(* Title: Doc/Tutorial/Protocol/Public.thy Author: Lawrence C Paulson, Cambridge University Computer Laboratory Copyright 1996 University of Cambridge Theory of Public Keys (common to all public-key protocols) Private and public keys; initial states of agents *) theory Public imports Event begin (*>*)
text‹ The function ‹pubK› m ‹priK› maps agents to their private keys. It is merely
an abbreviation (cf.\ \S\ref{sec:abbreviations}) defined in terms of ‹invKey›and‹pubK›. ›
(*Agents see their own private keys!*) lemma priK_in_initState[iff]: "Key (priK A) ∈ initState A" by (induct A) auto
(*All public keys are visible*) lemma spies_pubK[iff]: "Key (pubK A) ∈ spies evs" by (induct evs) (simp_all add: imageI knows_Cons split: event.split)
(*Spy sees private keys of bad agents!*) lemma Spy_spies_bad[intro!]: "A ∈ bad ==> Key (priK A) ∈ spies evs" by (induct evs) (simp_all add: imageI knows_Cons split: event.split)
lemmas [iff] = spies_pubK [THEN analz.Inj]
(*** Fresh nonces ***)
lemma Nonce_notin_initState[iff]: "Nonce N ∉ parts (initState B)" by (induct B) auto
lemma Nonce_notin_used_empty[simp]: "Nonce N ∉ used []" by (simp add: used_Nil)
(*** Supply fresh nonces for possibility theorems. ***)
(*In any trace, there is an upper bound N on the greatest nonce in use.*) lemma Nonce_supply_lemma: "∃N. ∀n. N≤n ⟶ Nonce n ∉ used evs" apply (induct_tac "evs") apply (rule_tac x = 0 in exI) apply (simp_all (no_asm_simp) add: used_Cons split: event.split) apply safe apply (rule msg_Nonce_supply [THEN exE], blast elim!: add_leE)+ done
lemma Nonce_supply1: "∃N. Nonce N ∉ used evs" by (rule Nonce_supply_lemma [THEN exE], blast)
lemma Nonce_supply: "Nonce (SOME N. Nonce N ∉ used evs) ∉ used evs" apply (rule Nonce_supply_lemma [THEN exE]) apply (rule someI, fast) done
(*** Specialized rewriting for the analz_image_... theorems ***)
lemma insert_Key_singleton: "insert (Key K) H = Key ` {K} ∪ H" by blast
lemma insert_Key_image: "insert (Key K) (Key`KK ∪ C) = Key ` (insert K KK) ∪ C" by blast
(*Specialized methods*)
(*Tactic for possibility theorems*)
ML ‹ fun possibility_tac ctxt = REPEAT (*omit used_Says so that Nonces start from different traces!*)
(ALLGOALS (simp_tac (ctxt delsimps [used_Says])) THEN
REPEAT_FIRST (eq_assume_tac ORELSE'
resolve_tac ctxt [refl, conjI, @{thm Nonce_supply}])); ›
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.