author | paulson |
Thu, 08 Jan 1998 18:10:34 +0100 | |
changeset 4537 | 4e835bd9fada |
parent 4509 | 828148415197 |
child 4598 | 649bf14debe7 |
permissions | -rw-r--r-- |
2002 | 1 |
(* Title: HOL/Auth/OtwayRees_Bad |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1996 University of Cambridge |
|
5 |
||
6 |
Inductive relation "otway" for the Otway-Rees protocol. |
|
7 |
||
8 |
The FAULTY version omitting encryption of Nonce NB, as suggested on page 247 of |
|
9 |
Burrows, Abadi and Needham. A Logic of Authentication. |
|
10 |
Proc. Royal Soc. 426 (1989) |
|
11 |
||
12 |
This file illustrates the consequences of such errors. We can still prove |
|
2032 | 13 |
impressive-looking properties such as Spy_not_see_encrypted_key, yet the |
2002 | 14 |
protocol is open to a middleperson attack. Attempting to prove some key lemmas |
15 |
indicates the possibility of this attack. |
|
16 |
*) |
|
17 |
||
18 |
open OtwayRees_Bad; |
|
19 |
||
4449 | 20 |
set proof_timing; |
2002 | 21 |
HOL_quantifiers := false; |
22 |
||
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
23 |
AddEs spies_partsEs; |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
24 |
AddDs [impOfSubs analz_subset_parts]; |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
25 |
AddDs [impOfSubs Fake_parts_insert]; |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
26 |
|
2002 | 27 |
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
3102
diff
changeset
|
28 |
(*A "possibility property": there are traces that reach the end*) |
2002 | 29 |
goal thy |
30 |
"!!A B. [| A ~= B; A ~= Server; B ~= Server |] \ |
|
31 |
\ ==> EX K. EX NA. EX evs: otway. \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
32 |
\ Says B A {|Nonce NA, Crypt (shrK A) {|Nonce NA, Key K|}|} \ |
3465 | 33 |
\ : set evs"; |
2002 | 34 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
2032 | 35 |
by (rtac (otway.Nil RS otway.OR1 RS otway.OR2 RS otway.OR3 RS otway.OR4) 2); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
36 |
by possibility_tac; |
2002 | 37 |
result(); |
38 |
||
39 |
||
40 |
(**** Inductive proofs about otway ****) |
|
41 |
||
42 |
(*Nobody sends themselves messages*) |
|
3465 | 43 |
goal thy "!!evs. evs : otway ==> ALL A X. Says A A X ~: set evs"; |
2032 | 44 |
by (etac otway.induct 1); |
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4471
diff
changeset
|
45 |
by Auto_tac; |
2002 | 46 |
qed_spec_mp "not_Says_to_self"; |
47 |
Addsimps [not_Says_to_self]; |
|
48 |
AddSEs [not_Says_to_self RSN (2, rev_notE)]; |
|
49 |
||
50 |
||
51 |
(** For reasoning about the encrypted portion of messages **) |
|
52 |
||
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
53 |
goal thy "!!evs. Says A' B {|N, Agent A, Agent B, X|} : set evs \ |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
54 |
\ ==> X : analz (spies evs)"; |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
55 |
by (dtac (Says_imp_spies RS analz.Inj) 1); |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
56 |
by (Blast_tac 1); |
3683 | 57 |
qed "OR2_analz_spies"; |
2002 | 58 |
|
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
59 |
goal thy "!!evs. Says S' B {|N, X, Crypt (shrK B) X'|} : set evs \ |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
60 |
\ ==> X : analz (spies evs)"; |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
61 |
by (dtac (Says_imp_spies RS analz.Inj) 1); |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
62 |
by (Blast_tac 1); |
3683 | 63 |
qed "OR4_analz_spies"; |
2002 | 64 |
|
3465 | 65 |
goal thy "!!evs. Says Server B {|NA, X, Crypt K' {|NB,K|}|} : set evs \ |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
66 |
\ ==> K : parts (spies evs)"; |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
67 |
by (Blast_tac 1); |
3683 | 68 |
qed "Oops_parts_spies"; |
2002 | 69 |
|
3683 | 70 |
bind_thm ("OR2_parts_spies", |
71 |
OR2_analz_spies RS (impOfSubs analz_subset_parts)); |
|
72 |
bind_thm ("OR4_parts_spies", |
|
73 |
OR4_analz_spies RS (impOfSubs analz_subset_parts)); |
|
2052 | 74 |
|
3683 | 75 |
(*For proving the easier theorems about X ~: parts (spies evs).*) |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
76 |
fun parts_induct_tac i = |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
77 |
etac otway.induct i THEN |
3683 | 78 |
forward_tac [Oops_parts_spies] (i+6) THEN |
79 |
forward_tac [OR4_parts_spies] (i+5) THEN |
|
80 |
forward_tac [OR2_parts_spies] (i+3) THEN |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
81 |
prove_simple_subgoals_tac i; |
2002 | 82 |
|
83 |
||
3683 | 84 |
(** Theorems of the form X ~: parts (spies evs) imply that NOBODY |
2002 | 85 |
sends messages containing X! **) |
86 |
||
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
87 |
(*Spy never sees a good agent's shared key!*) |
2002 | 88 |
goal thy |
3683 | 89 |
"!!evs. evs : otway ==> (Key (shrK A) : parts (spies evs)) = (A : bad)"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
90 |
by (parts_induct_tac 1); |
3961 | 91 |
by (ALLGOALS Blast_tac); |
2131 | 92 |
qed "Spy_see_shrK"; |
93 |
Addsimps [Spy_see_shrK]; |
|
2002 | 94 |
|
2131 | 95 |
goal thy |
3683 | 96 |
"!!evs. evs : otway ==> (Key (shrK A) : analz (spies evs)) = (A : bad)"; |
4091 | 97 |
by (auto_tac(claset() addDs [impOfSubs analz_subset_parts], simpset())); |
2131 | 98 |
qed "Spy_analz_shrK"; |
99 |
Addsimps [Spy_analz_shrK]; |
|
2002 | 100 |
|
4471 | 101 |
AddSDs [Spy_see_shrK RSN (2, rev_iffD1), |
102 |
Spy_analz_shrK RSN (2, rev_iffD1)]; |
|
2002 | 103 |
|
104 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
105 |
(*Nobody can have used non-existent keys!*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
106 |
goal thy "!!evs. evs : otway ==> \ |
3683 | 107 |
\ Key K ~: used evs --> K ~: keysFor (parts (spies evs))"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
108 |
by (parts_induct_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
109 |
(*Fake*) |
4509
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
110 |
by (blast_tac (claset() addSDs [keysFor_parts_insert]) 1); |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
111 |
(*OR2, OR3*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
3102
diff
changeset
|
112 |
by (ALLGOALS Blast_tac); |
2160 | 113 |
qed_spec_mp "new_keys_not_used"; |
2002 | 114 |
|
115 |
bind_thm ("new_keys_not_analzd", |
|
2032 | 116 |
[analz_subset_parts RS keysFor_mono, |
117 |
new_keys_not_used] MRS contra_subsetD); |
|
2002 | 118 |
|
119 |
Addsimps [new_keys_not_used, new_keys_not_analzd]; |
|
120 |
||
121 |
||
2131 | 122 |
|
123 |
(*** Proofs involving analz ***) |
|
124 |
||
125 |
(*Describes the form of K and NA when the Server sends this message. Also |
|
126 |
for Oops case.*) |
|
127 |
goal thy |
|
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
128 |
"!!evs. [| Says Server B {|NA, X, Crypt (shrK B) {|NB, Key K|}|} : set evs; \ |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
129 |
\ evs : otway |] \ |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
130 |
\ ==> K ~: range shrK & (EX i. NA = Nonce i) & (EX j. NB = Nonce j)"; |
2131 | 131 |
by (etac rev_mp 1); |
132 |
by (etac otway.induct 1); |
|
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
133 |
by (ALLGOALS Simp_tac); |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
134 |
by (ALLGOALS Blast_tac); |
2131 | 135 |
qed "Says_Server_message_form"; |
136 |
||
137 |
||
138 |
(*For proofs involving analz.*) |
|
3683 | 139 |
val analz_spies_tac = |
140 |
dtac OR2_analz_spies 4 THEN |
|
141 |
dtac OR4_analz_spies 6 THEN |
|
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
142 |
forward_tac [Says_Server_message_form] 7 THEN assume_tac 7 THEN |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
143 |
REPEAT ((eresolve_tac [exE, conjE] ORELSE' hyp_subst_tac) 7); |
2002 | 144 |
|
145 |
||
146 |
(**** |
|
147 |
The following is to prove theorems of the form |
|
148 |
||
3683 | 149 |
Key K : analz (insert (Key KAB) (spies evs)) ==> |
150 |
Key K : analz (spies evs) |
|
2002 | 151 |
|
152 |
A more general formula must be proved inductively. |
|
153 |
****) |
|
154 |
||
155 |
||
156 |
(** Session keys are not used to encrypt other session keys **) |
|
157 |
||
158 |
(*The equality makes the induction hypothesis easier to apply*) |
|
159 |
goal thy |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
160 |
"!!evs. evs : otway ==> \ |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
161 |
\ ALL K KK. KK <= Compl (range shrK) --> \ |
3683 | 162 |
\ (Key K : analz (Key``KK Un (spies evs))) = \ |
163 |
\ (K : KK | Key K : analz (spies evs))"; |
|
2032 | 164 |
by (etac otway.induct 1); |
3683 | 165 |
by analz_spies_tac; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
166 |
by (REPEAT_FIRST (resolve_tac [allI, impI])); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
167 |
by (REPEAT_FIRST (rtac analz_image_freshK_lemma )); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
168 |
by (ALLGOALS (asm_simp_tac analz_image_freshK_ss)); |
3451
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3207
diff
changeset
|
169 |
(*Fake*) |
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4091
diff
changeset
|
170 |
by (spy_analz_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
171 |
qed_spec_mp "analz_image_freshK"; |
2002 | 172 |
|
173 |
||
174 |
goal thy |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
175 |
"!!evs. [| evs : otway; KAB ~: range shrK |] ==> \ |
3683 | 176 |
\ Key K : analz (insert (Key KAB) (spies evs)) = \ |
177 |
\ (K = KAB | Key K : analz (spies evs))"; |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
178 |
by (asm_simp_tac (analz_image_freshK_ss addsimps [analz_image_freshK]) 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
179 |
qed "analz_insert_freshK"; |
2002 | 180 |
|
181 |
||
2131 | 182 |
(*** The Key K uniquely identifies the Server's message. **) |
2002 | 183 |
|
184 |
goal thy |
|
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
185 |
"!!evs. evs : otway ==> \ |
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
186 |
\ EX B' NA' NB' X'. ALL B NA NB X. \ |
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
187 |
\ Says Server B {|NA, X, Crypt (shrK B) {|NB, K|}|} : set evs --> \ |
2131 | 188 |
\ B=B' & NA=NA' & NB=NB' & X=X'"; |
2032 | 189 |
by (etac otway.induct 1); |
4091 | 190 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib]))); |
3730 | 191 |
by (ALLGOALS Clarify_tac); |
2002 | 192 |
(*Remaining cases: OR3 and OR4*) |
193 |
by (ex_strip_tac 2); |
|
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
194 |
by (Best_tac 2); (*Blast_tac's too slow (in reconstruction)*) |
2107
23e8f15ec95f
The new proof of the lemma for new_nonces_not_seen is faster
paulson
parents:
2052
diff
changeset
|
195 |
by (expand_case_tac "K = ?y" 1); |
23e8f15ec95f
The new proof of the lemma for new_nonces_not_seen is faster
paulson
parents:
2052
diff
changeset
|
196 |
by (REPEAT (ares_tac [refl,exI,impI,conjI] 2)); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
197 |
(*...we assume X is a recent message, and handle this case by contradiction*) |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
198 |
by (blast_tac (claset() addSEs spies_partsEs) 1); |
2002 | 199 |
val lemma = result(); |
200 |
||
201 |
goal thy |
|
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
202 |
"!!evs. [| Says Server B {|NA, X, Crypt (shrK B) {|NB, K|}|} : set evs; \ |
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
203 |
\ Says Server B' {|NA',X',Crypt (shrK B') {|NB',K|}|} : set evs; \ |
2131 | 204 |
\ evs : otway |] ==> X=X' & B=B' & NA=NA' & NB=NB'"; |
2417 | 205 |
by (prove_unique_tac lemma 1); |
2002 | 206 |
qed "unique_session_keys"; |
207 |
||
208 |
||
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
209 |
(** Crucial secrecy property: Spy does not see the keys sent in msg OR3 |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
210 |
Does not in itself guarantee security: an attack could violate |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
211 |
the premises, e.g. by having A=Spy **) |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
212 |
|
2131 | 213 |
goal thy |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
214 |
"!!evs. [| A ~: bad; B ~: bad; evs : otway |] \ |
2166 | 215 |
\ ==> Says Server B \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
216 |
\ {|NA, Crypt (shrK A) {|NA, Key K|}, \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
217 |
\ Crypt (shrK B) {|NB, Key K|}|} : set evs --> \ |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
218 |
\ Notes Spy {|NA, NB, Key K|} ~: set evs --> \ |
3683 | 219 |
\ Key K ~: analz (spies evs)"; |
2131 | 220 |
by (etac otway.induct 1); |
3683 | 221 |
by analz_spies_tac; |
2131 | 222 |
by (ALLGOALS |
4091 | 223 |
(asm_simp_tac (simpset() addcongs [conj_cong] |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
224 |
addsimps [analz_insert_eq, analz_insert_freshK] |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
225 |
addsimps (pushes@expand_ifs)))); |
3451
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3207
diff
changeset
|
226 |
(*Oops*) |
4091 | 227 |
by (blast_tac (claset() addSDs [unique_session_keys]) 4); |
3451
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3207
diff
changeset
|
228 |
(*OR4*) |
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3207
diff
changeset
|
229 |
by (Blast_tac 3); |
2131 | 230 |
(*OR3*) |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
231 |
by (Blast_tac 2); |
3451
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3207
diff
changeset
|
232 |
(*Fake*) |
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3207
diff
changeset
|
233 |
by (spy_analz_tac 1); |
2131 | 234 |
val lemma = result() RS mp RS mp RSN(2,rev_notE); |
235 |
||
236 |
goal thy |
|
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
237 |
"!!evs. [| Says Server B \ |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
238 |
\ {|NA, Crypt (shrK A) {|NA, Key K|}, \ |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
239 |
\ Crypt (shrK B) {|NB, Key K|}|} : set evs; \ |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
240 |
\ Notes Spy {|NA, NB, Key K|} ~: set evs; \ |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
241 |
\ A ~: bad; B ~: bad; evs : otway |] \ |
3683 | 242 |
\ ==> Key K ~: analz (spies evs)"; |
2131 | 243 |
by (forward_tac [Says_Server_message_form] 1 THEN assume_tac 1); |
4091 | 244 |
by (blast_tac (claset() addSEs [lemma]) 1); |
2131 | 245 |
qed "Spy_not_see_encrypted_key"; |
246 |
||
247 |
||
248 |
(*** Attempting to prove stronger properties ***) |
|
249 |
||
2052 | 250 |
(*Only OR1 can have caused such a part of a message to appear. |
251 |
I'm not sure why A ~= B premise is needed: OtwayRees.ML doesn't need it. |
|
252 |
Perhaps it's because OR2 has two similar-looking encrypted messages in |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
253 |
this version.*) |
2002 | 254 |
goal thy |
3683 | 255 |
"!!evs. [| A ~: bad; A ~= B; evs : otway |] \ |
256 |
\ ==> Crypt (shrK A) {|NA, Agent A, Agent B|} : parts (spies evs) --> \ |
|
2131 | 257 |
\ Says A B {|NA, Agent A, Agent B, \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
258 |
\ Crypt (shrK A) {|NA, Agent A, Agent B|}|} : set evs"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
259 |
by (parts_induct_tac 1); |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
260 |
by (ALLGOALS Blast_tac); |
2002 | 261 |
qed_spec_mp "Crypt_imp_OR1"; |
262 |
||
263 |
||
2131 | 264 |
(*Crucial property: If the encrypted message appears, and A has used NA |
265 |
to start a run, then it originated with the Server!*) |
|
266 |
(*Only it is FALSE. Somebody could make a fake message to Server |
|
2002 | 267 |
substituting some other nonce NA' for NB.*) |
268 |
goal thy |
|
3683 | 269 |
"!!evs. [| A ~: bad; A ~= Spy; evs : otway |] \ |
270 |
\ ==> Crypt (shrK A) {|NA, Key K|} : parts (spies evs) --> \ |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
271 |
\ Says A B {|NA, Agent A, Agent B, \ |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
272 |
\ Crypt (shrK A) {|NA, Agent A, Agent B|}|} \ |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
273 |
\ : set evs --> \ |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
274 |
\ (EX B NB. Says Server B \ |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
275 |
\ {|NA, \ |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
276 |
\ Crypt (shrK A) {|NA, Key K|}, \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
277 |
\ Crypt (shrK B) {|NB, Key K|}|} : set evs)"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
278 |
by (parts_induct_tac 1); |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
279 |
(*Fake*) |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
280 |
by (Blast_tac 1); |
2002 | 281 |
(*OR1: it cannot be a new Nonce, contradiction.*) |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
282 |
by (Blast_tac 1); |
3730 | 283 |
(*OR3 and OR4*) |
4091 | 284 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [ex_disj_distrib]))); |
3730 | 285 |
by (ALLGOALS Clarify_tac); |
2002 | 286 |
(*OR4*) |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
287 |
by (blast_tac (claset() addSIs [Crypt_imp_OR1]) 2); |
2131 | 288 |
(*OR3*) (** LEVEL 5 **) |
3730 | 289 |
(*The hypotheses at this point suggest an attack in which nonce NB is used |
2052 | 290 |
in two different roles: |
291 |
Says B' Server |
|
3730 | 292 |
{|Nonce NA, Agent Aa, Agent A, |
293 |
Crypt (shrK Aa) {|Nonce NA, Agent Aa, Agent A|}, Nonce NB, |
|
294 |
Crypt (shrK A) {|Nonce NA, Agent Aa, Agent A|}|} |
|
295 |
: set evs3; |
|
2052 | 296 |
Says A B |
3730 | 297 |
{|Nonce NB, Agent A, Agent B, |
298 |
Crypt (shrK A) {|Nonce NB, Agent A, Agent B|}|} |
|
299 |
: set evs3; |
|
2052 | 300 |
*) |
2131 | 301 |
writeln "GIVE UP! on NA_Crypt_imp_Server_msg"; |
2002 | 302 |
|
303 |
||
2052 | 304 |
(*Thus the key property A_can_trust probably fails too.*) |