src/HOL/Auth/NS_Public_Bad.ML
author paulson
Thu Jan 23 10:34:18 1997 +0100 (1997-01-23)
changeset 2536 1e04eb7f7eb1
parent 2516 4d68fbe6378b
child 2637 e9b203f854ae
permissions -rw-r--r--
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson@2318
     1
(*  Title:      HOL/Auth/NS_Public_Bad
paulson@2318
     2
    ID:         $Id$
paulson@2318
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
paulson@2318
     4
    Copyright   1996  University of Cambridge
paulson@2318
     5
paulson@2318
     6
Inductive relation "ns_public" for the Needham-Schroeder Public-Key protocol.
paulson@2318
     7
Flawed version, vulnerable to Lowe's attack.
paulson@2318
     8
paulson@2318
     9
From page 260 of
paulson@2318
    10
  Burrows, Abadi and Needham.  A Logic of Authentication.
paulson@2318
    11
  Proc. Royal Soc. 426 (1989)
paulson@2318
    12
*)
paulson@2318
    13
paulson@2318
    14
open NS_Public_Bad;
paulson@2318
    15
paulson@2318
    16
proof_timing:=true;
paulson@2318
    17
HOL_quantifiers := false;
paulson@2318
    18
paulson@2318
    19
AddIffs [Spy_in_lost];
paulson@2318
    20
paulson@2318
    21
(*Replacing the variable by a constant improves search speed by 50%!*)
paulson@2318
    22
val Says_imp_sees_Spy' = 
paulson@2318
    23
    read_instantiate_sg (sign_of thy) [("lost","lost")] Says_imp_sees_Spy;
paulson@2318
    24
paulson@2318
    25
paulson@2318
    26
(*A "possibility property": there are traces that reach the end*)
paulson@2318
    27
goal thy 
paulson@2480
    28
 "!!A B. A ~= B ==> EX NB. EX evs: ns_public.               \
paulson@2480
    29
\                     Says A B (Crypt (pubK B) (Nonce NB)) : set_of_list evs";
paulson@2318
    30
by (REPEAT (resolve_tac [exI,bexI] 1));
paulson@2318
    31
by (rtac (ns_public.Nil RS ns_public.NS1 RS ns_public.NS2 RS ns_public.NS3) 2);
paulson@2516
    32
by possibility_tac;
paulson@2318
    33
result();
paulson@2318
    34
paulson@2318
    35
paulson@2318
    36
(**** Inductive proofs about ns_public ****)
paulson@2318
    37
paulson@2318
    38
(*Nobody sends themselves messages*)
paulson@2318
    39
goal thy "!!evs. evs : ns_public ==> ALL A X. Says A A X ~: set_of_list evs";
paulson@2318
    40
by (etac ns_public.induct 1);
paulson@2318
    41
by (Auto_tac());
paulson@2318
    42
qed_spec_mp "not_Says_to_self";
paulson@2318
    43
Addsimps [not_Says_to_self];
paulson@2318
    44
AddSEs   [not_Says_to_self RSN (2, rev_notE)];
paulson@2318
    45
paulson@2318
    46
paulson@2318
    47
(*For proving the easier theorems about X ~: parts (sees lost Spy evs) *)
paulson@2318
    48
fun parts_induct_tac i = SELECT_GOAL
paulson@2318
    49
    (DETERM (etac ns_public.induct 1 THEN 
paulson@2318
    50
             (*Fake message*)
paulson@2318
    51
             TRY (best_tac (!claset addDs [impOfSubs analz_subset_parts,
paulson@2318
    52
                                           impOfSubs Fake_parts_insert]
paulson@2318
    53
                                    addss (!simpset)) 2)) THEN
paulson@2318
    54
     (*Base case*)
paulson@2318
    55
     fast_tac (!claset addss (!simpset)) 1 THEN
paulson@2318
    56
     ALLGOALS Asm_simp_tac) i;
paulson@2318
    57
paulson@2318
    58
(** Theorems of the form X ~: parts (sees lost Spy evs) imply that NOBODY
paulson@2318
    59
    sends messages containing X! **)
paulson@2318
    60
paulson@2318
    61
(*Spy never sees another agent's private key! (unless it's lost at start)*)
paulson@2318
    62
goal thy 
paulson@2318
    63
 "!!evs. evs : ns_public \
paulson@2318
    64
\        ==> (Key (priK A) : parts (sees lost Spy evs)) = (A : lost)";
paulson@2318
    65
by (parts_induct_tac 1);
paulson@2318
    66
by (Auto_tac());
paulson@2318
    67
qed "Spy_see_priK";
paulson@2318
    68
Addsimps [Spy_see_priK];
paulson@2318
    69
paulson@2318
    70
goal thy 
paulson@2318
    71
 "!!evs. evs : ns_public \
paulson@2318
    72
\        ==> (Key (priK A) : analz (sees lost Spy evs)) = (A : lost)";
paulson@2318
    73
by (auto_tac(!claset addDs [impOfSubs analz_subset_parts], !simpset));
paulson@2318
    74
qed "Spy_analz_priK";
paulson@2318
    75
Addsimps [Spy_analz_priK];
paulson@2318
    76
paulson@2318
    77
goal thy  "!!A. [| Key (priK A) : parts (sees lost Spy evs);       \
paulson@2318
    78
\                  evs : ns_public |] ==> A:lost";
paulson@2318
    79
by (fast_tac (!claset addDs [Spy_see_priK]) 1);
paulson@2318
    80
qed "Spy_see_priK_D";
paulson@2318
    81
paulson@2318
    82
bind_thm ("Spy_analz_priK_D", analz_subset_parts RS subsetD RS Spy_see_priK_D);
paulson@2318
    83
AddSDs [Spy_see_priK_D, Spy_analz_priK_D];
paulson@2318
    84
paulson@2318
    85
paulson@2418
    86
fun analz_induct_tac i = 
paulson@2516
    87
    etac ns_public.induct i     THEN
paulson@2418
    88
    ALLGOALS (asm_simp_tac 
paulson@2516
    89
              (!simpset addsimps [not_parts_not_analz]
paulson@2480
    90
                        setloop split_tac [expand_if]));
paulson@2418
    91
paulson@2318
    92
paulson@2318
    93
(**** Authenticity properties obtained from NS2 ****)
paulson@2318
    94
paulson@2318
    95
(*It is impossible to re-use a nonce in both NS1 and NS2, provided the nonce
paulson@2318
    96
  is secret.  (Honest users generate fresh nonces.)*)
paulson@2318
    97
goal thy 
paulson@2536
    98
 "!!evs. [| Nonce NA ~: analz (sees lost Spy evs);  \
paulson@2536
    99
\           Crypt (pubK B) {|Nonce NA, Agent A|} : parts (sees lost Spy evs); \
paulson@2536
   100
\           evs : ns_public |]                      \
paulson@2536
   101
\ ==> Crypt (pubK C) {|NA', Nonce NA|} ~: parts (sees lost Spy evs)";
paulson@2536
   102
by (etac rev_mp 1);
paulson@2536
   103
by (etac rev_mp 1);
paulson@2418
   104
by (analz_induct_tac 1);
paulson@2318
   105
(*NS3*)
paulson@2497
   106
by (fast_tac (!claset addSEs partsEs) 4);
paulson@2318
   107
(*NS2*)
paulson@2497
   108
by (fast_tac (!claset addSEs partsEs) 3);
paulson@2318
   109
(*Fake*)
paulson@2536
   110
by (deepen_tac (!claset addSIs [analz_insertI]
paulson@2536
   111
                        addDs [impOfSubs analz_subset_parts,
paulson@2536
   112
			       impOfSubs Fake_parts_insert]
paulson@2536
   113
			addss (!simpset)) 0 2);
paulson@2318
   114
(*Base*)
paulson@2374
   115
by (fast_tac (!claset addss (!simpset)) 1);
paulson@2536
   116
qed "no_nonce_NS1_NS2";
paulson@2318
   117
paulson@2318
   118
paulson@2480
   119
(*Unicity for NS1: nonce NA identifies agents A and B*)
paulson@2318
   120
goal thy 
paulson@2536
   121
 "!!evs. [| Nonce NA ~: analz (sees lost Spy evs);  evs : ns_public |]      \
paulson@2536
   122
\ ==> EX A' B'. ALL A B.                                                    \
paulson@2318
   123
\      Crypt (pubK B) {|Nonce NA, Agent A|} : parts (sees lost Spy evs) --> \
paulson@2536
   124
\      A=A' & B=B'";
paulson@2536
   125
by (etac rev_mp 1);
paulson@2418
   126
by (analz_induct_tac 1);
paulson@2318
   127
(*NS1*)
paulson@2497
   128
by (simp_tac (!simpset addsimps [all_conj_distrib]) 3);
paulson@2318
   129
by (expand_case_tac "NA = ?y" 3 THEN
paulson@2497
   130
    REPEAT (fast_tac (!claset addSEs partsEs) 3));
paulson@2318
   131
(*Base*)
paulson@2318
   132
by (fast_tac (!claset addss (!simpset)) 1);
paulson@2318
   133
(*Fake*)
paulson@2497
   134
by (simp_tac (!simpset addsimps [all_conj_distrib, parts_insert_sees]) 1);
paulson@2374
   135
by (step_tac (!claset addSIs [analz_insertI]) 1);
paulson@2318
   136
by (ex_strip_tac 1);
paulson@2318
   137
by (best_tac (!claset delrules [conjI]
paulson@2516
   138
                      addSDs [impOfSubs Fake_parts_insert]
paulson@2516
   139
                      addDs  [impOfSubs analz_subset_parts]
paulson@2318
   140
                      addss (!simpset)) 1);
paulson@2318
   141
val lemma = result();
paulson@2318
   142
paulson@2318
   143
goal thy 
paulson@2318
   144
 "!!evs. [| Crypt(pubK B)  {|Nonce NA, Agent A|}  : parts(sees lost Spy evs); \
paulson@2318
   145
\           Crypt(pubK B') {|Nonce NA, Agent A'|} : parts(sees lost Spy evs); \
paulson@2318
   146
\           Nonce NA ~: analz (sees lost Spy evs);                            \
paulson@2318
   147
\           evs : ns_public |]                                                \
paulson@2318
   148
\        ==> A=A' & B=B'";
paulson@2418
   149
by (prove_unique_tac lemma 1);
paulson@2318
   150
qed "unique_NA";
paulson@2318
   151
paulson@2318
   152
paulson@2318
   153
(*Secrecy: Spy does not see the nonce sent in msg NS1 if A and B are secure*)
paulson@2318
   154
goal thy 
paulson@2536
   155
 "!!evs. [| Says A B (Crypt(pubK B) {|Nonce NA, Agent A|}) : set_of_list evs; \
paulson@2536
   156
\           A ~: lost;  B ~: lost;  evs : ns_public |]                        \
paulson@2536
   157
\        ==>  Nonce NA ~: analz (sees lost Spy evs)";
paulson@2536
   158
by (etac rev_mp 1);
paulson@2418
   159
by (analz_induct_tac 1);
paulson@2318
   160
(*NS3*)
paulson@2318
   161
by (fast_tac (!claset addSDs [Says_imp_sees_Spy' RS parts.Inj]
paulson@2318
   162
                      addEs  [no_nonce_NS1_NS2 RSN (2, rev_notE)]) 4);
paulson@2536
   163
(*NS2*)
paulson@2536
   164
by (deepen_tac (!claset addSDs [Says_imp_sees_Spy' RS parts.Inj]
paulson@2536
   165
                        addSEs [MPair_parts]
paulson@2536
   166
			addDs  [parts.Body, unique_NA]) 0 3);
paulson@2318
   167
(*NS1*)
paulson@2536
   168
by (fast_tac (!claset addSEs sees_Spy_partsEs
paulson@2497
   169
                      addIs  [impOfSubs analz_subset_parts]) 2);
paulson@2318
   170
(*Fake*)
paulson@2497
   171
by (spy_analz_tac 1);
paulson@2536
   172
qed "Spy_not_see_NA";
paulson@2318
   173
paulson@2318
   174
paulson@2318
   175
(*Authentication for A: if she receives message 2 and has used NA
paulson@2318
   176
  to start a run, then B has sent message 2.*)
paulson@2318
   177
goal thy 
paulson@2536
   178
 "!!evs. [| Says A B (Crypt (pubK B) {|Nonce NA, Agent A|}) : set_of_list evs;\
paulson@2536
   179
\           Says B' A (Crypt(pubK A) {|Nonce NA, Nonce NB|}): set_of_list evs;\
paulson@2536
   180
\           A ~: lost;  B ~: lost;  evs : ns_public |]  \
paulson@2536
   181
\        ==> Says B A (Crypt(pubK A) {|Nonce NA, Nonce NB|}): set_of_list evs";
paulson@2536
   182
by (etac rev_mp 1);
paulson@2536
   183
(*prepare induction over Crypt (pubK A) {|NA,NB|} : parts H*)
paulson@2536
   184
by (etac (Says_imp_sees_Spy' RS parts.Inj RS rev_mp) 1);
paulson@2536
   185
by (etac ns_public.induct 1);
paulson@2318
   186
by (ALLGOALS Asm_simp_tac);
paulson@2318
   187
(*NS1*)
paulson@2536
   188
by (fast_tac (!claset addSEs sees_Spy_partsEs) 2);
paulson@2318
   189
(*Fake*)
paulson@2318
   190
by (REPEAT_FIRST (resolve_tac [impI, conjI]));
paulson@2318
   191
by (fast_tac (!claset addss (!simpset)) 1);
paulson@2318
   192
by (forward_tac [Spy_not_see_NA] 1 THEN REPEAT (assume_tac 1));
paulson@2324
   193
by (best_tac (!claset addSIs [disjI2]
paulson@2516
   194
                      addSDs [impOfSubs Fake_parts_insert]
paulson@2516
   195
                      addDs  [impOfSubs analz_subset_parts]
paulson@2516
   196
                      addss (!simpset)) 1);
paulson@2318
   197
(*NS2*)
paulson@2318
   198
by (Step_tac 1);
paulson@2318
   199
by (forward_tac [Spy_not_see_NA] 1 THEN REPEAT (assume_tac 1));
paulson@2536
   200
by (deepen_tac (!claset addSDs [Says_imp_sees_Spy' RS parts.Inj]
paulson@2536
   201
                        addDs  [unique_NA]) 1 1);
paulson@2318
   202
qed "A_trusts_NS2";
paulson@2318
   203
paulson@2318
   204
(*If the encrypted message appears then it originated with Alice in NS1*)
paulson@2318
   205
goal thy 
paulson@2536
   206
 "!!evs. [| Crypt (pubK B) {|Nonce NA, Agent A|} : parts (sees lost Spy evs); \
paulson@2536
   207
\           Nonce NA ~: analz (sees lost Spy evs);                 \
paulson@2536
   208
\           evs : ns_public |]                                     \
paulson@2536
   209
\   ==> Says A B (Crypt (pubK B) {|Nonce NA, Agent A|}) : set_of_list evs";
paulson@2536
   210
by (etac rev_mp 1);
paulson@2536
   211
by (etac rev_mp 1);
paulson@2418
   212
by (analz_induct_tac 1);
paulson@2318
   213
(*Fake*)
paulson@2318
   214
by (best_tac (!claset addSIs [disjI2]
paulson@2516
   215
                      addSDs [impOfSubs Fake_parts_insert]
paulson@2516
   216
                      addIs  [analz_insertI]
paulson@2516
   217
                      addDs  [impOfSubs analz_subset_parts]
paulson@2516
   218
                      addss (!simpset)) 2);
paulson@2318
   219
(*Base*)
paulson@2318
   220
by (fast_tac (!claset addss (!simpset)) 1);
paulson@2318
   221
qed_spec_mp "B_trusts_NS1";
paulson@2318
   222
paulson@2318
   223
paulson@2318
   224
paulson@2318
   225
(**** Authenticity properties obtained from NS2 ****)
paulson@2318
   226
paulson@2480
   227
(*Unicity for NS2: nonce NB identifies agent A and nonce NA
paulson@2318
   228
  [proof closely follows that for unique_NA] *)
paulson@2318
   229
goal thy 
paulson@2536
   230
 "!!evs. [| Nonce NB ~: analz (sees lost Spy evs);  evs : ns_public |]      \
paulson@2536
   231
\ ==> EX A' NA'. ALL A NA.                                                  \
paulson@2536
   232
\      Crypt (pubK A) {|Nonce NA, Nonce NB|}                                \
paulson@2536
   233
\        : parts (sees lost Spy evs)  -->  A=A' & NA=NA'";
paulson@2536
   234
by (etac rev_mp 1);
paulson@2418
   235
by (analz_induct_tac 1);
paulson@2318
   236
(*NS2*)
paulson@2497
   237
by (simp_tac (!simpset addsimps [all_conj_distrib]) 3);
paulson@2318
   238
by (expand_case_tac "NB = ?y" 3 THEN
paulson@2497
   239
    REPEAT (fast_tac (!claset addSEs partsEs) 3));
paulson@2318
   240
(*Base*)
paulson@2318
   241
by (fast_tac (!claset addss (!simpset)) 1);
paulson@2318
   242
(*Fake*)
paulson@2497
   243
by (simp_tac (!simpset addsimps [all_conj_distrib, parts_insert_sees]) 1);
paulson@2374
   244
by (step_tac (!claset addSIs [analz_insertI]) 1);
paulson@2318
   245
by (ex_strip_tac 1);
paulson@2318
   246
by (best_tac (!claset delrules [conjI]
paulson@2516
   247
                      addSDs [impOfSubs Fake_parts_insert]
paulson@2516
   248
                      addDs  [impOfSubs analz_subset_parts] 
paulson@2516
   249
                      addss (!simpset)) 1);
paulson@2318
   250
val lemma = result();
paulson@2318
   251
paulson@2318
   252
goal thy 
paulson@2318
   253
 "!!evs. [| Crypt(pubK A) {|Nonce NA, Nonce NB|}  : parts(sees lost Spy evs); \
paulson@2318
   254
\           Crypt(pubK A'){|Nonce NA', Nonce NB|} : parts(sees lost Spy evs); \
paulson@2318
   255
\           Nonce NB ~: analz (sees lost Spy evs);                            \
paulson@2318
   256
\           evs : ns_public |]                                                \
paulson@2318
   257
\        ==> A=A' & NA=NA'";
paulson@2418
   258
by (prove_unique_tac lemma 1);
paulson@2318
   259
qed "unique_NB";
paulson@2318
   260
paulson@2318
   261
paulson@2318
   262
(*NB remains secret PROVIDED Alice never responds with round 3*)
paulson@2318
   263
goal thy 
paulson@2536
   264
 "!!evs.[| Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set_of_list evs;\
paulson@2536
   265
\          (ALL C. Says A C (Crypt (pubK C) (Nonce NB)) ~: set_of_list evs);  \
paulson@2536
   266
\          A ~: lost;  B ~: lost;  evs : ns_public |]   \
paulson@2536
   267
\       ==> Nonce NB ~: analz (sees lost Spy evs)";
paulson@2536
   268
by (etac rev_mp 1);
paulson@2536
   269
by (etac rev_mp 1);
paulson@2418
   270
by (analz_induct_tac 1);
paulson@2318
   271
(*NS1*)
paulson@2536
   272
by (fast_tac (!claset addSEs sees_Spy_partsEs) 2);
paulson@2318
   273
(*Fake*)
paulson@2497
   274
by (spy_analz_tac 1);
paulson@2318
   275
(*NS2 and NS3*)
paulson@2536
   276
by (ALLGOALS (asm_simp_tac (!simpset addsimps [all_conj_distrib])));
paulson@2536
   277
by (step_tac (!claset delrules [allI]) 1);
paulson@2536
   278
by (Fast_tac 5);
paulson@2536
   279
by (fast_tac (!claset addSIs [impOfSubs analz_subset_parts]) 1);
paulson@2318
   280
(*NS2*)
paulson@2536
   281
by (fast_tac (!claset addSEs sees_Spy_partsEs) 2);
paulson@2497
   282
by (fast_tac (!claset addSDs [Says_imp_sees_Spy' RS parts.Inj]
paulson@2497
   283
                      addEs  [no_nonce_NS1_NS2 RSN (2, rev_notE)]) 1);
paulson@2318
   284
(*NS3*)
paulson@2318
   285
by (forw_inst_tac [("A'","A")] (Says_imp_sees_Spy' RS parts.Inj RS unique_NB) 1
paulson@2318
   286
    THEN REPEAT (eresolve_tac [asm_rl, Says_imp_sees_Spy' RS parts.Inj] 1));
paulson@2318
   287
by (Fast_tac 1);
paulson@2536
   288
qed "Spy_not_see_NB";
paulson@2318
   289
paulson@2318
   290
paulson@2318
   291
paulson@2318
   292
(*Authentication for B: if he receives message 3 and has used NB
paulson@2536
   293
  in message 2, then A has sent message 3--to somebody....*)
paulson@2318
   294
goal thy 
paulson@2536
   295
 "!!evs. [| Says B A  (Crypt (pubK A) {|Nonce NA, Nonce NB|})          \
paulson@2536
   296
\             : set_of_list evs;                                       \
paulson@2536
   297
\           Says A' B (Crypt (pubK B) (Nonce NB)): set_of_list evs;    \
paulson@2536
   298
\           A ~: lost;  B ~: lost;  evs : ns_public |]                 \
paulson@2536
   299
\        ==> EX C. Says A C (Crypt (pubK C) (Nonce NB)) : set_of_list evs";
paulson@2536
   300
by (etac rev_mp 1);
paulson@2536
   301
(*prepare induction over Crypt (pubK B) NB : parts H*)
paulson@2536
   302
by (etac (Says_imp_sees_Spy' RS parts.Inj RS rev_mp) 1);
paulson@2418
   303
by (analz_induct_tac 1);
paulson@2318
   304
by (ALLGOALS (asm_simp_tac (!simpset addsimps [ex_disj_distrib])));
paulson@2318
   305
(*NS1*)
paulson@2536
   306
by (fast_tac (!claset addSEs sees_Spy_partsEs) 2);
paulson@2318
   307
(*Fake*)
paulson@2318
   308
by (REPEAT_FIRST (resolve_tac [impI, conjI]));
paulson@2318
   309
by (fast_tac (!claset addss (!simpset)) 1);
paulson@2516
   310
by (rtac (ccontr RS disjI2) 1);
paulson@2536
   311
by (forward_tac [Spy_not_see_NB] 1 THEN (REPEAT_FIRST assume_tac)
paulson@2536
   312
    THEN Fast_tac 1);
paulson@2318
   313
by (best_tac (!claset addSDs [impOfSubs Fake_parts_insert]
paulson@2516
   314
                      addDs  [impOfSubs analz_subset_parts] 
paulson@2516
   315
                      addss (!simpset)) 1);
paulson@2318
   316
(*NS3*)
paulson@2318
   317
by (Step_tac 1);
paulson@2536
   318
by (forward_tac [Spy_not_see_NB] 1 THEN (REPEAT_FIRST assume_tac)
paulson@2536
   319
    THEN Fast_tac 1);
paulson@2318
   320
by (best_tac (!claset addSDs [Says_imp_sees_Spy' RS parts.Inj]
paulson@2516
   321
                      addDs  [unique_NB]) 1);
paulson@2318
   322
qed "B_trusts_NS3";
paulson@2318
   323
paulson@2318
   324
paulson@2318
   325
(*Can we strengthen the secrecy theorem?  NO*)
paulson@2318
   326
goal thy 
paulson@2318
   327
 "!!evs. [| A ~: lost;  B ~: lost;  evs : ns_public |]   \
paulson@2318
   328
\ ==> Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set_of_list evs \
paulson@2318
   329
\     --> Nonce NB ~: analz (sees lost Spy evs)";
paulson@2418
   330
by (analz_induct_tac 1);
paulson@2318
   331
(*NS1*)
paulson@2318
   332
by (fast_tac (!claset addSEs partsEs
paulson@2497
   333
                      addSDs [Says_imp_sees_Spy' RS parts.Inj]) 2);
paulson@2318
   334
(*Fake*)
paulson@2497
   335
by (spy_analz_tac 1);
paulson@2318
   336
(*NS2 and NS3*)
paulson@2318
   337
by (Step_tac 1);
paulson@2497
   338
by (fast_tac (!claset addSIs [impOfSubs analz_subset_parts, usedI]) 1);
paulson@2318
   339
(*NS2*)
paulson@2318
   340
by (fast_tac (!claset addSEs partsEs
paulson@2497
   341
                      addSDs [Says_imp_sees_Spy' RS parts.Inj]) 2);
paulson@2318
   342
by (fast_tac (!claset addSDs [Says_imp_sees_Spy' RS parts.Inj]
paulson@2318
   343
                      addEs  [no_nonce_NS1_NS2 RSN (2, rev_notE)]) 1);
paulson@2318
   344
(*NS3*)
paulson@2318
   345
by (forw_inst_tac [("A'","A")] (Says_imp_sees_Spy' RS parts.Inj RS unique_NB) 1
paulson@2318
   346
    THEN REPEAT (eresolve_tac [asm_rl, Says_imp_sees_Spy' RS parts.Inj] 1));
paulson@2318
   347
by (Step_tac 1);
paulson@2318
   348
paulson@2318
   349
(*
paulson@2318
   350
THIS IS THE ATTACK!
paulson@2318
   351
Level 9
paulson@2318
   352
!!evs. [| A ~: lost; B ~: lost; evs : ns_public |]
paulson@2318
   353
       ==> Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB|})
paulson@2318
   354
           : set_of_list evs -->
paulson@2318
   355
           Nonce NB ~: analz (sees lost Spy evs)
paulson@2318
   356
 1. !!evs Aa Ba B' NAa NBa evsa.
paulson@2318
   357
       [| A ~: lost; B ~: lost; evsa : ns_public; A ~= Ba;
paulson@2318
   358
          Says B' A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set_of_list evsa;
paulson@2318
   359
          Says A Ba (Crypt (pubK Ba) {|Nonce NA, Agent A|}) : set_of_list evsa;
paulson@2318
   360
          Ba : lost;
paulson@2318
   361
          Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set_of_list evsa;
paulson@2318
   362
          Nonce NB ~: analz (sees lost Spy evsa) |]
paulson@2318
   363
       ==> False
paulson@2318
   364
*)
paulson@2318
   365
paulson@2318
   366
paulson@2318
   367