author | paulson |
Thu, 08 Jan 1998 18:10:34 +0100 | |
changeset 4537 | 4e835bd9fada |
parent 4509 | 828148415197 |
child 4598 | 649bf14debe7 |
permissions | -rw-r--r-- |
1995 | 1 |
(* Title: HOL/Auth/Yahalom |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
2 |
ID: $Id$ |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
4 |
Copyright 1996 University of Cambridge |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
5 |
|
3432 | 6 |
Inductive relation "yahalom" for the Yahalom protocol. |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
7 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
8 |
From page 257 of |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
9 |
Burrows, Abadi and Needham. A Logic of Authentication. |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
10 |
Proc. Royal Soc. 426 (1989) |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
11 |
*) |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
12 |
|
1995 | 13 |
open Yahalom; |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
14 |
|
4449 | 15 |
set proof_timing; |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
16 |
HOL_quantifiers := false; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
17 |
Pretty.setdepth 25; |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
18 |
|
1995 | 19 |
|
2322 | 20 |
(*A "possibility property": there are traces that reach the end*) |
1995 | 21 |
goal thy |
22 |
"!!A B. [| A ~= B; A ~= Server; B ~= Server |] \ |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
23 |
\ ==> EX X NB K. EX evs: yahalom. \ |
3465 | 24 |
\ Says A B {|X, Crypt K (Nonce NB)|} : set evs"; |
1995 | 25 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
26 |
by (rtac (yahalom.Nil RS yahalom.YM1 RS yahalom.YM2 RS yahalom.YM3 RS |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
27 |
yahalom.YM4) 2); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
28 |
by possibility_tac; |
2013 | 29 |
result(); |
1995 | 30 |
|
31 |
||
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
32 |
(**** Inductive proofs about yahalom ****) |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
33 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
34 |
(*Nobody sends themselves messages*) |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
35 |
goal thy "!!evs. evs: yahalom ==> ALL A X. Says A A X ~: set evs"; |
2032 | 36 |
by (etac yahalom.induct 1); |
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4471
diff
changeset
|
37 |
by Auto_tac; |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
38 |
qed_spec_mp "not_Says_to_self"; |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
39 |
Addsimps [not_Says_to_self]; |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
40 |
AddSEs [not_Says_to_self RSN (2, rev_notE)]; |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
41 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
42 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
43 |
(** For reasoning about the encrypted portion of messages **) |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
44 |
|
1995 | 45 |
(*Lets us treat YM4 using a similar argument as for the Fake case.*) |
3465 | 46 |
goal thy "!!evs. Says S A {|Crypt (shrK A) Y, X|} : set evs ==> \ |
3683 | 47 |
\ X : analz (spies evs)"; |
4091 | 48 |
by (blast_tac (claset() addSDs [Says_imp_spies RS analz.Inj]) 1); |
3683 | 49 |
qed "YM4_analz_spies"; |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
50 |
|
3683 | 51 |
bind_thm ("YM4_parts_spies", |
52 |
YM4_analz_spies RS (impOfSubs analz_subset_parts)); |
|
2110 | 53 |
|
2133 | 54 |
(*Relates to both YM4 and Oops*) |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
55 |
goal thy "!!evs. Says S A {|Crypt (shrK A) {|B,K,NA,NB|}, X|} : set evs ==> \ |
3683 | 56 |
\ K : parts (spies evs)"; |
4091 | 57 |
by (blast_tac (claset() addSEs partsEs |
4238
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
58 |
addSDs [Says_imp_spies RS parts.Inj]) 1); |
3683 | 59 |
qed "YM4_Key_parts_spies"; |
2110 | 60 |
|
3683 | 61 |
(*For proving the easier theorems about X ~: parts (spies evs).*) |
62 |
fun parts_spies_tac i = |
|
63 |
forward_tac [YM4_Key_parts_spies] (i+6) THEN |
|
64 |
forward_tac [YM4_parts_spies] (i+5) THEN |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
65 |
prove_simple_subgoals_tac i; |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
66 |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
67 |
(*Induction for regularity theorems. If induction formula has the form |
3683 | 68 |
X ~: analz (spies evs) --> ... then it shortens the proof by discarding |
69 |
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
|
70 |
fun parts_induct_tac i = |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
71 |
etac yahalom.induct i |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
72 |
THEN |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
73 |
REPEAT (FIRSTGOAL analz_mono_contra_tac) |
3683 | 74 |
THEN parts_spies_tac i; |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
75 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
76 |
|
3683 | 77 |
(** Theorems of the form X ~: parts (spies evs) imply that NOBODY |
2013 | 78 |
sends messages containing X! **) |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
79 |
|
3683 | 80 |
(*Spy never sees another agent's shared key! (unless it's bad at start)*) |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
81 |
goal thy |
3683 | 82 |
"!!evs. evs : yahalom ==> (Key (shrK A) : parts (spies evs)) = (A : bad)"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
83 |
by (parts_induct_tac 1); |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
84 |
by (Fake_parts_insert_tac 1); |
3961 | 85 |
by (ALLGOALS Blast_tac); |
2133 | 86 |
qed "Spy_see_shrK"; |
87 |
Addsimps [Spy_see_shrK]; |
|
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
88 |
|
2133 | 89 |
goal thy |
3683 | 90 |
"!!evs. evs : yahalom ==> (Key (shrK A) : analz (spies evs)) = (A : bad)"; |
4091 | 91 |
by (auto_tac(claset() addDs [impOfSubs analz_subset_parts], simpset())); |
2133 | 92 |
qed "Spy_analz_shrK"; |
93 |
Addsimps [Spy_analz_shrK]; |
|
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
94 |
|
4471 | 95 |
AddSDs [Spy_see_shrK RSN (2, rev_iffD1), |
96 |
Spy_analz_shrK RSN (2, rev_iffD1)]; |
|
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
97 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
98 |
|
3432 | 99 |
(*Nobody can have used non-existent keys! Needed to apply analz_insert_Key*) |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
100 |
goal thy "!!evs. evs : yahalom ==> \ |
3683 | 101 |
\ Key K ~: used evs --> K ~: keysFor (parts (spies evs))"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
102 |
by (parts_induct_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
103 |
(*Fake*) |
4509
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
104 |
by (blast_tac (claset() addSDs [keysFor_parts_insert]) 1); |
3961 | 105 |
(*YM2-4: Because Key K is not fresh, etc.*) |
4091 | 106 |
by (REPEAT (blast_tac (claset() addSEs spies_partsEs) 1)); |
2160 | 107 |
qed_spec_mp "new_keys_not_used"; |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
108 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
109 |
bind_thm ("new_keys_not_analzd", |
2032 | 110 |
[analz_subset_parts RS keysFor_mono, |
111 |
new_keys_not_used] MRS contra_subsetD); |
|
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
112 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
113 |
Addsimps [new_keys_not_used, new_keys_not_analzd]; |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
114 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
115 |
|
2133 | 116 |
(*Describes the form of K when the Server sends this message. Useful for |
117 |
Oops as well as main secrecy property.*) |
|
2110 | 118 |
goal thy |
3501
4ab477ffb4c6
Changed some variables of type msg to lower case (e.g. from NB to nb
paulson
parents:
3466
diff
changeset
|
119 |
"!!evs. [| Says Server A {|Crypt (shrK A) {|Agent B, Key K, na, nb|}, X|} \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
120 |
\ : set evs; \ |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
121 |
\ evs : yahalom |] \ |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
122 |
\ ==> K ~: range shrK"; |
2133 | 123 |
by (etac rev_mp 1); |
124 |
by (etac yahalom.induct 1); |
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
125 |
by (ALLGOALS Asm_simp_tac); |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
126 |
by (Blast_tac 1); |
2133 | 127 |
qed "Says_Server_message_form"; |
2110 | 128 |
|
129 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
130 |
(*For proofs involving analz.*) |
3683 | 131 |
val analz_spies_tac = |
132 |
forward_tac [YM4_analz_spies] 6 THEN |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
133 |
forward_tac [Says_Server_message_form] 7 THEN |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
134 |
assume_tac 7 THEN REPEAT ((etac exE ORELSE' hyp_subst_tac) 7); |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
135 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
136 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
137 |
(**** |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
138 |
The following is to prove theorems of the form |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
139 |
|
3683 | 140 |
Key K : analz (insert (Key KAB) (spies evs)) ==> |
141 |
Key K : analz (spies evs) |
|
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
142 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
143 |
A more general formula must be proved inductively. |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
144 |
****) |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
145 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
146 |
(** Session keys are not used to encrypt other session keys **) |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
147 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
148 |
goal thy |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
149 |
"!!evs. evs : yahalom ==> \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
150 |
\ ALL K KK. KK <= Compl (range shrK) --> \ |
3683 | 151 |
\ (Key K : analz (Key``KK Un (spies evs))) = \ |
152 |
\ (K : KK | Key K : analz (spies evs))"; |
|
2032 | 153 |
by (etac yahalom.induct 1); |
3683 | 154 |
by analz_spies_tac; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
155 |
by (REPEAT_FIRST (resolve_tac [allI, impI])); |
3679 | 156 |
by (REPEAT_FIRST (rtac analz_image_freshK_lemma)); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
157 |
by (ALLGOALS (asm_simp_tac analz_image_freshK_ss)); |
3450
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3444
diff
changeset
|
158 |
(*Fake*) |
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4238
diff
changeset
|
159 |
by (spy_analz_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
160 |
qed_spec_mp "analz_image_freshK"; |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
161 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
162 |
goal thy |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
163 |
"!!evs. [| evs : yahalom; KAB ~: range shrK |] ==> \ |
3683 | 164 |
\ Key K : analz (insert (Key KAB) (spies evs)) = \ |
165 |
\ (K = KAB | Key K : analz (spies evs))"; |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
166 |
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:
2454
diff
changeset
|
167 |
qed "analz_insert_freshK"; |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
168 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
169 |
|
2110 | 170 |
(*** The Key K uniquely identifies the Server's message. **) |
171 |
||
172 |
goal thy |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
173 |
"!!evs. evs : yahalom ==> \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
174 |
\ EX A' B' na' nb' X'. ALL A B na nb X. \ |
2110 | 175 |
\ Says Server A \ |
3450
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3444
diff
changeset
|
176 |
\ {|Crypt (shrK A) {|Agent B, Key K, na, nb|}, X|} \ |
3465 | 177 |
\ : set evs --> A=A' & B=B' & na=na' & nb=nb' & X=X'"; |
2110 | 178 |
by (etac yahalom.induct 1); |
4091 | 179 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib]))); |
3708 | 180 |
by (ALLGOALS Clarify_tac); |
2133 | 181 |
by (ex_strip_tac 2); |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
182 |
by (Blast_tac 2); |
2110 | 183 |
(*Remaining case: YM3*) |
184 |
by (expand_case_tac "K = ?y" 1); |
|
185 |
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:
2454
diff
changeset
|
186 |
(*...we assume X is a recent message and handle this case by contradiction*) |
4091 | 187 |
by (blast_tac (claset() addSEs spies_partsEs |
4238
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
188 |
delrules [conjI] (*no split-up to 4 subgoals*)) 1); |
2110 | 189 |
val lemma = result(); |
190 |
||
191 |
goal thy |
|
3683 | 192 |
"!!evs. [| Says Server A \ |
193 |
\ {|Crypt (shrK A) {|Agent B, Key K, na, nb|}, X|} : set evs; \ |
|
194 |
\ Says Server A' \ |
|
195 |
\ {|Crypt (shrK A') {|Agent B', Key K, na', nb'|}, X'|} : set evs; \ |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
196 |
\ evs : yahalom |] \ |
3450
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3444
diff
changeset
|
197 |
\ ==> A=A' & B=B' & na=na' & nb=nb'"; |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2377
diff
changeset
|
198 |
by (prove_unique_tac lemma 1); |
2110 | 199 |
qed "unique_session_keys"; |
200 |
||
201 |
||
202 |
(** Crucial secrecy property: Spy does not see the keys sent in msg YM3 **) |
|
2013 | 203 |
|
204 |
goal thy |
|
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
205 |
"!!evs. [| A ~: bad; B ~: bad; evs : yahalom |] \ |
2051 | 206 |
\ ==> Says Server A \ |
3450
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3444
diff
changeset
|
207 |
\ {|Crypt (shrK A) {|Agent B, Key K, na, nb|}, \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
208 |
\ Crypt (shrK B) {|Agent A, Key K|}|} \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
209 |
\ : set evs --> \ |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
210 |
\ Notes Spy {|na, nb, Key K|} ~: set evs --> \ |
3683 | 211 |
\ Key K ~: analz (spies evs)"; |
2032 | 212 |
by (etac yahalom.induct 1); |
3683 | 213 |
by analz_spies_tac; |
2013 | 214 |
by (ALLGOALS |
215 |
(asm_simp_tac |
|
4091 | 216 |
(simpset() addsimps (expand_ifs@pushes) |
4238
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
217 |
addsimps [analz_insert_eq, analz_insert_freshK]))); |
3450
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3444
diff
changeset
|
218 |
(*Oops*) |
4091 | 219 |
by (blast_tac (claset() addDs [unique_session_keys]) 3); |
2013 | 220 |
(*YM3*) |
4091 | 221 |
by (blast_tac (claset() delrules [impCE] |
4238
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
222 |
addSEs spies_partsEs |
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
223 |
addIs [impOfSubs analz_subset_parts]) 2); |
3450
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3444
diff
changeset
|
224 |
(*Fake*) |
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3444
diff
changeset
|
225 |
by (spy_analz_tac 1); |
2110 | 226 |
val lemma = result() RS mp RS mp RSN(2,rev_notE); |
2013 | 227 |
|
228 |
||
3432 | 229 |
(*Final version*) |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
230 |
goal thy |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
231 |
"!!evs. [| Says Server A \ |
3450
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3444
diff
changeset
|
232 |
\ {|Crypt (shrK A) {|Agent B, Key K, na, nb|}, \ |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
233 |
\ Crypt (shrK B) {|Agent A, Key K|}|} \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
234 |
\ : set evs; \ |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
235 |
\ 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
|
236 |
\ A ~: bad; B ~: bad; evs : yahalom |] \ |
3683 | 237 |
\ ==> Key K ~: analz (spies evs)"; |
2013 | 238 |
by (forward_tac [Says_Server_message_form] 1 THEN assume_tac 1); |
4091 | 239 |
by (blast_tac (claset() addSEs [lemma]) 1); |
2032 | 240 |
qed "Spy_not_see_encrypted_key"; |
2001 | 241 |
|
242 |
||
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
243 |
(** Security Guarantee for A upon receiving YM3 **) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
244 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
245 |
(*If the encrypted message appears then it originated with the Server*) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
246 |
goal thy |
3683 | 247 |
"!!evs. [| Crypt (shrK A) {|Agent B, Key K, na, nb|} : parts (spies evs); \ |
248 |
\ A ~: bad; evs : yahalom |] \ |
|
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
249 |
\ ==> Says Server A \ |
3450
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3444
diff
changeset
|
250 |
\ {|Crypt (shrK A) {|Agent B, Key K, na, nb|}, \ |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
251 |
\ Crypt (shrK B) {|Agent A, Key K|}|} \ |
3465 | 252 |
\ : set evs"; |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
253 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
254 |
by (parts_induct_tac 1); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
255 |
by (Fake_parts_insert_tac 1); |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
256 |
qed "A_trusts_YM3"; |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
257 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
258 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
259 |
(** Security Guarantees for B upon receiving YM4 **) |
2013 | 260 |
|
2110 | 261 |
(*B knows, by the first part of A's message, that the Server distributed |
262 |
the key for A and B. But this part says nothing about nonces.*) |
|
2001 | 263 |
goal thy |
3683 | 264 |
"!!evs. [| Crypt (shrK B) {|Agent A, Key K|} : parts (spies evs); \ |
265 |
\ B ~: bad; evs : yahalom |] \ |
|
2001 | 266 |
\ ==> EX NA NB. Says Server A \ |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2377
diff
changeset
|
267 |
\ {|Crypt (shrK A) {|Agent B, Key K, \ |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
268 |
\ Nonce NA, Nonce NB|}, \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
269 |
\ Crypt (shrK B) {|Agent A, Key K|}|} \ |
3465 | 270 |
\ : set evs"; |
2032 | 271 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
272 |
by (parts_induct_tac 1); |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
273 |
by (Fake_parts_insert_tac 1); |
2110 | 274 |
(*YM3*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
275 |
by (Blast_tac 1); |
2110 | 276 |
qed "B_trusts_YM4_shrK"; |
277 |
||
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
278 |
(*B knows, by the second part of A's message, that the Server distributed |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
279 |
the key quoting nonce NB. This part says nothing about agent names. |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
280 |
Secrecy of NB is crucial.*) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
281 |
goal thy |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
282 |
"!!evs. evs : yahalom \ |
3683 | 283 |
\ ==> Nonce NB ~: analz (spies evs) --> \ |
284 |
\ Crypt K (Nonce NB) : parts (spies evs) --> \ |
|
3543 | 285 |
\ (EX A B NA. Says Server A \ |
286 |
\ {|Crypt (shrK A) {|Agent B, Key K, \ |
|
287 |
\ Nonce NA, Nonce NB|}, \ |
|
288 |
\ Crypt (shrK B) {|Agent A, Key K|}|} \ |
|
3465 | 289 |
\ : set evs)"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
290 |
by (parts_induct_tac 1); |
3708 | 291 |
by (ALLGOALS Clarify_tac); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
292 |
(*YM3 & Fake*) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
293 |
by (Blast_tac 2); |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
294 |
by (Fake_parts_insert_tac 1); |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
295 |
(*YM4*) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
296 |
(*A is uncompromised because NB is secure*) |
3683 | 297 |
by (not_bad_tac "A" 1); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
298 |
(*A's certificate guarantees the existence of the Server message*) |
4091 | 299 |
by (blast_tac (claset() addDs [Says_imp_spies RS parts.Inj RS parts.Fst RS |
4238
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
300 |
A_trusts_YM3]) 1); |
3464
315694e22856
Trivial changes in connection with the Yahalom paper.
paulson
parents:
3450
diff
changeset
|
301 |
bind_thm ("B_trusts_YM4_newK", result() RS mp RSN (2, rev_mp)); |
2133 | 302 |
|
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
303 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
304 |
(**** Towards proving secrecy of Nonce NB ****) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
305 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
306 |
(** Lemmas about the predicate KeyWithNonce **) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
307 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
308 |
goalw thy [KeyWithNonce_def] |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
309 |
"!!evs. Says Server A \ |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
310 |
\ {|Crypt (shrK A) {|Agent B, Key K, na, Nonce NB|}, X|} \ |
3465 | 311 |
\ : set evs ==> KeyWithNonce K NB evs"; |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
312 |
by (Blast_tac 1); |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
313 |
qed "KeyWithNonceI"; |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
314 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
315 |
goalw thy [KeyWithNonce_def] |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
316 |
"KeyWithNonce K NB (Says S A X # evs) = \ |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
317 |
\ (Server = S & \ |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
318 |
\ (EX B n X'. X = {|Crypt (shrK A) {|Agent B, Key K, n, Nonce NB|}, X'|}) \ |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
319 |
\ | KeyWithNonce K NB evs)"; |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
320 |
by (Simp_tac 1); |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
321 |
by (Blast_tac 1); |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
322 |
qed "KeyWithNonce_Says"; |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
323 |
Addsimps [KeyWithNonce_Says]; |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
324 |
|
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
325 |
goalw thy [KeyWithNonce_def] |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
326 |
"KeyWithNonce K NB (Notes A X # evs) = KeyWithNonce K NB evs"; |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
327 |
by (Simp_tac 1); |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
328 |
qed "KeyWithNonce_Notes"; |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
329 |
Addsimps [KeyWithNonce_Notes]; |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
330 |
|
3464
315694e22856
Trivial changes in connection with the Yahalom paper.
paulson
parents:
3450
diff
changeset
|
331 |
(*A fresh key cannot be associated with any nonce |
315694e22856
Trivial changes in connection with the Yahalom paper.
paulson
parents:
3450
diff
changeset
|
332 |
(with respect to a given trace). *) |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
333 |
goalw thy [KeyWithNonce_def] |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
334 |
"!!evs. Key K ~: used evs ==> ~ KeyWithNonce K NB evs"; |
4091 | 335 |
by (blast_tac (claset() addSEs spies_partsEs) 1); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
336 |
qed "fresh_not_KeyWithNonce"; |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
337 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
338 |
(*The Server message associates K with NB' and therefore not with any |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
339 |
other nonce NB.*) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
340 |
goalw thy [KeyWithNonce_def] |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
341 |
"!!evs. [| Says Server A \ |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
342 |
\ {|Crypt (shrK A) {|Agent B, Key K, na, Nonce NB'|}, X|} \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
343 |
\ : set evs; \ |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
344 |
\ NB ~= NB'; evs : yahalom |] \ |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
345 |
\ ==> ~ KeyWithNonce K NB evs"; |
4091 | 346 |
by (blast_tac (claset() addDs [unique_session_keys]) 1); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
347 |
qed "Says_Server_KeyWithNonce"; |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
348 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
349 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
350 |
(*The only nonces that can be found with the help of session keys are |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
351 |
those distributed as nonce NB by the Server. The form of the theorem |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
352 |
recalls analz_image_freshK, but it is much more complicated.*) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
353 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
354 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
355 |
(*As with analz_image_freshK, we take some pains to express the property |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
356 |
as a logical equivalence so that the simplifier can apply it.*) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
357 |
goal thy |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
358 |
"!!evs. P --> (X : analz (G Un H)) --> (X : analz H) ==> \ |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
359 |
\ P --> (X : analz (G Un H)) = (X : analz H)"; |
4091 | 360 |
by (blast_tac (claset() addIs [impOfSubs analz_mono]) 1); |
3961 | 361 |
val Nonce_secrecy_lemma = result(); |
2133 | 362 |
|
363 |
goal thy |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
364 |
"!!evs. evs : yahalom ==> \ |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
365 |
\ (ALL KK. KK <= Compl (range shrK) --> \ |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
366 |
\ (ALL K: KK. ~ KeyWithNonce K NB evs) --> \ |
3683 | 367 |
\ (Nonce NB : analz (Key``KK Un (spies evs))) = \ |
368 |
\ (Nonce NB : analz (spies evs)))"; |
|
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
369 |
by (etac yahalom.induct 1); |
3683 | 370 |
by analz_spies_tac; |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
371 |
by (REPEAT_FIRST (resolve_tac [impI RS allI])); |
3961 | 372 |
by (REPEAT_FIRST (rtac Nonce_secrecy_lemma)); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
373 |
(*For Oops, simplification proves NBa~=NB. By Says_Server_KeyWithNonce, |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
374 |
we get (~ KeyWithNonce K NB evsa); then simplification can apply the |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
375 |
induction hypothesis with KK = {K}.*) |
3961 | 376 |
by (ALLGOALS (*12 seconds*) |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
377 |
(asm_simp_tac |
3961 | 378 |
(analz_image_freshK_ss |
379 |
addsimps expand_ifs |
|
380 |
addsimps [all_conj_distrib, analz_image_freshK, |
|
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
381 |
KeyWithNonce_Says, KeyWithNonce_Notes, |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
382 |
fresh_not_KeyWithNonce, |
3961 | 383 |
imp_disj_not1, (*Moves NBa~=NB to the front*) |
384 |
Says_Server_KeyWithNonce]))); |
|
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
385 |
(*Fake*) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
386 |
by (spy_analz_tac 1); |
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4238
diff
changeset
|
387 |
(*YM4*) (** LEVEL 6 **) |
3683 | 388 |
by (not_bad_tac "A" 1); |
389 |
by (dtac (Says_imp_spies RS parts.Inj RS parts.Fst RS A_trusts_YM3) 1 |
|
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
390 |
THEN REPEAT (assume_tac 1)); |
4091 | 391 |
by (blast_tac (claset() addIs [KeyWithNonceI]) 1); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
392 |
qed_spec_mp "Nonce_secrecy"; |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
393 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
394 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
395 |
(*Version required below: if NB can be decrypted using a session key then it |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
396 |
was distributed with that key. The more general form above is required |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
397 |
for the induction to carry through.*) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
398 |
goal thy |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
399 |
"!!evs. [| Says Server A \ |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
400 |
\ {|Crypt (shrK A) {|Agent B, Key KAB, na, Nonce NB'|}, X|} \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
401 |
\ : set evs; \ |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
402 |
\ NB ~= NB'; KAB ~: range shrK; evs : yahalom |] \ |
3683 | 403 |
\ ==> (Nonce NB : analz (insert (Key KAB) (spies evs))) = \ |
404 |
\ (Nonce NB : analz (spies evs))"; |
|
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
405 |
by (asm_simp_tac (analz_image_freshK_ss addsimps |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
406 |
[Nonce_secrecy, Says_Server_KeyWithNonce]) 1); |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
407 |
qed "single_Nonce_secrecy"; |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
408 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
409 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
410 |
(*** The Nonce NB uniquely identifies B's message. ***) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
411 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
412 |
goal thy |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
413 |
"!!evs. evs : yahalom ==> \ |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
414 |
\ EX NA' A' B'. ALL NA A B. \ |
3683 | 415 |
\ Crypt (shrK B) {|Agent A, Nonce NA, nb|} : parts(spies evs) \ |
416 |
\ --> B ~: bad --> NA = NA' & A = A' & B = B'"; |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
417 |
by (parts_induct_tac 1); |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
418 |
(*Fake*) |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
419 |
by (REPEAT (etac (exI RSN (2,exE)) 1) (*stripping EXs makes proof faster*) |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
420 |
THEN Fake_parts_insert_tac 1); |
4091 | 421 |
by (asm_simp_tac (simpset() addsimps [all_conj_distrib]) 1); |
2133 | 422 |
(*YM2: creation of new Nonce. Move assertion into global context*) |
3501
4ab477ffb4c6
Changed some variables of type msg to lower case (e.g. from NB to nb
paulson
parents:
3466
diff
changeset
|
423 |
by (expand_case_tac "nb = ?y" 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
424 |
by (REPEAT (resolve_tac [exI, conjI, impI, refl] 1)); |
4091 | 425 |
by (blast_tac (claset() addSEs spies_partsEs) 1); |
2133 | 426 |
val lemma = result(); |
427 |
||
2110 | 428 |
goal thy |
3683 | 429 |
"!!evs.[| Crypt (shrK B) {|Agent A, Nonce NA, nb|} : parts (spies evs); \ |
430 |
\ Crypt (shrK B') {|Agent A', Nonce NA', nb|} : parts (spies evs); \ |
|
431 |
\ evs : yahalom; B ~: bad; B' ~: bad |] \ |
|
2133 | 432 |
\ ==> NA' = NA & A' = A & B' = B"; |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2377
diff
changeset
|
433 |
by (prove_unique_tac lemma 1); |
2133 | 434 |
qed "unique_NB"; |
435 |
||
436 |
||
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
437 |
(*Variant useful for proving secrecy of NB: the Says... form allows |
3683 | 438 |
not_bad_tac to remove the assumption B' ~: bad.*) |
2133 | 439 |
goal thy |
3501
4ab477ffb4c6
Changed some variables of type msg to lower case (e.g. from NB to nb
paulson
parents:
3466
diff
changeset
|
440 |
"!!evs.[| Says C D {|X, Crypt (shrK B) {|Agent A, Nonce NA, nb|}|} \ |
3683 | 441 |
\ : set evs; B ~: bad; \ |
3501
4ab477ffb4c6
Changed some variables of type msg to lower case (e.g. from NB to nb
paulson
parents:
3466
diff
changeset
|
442 |
\ Says C' D' {|X', Crypt (shrK B') {|Agent A', Nonce NA', nb|}|} \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
443 |
\ : set evs; \ |
3683 | 444 |
\ nb ~: analz (spies evs); evs : yahalom |] \ |
2133 | 445 |
\ ==> NA' = NA & A' = A & B' = B"; |
3683 | 446 |
by (not_bad_tac "B'" 1); |
4091 | 447 |
by (blast_tac (claset() addSDs [Says_imp_spies RS parts.Inj] |
4238
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
448 |
addSEs [MPair_parts] |
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
449 |
addDs [unique_NB]) 1); |
2133 | 450 |
qed "Says_unique_NB"; |
451 |
||
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
452 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
453 |
(** A nonce value is never used both as NA and as NB **) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
454 |
|
2133 | 455 |
goal thy |
3683 | 456 |
"!!evs. [| B ~: bad; evs : yahalom |] \ |
457 |
\ ==> Nonce NB ~: analz (spies evs) --> \ |
|
458 |
\ Crypt (shrK B') {|Agent A', Nonce NB, nb'|} : parts(spies evs) --> \ |
|
459 |
\ Crypt (shrK B) {|Agent A, Nonce NA, Nonce NB|} ~: parts(spies evs)"; |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
460 |
by (parts_induct_tac 1); |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
461 |
by (Fake_parts_insert_tac 1); |
4091 | 462 |
by (blast_tac (claset() addDs [Says_imp_spies RS analz.Inj] |
4238
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
463 |
addSIs [parts_insertI] |
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
464 |
addSEs partsEs) 1); |
3464
315694e22856
Trivial changes in connection with the Yahalom paper.
paulson
parents:
3450
diff
changeset
|
465 |
bind_thm ("no_nonce_YM1_YM2", result() RS mp RSN (2,rev_mp) RSN (2,rev_notE)); |
2133 | 466 |
|
3464
315694e22856
Trivial changes in connection with the Yahalom paper.
paulson
parents:
3450
diff
changeset
|
467 |
(*The Server sends YM3 only in response to YM2.*) |
2133 | 468 |
goal thy |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
469 |
"!!evs. [| Says Server A \ |
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
470 |
\ {|Crypt (shrK A) {|Agent B, k, na, nb|}, X|} : set evs; \ |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
471 |
\ evs : yahalom |] \ |
2133 | 472 |
\ ==> EX B'. Says B' Server \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
473 |
\ {| Agent B, Crypt (shrK B) {|Agent A, na, nb|} |} \ |
3465 | 474 |
\ : set evs"; |
2133 | 475 |
by (etac rev_mp 1); |
476 |
by (etac yahalom.induct 1); |
|
477 |
by (ALLGOALS Asm_simp_tac); |
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
478 |
by (ALLGOALS Blast_tac); |
2133 | 479 |
qed "Says_Server_imp_YM2"; |
480 |
||
481 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
482 |
(*A vital theorem for B, that nonce NB remains secure from the Spy.*) |
2133 | 483 |
goal thy |
3683 | 484 |
"!!evs. [| A ~: bad; B ~: bad; evs : yahalom |] \ |
2133 | 485 |
\ ==> Says B Server \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
486 |
\ {|Agent B, Crypt (shrK B) {|Agent A, Nonce NA, Nonce NB|}|} \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
487 |
\ : set evs --> \ |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
488 |
\ (ALL k. Notes Spy {|Nonce NA, Nonce NB, k|} ~: set evs) --> \ |
3683 | 489 |
\ Nonce NB ~: analz (spies evs)"; |
2133 | 490 |
by (etac yahalom.induct 1); |
3683 | 491 |
by analz_spies_tac; |
2133 | 492 |
by (ALLGOALS |
493 |
(asm_simp_tac |
|
4091 | 494 |
(simpset() addsimps (expand_ifs@pushes) |
4238
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
495 |
addsimps [analz_insert_eq, analz_insert_freshK]))); |
3450
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3444
diff
changeset
|
496 |
(*Prove YM3 by showing that no NB can also be an NA*) |
4091 | 497 |
by (blast_tac (claset() addDs [Says_imp_spies RS parts.Inj] |
4238
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
498 |
addSEs [MPair_parts] |
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
499 |
addDs [no_nonce_YM1_YM2, Says_unique_NB]) 4 |
3450
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3444
diff
changeset
|
500 |
THEN flexflex_tac); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
501 |
(*YM2: similar freshness reasoning*) |
4091 | 502 |
by (blast_tac (claset() addSEs partsEs |
4238
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
503 |
addDs [Says_imp_spies RS analz.Inj, |
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
504 |
impOfSubs analz_subset_parts]) 3); |
3450
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3444
diff
changeset
|
505 |
(*YM1: NB=NA is impossible anyway, but NA is secret because it is fresh!*) |
4091 | 506 |
by (blast_tac (claset() addSIs [parts_insertI] |
4238
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
507 |
addSEs spies_partsEs) 2); |
2377 | 508 |
(*Fake*) |
509 |
by (spy_analz_tac 1); |
|
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
510 |
(** LEVEL 7: YM4 and Oops remain **) |
3708 | 511 |
by (ALLGOALS Clarify_tac); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
512 |
(*YM4: key K is visible to Spy, contradicting session key secrecy theorem*) |
3683 | 513 |
by (not_bad_tac "Aa" 1); |
514 |
by (dtac (Says_imp_spies RS parts.Inj RS parts.Fst RS A_trusts_YM3) 1); |
|
2133 | 515 |
by (forward_tac [Says_Server_message_form] 3); |
516 |
by (forward_tac [Says_Server_imp_YM2] 4); |
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
517 |
by (REPEAT_FIRST (eresolve_tac [asm_rl, bexE, exE, disjE])); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
518 |
(* use Says_unique_NB to identify message components: Aa=A, Ba=B, NAa=NA *) |
4091 | 519 |
by (blast_tac (claset() addDs [Says_unique_NB, Spy_not_see_encrypted_key, |
4238
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
520 |
impOfSubs Fake_analz_insert]) 1); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
521 |
(** LEVEL 14 **) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
522 |
(*Oops case: if the nonce is betrayed now, show that the Oops event is |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
523 |
covered by the quantified Oops assumption.*) |
4091 | 524 |
by (full_simp_tac (simpset() addsimps [all_conj_distrib]) 1); |
2133 | 525 |
by (forward_tac [Says_Server_imp_YM2] 1 THEN assume_tac 1 THEN etac exE 1); |
526 |
by (expand_case_tac "NB = NBa" 1); |
|
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
527 |
(*If NB=NBa then all other components of the Oops message agree*) |
4091 | 528 |
by (blast_tac (claset() addDs [Says_unique_NB]) 1 THEN flexflex_tac); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
529 |
(*case NB ~= NBa*) |
4091 | 530 |
by (asm_simp_tac (simpset() addsimps [single_Nonce_secrecy]) 1); |
4471 | 531 |
by (Clarify_tac 1); |
4091 | 532 |
by (blast_tac (claset() addSEs [MPair_parts] |
4238
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
533 |
addDs [Says_imp_spies RS parts.Inj, |
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
534 |
no_nonce_YM1_YM2 (*to prove NB~=NAa*) ]) 1); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
535 |
bind_thm ("Spy_not_see_NB", result() RSN(2,rev_mp) RSN(2,rev_mp)); |
2133 | 536 |
|
2001 | 537 |
|
3464
315694e22856
Trivial changes in connection with the Yahalom paper.
paulson
parents:
3450
diff
changeset
|
538 |
(*B's session key guarantee from YM4. The two certificates contribute to a |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
539 |
single conclusion about the Server's message. Note that the "Notes Spy" |
3464
315694e22856
Trivial changes in connection with the Yahalom paper.
paulson
parents:
3450
diff
changeset
|
540 |
assumption must quantify over ALL POSSIBLE keys instead of our particular K. |
315694e22856
Trivial changes in connection with the Yahalom paper.
paulson
parents:
3450
diff
changeset
|
541 |
If this run is broken and the spy substitutes a certificate containing an |
315694e22856
Trivial changes in connection with the Yahalom paper.
paulson
parents:
3450
diff
changeset
|
542 |
old key, B has no means of telling.*) |
2001 | 543 |
goal thy |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
544 |
"!!evs. [| Says B Server \ |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
545 |
\ {|Agent B, Crypt (shrK B) {|Agent A, Nonce NA, Nonce NB|}|} \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
546 |
\ : set evs; \ |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
547 |
\ Says A' B {|Crypt (shrK B) {|Agent A, Key K|}, \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
548 |
\ Crypt K (Nonce NB)|} : set evs; \ |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
549 |
\ ALL k. Notes Spy {|Nonce NA, Nonce NB, k|} ~: set evs; \ |
3683 | 550 |
\ A ~: bad; B ~: bad; evs : yahalom |] \ |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
551 |
\ ==> Says Server A \ |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
552 |
\ {|Crypt (shrK A) {|Agent B, Key K, \ |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
553 |
\ Nonce NA, Nonce NB|}, \ |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
554 |
\ Crypt (shrK B) {|Agent A, Key K|}|} \ |
3465 | 555 |
\ : set evs"; |
2133 | 556 |
by (forward_tac [Spy_not_see_NB] 1 THEN REPEAT (assume_tac 1)); |
3683 | 557 |
by (etac (Says_imp_spies RS parts.Inj RS MPair_parts) 1 THEN |
2133 | 558 |
dtac B_trusts_YM4_shrK 1); |
2170 | 559 |
by (dtac B_trusts_YM4_newK 3); |
2110 | 560 |
by (REPEAT_FIRST (eresolve_tac [asm_rl, exE])); |
2133 | 561 |
by (forward_tac [Says_Server_imp_YM2] 1 THEN assume_tac 1); |
2170 | 562 |
by (dtac unique_session_keys 1 THEN REPEAT (assume_tac 1)); |
4091 | 563 |
by (blast_tac (claset() addDs [Says_unique_NB]) 1); |
2322 | 564 |
qed "B_trusts_YM4"; |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
565 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
566 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
567 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
568 |
(*** Authenticating B to A ***) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
569 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
570 |
(*The encryption in message YM2 tells us it cannot be faked.*) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
571 |
goal thy |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
572 |
"!!evs. evs : yahalom \ |
3683 | 573 |
\ ==> Crypt (shrK B) {|Agent A, Nonce NA, nb|} : parts (spies evs) --> \ |
574 |
\ B ~: bad --> \ |
|
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
575 |
\ Says B Server {|Agent B, Crypt (shrK B) {|Agent A, Nonce NA, nb|}|} \ |
3465 | 576 |
\ : set evs"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
577 |
by (parts_induct_tac 1); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
578 |
by (Fake_parts_insert_tac 1); |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
579 |
bind_thm ("B_Said_YM2", result() RSN (2, rev_mp) RS mp); |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
580 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
581 |
(*If the server sends YM3 then B sent YM2*) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
582 |
goal thy |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
583 |
"!!evs. evs : yahalom \ |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
584 |
\ ==> Says Server A {|Crypt (shrK A) {|Agent B, Key K, Nonce NA, nb|}, X|} \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
585 |
\ : set evs --> \ |
3683 | 586 |
\ B ~: bad --> \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
587 |
\ Says B Server {|Agent B, Crypt (shrK B) {|Agent A, Nonce NA, nb|}|} \ |
3465 | 588 |
\ : set evs"; |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
589 |
by (etac yahalom.induct 1); |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
590 |
by (ALLGOALS Asm_simp_tac); |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
591 |
(*YM4*) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
592 |
by (Blast_tac 2); |
4509
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
593 |
(*YM3 [blast_tac is 50% slower] *) |
4091 | 594 |
by (best_tac (claset() addSDs [B_Said_YM2, Says_imp_spies RS parts.Inj] |
4238
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
595 |
addSEs [MPair_parts]) 1); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
596 |
val lemma = result() RSN (2, rev_mp) RS mp |> standard; |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
597 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
598 |
(*If A receives YM3 then B has used nonce NA (and therefore is alive)*) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
599 |
goal thy |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
600 |
"!!evs. [| Says S A {|Crypt (shrK A) {|Agent B, Key K, Nonce NA, nb|}, X|} \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
601 |
\ : set evs; \ |
3683 | 602 |
\ A ~: bad; B ~: bad; evs : yahalom |] \ |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
603 |
\ ==> Says B Server {|Agent B, Crypt (shrK B) {|Agent A, Nonce NA, nb|}|} \ |
3465 | 604 |
\ : set evs"; |
4091 | 605 |
by (blast_tac (claset() addSDs [A_trusts_YM3, lemma] |
4238
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
606 |
addEs spies_partsEs) 1); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
607 |
qed "YM3_auth_B_to_A"; |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
608 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
609 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
610 |
(*** Authenticating A to B using the certificate Crypt K (Nonce NB) ***) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
611 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
612 |
(*Assuming the session key is secure, if both certificates are present then |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
613 |
A has said NB. We can't be sure about the rest of A's message, but only |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
614 |
NB matters for freshness.*) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
615 |
goal thy |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
616 |
"!!evs. evs : yahalom \ |
3683 | 617 |
\ ==> Key K ~: analz (spies evs) --> \ |
618 |
\ Crypt K (Nonce NB) : parts (spies evs) --> \ |
|
619 |
\ Crypt (shrK B) {|Agent A, Key K|} : parts (spies evs) --> \ |
|
620 |
\ B ~: bad --> \ |
|
621 |
\ (EX X. Says A B {|X, Crypt K (Nonce NB)|} : set evs)"; |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
622 |
by (parts_induct_tac 1); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
623 |
(*Fake*) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
624 |
by (Fake_parts_insert_tac 1); |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
625 |
(*YM3: by new_keys_not_used we note that Crypt K (Nonce NB) could not exist*) |
4238
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
626 |
by (fast_tac (claset() addSDs [Crypt_imp_keysFor] addss (simpset())) 1); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
627 |
(*YM4: was Crypt K (Nonce NB) the very last message? If not, use ind. hyp.*) |
4091 | 628 |
by (asm_simp_tac (simpset() addsimps [ex_disj_distrib]) 1); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
629 |
(*yes: apply unicity of session keys*) |
3683 | 630 |
by (not_bad_tac "Aa" 1); |
4091 | 631 |
by (blast_tac (claset() addSEs [MPair_parts] |
4238
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
632 |
addSDs [A_trusts_YM3, B_trusts_YM4_shrK] |
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
633 |
addDs [Says_imp_spies RS parts.Inj, |
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
634 |
unique_session_keys]) 1); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
635 |
val lemma = normalize_thm [RSspec, RSmp] (result()) |> standard; |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
636 |
|
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
637 |
(*If B receives YM4 then A has used nonce NB (and therefore is alive). |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
638 |
Moreover, A associates K with NB (thus is talking about the same run). |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
639 |
Other premises guarantee secrecy of K.*) |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
640 |
goal thy |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
641 |
"!!evs. [| Says B Server \ |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
642 |
\ {|Agent B, Crypt (shrK B) {|Agent A, Nonce NA, Nonce NB|}|} \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
643 |
\ : set evs; \ |
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
644 |
\ Says A' B {|Crypt (shrK B) {|Agent A, Key K|}, \ |
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
645 |
\ Crypt K (Nonce NB)|} : set evs; \ |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
646 |
\ (ALL NA k. Notes Spy {|Nonce NA, Nonce NB, k|} ~: set evs); \ |
3683 | 647 |
\ A ~: bad; B ~: bad; evs : yahalom |] \ |
3465 | 648 |
\ ==> EX X. Says A B {|X, Crypt K (Nonce NB)|} : set evs"; |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
649 |
by (dtac B_trusts_YM4 1); |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
650 |
by (REPEAT_FIRST (eresolve_tac [asm_rl, spec])); |
3683 | 651 |
by (etac (Says_imp_spies RS parts.Inj RS MPair_parts) 1); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
652 |
by (rtac lemma 1); |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
653 |
by (rtac Spy_not_see_encrypted_key 2); |
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
654 |
by (REPEAT_FIRST assume_tac); |
4091 | 655 |
by (blast_tac (claset() addSEs [MPair_parts] |
4238
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4091
diff
changeset
|
656 |
addDs [Says_imp_spies RS parts.Inj]) 1); |
3444
919de2cb3487
Streamlined proofs of the secrecy of NB and added authentication of A and B
paulson
parents:
3432
diff
changeset
|
657 |
qed_spec_mp "YM4_imp_A_Said_YM3"; |