author | paulson |
Thu, 02 Jul 1998 17:48:11 +0200 | |
changeset 5114 | c729d4c299c1 |
parent 5076 | fbc9d95b62ba |
child 5223 | 4cb05273f764 |
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*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
22 |
Goal "A ~= B ==> EX NB. EX evs: ns_public. \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
23 |
\ Says A B (Crypt (pubK B) (Nonce NB)) : set evs"; |
2318 | 24 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
25 |
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
|
26 |
by possibility_tac; |
2318 | 27 |
result(); |
28 |
||
29 |
||
30 |
(**** Inductive proofs about ns_public ****) |
|
31 |
||
32 |
(*Nobody sends themselves messages*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
33 |
Goal "evs : ns_public ==> ALL A X. Says A A X ~: set evs"; |
2318 | 34 |
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
|
35 |
by Auto_tac; |
2318 | 36 |
qed_spec_mp "not_Says_to_self"; |
37 |
Addsimps [not_Says_to_self]; |
|
38 |
AddSEs [not_Says_to_self RSN (2, rev_notE)]; |
|
39 |
||
40 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
41 |
(*Induction for regularity theorems. If induction formula has the form |
3683 | 42 |
X ~: analz (spies evs) --> ... then it shortens the proof by discarding |
43 |
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
|
44 |
fun parts_induct_tac i = |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
45 |
etac ns_public.induct i |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
46 |
THEN |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
47 |
REPEAT (FIRSTGOAL analz_mono_contra_tac) |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
48 |
THEN |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
49 |
prove_simple_subgoals_tac i; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
50 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
51 |
|
3683 | 52 |
(** Theorems of the form X ~: parts (spies evs) imply that NOBODY |
2318 | 53 |
sends messages containing X! **) |
54 |
||
3683 | 55 |
(*Spy never sees another agent's private key! (unless it's bad at start)*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
56 |
Goal "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
|
57 |
by (parts_induct_tac 1); |
4470 | 58 |
by (Blast_tac 1); |
2318 | 59 |
qed "Spy_see_priK"; |
60 |
Addsimps [Spy_see_priK]; |
|
61 |
||
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
62 |
Goal "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
|
63 |
by Auto_tac; |
2318 | 64 |
qed "Spy_analz_priK"; |
65 |
Addsimps [Spy_analz_priK]; |
|
66 |
||
4470 | 67 |
AddSDs [Spy_see_priK RSN (2, rev_iffD1), |
68 |
Spy_analz_priK RSN (2, rev_iffD1)]; |
|
2318 | 69 |
|
70 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
71 |
(**** Authenticity properties obtained from NS2 ****) |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
72 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
73 |
(*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
|
74 |
is secret. (Honest users generate fresh nonces.)*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
75 |
Goal "[| Crypt (pubK B) {|Nonce NA, Agent A|} : parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
76 |
\ Nonce NA ~: analz (spies evs); evs : ns_public |] \ |
3683 | 77 |
\ ==> 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
|
78 |
by (etac rev_mp 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
79 |
by (etac rev_mp 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
80 |
by (parts_induct_tac 1); |
4470 | 81 |
by (ALLGOALS Blast_tac); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
82 |
qed "no_nonce_NS1_NS2"; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
83 |
|
4470 | 84 |
(*Adding it to the claset slows down proofs...*) |
85 |
val nonce_NS1_NS2_E = no_nonce_NS1_NS2 RSN (2, rev_notE); |
|
86 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
87 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
88 |
(*Unicity for NS1: nonce NA identifies agents A and B*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
89 |
Goal "[| Nonce NA ~: analz (spies evs); evs : ns_public |] \ |
3709 | 90 |
\ ==> EX A' B'. ALL A B. \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
91 |
\ Crypt (pubK B) {|Nonce NA, Agent A|} : parts (spies evs) --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
92 |
\ A=A' & B=B'"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
93 |
by (etac rev_mp 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
94 |
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
|
95 |
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
|
96 |
(*NS1*) |
4470 | 97 |
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
|
98 |
(*Fake*) |
3709 | 99 |
by (Clarify_tac 1); |
4470 | 100 |
by (Blast_tac 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
101 |
val lemma = result(); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
102 |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
103 |
Goal "[| Crypt(pubK B) {|Nonce NA, Agent A|} : parts(spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
104 |
\ Crypt(pubK B') {|Nonce NA, Agent A'|} : parts(spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
105 |
\ Nonce NA ~: analz (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
106 |
\ evs : ns_public |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
107 |
\ ==> A=A' & B=B'"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
108 |
by (prove_unique_tac lemma 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
109 |
qed "unique_NA"; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
110 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
111 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
112 |
(*Tactic for proving secrecy theorems*) |
4686 | 113 |
fun analz_induct_tac i = |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
114 |
etac ns_public.induct i THEN |
4686 | 115 |
ALLGOALS Asm_simp_tac; |
2318 | 116 |
|
117 |
||
118 |
(*Secrecy: Spy does not see the nonce sent in msg NS1 if A and B are secure*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
119 |
Goal "[| Says A B (Crypt(pubK B) {|Nonce NA, Agent A|}) : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
120 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
121 |
\ ==> 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
|
122 |
by (etac rev_mp 1); |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
123 |
by (analz_induct_tac 1); |
2318 | 124 |
(*NS3*) |
4470 | 125 |
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
|
126 |
(*NS2*) |
4470 | 127 |
by (blast_tac (claset() addDs [unique_NA]) 3); |
2318 | 128 |
(*NS1*) |
4470 | 129 |
by (Blast_tac 2); |
2318 | 130 |
(*Fake*) |
2497 | 131 |
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
|
132 |
qed "Spy_not_see_NA"; |
2318 | 133 |
|
134 |
||
135 |
(*Authentication for A: if she receives message 2 and has used NA |
|
136 |
to start a run, then B has sent message 2.*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
137 |
Goal "[| Says A B (Crypt(pubK B) {|Nonce NA, Agent A|}) : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
138 |
\ Says B' A (Crypt(pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
139 |
\ : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
140 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
141 |
\ ==> Says B A (Crypt(pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
142 |
\ : set evs"; |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
143 |
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
|
144 |
(*prepare induction over Crypt (pubK A) {|NA,NB,B|} : parts H*) |
3683 | 145 |
by (etac (Says_imp_spies RS parts.Inj RS rev_mp) 1); |
2318 | 146 |
by (etac ns_public.induct 1); |
147 |
by (ALLGOALS Asm_simp_tac); |
|
148 |
(*NS1*) |
|
4470 | 149 |
by (Blast_tac 2); |
2318 | 150 |
(*Fake*) |
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4197
diff
changeset
|
151 |
by (blast_tac (claset() addDs [Spy_not_see_NA]) 1); |
2318 | 152 |
qed "A_trusts_NS2"; |
153 |
||
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4477
diff
changeset
|
154 |
|
2318 | 155 |
(*If the encrypted message appears then it originated with Alice in NS1*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
156 |
Goal "[| Crypt (pubK B) {|Nonce NA, Agent A|} : parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
157 |
\ Nonce NA ~: analz (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
158 |
\ evs : ns_public |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
159 |
\==> 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
|
160 |
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
|
161 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
162 |
by (parts_induct_tac 1); |
4470 | 163 |
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
|
164 |
qed "B_trusts_NS1"; |
2318 | 165 |
|
166 |
||
167 |
||
168 |
(**** Authenticity properties obtained from NS2 ****) |
|
169 |
||
2480 | 170 |
(*Unicity for NS2: nonce NB identifies nonce NA and agents A, B |
2318 | 171 |
[unicity of B makes Lowe's fix work] |
172 |
[proof closely follows that for unique_NA] *) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
173 |
Goal "[| Nonce NB ~: analz (spies evs); evs : ns_public |] \ |
3709 | 174 |
\ ==> EX A' NA' B'. ALL A NA B. \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
175 |
\ Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|} : parts (spies evs) \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
176 |
\ --> 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
|
177 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
178 |
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
|
179 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib]))); |
2318 | 180 |
(*NS2*) |
4470 | 181 |
by (expand_case_tac "NB = ?y" 2 THEN Blast_tac 2); |
2318 | 182 |
(*Fake*) |
3709 | 183 |
by (Clarify_tac 1); |
4470 | 184 |
by (Blast_tac 1); |
2318 | 185 |
val lemma = result(); |
186 |
||
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
187 |
Goal "[| Crypt(pubK A) {|Nonce NA, Nonce NB, Agent B|} \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
188 |
\ : parts(spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
189 |
\ Crypt(pubK A') {|Nonce NA', Nonce NB, Agent B'|} \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
190 |
\ : parts(spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
191 |
\ Nonce NB ~: analz (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
192 |
\ evs : ns_public |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
193 |
\ ==> A=A' & NA=NA' & B=B'"; |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
194 |
by (prove_unique_tac lemma 1); |
2318 | 195 |
qed "unique_NB"; |
196 |
||
4470 | 197 |
AddDs [unique_NB]; |
198 |
||
2318 | 199 |
|
200 |
(*Secrecy: Spy does not see the nonce sent in msg NS2 if A and B are secure*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
201 |
Goal "[| Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
202 |
\ : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
203 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
3683 | 204 |
\ ==> 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
|
205 |
by (etac rev_mp 1); |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
206 |
by (analz_induct_tac 1); |
2318 | 207 |
(*NS3*) |
4470 | 208 |
by (Blast_tac 4); |
3709 | 209 |
(*NS2: by freshness and unicity of NB*) |
4470 | 210 |
by (blast_tac (claset() addEs [nonce_NS1_NS2_E]) 3); |
2318 | 211 |
(*NS1*) |
4470 | 212 |
by (Blast_tac 2); |
2318 | 213 |
(*Fake*) |
2497 | 214 |
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
|
215 |
qed "Spy_not_see_NB"; |
2318 | 216 |
|
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4197
diff
changeset
|
217 |
AddDs [Spy_not_see_NB]; |
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4197
diff
changeset
|
218 |
|
2318 | 219 |
|
220 |
(*Authentication for B: if he receives message 3 and has used NB |
|
221 |
in message 2, then A has sent message 3.*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
222 |
Goal "[| Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
223 |
\ : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
224 |
\ Says A' B (Crypt (pubK B) (Nonce NB)): set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
225 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
226 |
\ ==> 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
|
227 |
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
|
228 |
(*prepare induction over Crypt (pubK B) NB : parts H*) |
3683 | 229 |
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
|
230 |
by (parts_induct_tac 1); |
3709 | 231 |
by (ALLGOALS Clarify_tac); |
4470 | 232 |
by (ALLGOALS Blast_tac); |
2318 | 233 |
qed "B_trusts_NS3"; |
234 |
||
235 |
||
236 |
(**** Overall guarantee for B*) |
|
237 |
||
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
238 |
(*Matches only NS2, not NS1 (or NS3)*) |
3683 | 239 |
val Says_imp_spies' = |
240 |
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
|
241 |
|
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
242 |
|
2318 | 243 |
(*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
|
244 |
NA, then A initiated the run using NA. SAME proof as B_trusts_NS3!*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
245 |
Goal "[| Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
246 |
\ : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
247 |
\ Says A' B (Crypt (pubK B) (Nonce NB)): set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
248 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
249 |
\ ==> 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
|
250 |
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
|
251 |
(*prepare induction over Crypt (pubK B) {|NB|} : parts H*) |
3683 | 252 |
by (etac (Says_imp_spies RS parts.Inj RS rev_mp) 1); |
2318 | 253 |
by (etac ns_public.induct 1); |
254 |
by (ALLGOALS Asm_simp_tac); |
|
3709 | 255 |
by (ALLGOALS Clarify_tac); |
4470 | 256 |
(*NS3 holds because NB determines A and NA*) |
257 |
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
|
258 |
qed "B_trusts_protocol"; |
2318 | 259 |