src/HOL/Auth/Yahalom2.ML
author paulson
Thu Dec 19 11:58:39 1996 +0100 (1996-12-19)
changeset 2451 ce85a2aafc7a
parent 2377 ad9d2dedaeaa
child 2516 4d68fbe6378b
permissions -rw-r--r--
Extensive tidying and simplification, largely stemming from
changing newN and newK to take an integer argument
paulson@2111
     1
(*  Title:      HOL/Auth/Yahalom2
paulson@2111
     2
    ID:         $Id$
paulson@2111
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
paulson@2111
     4
    Copyright   1996  University of Cambridge
paulson@2111
     5
paulson@2111
     6
Inductive relation "yahalom" for the Yahalom protocol, Variant 2.
paulson@2111
     7
paulson@2111
     8
This version trades encryption of NB for additional explicitness in YM3.
paulson@2111
     9
paulson@2111
    10
From page 259 of
paulson@2111
    11
  Burrows, Abadi and Needham.  A Logic of Authentication.
paulson@2111
    12
  Proc. Royal Soc. 426 (1989)
paulson@2111
    13
*)
paulson@2111
    14
paulson@2111
    15
open Yahalom2;
paulson@2111
    16
paulson@2111
    17
proof_timing:=true;
paulson@2111
    18
HOL_quantifiers := false;
paulson@2111
    19
paulson@2111
    20
paulson@2323
    21
(*A "possibility property": there are traces that reach the end*)
paulson@2111
    22
goal thy 
paulson@2111
    23
 "!!A B. [| A ~= B; A ~= Server; B ~= Server |]   \
paulson@2111
    24
\        ==> EX X NB K. EX evs: yahalom lost.          \
paulson@2284
    25
\               Says A B {|X, Crypt K (Nonce NB)|} : set_of_list evs";
paulson@2111
    26
by (REPEAT (resolve_tac [exI,bexI] 1));
paulson@2111
    27
by (rtac (yahalom.Nil RS yahalom.YM1 RS yahalom.YM2 RS yahalom.YM3 RS yahalom.YM4) 2);
paulson@2111
    28
by (ALLGOALS (simp_tac (!simpset setsolver safe_solver)));
paulson@2111
    29
by (ALLGOALS Fast_tac);
paulson@2111
    30
result();
paulson@2111
    31
paulson@2111
    32
paulson@2111
    33
(**** Inductive proofs about yahalom ****)
paulson@2111
    34
paulson@2111
    35
(*Monotonicity*)
paulson@2111
    36
goal thy "!!evs. lost' <= lost ==> yahalom lost' <= yahalom lost";
paulson@2111
    37
by (rtac subsetI 1);
paulson@2111
    38
by (etac yahalom.induct 1);
paulson@2111
    39
by (REPEAT_FIRST
paulson@2111
    40
    (best_tac (!claset addIs (impOfSubs (sees_mono RS analz_mono RS synth_mono)
paulson@2111
    41
                              :: yahalom.intrs))));
paulson@2111
    42
qed "yahalom_mono";
paulson@2111
    43
paulson@2111
    44
paulson@2111
    45
(*Nobody sends themselves messages*)
paulson@2111
    46
goal thy "!!evs. evs: yahalom lost ==> ALL A X. Says A A X ~: set_of_list evs";
paulson@2111
    47
by (etac yahalom.induct 1);
paulson@2111
    48
by (Auto_tac());
paulson@2111
    49
qed_spec_mp "not_Says_to_self";
paulson@2111
    50
Addsimps [not_Says_to_self];
paulson@2111
    51
AddSEs   [not_Says_to_self RSN (2, rev_notE)];
paulson@2111
    52
paulson@2111
    53
paulson@2111
    54
(** For reasoning about the encrypted portion of messages **)
paulson@2111
    55
paulson@2111
    56
(*Lets us treat YM4 using a similar argument as for the Fake case.*)
paulson@2284
    57
goal thy "!!evs. Says S A {|NB, Crypt (shrK A) Y, X|} : set_of_list evs ==> \
paulson@2111
    58
\                X : analz (sees lost Spy evs)";
paulson@2111
    59
by (fast_tac (!claset addSDs [Says_imp_sees_Spy RS analz.Inj]) 1);
paulson@2111
    60
qed "YM4_analz_sees_Spy";
paulson@2111
    61
paulson@2111
    62
bind_thm ("YM4_parts_sees_Spy",
paulson@2111
    63
          YM4_analz_sees_Spy RS (impOfSubs analz_subset_parts));
paulson@2111
    64
paulson@2155
    65
(*Relates to both YM4 and Oops*)
paulson@2284
    66
goal thy "!!evs. Says S A {|NB, Crypt (shrK A) {|B, K, NA|}, X|} \
paulson@2111
    67
\                  : set_of_list evs ==> \
paulson@2111
    68
\                K : parts (sees lost Spy evs)";
paulson@2111
    69
by (fast_tac (!claset addSEs partsEs
paulson@2111
    70
                      addSDs [Says_imp_sees_Spy RS parts.Inj]) 1);
paulson@2111
    71
qed "YM4_Key_parts_sees_Spy";
paulson@2111
    72
paulson@2111
    73
(*We instantiate the variable to "lost".  Leaving it as a Var makes proofs
paulson@2111
    74
  harder: the simplifier does less.*)
paulson@2111
    75
val parts_Fake_tac = 
paulson@2111
    76
    forw_inst_tac [("lost","lost")] YM4_parts_sees_Spy 6 THEN
paulson@2111
    77
    forw_inst_tac [("lost","lost")] YM4_Key_parts_sees_Spy 7;
paulson@2111
    78
paulson@2111
    79
(*For proving the easier theorems about X ~: parts (sees lost Spy evs) *)
paulson@2111
    80
fun parts_induct_tac i = SELECT_GOAL
paulson@2111
    81
    (DETERM (etac yahalom.induct 1 THEN parts_Fake_tac THEN
paulson@2170
    82
             (*Fake message*)
paulson@2170
    83
             TRY (best_tac (!claset addDs [impOfSubs analz_subset_parts,
paulson@2170
    84
                                           impOfSubs Fake_parts_insert]
paulson@2111
    85
                                    addss (!simpset)) 2)) THEN
paulson@2111
    86
     (*Base case*)
paulson@2111
    87
     fast_tac (!claset addss (!simpset)) 1 THEN
paulson@2111
    88
     ALLGOALS Asm_simp_tac) i;
paulson@2111
    89
paulson@2111
    90
paulson@2111
    91
(** Theorems of the form X ~: parts (sees lost Spy evs) imply that NOBODY
paulson@2111
    92
    sends messages containing X! **)
paulson@2111
    93
paulson@2111
    94
(*Spy never sees another agent's shared key! (unless it is leaked at start)*)
paulson@2111
    95
goal thy 
paulson@2111
    96
 "!!evs. [| evs : yahalom lost;  A ~: lost |]    \
paulson@2111
    97
\        ==> Key (shrK A) ~: parts (sees lost Spy evs)";
paulson@2111
    98
by (parts_induct_tac 1);
paulson@2111
    99
by (Auto_tac());
paulson@2111
   100
qed "Spy_not_see_shrK";
paulson@2111
   101
paulson@2111
   102
bind_thm ("Spy_not_analz_shrK",
paulson@2111
   103
          [analz_subset_parts, Spy_not_see_shrK] MRS contra_subsetD);
paulson@2111
   104
paulson@2111
   105
Addsimps [Spy_not_see_shrK, Spy_not_analz_shrK];
paulson@2111
   106
paulson@2111
   107
(*We go to some trouble to preserve R in the 3rd and 4th subgoals
paulson@2111
   108
  As usual fast_tac cannot be used because it uses the equalities too soon*)
paulson@2111
   109
val major::prems = 
paulson@2111
   110
goal thy  "[| Key (shrK A) : parts (sees lost Spy evs);       \
paulson@2111
   111
\             evs : yahalom lost;                               \
paulson@2111
   112
\             A:lost ==> R                                  \
paulson@2111
   113
\           |] ==> R";
paulson@2111
   114
by (rtac ccontr 1);
paulson@2111
   115
by (rtac ([major, Spy_not_see_shrK] MRS rev_notE) 1);
paulson@2111
   116
by (swap_res_tac prems 2);
paulson@2111
   117
by (ALLGOALS (fast_tac (!claset addIs prems)));
paulson@2111
   118
qed "Spy_see_shrK_E";
paulson@2111
   119
paulson@2111
   120
bind_thm ("Spy_analz_shrK_E", 
paulson@2111
   121
          analz_subset_parts RS subsetD RS Spy_see_shrK_E);
paulson@2111
   122
paulson@2111
   123
AddSEs [Spy_see_shrK_E, Spy_analz_shrK_E];
paulson@2111
   124
paulson@2111
   125
paulson@2111
   126
(*** Future keys can't be seen or used! ***)
paulson@2111
   127
paulson@2160
   128
(*Nobody can have SEEN keys that will be generated in the future. *)
paulson@2451
   129
goal thy "!!i. evs : yahalom lost ==> \
paulson@2451
   130
\              length evs <= i --> Key(newK i) ~: parts (sees lost Spy evs)";
paulson@2111
   131
by (parts_induct_tac 1);
paulson@2264
   132
by (REPEAT_FIRST (best_tac (!claset addEs [leD RS notE]
paulson@2264
   133
				    addDs [impOfSubs analz_subset_parts,
paulson@2111
   134
                                           impOfSubs parts_insert_subset_Un,
paulson@2111
   135
                                           Suc_leD]
paulson@2111
   136
                                    addss (!simpset))));
paulson@2160
   137
qed_spec_mp "new_keys_not_seen";
paulson@2111
   138
Addsimps [new_keys_not_seen];
paulson@2111
   139
paulson@2160
   140
(*Variant: old messages must contain old keys!*)
paulson@2111
   141
goal thy 
paulson@2111
   142
 "!!evs. [| Says A B X : set_of_list evs;  \
paulson@2451
   143
\           Key (newK i) : parts {X};    \
paulson@2111
   144
\           evs : yahalom lost                 \
paulson@2451
   145
\        |] ==> i < length evs";
paulson@2111
   146
by (rtac ccontr 1);
paulson@2111
   147
by (dtac leI 1);
paulson@2111
   148
by (fast_tac (!claset addSDs [new_keys_not_seen, Says_imp_sees_Spy]
paulson@2111
   149
                      addIs  [impOfSubs parts_mono]) 1);
paulson@2111
   150
qed "Says_imp_old_keys";
paulson@2111
   151
paulson@2111
   152
paulson@2111
   153
(*Nobody can have USED keys that will be generated in the future.
paulson@2111
   154
  ...very like new_keys_not_seen*)
paulson@2451
   155
goal thy "!!i. evs : yahalom lost ==> \
paulson@2451
   156
\             length evs <= i --> newK i ~: keysFor(parts(sees lost Spy evs))";
paulson@2111
   157
by (parts_induct_tac 1);
paulson@2170
   158
by (dtac YM4_Key_parts_sees_Spy 5);
paulson@2111
   159
(*YM1, YM2 and YM3*)
paulson@2111
   160
by (EVERY (map (fast_tac (!claset addDs [Suc_leD] addss (!simpset))) [4,3,2]));
paulson@2160
   161
(*Fake and Oops: these messages send unknown (X) components*)
paulson@2160
   162
by (EVERY
paulson@2160
   163
    (map (fast_tac
paulson@2170
   164
          (!claset addDs [impOfSubs analz_subset_parts,
paulson@2170
   165
                          impOfSubs (analz_subset_parts RS keysFor_mono),
paulson@2170
   166
                          impOfSubs (parts_insert_subset_Un RS keysFor_mono),
paulson@2170
   167
                          Suc_leD]
paulson@2160
   168
                   addss (!simpset))) [3,1]));
paulson@2160
   169
(*YM4: if K was used then it had been seen, contradicting new_keys_not_seen*)
paulson@2160
   170
by (fast_tac
paulson@2160
   171
      (!claset addSEs partsEs
paulson@2160
   172
               addSDs [Says_imp_sees_Spy RS parts.Inj]
paulson@2111
   173
               addEs [new_keys_not_seen RSN(2,rev_notE)]
paulson@2160
   174
               addDs [Suc_leD]) 1);
paulson@2160
   175
qed_spec_mp "new_keys_not_used";
paulson@2111
   176
paulson@2111
   177
bind_thm ("new_keys_not_analzd",
paulson@2111
   178
          [analz_subset_parts RS keysFor_mono,
paulson@2111
   179
           new_keys_not_used] MRS contra_subsetD);
paulson@2111
   180
paulson@2111
   181
Addsimps [new_keys_not_used, new_keys_not_analzd];
paulson@2111
   182
paulson@2111
   183
paulson@2155
   184
(*Describes the form of K when the Server sends this message.  Useful for
paulson@2155
   185
  Oops as well as main secrecy property.*)
paulson@2111
   186
goal thy 
paulson@2284
   187
 "!!evs. [| Says Server A {|NB', Crypt (shrK A) {|Agent B, K, NA|}, X|} \
paulson@2155
   188
\            : set_of_list evs;                                         \
paulson@2155
   189
\           evs : yahalom lost |]                                       \
paulson@2451
   190
\        ==> (EX i. K = Key(newK i)) & A ~= B";
paulson@2155
   191
by (etac rev_mp 1);
paulson@2155
   192
by (etac yahalom.induct 1);
paulson@2155
   193
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
paulson@2155
   194
qed "Says_Server_message_form";
paulson@2111
   195
paulson@2111
   196
paulson@2111
   197
(*For proofs involving analz.  We again instantiate the variable to "lost".*)
paulson@2111
   198
val analz_Fake_tac = 
paulson@2111
   199
    dres_inst_tac [("lost","lost")] YM4_analz_sees_Spy 6 THEN
paulson@2155
   200
    forw_inst_tac [("lost","lost")] Says_Server_message_form 7 THEN
paulson@2155
   201
    assume_tac 7 THEN Full_simp_tac 7 THEN
paulson@2451
   202
    REPEAT ((eresolve_tac [exE,conjE] ORELSE' hyp_subst_tac) 7);
paulson@2111
   203
paulson@2111
   204
paulson@2111
   205
(****
paulson@2111
   206
 The following is to prove theorems of the form
paulson@2111
   207
paulson@2451
   208
          Key K : analz (insert (Key (newK i)) (sees lost Spy evs)) ==>
paulson@2111
   209
          Key K : analz (sees lost Spy evs)
paulson@2111
   210
paulson@2111
   211
 A more general formula must be proved inductively.
paulson@2111
   212
paulson@2111
   213
****)
paulson@2111
   214
paulson@2111
   215
(** Session keys are not used to encrypt other session keys **)
paulson@2111
   216
paulson@2111
   217
goal thy  
paulson@2111
   218
 "!!evs. evs : yahalom lost ==> \
paulson@2111
   219
\  ALL K E. (Key K : analz (Key``(newK``E) Un (sees lost Spy evs))) = \
paulson@2111
   220
\           (K : newK``E | Key K : analz (sees lost Spy evs))";
paulson@2111
   221
by (etac yahalom.induct 1);
paulson@2111
   222
by analz_Fake_tac;
paulson@2111
   223
by (REPEAT_FIRST (resolve_tac [allI, analz_image_newK_lemma]));
paulson@2451
   224
by (ALLGOALS (*Takes 11 secs*)
paulson@2111
   225
    (asm_simp_tac 
paulson@2451
   226
     (!simpset addsimps [Un_assoc RS sym, 
paulson@2451
   227
			 insert_Key_singleton, insert_Key_image, pushKey_newK]
paulson@2111
   228
               setloop split_tac [expand_if])));
paulson@2155
   229
(*YM4, Fake*) 
paulson@2155
   230
by (EVERY (map spy_analz_tac [4, 2]));
paulson@2155
   231
(*Oops, YM3, Base*)
paulson@2111
   232
by (REPEAT (fast_tac (!claset addIs [image_eqI] addss (!simpset)) 1));
paulson@2111
   233
qed_spec_mp "analz_image_newK";
paulson@2111
   234
paulson@2111
   235
goal thy
paulson@2111
   236
 "!!evs. evs : yahalom lost ==>                               \
paulson@2451
   237
\        Key K : analz (insert (Key (newK i)) (sees lost Spy evs)) = \
paulson@2451
   238
\        (K = newK i | Key K : analz (sees lost Spy evs))";
paulson@2111
   239
by (asm_simp_tac (HOL_ss addsimps [pushKey_newK, analz_image_newK, 
paulson@2111
   240
                                   insert_Key_singleton]) 1);
paulson@2111
   241
by (Fast_tac 1);
paulson@2111
   242
qed "analz_insert_Key_newK";
paulson@2111
   243
paulson@2111
   244
paulson@2111
   245
(*** The Key K uniquely identifies the Server's  message. **)
paulson@2111
   246
paulson@2111
   247
goal thy 
paulson@2111
   248
 "!!evs. evs : yahalom lost ==>                                     \
paulson@2155
   249
\      EX A' B' NA' NB' X'. ALL A B NA NB X.                        \
paulson@2111
   250
\          Says Server A                                            \
paulson@2284
   251
\           {|NB, Crypt (shrK A) {|Agent B, Key K, NA|}, X|}        \
paulson@2155
   252
\          : set_of_list evs --> A=A' & B=B' & NA=NA' & NB=NB' & X=X'";
paulson@2111
   253
by (etac yahalom.induct 1);
paulson@2111
   254
by (ALLGOALS (asm_simp_tac (!simpset addsimps [all_conj_distrib])));
paulson@2111
   255
by (Step_tac 1);
paulson@2111
   256
(*Remaining case: YM3*)
paulson@2111
   257
by (expand_case_tac "K = ?y" 1);
paulson@2111
   258
by (REPEAT (ares_tac [refl,exI,impI,conjI] 2));
paulson@2111
   259
(*...we assume X is a very new message, and handle this case by contradiction*)
paulson@2111
   260
by (fast_tac (!claset addEs [Says_imp_old_keys RS less_irrefl]
paulson@2111
   261
                      delrules [conjI]    (*prevent split-up into 4 subgoals*)
paulson@2111
   262
                      addss (!simpset addsimps [parts_insertI])) 1);
paulson@2111
   263
val lemma = result();
paulson@2111
   264
paulson@2111
   265
goal thy 
paulson@2111
   266
"!!evs. [| Says Server A                                            \
paulson@2284
   267
\           {|NB, Crypt (shrK A) {|Agent B, Key K, NA|}, X|}        \
paulson@2111
   268
\           : set_of_list evs;                                      \
paulson@2111
   269
\          Says Server A'                                           \
paulson@2284
   270
\           {|NB', Crypt (shrK A') {|Agent B', Key K, NA'|}, X'|}   \
paulson@2111
   271
\           : set_of_list evs;                                      \
paulson@2111
   272
\          evs : yahalom lost |]                                    \
paulson@2111
   273
\       ==> A=A' & B=B' & NA=NA' & NB=NB'";
paulson@2451
   274
by (prove_unique_tac lemma 1);
paulson@2111
   275
qed "unique_session_keys";
paulson@2111
   276
paulson@2111
   277
paulson@2111
   278
(** Crucial secrecy property: Spy does not see the keys sent in msg YM3 **)
paulson@2111
   279
paulson@2111
   280
goal thy 
paulson@2155
   281
 "!!evs. [| A ~: lost;  B ~: lost;  A ~= B;                          \
paulson@2155
   282
\           evs : yahalom lost |]            \
paulson@2111
   283
\        ==> Says Server A                                           \
paulson@2284
   284
\              {|NB, Crypt (shrK A) {|Agent B, Key K, NA|},           \
paulson@2284
   285
\                    Crypt (shrK B) {|NB, Key K, Agent A|}|}          \
paulson@2111
   286
\             : set_of_list evs -->                               \
paulson@2155
   287
\            Says A Spy {|NA, NB, Key K|} ~: set_of_list evs -->  \
paulson@2111
   288
\            Key K ~: analz (sees lost Spy evs)";
paulson@2111
   289
by (etac yahalom.induct 1);
paulson@2111
   290
by analz_Fake_tac;
paulson@2111
   291
by (ALLGOALS
paulson@2111
   292
    (asm_simp_tac 
paulson@2451
   293
     (!simpset addsimps [not_parts_not_analz, analz_insert_Key_newK]
paulson@2111
   294
               setloop split_tac [expand_if])));
paulson@2111
   295
(*YM3*)
paulson@2111
   296
by (fast_tac (!claset addIs [parts_insertI]
paulson@2111
   297
                      addEs [Says_imp_old_keys RS less_irrefl]
paulson@2111
   298
                      addss (!simpset)) 2);
paulson@2155
   299
(*OR4, Fake*) 
paulson@2377
   300
by (REPEAT_FIRST spy_analz_tac);
paulson@2155
   301
(*Oops*)
paulson@2111
   302
by (fast_tac (!claset delrules [disjE] 
paulson@2170
   303
                      addDs [unique_session_keys]
paulson@2170
   304
                      addss (!simpset)) 1);
paulson@2111
   305
val lemma = result() RS mp RS mp RSN(2,rev_notE);
paulson@2111
   306
paulson@2111
   307
paulson@2111
   308
(*Final version: Server's message in the most abstract form*)
paulson@2111
   309
goal thy 
paulson@2111
   310
 "!!evs. [| Says Server A                                         \
paulson@2284
   311
\              {|NB, Crypt (shrK A) {|Agent B, K, NA|},           \
paulson@2284
   312
\                    Crypt (shrK B) {|NB, K, Agent A|}|}          \
paulson@2111
   313
\           : set_of_list evs;                                    \
paulson@2155
   314
\           Says A Spy {|NA, NB, K|} ~: set_of_list evs;          \
paulson@2155
   315
\           A ~: lost;  B ~: lost;  evs : yahalom lost |]         \
paulson@2155
   316
\        ==> K ~: analz (sees lost Spy evs)";
paulson@2111
   317
by (forward_tac [Says_Server_message_form] 1 THEN assume_tac 1);
paulson@2111
   318
by (fast_tac (!claset addSEs [lemma]) 1);
paulson@2111
   319
qed "Spy_not_see_encrypted_key";
paulson@2111
   320
paulson@2111
   321
paulson@2111
   322
goal thy 
paulson@2155
   323
 "!!evs. [| C ~: {A,B,Server};                                    \
paulson@2111
   324
\           Says Server A                                         \
paulson@2284
   325
\              {|NB, Crypt (shrK A) {|Agent B, K, NA|},           \
paulson@2284
   326
\                    Crypt (shrK B) {|NB, K, Agent A|}|}          \
paulson@2111
   327
\           : set_of_list evs;                                    \
paulson@2155
   328
\           Says A Spy {|NA, NB, K|} ~: set_of_list evs;          \
paulson@2155
   329
\           A ~: lost;  B ~: lost;  evs : yahalom lost |]         \
paulson@2155
   330
\        ==> K ~: analz (sees lost C evs)";
paulson@2111
   331
by (rtac (subset_insertI RS sees_mono RS analz_mono RS contra_subsetD) 1);
paulson@2111
   332
by (rtac (sees_lost_agent_subset_sees_Spy RS analz_mono RS contra_subsetD) 1);
paulson@2111
   333
by (FIRSTGOAL (rtac Spy_not_see_encrypted_key));
paulson@2111
   334
by (REPEAT_FIRST (fast_tac (!claset addIs [yahalom_mono RS subsetD])));
paulson@2111
   335
qed "Agent_not_see_encrypted_key";
paulson@2111
   336
paulson@2111
   337
paulson@2155
   338
(*** Security Guarantees for A and B ***)
paulson@2155
   339
paulson@2155
   340
(*If the encrypted message appears then it originated with the Server.*)
paulson@2155
   341
goal thy
paulson@2284
   342
 "!!evs. [| Crypt (shrK A) {|Agent B, Key K, NA|}                \
paulson@2155
   343
\            : parts (sees lost Spy evs);                              \
paulson@2155
   344
\           A ~: lost;  evs : yahalom lost |]                          \
paulson@2155
   345
\         ==> EX NB. Says Server A                                     \
paulson@2284
   346
\                      {|NB, Crypt (shrK A) {|Agent B, Key K, NA|},    \
paulson@2284
   347
\                            Crypt (shrK B) {|NB, Key K, Agent A|}|}   \
paulson@2155
   348
\                    : set_of_list evs";
paulson@2155
   349
by (etac rev_mp 1);
paulson@2155
   350
by (parts_induct_tac 1);
paulson@2155
   351
(*The nested conjunctions are entirely useless*)
paulson@2155
   352
by (REPEAT_FIRST (rtac conjI ORELSE' fast_tac (!claset delrules [conjI])));
paulson@2323
   353
qed "A_trusts_YM3";
paulson@2155
   354
paulson@2111
   355
paulson@2111
   356
(*B knows, by the first part of A's message, that the Server distributed 
paulson@2155
   357
  the key for A and B. *)
paulson@2111
   358
goal thy 
paulson@2284
   359
 "!!evs. [| Crypt (shrK B) {|Nonce NB, Key K, Agent A|}              \
paulson@2155
   360
\            : parts (sees lost Spy evs);                            \
paulson@2155
   361
\           B ~: lost;  evs : yahalom lost |]                        \
paulson@2111
   362
\        ==> EX NA. Says Server A                                    \
paulson@2155
   363
\                    {|Nonce NB,                                     \
paulson@2284
   364
\                      Crypt (shrK A) {|Agent B, Key K, Nonce NA|},  \
paulson@2284
   365
\                      Crypt (shrK B) {|Nonce NB, Key K, Agent A|}|} \
paulson@2111
   366
\                       : set_of_list evs";
paulson@2111
   367
by (etac rev_mp 1);
paulson@2111
   368
by (parts_induct_tac 1);
paulson@2111
   369
(*YM3*)
paulson@2111
   370
by (Fast_tac 1);
paulson@2111
   371
qed "B_trusts_YM4_shrK";
paulson@2111
   372
paulson@2111
   373
(*With this variant we don't bother to use the 2nd part of YM4 at all, since
paulson@2111
   374
  Nonce NB is available in the first part.  However the 2nd part does assure B
paulson@2111
   375
  of A's existence.*)
paulson@2111
   376
paulson@2155
   377
(*What can B deduce from receipt of YM4?  Stronger and simpler than Yahalom
paulson@2155
   378
  because we do not have to show that NB is secret. *)
paulson@2111
   379
goal thy 
paulson@2284
   380
 "!!evs. [| Says A' B {|Crypt (shrK B) {|Nonce NB, Key K, Agent A|},    \
paulson@2284
   381
\                       Crypt K (Nonce NB)|} : set_of_list evs;         \
paulson@2111
   382
\           A ~: lost;  B ~: lost;  evs : yahalom lost |]               \
paulson@2111
   383
\        ==> EX NA. Says Server A                                       \
paulson@2155
   384
\                    {|Nonce NB,                                        \
paulson@2284
   385
\                      Crypt (shrK A) {|Agent B, Key K, Nonce NA|},     \
paulson@2284
   386
\                      Crypt (shrK B) {|Nonce NB, Key K, Agent A|}|}    \
paulson@2111
   387
\                   : set_of_list evs";
paulson@2170
   388
by (etac (Says_imp_sees_Spy RS parts.Inj RS MPair_parts) 1);
paulson@2111
   389
by (fast_tac (!claset addSDs [B_trusts_YM4_shrK]) 1);
paulson@2323
   390
qed "B_trusts_YM4";