author | nipkow |
Wed, 30 Aug 2000 10:21:19 +0200 | |
changeset 9736 | 332fab43628f |
parent 6740 | 5b5bf511fdd5 |
child 11118 | c3946a7cdee4 |
permissions | -rw-r--r-- |
5430 | 1 |
(* Title: HOL/Auth/NSP_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 |
||
9736 | 14 |
fun impOfAlways th = |
15 |
rulify (th RS Always_includes_reachable RS subsetD RS CollectD); |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
16 |
|
5430 | 17 |
AddEs spies_partsEs; |
18 |
AddDs [impOfSubs analz_subset_parts]; |
|
19 |
AddDs [impOfSubs Fake_parts_insert]; |
|
20 |
||
21 |
AddIffs [Spy_in_bad]; |
|
22 |
||
23 |
(*For other theories, e.g. Mutex and Lift, using AddIffs slows proofs down. |
|
24 |
Here, it facilitates re-use of the Auth proofs.*) |
|
25 |
||
26 |
AddIffs (map simp_of_act [Fake_def, NS1_def, NS2_def, NS3_def]); |
|
27 |
||
28 |
Addsimps [Nprg_def RS def_prg_simps]; |
|
29 |
||
5648 | 30 |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
31 |
(*A "possibility property": there are traces that reach the end. |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
32 |
Replace by LEADSTO proof!*) |
5430 | 33 |
Goal "A ~= B ==> EX NB. EX s: reachable Nprg. \ |
34 |
\ Says A B (Crypt (pubK B) (Nonce NB)) : set s"; |
|
35 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
|
36 |
by (res_inst_tac [("act", "NS3")] reachable.Acts 2); |
|
37 |
by (res_inst_tac [("act", "NS2")] reachable.Acts 3); |
|
38 |
by (res_inst_tac [("act", "NS1")] reachable.Acts 4); |
|
5536 | 39 |
by (rtac reachable.Init 5); |
5648 | 40 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [Nprg_def]))); |
5536 | 41 |
by (REPEAT_FIRST (rtac exI )); |
5430 | 42 |
by possibility_tac; |
43 |
result(); |
|
44 |
||
45 |
||
46 |
(**** Inductive proofs about ns_public ****) |
|
47 |
||
48 |
(*can be used to simulate analz_mono_contra_tac |
|
49 |
val analz_impI = read_instantiate_sg (sign_of thy) |
|
50 |
[("P", "?Y ~: analz (spies ?evs)")] impI; |
|
51 |
||
52 |
val spies_Says_analz_contraD = |
|
53 |
spies_subset_spies_Says RS analz_mono RS contra_subsetD; |
|
54 |
||
55 |
by (rtac analz_impI 2); |
|
56 |
by (auto_tac (claset() addSDs [spies_Says_analz_contraD], simpset())); |
|
57 |
*) |
|
58 |
||
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
59 |
fun ns_constrains_tac i = |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
60 |
SELECT_GOAL |
6709 | 61 |
(EVERY [REPEAT (etac Always_ConstrainsI 1), |
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
62 |
REPEAT (resolve_tac [StableI, stableI, |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
63 |
constrains_imp_Constrains] 1), |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
64 |
rtac constrainsI 1, |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
65 |
Full_simp_tac 1, |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
66 |
REPEAT (FIRSTGOAL (etac disjE)), |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
67 |
ALLGOALS (clarify_tac (claset() delrules [impI,impCE])), |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
68 |
REPEAT (FIRSTGOAL analz_mono_contra_tac), |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
69 |
ALLGOALS Asm_simp_tac]) i; |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
70 |
|
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
71 |
(*Tactic for proving secrecy theorems*) |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
72 |
val ns_induct_tac = |
5430 | 73 |
(SELECT_GOAL o EVERY) |
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
74 |
[rtac AlwaysI 1, |
5430 | 75 |
Force_tac 1, |
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
76 |
(*"reachable" gets in here*) |
6740 | 77 |
rtac (Always_reachable RS Always_ConstrainsI RS StableI) 1, |
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
78 |
ns_constrains_tac 1]; |
5430 | 79 |
|
80 |
||
81 |
(** Theorems of the form X ~: parts (spies evs) imply that NOBODY |
|
82 |
sends messages containing X! **) |
|
83 |
||
84 |
(*Spy never sees another agent's private key! (unless it's bad at start)*) |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
85 |
Goal "Nprg : Always {s. (Key (priK A) : parts (spies s)) = (A : bad)}"; |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
86 |
by (ns_induct_tac 1); |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
87 |
by (Blast_tac 1); |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
88 |
qed "Spy_see_priK"; |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
89 |
Addsimps [impOfAlways Spy_see_priK]; |
5430 | 90 |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
91 |
Goal "Nprg : Always {s. (Key (priK A) : analz (spies s)) = (A : bad)}"; |
6709 | 92 |
by (rtac (Always_reachable RS Always_weaken) 1); |
5430 | 93 |
by Auto_tac; |
94 |
qed "Spy_analz_priK"; |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
95 |
Addsimps [impOfAlways Spy_analz_priK]; |
5430 | 96 |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
97 |
(** |
5430 | 98 |
AddSDs [Spy_see_priK RSN (2, rev_iffD1), |
99 |
Spy_analz_priK RSN (2, rev_iffD1)]; |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
100 |
**) |
5430 | 101 |
|
102 |
||
103 |
(**** Authenticity properties obtained from NS2 ****) |
|
104 |
||
105 |
(*It is impossible to re-use a nonce in both NS1 and NS2, provided the nonce |
|
106 |
is secret. (Honest users generate fresh nonces.)*) |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
107 |
Goal |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
108 |
"Nprg \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
109 |
\ : Always {s. Nonce NA ~: analz (spies s) --> \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
110 |
\ Crypt (pubK B) {|Nonce NA, Agent A|} : parts (spies s) --> \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
111 |
\ Crypt (pubK C) {|NA', Nonce NA|} ~: parts (spies s)}"; |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
112 |
by (ns_induct_tac 1); |
5430 | 113 |
by (ALLGOALS Blast_tac); |
114 |
qed "no_nonce_NS1_NS2"; |
|
115 |
||
116 |
(*Adding it to the claset slows down proofs...*) |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
117 |
val nonce_NS1_NS2_E = impOfAlways no_nonce_NS1_NS2 RSN (2, rev_notE); |
5430 | 118 |
|
119 |
||
120 |
(*Unicity for NS1: nonce NA identifies agents A and B*) |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
121 |
Goal |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
122 |
"Nprg \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
123 |
\ : Always {s. Nonce NA ~: analz (spies s) --> \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
124 |
\ (EX A' B'. ALL A B. \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
125 |
\ Crypt (pubK B) {|Nonce NA, Agent A|} : parts (spies s) --> \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
126 |
\ A=A' & B=B')}"; |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
127 |
by (ns_induct_tac 1); |
5430 | 128 |
by (ALLGOALS (simp_tac (simpset() addsimps [all_conj_distrib]))); |
129 |
(*NS1*) |
|
130 |
by (expand_case_tac "NA = ?y" 2 THEN Blast_tac 2); |
|
131 |
(*Fake*) |
|
132 |
by (Blast_tac 1); |
|
133 |
val lemma = result(); |
|
134 |
||
135 |
Goal "[| Crypt(pubK B) {|Nonce NA, Agent A|} : parts(spies s); \ |
|
136 |
\ Crypt(pubK B') {|Nonce NA, Agent A'|} : parts(spies s); \ |
|
137 |
\ Nonce NA ~: analz (spies s); \ |
|
138 |
\ s : reachable Nprg |] \ |
|
139 |
\ ==> A=A' & B=B'"; |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
140 |
by (prove_unique_tac (impOfAlways lemma) 1); |
5430 | 141 |
qed "unique_NA"; |
142 |
||
143 |
||
144 |
(*Secrecy: Spy does not see the nonce sent in msg NS1 if A and B are secure*) |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
145 |
Goal "[| A ~: bad; B ~: bad |] \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
146 |
\ ==> Nprg : Always \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
147 |
\ {s. Says A B (Crypt(pubK B) {|Nonce NA, Agent A|}) : set s \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
148 |
\ --> Nonce NA ~: analz (spies s)}"; |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
149 |
by (ns_induct_tac 1); |
5430 | 150 |
(*NS3*) |
151 |
by (blast_tac (claset() addEs [nonce_NS1_NS2_E]) 4); |
|
152 |
(*NS2*) |
|
153 |
by (blast_tac (claset() addDs [unique_NA]) 3); |
|
154 |
(*NS1*) |
|
155 |
by (Blast_tac 2); |
|
156 |
(*Fake*) |
|
157 |
by (spy_analz_tac 1); |
|
158 |
qed "Spy_not_see_NA"; |
|
159 |
||
160 |
||
161 |
(*Authentication for A: if she receives message 2 and has used NA |
|
162 |
to start a run, then B has sent message 2.*) |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
163 |
val prems = |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
164 |
goal thy "[| A ~: bad; B ~: bad |] \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
165 |
\ ==> Nprg : Always \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
166 |
\ {s. Says A B (Crypt(pubK B) {|Nonce NA, Agent A|}) : set s & \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
167 |
\ Crypt(pubK A) {|Nonce NA, Nonce NB|} : parts (knows Spy s) \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
168 |
\ --> Says B A (Crypt(pubK A) {|Nonce NA, Nonce NB|}): set s}"; |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
169 |
(*insert an invariant for use in some of the subgoals*) |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
170 |
by (cut_facts_tac ([prems MRS Spy_not_see_NA] @ prems) 1); |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
171 |
by (ns_induct_tac 1); |
5430 | 172 |
by (ALLGOALS Clarify_tac); |
173 |
(*NS2*) |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
174 |
by (blast_tac (claset() addDs [unique_NA]) 3); |
5430 | 175 |
(*NS1*) |
176 |
by (Blast_tac 2); |
|
177 |
(*Fake*) |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
178 |
by (Blast_tac 1); |
5430 | 179 |
qed "A_trusts_NS2"; |
180 |
||
181 |
||
182 |
(*If the encrypted message appears then it originated with Alice in NS1*) |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
183 |
Goal "Nprg : Always \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
184 |
\ {s. Nonce NA ~: analz (spies s) --> \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
185 |
\ Crypt (pubK B) {|Nonce NA, Agent A|} : parts (spies s) \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
186 |
\ --> Says A B (Crypt (pubK B) {|Nonce NA, Agent A|}) : set s}"; |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
187 |
by (ns_induct_tac 1); |
5430 | 188 |
by (Blast_tac 1); |
189 |
qed "B_trusts_NS1"; |
|
190 |
||
191 |
||
192 |
||
193 |
(**** Authenticity properties obtained from NS2 ****) |
|
194 |
||
195 |
(*Unicity for NS2: nonce NB identifies nonce NA and agent A |
|
196 |
[proof closely follows that for unique_NA] *) |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
197 |
Goal |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
198 |
"Nprg \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
199 |
\ : Always {s. Nonce NB ~: analz (spies s) --> \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
200 |
\ (EX A' NA'. ALL A NA. \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
201 |
\ Crypt (pubK A) {|Nonce NA, Nonce NB|} : parts (spies s) \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
202 |
\ --> A=A' & NA=NA')}"; |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
203 |
by (ns_induct_tac 1); |
5430 | 204 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib]))); |
205 |
(*NS2*) |
|
206 |
by (expand_case_tac "NB = ?y" 2 THEN Blast_tac 2); |
|
207 |
(*Fake*) |
|
208 |
by (Blast_tac 1); |
|
209 |
val lemma = result(); |
|
210 |
||
211 |
Goal "[| Crypt(pubK A) {|Nonce NA, Nonce NB|} : parts(spies s); \ |
|
212 |
\ Crypt(pubK A'){|Nonce NA', Nonce NB|} : parts(spies s); \ |
|
213 |
\ Nonce NB ~: analz (spies s); \ |
|
214 |
\ s : reachable Nprg |] \ |
|
215 |
\ ==> A=A' & NA=NA'"; |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
216 |
by (prove_unique_tac (impOfAlways lemma) 1); |
5430 | 217 |
qed "unique_NB"; |
218 |
||
219 |
||
220 |
(*NB remains secret PROVIDED Alice never responds with round 3*) |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
221 |
Goal "[| A ~: bad; B ~: bad |] \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
222 |
\ ==> Nprg : Always \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
223 |
\ {s. Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set s & \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
224 |
\ (ALL C. Says A C (Crypt (pubK C) (Nonce NB)) ~: set s) \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
225 |
\ --> Nonce NB ~: analz (spies s)}"; |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
226 |
by (ns_induct_tac 1); |
5430 | 227 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib]))); |
228 |
by (ALLGOALS Clarify_tac); |
|
229 |
(*NS3: because NB determines A*) |
|
230 |
by (blast_tac (claset() addDs [unique_NB]) 4); |
|
231 |
(*NS2: by freshness and unicity of NB*) |
|
232 |
by (blast_tac (claset() addEs [nonce_NS1_NS2_E]) 3); |
|
233 |
(*NS1: by freshness*) |
|
234 |
by (Blast_tac 2); |
|
235 |
(*Fake*) |
|
236 |
by (spy_analz_tac 1); |
|
237 |
qed "Spy_not_see_NB"; |
|
238 |
||
239 |
||
240 |
||
241 |
(*Authentication for B: if he receives message 3 and has used NB |
|
242 |
in message 2, then A has sent message 3--to somebody....*) |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
243 |
val prems = |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
244 |
goal thy "[| A ~: bad; B ~: bad |] \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
245 |
\ ==> Nprg : Always \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
246 |
\ {s. Crypt (pubK B) (Nonce NB) : parts (spies s) & \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
247 |
\ Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set s \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
248 |
\ --> (EX C. Says A C (Crypt (pubK C) (Nonce NB)) : set s)}"; |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
249 |
(*insert an invariant for use in some of the subgoals*) |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
250 |
by (cut_facts_tac ([prems MRS Spy_not_see_NB] @ prems) 1); |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
251 |
by (ns_induct_tac 1); |
5430 | 252 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [ex_disj_distrib]))); |
253 |
by (ALLGOALS Clarify_tac); |
|
254 |
(*NS3: because NB determines A (this use of unique_NB is more robust) *) |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
255 |
by (blast_tac (claset() addIs [unique_NB RS conjunct1]) 3); |
5430 | 256 |
(*NS1: by freshness*) |
257 |
by (Blast_tac 2); |
|
258 |
(*Fake*) |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
259 |
by (Blast_tac 1); |
5430 | 260 |
qed "B_trusts_NS3"; |
261 |
||
262 |
||
263 |
(*Can we strengthen the secrecy theorem? NO*) |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
264 |
Goal "[| A ~: bad; B ~: bad |] \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
265 |
\ ==> Nprg : Always \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
266 |
\ {s. Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set s \ |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
267 |
\ --> Nonce NB ~: analz (spies s)}"; |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
268 |
by (ns_induct_tac 1); |
5430 | 269 |
by (ALLGOALS Clarify_tac); |
270 |
(*NS2: by freshness and unicity of NB*) |
|
271 |
by (blast_tac (claset() addEs [nonce_NS1_NS2_E]) 3); |
|
272 |
(*NS1: by freshness*) |
|
273 |
by (Blast_tac 2); |
|
274 |
(*Fake*) |
|
275 |
by (spy_analz_tac 1); |
|
276 |
(*NS3: unicity of NB identifies A and NA, but not B*) |
|
277 |
by (forw_inst_tac [("A'","A")] (Says_imp_spies RS parts.Inj RS unique_NB) 1 |
|
278 |
THEN REPEAT (eresolve_tac [asm_rl, Says_imp_spies RS parts.Inj] 1)); |
|
279 |
by Auto_tac; |
|
280 |
by (rename_tac "s B' C" 1); |
|
281 |
||
282 |
(* |
|
283 |
THIS IS THE ATTACK! |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
284 |
[| A ~: bad; B ~: bad |] |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
285 |
==> Nprg |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
286 |
: Always |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
287 |
{s. Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set s --> |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
288 |
Nonce NB ~: analz (knows Spy s)} |
5430 | 289 |
1. !!s B' C. |
290 |
[| A ~: bad; B ~: bad; s : reachable Nprg; |
|
291 |
Says A C (Crypt (pubK C) {|Nonce NA, Agent A|}) : set s; |
|
6673
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
292 |
Says B' A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set s; |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
293 |
C : bad; Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set s; |
ca95af28fb33
redid proofs to use "always" rather than "reachable" (somewhat)
paulson
parents:
6570
diff
changeset
|
294 |
Nonce NB ~: analz (knows Spy s) |] |
5430 | 295 |
==> False |
296 |
*) |