src/HOL/Auth/Yahalom.ML
author paulson
Mon Oct 07 10:40:51 1996 +0200 (1996-10-07)
changeset 2060 275ef0f28e1f
parent 2051 067bf19a71b7
child 2110 d01151e66cd4
permissions -rw-r--r--
Simplified a proof
paulson@1995
     1
(*  Title:      HOL/Auth/Yahalom
paulson@1985
     2
    ID:         $Id$
paulson@1985
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
paulson@1985
     4
    Copyright   1996  University of Cambridge
paulson@1985
     5
paulson@1985
     6
Inductive relation "otway" for the Yahalom protocol.
paulson@1985
     7
paulson@1985
     8
From page 257 of
paulson@1985
     9
  Burrows, Abadi and Needham.  A Logic of Authentication.
paulson@1985
    10
  Proc. Royal Soc. 426 (1989)
paulson@2060
    11
paulson@2060
    12
DEFINE parts_induct_tac AS IN OtwayRees
paulson@1985
    13
*)
paulson@1985
    14
paulson@1995
    15
open Yahalom;
paulson@1985
    16
paulson@1985
    17
proof_timing:=true;
paulson@1985
    18
HOL_quantifiers := false;
paulson@1985
    19
paulson@1995
    20
paulson@2013
    21
(*Weak liveness: there are traces that reach the end*)
paulson@1995
    22
paulson@1995
    23
goal thy 
paulson@1995
    24
 "!!A B. [| A ~= B; A ~= Server; B ~= Server |]   \
paulson@2032
    25
\        ==> EX X NB K. EX evs: yahalom lost.          \
paulson@1995
    26
\               Says A B {|X, Crypt (Nonce NB) K|} : set_of_list evs";
paulson@1995
    27
by (REPEAT (resolve_tac [exI,bexI] 1));
paulson@2032
    28
by (rtac (yahalom.Nil RS yahalom.YM1 RS yahalom.YM2 RS yahalom.YM3 RS yahalom.YM4) 2);
paulson@1995
    29
by (ALLGOALS (simp_tac (!simpset setsolver safe_solver)));
paulson@1995
    30
by (ALLGOALS Fast_tac);
paulson@2013
    31
result();
paulson@1995
    32
paulson@1995
    33
paulson@1985
    34
(**** Inductive proofs about yahalom ****)
paulson@1985
    35
paulson@2045
    36
goal thy "!!evs. lost' <= lost ==> yahalom lost' <= yahalom lost";
paulson@2045
    37
by (rtac subsetI 1);
paulson@2045
    38
by (etac yahalom.induct 1);
paulson@2045
    39
by (REPEAT_FIRST
paulson@2045
    40
    (best_tac (!claset addIs (impOfSubs (sees_mono RS analz_mono RS synth_mono)
paulson@2045
    41
                              :: yahalom.intrs))));
paulson@2045
    42
qed "yahalom_mono";
paulson@2045
    43
paulson@1985
    44
paulson@1985
    45
(*Nobody sends themselves messages*)
paulson@2051
    46
goal thy "!!evs. evs: yahalom lost ==> ALL A X. Says A A X ~: set_of_list evs";
paulson@2032
    47
by (etac yahalom.induct 1);
paulson@1985
    48
by (Auto_tac());
paulson@1985
    49
qed_spec_mp "not_Says_to_self";
paulson@1985
    50
Addsimps [not_Says_to_self];
paulson@1985
    51
AddSEs   [not_Says_to_self RSN (2, rev_notE)];
paulson@1985
    52
paulson@1985
    53
paulson@1985
    54
(** For reasoning about the encrypted portion of messages **)
paulson@1985
    55
paulson@1995
    56
(*Lets us treat YM4 using a similar argument as for the Fake case.*)
paulson@1995
    57
goal thy "!!evs. Says S A {|Crypt Y (shrK A), X|} : set_of_list evs ==> \
paulson@2032
    58
\                X : analz (sees lost Spy evs)";
paulson@2032
    59
by (fast_tac (!claset addSDs [Says_imp_sees_Spy RS analz.Inj]) 1);
paulson@2032
    60
qed "YM4_analz_sees_Spy";
paulson@1985
    61
paulson@1995
    62
goal thy "!!evs. Says S A {|Crypt {|B, K, NA, NB|} (shrK A), X|} \
paulson@1995
    63
\                  : set_of_list evs ==> \
paulson@2032
    64
\                K : parts (sees lost Spy evs)";
paulson@1985
    65
by (fast_tac (!claset addSEs partsEs
paulson@2032
    66
                      addSDs [Says_imp_sees_Spy RS parts.Inj]) 1);
paulson@2032
    67
qed "YM4_parts_sees_Spy";
paulson@1985
    68
paulson@1985
    69
paulson@1985
    70
paulson@2032
    71
(** Theorems of the form X ~: parts (sees lost Spy evs) imply that NOBODY
paulson@2013
    72
    sends messages containing X! **)
paulson@1985
    73
paulson@2032
    74
(*Spy never sees lost another agent's shared key! (unless it is leaked at start)*)
paulson@1985
    75
goal thy 
paulson@2032
    76
 "!!evs. [| evs : yahalom lost;  A ~: lost |]    \
paulson@2032
    77
\        ==> Key (shrK A) ~: parts (sees lost Spy evs)";
paulson@2032
    78
by (etac yahalom.induct 1);
paulson@2032
    79
by (dtac (YM4_analz_sees_Spy RS synth.Inj) 6);
paulson@1995
    80
by (ALLGOALS Asm_simp_tac);
paulson@1995
    81
by (stac insert_commute 3);
paulson@1985
    82
by (Auto_tac());
paulson@1995
    83
(*Fake and YM4 are similar*)
paulson@1995
    84
by (ALLGOALS (best_tac (!claset addSDs [impOfSubs analz_subset_parts,
paulson@2032
    85
                                        impOfSubs Fake_parts_insert])));
paulson@2032
    86
qed "Spy_not_see_shrK";
paulson@1985
    87
paulson@2032
    88
bind_thm ("Spy_not_analz_shrK",
paulson@2032
    89
          [analz_subset_parts, Spy_not_see_shrK] MRS contra_subsetD);
paulson@1985
    90
paulson@2032
    91
Addsimps [Spy_not_see_shrK, Spy_not_analz_shrK];
paulson@1985
    92
paulson@1985
    93
(*We go to some trouble to preserve R in the 3rd and 4th subgoals
paulson@1985
    94
  As usual fast_tac cannot be used because it uses the equalities too soon*)
paulson@1985
    95
val major::prems = 
paulson@2032
    96
goal thy  "[| Key (shrK A) : parts (sees lost Spy evs);       \
paulson@2032
    97
\             evs : yahalom lost;                               \
paulson@2032
    98
\             A:lost ==> R                                  \
paulson@1985
    99
\           |] ==> R";
paulson@2032
   100
by (rtac ccontr 1);
paulson@2032
   101
by (rtac ([major, Spy_not_see_shrK] MRS rev_notE) 1);
paulson@1985
   102
by (swap_res_tac prems 2);
paulson@1985
   103
by (ALLGOALS (fast_tac (!claset addIs prems)));
paulson@2032
   104
qed "Spy_see_shrK_E";
paulson@1985
   105
paulson@2032
   106
bind_thm ("Spy_analz_shrK_E", 
paulson@2032
   107
          analz_subset_parts RS subsetD RS Spy_see_shrK_E);
paulson@1985
   108
paulson@2032
   109
AddSEs [Spy_see_shrK_E, Spy_analz_shrK_E];
paulson@1985
   110
paulson@1985
   111
paulson@1985
   112
(*** Future keys can't be seen or used! ***)
paulson@1985
   113
paulson@1985
   114
(*Nobody can have SEEN keys that will be generated in the future.
paulson@1985
   115
  This has to be proved anew for each protocol description,
paulson@1985
   116
  but should go by similar reasoning every time.  Hardest case is the
paulson@1985
   117
  standard Fake rule.  
paulson@1985
   118
      The length comparison, and Union over C, are essential for the 
paulson@1985
   119
  induction! *)
paulson@2032
   120
goal thy "!!evs. evs : yahalom lost ==> \
paulson@1985
   121
\                length evs <= length evs' --> \
paulson@2032
   122
\                          Key (newK evs') ~: (UN C. parts (sees lost C evs))";
paulson@2032
   123
by (etac yahalom.induct 1);
paulson@2032
   124
by (dtac (YM4_analz_sees_Spy RS synth.Inj) 6);
paulson@1985
   125
by (REPEAT_FIRST (best_tac (!claset addDs [impOfSubs analz_subset_parts,
paulson@2032
   126
                                           impOfSubs parts_insert_subset_Un,
paulson@2032
   127
                                           Suc_leD]
paulson@2032
   128
                                    addss (!simpset))));
paulson@1985
   129
val lemma = result();
paulson@1985
   130
paulson@1985
   131
(*Variant needed for the main theorem below*)
paulson@1985
   132
goal thy 
paulson@2032
   133
 "!!evs. [| evs : yahalom lost;  length evs <= length evs' |]    \
paulson@2032
   134
\        ==> Key (newK evs') ~: parts (sees lost C evs)";
paulson@1985
   135
by (fast_tac (!claset addDs [lemma]) 1);
paulson@1985
   136
qed "new_keys_not_seen";
paulson@1985
   137
Addsimps [new_keys_not_seen];
paulson@1985
   138
paulson@1985
   139
(*Another variant: old messages must contain old keys!*)
paulson@1985
   140
goal thy 
paulson@1985
   141
 "!!evs. [| Says A B X : set_of_list evs;  \
paulson@1985
   142
\           Key (newK evt) : parts {X};    \
paulson@2032
   143
\           evs : yahalom lost                 \
paulson@1985
   144
\        |] ==> length evt < length evs";
paulson@2032
   145
by (rtac ccontr 1);
paulson@2032
   146
by (dtac leI 1);
paulson@2032
   147
by (fast_tac (!claset addSDs [new_keys_not_seen, Says_imp_sees_Spy]
paulson@2013
   148
                      addIs  [impOfSubs parts_mono]) 1);
paulson@1985
   149
qed "Says_imp_old_keys";
paulson@1985
   150
paulson@1985
   151
paulson@1985
   152
(*Nobody can have USED keys that will be generated in the future.
paulson@1985
   153
  ...very like new_keys_not_seen*)
paulson@2032
   154
goal thy "!!evs. evs : yahalom lost ==> \
paulson@1985
   155
\                length evs <= length evs' --> \
paulson@2032
   156
\                newK evs' ~: keysFor (UN C. parts (sees lost C evs))";
paulson@2032
   157
by (etac yahalom.induct 1);
paulson@2032
   158
by (forward_tac [YM4_parts_sees_Spy] 6);
paulson@2032
   159
by (dtac (YM4_analz_sees_Spy RS synth.Inj) 6);
paulson@1995
   160
by (ALLGOALS Asm_full_simp_tac);
paulson@1995
   161
(*YM1, YM2 and YM3*)
paulson@1995
   162
by (EVERY (map (fast_tac (!claset addDs [Suc_leD] addss (!simpset))) [4,3,2]));
paulson@1995
   163
(*Fake and YM4: these messages send unknown (X) components*)
paulson@1995
   164
by (stac insert_commute 2);
paulson@1995
   165
by (Simp_tac 2);
paulson@1995
   166
(*YM4: the only way K could have been used is if it had been seen,
paulson@1995
   167
  contradicting new_keys_not_seen*)
paulson@1995
   168
by (ALLGOALS
paulson@1985
   169
     (best_tac
paulson@2026
   170
      (!claset addDs [impOfSubs analz_subset_parts,
paulson@2032
   171
                      impOfSubs (analz_subset_parts RS keysFor_mono),
paulson@2032
   172
                      impOfSubs (parts_insert_subset_Un RS keysFor_mono),
paulson@2032
   173
                      Suc_leD]
paulson@2032
   174
               addEs [new_keys_not_seen RSN(2,rev_notE)]
paulson@2032
   175
               addss (!simpset))));
paulson@1985
   176
val lemma = result();
paulson@1985
   177
paulson@1985
   178
goal thy 
paulson@2032
   179
 "!!evs. [| evs : yahalom lost;  length evs <= length evs' |]    \
paulson@2032
   180
\        ==> newK evs' ~: keysFor (parts (sees lost C evs))";
paulson@1985
   181
by (fast_tac (!claset addSDs [lemma] addss (!simpset)) 1);
paulson@1985
   182
qed "new_keys_not_used";
paulson@1985
   183
paulson@1985
   184
bind_thm ("new_keys_not_analzd",
paulson@2032
   185
          [analz_subset_parts RS keysFor_mono,
paulson@2032
   186
           new_keys_not_used] MRS contra_subsetD);
paulson@1985
   187
paulson@1985
   188
Addsimps [new_keys_not_used, new_keys_not_analzd];
paulson@1985
   189
paulson@1985
   190
paulson@1985
   191
(** Lemmas concerning the form of items passed in messages **)
paulson@1985
   192
paulson@1985
   193
paulson@1985
   194
(****
paulson@1985
   195
 The following is to prove theorems of the form
paulson@1985
   196
paulson@2032
   197
          Key K : analz (insert (Key (newK evt)) (sees lost Spy evs)) ==>
paulson@2032
   198
          Key K : analz (sees lost Spy evs)
paulson@1985
   199
paulson@1985
   200
 A more general formula must be proved inductively.
paulson@1985
   201
paulson@1985
   202
****)
paulson@1985
   203
paulson@1985
   204
paulson@1985
   205
(*NOT useful in this form, but it says that session keys are not used
paulson@1985
   206
  to encrypt messages containing other keys, in the actual protocol.
paulson@1985
   207
  We require that agents should behave like this subsequently also.*)
paulson@1985
   208
goal thy 
paulson@2032
   209
 "!!evs. evs : yahalom lost ==> \
paulson@2032
   210
\        (Crypt X (newK evt)) : parts (sees lost Spy evs) & \
paulson@2032
   211
\        Key K : parts {X} --> Key K : parts (sees lost Spy evs)";
paulson@2032
   212
by (etac yahalom.induct 1);
paulson@2032
   213
by (dtac (YM4_analz_sees_Spy RS synth.Inj) 6);
paulson@2060
   214
by (ALLGOALS Asm_simp_tac);
paulson@1985
   215
(*Deals with Faked messages*)
paulson@1995
   216
by (EVERY 
paulson@1995
   217
    (map (best_tac (!claset addSEs partsEs
paulson@2032
   218
                            addDs [impOfSubs parts_insert_subset_Un]
paulson@2032
   219
                            addss (!simpset)))
paulson@1995
   220
     [3,2]));
paulson@1995
   221
(*Base case*)
paulson@1985
   222
by (Auto_tac());
paulson@1985
   223
result();
paulson@1985
   224
paulson@1985
   225
paulson@1985
   226
(** Session keys are not used to encrypt other session keys **)
paulson@1985
   227
paulson@1985
   228
goal thy  
paulson@2032
   229
 "!!evs. evs : yahalom lost ==> \
paulson@2032
   230
\  ALL K E. (Key K : analz (Key``(newK``E) Un (sees lost Spy evs))) = \
paulson@2032
   231
\           (K : newK``E | Key K : analz (sees lost Spy evs))";
paulson@2032
   232
by (etac yahalom.induct 1);
paulson@2032
   233
by (dtac YM4_analz_sees_Spy 6);
paulson@2045
   234
by (REPEAT_FIRST (resolve_tac [allI, analz_image_newK_lemma]));
paulson@1995
   235
by (ALLGOALS 
paulson@1985
   236
    (asm_simp_tac 
paulson@1985
   237
     (!simpset addsimps ([insert_Key_singleton, insert_Key_image, pushKey_newK]
paulson@2032
   238
                         @ pushes)
paulson@1985
   239
               setloop split_tac [expand_if])));
paulson@1985
   240
(*YM4*) 
paulson@2032
   241
by (spy_analz_tac 4);
paulson@1985
   242
(*YM3*)
paulson@1995
   243
by (Fast_tac 3);
paulson@1995
   244
(*Fake case*)
paulson@2032
   245
by (spy_analz_tac 2);
paulson@1985
   246
(*Base case*)
paulson@1985
   247
by (fast_tac (!claset addIs [image_eqI] addss (!simpset)) 1);
paulson@1985
   248
qed_spec_mp "analz_image_newK";
paulson@1985
   249
paulson@1985
   250
goal thy
paulson@2032
   251
 "!!evs. evs : yahalom lost ==>                               \
paulson@2032
   252
\        Key K : analz (insert (Key (newK evt)) (sees lost Spy evs)) = \
paulson@2032
   253
\        (K = newK evt | Key K : analz (sees lost Spy evs))";
paulson@1985
   254
by (asm_simp_tac (HOL_ss addsimps [pushKey_newK, analz_image_newK, 
paulson@2032
   255
                                   insert_Key_singleton]) 1);
paulson@1985
   256
by (Fast_tac 1);
paulson@1985
   257
qed "analz_insert_Key_newK";
paulson@1985
   258
paulson@1985
   259
paulson@2013
   260
(*Describes the form of K when the Server sends this message.*)
paulson@1985
   261
goal thy 
paulson@1995
   262
 "!!evs. [| Says Server A                                           \
paulson@1995
   263
\            {|Crypt {|Agent B, K, NA, NB|} (shrK A),               \
paulson@1995
   264
\              Crypt {|Agent A, K|} (shrK B)|} : set_of_list evs;   \
paulson@2032
   265
\           evs : yahalom lost |]                                        \
paulson@2032
   266
\        ==> (EX evt: yahalom lost. K = Key(newK evt))";
paulson@2032
   267
by (etac rev_mp 1);
paulson@2032
   268
by (etac yahalom.induct 1);
paulson@2013
   269
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
paulson@1985
   270
qed "Says_Server_message_form";
paulson@1985
   271
paulson@1985
   272
paulson@2032
   273
(** Crucial secrecy property: Spy does not see the keys sent in msg YM3
paulson@2013
   274
    As with Otway-Rees, proof does not need uniqueness of session keys. **)
paulson@2013
   275
paulson@2013
   276
goal thy 
paulson@2051
   277
 "!!evs. [| A ~: lost;  B ~: lost;                                \
paulson@2051
   278
\           evs : yahalom lost;  evt : yahalom lost |]            \
paulson@2051
   279
\        ==> Says Server A                                        \
paulson@2051
   280
\              {|Crypt {|Agent B, Key K, NA, NB|} (shrK A),       \
paulson@2051
   281
\                Crypt {|Agent A, Key K|} (shrK B)|}              \
paulson@2013
   282
\             : set_of_list evs -->    \
paulson@2051
   283
\            Key K ~: analz (sees lost Spy evs)";
paulson@2032
   284
by (etac yahalom.induct 1);
paulson@2032
   285
by (dtac YM4_analz_sees_Spy 6);
paulson@2013
   286
by (ALLGOALS
paulson@2013
   287
    (asm_simp_tac 
paulson@2013
   288
     (!simpset addsimps ([analz_subset_parts RS contra_subsetD,
paulson@2032
   289
                          analz_insert_Key_newK] @ pushes)
paulson@2013
   290
               setloop split_tac [expand_if])));
paulson@2013
   291
(*YM4*)
paulson@2032
   292
by (spy_analz_tac 3);
paulson@2013
   293
(*YM3*)
paulson@2013
   294
by (fast_tac (!claset addIs [parts_insertI]
paulson@2032
   295
                      addEs [Says_imp_old_keys RS less_irrefl]
paulson@2032
   296
                      addss (!simpset)) 2);
paulson@2013
   297
(*Fake*) (** LEVEL 10 **)
paulson@2032
   298
by (spy_analz_tac 1);
paulson@2013
   299
val lemma = result() RS mp RSN(2,rev_notE);
paulson@2013
   300
paulson@2013
   301
paulson@2013
   302
(*Final version: Server's message in the most abstract form*)
paulson@1985
   303
goal thy 
paulson@1985
   304
 "!!evs. [| Says Server A \
paulson@1995
   305
\            {|Crypt {|Agent B, K, NA, NB|} (shrK A),                   \
paulson@1995
   306
\              Crypt {|Agent A, K|} (shrK B)|} : set_of_list evs;       \
paulson@2032
   307
\           A ~: lost;  B ~: lost;  evs : yahalom lost |] ==>                  \
paulson@2032
   308
\     K ~: analz (sees lost Spy evs)";
paulson@2013
   309
by (forward_tac [Says_Server_message_form] 1 THEN assume_tac 1);
paulson@2013
   310
by (fast_tac (!claset addSEs [lemma]) 1);
paulson@2032
   311
qed "Spy_not_see_encrypted_key";
paulson@2001
   312
paulson@2001
   313
paulson@2045
   314
goal thy 
paulson@2045
   315
 "!!evs. [| C ~: {A,B,Server};                                          \
paulson@2045
   316
\           Says Server A                                               \
paulson@2045
   317
\            {|Crypt {|Agent B, K, NA, NB|} (shrK A),                   \
paulson@2045
   318
\              Crypt {|Agent A, K|} (shrK B)|} : set_of_list evs;       \
paulson@2045
   319
\           A ~: lost;  B ~: lost;  evs : yahalom lost |] ==>           \
paulson@2045
   320
\     K ~: analz (sees lost C evs)";
paulson@2045
   321
by (rtac (subset_insertI RS sees_mono RS analz_mono RS contra_subsetD) 1);
paulson@2045
   322
by (rtac (sees_lost_agent_subset_sees_Spy RS analz_mono RS contra_subsetD) 1);
paulson@2045
   323
by (FIRSTGOAL (rtac Spy_not_see_encrypted_key));
paulson@2045
   324
by (REPEAT_FIRST (fast_tac (!claset addIs [yahalom_mono RS subsetD])));
paulson@2045
   325
qed "Agent_not_see_encrypted_key";
paulson@2045
   326
paulson@2045
   327
paulson@2013
   328
(** Towards proofs of stronger authenticity properties **)
paulson@2013
   329
paulson@2001
   330
goal thy 
paulson@2032
   331
 "!!evs. [| Crypt {|Agent A, Key K|} (shrK B) : parts (sees lost Spy evs); \
paulson@2051
   332
\           B ~: lost;  evs : yahalom lost |]                           \
paulson@2001
   333
\        ==> EX NA NB. Says Server A                                    \
paulson@2013
   334
\                        {|Crypt {|Agent B, Key K,                      \
paulson@2013
   335
\                                  Nonce NA, Nonce NB|} (shrK A),       \
paulson@2013
   336
\                          Crypt {|Agent A, Key K|} (shrK B)|}          \
paulson@2013
   337
\                       : set_of_list evs";
paulson@2032
   338
by (etac rev_mp 1);
paulson@2032
   339
by (etac yahalom.induct 1);
paulson@2032
   340
by (dtac (YM4_analz_sees_Spy RS synth.Inj) 6);
paulson@2013
   341
by (ALLGOALS Asm_simp_tac);
paulson@2001
   342
(*YM3*)
paulson@2001
   343
by (Fast_tac 3);
paulson@2001
   344
(*Base case*)
paulson@2001
   345
by (fast_tac (!claset addss (!simpset)) 1);
paulson@2013
   346
(*Prepare YM4*)
paulson@2013
   347
by (stac insert_commute 2 THEN Simp_tac 2);
paulson@2013
   348
(*Fake and YM4 are similar*)
paulson@2013
   349
by (ALLGOALS (best_tac (!claset addSDs [impOfSubs analz_subset_parts,
paulson@2032
   350
                                        impOfSubs Fake_parts_insert])));
paulson@2013
   351
qed "Crypt_imp_Server_msg";
paulson@2001
   352
paulson@2001
   353
paulson@2051
   354
(*What can B deduce from receipt of YM4?  NOT THAT THE NONCES AGREE.  Cf the
paulson@2051
   355
  BAN paper page 259.  "If A chose to replay an old key to B in message 4,
paulson@2051
   356
  B could not detect the fraud." *)
paulson@2001
   357
goal thy 
paulson@2001
   358
 "!!evs. [| Says A' B {|Crypt {|Agent A, Key K|} (shrK B),              \
paulson@2001
   359
\                       Crypt (Nonce NB) K|} : set_of_list evs;         \
paulson@2051
   360
\           B ~: lost;  evs : yahalom lost |]                           \
paulson@2001
   361
\        ==> EX NA NB. Says Server A                                    \
paulson@2001
   362
\                     {|Crypt {|Agent B, Key K,                         \
paulson@2001
   363
\                               Nonce NA, Nonce NB|} (shrK A),          \
paulson@2001
   364
\                       Crypt {|Agent A, Key K|} (shrK B)|}             \
paulson@2001
   365
\                   : set_of_list evs";
paulson@2032
   366
by (etac rev_mp 1);
paulson@2032
   367
by (etac yahalom.induct 1);
paulson@2032
   368
by (dtac YM4_analz_sees_Spy 6);
paulson@2001
   369
by (ALLGOALS Asm_simp_tac);
paulson@2013
   370
by (ALLGOALS (fast_tac (!claset addSDs [impOfSubs analz_subset_parts RS
paulson@2032
   371
                                        Crypt_imp_Server_msg])));
paulson@2001
   372
qed "YM4_imp_Says_Server_A";
paulson@2001
   373
paulson@2001
   374
goal thy 
paulson@2001
   375
 "!!evs. [| Says A' B {|Crypt {|Agent A, Key K|} (shrK B),              \
paulson@2001
   376
\                       Crypt (Nonce NB) K|} : set_of_list evs;         \
paulson@2051
   377
\           A ~: lost;  B ~: lost;  evs : yahalom lost |]               \
paulson@2032
   378
\        ==> Key K ~: analz (sees lost Spy evs)";
paulson@2001
   379
by (fast_tac (!claset addSDs [YM4_imp_Says_Server_A,
paulson@2032
   380
                              Spy_not_see_encrypted_key]) 1);
paulson@2001
   381
qed "B_gets_secure_key";