author | bulwahn |
Tue, 10 Jan 2012 10:18:08 +0100 | |
changeset 46169 | 321abd584588 |
parent 44890 | 22f665a2e91c |
child 55417 | 01fbfb60c33e |
permissions | -rw-r--r-- |
37936 | 1 |
(* Title: HOL/Auth/Kerberos_BAN_Gets.thy |
18886 | 2 |
Author: Giampaolo Bella, Catania University |
3 |
*) |
|
4 |
||
5 |
header{*The Kerberos Protocol, BAN Version, with Gets event*} |
|
6 |
||
7 |
theory Kerberos_BAN_Gets imports Public begin |
|
8 |
||
9 |
text{*From page 251 of |
|
10 |
Burrows, Abadi and Needham (1989). A Logic of Authentication. |
|
11 |
Proc. Royal Soc. 426 |
|
12 |
||
13 |
Confidentiality (secrecy) and authentication properties rely on |
|
14 |
temporal checks: strong guarantees in a little abstracted - but |
|
15 |
very realistic - model. |
|
16 |
*} |
|
17 |
||
18 |
(* Temporal modelization: session keys can be leaked |
|
19 |
ONLY when they have expired *) |
|
20 |
||
21 |
consts |
|
22 |
||
23 |
(*Duration of the session key*) |
|
24 |
sesKlife :: nat |
|
25 |
||
26 |
(*Duration of the authenticator*) |
|
27 |
authlife :: nat |
|
28 |
||
29 |
text{*The ticket should remain fresh for two journeys on the network at least*} |
|
30 |
text{*The Gets event causes longer traces for the protocol to reach its end*} |
|
31 |
specification (sesKlife) |
|
32 |
sesKlife_LB [iff]: "4 \<le> sesKlife" |
|
33 |
by blast |
|
34 |
||
35 |
text{*The authenticator only for one journey*} |
|
36 |
text{*The Gets event causes longer traces for the protocol to reach its end*} |
|
37 |
specification (authlife) |
|
38 |
authlife_LB [iff]: "2 \<le> authlife" |
|
39 |
by blast |
|
40 |
||
41 |
||
20768 | 42 |
abbreviation |
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20768
diff
changeset
|
43 |
CT :: "event list=>nat" where |
20768 | 44 |
"CT == length" |
18886 | 45 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20768
diff
changeset
|
46 |
abbreviation |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20768
diff
changeset
|
47 |
expiredK :: "[nat, event list] => bool" where |
20768 | 48 |
"expiredK T evs == sesKlife + T < CT evs" |
18886 | 49 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20768
diff
changeset
|
50 |
abbreviation |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20768
diff
changeset
|
51 |
expiredA :: "[nat, event list] => bool" where |
20768 | 52 |
"expiredA T evs == authlife + T < CT evs" |
18886 | 53 |
|
54 |
||
36866 | 55 |
definition |
18886 | 56 |
(* Yields the subtrace of a given trace from its beginning to a given event *) |
57 |
before :: "[event, event list] => event list" ("before _ on _") |
|
36866 | 58 |
where "before ev on evs = takeWhile (% z. z ~= ev) (rev evs)" |
18886 | 59 |
|
36866 | 60 |
definition |
18886 | 61 |
(* States than an event really appears only once on a trace *) |
62 |
Unique :: "[event, event list] => bool" ("Unique _ on _") |
|
36866 | 63 |
where "Unique ev on evs = (ev \<notin> set (tl (dropWhile (% z. z \<noteq> ev) evs)))" |
18886 | 64 |
|
65 |
||
23746 | 66 |
inductive_set bankerb_gets :: "event list set" |
67 |
where |
|
18886 | 68 |
|
69 |
Nil: "[] \<in> bankerb_gets" |
|
70 |
||
23746 | 71 |
| Fake: "\<lbrakk> evsf \<in> bankerb_gets; X \<in> synth (analz (knows Spy evsf)) \<rbrakk> |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
72 |
\<Longrightarrow> Says Spy B X # evsf \<in> bankerb_gets" |
18886 | 73 |
|
23746 | 74 |
| Reception: "\<lbrakk> evsr\<in> bankerb_gets; Says A B X \<in> set evsr \<rbrakk> |
18886 | 75 |
\<Longrightarrow> Gets B X # evsr \<in> bankerb_gets" |
76 |
||
23746 | 77 |
| BK1: "\<lbrakk> evs1 \<in> bankerb_gets \<rbrakk> |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
78 |
\<Longrightarrow> Says A Server \<lbrace>Agent A, Agent B\<rbrace> # evs1 |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
79 |
\<in> bankerb_gets" |
18886 | 80 |
|
81 |
||
23746 | 82 |
| BK2: "\<lbrakk> evs2 \<in> bankerb_gets; Key K \<notin> used evs2; K \<in> symKeys; |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
83 |
Gets Server \<lbrace>Agent A, Agent B\<rbrace> \<in> set evs2 \<rbrakk> |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
84 |
\<Longrightarrow> Says Server A |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
85 |
(Crypt (shrK A) |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
86 |
\<lbrace>Number (CT evs2), Agent B, Key K, |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
87 |
(Crypt (shrK B) \<lbrace>Number (CT evs2), Agent A, Key K\<rbrace>)\<rbrace>) |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
88 |
# evs2 \<in> bankerb_gets" |
18886 | 89 |
|
90 |
||
23746 | 91 |
| BK3: "\<lbrakk> evs3 \<in> bankerb_gets; |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
92 |
Gets A (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>) |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
93 |
\<in> set evs3; |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
94 |
Says A Server \<lbrace>Agent A, Agent B\<rbrace> \<in> set evs3; |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
95 |
\<not> expiredK Tk evs3 \<rbrakk> |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
96 |
\<Longrightarrow> Says A B \<lbrace>Ticket, Crypt K \<lbrace>Agent A, Number (CT evs3)\<rbrace> \<rbrace> |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
97 |
# evs3 \<in> bankerb_gets" |
18886 | 98 |
|
99 |
||
23746 | 100 |
| BK4: "\<lbrakk> evs4 \<in> bankerb_gets; |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
101 |
Gets B \<lbrace>(Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>), |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
102 |
(Crypt K \<lbrace>Agent A, Number Ta\<rbrace>) \<rbrace>: set evs4; |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
103 |
\<not> expiredK Tk evs4; \<not> expiredA Ta evs4 \<rbrakk> |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
104 |
\<Longrightarrow> Says B A (Crypt K (Number Ta)) # evs4 |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
105 |
\<in> bankerb_gets" |
18886 | 106 |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
107 |
(*Old session keys may become compromised*) |
23746 | 108 |
| Oops: "\<lbrakk> evso \<in> bankerb_gets; |
18886 | 109 |
Says Server A (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>) |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
110 |
\<in> set evso; |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
111 |
expiredK Tk evso \<rbrakk> |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
112 |
\<Longrightarrow> Notes Spy \<lbrace>Number Tk, Key K\<rbrace> # evso \<in> bankerb_gets" |
18886 | 113 |
|
114 |
||
115 |
declare Says_imp_knows_Spy [THEN parts.Inj, dest] |
|
116 |
declare parts.Body [dest] |
|
117 |
declare analz_into_parts [dest] |
|
118 |
declare Fake_parts_insert_in_Un [dest] |
|
119 |
declare knows_Spy_partsEs [elim] |
|
120 |
||
121 |
||
122 |
text{*A "possibility property": there are traces that reach the end.*} |
|
123 |
lemma "\<lbrakk>Key K \<notin> used []; K \<in> symKeys\<rbrakk> |
|
124 |
\<Longrightarrow> \<exists>Timestamp. \<exists>evs \<in> bankerb_gets. |
|
125 |
Says B A (Crypt K (Number Timestamp)) |
|
126 |
\<in> set evs" |
|
127 |
apply (cut_tac sesKlife_LB) |
|
128 |
apply (cut_tac authlife_LB) |
|
129 |
apply (intro exI bexI) |
|
130 |
apply (rule_tac [2] |
|
131 |
bankerb_gets.Nil [THEN bankerb_gets.BK1, THEN bankerb_gets.Reception, |
|
132 |
THEN bankerb_gets.BK2, THEN bankerb_gets.Reception, |
|
133 |
THEN bankerb_gets.BK3, THEN bankerb_gets.Reception, |
|
134 |
THEN bankerb_gets.BK4]) |
|
135 |
apply (possibility, simp_all (no_asm_simp) add: used_Cons) |
|
136 |
done |
|
137 |
||
138 |
||
139 |
text{*Lemmas about reception invariant: if a message is received it certainly |
|
140 |
was sent*} |
|
141 |
lemma Gets_imp_Says : |
|
142 |
"\<lbrakk> Gets B X \<in> set evs; evs \<in> bankerb_gets \<rbrakk> \<Longrightarrow> \<exists>A. Says A B X \<in> set evs" |
|
143 |
apply (erule rev_mp) |
|
144 |
apply (erule bankerb_gets.induct) |
|
145 |
apply auto |
|
146 |
done |
|
147 |
||
148 |
lemma Gets_imp_knows_Spy: |
|
149 |
"\<lbrakk> Gets B X \<in> set evs; evs \<in> bankerb_gets \<rbrakk> \<Longrightarrow> X \<in> knows Spy evs" |
|
150 |
apply (blast dest!: Gets_imp_Says Says_imp_knows_Spy) |
|
151 |
done |
|
152 |
||
153 |
lemma Gets_imp_knows_Spy_parts[dest]: |
|
154 |
"\<lbrakk> Gets B X \<in> set evs; evs \<in> bankerb_gets \<rbrakk> \<Longrightarrow> X \<in> parts (knows Spy evs)" |
|
155 |
apply (blast dest: Gets_imp_knows_Spy [THEN parts.Inj]) |
|
156 |
done |
|
157 |
||
158 |
lemma Gets_imp_knows: |
|
159 |
"\<lbrakk> Gets B X \<in> set evs; evs \<in> bankerb_gets \<rbrakk> \<Longrightarrow> X \<in> knows B evs" |
|
39251
8756b44582e2
Tidied up proofs using sledgehammer, also deleting unnecessary semicolons
paulson
parents:
37936
diff
changeset
|
160 |
by (metis Gets_imp_knows_Spy Gets_imp_knows_agents) |
18886 | 161 |
|
162 |
lemma Gets_imp_knows_analz: |
|
163 |
"\<lbrakk> Gets B X \<in> set evs; evs \<in> bankerb_gets \<rbrakk> \<Longrightarrow> X \<in> analz (knows B evs)" |
|
164 |
apply (blast dest: Gets_imp_knows [THEN analz.Inj]) |
|
165 |
done |
|
166 |
||
167 |
text{*Lemmas for reasoning about predicate "before"*} |
|
39251
8756b44582e2
Tidied up proofs using sledgehammer, also deleting unnecessary semicolons
paulson
parents:
37936
diff
changeset
|
168 |
lemma used_Says_rev: "used (evs @ [Says A B X]) = parts {X} \<union> (used evs)" |
18886 | 169 |
apply (induct_tac "evs") |
170 |
apply simp |
|
171 |
apply (induct_tac "a") |
|
172 |
apply auto |
|
173 |
done |
|
174 |
||
39251
8756b44582e2
Tidied up proofs using sledgehammer, also deleting unnecessary semicolons
paulson
parents:
37936
diff
changeset
|
175 |
lemma used_Notes_rev: "used (evs @ [Notes A X]) = parts {X} \<union> (used evs)" |
18886 | 176 |
apply (induct_tac "evs") |
177 |
apply simp |
|
178 |
apply (induct_tac "a") |
|
179 |
apply auto |
|
180 |
done |
|
181 |
||
39251
8756b44582e2
Tidied up proofs using sledgehammer, also deleting unnecessary semicolons
paulson
parents:
37936
diff
changeset
|
182 |
lemma used_Gets_rev: "used (evs @ [Gets B X]) = used evs" |
18886 | 183 |
apply (induct_tac "evs") |
184 |
apply simp |
|
185 |
apply (induct_tac "a") |
|
186 |
apply auto |
|
187 |
done |
|
188 |
||
189 |
lemma used_evs_rev: "used evs = used (rev evs)" |
|
190 |
apply (induct_tac "evs") |
|
191 |
apply simp |
|
192 |
apply (induct_tac "a") |
|
193 |
apply (simp add: used_Says_rev) |
|
194 |
apply (simp add: used_Gets_rev) |
|
195 |
apply (simp add: used_Notes_rev) |
|
196 |
done |
|
197 |
||
198 |
lemma used_takeWhile_used [rule_format]: |
|
199 |
"x : used (takeWhile P X) --> x : used X" |
|
200 |
apply (induct_tac "X") |
|
201 |
apply simp |
|
202 |
apply (induct_tac "a") |
|
203 |
apply (simp_all add: used_Nil) |
|
204 |
apply (blast dest!: initState_into_used)+ |
|
205 |
done |
|
206 |
||
207 |
lemma set_evs_rev: "set evs = set (rev evs)" |
|
208 |
apply auto |
|
209 |
done |
|
210 |
||
211 |
lemma takeWhile_void [rule_format]: |
|
212 |
"x \<notin> set evs \<longrightarrow> takeWhile (\<lambda>z. z \<noteq> x) evs = evs" |
|
213 |
apply auto |
|
214 |
done |
|
215 |
||
216 |
(**** Inductive proofs about bankerb_gets ****) |
|
217 |
||
218 |
text{*Forwarding Lemma for reasoning about the encrypted portion of message BK3*} |
|
219 |
lemma BK3_msg_in_parts_knows_Spy: |
|
220 |
"\<lbrakk>Gets A (Crypt KA \<lbrace>Timestamp, B, K, X\<rbrace>) \<in> set evs; evs \<in> bankerb_gets \<rbrakk> |
|
221 |
\<Longrightarrow> X \<in> parts (knows Spy evs)" |
|
222 |
apply blast |
|
223 |
done |
|
224 |
||
225 |
lemma Oops_parts_knows_Spy: |
|
226 |
"Says Server A (Crypt (shrK A) \<lbrace>Timestamp, B, K, X\<rbrace>) \<in> set evs |
|
227 |
\<Longrightarrow> K \<in> parts (knows Spy evs)" |
|
228 |
apply blast |
|
229 |
done |
|
230 |
||
231 |
||
232 |
text{*Spy never sees another agent's shared key! (unless it's bad at start)*} |
|
233 |
lemma Spy_see_shrK [simp]: |
|
234 |
"evs \<in> bankerb_gets \<Longrightarrow> (Key (shrK A) \<in> parts (knows Spy evs)) = (A \<in> bad)" |
|
235 |
apply (erule bankerb_gets.induct) |
|
236 |
apply (frule_tac [8] Oops_parts_knows_Spy) |
|
237 |
apply (frule_tac [6] BK3_msg_in_parts_knows_Spy, simp_all, blast+) |
|
238 |
done |
|
239 |
||
240 |
||
241 |
lemma Spy_analz_shrK [simp]: |
|
242 |
"evs \<in> bankerb_gets \<Longrightarrow> (Key (shrK A) \<in> analz (knows Spy evs)) = (A \<in> bad)" |
|
243 |
by auto |
|
244 |
||
245 |
lemma Spy_see_shrK_D [dest!]: |
|
246 |
"\<lbrakk> Key (shrK A) \<in> parts (knows Spy evs); |
|
247 |
evs \<in> bankerb_gets \<rbrakk> \<Longrightarrow> A:bad" |
|
248 |
by (blast dest: Spy_see_shrK) |
|
249 |
||
250 |
lemmas Spy_analz_shrK_D = analz_subset_parts [THEN subsetD, THEN Spy_see_shrK_D, dest!] |
|
251 |
||
252 |
||
253 |
text{*Nobody can have used non-existent keys!*} |
|
254 |
lemma new_keys_not_used [simp]: |
|
255 |
"\<lbrakk>Key K \<notin> used evs; K \<in> symKeys; evs \<in> bankerb_gets\<rbrakk> |
|
256 |
\<Longrightarrow> K \<notin> keysFor (parts (knows Spy evs))" |
|
257 |
apply (erule rev_mp) |
|
258 |
apply (erule bankerb_gets.induct) |
|
259 |
apply (frule_tac [8] Oops_parts_knows_Spy) |
|
260 |
apply (frule_tac [6] BK3_msg_in_parts_knows_Spy, simp_all) |
|
261 |
txt{*Fake*} |
|
262 |
apply (force dest!: keysFor_parts_insert) |
|
263 |
txt{*BK2, BK3, BK4*} |
|
264 |
apply (force dest!: analz_shrK_Decrypt)+ |
|
265 |
done |
|
266 |
||
267 |
subsection{* Lemmas concerning the form of items passed in messages *} |
|
268 |
||
269 |
text{*Describes the form of K, X and K' when the Server sends this message.*} |
|
270 |
lemma Says_Server_message_form: |
|
271 |
"\<lbrakk> Says Server A (Crypt K' \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>) |
|
272 |
\<in> set evs; evs \<in> bankerb_gets \<rbrakk> |
|
273 |
\<Longrightarrow> K' = shrK A & K \<notin> range shrK & |
|
274 |
Ticket = (Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>) & |
|
275 |
Key K \<notin> used(before |
|
276 |
Says Server A (Crypt K' \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>) |
|
277 |
on evs) & |
|
278 |
Tk = CT(before |
|
279 |
Says Server A (Crypt K' \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>) |
|
280 |
on evs)" |
|
281 |
apply (unfold before_def) |
|
282 |
apply (erule rev_mp) |
|
283 |
apply (erule bankerb_gets.induct, simp_all) |
|
284 |
txt{*We need this simplification only for Message 2*} |
|
285 |
apply (simp (no_asm) add: takeWhile_tail) |
|
286 |
apply auto |
|
287 |
txt{*Two subcases of Message 2. Subcase: used before*} |
|
288 |
apply (blast dest: used_evs_rev [THEN equalityD2, THEN contra_subsetD] |
|
289 |
used_takeWhile_used) |
|
290 |
txt{*subcase: CT before*} |
|
44890
22f665a2e91c
new fastforce replacing fastsimp - less confusing name
nipkow
parents:
39251
diff
changeset
|
291 |
apply (fastforce dest!: set_evs_rev [THEN equalityD2, THEN contra_subsetD, THEN takeWhile_void]) |
18886 | 292 |
done |
293 |
||
294 |
||
295 |
text{*If the encrypted message appears then it originated with the Server |
|
296 |
PROVIDED that A is NOT compromised! |
|
297 |
This allows A to verify freshness of the session key. |
|
298 |
*} |
|
299 |
lemma Kab_authentic: |
|
300 |
"\<lbrakk> Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace> |
|
301 |
\<in> parts (knows Spy evs); |
|
302 |
A \<notin> bad; evs \<in> bankerb_gets \<rbrakk> |
|
303 |
\<Longrightarrow> Says Server A (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace>) |
|
304 |
\<in> set evs" |
|
305 |
apply (erule rev_mp) |
|
306 |
apply (erule bankerb_gets.induct) |
|
307 |
apply (frule_tac [8] Oops_parts_knows_Spy) |
|
308 |
apply (frule_tac [6] BK3_msg_in_parts_knows_Spy, simp_all, blast) |
|
309 |
done |
|
310 |
||
311 |
||
312 |
text{*If the TICKET appears then it originated with the Server*} |
|
313 |
text{*FRESHNESS OF THE SESSION KEY to B*} |
|
314 |
lemma ticket_authentic: |
|
315 |
"\<lbrakk> Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace> \<in> parts (knows Spy evs); |
|
316 |
B \<notin> bad; evs \<in> bankerb_gets \<rbrakk> |
|
317 |
\<Longrightarrow> Says Server A |
|
318 |
(Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, |
|
319 |
Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>\<rbrace>) |
|
320 |
\<in> set evs" |
|
321 |
apply (erule rev_mp) |
|
322 |
apply (erule bankerb_gets.induct) |
|
323 |
apply (frule_tac [8] Oops_parts_knows_Spy) |
|
324 |
apply (frule_tac [6] BK3_msg_in_parts_knows_Spy, simp_all, blast) |
|
325 |
done |
|
326 |
||
327 |
||
328 |
text{*EITHER describes the form of X when the following message is sent, |
|
329 |
OR reduces it to the Fake case. |
|
330 |
Use @{text Says_Server_message_form} if applicable.*} |
|
331 |
lemma Gets_Server_message_form: |
|
332 |
"\<lbrakk> Gets A (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace>) |
|
333 |
\<in> set evs; |
|
334 |
evs \<in> bankerb_gets \<rbrakk> |
|
335 |
\<Longrightarrow> (K \<notin> range shrK & X = (Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>)) |
|
336 |
| X \<in> analz (knows Spy evs)" |
|
337 |
apply (case_tac "A \<in> bad") |
|
338 |
apply (force dest!: Gets_imp_knows_Spy [THEN analz.Inj]) |
|
339 |
apply (blast dest!: Kab_authentic Says_Server_message_form) |
|
340 |
done |
|
341 |
||
342 |
||
343 |
text{*Reliability guarantees: honest agents act as we expect*} |
|
344 |
||
345 |
lemma BK3_imp_Gets: |
|
346 |
"\<lbrakk> Says A B \<lbrace>Ticket, Crypt K \<lbrace>Agent A, Number Ta\<rbrace>\<rbrace> \<in> set evs; |
|
347 |
A \<notin> bad; evs \<in> bankerb_gets \<rbrakk> |
|
348 |
\<Longrightarrow> \<exists> Tk. Gets A (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>) |
|
349 |
\<in> set evs" |
|
350 |
apply (erule rev_mp) |
|
351 |
apply (erule bankerb_gets.induct) |
|
352 |
apply auto |
|
353 |
done |
|
354 |
||
355 |
lemma BK4_imp_Gets: |
|
356 |
"\<lbrakk> Says B A (Crypt K (Number Ta)) \<in> set evs; |
|
357 |
B \<notin> bad; evs \<in> bankerb_gets \<rbrakk> |
|
358 |
\<Longrightarrow> \<exists> Tk. Gets B \<lbrace>Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>, |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
23746
diff
changeset
|
359 |
Crypt K \<lbrace>Agent A, Number Ta\<rbrace>\<rbrace> \<in> set evs" |
18886 | 360 |
apply (erule rev_mp) |
361 |
apply (erule bankerb_gets.induct) |
|
362 |
apply auto |
|
363 |
done |
|
364 |
||
365 |
lemma Gets_A_knows_K: |
|
366 |
"\<lbrakk> Gets A (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>) \<in> set evs; |
|
367 |
evs \<in> bankerb_gets \<rbrakk> |
|
368 |
\<Longrightarrow> Key K \<in> analz (knows A evs)" |
|
369 |
apply (force dest: Gets_imp_knows_analz) |
|
370 |
done |
|
371 |
||
372 |
lemma Gets_B_knows_K: |
|
373 |
"\<lbrakk> Gets B \<lbrace>Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>, |
|
374 |
Crypt K \<lbrace>Agent A, Number Ta\<rbrace>\<rbrace> \<in> set evs; |
|
375 |
evs \<in> bankerb_gets \<rbrakk> |
|
376 |
\<Longrightarrow> Key K \<in> analz (knows B evs)" |
|
377 |
apply (force dest: Gets_imp_knows_analz) |
|
378 |
done |
|
379 |
||
380 |
||
381 |
(**** |
|
382 |
The following is to prove theorems of the form |
|
383 |
||
384 |
Key K \<in> analz (insert (Key KAB) (knows Spy evs)) \<Longrightarrow> |
|
385 |
Key K \<in> analz (knows Spy evs) |
|
386 |
||
387 |
A more general formula must be proved inductively. |
|
388 |
||
389 |
****) |
|
390 |
||
391 |
||
392 |
text{* Session keys are not used to encrypt other session keys *} |
|
393 |
lemma analz_image_freshK [rule_format (no_asm)]: |
|
394 |
"evs \<in> bankerb_gets \<Longrightarrow> |
|
395 |
\<forall>K KK. KK \<subseteq> - (range shrK) \<longrightarrow> |
|
396 |
(Key K \<in> analz (Key`KK Un (knows Spy evs))) = |
|
397 |
(K \<in> KK | Key K \<in> analz (knows Spy evs))" |
|
398 |
apply (erule bankerb_gets.induct) |
|
399 |
apply (drule_tac [8] Says_Server_message_form) |
|
400 |
apply (erule_tac [6] Gets_Server_message_form [THEN disjE], analz_freshK, spy_analz, auto) |
|
401 |
done |
|
402 |
||
403 |
||
404 |
lemma analz_insert_freshK: |
|
405 |
"\<lbrakk> evs \<in> bankerb_gets; KAB \<notin> range shrK \<rbrakk> \<Longrightarrow> |
|
406 |
(Key K \<in> analz (insert (Key KAB) (knows Spy evs))) = |
|
407 |
(K = KAB | Key K \<in> analz (knows Spy evs))" |
|
408 |
by (simp only: analz_image_freshK analz_image_freshK_simps) |
|
409 |
||
410 |
||
411 |
text{* The session key K uniquely identifies the message *} |
|
412 |
lemma unique_session_keys: |
|
413 |
"\<lbrakk> Says Server A |
|
414 |
(Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace>) \<in> set evs; |
|
415 |
Says Server A' |
|
416 |
(Crypt (shrK A') \<lbrace>Number Tk', Agent B', Key K, X'\<rbrace>) \<in> set evs; |
|
417 |
evs \<in> bankerb_gets \<rbrakk> \<Longrightarrow> A=A' & Tk=Tk' & B=B' & X = X'" |
|
418 |
apply (erule rev_mp) |
|
419 |
apply (erule rev_mp) |
|
420 |
apply (erule bankerb_gets.induct) |
|
421 |
apply (frule_tac [8] Oops_parts_knows_Spy) |
|
422 |
apply (frule_tac [6] BK3_msg_in_parts_knows_Spy, simp_all) |
|
423 |
txt{*BK2: it can't be a new key*} |
|
424 |
apply blast |
|
425 |
done |
|
426 |
||
427 |
lemma unique_session_keys_Gets: |
|
428 |
"\<lbrakk> Gets A |
|
429 |
(Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace>) \<in> set evs; |
|
430 |
Gets A |
|
431 |
(Crypt (shrK A) \<lbrace>Number Tk', Agent B', Key K, X'\<rbrace>) \<in> set evs; |
|
432 |
A \<notin> bad; evs \<in> bankerb_gets \<rbrakk> \<Longrightarrow> Tk=Tk' & B=B' & X = X'" |
|
433 |
apply (blast dest!: Kab_authentic unique_session_keys) |
|
434 |
done |
|
435 |
||
436 |
||
437 |
lemma Server_Unique: |
|
438 |
"\<lbrakk> Says Server A |
|
439 |
(Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>) \<in> set evs; |
|
440 |
evs \<in> bankerb_gets \<rbrakk> \<Longrightarrow> |
|
441 |
Unique Says Server A (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>) |
|
442 |
on evs" |
|
443 |
apply (erule rev_mp, erule bankerb_gets.induct, simp_all add: Unique_def) |
|
444 |
apply blast |
|
445 |
done |
|
446 |
||
447 |
||
448 |
||
449 |
subsection{*Non-temporal guarantees, explicitly relying on non-occurrence of |
|
450 |
oops events - refined below by temporal guarantees*} |
|
451 |
||
452 |
text{*Non temporal treatment of confidentiality*} |
|
453 |
||
454 |
text{* Lemma: the session key sent in msg BK2 would be lost by oops |
|
455 |
if the spy could see it! *} |
|
456 |
lemma lemma_conf [rule_format (no_asm)]: |
|
457 |
"\<lbrakk> A \<notin> bad; B \<notin> bad; evs \<in> bankerb_gets \<rbrakk> |
|
458 |
\<Longrightarrow> Says Server A |
|
459 |
(Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, |
|
460 |
Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>\<rbrace>) |
|
461 |
\<in> set evs \<longrightarrow> |
|
462 |
Key K \<in> analz (knows Spy evs) \<longrightarrow> Notes Spy \<lbrace>Number Tk, Key K\<rbrace> \<in> set evs" |
|
463 |
apply (erule bankerb_gets.induct) |
|
464 |
apply (frule_tac [8] Says_Server_message_form) |
|
465 |
apply (frule_tac [6] Gets_Server_message_form [THEN disjE]) |
|
466 |
apply (simp_all (no_asm_simp) add: analz_insert_eq analz_insert_freshK pushes) |
|
467 |
txt{*Fake*} |
|
468 |
apply spy_analz |
|
469 |
txt{*BK2*} |
|
470 |
apply (blast intro: parts_insertI) |
|
471 |
txt{*BK3*} |
|
472 |
apply (case_tac "Aa \<in> bad") |
|
473 |
prefer 2 apply (blast dest: Kab_authentic unique_session_keys) |
|
474 |
apply (blast dest: Gets_imp_knows_Spy [THEN analz.Inj] Crypt_Spy_analz_bad elim!: MPair_analz) |
|
475 |
txt{*Oops*} |
|
476 |
apply (blast dest: unique_session_keys) |
|
477 |
done |
|
478 |
||
479 |
||
480 |
text{*Confidentiality for the Server: Spy does not see the keys sent in msg BK2 |
|
481 |
as long as they have not expired.*} |
|
482 |
lemma Confidentiality_S: |
|
483 |
"\<lbrakk> Says Server A |
|
484 |
(Crypt K' \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>) \<in> set evs; |
|
485 |
Notes Spy \<lbrace>Number Tk, Key K\<rbrace> \<notin> set evs; |
|
486 |
A \<notin> bad; B \<notin> bad; evs \<in> bankerb_gets |
|
487 |
\<rbrakk> \<Longrightarrow> Key K \<notin> analz (knows Spy evs)" |
|
488 |
apply (frule Says_Server_message_form, assumption) |
|
489 |
apply (blast intro: lemma_conf) |
|
490 |
done |
|
491 |
||
492 |
text{*Confidentiality for Alice*} |
|
493 |
lemma Confidentiality_A: |
|
494 |
"\<lbrakk> Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace> \<in> parts (knows Spy evs); |
|
495 |
Notes Spy \<lbrace>Number Tk, Key K\<rbrace> \<notin> set evs; |
|
496 |
A \<notin> bad; B \<notin> bad; evs \<in> bankerb_gets |
|
497 |
\<rbrakk> \<Longrightarrow> Key K \<notin> analz (knows Spy evs)" |
|
498 |
by (blast dest!: Kab_authentic Confidentiality_S) |
|
499 |
||
500 |
text{*Confidentiality for Bob*} |
|
501 |
lemma Confidentiality_B: |
|
502 |
"\<lbrakk> Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace> |
|
503 |
\<in> parts (knows Spy evs); |
|
504 |
Notes Spy \<lbrace>Number Tk, Key K\<rbrace> \<notin> set evs; |
|
505 |
A \<notin> bad; B \<notin> bad; evs \<in> bankerb_gets |
|
506 |
\<rbrakk> \<Longrightarrow> Key K \<notin> analz (knows Spy evs)" |
|
507 |
by (blast dest!: ticket_authentic Confidentiality_S) |
|
508 |
||
509 |
||
510 |
text{*Non temporal treatment of authentication*} |
|
511 |
||
512 |
text{*Lemmas @{text lemma_A} and @{text lemma_B} in fact are common to both temporal and non-temporal treatments*} |
|
513 |
lemma lemma_A [rule_format]: |
|
514 |
"\<lbrakk> A \<notin> bad; B \<notin> bad; evs \<in> bankerb_gets \<rbrakk> |
|
515 |
\<Longrightarrow> |
|
516 |
Key K \<notin> analz (knows Spy evs) \<longrightarrow> |
|
517 |
Says Server A (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace>) |
|
518 |
\<in> set evs \<longrightarrow> |
|
519 |
Crypt K \<lbrace>Agent A, Number Ta\<rbrace> \<in> parts (knows Spy evs) \<longrightarrow> |
|
520 |
Says A B \<lbrace>X, Crypt K \<lbrace>Agent A, Number Ta\<rbrace>\<rbrace> |
|
521 |
\<in> set evs" |
|
522 |
apply (erule bankerb_gets.induct) |
|
523 |
apply (frule_tac [8] Oops_parts_knows_Spy) |
|
524 |
apply (frule_tac [6] Gets_Server_message_form) |
|
525 |
apply (frule_tac [7] BK3_msg_in_parts_knows_Spy, analz_mono_contra) |
|
526 |
apply (simp_all (no_asm_simp) add: all_conj_distrib) |
|
527 |
txt{*Fake*} |
|
528 |
apply blast |
|
529 |
txt{*BK2*} |
|
530 |
apply (force dest: Crypt_imp_invKey_keysFor) |
|
531 |
txt{*BK3*} |
|
532 |
apply (blast dest: Kab_authentic unique_session_keys) |
|
533 |
done |
|
534 |
lemma lemma_B [rule_format]: |
|
535 |
"\<lbrakk> B \<notin> bad; evs \<in> bankerb_gets \<rbrakk> |
|
536 |
\<Longrightarrow> Key K \<notin> analz (knows Spy evs) \<longrightarrow> |
|
537 |
Says Server A (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace>) |
|
538 |
\<in> set evs \<longrightarrow> |
|
539 |
Crypt K (Number Ta) \<in> parts (knows Spy evs) \<longrightarrow> |
|
540 |
Says B A (Crypt K (Number Ta)) \<in> set evs" |
|
541 |
apply (erule bankerb_gets.induct) |
|
542 |
apply (frule_tac [8] Oops_parts_knows_Spy) |
|
543 |
apply (frule_tac [6] Gets_Server_message_form) |
|
544 |
apply (drule_tac [7] BK3_msg_in_parts_knows_Spy, analz_mono_contra) |
|
545 |
apply (simp_all (no_asm_simp) add: all_conj_distrib) |
|
546 |
txt{*Fake*} |
|
547 |
apply blast |
|
548 |
txt{*BK2*} |
|
549 |
apply (force dest: Crypt_imp_invKey_keysFor) |
|
550 |
txt{*BK4*} |
|
551 |
apply (blast dest: ticket_authentic unique_session_keys |
|
552 |
Gets_imp_knows_Spy [THEN analz.Inj] Crypt_Spy_analz_bad) |
|
553 |
done |
|
554 |
||
555 |
||
556 |
text{*The "r" suffix indicates theorems where the confidentiality assumptions are relaxed by the corresponding arguments.*} |
|
557 |
||
558 |
text{*Authentication of A to B*} |
|
559 |
lemma B_authenticates_A_r: |
|
560 |
"\<lbrakk> Crypt K \<lbrace>Agent A, Number Ta\<rbrace> \<in> parts (knows Spy evs); |
|
561 |
Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace> \<in> parts (knows Spy evs); |
|
562 |
Notes Spy \<lbrace>Number Tk, Key K\<rbrace> \<notin> set evs; |
|
563 |
A \<notin> bad; B \<notin> bad; evs \<in> bankerb_gets \<rbrakk> |
|
564 |
\<Longrightarrow> Says A B \<lbrace>Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>, |
|
565 |
Crypt K \<lbrace>Agent A, Number Ta\<rbrace>\<rbrace> \<in> set evs" |
|
566 |
by (blast dest!: ticket_authentic |
|
567 |
intro!: lemma_A |
|
568 |
elim!: Confidentiality_S [THEN [2] rev_notE]) |
|
569 |
||
570 |
text{*Authentication of B to A*} |
|
571 |
lemma A_authenticates_B_r: |
|
572 |
"\<lbrakk> Crypt K (Number Ta) \<in> parts (knows Spy evs); |
|
573 |
Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace> \<in> parts (knows Spy evs); |
|
574 |
Notes Spy \<lbrace>Number Tk, Key K\<rbrace> \<notin> set evs; |
|
575 |
A \<notin> bad; B \<notin> bad; evs \<in> bankerb_gets \<rbrakk> |
|
576 |
\<Longrightarrow> Says B A (Crypt K (Number Ta)) \<in> set evs" |
|
577 |
by (blast dest!: Kab_authentic |
|
578 |
intro!: lemma_B elim!: Confidentiality_S [THEN [2] rev_notE]) |
|
579 |
||
580 |
lemma B_authenticates_A: |
|
581 |
"\<lbrakk> Crypt K \<lbrace>Agent A, Number Ta\<rbrace> \<in> parts (spies evs); |
|
582 |
Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace> \<in> parts (spies evs); |
|
583 |
Key K \<notin> analz (spies evs); |
|
584 |
A \<notin> bad; B \<notin> bad; evs \<in> bankerb_gets \<rbrakk> |
|
585 |
\<Longrightarrow> Says A B \<lbrace>Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>, |
|
586 |
Crypt K \<lbrace>Agent A, Number Ta\<rbrace>\<rbrace> \<in> set evs" |
|
587 |
apply (blast dest!: ticket_authentic intro!: lemma_A) |
|
588 |
done |
|
589 |
||
590 |
lemma A_authenticates_B: |
|
591 |
"\<lbrakk> Crypt K (Number Ta) \<in> parts (spies evs); |
|
592 |
Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace> \<in> parts (spies evs); |
|
593 |
Key K \<notin> analz (spies evs); |
|
594 |
A \<notin> bad; B \<notin> bad; evs \<in> bankerb_gets \<rbrakk> |
|
595 |
\<Longrightarrow> Says B A (Crypt K (Number Ta)) \<in> set evs" |
|
596 |
apply (blast dest!: Kab_authentic intro!: lemma_B) |
|
597 |
done |
|
598 |
||
599 |
||
600 |
subsection{*Temporal guarantees, relying on a temporal check that insures that |
|
601 |
no oops event occurred. These are available in the sense of goal availability*} |
|
602 |
||
603 |
||
604 |
text{*Temporal treatment of confidentiality*} |
|
605 |
||
606 |
text{* Lemma: the session key sent in msg BK2 would be EXPIRED |
|
607 |
if the spy could see it! *} |
|
608 |
lemma lemma_conf_temporal [rule_format (no_asm)]: |
|
609 |
"\<lbrakk> A \<notin> bad; B \<notin> bad; evs \<in> bankerb_gets \<rbrakk> |
|
610 |
\<Longrightarrow> Says Server A |
|
611 |
(Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, |
|
612 |
Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>\<rbrace>) |
|
613 |
\<in> set evs \<longrightarrow> |
|
614 |
Key K \<in> analz (knows Spy evs) \<longrightarrow> expiredK Tk evs" |
|
615 |
apply (erule bankerb_gets.induct) |
|
616 |
apply (frule_tac [8] Says_Server_message_form) |
|
617 |
apply (frule_tac [6] Gets_Server_message_form [THEN disjE]) |
|
618 |
apply (simp_all (no_asm_simp) add: less_SucI analz_insert_eq analz_insert_freshK pushes) |
|
619 |
txt{*Fake*} |
|
620 |
apply spy_analz |
|
621 |
txt{*BK2*} |
|
622 |
apply (blast intro: parts_insertI less_SucI) |
|
623 |
txt{*BK3*} |
|
624 |
apply (case_tac "Aa \<in> bad") |
|
625 |
prefer 2 apply (blast dest: Kab_authentic unique_session_keys) |
|
626 |
apply (blast dest: Gets_imp_knows_Spy [THEN analz.Inj] Crypt_Spy_analz_bad elim!: MPair_analz intro: less_SucI) |
|
627 |
txt{*Oops: PROOF FAILS if unsafe intro below*} |
|
628 |
apply (blast dest: unique_session_keys intro!: less_SucI) |
|
629 |
done |
|
630 |
||
631 |
||
632 |
text{*Confidentiality for the Server: Spy does not see the keys sent in msg BK2 |
|
633 |
as long as they have not expired.*} |
|
634 |
lemma Confidentiality_S_temporal: |
|
635 |
"\<lbrakk> Says Server A |
|
636 |
(Crypt K' \<lbrace>Number T, Agent B, Key K, X\<rbrace>) \<in> set evs; |
|
637 |
\<not> expiredK T evs; |
|
638 |
A \<notin> bad; B \<notin> bad; evs \<in> bankerb_gets |
|
639 |
\<rbrakk> \<Longrightarrow> Key K \<notin> analz (knows Spy evs)" |
|
640 |
apply (frule Says_Server_message_form, assumption) |
|
641 |
apply (blast intro: lemma_conf_temporal) |
|
642 |
done |
|
643 |
||
644 |
text{*Confidentiality for Alice*} |
|
645 |
lemma Confidentiality_A_temporal: |
|
646 |
"\<lbrakk> Crypt (shrK A) \<lbrace>Number T, Agent B, Key K, X\<rbrace> \<in> parts (knows Spy evs); |
|
647 |
\<not> expiredK T evs; |
|
648 |
A \<notin> bad; B \<notin> bad; evs \<in> bankerb_gets |
|
649 |
\<rbrakk> \<Longrightarrow> Key K \<notin> analz (knows Spy evs)" |
|
650 |
by (blast dest!: Kab_authentic Confidentiality_S_temporal) |
|
651 |
||
652 |
text{*Confidentiality for Bob*} |
|
653 |
lemma Confidentiality_B_temporal: |
|
654 |
"\<lbrakk> Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace> |
|
655 |
\<in> parts (knows Spy evs); |
|
656 |
\<not> expiredK Tk evs; |
|
657 |
A \<notin> bad; B \<notin> bad; evs \<in> bankerb_gets |
|
658 |
\<rbrakk> \<Longrightarrow> Key K \<notin> analz (knows Spy evs)" |
|
659 |
by (blast dest!: ticket_authentic Confidentiality_S_temporal) |
|
660 |
||
661 |
||
662 |
text{*Temporal treatment of authentication*} |
|
663 |
||
664 |
text{*Authentication of A to B*} |
|
665 |
lemma B_authenticates_A_temporal: |
|
666 |
"\<lbrakk> Crypt K \<lbrace>Agent A, Number Ta\<rbrace> \<in> parts (knows Spy evs); |
|
667 |
Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace> |
|
668 |
\<in> parts (knows Spy evs); |
|
669 |
\<not> expiredK Tk evs; |
|
670 |
A \<notin> bad; B \<notin> bad; evs \<in> bankerb_gets \<rbrakk> |
|
671 |
\<Longrightarrow> Says A B \<lbrace>Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>, |
|
672 |
Crypt K \<lbrace>Agent A, Number Ta\<rbrace>\<rbrace> \<in> set evs" |
|
673 |
by (blast dest!: ticket_authentic |
|
674 |
intro!: lemma_A |
|
675 |
elim!: Confidentiality_S_temporal [THEN [2] rev_notE]) |
|
676 |
||
677 |
text{*Authentication of B to A*} |
|
678 |
lemma A_authenticates_B_temporal: |
|
679 |
"\<lbrakk> Crypt K (Number Ta) \<in> parts (knows Spy evs); |
|
680 |
Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace> |
|
681 |
\<in> parts (knows Spy evs); |
|
682 |
\<not> expiredK Tk evs; |
|
683 |
A \<notin> bad; B \<notin> bad; evs \<in> bankerb_gets \<rbrakk> |
|
684 |
\<Longrightarrow> Says B A (Crypt K (Number Ta)) \<in> set evs" |
|
685 |
by (blast dest!: Kab_authentic |
|
686 |
intro!: lemma_B elim!: Confidentiality_S_temporal [THEN [2] rev_notE]) |
|
687 |
||
688 |
||
689 |
subsection{*Combined guarantees of key distribution and non-injective agreement on the session keys*} |
|
690 |
||
691 |
lemma B_authenticates_and_keydist_to_A: |
|
692 |
"\<lbrakk> Gets B \<lbrace>Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>, |
|
693 |
Crypt K \<lbrace>Agent A, Number Ta\<rbrace>\<rbrace> \<in> set evs; |
|
694 |
Key K \<notin> analz (spies evs); |
|
695 |
A \<notin> bad; B \<notin> bad; evs \<in> bankerb_gets \<rbrakk> |
|
696 |
\<Longrightarrow> Says A B \<lbrace>Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>, |
|
697 |
Crypt K \<lbrace>Agent A, Number Ta\<rbrace>\<rbrace> \<in> set evs |
|
698 |
\<and> Key K \<in> analz (knows A evs)" |
|
699 |
apply (blast dest: B_authenticates_A BK3_imp_Gets Gets_A_knows_K) |
|
700 |
done |
|
701 |
||
702 |
lemma A_authenticates_and_keydist_to_B: |
|
703 |
"\<lbrakk> Gets A (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>) \<in> set evs; |
|
704 |
Gets A (Crypt K (Number Ta)) \<in> set evs; |
|
705 |
Key K \<notin> analz (spies evs); |
|
706 |
A \<notin> bad; B \<notin> bad; evs \<in> bankerb_gets \<rbrakk> |
|
707 |
\<Longrightarrow> Says B A (Crypt K (Number Ta)) \<in> set evs |
|
708 |
\<and> Key K \<in> analz (knows B evs)" |
|
709 |
apply (blast dest: A_authenticates_B BK4_imp_Gets Gets_B_knows_K) |
|
710 |
done |
|
711 |
||
712 |
||
713 |
||
714 |
||
715 |
||
716 |
end |