(* Title: HOL/Auth/ZhouGollmann.thy Author: Giampaolo Bella and L C Paulson, Cambridge Univ Computer Lab Copyright 2003 University of Cambridge The protocol of Jianying Zhou and Dieter Gollmann, A Fair Non-Repudiation Protocol, Security and Privacy 1996 (Oakland) 55-61 *)
definition broken :: "agent set"where ๐โนthe compromised honest agents; TTP is included as it's not allowed to use the protocolโบ "broken == bad - {Spy}"
declare broken_def [simp]
inductive_set zg :: "event list set" where
Nil: "[] โ zg"
| Fake: "[evsf โ zg; X โ synth (analz (spies evsf))] ==> Says Spy B X # evsf โ zg"
| Reception: "[evsr โ zg; Says A B X โ set evsr]==> Gets B X # evsr โ zg"
(*L is fresh for honest agents. We don't require K to be fresh because we don't bother to prove secrecy! We just assume that the protocol's objective is to deliver K fairly, rather than to keep M secret.*)
| ZG1: "[evs1 โ zg; Nonce L โ used evs1; C = Crypt K (Number m); K โ symKeys; NRO = Crypt (priK A) {Number f_nro, Agent B, Nonce L, C}] ==> Says A B {Number f_nro, Agent B, Nonce L, C, NRO} # evs1 โ zg"
(*B must check that NRO is A's signature to learn the sender's name*)
| ZG2: "[evs2 โ zg; Gets B {Number f_nro, Agent B, Nonce L, C, NRO}โ set evs2; NRO = Crypt (priK A) {Number f_nro, Agent B, Nonce L, C}; NRR = Crypt (priK B) {Number f_nrr, Agent A, Nonce L, C}] ==> Says B A {Number f_nrr, Agent A, Nonce L, NRR} # evs2 โ zg"
(*A must check that NRR is B's signature to learn the sender's name; without spy, the matching label would be enough*)
| ZG3: "[evs3 โ zg; C = Crypt K M; K โ symKeys; Says A B {Number f_nro, Agent B, Nonce L, C, NRO}โ set evs3; Gets A {Number f_nrr, Agent A, Nonce L, NRR}โ set evs3; NRR = Crypt (priK B) {Number f_nrr, Agent A, Nonce L, C}; sub_K = Crypt (priK A) {Number f_sub, Agent B, Nonce L, Key K}] ==> Says A TTP {Number f_sub, Agent B, Nonce L, Key K, sub_K} # evs3 โ zg"
(*TTP checks that sub_K is A's signature to learn who issued K, then gives credentials to A and B. The Notes event models the availability of the credentials, but the act of fetching them is not modelled. We also give con_K to the Spy. This makes the threat model more dangerous, while also allowing lemma @{text Crypt_used_imp_spies} to omit the condition @{term "K \<noteq> priK TTP"}. *)
| ZG4: "[evs4 โ zg; K โ symKeys; Gets TTP {Number f_sub, Agent B, Nonce L, Key K, sub_K} โ set evs4; sub_K = Crypt (priK A) {Number f_sub, Agent B, Nonce L, Key K}; con_K = Crypt (priK TTP) {Number f_con, Agent A, Agent B, Nonce L, Key K}] ==> Says TTP Spy con_K # Notes TTP {Number f_con, Agent A, Agent B, Nonce L, Key K, con_K} # evs4 โ zg"
textโนA "possibility property": there are traces that reach the endโบ lemma"[A โ B; TTP โ A; TTP โ B; K โ symKeys]==> โL. โevs โ zg. Notes TTP {Number f_con, Agent A, Agent B, Nonce L, Key K, Crypt (priK TTP) {Number f_con, Agent A, Agent B, Nonce L, Key K}} โ set evs" apply (intro exI bexI) apply (rule_tac [2] zg.Nil
[THEN zg.ZG1, THEN zg.Reception [of _ A B], THEN zg.ZG2, THEN zg.Reception [of _ B A], THEN zg.ZG3, THEN zg.Reception [of _ A TTP], THEN zg.ZG4]) apply (basic_possibility, auto) done
subsectionโนBasic Lemmasโบ
lemma Gets_imp_Says: "[Gets B X โ set evs; evs โ zg]==>โA. Says A B X โ set evs" apply (erule rev_mp) apply (erule zg.induct, auto) done
lemma Gets_imp_knows_Spy: "[Gets B X โ set evs; evs โ zg]==> X โ spies evs" by (blast dest!: Gets_imp_Says Says_imp_knows_Spy)
textโนLets us replace proofs about ๐โนused evsโบby simpler proofs about ๐โนparts (spies evs)โบ.โบ lemma Crypt_used_imp_spies: "[Crypt K X โ used evs; evs โ zg] ==> Crypt K X โ parts (spies evs)" apply (erule rev_mp) apply (erule zg.induct) apply (simp_all add: parts_insert_knows_A) done
textโนFor reasoning about C, which is encrypted in message ZG2โบ lemma ZG2_msg_in_parts_spies: "[Gets B {F, B', L, C, X}โ set evs; evs โ zg] ==> C โ parts (spies evs)" by (blast dest: Gets_imp_Says)
(*classical regularity lemma on priK*) lemma Spy_see_priK [simp]: "evs โ zg ==> (Key (priK A) โ parts (spies evs)) = (A โ bad)" apply (erule zg.induct) apply (frule_tac [5] ZG2_msg_in_parts_spies, auto) done
textโนSo that blast can use it tooโบ declare Spy_see_priK [THEN [2] rev_iffD1, dest!]
lemma Spy_analz_priK [simp]: "evs โ zg ==> (Key (priK A) โ analz (spies evs)) = (A โ bad)" by auto
subsectionโนAbout NRO: Validity for ๐โนBโบ\ textโนBelow we prove that if ๐โนNROโบexists then ๐โนAโบdefinitely sent it, provided ๐โนAโบis not broken.โบ
textโนStrong conclusion for a good agentโบ lemma NRO_validity_good: "[NRO = Crypt (priK A) {Number f_nro, Agent B, Nonce L, C}; NRO โ parts (spies evs); A โ bad; evs โ zg] ==> Says A B {Number f_nro, Agent B, Nonce L, C, NRO}โ set evs" apply clarify apply (erule rev_mp) apply (erule zg.induct) apply (frule_tac [5] ZG2_msg_in_parts_spies, auto) done
lemma NRO_sender: "[Says A' B {n, b, l, C, Crypt (priK A) X}โ set evs; evs โ zg] ==> A' โ {A,Spy}" apply (erule rev_mp) apply (erule zg.induct, simp_all) done
textโนHolds also for ๐โนA = Spyโบ!โบ theorem NRO_validity: "[Gets B {Number f_nro, Agent B, Nonce L, C, NRO}โ set evs; NRO = Crypt (priK A) {Number f_nro, Agent B, Nonce L, C}; A โ broken; evs โ zg] ==> Says A B {Number f_nro, Agent B, Nonce L, C, NRO}โ set evs" apply (drule Gets_imp_Says, assumption) apply clarify apply (frule NRO_sender, auto) txtโนWe are left with the case where the sender is ๐โนSpyโบand not equal to ๐โนAโบ, because ๐โนA โ badโบ. Thus theorem โนNRO_validity_goodโบapplies.โบ apply (blast dest: NRO_validity_good [OF refl]) done
subsectionโนAbout NRR: Validity for ๐โนAโบ\โบ
textโนBelow we prove that if ๐โนNRRโบexists then ๐โนBโบ definitely sent it, provided ๐โนBโบis not broken.โบ
textโนStrong conclusion for a good agentโบ lemma NRR_validity_good: "[NRR = Crypt (priK B) {Number f_nrr, Agent A, Nonce L, C}; NRR โ parts (spies evs); B โ bad; evs โ zg] ==> Says B A {Number f_nrr, Agent A, Nonce L, NRR}โ set evs" apply clarify apply (erule rev_mp) apply (erule zg.induct) apply (frule_tac [5] ZG2_msg_in_parts_spies, auto) done
lemma NRR_sender: "[Says B' A {n, a, l, Crypt (priK B) X}โ set evs; evs โ zg] ==> B' โ {B,Spy}" apply (erule rev_mp) apply (erule zg.induct, simp_all) done
textโนHolds also for ๐โนB = Spyโบ!โบ theorem NRR_validity: "[Says B' A {Number f_nrr, Agent A, Nonce L, NRR}โ set evs; NRR = Crypt (priK B) {Number f_nrr, Agent A, Nonce L, C}; B โ broken; evs โ zg] ==> Says B A {Number f_nrr, Agent A, Nonce L, NRR}โ set evs" apply clarify apply (frule NRR_sender, auto) txtโนWe are left with the case where ๐โนB' = Spyโบand ๐โนB' โ Bโบ, i.e. ๐โนB โ badโบ, when we can apply โนNRR_validity_goodโบ.โบ apply (blast dest: NRR_validity_good [OF refl]) done
subsectionโนProofs About ๐โนsub_Kโบ\โบ
textโนBelow we prove that if ๐โนsub_Kโบexists then ๐โนAโบ definitely sent it, provided ๐โนAโบis not broken.โบ
textโนStrong conclusion for a good agentโบ lemma sub_K_validity_good: "[sub_K = Crypt (priK A) {Number f_sub, Agent B, Nonce L, Key K}; sub_K โ parts (spies evs); A โ bad; evs โ zg] ==> Says A TTP {Number f_sub, Agent B, Nonce L, Key K, sub_K}โ set evs" apply clarify apply (erule rev_mp) apply (erule zg.induct) apply (frule_tac [5] ZG2_msg_in_parts_spies, simp_all) txtโนFakeโบ apply (blast dest!: Fake_parts_sing_imp_Un) done
lemma sub_K_sender: "[Says A' TTP {n, b, l, k, Crypt (priK A) X}โ set evs; evs โ zg] ==> A' โ {A,Spy}" apply (erule rev_mp) apply (erule zg.induct, simp_all) done
textโนHolds also for ๐โนA = Spyโบ!โบ theorem sub_K_validity: "[Gets TTP {Number f_sub, Agent B, Nonce L, Key K, sub_K}โ set evs; sub_K = Crypt (priK A) {Number f_sub, Agent B, Nonce L, Key K}; A โ broken; evs โ zg] ==> Says A TTP {Number f_sub, Agent B, Nonce L, Key K, sub_K}โ set evs" apply (drule Gets_imp_Says, assumption) apply clarify apply (frule sub_K_sender, auto) txtโนWe are left with the case where the sender is ๐โนSpyโบand not equal to ๐โนAโบ, because ๐โนA โ badโบ. Thus theorem โนsub_K_validity_goodโบapplies.โบ apply (blast dest: sub_K_validity_good [OF refl]) done
subsectionโนProofs About ๐โนcon_Kโบ\โบ
textโนBelow we prove that if ๐โนcon_Kโบexists, then ๐โนTTPโบ has it, and therefore ๐โนAโบand ๐โนBโบ) can get it too. Moreover, we know that ๐โนAโบsent ๐โนsub_Kโบ\โบ
textโนIf ๐โนTTPโบholds ๐โนcon_Kโบ then ๐โนAโบ sent ๐โนsub_Kโบ. We assume that ๐โนAโบ is not broken. Importantly, nothing needs to be assumed about the form of ๐โนcon_Kโบ!โบ lemma Notes_TTP_imp_Says_A: "[Notes TTP {Number f_con, Agent A, Agent B, Nonce L, Key K, con_K} โ set evs; sub_K = Crypt (priK A) {Number f_sub, Agent B, Nonce L, Key K}; A โ broken; evs โ zg] ==> Says A TTP {Number f_sub, Agent B, Nonce L, Key K, sub_K}โ set evs" apply clarify apply (erule rev_mp) apply (erule zg.induct) apply (frule_tac [5] ZG2_msg_in_parts_spies, simp_all) txtโนZG4โบ apply clarify apply (rule sub_K_validity, auto) done
textโนIf ๐โนcon_Kโบexists, then ๐โนAโบ sent ๐โนsub_Kโบ. We again assume that ๐โนAโบis not broken.โบ theorem B_sub_K_validity: "[con_K โ used evs; con_K = Crypt (priK TTP) {Number f_con, Agent A, Agent B, Nonce L, Key K}; sub_K = Crypt (priK A) {Number f_sub, Agent B, Nonce L, Key K}; A โ broken; evs โ zg] ==> Says A TTP {Number f_sub, Agent B, Nonce L, Key K, sub_K}โ set evs" by (blast dest: con_K_validity Notes_TTP_imp_Says_A)
subsectionโนProving fairnessโบ
textโนCannot prove that, if ๐โนBโบhas NRO, then ๐โนAโบ has her NRR. It would appear that ๐โนBโบhas a small advantage, though it is useless to win disputes: ๐โนBโบneeds to present ๐โนcon_Kโบ as well.โบ
textโนStrange: unicity of the label protects ๐โนAโบ?โบ lemma A_unicity: "[NRO = Crypt (priK A) {Number f_nro, Agent B, Nonce L, Crypt K M}; NRO โ parts (spies evs); Says A B {Number f_nro, Agent B, Nonce L, Crypt K M', NRO'} โ set evs; A โ bad; evs โ zg] ==> M'=M" apply clarify apply (erule rev_mp) apply (erule rev_mp) apply (erule zg.induct) apply (frule_tac [5] ZG2_msg_in_parts_spies, auto) txtโนZG1: freshnessโบ apply (blast dest: parts.Body) done
textโนFairness lemma: if ๐โนsub_Kโบexists, then ๐โนAโบ holds NRR. Relies on unicity of labels.โบ lemma sub_K_implies_NRR: "[NRO = Crypt (priK A) {Number f_nro, Agent B, Nonce L, Crypt K M}; NRR = Crypt (priK B) {Number f_nrr, Agent A, Nonce L, Crypt K M}; sub_K โ parts (spies evs); NRO โ parts (spies evs); sub_K = Crypt (priK A) {Number f_sub, Agent B, Nonce L, Key K}; A โ bad; evs โ zg] ==> Gets A {Number f_nrr, Agent A, Nonce L, NRR}โ set evs" apply clarify apply hypsubst_thin apply (erule rev_mp) apply (erule rev_mp) apply (erule zg.induct) apply (frule_tac [5] ZG2_msg_in_parts_spies, simp_all) txtโนFakeโบ apply blast txtโนZG1: freshnessโบ apply (blast dest: parts.Body) txtโนZG3โบ apply (blast dest: A_unicity [OF refl]) done
lemma Crypt_used_imp_L_used: "[Crypt (priK TTP) {F, A, B, L, K}โ used evs; evs โ zg] ==> L โ used evs" apply (erule rev_mp) apply (erule zg.induct, auto) txtโนFakeโบ apply (blast dest!: Fake_parts_sing_imp_Un) txtโนZG2: freshnessโบ apply (blast dest: parts.Body) done
textโนFairness for ๐โนAโบ: if ๐โนcon_Kโบ and ๐โนNROโบ exist, then ๐โนAโบholds NRR. ๐โนAโบ must be uncompromised, but there is no assumption about ๐โนBโบ.โบ theorem A_fairness_NRO: "[con_K โ used evs; NRO โ parts (spies evs); con_K = Crypt (priK TTP) {Number f_con, Agent A, Agent B, Nonce L, Key K}; NRO = Crypt (priK A) {Number f_nro, Agent B, Nonce L, Crypt K M}; NRR = Crypt (priK B) {Number f_nrr, Agent A, Nonce L, Crypt K M}; A โ bad; evs โ zg] ==> Gets A {Number f_nrr, Agent A, Nonce L, NRR}โ set evs" apply clarify apply (erule rev_mp) apply (erule rev_mp) apply (erule zg.induct) apply (frule_tac [5] ZG2_msg_in_parts_spies, simp_all) txtโนFakeโบ apply (simp add: parts_insert_knows_A) apply (blast dest: Fake_parts_sing_imp_Un) txtโนZG1โบ apply (blast dest: Crypt_used_imp_L_used) txtโนZG2โบ apply (blast dest: parts_cut) txtโนZG4โบ apply (blast intro: sub_K_implies_NRR [OF refl]
dest: Gets_imp_knows_Spy [THEN parts.Inj]) done
textโนFairness for ๐โนBโบ: NRR exists at all, then ๐โนBโบ holds NRO. ๐โนBโบmust be uncompromised, but there is no assumption about ๐โนAโบ.โบ theorem B_fairness_NRR: "[NRR โ used evs; NRR = Crypt (priK B) {Number f_nrr, Agent A, Nonce L, C}; NRO = Crypt (priK A) {Number f_nro, Agent B, Nonce L, C}; B โ bad; evs โ zg] ==> Gets B {Number f_nro, Agent B, Nonce L, C, NRO}โ set evs" apply clarify apply (erule rev_mp) apply (erule zg.induct) apply (frule_tac [5] ZG2_msg_in_parts_spies, simp_all) txtโนFakeโบ apply (blast dest!: Fake_parts_sing_imp_Un) txtโนZG2โบ apply (blast dest: parts_cut) done
textโนIf ๐โนcon_Kโบexists at all, then ๐โนBโบ can get it, by โนcon_K_validityโบ. Cannot conclude that also NRO is available to ๐โนBโบ, because if ๐โนAโบwere unfair, ๐โนAโบ could build message 3 without building message 1, which contains NRO.โบ
end
Messung V0.5 in Prozent
ยค Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-04-28)
ยค
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfรคltig zusammengestellt. Es wird jedoch weder Vollstรคndigkeit, noch Richtigkeit,
noch Qualitรคt der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.