author | paulson |
Tue, 23 Dec 1997 11:43:48 +0100 | |
changeset 4470 | af3239def3d4 |
parent 4449 | df30e75f670f |
child 4477 | b3e5857d8d99 |
permissions | -rw-r--r-- |
2318 | 1 |
(* Title: HOL/Auth/NS_Public |
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 |
Version incorporating Lowe's fix (inclusion of B's identify in round 2). |
|
4470 | 8 |
|
9 |
This version is experimental. It adds many more rules to the claset and even |
|
10 |
replaces Fake_parts_insert_tac by Blast_tac. |
|
2318 | 11 |
*) |
12 |
||
13 |
open NS_Public; |
|
14 |
||
4449 | 15 |
set proof_timing; |
2318 | 16 |
HOL_quantifiers := false; |
17 |
||
4470 | 18 |
AddEs spies_partsEs; |
19 |
AddDs [impOfSubs analz_subset_parts]; |
|
20 |
AddDs [impOfSubs Fake_parts_insert]; |
|
21 |
||
3683 | 22 |
AddIffs [Spy_in_bad]; |
2318 | 23 |
|
24 |
(*A "possibility property": there are traces that reach the end*) |
|
25 |
goal thy |
|
26 |
"!!A B. A ~= B ==> EX NB. EX evs: ns_public. \ |
|
3465 | 27 |
\ Says A B (Crypt (pubK B) (Nonce NB)) : set evs"; |
2318 | 28 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
29 |
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
|
30 |
by possibility_tac; |
2318 | 31 |
result(); |
32 |
||
33 |
||
34 |
(**** Inductive proofs about ns_public ****) |
|
35 |
||
36 |
(*Nobody sends themselves messages*) |
|
3465 | 37 |
goal thy "!!evs. evs : ns_public ==> ALL A X. Says A A X ~: set evs"; |
2318 | 38 |
by (etac ns_public.induct 1); |
39 |
by (Auto_tac()); |
|
40 |
qed_spec_mp "not_Says_to_self"; |
|
41 |
Addsimps [not_Says_to_self]; |
|
42 |
AddSEs [not_Says_to_self RSN (2, rev_notE)]; |
|
43 |
||
44 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
45 |
(*Induction for regularity theorems. If induction formula has the form |
3683 | 46 |
X ~: analz (spies evs) --> ... then it shortens the proof by discarding |
47 |
needless information about analz (insert X (spies evs)) *) |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
48 |
fun parts_induct_tac i = |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
49 |
etac ns_public.induct i |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
50 |
THEN |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
51 |
REPEAT (FIRSTGOAL analz_mono_contra_tac) |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
52 |
THEN |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
53 |
prove_simple_subgoals_tac i; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
54 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
55 |
|
3683 | 56 |
(** Theorems of the form X ~: parts (spies evs) imply that NOBODY |
2318 | 57 |
sends messages containing X! **) |
58 |
||
3683 | 59 |
(*Spy never sees another agent's private key! (unless it's bad at start)*) |
2318 | 60 |
goal thy |
3683 | 61 |
"!!A. evs: ns_public ==> (Key (priK A) : parts (spies evs)) = (A : bad)"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
62 |
by (parts_induct_tac 1); |
4470 | 63 |
by (Blast_tac 1); |
2318 | 64 |
qed "Spy_see_priK"; |
65 |
Addsimps [Spy_see_priK]; |
|
66 |
||
67 |
goal thy |
|
3683 | 68 |
"!!A. evs: ns_public ==> (Key (priK A) : analz (spies evs)) = (A : bad)"; |
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4197
diff
changeset
|
69 |
by (Auto_tac()); |
2318 | 70 |
qed "Spy_analz_priK"; |
71 |
Addsimps [Spy_analz_priK]; |
|
72 |
||
4470 | 73 |
AddSDs [Spy_see_priK RSN (2, rev_iffD1), |
74 |
Spy_analz_priK RSN (2, rev_iffD1)]; |
|
2318 | 75 |
|
76 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
77 |
(**** Authenticity properties obtained from NS2 ****) |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
78 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
79 |
(*It is impossible to re-use a nonce in both NS1 and NS2, provided the nonce |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
80 |
is secret. (Honest users generate fresh nonces.)*) |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
81 |
goal thy |
3683 | 82 |
"!!evs. [| Crypt (pubK B) {|Nonce NA, Agent A|} : parts (spies evs); \ |
83 |
\ Nonce NA ~: analz (spies evs); \ |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
84 |
\ evs : ns_public |] \ |
3683 | 85 |
\ ==> Crypt (pubK C) {|NA', Nonce NA, Agent D|} ~: parts (spies evs)"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
86 |
by (etac rev_mp 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
87 |
by (etac rev_mp 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
88 |
by (parts_induct_tac 1); |
4470 | 89 |
by (ALLGOALS Blast_tac); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
90 |
qed "no_nonce_NS1_NS2"; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
91 |
|
4470 | 92 |
(*Adding it to the claset slows down proofs...*) |
93 |
val nonce_NS1_NS2_E = no_nonce_NS1_NS2 RSN (2, rev_notE); |
|
94 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
95 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
96 |
(*Unicity for NS1: nonce NA identifies agents A and B*) |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
97 |
goal thy |
3683 | 98 |
"!!evs. [| Nonce NA ~: analz (spies evs); evs : ns_public |] \ |
3709 | 99 |
\ ==> EX A' B'. ALL A B. \ |
3683 | 100 |
\ Crypt (pubK B) {|Nonce NA, Agent A|} : parts (spies evs) --> \ |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
101 |
\ A=A' & B=B'"; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
102 |
by (etac rev_mp 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
103 |
by (parts_induct_tac 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
104 |
by (ALLGOALS |
4470 | 105 |
(asm_simp_tac (simpset() addsimps [all_conj_distrib, |
106 |
parts_insert_spies]))); |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
107 |
(*NS1*) |
4470 | 108 |
by (expand_case_tac "NA = ?y" 2 THEN Blast_tac 2); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
109 |
(*Fake*) |
3709 | 110 |
by (Clarify_tac 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
111 |
by (ex_strip_tac 1); |
4470 | 112 |
by (Blast_tac 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
113 |
val lemma = result(); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
114 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
115 |
goal thy |
3683 | 116 |
"!!evs. [| Crypt(pubK B) {|Nonce NA, Agent A|} : parts(spies evs); \ |
117 |
\ Crypt(pubK B') {|Nonce NA, Agent A'|} : parts(spies evs); \ |
|
118 |
\ Nonce NA ~: analz (spies evs); \ |
|
119 |
\ evs : ns_public |] \ |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
120 |
\ ==> A=A' & B=B'"; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
121 |
by (prove_unique_tac lemma 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
122 |
qed "unique_NA"; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
123 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
124 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
125 |
(*Tactic for proving secrecy theorems*) |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
126 |
fun analz_induct_tac i = |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
127 |
etac ns_public.induct i THEN |
4470 | 128 |
ALLGOALS (asm_simp_tac (simpset() addsplits [expand_if])); |
2318 | 129 |
|
130 |
||
131 |
(*Secrecy: Spy does not see the nonce sent in msg NS1 if A and B are secure*) |
|
132 |
goal thy |
|
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
133 |
"!!evs. [| Says A B (Crypt(pubK B) {|Nonce NA, Agent A|}) : set evs; \ |
3683 | 134 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
135 |
\ ==> Nonce NA ~: analz (spies evs)"; |
|
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
136 |
by (etac rev_mp 1); |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
137 |
by (analz_induct_tac 1); |
2318 | 138 |
(*NS3*) |
4470 | 139 |
by (blast_tac (claset() addEs [nonce_NS1_NS2_E]) 4); |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
140 |
(*NS2*) |
4470 | 141 |
by (blast_tac (claset() addDs [unique_NA]) 3); |
2318 | 142 |
(*NS1*) |
4470 | 143 |
by (Blast_tac 2); |
2318 | 144 |
(*Fake*) |
2497 | 145 |
by (spy_analz_tac 1); |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
146 |
qed "Spy_not_see_NA"; |
2318 | 147 |
|
148 |
||
149 |
(*Authentication for A: if she receives message 2 and has used NA |
|
150 |
to start a run, then B has sent message 2.*) |
|
151 |
goal thy |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
152 |
"!!evs. [| Says A B (Crypt (pubK B) {|Nonce NA, Agent A|}) : set evs; \ |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
153 |
\ Says B' A (Crypt(pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
154 |
\ : set evs; \ |
3683 | 155 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
156 |
\ ==> Says B A (Crypt(pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
3465 | 157 |
\ : set evs"; |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
158 |
by (etac rev_mp 1); |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
159 |
(*prepare induction over Crypt (pubK A) {|NA,NB,B|} : parts H*) |
3683 | 160 |
by (etac (Says_imp_spies RS parts.Inj RS rev_mp) 1); |
2318 | 161 |
by (etac ns_public.induct 1); |
162 |
by (ALLGOALS Asm_simp_tac); |
|
163 |
(*NS1*) |
|
4470 | 164 |
by (Blast_tac 2); |
2318 | 165 |
(*Fake*) |
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4197
diff
changeset
|
166 |
by (blast_tac (claset() addDs [Spy_not_see_NA]) 1); |
2318 | 167 |
qed "A_trusts_NS2"; |
168 |
||
169 |
(*If the encrypted message appears then it originated with Alice in NS1*) |
|
170 |
goal thy |
|
3683 | 171 |
"!!evs. [| Crypt (pubK B) {|Nonce NA, Agent A|} : parts (spies evs); \ |
172 |
\ Nonce NA ~: analz (spies evs); \ |
|
173 |
\ evs : ns_public |] \ |
|
3465 | 174 |
\ ==> Says A B (Crypt (pubK B) {|Nonce NA, Agent A|}) : set evs"; |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
175 |
by (etac rev_mp 1); |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
176 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
177 |
by (parts_induct_tac 1); |
4470 | 178 |
by (Blast_tac 1); |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
179 |
qed "B_trusts_NS1"; |
2318 | 180 |
|
181 |
||
182 |
||
183 |
(**** Authenticity properties obtained from NS2 ****) |
|
184 |
||
2480 | 185 |
(*Unicity for NS2: nonce NB identifies nonce NA and agents A, B |
2318 | 186 |
[unicity of B makes Lowe's fix work] |
187 |
[proof closely follows that for unique_NA] *) |
|
188 |
goal thy |
|
3709 | 189 |
"!!evs. [| Nonce NB ~: analz (spies evs); evs : ns_public |] \ |
190 |
\ ==> EX A' NA' B'. ALL A NA B. \ |
|
3683 | 191 |
\ Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|} : parts (spies evs) \ |
192 |
\ --> A=A' & NA=NA' & B=B'"; |
|
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
193 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
194 |
by (parts_induct_tac 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
195 |
by (ALLGOALS |
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4197
diff
changeset
|
196 |
(asm_simp_tac (simpset() addsimps [all_conj_distrib, |
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4197
diff
changeset
|
197 |
parts_insert_spies]))); |
2318 | 198 |
(*NS2*) |
4470 | 199 |
by (expand_case_tac "NB = ?y" 2 THEN Blast_tac 2); |
2318 | 200 |
(*Fake*) |
3709 | 201 |
by (Clarify_tac 1); |
2318 | 202 |
by (ex_strip_tac 1); |
4470 | 203 |
by (Blast_tac 1); |
2318 | 204 |
val lemma = result(); |
205 |
||
206 |
goal thy |
|
207 |
"!!evs. [| Crypt(pubK A) {|Nonce NA, Nonce NB, Agent B|} \ |
|
3709 | 208 |
\ : parts(spies evs); \ |
2318 | 209 |
\ Crypt(pubK A') {|Nonce NA', Nonce NB, Agent B'|} \ |
3709 | 210 |
\ : parts(spies evs); \ |
211 |
\ Nonce NB ~: analz (spies evs); \ |
|
2318 | 212 |
\ evs : ns_public |] \ |
213 |
\ ==> A=A' & NA=NA' & B=B'"; |
|
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
214 |
by (prove_unique_tac lemma 1); |
2318 | 215 |
qed "unique_NB"; |
216 |
||
4470 | 217 |
AddDs [unique_NB]; |
218 |
||
2318 | 219 |
|
220 |
(*Secrecy: Spy does not see the nonce sent in msg NS2 if A and B are secure*) |
|
221 |
goal thy |
|
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
222 |
"!!evs. [| Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
223 |
\ : set evs; \ |
3683 | 224 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
225 |
\ ==> Nonce NB ~: analz (spies evs)"; |
|
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
226 |
by (etac rev_mp 1); |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
227 |
by (analz_induct_tac 1); |
2318 | 228 |
(*NS3*) |
4470 | 229 |
by (Blast_tac 4); |
3709 | 230 |
(*NS2: by freshness and unicity of NB*) |
4470 | 231 |
by (blast_tac (claset() addEs [nonce_NS1_NS2_E]) 3); |
2318 | 232 |
(*NS1*) |
4470 | 233 |
by (Blast_tac 2); |
2318 | 234 |
(*Fake*) |
2497 | 235 |
by (spy_analz_tac 1); |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
236 |
qed "Spy_not_see_NB"; |
2318 | 237 |
|
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4197
diff
changeset
|
238 |
AddDs [Spy_not_see_NB]; |
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4197
diff
changeset
|
239 |
|
2318 | 240 |
|
241 |
(*Authentication for B: if he receives message 3 and has used NB |
|
242 |
in message 2, then A has sent message 3.*) |
|
243 |
goal thy |
|
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
244 |
"!!evs. [| Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
245 |
\ : set evs; \ |
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
246 |
\ Says A' B (Crypt (pubK B) (Nonce NB)): set evs; \ |
4197 | 247 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
3465 | 248 |
\ ==> Says A B (Crypt (pubK B) (Nonce NB)) : set evs"; |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
249 |
by (etac rev_mp 1); |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
250 |
(*prepare induction over Crypt (pubK B) NB : parts H*) |
3683 | 251 |
by (etac (Says_imp_spies RS parts.Inj RS rev_mp) 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
252 |
by (parts_induct_tac 1); |
3709 | 253 |
by (ALLGOALS Clarify_tac); |
4470 | 254 |
by (ALLGOALS Blast_tac); |
2318 | 255 |
qed "B_trusts_NS3"; |
256 |
||
257 |
||
258 |
(**** Overall guarantee for B*) |
|
259 |
||
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
260 |
(*Matches only NS2, not NS1 (or NS3)*) |
3683 | 261 |
val Says_imp_spies' = |
262 |
read_instantiate [("X","Crypt ?K {|?XX,?YY,?ZZ|}")] Says_imp_spies; |
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
263 |
|
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
264 |
|
2318 | 265 |
(*If B receives NS3 and the nonce NB agrees with the nonce he joined with |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
266 |
NA, then A initiated the run using NA. SAME proof as B_trusts_NS3!*) |
2318 | 267 |
goal thy |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
268 |
"!!evs. [| Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
269 |
\ : set evs; \ |
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
270 |
\ Says A' B (Crypt (pubK B) (Nonce NB)): set evs; \ |
3683 | 271 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
3465 | 272 |
\ ==> Says A B (Crypt (pubK B) {|Nonce NA, Agent A|}) : set evs"; |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
273 |
by (etac rev_mp 1); |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
274 |
(*prepare induction over Crypt (pubK B) {|NB|} : parts H*) |
3683 | 275 |
by (etac (Says_imp_spies RS parts.Inj RS rev_mp) 1); |
2318 | 276 |
by (etac ns_public.induct 1); |
277 |
by (ALLGOALS Asm_simp_tac); |
|
3709 | 278 |
by (ALLGOALS Clarify_tac); |
4470 | 279 |
(*NS3 holds because NB determines A and NA*) |
280 |
by (ALLGOALS Blast_tac); |
|
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
281 |
qed "B_trusts_protocol"; |
2318 | 282 |