src/HOL/Auth/OtwayRees_AN.thy
changeset 67613 ce654b0e6d69
parent 67443 3abf6a722518
child 69597 ff784d5a5bfb
equal deleted inserted replaced
67610:4939494ed791 67613:ce654b0e6d69
   133      "[| Says Server B
   133      "[| Says Server B
   134             \<lbrace>Crypt (shrK A) \<lbrace>NA, Agent A, Agent B, Key K\<rbrace>,
   134             \<lbrace>Crypt (shrK A) \<lbrace>NA, Agent A, Agent B, Key K\<rbrace>,
   135               Crypt (shrK B) \<lbrace>NB, Agent A, Agent B, Key K\<rbrace>\<rbrace>
   135               Crypt (shrK B) \<lbrace>NB, Agent A, Agent B, Key K\<rbrace>\<rbrace>
   136            \<in> set evs;
   136            \<in> set evs;
   137          evs \<in> otway |]
   137          evs \<in> otway |]
   138       ==> K \<notin> range shrK & (\<exists>i. NA = Nonce i) & (\<exists>j. NB = Nonce j)"
   138       ==> K \<notin> range shrK \<and> (\<exists>i. NA = Nonce i) \<and> (\<exists>j. NB = Nonce j)"
   139 apply (erule rev_mp)
   139 apply (erule rev_mp)
   140 apply (erule otway.induct, auto)
   140 apply (erule otway.induct, auto)
   141 done
   141 done
   142 
   142 
   143 
   143 
   155 text\<open>Session keys are not used to encrypt other session keys\<close>
   155 text\<open>Session keys are not used to encrypt other session keys\<close>
   156 
   156 
   157 text\<open>The equality makes the induction hypothesis easier to apply\<close>
   157 text\<open>The equality makes the induction hypothesis easier to apply\<close>
   158 lemma analz_image_freshK [rule_format]:
   158 lemma analz_image_freshK [rule_format]:
   159  "evs \<in> otway ==>
   159  "evs \<in> otway ==>
   160    \<forall>K KK. KK <= -(range shrK) -->
   160    \<forall>K KK. KK \<subseteq> -(range shrK) \<longrightarrow>
   161           (Key K \<in> analz (Key`KK Un (knows Spy evs))) =
   161           (Key K \<in> analz (Key`KK \<union> (knows Spy evs))) =
   162           (K \<in> KK | Key K \<in> analz (knows Spy evs))"
   162           (K \<in> KK | Key K \<in> analz (knows Spy evs))"
   163 apply (erule otway.induct) 
   163 apply (erule otway.induct) 
   164 apply (frule_tac [8] Says_Server_message_form)
   164 apply (frule_tac [8] Says_Server_message_form)
   165 apply (drule_tac [7] OR4_analz_knows_Spy, analz_freshK, spy_analz, auto) 
   165 apply (drule_tac [7] OR4_analz_knows_Spy, analz_freshK, spy_analz, auto) 
   166 done
   166 done
   181         Says Server B'
   181         Says Server B'
   182           \<lbrace>Crypt (shrK A') \<lbrace>NA', Agent A', Agent B', K\<rbrace>,
   182           \<lbrace>Crypt (shrK A') \<lbrace>NA', Agent A', Agent B', K\<rbrace>,
   183             Crypt (shrK B') \<lbrace>NB', Agent A', Agent B', K\<rbrace>\<rbrace>
   183             Crypt (shrK B') \<lbrace>NB', Agent A', Agent B', K\<rbrace>\<rbrace>
   184          \<in> set evs;
   184          \<in> set evs;
   185         evs \<in> otway |]
   185         evs \<in> otway |]
   186      ==> A=A' & B=B' & NA=NA' & NB=NB'"
   186      ==> A=A' \<and> B=B' \<and> NA=NA' \<and> NB=NB'"
   187 apply (erule rev_mp, erule rev_mp, erule otway.induct, simp_all)
   187 apply (erule rev_mp, erule rev_mp, erule otway.induct, simp_all)
   188 apply blast+  \<comment> \<open>OR3 and OR4\<close>
   188 apply blast+  \<comment> \<open>OR3 and OR4\<close>
   189 done
   189 done
   190 
   190 
   191 
   191 
   193 
   193 
   194 text\<open>If the encrypted message appears then it originated with the Server!\<close>
   194 text\<open>If the encrypted message appears then it originated with the Server!\<close>
   195 lemma NA_Crypt_imp_Server_msg [rule_format]:
   195 lemma NA_Crypt_imp_Server_msg [rule_format]:
   196     "[| A \<notin> bad;  A \<noteq> B;  evs \<in> otway |]
   196     "[| A \<notin> bad;  A \<noteq> B;  evs \<in> otway |]
   197      ==> Crypt (shrK A) \<lbrace>NA, Agent A, Agent B, Key K\<rbrace> \<in> parts (knows Spy evs)
   197      ==> Crypt (shrK A) \<lbrace>NA, Agent A, Agent B, Key K\<rbrace> \<in> parts (knows Spy evs)
   198        --> (\<exists>NB. Says Server B
   198        \<longrightarrow> (\<exists>NB. Says Server B
   199                     \<lbrace>Crypt (shrK A) \<lbrace>NA, Agent A, Agent B, Key K\<rbrace>,
   199                     \<lbrace>Crypt (shrK A) \<lbrace>NA, Agent A, Agent B, Key K\<rbrace>,
   200                       Crypt (shrK B) \<lbrace>NB, Agent A, Agent B, Key K\<rbrace>\<rbrace>
   200                       Crypt (shrK B) \<lbrace>NB, Agent A, Agent B, Key K\<rbrace>\<rbrace>
   201                     \<in> set evs)"
   201                     \<in> set evs)"
   202 apply (erule otway.induct, force)
   202 apply (erule otway.induct, force)
   203 apply (simp_all add: ex_disj_distrib)
   203 apply (simp_all add: ex_disj_distrib)
   223 lemma secrecy_lemma:
   223 lemma secrecy_lemma:
   224      "[| A \<notin> bad;  B \<notin> bad;  evs \<in> otway |]
   224      "[| A \<notin> bad;  B \<notin> bad;  evs \<in> otway |]
   225       ==> Says Server B
   225       ==> Says Server B
   226            \<lbrace>Crypt (shrK A) \<lbrace>NA, Agent A, Agent B, Key K\<rbrace>,
   226            \<lbrace>Crypt (shrK A) \<lbrace>NA, Agent A, Agent B, Key K\<rbrace>,
   227              Crypt (shrK B) \<lbrace>NB, Agent A, Agent B, Key K\<rbrace>\<rbrace>
   227              Crypt (shrK B) \<lbrace>NB, Agent A, Agent B, Key K\<rbrace>\<rbrace>
   228           \<in> set evs -->
   228           \<in> set evs \<longrightarrow>
   229           Notes Spy \<lbrace>NA, NB, Key K\<rbrace> \<notin> set evs -->
   229           Notes Spy \<lbrace>NA, NB, Key K\<rbrace> \<notin> set evs \<longrightarrow>
   230           Key K \<notin> analz (knows Spy evs)"
   230           Key K \<notin> analz (knows Spy evs)"
   231 apply (erule otway.induct, force)
   231 apply (erule otway.induct, force)
   232 apply (frule_tac [7] Says_Server_message_form)
   232 apply (frule_tac [7] Says_Server_message_form)
   233 apply (drule_tac [6] OR4_analz_knows_Spy)
   233 apply (drule_tac [6] OR4_analz_knows_Spy)
   234 apply (simp_all add: analz_insert_eq analz_insert_freshK pushes)
   234 apply (simp_all add: analz_insert_eq analz_insert_freshK pushes)
   263 
   263 
   264 text\<open>If the encrypted message appears then it originated with the Server!\<close>
   264 text\<open>If the encrypted message appears then it originated with the Server!\<close>
   265 lemma NB_Crypt_imp_Server_msg [rule_format]:
   265 lemma NB_Crypt_imp_Server_msg [rule_format]:
   266  "[| B \<notin> bad;  A \<noteq> B;  evs \<in> otway |]
   266  "[| B \<notin> bad;  A \<noteq> B;  evs \<in> otway |]
   267   ==> Crypt (shrK B) \<lbrace>NB, Agent A, Agent B, Key K\<rbrace> \<in> parts (knows Spy evs)
   267   ==> Crypt (shrK B) \<lbrace>NB, Agent A, Agent B, Key K\<rbrace> \<in> parts (knows Spy evs)
   268       --> (\<exists>NA. Says Server B
   268       \<longrightarrow> (\<exists>NA. Says Server B
   269                    \<lbrace>Crypt (shrK A) \<lbrace>NA, Agent A, Agent B, Key K\<rbrace>,
   269                    \<lbrace>Crypt (shrK A) \<lbrace>NA, Agent A, Agent B, Key K\<rbrace>,
   270                      Crypt (shrK B) \<lbrace>NB, Agent A, Agent B, Key K\<rbrace>\<rbrace>
   270                      Crypt (shrK B) \<lbrace>NB, Agent A, Agent B, Key K\<rbrace>\<rbrace>
   271                    \<in> set evs)"
   271                    \<in> set evs)"
   272 apply (erule otway.induct, force, simp_all add: ex_disj_distrib)
   272 apply (erule otway.induct, force, simp_all add: ex_disj_distrib)
   273 apply blast+  \<comment> \<open>Fake, OR3\<close>
   273 apply blast+  \<comment> \<open>Fake, OR3\<close>