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