author | paulson |
Fri, 11 Jul 1997 13:32:39 +0200 | |
changeset 3516 | 470626799511 |
parent 3466 | 30791e5a69c4 |
child 3519 | ab0a9fbed4c0 |
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). |
|
3516
470626799511
Removal of monotonicity reasoning involving "lost" and the theorem
paulson
parents:
3466
diff
changeset
|
8 |
|
470626799511
Removal of monotonicity reasoning involving "lost" and the theorem
paulson
parents:
3466
diff
changeset
|
9 |
PROOFS BELOW MIGHT BE SIMPLIFIED using Yahalom's analz_mono_parts_induct_tac |
2318 | 10 |
*) |
11 |
||
12 |
open NS_Public; |
|
13 |
||
14 |
proof_timing:=true; |
|
15 |
HOL_quantifiers := false; |
|
16 |
||
17 |
AddIffs [Spy_in_lost]; |
|
18 |
||
19 |
(*Replacing the variable by a constant improves search speed by 50%!*) |
|
20 |
val Says_imp_sees_Spy' = |
|
21 |
read_instantiate_sg (sign_of thy) [("lost","lost")] Says_imp_sees_Spy; |
|
22 |
||
23 |
(*A "possibility property": there are traces that reach the end*) |
|
24 |
goal thy |
|
25 |
"!!A B. A ~= B ==> EX NB. EX evs: ns_public. \ |
|
3465 | 26 |
\ Says A B (Crypt (pubK B) (Nonce NB)) : set evs"; |
2318 | 27 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
28 |
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
|
29 |
by possibility_tac; |
2318 | 30 |
result(); |
31 |
||
32 |
||
33 |
(**** Inductive proofs about ns_public ****) |
|
34 |
||
35 |
(*Nobody sends themselves messages*) |
|
3465 | 36 |
goal thy "!!evs. evs : ns_public ==> ALL A X. Says A A X ~: set evs"; |
2318 | 37 |
by (etac ns_public.induct 1); |
38 |
by (Auto_tac()); |
|
39 |
qed_spec_mp "not_Says_to_self"; |
|
40 |
Addsimps [not_Says_to_self]; |
|
41 |
AddSEs [not_Says_to_self RSN (2, rev_notE)]; |
|
42 |
||
43 |
||
44 |
(** Theorems of the form X ~: parts (sees lost Spy evs) imply that NOBODY |
|
45 |
sends messages containing X! **) |
|
46 |
||
47 |
(*Spy never sees another agent's private key! (unless it's lost at start)*) |
|
48 |
goal thy |
|
49 |
"!!evs. evs : ns_public \ |
|
50 |
\ ==> (Key (priK A) : parts (sees lost Spy evs)) = (A : lost)"; |
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
51 |
by (etac ns_public.induct 1); |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
52 |
by (prove_simple_subgoals_tac 1); |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
53 |
by (Fake_parts_insert_tac 1); |
2318 | 54 |
qed "Spy_see_priK"; |
55 |
Addsimps [Spy_see_priK]; |
|
56 |
||
57 |
goal thy |
|
58 |
"!!evs. evs : ns_public \ |
|
59 |
\ ==> (Key (priK A) : analz (sees lost Spy evs)) = (A : lost)"; |
|
60 |
by (auto_tac(!claset addDs [impOfSubs analz_subset_parts], !simpset)); |
|
61 |
qed "Spy_analz_priK"; |
|
62 |
Addsimps [Spy_analz_priK]; |
|
63 |
||
64 |
goal thy "!!A. [| Key (priK A) : parts (sees lost Spy evs); \ |
|
65 |
\ evs : ns_public |] ==> A:lost"; |
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
66 |
by (blast_tac (!claset addDs [Spy_see_priK]) 1); |
2318 | 67 |
qed "Spy_see_priK_D"; |
68 |
||
69 |
bind_thm ("Spy_analz_priK_D", analz_subset_parts RS subsetD RS Spy_see_priK_D); |
|
70 |
AddSDs [Spy_see_priK_D, Spy_analz_priK_D]; |
|
71 |
||
72 |
||
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
73 |
fun analz_induct_tac i = |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
74 |
etac ns_public.induct i THEN |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
75 |
ALLGOALS (asm_simp_tac |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2497
diff
changeset
|
76 |
(!simpset addsimps [not_parts_not_analz] |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2418
diff
changeset
|
77 |
setloop split_tac [expand_if])); |
2318 | 78 |
|
79 |
(**** Authenticity properties obtained from NS2 ****) |
|
80 |
||
81 |
(*It is impossible to re-use a nonce in both NS1 and NS2, provided the nonce |
|
82 |
is secret. (Honest users generate fresh nonces.)*) |
|
83 |
goal thy |
|
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
84 |
"!!evs. [| Nonce NA ~: analz (sees lost Spy evs); \ |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
85 |
\ Crypt (pubK B) {|Nonce NA, Agent A|} : parts (sees lost Spy evs); \ |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
86 |
\ evs : ns_public |] \ |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
87 |
\ ==> Crypt (pubK C) {|NA', Nonce NA, Agent D|} ~: parts (sees lost Spy evs)"; |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
88 |
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
|
89 |
by (etac rev_mp 1); |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
90 |
by (analz_induct_tac 1); |
2318 | 91 |
(*NS3*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
92 |
by (blast_tac (!claset addSEs partsEs) 4); |
2318 | 93 |
(*NS2*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
94 |
by (blast_tac (!claset addSEs partsEs) 3); |
2318 | 95 |
(*Fake*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
96 |
by (blast_tac (!claset addSIs [analz_insertI] |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
97 |
addDs [impOfSubs analz_subset_parts, |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
98 |
impOfSubs Fake_parts_insert]) 2); |
2318 | 99 |
(*Base*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
100 |
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
|
101 |
qed "no_nonce_NS1_NS2"; |
2318 | 102 |
|
103 |
||
2480 | 104 |
(*Unicity for NS1: nonce NA identifies agents A and B*) |
2318 | 105 |
goal thy |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
106 |
"!!evs. [| Nonce NA ~: analz (sees lost Spy evs); evs : ns_public |] \ |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
107 |
\ ==> EX A' B'. ALL A B. \ |
2318 | 108 |
\ Crypt (pubK B) {|Nonce NA, Agent A|} : parts (sees lost Spy evs) --> \ |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
109 |
\ A=A' & B=B'"; |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
110 |
by (etac rev_mp 1); |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
111 |
by (analz_induct_tac 1); |
2318 | 112 |
(*NS1*) |
2497 | 113 |
by (simp_tac (!simpset addsimps [all_conj_distrib]) 3); |
2318 | 114 |
by (expand_case_tac "NA = ?y" 3 THEN |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
115 |
REPEAT (blast_tac (!claset addSEs partsEs) 3)); |
2318 | 116 |
(*Base*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
117 |
by (Blast_tac 1); |
2318 | 118 |
(*Fake*) |
2497 | 119 |
by (simp_tac (!simpset addsimps [all_conj_distrib, parts_insert_sees]) 1); |
2374 | 120 |
by (step_tac (!claset addSIs [analz_insertI]) 1); |
2318 | 121 |
by (ex_strip_tac 1); |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
122 |
by (blast_tac (!claset delrules [conjI] |
3516
470626799511
Removal of monotonicity reasoning involving "lost" and the theorem
paulson
parents:
3466
diff
changeset
|
123 |
addSDs [impOfSubs Fake_parts_insert] |
470626799511
Removal of monotonicity reasoning involving "lost" and the theorem
paulson
parents:
3466
diff
changeset
|
124 |
addDs [impOfSubs analz_subset_parts]) 1); |
2318 | 125 |
val lemma = result(); |
126 |
||
127 |
goal thy |
|
128 |
"!!evs. [| Crypt(pubK B) {|Nonce NA, Agent A|} : parts(sees lost Spy evs); \ |
|
129 |
\ Crypt(pubK B') {|Nonce NA, Agent A'|} : parts(sees lost Spy evs); \ |
|
130 |
\ Nonce NA ~: analz (sees lost Spy evs); \ |
|
131 |
\ evs : ns_public |] \ |
|
132 |
\ ==> A=A' & B=B'"; |
|
2480 | 133 |
by (prove_unique_tac lemma 1); |
2318 | 134 |
qed "unique_NA"; |
135 |
||
136 |
||
137 |
(*Secrecy: Spy does not see the nonce sent in msg NS1 if A and B are secure*) |
|
138 |
goal thy |
|
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
139 |
"!!evs. [| 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
|
140 |
\ A ~: lost; B ~: lost; evs : ns_public |] \ |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
141 |
\ ==> Nonce NA ~: analz (sees lost Spy evs)"; |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
142 |
by (etac rev_mp 1); |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
143 |
by (analz_induct_tac 1); |
2318 | 144 |
(*NS3*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
145 |
by (blast_tac (!claset addDs [Says_imp_sees_Spy' RS parts.Inj] |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
146 |
addEs [no_nonce_NS1_NS2 RSN (2, rev_notE)]) 4); |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
147 |
(*NS2*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
148 |
by (blast_tac (!claset addSEs [MPair_parts] |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
149 |
addDs [Says_imp_sees_Spy' RS parts.Inj, |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
150 |
parts.Body, unique_NA]) 3); |
2318 | 151 |
(*NS1*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
152 |
by (blast_tac (!claset addSEs sees_Spy_partsEs |
2497 | 153 |
addIs [impOfSubs analz_subset_parts]) 2); |
2318 | 154 |
(*Fake*) |
2497 | 155 |
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
|
156 |
qed "Spy_not_see_NA"; |
2318 | 157 |
|
158 |
||
159 |
(*Authentication for A: if she receives message 2 and has used NA |
|
160 |
to start a run, then B has sent message 2.*) |
|
161 |
goal thy |
|
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
162 |
"!!evs. [| Says A B (Crypt (pubK B) {|Nonce NA, Agent A|}) : set evs; \ |
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
163 |
\ Says B' A (Crypt(pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
164 |
\ : set evs; \ |
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
165 |
\ A ~: lost; B ~: lost; evs : ns_public |] \ |
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
166 |
\ ==> Says B A (Crypt(pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
3465 | 167 |
\ : set evs"; |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
168 |
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
|
169 |
(*prepare induction over Crypt (pubK A) {|NA,NB,B|} : parts H*) |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
170 |
by (etac (Says_imp_sees_Spy' RS parts.Inj RS rev_mp) 1); |
2318 | 171 |
by (etac ns_public.induct 1); |
172 |
by (ALLGOALS Asm_simp_tac); |
|
173 |
(*NS1*) |
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
174 |
by (blast_tac (!claset addSEs sees_Spy_partsEs) 2); |
2318 | 175 |
(*Fake*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
176 |
by (blast_tac (!claset addSDs [impOfSubs Fake_parts_insert] |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
177 |
addDs [Spy_not_see_NA, |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
178 |
impOfSubs analz_subset_parts]) 1); |
2318 | 179 |
qed "A_trusts_NS2"; |
180 |
||
181 |
(*If the encrypted message appears then it originated with Alice in NS1*) |
|
182 |
goal thy |
|
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
183 |
"!!evs. [| Crypt (pubK B) {|Nonce NA, Agent A|} : parts (sees lost Spy evs); \ |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
184 |
\ Nonce NA ~: analz (sees lost Spy evs); \ |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
185 |
\ evs : ns_public |] \ |
3465 | 186 |
\ ==> 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
|
187 |
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
|
188 |
by (etac rev_mp 1); |
2480 | 189 |
by (analz_induct_tac 1); |
2318 | 190 |
(*Fake*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
191 |
by (blast_tac (!claset addSDs [impOfSubs Fake_parts_insert] |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
192 |
addIs [analz_insertI] |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
193 |
addDs [impOfSubs analz_subset_parts]) 2); |
2318 | 194 |
(*Base*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
195 |
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
|
196 |
qed "B_trusts_NS1"; |
2318 | 197 |
|
198 |
||
199 |
||
200 |
(**** Authenticity properties obtained from NS2 ****) |
|
201 |
||
2480 | 202 |
(*Unicity for NS2: nonce NB identifies nonce NA and agents A, B |
2318 | 203 |
[unicity of B makes Lowe's fix work] |
204 |
[proof closely follows that for unique_NA] *) |
|
205 |
goal thy |
|
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
206 |
"!!evs. [| Nonce NB ~: analz (sees lost Spy evs); evs : ns_public |] \ |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
207 |
\ ==> EX A' NA' B'. ALL A NA B. \ |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
208 |
\ Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|} \ |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
209 |
\ : parts (sees lost Spy evs) --> A=A' & NA=NA' & B=B'"; |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
210 |
by (etac rev_mp 1); |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
211 |
by (analz_induct_tac 1); |
2318 | 212 |
(*NS2*) |
2497 | 213 |
by (simp_tac (!simpset addsimps [all_conj_distrib]) 3); |
2318 | 214 |
by (expand_case_tac "NB = ?y" 3 THEN |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
215 |
REPEAT (blast_tac (!claset addSEs partsEs) 3)); |
2318 | 216 |
(*Base*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
217 |
by (Blast_tac 1); |
2318 | 218 |
(*Fake*) |
2497 | 219 |
by (simp_tac (!simpset addsimps [all_conj_distrib, parts_insert_sees]) 1); |
2374 | 220 |
by (step_tac (!claset addSIs [analz_insertI]) 1); |
2318 | 221 |
by (ex_strip_tac 1); |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
222 |
by (blast_tac (!claset delrules [conjI] |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2497
diff
changeset
|
223 |
addSDs [impOfSubs Fake_parts_insert] |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
224 |
addDs [impOfSubs analz_subset_parts]) 1); |
2318 | 225 |
val lemma = result(); |
226 |
||
227 |
goal thy |
|
228 |
"!!evs. [| Crypt(pubK A) {|Nonce NA, Nonce NB, Agent B|} \ |
|
229 |
\ : parts(sees lost Spy evs); \ |
|
230 |
\ Crypt(pubK A') {|Nonce NA', Nonce NB, Agent B'|} \ |
|
231 |
\ : parts(sees lost Spy evs); \ |
|
232 |
\ Nonce NB ~: analz (sees lost Spy evs); \ |
|
233 |
\ evs : ns_public |] \ |
|
234 |
\ ==> A=A' & NA=NA' & B=B'"; |
|
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
235 |
by (prove_unique_tac lemma 1); |
2318 | 236 |
qed "unique_NB"; |
237 |
||
238 |
||
239 |
(*Secrecy: Spy does not see the nonce sent in msg NS2 if A and B are secure*) |
|
240 |
goal thy |
|
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
241 |
"!!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
|
242 |
\ : set evs; \ |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
243 |
\ A ~: lost; B ~: lost; evs : ns_public |] \ |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
244 |
\ ==> Nonce NB ~: analz (sees lost Spy evs)"; |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
245 |
by (etac rev_mp 1); |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
246 |
by (analz_induct_tac 1); |
2318 | 247 |
(*NS3*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
248 |
by (blast_tac (!claset addDs [Says_imp_sees_Spy' RS parts.Inj, |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
249 |
unique_NB]) 4); |
2318 | 250 |
(*NS1*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
251 |
by (blast_tac (!claset addSEs sees_Spy_partsEs) 2); |
2318 | 252 |
(*Fake*) |
2497 | 253 |
by (spy_analz_tac 1); |
2318 | 254 |
(*NS2*) |
255 |
by (Step_tac 1); |
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
256 |
by (blast_tac (!claset addSEs sees_Spy_partsEs) 3); |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
257 |
by (blast_tac (!claset addSDs [Says_imp_sees_Spy' RS parts.Inj] |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
258 |
addEs [no_nonce_NS1_NS2 RSN (2, rev_notE)]) 2); |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
259 |
by (blast_tac (!claset addSIs [impOfSubs analz_subset_parts]) 1); |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
260 |
qed "Spy_not_see_NB"; |
2318 | 261 |
|
262 |
||
263 |
(*Authentication for B: if he receives message 3 and has used NB |
|
264 |
in message 2, then A has sent message 3.*) |
|
265 |
goal thy |
|
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
266 |
"!!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
|
267 |
\ : set evs; \ |
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
268 |
\ 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
|
269 |
\ A ~: lost; B ~: lost; evs : ns_public |] \ |
3465 | 270 |
\ ==> 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
|
271 |
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
|
272 |
(*prepare induction over Crypt (pubK B) NB : parts H*) |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
273 |
by (etac (Says_imp_sees_Spy' RS parts.Inj RS rev_mp) 1); |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
274 |
by (analz_induct_tac 1); |
2318 | 275 |
(*NS1*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
276 |
by (blast_tac (!claset addSEs sees_Spy_partsEs) 2); |
2318 | 277 |
(*Fake*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
278 |
by (blast_tac (!claset addSDs [impOfSubs Fake_parts_insert] |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
279 |
addDs [Spy_not_see_NB, |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
280 |
impOfSubs analz_subset_parts]) 1); |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
281 |
(*NS3; not clear why blast_tac needs to be preceeded by Step_tac*) |
2318 | 282 |
by (Step_tac 1); |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
283 |
by (blast_tac (!claset addDs [Says_imp_sees_Spy' RS parts.Inj, |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
284 |
Spy_not_see_NB, unique_NB]) 1); |
2318 | 285 |
qed "B_trusts_NS3"; |
286 |
||
287 |
||
288 |
(**** Overall guarantee for B*) |
|
289 |
||
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
290 |
(*Matches only NS2, not NS1 (or NS3)*) |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
291 |
val Says_imp_sees_Spy'' = |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
292 |
read_instantiate [("X","Crypt ?K {|?XX,?YY,?ZZ|}")] Says_imp_sees_Spy'; |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
293 |
|
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
294 |
|
2318 | 295 |
(*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
|
296 |
NA, then A initiated the run using NA. SAME proof as B_trusts_NS3!*) |
2318 | 297 |
goal thy |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
298 |
"!!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
|
299 |
\ : set evs; \ |
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
300 |
\ 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
|
301 |
\ A ~: lost; B ~: lost; evs : ns_public |] \ |
3465 | 302 |
\ ==> 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
|
303 |
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
|
304 |
(*prepare induction over Crypt (pubK B) {|NB|} : parts H*) |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
305 |
by (etac (Says_imp_sees_Spy' RS parts.Inj RS rev_mp) 1); |
2318 | 306 |
by (etac ns_public.induct 1); |
307 |
by (ALLGOALS Asm_simp_tac); |
|
308 |
(*Fake, NS2, NS3*) |
|
309 |
(*NS1*) |
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
310 |
by (blast_tac (!claset addSEs sees_Spy_partsEs) 2); |
2318 | 311 |
(*Fake*) |
312 |
by (REPEAT_FIRST (resolve_tac [impI, conjI])); |
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
313 |
by (Blast_tac 1); |
2318 | 314 |
by (forward_tac [Spy_not_see_NB] 1 THEN REPEAT (assume_tac 1)); |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
315 |
by (blast_tac (!claset addSIs [disjI2] |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2497
diff
changeset
|
316 |
addDs [impOfSubs analz_subset_parts, |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
317 |
impOfSubs Fake_parts_insert]) 1); |
2318 | 318 |
(*NS3*) |
319 |
by (Step_tac 1); |
|
320 |
by (forward_tac [Spy_not_see_NB] 1 THEN REPEAT (assume_tac 1)); |
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
321 |
by (blast_tac (!claset addSDs [Says_imp_sees_Spy'' RS parts.Inj] |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
322 |
addDs [unique_NB]) 1); |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
323 |
qed "B_trusts_protocol"; |
2318 | 324 |