src/HOL/Auth/Kerberos_BAN.thy
author paulson
Fri Sep 26 10:34:28 2003 +0200 (2003-09-26)
changeset 14207 f20fbb141673
parent 14200 d8598e24f8fa
child 16417 9bc16273c2d4
permissions -rw-r--r--
Conversion of all main protocols from "Shared" to "Public".
Removal of Key_supply_ax: modifications to possibility theorems.
Improved presentation.
paulson@5053
     1
(*  Title:      HOL/Auth/Kerberos_BAN
paulson@5053
     2
    ID:         $Id$
paulson@5053
     3
    Author:     Giampaolo Bella, Cambridge University Computer Laboratory
paulson@5053
     4
    Copyright   1998  University of Cambridge
paulson@5053
     5
paulson@13926
     6
Tidied and converted to Isar by lcp.
paulson@5053
     7
*)
paulson@5053
     8
paulson@14207
     9
header{*The Kerberos Protocol, BAN Version*}
paulson@14207
    10
paulson@14207
    11
theory Kerberos_BAN = Public:
paulson@5053
    12
paulson@14207
    13
text{*From page 251 of
paulson@14207
    14
  Burrows, Abadi and Needham (1989).  A Logic of Authentication.
paulson@14207
    15
  Proc. Royal Soc. 426
paulson@14207
    16
paulson@14207
    17
  Confidentiality (secrecy) and authentication properties rely on
paulson@14207
    18
  temporal checks: strong guarantees in a little abstracted - but
paulson@14207
    19
  very realistic - model.
paulson@14207
    20
*}
paulson@14207
    21
paulson@14207
    22
(* Temporal modelization: session keys can be leaked
paulson@5053
    23
                          ONLY when they have expired *)
paulson@5053
    24
paulson@5053
    25
syntax
paulson@13926
    26
    CT :: "event list=>nat"
paulson@13926
    27
    Expired :: "[nat, event list] => bool"
paulson@13926
    28
    RecentAuth :: "[nat, event list] => bool"
paulson@5053
    29
paulson@5053
    30
consts
paulson@5053
    31
paulson@5053
    32
    (*Duration of the session key*)
paulson@5053
    33
    SesKeyLife   :: nat
paulson@5053
    34
paulson@5053
    35
    (*Duration of the authenticator*)
paulson@5053
    36
    AutLife :: nat
paulson@5053
    37
paulson@14126
    38
text{*The ticket should remain fresh for two journeys on the network at least*}
paulson@14126
    39
specification (SesKeyLife)
paulson@14126
    40
  SesKeyLife_LB [iff]: "2 \<le> SesKeyLife"
paulson@14126
    41
    by blast
paulson@5053
    42
paulson@14126
    43
text{*The authenticator only for one journey*}
paulson@14126
    44
specification (AutLife)
paulson@14126
    45
  AutLife_LB [iff]:    "Suc 0 \<le> AutLife"
paulson@14126
    46
    by blast
paulson@14126
    47
paulson@5053
    48
paulson@5053
    49
translations
paulson@14207
    50
   "CT" == "length "
paulson@14207
    51
paulson@5053
    52
   "Expired T evs" == "SesKeyLife + T < CT evs"
paulson@5053
    53
paulson@14126
    54
   "RecentAuth T evs" == "CT evs \<le> AutLife + T"
paulson@5053
    55
paulson@13926
    56
consts  kerberos_ban   :: "event list set"
paulson@5053
    57
inductive "kerberos_ban"
paulson@14207
    58
 intros
paulson@13926
    59
paulson@13926
    60
   Nil:  "[] \<in> kerberos_ban"
paulson@13926
    61
paulson@13926
    62
   Fake: "[| evsf \<in> kerberos_ban;  X \<in> synth (analz (spies evsf)) |]
paulson@13926
    63
	  ==> Says Spy B X # evsf \<in> kerberos_ban"
paulson@13926
    64
paulson@13926
    65
paulson@13926
    66
   Kb1:  "[| evs1 \<in> kerberos_ban |]
paulson@13926
    67
	  ==> Says A Server {|Agent A, Agent B|} # evs1
paulson@13926
    68
		\<in>  kerberos_ban"
paulson@13926
    69
paulson@13926
    70
paulson@14207
    71
   Kb2:  "[| evs2 \<in> kerberos_ban;  Key KAB \<notin> used evs2;  KAB \<in> symKeys;
paulson@13926
    72
	     Says A' Server {|Agent A, Agent B|} \<in> set evs2 |]
paulson@14207
    73
	  ==> Says Server A
paulson@13926
    74
		(Crypt (shrK A)
paulson@14207
    75
		   {|Number (CT evs2), Agent B, Key KAB,
paulson@14207
    76
		    (Crypt (shrK B) {|Number (CT evs2), Agent A, Key KAB|})|})
paulson@13926
    77
		# evs2 \<in> kerberos_ban"
paulson@13926
    78
paulson@13926
    79
paulson@14207
    80
   Kb3:  "[| evs3 \<in> kerberos_ban;
paulson@14207
    81
	     Says S A (Crypt (shrK A) {|Number Ts, Agent B, Key K, X|})
paulson@13926
    82
	       \<in> set evs3;
paulson@13926
    83
	     Says A Server {|Agent A, Agent B|} \<in> set evs3;
paulson@13926
    84
	     ~ Expired Ts evs3 |]
paulson@14207
    85
	  ==> Says A B {|X, Crypt K {|Agent A, Number (CT evs3)|} |}
paulson@13926
    86
	       # evs3 \<in> kerberos_ban"
paulson@13926
    87
paulson@13926
    88
paulson@14207
    89
   Kb4:  "[| evs4 \<in> kerberos_ban;
paulson@14207
    90
	     Says A' B {|(Crypt (shrK B) {|Number Ts, Agent A, Key K|}),
paulson@13926
    91
			 (Crypt K {|Agent A, Number Ta|}) |}: set evs4;
paulson@13926
    92
	     ~ Expired Ts evs4;  RecentAuth Ta evs4 |]
paulson@13926
    93
	  ==> Says B A (Crypt K (Number Ta)) # evs4
paulson@13926
    94
		\<in> kerberos_ban"
paulson@5053
    95
paulson@13926
    96
	(*Old session keys may become compromised*)
paulson@14207
    97
   Oops: "[| evso \<in> kerberos_ban;
paulson@13926
    98
	     Says Server A (Crypt (shrK A) {|Number Ts, Agent B, Key K, X|})
paulson@13926
    99
	       \<in> set evso;
paulson@13926
   100
	     Expired Ts evso |]
paulson@13926
   101
	  ==> Notes Spy {|Number Ts, Key K|} # evso \<in> kerberos_ban"
paulson@13926
   102
paulson@13926
   103
paulson@14207
   104
declare Says_imp_knows_Spy [THEN parts.Inj, dest]
paulson@14200
   105
declare parts.Body [dest]
paulson@14200
   106
declare analz_into_parts [dest]
paulson@14200
   107
declare Fake_parts_insert_in_Un [dest]
paulson@13926
   108
paulson@14207
   109
text{*A "possibility property": there are traces that reach the end.*}
paulson@14207
   110
lemma "[|Key K \<notin> used []; K \<in> symKeys|]
paulson@14207
   111
       ==> \<exists>Timestamp. \<exists>evs \<in> kerberos_ban.
paulson@14207
   112
             Says B A (Crypt K (Number Timestamp))
paulson@13926
   113
                  \<in> set evs"
paulson@13926
   114
apply (cut_tac SesKeyLife_LB)
paulson@13926
   115
apply (intro exI bexI)
paulson@14207
   116
apply (rule_tac [2]
paulson@14207
   117
           kerberos_ban.Nil [THEN kerberos_ban.Kb1, THEN kerberos_ban.Kb2,
paulson@14200
   118
                             THEN kerberos_ban.Kb3, THEN kerberos_ban.Kb4])
paulson@14200
   119
apply (possibility, simp_all (no_asm_simp) add: used_Cons)
paulson@13926
   120
done
paulson@13926
   121
paulson@13926
   122
paulson@13926
   123
(**** Inductive proofs about kerberos_ban ****)
paulson@13926
   124
paulson@14207
   125
text{*Forwarding Lemma for reasoning about the encrypted portion of message Kb3*}
paulson@13926
   126
lemma Kb3_msg_in_parts_spies:
paulson@14207
   127
     "Says S A (Crypt KA {|Timestamp, B, K, X|}) \<in> set evs
paulson@13926
   128
      ==> X \<in> parts (spies evs)"
paulson@13926
   129
by blast
paulson@14207
   130
paulson@13926
   131
lemma Oops_parts_spies:
paulson@14207
   132
     "Says Server A (Crypt (shrK A) {|Timestamp, B, K, X|}) \<in> set evs
paulson@13926
   133
      ==> K \<in> parts (spies evs)"
paulson@13926
   134
by blast
paulson@13926
   135
paulson@13926
   136
paulson@14207
   137
text{*Spy never sees another agent's shared key! (unless it's bad at start)*}
paulson@13926
   138
lemma Spy_see_shrK [simp]:
paulson@13926
   139
     "evs \<in> kerberos_ban ==> (Key (shrK A) \<in> parts (spies evs)) = (A \<in> bad)"
paulson@14207
   140
apply (erule kerberos_ban.induct)
paulson@14207
   141
apply (frule_tac [7] Oops_parts_spies)
paulson@14207
   142
apply (frule_tac [5] Kb3_msg_in_parts_spies, simp_all, blast+)
paulson@13926
   143
done
paulson@5053
   144
paulson@5053
   145
paulson@13926
   146
lemma Spy_analz_shrK [simp]:
paulson@13926
   147
     "evs \<in> kerberos_ban ==> (Key (shrK A) \<in> analz (spies evs)) = (A \<in> bad)"
paulson@14207
   148
by auto
paulson@13926
   149
paulson@13926
   150
lemma Spy_see_shrK_D [dest!]:
paulson@14207
   151
     "[| Key (shrK A) \<in> parts (spies evs);
paulson@13926
   152
                evs \<in> kerberos_ban |] ==> A:bad"
paulson@14207
   153
by (blast dest: Spy_see_shrK)
paulson@13926
   154
paulson@13926
   155
lemmas Spy_analz_shrK_D = analz_subset_parts [THEN subsetD, THEN Spy_see_shrK_D,  dest!]
paulson@13926
   156
paulson@13926
   157
paulson@14207
   158
text{*Nobody can have used non-existent keys!*}
paulson@14207
   159
lemma new_keys_not_used [simp]:
paulson@14207
   160
    "[|Key K \<notin> used evs; K \<in> symKeys; evs \<in> kerberos_ban|]
paulson@14207
   161
     ==> K \<notin> keysFor (parts (spies evs))"
paulson@14207
   162
apply (erule rev_mp)
paulson@14207
   163
apply (erule kerberos_ban.induct)
paulson@14207
   164
apply (frule_tac [7] Oops_parts_spies)
paulson@14207
   165
apply (frule_tac [5] Kb3_msg_in_parts_spies, simp_all)
paulson@14207
   166
txt{*Fake*}
paulson@13926
   167
apply (force dest!: keysFor_parts_insert)
paulson@14207
   168
txt{*Kb2, Kb3, Kb4*}
paulson@14207
   169
apply (force dest!: analz_shrK_Decrypt)+
paulson@13926
   170
done
paulson@13926
   171
paulson@14207
   172
subsection{* Lemmas concerning the form of items passed in messages *}
paulson@13926
   173
paulson@14207
   174
text{*Describes the form of K, X and K' when the Server sends this message.*}
paulson@13926
   175
lemma Says_Server_message_form:
paulson@14207
   176
     "[| Says Server A (Crypt K' {|Number Ts, Agent B, Key K, X|})
paulson@14207
   177
         \<in> set evs; evs \<in> kerberos_ban |]
paulson@14207
   178
      ==> K \<notin> range shrK &
paulson@14207
   179
          X = (Crypt (shrK B) {|Number Ts, Agent A, Key K|}) &
paulson@13926
   180
          K' = shrK A"
paulson@13926
   181
apply (erule rev_mp)
paulson@13926
   182
apply (erule kerberos_ban.induct, auto)
paulson@13926
   183
done
paulson@5053
   184
paulson@5053
   185
paulson@14207
   186
text{*If the encrypted message appears then it originated with the Server
paulson@13926
   187
  PROVIDED that A is NOT compromised!
paulson@13926
   188
paulson@13926
   189
  This shows implicitly the FRESHNESS OF THE SESSION KEY to A
paulson@14207
   190
*}
paulson@13926
   191
lemma A_trusts_K_by_Kb2:
paulson@14207
   192
     "[| Crypt (shrK A) {|Number Ts, Agent B, Key K, X|}
paulson@14207
   193
           \<in> parts (spies evs);
paulson@14207
   194
         A \<notin> bad;  evs \<in> kerberos_ban |]
paulson@14207
   195
       ==> Says Server A (Crypt (shrK A) {|Number Ts, Agent B, Key K, X|})
paulson@13926
   196
             \<in> set evs"
paulson@13926
   197
apply (erule rev_mp)
paulson@14207
   198
apply (erule kerberos_ban.induct)
paulson@14207
   199
apply (frule_tac [7] Oops_parts_spies)
paulson@14207
   200
apply (frule_tac [5] Kb3_msg_in_parts_spies, simp_all, blast)
paulson@13926
   201
done
paulson@13926
   202
paulson@13926
   203
paulson@14207
   204
text{*If the TICKET appears then it originated with the Server*}
paulson@14207
   205
text{*FRESHNESS OF THE SESSION KEY to B*}
paulson@13926
   206
lemma B_trusts_K_by_Kb3:
paulson@14207
   207
     "[| Crypt (shrK B) {|Number Ts, Agent A, Key K|} \<in> parts (spies evs);
paulson@14207
   208
         B \<notin> bad;  evs \<in> kerberos_ban |]
paulson@14207
   209
       ==> Says Server A
paulson@14207
   210
            (Crypt (shrK A) {|Number Ts, Agent B, Key K,
paulson@14207
   211
                          Crypt (shrK B) {|Number Ts, Agent A, Key K|}|})
paulson@13926
   212
           \<in> set evs"
paulson@13926
   213
apply (erule rev_mp)
paulson@14207
   214
apply (erule kerberos_ban.induct)
paulson@14207
   215
apply (frule_tac [7] Oops_parts_spies)
paulson@14207
   216
apply (frule_tac [5] Kb3_msg_in_parts_spies, simp_all, blast)
paulson@13926
   217
done
paulson@13926
   218
paulson@13926
   219
paulson@14207
   220
text{*EITHER describes the form of X when the following message is sent,
paulson@13926
   221
  OR     reduces it to the Fake case.
paulson@14207
   222
  Use @{text Says_Server_message_form} if applicable.*}
paulson@13926
   223
lemma Says_S_message_form:
paulson@14207
   224
     "[| Says S A (Crypt (shrK A) {|Number Ts, Agent B, Key K, X|})
paulson@14207
   225
            \<in> set evs;
paulson@14207
   226
         evs \<in> kerberos_ban |]
paulson@14207
   227
 ==> (K \<notin> range shrK & X = (Crypt (shrK B) {|Number Ts, Agent A, Key K|}))
paulson@13926
   228
          | X \<in> analz (spies evs)"
paulson@13926
   229
apply (case_tac "A \<in> bad")
paulson@13926
   230
apply (force dest!: Says_imp_spies [THEN analz.Inj])
paulson@13926
   231
apply (frule Says_imp_spies [THEN parts.Inj])
paulson@13926
   232
apply (blast dest!: A_trusts_K_by_Kb2 Says_Server_message_form)
paulson@13926
   233
done
paulson@13926
   234
paulson@5053
   235
paulson@5053
   236
paulson@13926
   237
(****
paulson@13926
   238
 The following is to prove theorems of the form
paulson@13926
   239
paulson@13926
   240
  Key K \<in> analz (insert (Key KAB) (spies evs)) ==>
paulson@13926
   241
  Key K \<in> analz (spies evs)
paulson@13926
   242
paulson@13926
   243
 A more general formula must be proved inductively.
paulson@13926
   244
paulson@13926
   245
****)
paulson@13926
   246
paulson@14207
   247
text{* Session keys are not used to encrypt other session keys *}
paulson@13926
   248
lemma analz_image_freshK [rule_format (no_asm)]:
paulson@14207
   249
     "evs \<in> kerberos_ban ==>
paulson@14207
   250
   \<forall>K KK. KK \<subseteq> - (range shrK) -->
paulson@14207
   251
          (Key K \<in> analz (Key`KK Un (spies evs))) =
paulson@13926
   252
          (K \<in> KK | Key K \<in> analz (spies evs))"
paulson@13926
   253
apply (erule kerberos_ban.induct)
paulson@13926
   254
apply (drule_tac [7] Says_Server_message_form)
paulson@14207
   255
apply (erule_tac [5] Says_S_message_form [THEN disjE], analz_freshK, spy_analz, auto) 
paulson@13926
   256
done
paulson@13926
   257
paulson@13926
   258
paulson@13926
   259
lemma analz_insert_freshK:
paulson@14207
   260
     "[| evs \<in> kerberos_ban;  KAB \<notin> range shrK |] ==>
paulson@14207
   261
      (Key K \<in> analz (insert (Key KAB) (spies evs))) =
paulson@13926
   262
      (K = KAB | Key K \<in> analz (spies evs))"
paulson@13926
   263
by (simp only: analz_image_freshK analz_image_freshK_simps)
paulson@13926
   264
paulson@13926
   265
paulson@14207
   266
text{* The session key K uniquely identifies the message *}
paulson@13926
   267
lemma unique_session_keys:
paulson@14207
   268
     "[| Says Server A
paulson@14207
   269
           (Crypt (shrK A) {|Number Ts, Agent B, Key K, X|}) \<in> set evs;
paulson@14207
   270
         Says Server A'
paulson@14207
   271
          (Crypt (shrK A') {|Number Ts', Agent B', Key K, X'|}) \<in> set evs;
paulson@13926
   272
         evs \<in> kerberos_ban |] ==> A=A' & Ts=Ts' & B=B' & X = X'"
paulson@13926
   273
apply (erule rev_mp)
paulson@13926
   274
apply (erule rev_mp)
paulson@14207
   275
apply (erule kerberos_ban.induct)
paulson@14207
   276
apply (frule_tac [7] Oops_parts_spies)
paulson@14207
   277
apply (frule_tac [5] Kb3_msg_in_parts_spies, simp_all)
paulson@14207
   278
txt{*Kb2: it can't be a new key*}
paulson@13926
   279
apply blast
paulson@13926
   280
done
paulson@13926
   281
paulson@13926
   282
paulson@14207
   283
text{* Lemma: the session key sent in msg Kb2 would be EXPIRED
paulson@14207
   284
    if the spy could see it! *}
paulson@13926
   285
paulson@13926
   286
lemma lemma2 [rule_format (no_asm)]:
paulson@14207
   287
     "[| A \<notin> bad;  B \<notin> bad;  evs \<in> kerberos_ban |]
paulson@14207
   288
  ==> Says Server A
paulson@14207
   289
          (Crypt (shrK A) {|Number Ts, Agent B, Key K,
paulson@14207
   290
                            Crypt (shrK B) {|Number Ts, Agent A, Key K|}|})
paulson@14207
   291
         \<in> set evs -->
paulson@13926
   292
      Key K \<in> analz (spies evs) --> Expired Ts evs"
paulson@13926
   293
apply (erule kerberos_ban.induct)
paulson@13926
   294
apply (frule_tac [7] Says_Server_message_form)
paulson@13926
   295
apply (frule_tac [5] Says_S_message_form [THEN disjE])
paulson@13926
   296
apply (simp_all (no_asm_simp) add: less_SucI analz_insert_eq analz_insert_freshK pushes)
paulson@13926
   297
txt{*Fake*}
paulson@13926
   298
apply spy_analz
paulson@13926
   299
txt{*Kb2*}
paulson@13926
   300
apply (blast intro: parts_insertI less_SucI)
paulson@13926
   301
txt{*Kb3*}
paulson@13926
   302
apply (case_tac "Aa \<in> bad")
paulson@13926
   303
 prefer 2 apply (blast dest: A_trusts_K_by_Kb2 unique_session_keys)
paulson@13926
   304
apply (blast dest: Says_imp_spies [THEN analz.Inj] Crypt_Spy_analz_bad elim!: MPair_analz intro: less_SucI)
paulson@13926
   305
txt{*Oops: PROOF FAILED if addIs below*}
paulson@13926
   306
apply (blast dest: unique_session_keys intro!: less_SucI)
paulson@13926
   307
done
paulson@5053
   308
paulson@5053
   309
paulson@14207
   310
text{*Confidentiality for the Server: Spy does not see the keys sent in msg Kb2
paulson@14207
   311
as long as they have not expired.*}
paulson@13926
   312
lemma Confidentiality_S:
paulson@14207
   313
     "[| Says Server A
paulson@14207
   314
          (Crypt K' {|Number T, Agent B, Key K, X|}) \<in> set evs;
paulson@14207
   315
         ~ Expired T evs;
paulson@14207
   316
         A \<notin> bad;  B \<notin> bad;  evs \<in> kerberos_ban
paulson@13926
   317
      |] ==> Key K \<notin> analz (spies evs)"
paulson@13926
   318
apply (frule Says_Server_message_form, assumption)
paulson@13926
   319
apply (blast intro: lemma2)
paulson@13926
   320
done
paulson@13926
   321
paulson@14207
   322
(**** THE COUNTERPART OF CONFIDENTIALITY
paulson@13926
   323
      [|...; Expired Ts evs; ...|] ==> Key K \<in> analz (spies evs)
paulson@13926
   324
      WOULD HOLD ONLY IF AN OOPS OCCURRED! ---> Nothing to prove!   ****)
paulson@13926
   325
paulson@13926
   326
paulson@14207
   327
text{*Confidentiality for Alice*}
paulson@13926
   328
lemma Confidentiality_A:
paulson@14207
   329
     "[| Crypt (shrK A) {|Number T, Agent B, Key K, X|} \<in> parts (spies evs);
paulson@14207
   330
         ~ Expired T evs;
paulson@14207
   331
         A \<notin> bad;  B \<notin> bad;  evs \<in> kerberos_ban
paulson@13926
   332
      |] ==> Key K \<notin> analz (spies evs)"
paulson@14207
   333
by (blast dest!: A_trusts_K_by_Kb2 Confidentiality_S)
paulson@13926
   334
paulson@13926
   335
paulson@14207
   336
text{*Confidentiality for Bob*}
paulson@13926
   337
lemma Confidentiality_B:
paulson@14207
   338
     "[| Crypt (shrK B) {|Number Tk, Agent A, Key K|}
paulson@14207
   339
          \<in> parts (spies evs);
paulson@14207
   340
        ~ Expired Tk evs;
paulson@14207
   341
        A \<notin> bad;  B \<notin> bad;  evs \<in> kerberos_ban
paulson@13926
   342
      |] ==> Key K \<notin> analz (spies evs)"
paulson@14207
   343
by (blast dest!: B_trusts_K_by_Kb3 Confidentiality_S)
paulson@13926
   344
paulson@5053
   345
paulson@13926
   346
lemma lemma_B [rule_format]:
paulson@14207
   347
     "[| B \<notin> bad;  evs \<in> kerberos_ban |]
paulson@14207
   348
      ==> Key K \<notin> analz (spies evs) -->
paulson@14207
   349
          Says Server A (Crypt (shrK A) {|Number Ts, Agent B, Key K, X|})
paulson@14207
   350
          \<in> set evs -->
paulson@14207
   351
          Crypt K (Number Ta) \<in> parts (spies evs) -->
paulson@13926
   352
          Says B A (Crypt K (Number Ta)) \<in> set evs"
paulson@13926
   353
apply (erule kerberos_ban.induct)
paulson@13926
   354
apply (frule_tac [7] Oops_parts_spies)
paulson@13926
   355
apply (frule_tac [5] Says_S_message_form)
paulson@13926
   356
apply (drule_tac [6] Kb3_msg_in_parts_spies, analz_mono_contra)
paulson@13926
   357
apply (simp_all (no_asm_simp) add: all_conj_distrib)
paulson@13926
   358
txt{*Fake*}
paulson@13926
   359
apply blast
paulson@14207
   360
txt{*Kb2*} 
paulson@14207
   361
apply (force dest: Crypt_imp_invKey_keysFor)
paulson@13926
   362
txt{*Kb4*}
paulson@14207
   363
apply (blast dest: B_trusts_K_by_Kb3 unique_session_keys
paulson@13926
   364
                   Says_imp_spies [THEN analz.Inj] Crypt_Spy_analz_bad)
paulson@13926
   365
done
paulson@13926
   366
paulson@13926
   367
paulson@14207
   368
text{*Authentication of B to A*}
paulson@13926
   369
lemma Authentication_B:
paulson@14207
   370
     "[| Crypt K (Number Ta) \<in> parts (spies evs);
paulson@14207
   371
         Crypt (shrK A) {|Number Ts, Agent B, Key K, X|}
paulson@14207
   372
         \<in> parts (spies evs);
paulson@14207
   373
         ~ Expired Ts evs;
paulson@14207
   374
         A \<notin> bad;  B \<notin> bad;  evs \<in> kerberos_ban |]
paulson@13926
   375
      ==> Says B A (Crypt K (Number Ta)) \<in> set evs"
paulson@13926
   376
by (blast dest!: A_trusts_K_by_Kb2
paulson@13926
   377
          intro!: lemma_B elim!: Confidentiality_S [THEN [2] rev_notE])
paulson@13926
   378
paulson@13926
   379
lemma lemma_A [rule_format]:
paulson@14207
   380
     "[| A \<notin> bad; B \<notin> bad; evs \<in> kerberos_ban |]
paulson@14207
   381
      ==>
paulson@14207
   382
         Key K \<notin> analz (spies evs) -->
paulson@14207
   383
         Says Server A (Crypt (shrK A) {|Number Ts, Agent B, Key K, X|})
paulson@14207
   384
         \<in> set evs -->
paulson@14207
   385
          Crypt K {|Agent A, Number Ta|} \<in> parts (spies evs) -->
paulson@14207
   386
         Says A B {|X, Crypt K {|Agent A, Number Ta|}|}
paulson@13926
   387
             \<in> set evs"
paulson@13926
   388
apply (erule kerberos_ban.induct)
paulson@13926
   389
apply (frule_tac [7] Oops_parts_spies)
paulson@13926
   390
apply (frule_tac [5] Says_S_message_form)
paulson@13926
   391
apply (frule_tac [6] Kb3_msg_in_parts_spies, analz_mono_contra)
paulson@13926
   392
apply (simp_all (no_asm_simp) add: all_conj_distrib)
paulson@13926
   393
txt{*Fake*}
paulson@13926
   394
apply blast
paulson@13926
   395
txt{*Kb2*}
paulson@14207
   396
apply (force dest: Crypt_imp_invKey_keysFor)
paulson@13926
   397
txt{*Kb3*}
paulson@13926
   398
apply (blast dest: A_trusts_K_by_Kb2 unique_session_keys)
paulson@13926
   399
done
paulson@13926
   400
paulson@14207
   401
text{*Authentication of A to B*}
paulson@13926
   402
lemma Authentication_A:
paulson@14207
   403
     "[| Crypt K {|Agent A, Number Ta|} \<in> parts (spies evs);
paulson@14207
   404
         Crypt (shrK B) {|Number Ts, Agent A, Key K|}
paulson@14207
   405
         \<in> parts (spies evs);
paulson@14207
   406
         ~ Expired Ts evs;
paulson@14207
   407
         A \<notin> bad;  B \<notin> bad;  evs \<in> kerberos_ban |]
paulson@14207
   408
      ==> Says A B {|Crypt (shrK B) {|Number Ts, Agent A, Key K|},
paulson@13926
   409
                     Crypt K {|Agent A, Number Ta|}|} \<in> set evs"
paulson@13926
   410
by (blast dest!: B_trusts_K_by_Kb3
paulson@14207
   411
          intro!: lemma_A
paulson@13926
   412
          elim!: Confidentiality_S [THEN [2] rev_notE])
paulson@5053
   413
paulson@5053
   414
end