| author | huffman | 
| Tue, 10 Apr 2007 22:02:43 +0200 | |
| changeset 22628 | 0e5ac9503d7e | 
| parent 21404 | eb85850d3eb7 | 
| child 23746 | a455e69c31cc | 
| permissions | -rw-r--r-- | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 1 | (* Title: HOL/Auth/ZhouGollmann | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 2 | ID: $Id$ | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 3 | Author: Giampaolo Bella and L C Paulson, Cambridge Univ Computer Lab | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 4 | Copyright 2003 University of Cambridge | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 5 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 6 | The protocol of | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 7 | Jianying Zhou and Dieter Gollmann, | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 8 | A Fair Non-Repudiation Protocol, | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 9 | Security and Privacy 1996 (Oakland) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 10 | 55-61 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 11 | *) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 12 | |
| 16417 | 13 | theory ZhouGollmann imports Public begin | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 14 | |
| 20768 | 15 | abbreviation | 
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
20768diff
changeset | 16 | TTP :: agent where "TTP == Server" | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 17 | |
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
20768diff
changeset | 18 | abbreviation f_sub :: nat where "f_sub == 5" | 
| 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
20768diff
changeset | 19 | abbreviation f_nro :: nat where "f_nro == 2" | 
| 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
20768diff
changeset | 20 | abbreviation f_nrr :: nat where "f_nrr == 3" | 
| 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
20768diff
changeset | 21 | abbreviation f_con :: nat where "f_con == 4" | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 22 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 23 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 24 | constdefs | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 25 | broken :: "agent set" | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 26 |     --{*the compromised honest agents; TTP is included as it's not allowed to
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 27 | use the protocol*} | 
| 14736 
7104394df99a
broken no longer includes TTP, and other minor changes
 paulson parents: 
14207diff
changeset | 28 |    "broken == bad - {Spy}"
 | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 29 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 30 | declare broken_def [simp] | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 31 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 32 | consts zg :: "event list set" | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 33 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 34 | inductive zg | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 35 | intros | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 36 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 37 | Nil: "[] \<in> zg" | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 38 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 39 | Fake: "[| evsf \<in> zg; X \<in> synth (analz (spies evsf)) |] | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 40 | ==> Says Spy B X # evsf \<in> zg" | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 41 | |
| 14736 
7104394df99a
broken no longer includes TTP, and other minor changes
 paulson parents: 
14207diff
changeset | 42 | Reception: "[| evsr \<in> zg; Says A B X \<in> set evsr |] ==> Gets B X # evsr \<in> zg" | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 43 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 44 | (*L is fresh for honest agents. | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 45 | We don't require K to be fresh because we don't bother to prove secrecy! | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 46 | We just assume that the protocol's objective is to deliver K fairly, | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 47 | rather than to keep M secret.*) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 48 | ZG1: "[| evs1 \<in> zg; Nonce L \<notin> used evs1; C = Crypt K (Number m); | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 49 | K \<in> symKeys; | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 50 | 	   NRO = Crypt (priK A) {|Number f_nro, Agent B, Nonce L, C|}|]
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 51 |        ==> Says A B {|Number f_nro, Agent B, Nonce L, C, NRO|} # evs1 \<in> zg"
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 52 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 53 | (*B must check that NRO is A's signature to learn the sender's name*) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 54 | ZG2: "[| evs2 \<in> zg; | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 55 | 	   Gets B {|Number f_nro, Agent B, Nonce L, C, NRO|} \<in> set evs2;
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 56 | 	   NRO = Crypt (priK A) {|Number f_nro, Agent B, Nonce L, C|};
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 57 | 	   NRR = Crypt (priK B) {|Number f_nrr, Agent A, Nonce L, C|}|]
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 58 |        ==> Says B A {|Number f_nrr, Agent A, Nonce L, NRR|} # evs2  \<in>  zg"
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 59 | |
| 14736 
7104394df99a
broken no longer includes TTP, and other minor changes
 paulson parents: 
14207diff
changeset | 60 | (*A must check that NRR is B's signature to learn the sender's name; | 
| 
7104394df99a
broken no longer includes TTP, and other minor changes
 paulson parents: 
14207diff
changeset | 61 | without spy, the matching label would be enough*) | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 62 | ZG3: "[| evs3 \<in> zg; C = Crypt K M; K \<in> symKeys; | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 63 | 	   Says A B {|Number f_nro, Agent B, Nonce L, C, NRO|} \<in> set evs3;
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 64 | 	   Gets A {|Number f_nrr, Agent A, Nonce L, NRR|} \<in> set evs3;
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 65 | 	   NRR = Crypt (priK B) {|Number f_nrr, Agent A, Nonce L, C|};
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 66 | 	   sub_K = Crypt (priK A) {|Number f_sub, Agent B, Nonce L, Key K|}|]
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 67 |        ==> Says A TTP {|Number f_sub, Agent B, Nonce L, Key K, sub_K|}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 68 | # evs3 \<in> zg" | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 69 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 70 | (*TTP checks that sub_K is A's signature to learn who issued K, then | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 71 | gives credentials to A and B. The Notes event models the availability of | 
| 14736 
7104394df99a
broken no longer includes TTP, and other minor changes
 paulson parents: 
14207diff
changeset | 72 | the credentials, but the act of fetching them is not modelled. We also | 
| 
7104394df99a
broken no longer includes TTP, and other minor changes
 paulson parents: 
14207diff
changeset | 73 | give con_K to the Spy. This makes the threat model more dangerous, while | 
| 
7104394df99a
broken no longer includes TTP, and other minor changes
 paulson parents: 
14207diff
changeset | 74 |    also allowing lemma @{text Crypt_used_imp_spies} to omit the condition
 | 
| 
7104394df99a
broken no longer includes TTP, and other minor changes
 paulson parents: 
14207diff
changeset | 75 |    @{term "K \<noteq> priK TTP"}. *)
 | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 76 | ZG4: "[| evs4 \<in> zg; K \<in> symKeys; | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 77 | 	   Gets TTP {|Number f_sub, Agent B, Nonce L, Key K, sub_K|}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 78 | \<in> set evs4; | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 79 | 	   sub_K = Crypt (priK A) {|Number f_sub, Agent B, Nonce L, Key K|};
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 80 | 	   con_K = Crypt (priK TTP) {|Number f_con, Agent A, Agent B,
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 81 | Nonce L, Key K|}|] | 
| 14736 
7104394df99a
broken no longer includes TTP, and other minor changes
 paulson parents: 
14207diff
changeset | 82 | ==> Says TTP Spy con_K | 
| 
7104394df99a
broken no longer includes TTP, and other minor changes
 paulson parents: 
14207diff
changeset | 83 | # | 
| 
7104394df99a
broken no longer includes TTP, and other minor changes
 paulson parents: 
14207diff
changeset | 84 | 	   Notes TTP {|Number f_con, Agent A, Agent B, Nonce L, Key K, con_K|}
 | 
| 
7104394df99a
broken no longer includes TTP, and other minor changes
 paulson parents: 
14207diff
changeset | 85 | # evs4 \<in> zg" | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 86 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 87 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 88 | declare Says_imp_knows_Spy [THEN analz.Inj, dest] | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 89 | declare Fake_parts_insert_in_Un [dest] | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 90 | declare analz_into_parts [dest] | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 91 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 92 | declare symKey_neq_priEK [simp] | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 93 | declare symKey_neq_priEK [THEN not_sym, simp] | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 94 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 95 | |
| 14146 | 96 | text{*A "possibility property": there are traces that reach the end*}
 | 
| 97 | lemma "[|A \<noteq> B; TTP \<noteq> A; TTP \<noteq> B; K \<in> symKeys|] ==> | |
| 98 | \<exists>L. \<exists>evs \<in> zg. | |
| 99 |            Notes TTP {|Number f_con, Agent A, Agent B, Nonce L, Key K,
 | |
| 100 |                Crypt (priK TTP) {|Number f_con, Agent A, Agent B, Nonce L, Key K|} |}
 | |
| 101 | \<in> set evs" | |
| 102 | apply (intro exI bexI) | |
| 103 | apply (rule_tac [2] zg.Nil | |
| 104 | [THEN zg.ZG1, THEN zg.Reception [of _ A B], | |
| 105 | THEN zg.ZG2, THEN zg.Reception [of _ B A], | |
| 106 | THEN zg.ZG3, THEN zg.Reception [of _ A TTP], | |
| 107 | THEN zg.ZG4]) | |
| 108 | apply (possibility, auto) | |
| 109 | done | |
| 110 | ||
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 111 | subsection {*Basic Lemmas*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 112 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 113 | lemma Gets_imp_Says: | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 114 | "[| Gets B X \<in> set evs; evs \<in> zg |] ==> \<exists>A. Says A B X \<in> set evs" | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 115 | apply (erule rev_mp) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 116 | apply (erule zg.induct, auto) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 117 | done | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 118 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 119 | lemma Gets_imp_knows_Spy: | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 120 | "[| Gets B X \<in> set evs; evs \<in> zg |] ==> X \<in> spies evs" | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 121 | by (blast dest!: Gets_imp_Says Says_imp_knows_Spy) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 122 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 123 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 124 | text{*Lets us replace proofs about @{term "used evs"} by simpler proofs 
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 125 | about @{term "parts (spies evs)"}.*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 126 | lemma Crypt_used_imp_spies: | 
| 14736 
7104394df99a
broken no longer includes TTP, and other minor changes
 paulson parents: 
14207diff
changeset | 127 | "[| Crypt K X \<in> used evs; evs \<in> zg |] | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 128 | ==> Crypt K X \<in> parts (spies evs)" | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 129 | apply (erule rev_mp) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 130 | apply (erule zg.induct) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 131 | apply (simp_all add: parts_insert_knows_A) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 132 | done | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 133 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 134 | lemma Notes_TTP_imp_Gets: | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 135 |      "[|Notes TTP {|Number f_con, Agent A, Agent B, Nonce L, Key K, con_K |}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 136 | \<in> set evs; | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 137 |         sub_K = Crypt (priK A) {|Number f_sub, Agent B, Nonce L, Key K|};
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 138 | evs \<in> zg|] | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 139 |     ==> Gets TTP {|Number f_sub, Agent B, Nonce L, Key K, sub_K|} \<in> set evs"
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 140 | apply (erule rev_mp) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 141 | apply (erule zg.induct, auto) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 142 | done | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 143 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 144 | text{*For reasoning about C, which is encrypted in message ZG2*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 145 | lemma ZG2_msg_in_parts_spies: | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 146 |      "[|Gets B {|F, B', L, C, X|} \<in> set evs; evs \<in> zg|]
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 147 | ==> C \<in> parts (spies evs)" | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 148 | by (blast dest: Gets_imp_Says) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 149 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 150 | (*classical regularity lemma on priK*) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 151 | lemma Spy_see_priK [simp]: | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 152 | "evs \<in> zg ==> (Key (priK A) \<in> parts (spies evs)) = (A \<in> bad)" | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 153 | apply (erule zg.induct) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 154 | apply (frule_tac [5] ZG2_msg_in_parts_spies, auto) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 155 | done | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 156 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 157 | text{*So that blast can use it too*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 158 | declare Spy_see_priK [THEN [2] rev_iffD1, dest!] | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 159 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 160 | lemma Spy_analz_priK [simp]: | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 161 | "evs \<in> zg ==> (Key (priK A) \<in> analz (spies evs)) = (A \<in> bad)" | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 162 | by auto | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 163 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 164 | |
| 14741 | 165 | subsection{*About NRO: Validity for @{term B}*}
 | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 166 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 167 | text{*Below we prove that if @{term NRO} exists then @{term A} definitely
 | 
| 14741 | 168 | sent it, provided @{term A} is not broken.*}
 | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 169 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 170 | text{*Strong conclusion for a good agent*}
 | 
| 15068 
58d216b32199
minor tweaks to go with the new version of the Accountability paper
 paulson parents: 
15047diff
changeset | 171 | lemma NRO_validity_good: | 
| 14741 | 172 |      "[|NRO = Crypt (priK A) {|Number f_nro, Agent B, Nonce L, C|};
 | 
| 173 | NRO \<in> parts (spies evs); | |
| 174 | A \<notin> bad; evs \<in> zg |] | |
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 175 |      ==> Says A B {|Number f_nro, Agent B, Nonce L, C, NRO|} \<in> set evs"
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 176 | apply clarify | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 177 | apply (erule rev_mp) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 178 | apply (erule zg.induct) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 179 | apply (frule_tac [5] ZG2_msg_in_parts_spies, auto) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 180 | done | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 181 | |
| 14741 | 182 | lemma NRO_sender: | 
| 183 |      "[|Says A' B {|n, b, l, C, Crypt (priK A) X|} \<in> set evs; evs \<in> zg|]
 | |
| 184 |     ==> A' \<in> {A,Spy}"
 | |
| 185 | apply (erule rev_mp) | |
| 186 | apply (erule zg.induct, simp_all) | |
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 187 | done | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 188 | |
| 14741 | 189 | text{*Holds also for @{term "A = Spy"}!*}
 | 
| 15068 
58d216b32199
minor tweaks to go with the new version of the Accountability paper
 paulson parents: 
15047diff
changeset | 190 | theorem NRO_validity: | 
| 15047 | 191 |      "[|Gets B {|Number f_nro, Agent B, Nonce L, C, NRO|} \<in> set evs;
 | 
| 14741 | 192 |         NRO = Crypt (priK A) {|Number f_nro, Agent B, Nonce L, C|};
 | 
| 193 | A \<notin> broken; evs \<in> zg |] | |
| 194 |      ==> Says A B {|Number f_nro, Agent B, Nonce L, C, NRO|} \<in> set evs"
 | |
| 15047 | 195 | apply (drule Gets_imp_Says, assumption) | 
| 14741 | 196 | apply clarify | 
| 197 | apply (frule NRO_sender, auto) | |
| 15047 | 198 | txt{*We are left with the case where the sender is @{term Spy} and not
 | 
| 199 |   equal to @{term A}, because @{term "A \<notin> bad"}. 
 | |
| 15068 
58d216b32199
minor tweaks to go with the new version of the Accountability paper
 paulson parents: 
15047diff
changeset | 200 |   Thus theorem @{text NRO_validity_good} applies.*}
 | 
| 
58d216b32199
minor tweaks to go with the new version of the Accountability paper
 paulson parents: 
15047diff
changeset | 201 | apply (blast dest: NRO_validity_good [OF refl]) | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 202 | done | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 203 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 204 | |
| 14741 | 205 | subsection{*About NRR: Validity for @{term A}*}
 | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 206 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 207 | text{*Below we prove that if @{term NRR} exists then @{term B} definitely
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 208 | sent it, provided @{term B} is not broken.*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 209 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 210 | text{*Strong conclusion for a good agent*}
 | 
| 15068 
58d216b32199
minor tweaks to go with the new version of the Accountability paper
 paulson parents: 
15047diff
changeset | 211 | lemma NRR_validity_good: | 
| 14741 | 212 |      "[|NRR = Crypt (priK B) {|Number f_nrr, Agent A, Nonce L, C|};
 | 
| 213 | NRR \<in> parts (spies evs); | |
| 214 | B \<notin> bad; evs \<in> zg |] | |
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 215 |      ==> Says B A {|Number f_nrr, Agent A, Nonce L, NRR|} \<in> set evs"
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 216 | apply clarify | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 217 | apply (erule rev_mp) | 
| 14741 | 218 | apply (erule zg.induct) | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 219 | apply (frule_tac [5] ZG2_msg_in_parts_spies, auto) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 220 | done | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 221 | |
| 14741 | 222 | lemma NRR_sender: | 
| 223 |      "[|Says B' A {|n, a, l, Crypt (priK B) X|} \<in> set evs; evs \<in> zg|]
 | |
| 224 |     ==> B' \<in> {B,Spy}"
 | |
| 225 | apply (erule rev_mp) | |
| 226 | apply (erule zg.induct, simp_all) | |
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 227 | done | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 228 | |
| 14741 | 229 | text{*Holds also for @{term "B = Spy"}!*}
 | 
| 15068 
58d216b32199
minor tweaks to go with the new version of the Accountability paper
 paulson parents: 
15047diff
changeset | 230 | theorem NRR_validity: | 
| 14741 | 231 |      "[|Says B' A {|Number f_nrr, Agent A, Nonce L, NRR|} \<in> set evs;
 | 
| 232 |         NRR = Crypt (priK B) {|Number f_nrr, Agent A, Nonce L, C|};
 | |
| 233 | B \<notin> broken; evs \<in> zg|] | |
| 234 |     ==> Says B A {|Number f_nrr, Agent A, Nonce L, NRR|} \<in> set evs"
 | |
| 235 | apply clarify | |
| 236 | apply (frule NRR_sender, auto) | |
| 237 | txt{*We are left with the case where @{term "B' = Spy"} and  @{term "B' \<noteq> B"},
 | |
| 15068 
58d216b32199
minor tweaks to go with the new version of the Accountability paper
 paulson parents: 
15047diff
changeset | 238 |   i.e. @{term "B \<notin> bad"}, when we can apply @{text NRR_validity_good}.*}
 | 
| 
58d216b32199
minor tweaks to go with the new version of the Accountability paper
 paulson parents: 
15047diff
changeset | 239 | apply (blast dest: NRR_validity_good [OF refl]) | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 240 | done | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 241 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 242 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 243 | subsection{*Proofs About @{term sub_K}*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 244 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 245 | text{*Below we prove that if @{term sub_K} exists then @{term A} definitely
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 246 | sent it, provided @{term A} is not broken.  *}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 247 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 248 | text{*Strong conclusion for a good agent*}
 | 
| 15068 
58d216b32199
minor tweaks to go with the new version of the Accountability paper
 paulson parents: 
15047diff
changeset | 249 | lemma sub_K_validity_good: | 
| 14741 | 250 |      "[|sub_K = Crypt (priK A) {|Number f_sub, Agent B, Nonce L, Key K|};
 | 
| 251 | sub_K \<in> parts (spies evs); | |
| 252 | A \<notin> bad; evs \<in> zg |] | |
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 253 |      ==> Says A TTP {|Number f_sub, Agent B, Nonce L, Key K, sub_K|} \<in> set evs"
 | 
| 14741 | 254 | apply clarify | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 255 | apply (erule rev_mp) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 256 | apply (erule zg.induct) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 257 | apply (frule_tac [5] ZG2_msg_in_parts_spies, simp_all) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 258 | txt{*Fake*} 
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 259 | apply (blast dest!: Fake_parts_sing_imp_Un) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 260 | done | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 261 | |
| 14741 | 262 | lemma sub_K_sender: | 
| 263 |      "[|Says A' TTP {|n, b, l, k, Crypt (priK A) X|} \<in> set evs;  evs \<in> zg|]
 | |
| 264 |     ==> A' \<in> {A,Spy}"
 | |
| 265 | apply (erule rev_mp) | |
| 266 | apply (erule zg.induct, simp_all) | |
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 267 | done | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 268 | |
| 14741 | 269 | text{*Holds also for @{term "A = Spy"}!*}
 | 
| 15068 
58d216b32199
minor tweaks to go with the new version of the Accountability paper
 paulson parents: 
15047diff
changeset | 270 | theorem sub_K_validity: | 
| 15047 | 271 |      "[|Gets TTP {|Number f_sub, Agent B, Nonce L, Key K, sub_K|} \<in> set evs;
 | 
| 14741 | 272 |         sub_K = Crypt (priK A) {|Number f_sub, Agent B, Nonce L, Key K|};
 | 
| 273 | A \<notin> broken; evs \<in> zg |] | |
| 274 |      ==> Says A TTP {|Number f_sub, Agent B, Nonce L, Key K, sub_K|} \<in> set evs"
 | |
| 15047 | 275 | apply (drule Gets_imp_Says, assumption) | 
| 14741 | 276 | apply clarify | 
| 277 | apply (frule sub_K_sender, auto) | |
| 15047 | 278 | txt{*We are left with the case where the sender is @{term Spy} and not
 | 
| 279 |   equal to @{term A}, because @{term "A \<notin> bad"}. 
 | |
| 15068 
58d216b32199
minor tweaks to go with the new version of the Accountability paper
 paulson parents: 
15047diff
changeset | 280 |   Thus theorem @{text sub_K_validity_good} applies.*}
 | 
| 
58d216b32199
minor tweaks to go with the new version of the Accountability paper
 paulson parents: 
15047diff
changeset | 281 | apply (blast dest: sub_K_validity_good [OF refl]) | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 282 | done | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 283 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 284 | |
| 14741 | 285 | |
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 286 | subsection{*Proofs About @{term con_K}*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 287 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 288 | text{*Below we prove that if @{term con_K} exists, then @{term TTP} has it,
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 289 | and therefore @{term A} and @{term B}) can get it too.  Moreover, we know
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 290 | that @{term A} sent @{term sub_K}*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 291 | |
| 15068 
58d216b32199
minor tweaks to go with the new version of the Accountability paper
 paulson parents: 
15047diff
changeset | 292 | lemma con_K_validity: | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 293 | "[|con_K \<in> used evs; | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 294 | con_K = Crypt (priK TTP) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 295 |                   {|Number f_con, Agent A, Agent B, Nonce L, Key K|};
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 296 | evs \<in> zg |] | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 297 |     ==> Notes TTP {|Number f_con, Agent A, Agent B, Nonce L, Key K, con_K|}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 298 | \<in> set evs" | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 299 | apply clarify | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 300 | apply (erule rev_mp) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 301 | apply (erule zg.induct) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 302 | apply (frule_tac [5] ZG2_msg_in_parts_spies, simp_all) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 303 | txt{*Fake*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 304 | apply (blast dest!: Fake_parts_sing_imp_Un) | 
| 14741 | 305 | txt{*ZG2*} 
 | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 306 | apply (blast dest: parts_cut) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 307 | done | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 308 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 309 | text{*If @{term TTP} holds @{term con_K} then @{term A} sent
 | 
| 14736 
7104394df99a
broken no longer includes TTP, and other minor changes
 paulson parents: 
14207diff
changeset | 310 |  @{term sub_K}.  We assume that @{term A} is not broken.  Importantly, nothing
 | 
| 
7104394df99a
broken no longer includes TTP, and other minor changes
 paulson parents: 
14207diff
changeset | 311 |   needs to be assumed about the form of @{term con_K}!*}
 | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 312 | lemma Notes_TTP_imp_Says_A: | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 313 |      "[|Notes TTP {|Number f_con, Agent A, Agent B, Nonce L, Key K, con_K|}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 314 | \<in> set evs; | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 315 |         sub_K = Crypt (priK A) {|Number f_sub, Agent B, Nonce L, Key K|};
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 316 | A \<notin> broken; evs \<in> zg|] | 
| 14741 | 317 |      ==> Says A TTP {|Number f_sub, Agent B, Nonce L, Key K, sub_K|} \<in> set evs"
 | 
| 318 | apply clarify | |
| 319 | apply (erule rev_mp) | |
| 320 | apply (erule zg.induct) | |
| 321 | apply (frule_tac [5] ZG2_msg_in_parts_spies, simp_all) | |
| 322 | txt{*ZG4*}
 | |
| 15047 | 323 | apply clarify | 
| 15068 
58d216b32199
minor tweaks to go with the new version of the Accountability paper
 paulson parents: 
15047diff
changeset | 324 | apply (rule sub_K_validity, auto) | 
| 14741 | 325 | done | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 326 | |
| 14736 
7104394df99a
broken no longer includes TTP, and other minor changes
 paulson parents: 
14207diff
changeset | 327 | text{*If @{term con_K} exists, then @{term A} sent @{term sub_K}.  We again
 | 
| 
7104394df99a
broken no longer includes TTP, and other minor changes
 paulson parents: 
14207diff
changeset | 328 |    assume that @{term A} is not broken. *}
 | 
| 15068 
58d216b32199
minor tweaks to go with the new version of the Accountability paper
 paulson parents: 
15047diff
changeset | 329 | theorem B_sub_K_validity: | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 330 | "[|con_K \<in> used evs; | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 331 |         con_K = Crypt (priK TTP) {|Number f_con, Agent A, Agent B,
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 332 | Nonce L, Key K|}; | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 333 |         sub_K = Crypt (priK A) {|Number f_sub, Agent B, Nonce L, Key K|};
 | 
| 14741 | 334 | A \<notin> broken; evs \<in> zg|] | 
| 335 |      ==> Says A TTP {|Number f_sub, Agent B, Nonce L, Key K, sub_K|} \<in> set evs"
 | |
| 15068 
58d216b32199
minor tweaks to go with the new version of the Accountability paper
 paulson parents: 
15047diff
changeset | 336 | by (blast dest: con_K_validity Notes_TTP_imp_Says_A) | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 337 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 338 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 339 | subsection{*Proving fairness*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 340 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 341 | text{*Cannot prove that, if @{term B} has NRO, then  @{term A} has her NRR.
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 342 | It would appear that @{term B} has a small advantage, though it is
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 343 | useless to win disputes: @{term B} needs to present @{term con_K} as well.*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 344 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 345 | text{*Strange: unicity of the label protects @{term A}?*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 346 | lemma A_unicity: | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 347 |      "[|NRO = Crypt (priK A) {|Number f_nro, Agent B, Nonce L, Crypt K M|};
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 348 | NRO \<in> parts (spies evs); | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 349 |         Says A B {|Number f_nro, Agent B, Nonce L, Crypt K M', NRO'|}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 350 | \<in> set evs; | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 351 | A \<notin> bad; evs \<in> zg |] | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 352 | ==> M'=M" | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 353 | apply clarify | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 354 | apply (erule rev_mp) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 355 | apply (erule rev_mp) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 356 | apply (erule zg.induct) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 357 | apply (frule_tac [5] ZG2_msg_in_parts_spies, auto) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 358 | txt{*ZG1: freshness*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 359 | apply (blast dest: parts.Body) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 360 | done | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 361 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 362 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 363 | text{*Fairness lemma: if @{term sub_K} exists, then @{term A} holds 
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 364 | NRR. Relies on unicity of labels.*} | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 365 | lemma sub_K_implies_NRR: | 
| 14741 | 366 |      "[| NRO = Crypt (priK A) {|Number f_nro, Agent B, Nonce L, Crypt K M|};
 | 
| 367 |          NRR = Crypt (priK B) {|Number f_nrr, Agent A, Nonce L, Crypt K M|};
 | |
| 368 | sub_K \<in> parts (spies evs); | |
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 369 | NRO \<in> parts (spies evs); | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 370 |          sub_K = Crypt (priK A) {|Number f_sub, Agent B, Nonce L, Key K|};
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 371 | A \<notin> bad; evs \<in> zg |] | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 372 |      ==> Gets A {|Number f_nrr, Agent A, Nonce L, NRR|} \<in> set evs"
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 373 | apply clarify | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 374 | apply (erule rev_mp) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 375 | apply (erule rev_mp) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 376 | apply (erule zg.induct) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 377 | apply (frule_tac [5] ZG2_msg_in_parts_spies, simp_all) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 378 | txt{*Fake*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 379 | apply blast | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 380 | txt{*ZG1: freshness*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 381 | apply (blast dest: parts.Body) | 
| 14741 | 382 | txt{*ZG3*} 
 | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 383 | apply (blast dest: A_unicity [OF refl]) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 384 | done | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 385 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 386 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 387 | lemma Crypt_used_imp_L_used: | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 388 |      "[| Crypt (priK TTP) {|F, A, B, L, K|} \<in> used evs; evs \<in> zg |]
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 389 | ==> L \<in> used evs" | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 390 | apply (erule rev_mp) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 391 | apply (erule zg.induct, auto) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 392 | txt{*Fake*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 393 | apply (blast dest!: Fake_parts_sing_imp_Un) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 394 | txt{*ZG2: freshness*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 395 | apply (blast dest: parts.Body) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 396 | done | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 397 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 398 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 399 | text{*Fairness for @{term A}: if @{term con_K} and @{term NRO} exist, 
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 400 | then @{term A} holds NRR.  @{term A} must be uncompromised, but there is no
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 401 | assumption about @{term B}.*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 402 | theorem A_fairness_NRO: | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 403 | "[|con_K \<in> used evs; | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 404 | NRO \<in> parts (spies evs); | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 405 | con_K = Crypt (priK TTP) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 406 |                       {|Number f_con, Agent A, Agent B, Nonce L, Key K|};
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 407 |         NRO = Crypt (priK A) {|Number f_nro, Agent B, Nonce L, Crypt K M|};
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 408 |         NRR = Crypt (priK B) {|Number f_nrr, Agent A, Nonce L, Crypt K M|};
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 409 | A \<notin> bad; evs \<in> zg |] | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 410 |     ==> Gets A {|Number f_nrr, Agent A, Nonce L, NRR|} \<in> set evs"
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 411 | apply clarify | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 412 | apply (erule rev_mp) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 413 | apply (erule rev_mp) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 414 | apply (erule zg.induct) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 415 | apply (frule_tac [5] ZG2_msg_in_parts_spies, simp_all) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 416 |    txt{*Fake*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 417 | apply (simp add: parts_insert_knows_A) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 418 | apply (blast dest: Fake_parts_sing_imp_Un) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 419 |   txt{*ZG1*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 420 | apply (blast dest: Crypt_used_imp_L_used) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 421 |  txt{*ZG2*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 422 | apply (blast dest: parts_cut) | 
| 14741 | 423 | txt{*ZG4*} 
 | 
| 424 | apply (blast intro: sub_K_implies_NRR [OF refl] | |
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 425 | dest: Gets_imp_knows_Spy [THEN parts.Inj]) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 426 | done | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 427 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 428 | text{*Fairness for @{term B}: NRR exists at all, then @{term B} holds NRO.
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 429 | @{term B} must be uncompromised, but there is no assumption about @{term
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 430 | A}. *} | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 431 | theorem B_fairness_NRR: | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 432 | "[|NRR \<in> used evs; | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 433 |         NRR = Crypt (priK B) {|Number f_nrr, Agent A, Nonce L, C|};
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 434 |         NRO = Crypt (priK A) {|Number f_nro, Agent B, Nonce L, C|};
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 435 | B \<notin> bad; evs \<in> zg |] | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 436 |     ==> Gets B {|Number f_nro, Agent B, Nonce L, C, NRO|} \<in> set evs"
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 437 | apply clarify | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 438 | apply (erule rev_mp) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 439 | apply (erule zg.induct) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 440 | apply (frule_tac [5] ZG2_msg_in_parts_spies, simp_all) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 441 | txt{*Fake*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 442 | apply (blast dest!: Fake_parts_sing_imp_Un) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 443 | txt{*ZG2*}
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 444 | apply (blast dest: parts_cut) | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 445 | done | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 446 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 447 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 448 | text{*If @{term con_K} exists at all, then @{term B} can get it, by @{text
 | 
| 15068 
58d216b32199
minor tweaks to go with the new version of the Accountability paper
 paulson parents: 
15047diff
changeset | 449 | con_K_validity}.  Cannot conclude that also NRO is available to @{term B},
 | 
| 14145 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 450 | because if @{term A} were unfair, @{term A} could build message 3 without
 | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 451 | building message 1, which contains NRO. *} | 
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 452 | |
| 
2e31b8cc8788
ZhouGollmann: new example (fair non-repudiation protocol)
 paulson parents: diff
changeset | 453 | end |