(* Title: HOL/Auth/Guard/Guard_NS_Public.thy Author: Frederic Blanqui, University of Cambridge Computer Laboratory Copyright 2002 University of Cambridge
Incorporating Lowe's fix (inclusion of B's identity in round 2).
*)
subsection\<open>messages used in the protocol\<close>
abbreviation (input)
ns1 :: "agent => agent => nat => event"where "ns1 A B NA == Says A B (Crypt (pubK B) \Nonce NA, Agent A\)"
abbreviation (input)
ns1' :: "agent => agent => agent => nat => event" where "ns1' A' A B NA == Says A' B (Crypt (pubK B) \Nonce NA, Agent A\)"
abbreviation (input)
ns2 :: "agent => agent => nat => nat => event"where "ns2 B A NA NB == Says B A (Crypt (pubK A) \Nonce NA, Nonce NB, Agent B\)"
abbreviation (input)
ns2' :: "agent => agent => agent => nat => nat => event" where "ns2' B' B A NA NB == Says B' A (Crypt (pubK A) \Nonce NA, Nonce NB, Agent B\)"
abbreviation (input)
ns3 :: "agent => agent => nat => event"where "ns3 A B NB == Says A B (Crypt (pubK B) (Nonce NB))"
subsection\<open>definition of the protocol\<close>
inductive_set nsp :: "event list set" where
Nil: "[] \ nsp"
| Fake: "\evs \ nsp; X \ synth (analz (spies evs))\ \ Says Spy B X # evs \ nsp"
| NS1: "\evs1 \ nsp; Nonce NA \ used evs1\ \ ns1 A B NA # evs1 \ nsp"
| NS2: "\evs2 \ nsp; Nonce NB \ used evs2; ns1' A' A B NA \ set evs2\ \
ns2 B A NA NB # evs2 \<in> nsp"
| NS3: "\A B B' NA NB evs3. \evs3 \ nsp; ns1 A B NA \ set evs3; ns2' B' B A NA NB \ set evs3\ \
ns3 A B NB # evs3 \<in> nsp"
lemma ns1_imp_Guard [rule_format]: "\evs \ nsp; A \ bad; B \ bad\ \
ns1 A B NA \<in> set evs \<longrightarrow> Guard NA {priK A,priK B} (spies evs)" apply (erule nsp.induct) (* Nil *) apply simp_all (* Fake *) apply safe apply (erule in_synth_Guard, erule Guard_analz, simp) (* NS1 *) apply blast apply blast apply blast apply (drule Nonce_neq, simp+, rule No_Nonce, simp) (* NS2 *) apply (frule_tac A=A in Nonce_neq, simp+) apply (case_tac "NAa=NA") apply (drule Guard_Nonce_analz, simp+) apply (drule Says_imp_knows_Spy)+ apply (drule_tac B=B and A'=Aa in NA_is_uniq, auto) (* NS3 *) apply (case_tac "NB=NA", clarify) apply (drule Guard_Nonce_analz, simp+) apply (drule Says_imp_knows_Spy)+ by (drule no_Nonce_NS1_NS2, auto)
subsection\<open>guardedness of NB\<close>
lemma ns2_imp_Guard [rule_format]: "\evs \ nsp; A \ bad; B \ bad\ \
ns2 B A NA NB \<in> set evs \<longrightarrow> Guard NB {priK A,priK B} (spies evs)" apply (erule nsp.induct) (* Nil *) apply simp_all (* Fake *) apply safe apply (erule in_synth_Guard, erule Guard_analz, simp) (* NS1 *) apply (frule Nonce_neq, simp+, blast, rule No_Nonce, simp) (* NS2 *) apply blast apply blast apply blast apply (frule_tac A=B and n=NB in Nonce_neq, simp+) apply (case_tac "NAa=NB") apply (drule Guard_Nonce_analz, simp+) apply (drule Says_imp_knows_Spy)+ apply (drule no_Nonce_NS1_NS2, auto) (* NS3 *) apply (case_tac "NBa=NB", clarify) apply (drule Guard_Nonce_analz, simp+) apply (drule Says_imp_knows_Spy)+ apply (drule_tac A=Aa and A'=A in NB_is_uniq) apply auto[1] apply (auto simp add: guard.No_Nonce) done
subsection\<open>Agents' Authentication\<close>
lemma B_trusts_NS1: "\evs \ nsp; A \ bad; B \ bad\ \
Crypt (pubK B) \<lbrace>Nonce NA, Agent A\<rbrace> \<in> parts (spies evs) \<longrightarrow> Nonce NA \<notin> analz (spies evs) \<longrightarrow> ns1 A B NA \<in> set evs" apply (erule nsp.induct, simp_all) by (blast intro: analz_insertI)+
lemma A_trusts_NS2: "\evs \ nsp; A \ bad; B \ bad\ \ ns1 A B NA \ set evs \<longrightarrow> Crypt (pubK A) \<lbrace>Nonce NA, Nonce NB, Agent B\<rbrace> \<in> parts (spies evs) \<longrightarrow> ns2 B A NA NB \<in> set evs" apply (erule nsp.induct, simp_all, safe) apply (frule_tac B=B in ns1_imp_Guard, simp+) apply (drule Guard_Nonce_analz, simp+, blast) apply (frule_tac B=B in ns1_imp_Guard, simp+) apply (drule Guard_Nonce_analz, simp+, blast) apply (frule_tac B=B in ns1_imp_Guard, simp+) by (drule Guard_Nonce_analz, simp+, blast+)
lemma B_trusts_NS3: "\evs \ nsp; A \ bad; B \ bad\ \ ns2 B A NA NB \ set evs \<longrightarrow> Crypt (pubK B) (Nonce NB) \<in> parts (spies evs) \<longrightarrow> ns3 A B NB \<in> set evs" apply (erule nsp.induct, simp_all, safe) apply (frule_tac B=B in ns2_imp_Guard, simp+) apply (drule Guard_Nonce_analz, simp+, blast) apply (frule_tac B=B in ns2_imp_Guard, simp+) apply (drule Guard_Nonce_analz, simp+, blast) apply (frule_tac B=B in ns2_imp_Guard, simp+) apply (drule Guard_Nonce_analz, simp+, blast, blast) apply (frule_tac B=B in ns2_imp_Guard, simp+) by (drule Guard_Nonce_analz, auto dest: Says_imp_knows_Spy NB_is_uniq)
end
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet)
¤
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 ist noch experimentell.