author | nipkow |
Sat, 07 Mar 1998 16:29:29 +0100 | |
changeset 4686 | 74a12e86b20b |
parent 4556 | e7a4683c0026 |
child 5076 | fbc9d95b62ba |
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 |
||
4449 | 16 |
set proof_timing; |
2318 | 17 |
HOL_quantifiers := false; |
18 |
||
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
19 |
AddEs spies_partsEs; |
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
20 |
AddDs [impOfSubs analz_subset_parts]; |
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
21 |
AddDs [impOfSubs Fake_parts_insert]; |
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
22 |
|
3683 | 23 |
AddIffs [Spy_in_bad]; |
2318 | 24 |
|
25 |
(*A "possibility property": there are traces that reach the end*) |
|
26 |
goal thy |
|
2480 | 27 |
"!!A B. A ~= B ==> EX NB. EX evs: ns_public. \ |
3465 | 28 |
\ Says A B (Crypt (pubK B) (Nonce NB)) : set evs"; |
2318 | 29 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
30 |
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
|
31 |
by possibility_tac; |
2318 | 32 |
result(); |
33 |
||
34 |
||
35 |
(**** Inductive proofs about ns_public ****) |
|
36 |
||
37 |
(*Nobody sends themselves messages*) |
|
3465 | 38 |
goal thy "!!evs. evs : ns_public ==> ALL A X. Says A A X ~: set evs"; |
2318 | 39 |
by (etac ns_public.induct 1); |
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4476
diff
changeset
|
40 |
by Auto_tac; |
2318 | 41 |
qed_spec_mp "not_Says_to_self"; |
42 |
Addsimps [not_Says_to_self]; |
|
43 |
AddSEs [not_Says_to_self RSN (2, rev_notE)]; |
|
44 |
||
45 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
46 |
(*Induction for regularity theorems. If induction formula has the form |
3683 | 47 |
X ~: analz (spies evs) --> ... then it shortens the proof by discarding |
48 |
needless information about analz (insert X (spies evs)) *) |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
49 |
fun parts_induct_tac i = |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
50 |
etac ns_public.induct i |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
51 |
THEN |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
52 |
REPEAT (FIRSTGOAL analz_mono_contra_tac) |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
53 |
THEN |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
54 |
prove_simple_subgoals_tac i; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
55 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
56 |
|
3683 | 57 |
(** Theorems of the form X ~: parts (spies evs) imply that NOBODY |
2318 | 58 |
sends messages containing X! **) |
59 |
||
3683 | 60 |
(*Spy never sees another agent's private key! (unless it's bad at start)*) |
2318 | 61 |
goal thy |
3683 | 62 |
"!!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:
3466
diff
changeset
|
63 |
by (parts_induct_tac 1); |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
64 |
by (Blast_tac 1); |
2318 | 65 |
qed "Spy_see_priK"; |
66 |
Addsimps [Spy_see_priK]; |
|
67 |
||
68 |
goal thy |
|
3683 | 69 |
"!!A. evs: ns_public ==> (Key (priK A) : analz (spies evs)) = (A : bad)"; |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
70 |
by Auto_tac; |
2318 | 71 |
qed "Spy_analz_priK"; |
72 |
Addsimps [Spy_analz_priK]; |
|
73 |
||
4476 | 74 |
AddSDs [Spy_see_priK RSN (2, rev_iffD1), |
75 |
Spy_analz_priK RSN (2, rev_iffD1)]; |
|
2318 | 76 |
|
77 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
78 |
(**** Authenticity properties obtained from NS2 ****) |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
79 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
80 |
(*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:
3466
diff
changeset
|
81 |
is secret. (Honest users generate fresh nonces.)*) |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
82 |
goal thy |
3683 | 83 |
"!!evs. [| Crypt (pubK B) {|Nonce NA, Agent A|} : parts (spies evs); \ |
84 |
\ Nonce NA ~: analz (spies evs); evs : ns_public |] \ |
|
85 |
\ ==> Crypt (pubK C) {|NA', Nonce NA|} ~: parts (spies evs)"; |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
86 |
by (etac rev_mp 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
87 |
by (etac rev_mp 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
88 |
by (parts_induct_tac 1); |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
89 |
by (ALLGOALS Blast_tac); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
90 |
qed "no_nonce_NS1_NS2"; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
91 |
|
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
92 |
(*Adding it to the claset slows down proofs...*) |
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
93 |
val nonce_NS1_NS2_E = no_nonce_NS1_NS2 RSN (2, rev_notE); |
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
94 |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
95 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
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:
3466
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:
3466
diff
changeset
|
101 |
\ A=A' & B=B'"; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
102 |
by (etac rev_mp 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
103 |
by (parts_induct_tac 1); |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
104 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib]))); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
105 |
(*NS1*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
106 |
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:
3466
diff
changeset
|
107 |
(*Fake*) |
3709 | 108 |
by (Clarify_tac 1); |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
109 |
by (Blast_tac 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
110 |
val lemma = result(); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
111 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
112 |
goal thy |
3683 | 113 |
"!!evs. [| Crypt(pubK B) {|Nonce NA, Agent A|} : parts(spies evs); \ |
114 |
\ Crypt(pubK B') {|Nonce NA, Agent A'|} : parts(spies evs); \ |
|
115 |
\ Nonce NA ~: analz (spies evs); \ |
|
3709 | 116 |
\ evs : ns_public |] \ |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
117 |
\ ==> A=A' & B=B'"; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
118 |
by (prove_unique_tac lemma 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
119 |
qed "unique_NA"; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
120 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
121 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
122 |
(*Tactic for proving secrecy theorems*) |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
123 |
fun analz_induct_tac i = |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
124 |
etac ns_public.induct i THEN |
4686 | 125 |
ALLGOALS Asm_simp_tac; |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
126 |
|
2318 | 127 |
|
128 |
(*Secrecy: Spy does not see the nonce sent in msg NS1 if A and B are secure*) |
|
129 |
goal thy |
|
3709 | 130 |
"!!evs. [| Says A B (Crypt(pubK B) {|Nonce NA, Agent A|}) : set evs; \ |
3683 | 131 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
132 |
\ ==> 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
|
133 |
by (etac rev_mp 1); |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
134 |
by (analz_induct_tac 1); |
2318 | 135 |
(*NS3*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
136 |
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
|
137 |
(*NS2*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
138 |
by (blast_tac (claset() addDs [unique_NA]) 3); |
2318 | 139 |
(*NS1*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
140 |
by (Blast_tac 2); |
2318 | 141 |
(*Fake*) |
2497 | 142 |
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
|
143 |
qed "Spy_not_see_NA"; |
2318 | 144 |
|
145 |
||
146 |
(*Authentication for A: if she receives message 2 and has used NA |
|
147 |
to start a run, then B has sent message 2.*) |
|
148 |
goal thy |
|
4551 | 149 |
"!!evs. [| Says A B (Crypt(pubK B) {|Nonce NA, Agent A|}) : set evs; \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
150 |
\ Says B' A (Crypt(pubK A) {|Nonce NA, Nonce NB|}): set evs; \ |
3709 | 151 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
3465 | 152 |
\ ==> Says B A (Crypt(pubK A) {|Nonce NA, 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
|
153 |
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
|
154 |
(*prepare induction over Crypt (pubK A) {|NA,NB|} : parts H*) |
3683 | 155 |
by (etac (Says_imp_spies RS parts.Inj RS rev_mp) 1); |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
156 |
by (etac ns_public.induct 1); |
2318 | 157 |
by (ALLGOALS Asm_simp_tac); |
3709 | 158 |
by (ALLGOALS Clarify_tac); |
159 |
(*NS2*) |
|
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
160 |
by (blast_tac (claset() addDs [Spy_not_see_NA, unique_NA]) 3); |
2318 | 161 |
(*NS1*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
162 |
by (Blast_tac 2); |
2318 | 163 |
(*Fake*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
164 |
by (blast_tac (claset() addDs [Spy_not_see_NA]) 1); |
2318 | 165 |
qed "A_trusts_NS2"; |
166 |
||
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
167 |
|
2318 | 168 |
(*If the encrypted message appears then it originated with Alice in NS1*) |
169 |
goal thy |
|
3683 | 170 |
"!!evs. [| Crypt (pubK B) {|Nonce NA, Agent A|} : parts (spies evs); \ |
171 |
\ Nonce NA ~: analz (spies evs); \ |
|
3709 | 172 |
\ evs : ns_public |] \ |
3465 | 173 |
\ ==> 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
|
174 |
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
|
175 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
176 |
by (parts_induct_tac 1); |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
177 |
by (Blast_tac 1); |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
178 |
qed "B_trusts_NS1"; |
2318 | 179 |
|
180 |
||
181 |
||
182 |
(**** Authenticity properties obtained from NS2 ****) |
|
183 |
||
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
184 |
(*Unicity for NS2: nonce NB identifies nonce NA and agent A |
2318 | 185 |
[proof closely follows that for unique_NA] *) |
186 |
goal thy |
|
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
187 |
"!!evs. [| Nonce NB ~: analz (spies evs); evs : ns_public |] \ |
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
188 |
\ ==> EX A' NA'. ALL A NA. \ |
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
189 |
\ Crypt (pubK A) {|Nonce NA, Nonce NB|} : parts (spies evs) \ |
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
190 |
\ --> A=A' & NA=NA'"; |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
191 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
192 |
by (parts_induct_tac 1); |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
193 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib]))); |
2318 | 194 |
(*NS2*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
195 |
by (expand_case_tac "NB = ?y" 2 THEN Blast_tac 2); |
2318 | 196 |
(*Fake*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
197 |
by (Blast_tac 1); |
2318 | 198 |
val lemma = result(); |
199 |
||
200 |
goal thy |
|
3683 | 201 |
"!!evs. [| Crypt(pubK A) {|Nonce NA, Nonce NB|} : parts(spies evs); \ |
202 |
\ Crypt(pubK A'){|Nonce NA', Nonce NB|} : parts(spies evs); \ |
|
203 |
\ Nonce NB ~: analz (spies evs); \ |
|
3709 | 204 |
\ evs : ns_public |] \ |
2318 | 205 |
\ ==> A=A' & NA=NA'"; |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
206 |
by (prove_unique_tac lemma 1); |
2318 | 207 |
qed "unique_NB"; |
208 |
||
209 |
||
210 |
(*NB remains secret PROVIDED Alice never responds with round 3*) |
|
211 |
goal thy |
|
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
212 |
"!!evs.[| Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set evs; \ |
3703 | 213 |
\ ALL C. Says A C (Crypt (pubK C) (Nonce NB)) ~: set evs; \ |
214 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
|
3683 | 215 |
\ ==> 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
|
216 |
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
|
217 |
by (etac rev_mp 1); |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
218 |
by (analz_induct_tac 1); |
4091 | 219 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib]))); |
3709 | 220 |
by (ALLGOALS Clarify_tac); |
3703 | 221 |
(*NS3: because NB determines A*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
222 |
by (blast_tac (claset() addDs [unique_NB]) 4); |
3703 | 223 |
(*NS2: by freshness and unicity of NB*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
224 |
by (blast_tac (claset() addEs [nonce_NS1_NS2_E]) 3); |
3703 | 225 |
(*NS1: by freshness*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
226 |
by (Blast_tac 2); |
2318 | 227 |
(*Fake*) |
2497 | 228 |
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
|
229 |
qed "Spy_not_see_NB"; |
2318 | 230 |
|
231 |
||
232 |
||
233 |
(*Authentication for B: if he receives message 3 and has used NB |
|
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
234 |
in message 2, then A has sent message 3--to somebody....*) |
2318 | 235 |
goal thy |
3545 | 236 |
"!!evs. [| Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set evs; \ |
237 |
\ Says A' B (Crypt (pubK B) (Nonce NB)): set evs; \ |
|
3683 | 238 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
3465 | 239 |
\ ==> EX C. Says A C (Crypt (pubK C) (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
|
240 |
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
|
241 |
(*prepare induction over Crypt (pubK B) NB : parts H*) |
3683 | 242 |
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:
3466
diff
changeset
|
243 |
by (parts_induct_tac 1); |
4091 | 244 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [ex_disj_distrib]))); |
3709 | 245 |
by (ALLGOALS Clarify_tac); |
4197 | 246 |
(*NS3: because NB determines A (this use of unique_NB is more robust) *) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
247 |
by (blast_tac (claset() addDs [Spy_not_see_NB] |
4197 | 248 |
addIs [unique_NB RS conjunct1]) 3); |
3703 | 249 |
(*NS1: by freshness*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
250 |
by (Blast_tac 2); |
2318 | 251 |
(*Fake*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
252 |
by (blast_tac (claset() addDs [Spy_not_see_NB]) 1); |
2318 | 253 |
qed "B_trusts_NS3"; |
254 |
||
255 |
||
256 |
(*Can we strengthen the secrecy theorem? NO*) |
|
257 |
goal thy |
|
3683 | 258 |
"!!evs. [| A ~: bad; B ~: bad; evs : ns_public |] \ |
3465 | 259 |
\ ==> Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set evs \ |
3683 | 260 |
\ --> Nonce NB ~: analz (spies evs)"; |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
261 |
by (analz_induct_tac 1); |
3709 | 262 |
by (ALLGOALS Clarify_tac); |
3703 | 263 |
(*NS2: by freshness and unicity of NB*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
264 |
by (blast_tac (claset() addEs [nonce_NS1_NS2_E]) 3); |
3703 | 265 |
(*NS1: by freshness*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
266 |
by (Blast_tac 2); |
2318 | 267 |
(*Fake*) |
2497 | 268 |
by (spy_analz_tac 1); |
3703 | 269 |
(*NS3: unicity of NB identifies A and NA, but not B*) |
3683 | 270 |
by (forw_inst_tac [("A'","A")] (Says_imp_spies RS parts.Inj RS unique_NB) 1 |
271 |
THEN REPEAT (eresolve_tac [asm_rl, Says_imp_spies RS parts.Inj] 1)); |
|
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4476
diff
changeset
|
272 |
by Auto_tac; |
3703 | 273 |
by (rename_tac "C B' evs3" 1); |
2318 | 274 |
|
275 |
(* |
|
276 |
THIS IS THE ATTACK! |
|
3703 | 277 |
Level 8 |
3683 | 278 |
!!evs. [| A ~: bad; B ~: bad; evs : ns_public |] |
3703 | 279 |
==> Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set evs --> |
3683 | 280 |
Nonce NB ~: analz (spies evs) |
3703 | 281 |
1. !!C B' evs3. |
282 |
[| A ~: bad; B ~: bad; evs3 : ns_public; |
|
283 |
Says A C (Crypt (pubK C) {|Nonce NA, Agent A|}) : set evs3; |
|
284 |
Says B' A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set evs3; C : bad; |
|
285 |
Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set evs3; |
|
286 |
Nonce NB ~: analz (spies evs3) |] |
|
2318 | 287 |
==> False |
288 |
*) |