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