author | nipkow |
Mon, 09 Feb 1998 14:40:59 +0100 | |
changeset 4612 | 26764de50c74 |
parent 4556 | e7a4683c0026 |
child 4686 | 74a12e86b20b |
permissions | -rw-r--r-- |
2318 | 1 |
(* Title: HOL/Auth/NS_Public |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1996 University of Cambridge |
|
5 |
||
6 |
Inductive relation "ns_public" for the Needham-Schroeder Public-Key protocol. |
|
7 |
Version incorporating Lowe's fix (inclusion of B's identify in round 2). |
|
8 |
*) |
|
9 |
||
10 |
open NS_Public; |
|
11 |
||
4449 | 12 |
set proof_timing; |
2318 | 13 |
HOL_quantifiers := false; |
14 |
||
4470 | 15 |
AddEs spies_partsEs; |
16 |
AddDs [impOfSubs analz_subset_parts]; |
|
17 |
AddDs [impOfSubs Fake_parts_insert]; |
|
18 |
||
3683 | 19 |
AddIffs [Spy_in_bad]; |
2318 | 20 |
|
21 |
(*A "possibility property": there are traces that reach the end*) |
|
22 |
goal thy |
|
23 |
"!!A B. A ~= B ==> EX NB. EX evs: ns_public. \ |
|
3465 | 24 |
\ Says A B (Crypt (pubK B) (Nonce NB)) : set evs"; |
2318 | 25 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
26 |
by (rtac (ns_public.Nil RS ns_public.NS1 RS ns_public.NS2 RS ns_public.NS3) 2); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2497
diff
changeset
|
27 |
by possibility_tac; |
2318 | 28 |
result(); |
29 |
||
30 |
||
31 |
(**** Inductive proofs about ns_public ****) |
|
32 |
||
33 |
(*Nobody sends themselves messages*) |
|
3465 | 34 |
goal thy "!!evs. evs : ns_public ==> ALL A X. Says A A X ~: set evs"; |
2318 | 35 |
by (etac ns_public.induct 1); |
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4470
diff
changeset
|
36 |
by Auto_tac; |
2318 | 37 |
qed_spec_mp "not_Says_to_self"; |
38 |
Addsimps [not_Says_to_self]; |
|
39 |
AddSEs [not_Says_to_self RSN (2, rev_notE)]; |
|
40 |
||
41 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
42 |
(*Induction for regularity theorems. If induction formula has the form |
3683 | 43 |
X ~: analz (spies evs) --> ... then it shortens the proof by discarding |
44 |
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
|
45 |
fun parts_induct_tac i = |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
46 |
etac ns_public.induct i |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
47 |
THEN |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
48 |
REPEAT (FIRSTGOAL analz_mono_contra_tac) |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
49 |
THEN |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
50 |
prove_simple_subgoals_tac i; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
51 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
52 |
|
3683 | 53 |
(** Theorems of the form X ~: parts (spies evs) imply that NOBODY |
2318 | 54 |
sends messages containing X! **) |
55 |
||
3683 | 56 |
(*Spy never sees another agent's private key! (unless it's bad at start)*) |
2318 | 57 |
goal thy |
3683 | 58 |
"!!A. evs: ns_public ==> (Key (priK A) : parts (spies evs)) = (A : bad)"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
59 |
by (parts_induct_tac 1); |
4470 | 60 |
by (Blast_tac 1); |
2318 | 61 |
qed "Spy_see_priK"; |
62 |
Addsimps [Spy_see_priK]; |
|
63 |
||
64 |
goal thy |
|
3683 | 65 |
"!!A. evs: ns_public ==> (Key (priK A) : analz (spies evs)) = (A : bad)"; |
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4470
diff
changeset
|
66 |
by Auto_tac; |
2318 | 67 |
qed "Spy_analz_priK"; |
68 |
Addsimps [Spy_analz_priK]; |
|
69 |
||
4470 | 70 |
AddSDs [Spy_see_priK RSN (2, rev_iffD1), |
71 |
Spy_analz_priK RSN (2, rev_iffD1)]; |
|
2318 | 72 |
|
73 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
74 |
(**** Authenticity properties obtained from NS2 ****) |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
75 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
76 |
(*It is impossible to re-use a nonce in both NS1 and NS2, provided the nonce |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
77 |
is secret. (Honest users generate fresh nonces.)*) |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
78 |
goal thy |
3683 | 79 |
"!!evs. [| Crypt (pubK B) {|Nonce NA, Agent A|} : parts (spies evs); \ |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4477
diff
changeset
|
80 |
\ Nonce NA ~: analz (spies evs); evs : ns_public |] \ |
3683 | 81 |
\ ==> Crypt (pubK C) {|NA', Nonce NA, Agent D|} ~: parts (spies evs)"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
82 |
by (etac rev_mp 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
83 |
by (etac rev_mp 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
84 |
by (parts_induct_tac 1); |
4470 | 85 |
by (ALLGOALS Blast_tac); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
86 |
qed "no_nonce_NS1_NS2"; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
87 |
|
4470 | 88 |
(*Adding it to the claset slows down proofs...*) |
89 |
val nonce_NS1_NS2_E = no_nonce_NS1_NS2 RSN (2, rev_notE); |
|
90 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
91 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
92 |
(*Unicity for NS1: nonce NA identifies agents A and B*) |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
93 |
goal thy |
3683 | 94 |
"!!evs. [| Nonce NA ~: analz (spies evs); evs : ns_public |] \ |
3709 | 95 |
\ ==> EX A' B'. ALL A B. \ |
3683 | 96 |
\ Crypt (pubK B) {|Nonce NA, Agent A|} : parts (spies evs) --> \ |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
97 |
\ A=A' & B=B'"; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
98 |
by (etac rev_mp 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
99 |
by (parts_induct_tac 1); |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4477
diff
changeset
|
100 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib]))); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
101 |
(*NS1*) |
4470 | 102 |
by (expand_case_tac "NA = ?y" 2 THEN Blast_tac 2); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
103 |
(*Fake*) |
3709 | 104 |
by (Clarify_tac 1); |
4470 | 105 |
by (Blast_tac 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
106 |
val lemma = result(); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
107 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
108 |
goal thy |
3683 | 109 |
"!!evs. [| Crypt(pubK B) {|Nonce NA, Agent A|} : parts(spies evs); \ |
110 |
\ Crypt(pubK B') {|Nonce NA, Agent A'|} : parts(spies evs); \ |
|
111 |
\ Nonce NA ~: analz (spies evs); \ |
|
112 |
\ evs : ns_public |] \ |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
113 |
\ ==> A=A' & B=B'"; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
114 |
by (prove_unique_tac lemma 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
115 |
qed "unique_NA"; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
116 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
117 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
118 |
(*Tactic for proving secrecy theorems*) |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
119 |
fun analz_induct_tac i = |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
120 |
etac ns_public.induct i THEN |
4470 | 121 |
ALLGOALS (asm_simp_tac (simpset() addsplits [expand_if])); |
2318 | 122 |
|
123 |
||
124 |
(*Secrecy: Spy does not see the nonce sent in msg NS1 if A and B are secure*) |
|
125 |
goal thy |
|
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4477
diff
changeset
|
126 |
"!!evs. [| Says A B (Crypt(pubK B) {|Nonce NA, Agent A|}) : set evs; \ |
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4477
diff
changeset
|
127 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
3683 | 128 |
\ ==> Nonce NA ~: analz (spies evs)"; |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
129 |
by (etac rev_mp 1); |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
130 |
by (analz_induct_tac 1); |
2318 | 131 |
(*NS3*) |
4470 | 132 |
by (blast_tac (claset() addEs [nonce_NS1_NS2_E]) 4); |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
133 |
(*NS2*) |
4470 | 134 |
by (blast_tac (claset() addDs [unique_NA]) 3); |
2318 | 135 |
(*NS1*) |
4470 | 136 |
by (Blast_tac 2); |
2318 | 137 |
(*Fake*) |
2497 | 138 |
by (spy_analz_tac 1); |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
139 |
qed "Spy_not_see_NA"; |
2318 | 140 |
|
141 |
||
142 |
(*Authentication for A: if she receives message 2 and has used NA |
|
143 |
to start a run, then B has sent message 2.*) |
|
144 |
goal thy |
|
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4477
diff
changeset
|
145 |
"!!evs. [| Says A B (Crypt(pubK B) {|Nonce NA, Agent A|}) : set evs; \ |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
146 |
\ Says B' A (Crypt(pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
147 |
\ : set evs; \ |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4477
diff
changeset
|
148 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
149 |
\ ==> Says B A (Crypt(pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
3465 | 150 |
\ : set evs"; |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
151 |
by (etac rev_mp 1); |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
152 |
(*prepare induction over Crypt (pubK A) {|NA,NB,B|} : parts H*) |
3683 | 153 |
by (etac (Says_imp_spies RS parts.Inj RS rev_mp) 1); |
2318 | 154 |
by (etac ns_public.induct 1); |
155 |
by (ALLGOALS Asm_simp_tac); |
|
156 |
(*NS1*) |
|
4470 | 157 |
by (Blast_tac 2); |
2318 | 158 |
(*Fake*) |
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4197
diff
changeset
|
159 |
by (blast_tac (claset() addDs [Spy_not_see_NA]) 1); |
2318 | 160 |
qed "A_trusts_NS2"; |
161 |
||
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4477
diff
changeset
|
162 |
|
2318 | 163 |
(*If the encrypted message appears then it originated with Alice in NS1*) |
164 |
goal thy |
|
3683 | 165 |
"!!evs. [| Crypt (pubK B) {|Nonce NA, Agent A|} : parts (spies evs); \ |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4477
diff
changeset
|
166 |
\ Nonce NA ~: analz (spies evs); \ |
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4477
diff
changeset
|
167 |
\ evs : ns_public |] \ |
3465 | 168 |
\ ==> Says A B (Crypt (pubK B) {|Nonce NA, Agent A|}) : set evs"; |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
169 |
by (etac rev_mp 1); |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
170 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
171 |
by (parts_induct_tac 1); |
4470 | 172 |
by (Blast_tac 1); |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
173 |
qed "B_trusts_NS1"; |
2318 | 174 |
|
175 |
||
176 |
||
177 |
(**** Authenticity properties obtained from NS2 ****) |
|
178 |
||
2480 | 179 |
(*Unicity for NS2: nonce NB identifies nonce NA and agents A, B |
2318 | 180 |
[unicity of B makes Lowe's fix work] |
181 |
[proof closely follows that for unique_NA] *) |
|
182 |
goal thy |
|
3709 | 183 |
"!!evs. [| Nonce NB ~: analz (spies evs); evs : ns_public |] \ |
184 |
\ ==> EX A' NA' B'. ALL A NA B. \ |
|
3683 | 185 |
\ Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|} : parts (spies evs) \ |
186 |
\ --> A=A' & NA=NA' & B=B'"; |
|
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
187 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
188 |
by (parts_induct_tac 1); |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4477
diff
changeset
|
189 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib]))); |
2318 | 190 |
(*NS2*) |
4470 | 191 |
by (expand_case_tac "NB = ?y" 2 THEN Blast_tac 2); |
2318 | 192 |
(*Fake*) |
3709 | 193 |
by (Clarify_tac 1); |
4470 | 194 |
by (Blast_tac 1); |
2318 | 195 |
val lemma = result(); |
196 |
||
197 |
goal thy |
|
198 |
"!!evs. [| Crypt(pubK A) {|Nonce NA, Nonce NB, Agent B|} \ |
|
3709 | 199 |
\ : parts(spies evs); \ |
2318 | 200 |
\ Crypt(pubK A') {|Nonce NA', Nonce NB, Agent B'|} \ |
3709 | 201 |
\ : parts(spies evs); \ |
202 |
\ Nonce NB ~: analz (spies evs); \ |
|
2318 | 203 |
\ evs : ns_public |] \ |
204 |
\ ==> A=A' & NA=NA' & B=B'"; |
|
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
205 |
by (prove_unique_tac lemma 1); |
2318 | 206 |
qed "unique_NB"; |
207 |
||
4470 | 208 |
AddDs [unique_NB]; |
209 |
||
2318 | 210 |
|
211 |
(*Secrecy: Spy does not see the nonce sent in msg NS2 if A and B are secure*) |
|
212 |
goal thy |
|
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
213 |
"!!evs. [| Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
214 |
\ : set evs; \ |
3683 | 215 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
216 |
\ ==> Nonce NB ~: analz (spies evs)"; |
|
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
217 |
by (etac rev_mp 1); |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
218 |
by (analz_induct_tac 1); |
2318 | 219 |
(*NS3*) |
4470 | 220 |
by (Blast_tac 4); |
3709 | 221 |
(*NS2: by freshness and unicity of NB*) |
4470 | 222 |
by (blast_tac (claset() addEs [nonce_NS1_NS2_E]) 3); |
2318 | 223 |
(*NS1*) |
4470 | 224 |
by (Blast_tac 2); |
2318 | 225 |
(*Fake*) |
2497 | 226 |
by (spy_analz_tac 1); |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
227 |
qed "Spy_not_see_NB"; |
2318 | 228 |
|
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4197
diff
changeset
|
229 |
AddDs [Spy_not_see_NB]; |
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4197
diff
changeset
|
230 |
|
2318 | 231 |
|
232 |
(*Authentication for B: if he receives message 3 and has used NB |
|
233 |
in message 2, then A has sent message 3.*) |
|
234 |
goal thy |
|
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
235 |
"!!evs. [| Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
236 |
\ : set evs; \ |
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
237 |
\ Says A' B (Crypt (pubK B) (Nonce NB)): set evs; \ |
4197 | 238 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
3465 | 239 |
\ ==> Says A B (Crypt (pubK B) (Nonce NB)) : set evs"; |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
240 |
by (etac rev_mp 1); |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
241 |
(*prepare induction over Crypt (pubK B) NB : parts H*) |
3683 | 242 |
by (etac (Says_imp_spies RS parts.Inj RS rev_mp) 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
243 |
by (parts_induct_tac 1); |
3709 | 244 |
by (ALLGOALS Clarify_tac); |
4470 | 245 |
by (ALLGOALS Blast_tac); |
2318 | 246 |
qed "B_trusts_NS3"; |
247 |
||
248 |
||
249 |
(**** Overall guarantee for B*) |
|
250 |
||
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
251 |
(*Matches only NS2, not NS1 (or NS3)*) |
3683 | 252 |
val Says_imp_spies' = |
253 |
read_instantiate [("X","Crypt ?K {|?XX,?YY,?ZZ|}")] Says_imp_spies; |
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
254 |
|
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
255 |
|
2318 | 256 |
(*If B receives NS3 and the nonce NB agrees with the nonce he joined with |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
257 |
NA, then A initiated the run using NA. SAME proof as B_trusts_NS3!*) |
2318 | 258 |
goal thy |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
259 |
"!!evs. [| Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
260 |
\ : set evs; \ |
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
261 |
\ Says A' B (Crypt (pubK B) (Nonce NB)): set evs; \ |
3683 | 262 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
3465 | 263 |
\ ==> Says A B (Crypt (pubK B) {|Nonce NA, Agent A|}) : set evs"; |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
264 |
by (etac rev_mp 1); |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
265 |
(*prepare induction over Crypt (pubK B) {|NB|} : parts H*) |
3683 | 266 |
by (etac (Says_imp_spies RS parts.Inj RS rev_mp) 1); |
2318 | 267 |
by (etac ns_public.induct 1); |
268 |
by (ALLGOALS Asm_simp_tac); |
|
3709 | 269 |
by (ALLGOALS Clarify_tac); |
4470 | 270 |
(*NS3 holds because NB determines A and NA*) |
271 |
by (ALLGOALS Blast_tac); |
|
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
272 |
qed "B_trusts_protocol"; |
2318 | 273 |