author | paulson |
Wed, 02 Sep 1998 10:35:11 +0200 | |
changeset 5421 | 01fc8d6a40f2 |
parent 5359 | bd539b72d484 |
child 5434 | 9b4bed3f394c |
permissions | -rw-r--r-- |
2318 | 1 |
(* Title: HOL/Auth/NS_Public_Bad |
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 |
Flawed version, vulnerable to Lowe's attack. |
|
8 |
||
9 |
From page 260 of |
|
10 |
Burrows, Abadi and Needham. A Logic of Authentication. |
|
11 |
Proc. Royal Soc. 426 (1989) |
|
12 |
*) |
|
13 |
||
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
14 |
AddEs spies_partsEs; |
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
15 |
AddDs [impOfSubs analz_subset_parts]; |
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
16 |
AddDs [impOfSubs Fake_parts_insert]; |
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
17 |
|
3683 | 18 |
AddIffs [Spy_in_bad]; |
2318 | 19 |
|
20 |
(*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
|
21 |
Goal "A ~= B ==> EX NB. EX evs: ns_public. \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
22 |
\ Says A B (Crypt (pubK B) (Nonce NB)) : set evs"; |
2318 | 23 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
24 |
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
|
25 |
by possibility_tac; |
2318 | 26 |
result(); |
27 |
||
28 |
||
29 |
(**** Inductive proofs about ns_public ****) |
|
30 |
||
31 |
(*Nobody sends themselves messages*) |
|
5421 | 32 |
Goal "evs : ns_public ==> ALL X. Says A A X ~: set evs"; |
2318 | 33 |
by (etac ns_public.induct 1); |
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4476
diff
changeset
|
34 |
by Auto_tac; |
2318 | 35 |
qed_spec_mp "not_Says_to_self"; |
36 |
Addsimps [not_Says_to_self]; |
|
37 |
AddSEs [not_Says_to_self RSN (2, rev_notE)]; |
|
38 |
||
39 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
40 |
(*Induction for regularity theorems. If induction formula has the form |
3683 | 41 |
X ~: analz (spies evs) --> ... then it shortens the proof by discarding |
42 |
needless information about analz (insert X (spies evs)) *) |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
43 |
fun parts_induct_tac i = |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
44 |
etac ns_public.induct i |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
45 |
THEN |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
46 |
REPEAT (FIRSTGOAL analz_mono_contra_tac) |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
47 |
THEN |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
48 |
prove_simple_subgoals_tac i; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
49 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
50 |
|
3683 | 51 |
(** Theorems of the form X ~: parts (spies evs) imply that NOBODY |
2318 | 52 |
sends messages containing X! **) |
53 |
||
3683 | 54 |
(*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
|
55 |
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:
3466
diff
changeset
|
56 |
by (parts_induct_tac 1); |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
57 |
by (Blast_tac 1); |
2318 | 58 |
qed "Spy_see_priK"; |
59 |
Addsimps [Spy_see_priK]; |
|
60 |
||
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
61 |
Goal "evs: ns_public ==> (Key (priK A) : analz (spies evs)) = (A : bad)"; |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
62 |
by Auto_tac; |
2318 | 63 |
qed "Spy_analz_priK"; |
64 |
Addsimps [Spy_analz_priK]; |
|
65 |
||
4476 | 66 |
AddSDs [Spy_see_priK RSN (2, rev_iffD1), |
67 |
Spy_analz_priK RSN (2, rev_iffD1)]; |
|
2318 | 68 |
|
69 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
70 |
(**** Authenticity properties obtained from NS2 ****) |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
71 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
72 |
(*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:
3466
diff
changeset
|
73 |
is secret. (Honest users generate fresh nonces.)*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
74 |
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
|
75 |
\ Nonce NA ~: analz (spies evs); evs : ns_public |] \ |
3683 | 76 |
\ ==> Crypt (pubK C) {|NA', Nonce NA|} ~: parts (spies evs)"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
77 |
by (etac rev_mp 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
78 |
by (etac rev_mp 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
79 |
by (parts_induct_tac 1); |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
80 |
by (ALLGOALS Blast_tac); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
81 |
qed "no_nonce_NS1_NS2"; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
82 |
|
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
83 |
(*Adding it to the claset slows down proofs...*) |
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
84 |
val nonce_NS1_NS2_E = no_nonce_NS1_NS2 RSN (2, rev_notE); |
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
85 |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
86 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
87 |
(*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
|
88 |
Goal "[| Nonce NA ~: analz (spies evs); evs : ns_public |] \ |
3709 | 89 |
\ ==> EX A' B'. ALL A B. \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
90 |
\ Crypt (pubK B) {|Nonce NA, Agent A|} : parts (spies evs) --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
91 |
\ A=A' & B=B'"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
92 |
by (etac rev_mp 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
93 |
by (parts_induct_tac 1); |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
94 |
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:
3466
diff
changeset
|
95 |
(*NS1*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
96 |
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:
3466
diff
changeset
|
97 |
(*Fake*) |
3709 | 98 |
by (Clarify_tac 1); |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
99 |
by (Blast_tac 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
100 |
val lemma = result(); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
101 |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
102 |
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
|
103 |
\ 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 |
\ Nonce NA ~: analz (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
105 |
\ evs : ns_public |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
106 |
\ ==> A=A' & B=B'"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
107 |
by (prove_unique_tac lemma 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
108 |
qed "unique_NA"; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
109 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
110 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
111 |
(*Tactic for proving secrecy theorems*) |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
112 |
fun analz_induct_tac i = |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
113 |
etac ns_public.induct i THEN |
4686 | 114 |
ALLGOALS Asm_simp_tac; |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
115 |
|
2318 | 116 |
|
117 |
(*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
|
118 |
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
|
119 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
120 |
\ ==> 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
|
121 |
by (etac rev_mp 1); |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
122 |
by (analz_induct_tac 1); |
2318 | 123 |
(*NS3*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
124 |
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
|
125 |
(*NS2*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
126 |
by (blast_tac (claset() addDs [unique_NA]) 3); |
2318 | 127 |
(*NS1*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
128 |
by (Blast_tac 2); |
2318 | 129 |
(*Fake*) |
2497 | 130 |
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
|
131 |
qed "Spy_not_see_NA"; |
2318 | 132 |
|
133 |
||
134 |
(*Authentication for A: if she receives message 2 and has used NA |
|
135 |
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
|
136 |
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
|
137 |
\ Says B' A (Crypt(pubK A) {|Nonce NA, Nonce NB|}): set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
138 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
139 |
\ ==> Says B A (Crypt(pubK A) {|Nonce NA, 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
|
140 |
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
|
141 |
(*prepare induction over Crypt (pubK A) {|NA,NB|} : parts H*) |
3683 | 142 |
by (etac (Says_imp_spies RS parts.Inj RS rev_mp) 1); |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
143 |
by (etac ns_public.induct 1); |
2318 | 144 |
by (ALLGOALS Asm_simp_tac); |
3709 | 145 |
by (ALLGOALS Clarify_tac); |
146 |
(*NS2*) |
|
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
147 |
by (blast_tac (claset() addDs [Spy_not_see_NA, unique_NA]) 3); |
2318 | 148 |
(*NS1*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
149 |
by (Blast_tac 2); |
2318 | 150 |
(*Fake*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
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:
4551
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:
3466
diff
changeset
|
162 |
by (parts_induct_tac 1); |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
163 |
by (Blast_tac 1); |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
164 |
qed "B_trusts_NS1"; |
2318 | 165 |
|
166 |
||
167 |
||
168 |
(**** Authenticity properties obtained from NS2 ****) |
|
169 |
||
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
170 |
(*Unicity for NS2: nonce NB identifies nonce NA and agent A |
2318 | 171 |
[proof closely follows that for unique_NA] *) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
172 |
Goal "[| Nonce NB ~: analz (spies evs); evs : ns_public |] \ |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
173 |
\ ==> EX A' NA'. ALL A NA. \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
174 |
\ Crypt (pubK A) {|Nonce NA, Nonce NB|} : parts (spies evs) \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
175 |
\ --> A=A' & NA=NA'"; |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
176 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
177 |
by (parts_induct_tac 1); |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
178 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib]))); |
2318 | 179 |
(*NS2*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
180 |
by (expand_case_tac "NB = ?y" 2 THEN Blast_tac 2); |
2318 | 181 |
(*Fake*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
182 |
by (Blast_tac 1); |
2318 | 183 |
val lemma = result(); |
184 |
||
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
185 |
Goal "[| Crypt(pubK A) {|Nonce NA, Nonce NB|} : parts(spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
186 |
\ Crypt(pubK A'){|Nonce NA', Nonce NB|} : parts(spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
187 |
\ Nonce NB ~: analz (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
188 |
\ evs : ns_public |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
189 |
\ ==> A=A' & NA=NA'"; |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
190 |
by (prove_unique_tac lemma 1); |
2318 | 191 |
qed "unique_NB"; |
192 |
||
193 |
||
194 |
(*NB remains secret PROVIDED Alice never responds with round 3*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
195 |
Goal "[| Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
196 |
\ ALL C. Says A C (Crypt (pubK C) (Nonce NB)) ~: set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
197 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
198 |
\ ==> 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
|
199 |
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
|
200 |
by (etac rev_mp 1); |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
201 |
by (analz_induct_tac 1); |
4091 | 202 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib]))); |
3709 | 203 |
by (ALLGOALS Clarify_tac); |
3703 | 204 |
(*NS3: because NB determines A*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
205 |
by (blast_tac (claset() addDs [unique_NB]) 4); |
3703 | 206 |
(*NS2: by freshness and unicity of NB*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
207 |
by (blast_tac (claset() addEs [nonce_NS1_NS2_E]) 3); |
3703 | 208 |
(*NS1: by freshness*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
209 |
by (Blast_tac 2); |
2318 | 210 |
(*Fake*) |
2497 | 211 |
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
|
212 |
qed "Spy_not_see_NB"; |
2318 | 213 |
|
214 |
||
215 |
||
216 |
(*Authentication for B: if he receives message 3 and has used NB |
|
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
217 |
in message 2, then A has sent message 3--to somebody....*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
218 |
Goal "[| Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
219 |
\ Says A' B (Crypt (pubK B) (Nonce NB)): set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
220 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
221 |
\ ==> EX C. Says A C (Crypt (pubK C) (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
|
222 |
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
|
223 |
(*prepare induction over Crypt (pubK B) NB : parts H*) |
3683 | 224 |
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:
3466
diff
changeset
|
225 |
by (parts_induct_tac 1); |
4091 | 226 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [ex_disj_distrib]))); |
3709 | 227 |
by (ALLGOALS Clarify_tac); |
4197 | 228 |
(*NS3: because NB determines A (this use of unique_NB is more robust) *) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
229 |
by (blast_tac (claset() addDs [Spy_not_see_NB] |
4197 | 230 |
addIs [unique_NB RS conjunct1]) 3); |
3703 | 231 |
(*NS1: by freshness*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
232 |
by (Blast_tac 2); |
2318 | 233 |
(*Fake*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
234 |
by (blast_tac (claset() addDs [Spy_not_see_NB]) 1); |
2318 | 235 |
qed "B_trusts_NS3"; |
236 |
||
237 |
||
238 |
(*Can we strengthen the secrecy theorem? NO*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
239 |
Goal "[| A ~: bad; B ~: bad; evs : ns_public |] \ |
3465 | 240 |
\ ==> Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set evs \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
241 |
\ --> Nonce NB ~: analz (spies evs)"; |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
242 |
by (analz_induct_tac 1); |
3709 | 243 |
by (ALLGOALS Clarify_tac); |
3703 | 244 |
(*NS2: by freshness and unicity of NB*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
245 |
by (blast_tac (claset() addEs [nonce_NS1_NS2_E]) 3); |
3703 | 246 |
(*NS1: by freshness*) |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4551
diff
changeset
|
247 |
by (Blast_tac 2); |
2318 | 248 |
(*Fake*) |
2497 | 249 |
by (spy_analz_tac 1); |
3703 | 250 |
(*NS3: unicity of NB identifies A and NA, but not B*) |
3683 | 251 |
by (forw_inst_tac [("A'","A")] (Says_imp_spies RS parts.Inj RS unique_NB) 1 |
252 |
THEN REPEAT (eresolve_tac [asm_rl, Says_imp_spies RS parts.Inj] 1)); |
|
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4476
diff
changeset
|
253 |
by Auto_tac; |
3703 | 254 |
by (rename_tac "C B' evs3" 1); |
2318 | 255 |
|
256 |
(* |
|
257 |
THIS IS THE ATTACK! |
|
3703 | 258 |
Level 8 |
3683 | 259 |
!!evs. [| A ~: bad; B ~: bad; evs : ns_public |] |
3703 | 260 |
==> Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set evs --> |
3683 | 261 |
Nonce NB ~: analz (spies evs) |
3703 | 262 |
1. !!C B' evs3. |
263 |
[| A ~: bad; B ~: bad; evs3 : ns_public; |
|
264 |
Says A C (Crypt (pubK C) {|Nonce NA, Agent A|}) : set evs3; |
|
265 |
Says B' A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set evs3; C : bad; |
|
266 |
Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set evs3; |
|
267 |
Nonce NB ~: analz (spies evs3) |] |
|
2318 | 268 |
==> False |
269 |
*) |