src/HOL/Auth/OtwayReesBella.thy
author paulson
Wed, 01 Feb 2006 15:22:02 +0100
changeset 18886 9f27383426db
child 20048 a7964311f1fb
permissions -rwxr-xr-x
new and updated protocol proofs by Giamp Bella
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     1
(*  ID:         $Id$
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     2
    Author:     Giampaolo Bella, Catania University
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     3
*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     4
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     5
header{*Bella's version of the Otway-Rees protocol*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     6
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     7
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     8
theory OtwayReesBella imports Public begin
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     9
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    10
text{*Bella's modifications to a version of the Otway-Rees protocol taken from
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    11
the BAN paper only concern message 7. The updated protocol makes the goal of
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    12
key distribution of the session key available to A. Investigating the
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    13
principle of Goal Availability undermines the BAN claim about the original
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    14
protocol, that "this protocol does not make use of Kab as an encryption key,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    15
so neither principal can know whether the key is known to the other". The
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    16
updated protocol makes no use of the session key to encrypt but informs A that
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    17
B knows it.*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    18
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    19
consts  orb   :: "event list set"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    20
inductive "orb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    21
 intros 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    22
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    23
  Nil:  "[]\<in> orb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    24
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    25
  Fake: "\<lbrakk>evsa\<in> orb;  X\<in> synth (analz (knows Spy evsa))\<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    26
 	 \<Longrightarrow> Says Spy B X  # evsa \<in> orb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    27
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    28
  Reception: "\<lbrakk>evsr\<in> orb;  Says A B X \<in> set evsr\<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    29
	      \<Longrightarrow> Gets B X # evsr \<in> orb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    30
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    31
  OR1:  "\<lbrakk>evs1\<in> orb;  Nonce NA \<notin> used evs1\<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    32
	 \<Longrightarrow> Says A B \<lbrace>Nonce M, Agent A, Agent B, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    33
		   Crypt (shrK A) \<lbrace>Nonce NA, Nonce M, Agent A, Agent B\<rbrace>\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    34
	       # evs1 \<in> orb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    35
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    36
  OR2:  "\<lbrakk>evs2\<in> orb;  Nonce NB \<notin> used evs2;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    37
	   Gets B \<lbrace>Nonce M, Agent A, Agent B, X\<rbrace> \<in> set evs2\<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    38
	\<Longrightarrow> Says B Server 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    39
		\<lbrace>Nonce M, Agent A, Agent B, X, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    40
	   Crypt (shrK B) \<lbrace>Nonce NB, Nonce M, Nonce M, Agent A, Agent B\<rbrace>\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    41
	       # evs2 \<in> orb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    42
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    43
  OR3:  "\<lbrakk>evs3\<in> orb;  Key KAB \<notin> used evs3;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    44
	  Gets Server 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    45
	     \<lbrace>Nonce M, Agent A, Agent B, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    46
	       Crypt (shrK A) \<lbrace>Nonce NA, Nonce M, Agent A, Agent B\<rbrace>, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    47
	       Crypt (shrK B) \<lbrace>Nonce NB, Nonce M, Nonce M, Agent A, Agent B\<rbrace>\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    48
	  \<in> set evs3\<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    49
	\<Longrightarrow> Says Server B \<lbrace>Nonce M,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    50
		    Crypt (shrK B) \<lbrace>Crypt (shrK A) \<lbrace>Nonce NA, Key KAB\<rbrace>,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    51
				      Nonce NB, Key KAB\<rbrace>\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    52
	       # evs3 \<in> orb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    53
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    54
  (*B can only check that the message he is bouncing is a ciphertext*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    55
  (*Sending M back is omitted*)   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    56
  OR4:  "\<lbrakk>evs4\<in> orb; B \<noteq> Server; \<forall> p q. X \<noteq> \<lbrace>p, q\<rbrace>; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    57
	  Says B Server \<lbrace>Nonce M, Agent A, Agent B, X', 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    58
		Crypt (shrK B) \<lbrace>Nonce NB, Nonce M, Nonce M, Agent A, Agent B\<rbrace>\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    59
	    \<in> set evs4;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    60
	  Gets B \<lbrace>Nonce M, Crypt (shrK B) \<lbrace>X, Nonce NB, Key KAB\<rbrace>\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    61
	    \<in> set evs4\<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    62
	\<Longrightarrow> Says B A \<lbrace>Nonce M, X\<rbrace> # evs4 \<in> orb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    63
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    64
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    65
  Oops: "\<lbrakk>evso\<in> orb;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    66
	   Says Server B \<lbrace>Nonce M,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    67
		    Crypt (shrK B) \<lbrace>Crypt (shrK A) \<lbrace>Nonce NA, Key KAB\<rbrace>,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    68
				      Nonce NB, Key KAB\<rbrace>\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    69
	     \<in> set evso\<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    70
 \<Longrightarrow> Notes Spy \<lbrace>Agent A, Agent B, Nonce NA, Nonce NB, Key KAB\<rbrace> # evso 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    71
     \<in> orb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    72
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    73
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    74
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    75
declare knows_Spy_partsEs [elim]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    76
declare analz_into_parts [dest]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    77
declare Fake_parts_insert_in_Un  [dest]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    78
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    79
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    80
text{*Fragile proof, with backtracking in the possibility call.*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    81
lemma possibility_thm: "\<lbrakk>A \<noteq> Server; B \<noteq> Server; Key K \<notin> used[]\<rbrakk>    
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    82
      \<Longrightarrow>   \<exists> evs \<in> orb.           
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    83
     Says B A \<lbrace>Nonce M, Crypt (shrK A) \<lbrace>Nonce Na, Key K\<rbrace>\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    84
apply (intro exI bexI)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    85
apply (rule_tac [2] orb.Nil
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    86
                    [THEN orb.OR1, THEN orb.Reception,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    87
                     THEN orb.OR2, THEN orb.Reception,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    88
                     THEN orb.OR3, THEN orb.Reception, THEN orb.OR4]) 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    89
apply (possibility, simp add: used_Cons)  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    90
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    91
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    92
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    93
lemma Gets_imp_Says :
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    94
     "\<lbrakk>Gets B X \<in> set evs; evs \<in> orb\<rbrakk> \<Longrightarrow> \<exists>A. Says A B X \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    95
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    96
apply (erule orb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    97
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    98
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    99
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   100
lemma Gets_imp_knows_Spy: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   101
     "\<lbrakk>Gets B X \<in> set evs; evs \<in> orb\<rbrakk>  \<Longrightarrow> X \<in> knows Spy evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   102
by (blast dest!: Gets_imp_Says Says_imp_knows_Spy)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   103
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   104
declare Gets_imp_knows_Spy [THEN parts.Inj, dest]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   105
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   106
lemma Gets_imp_knows:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   107
     "\<lbrakk>Gets B X \<in> set evs; evs \<in> orb\<rbrakk>  \<Longrightarrow> X \<in> knows B evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   108
apply (case_tac "B = Spy")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   109
apply (blast dest!: Gets_imp_knows_Spy)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   110
apply (blast dest!: Gets_imp_knows_agents)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   111
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   112
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   113
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   114
lemma OR2_analz_knows_Spy: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   115
   "\<lbrakk>Gets B \<lbrace>Nonce M, Agent A, Agent B, X\<rbrace> \<in> set evs; evs \<in> orb\<rbrakk>   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   116
    \<Longrightarrow> X \<in> analz (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   117
by (blast dest!: Gets_imp_knows_Spy [THEN analz.Inj])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   118
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   119
lemma OR4_parts_knows_Spy: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   120
   "\<lbrakk>Gets B \<lbrace>Nonce M, Crypt (shrK B) \<lbrace>X, Nonce Nb, Key Kab\<rbrace>\<rbrace>  \<in> set evs; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   121
      evs \<in> orb\<rbrakk>   \<Longrightarrow> X \<in> parts (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   122
by blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   123
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   124
lemma Oops_parts_knows_Spy: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   125
    "Says Server B \<lbrace>Nonce M, Crypt K' \<lbrace>X, Nonce Nb, K\<rbrace>\<rbrace> \<in> set evs  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   126
     \<Longrightarrow> K \<in> parts (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   127
by blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   128
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   129
lemmas OR2_parts_knows_Spy =
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   130
    OR2_analz_knows_Spy [THEN analz_into_parts, standard]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   131
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   132
ML
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   133
{*
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   134
val Oops_parts_knows_Spy = thm "Oops_parts_knows_Spy"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   135
val OR4_parts_knows_Spy = thm "OR4_parts_knows_Spy"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   136
val OR2_parts_knows_Spy = thm "OR2_parts_knows_Spy"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   137
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   138
fun parts_explicit_tac i = 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   139
    forward_tac [Oops_parts_knows_Spy] (i+7) THEN
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   140
    forward_tac [OR4_parts_knows_Spy]  (i+6) THEN
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   141
    forward_tac [OR2_parts_knows_Spy]  (i+4)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   142
*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   143
 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   144
method_setup parts_explicit = {*
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   145
    Method.ctxt_args (fn ctxt =>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   146
        Method.METHOD (fn facts =>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   147
            parts_explicit_tac 1)) *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   148
  "to explicitly state that some message components belong to parts knows Spy"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   149
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   150
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   151
lemma Spy_see_shrK [simp]: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   152
    "evs \<in> orb \<Longrightarrow> (Key (shrK A) \<in> parts (knows Spy evs)) = (A \<in> bad)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   153
by (erule orb.induct, parts_explicit, simp_all, blast+)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   154
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   155
lemma Spy_analz_shrK [simp]: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   156
"evs \<in> orb \<Longrightarrow> (Key (shrK A) \<in> analz (knows Spy evs)) = (A \<in> bad)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   157
by auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   158
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   159
lemma Spy_see_shrK_D [dest!]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   160
     "[|Key (shrK A) \<in> parts (knows Spy evs);  evs \<in> orb|] ==> A \<in> bad"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   161
by (blast dest: Spy_see_shrK)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   162
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   163
lemma new_keys_not_used [simp]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   164
   "\<lbrakk>Key K \<notin> used evs; K \<in> symKeys; evs \<in> orb\<rbrakk>  \<Longrightarrow> K \<notin> keysFor (parts (knows Spy evs))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   165
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   166
apply (erule orb.induct, parts_explicit, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   167
apply (force dest!: keysFor_parts_insert)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   168
apply (blast+)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   169
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   170
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   171
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   172
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   173
subsection{* Proofs involving analz *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   174
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   175
text{*Describes the form of K and NA when the Server sends this message.  Also
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   176
  for Oops case.*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   177
lemma Says_Server_message_form: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   178
"\<lbrakk>Says Server B  \<lbrace>Nonce M, Crypt (shrK B) \<lbrace>X, Nonce Nb, Key K\<rbrace>\<rbrace> \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   179
     evs \<in> orb\<rbrakk>                                            
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   180
 \<Longrightarrow> K \<notin> range shrK & (\<exists> A Na. X=(Crypt (shrK A) \<lbrace>Nonce Na, Key K\<rbrace>))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   181
by (erule rev_mp, erule orb.induct, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   182
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   183
lemma Says_Server_imp_Gets: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   184
 "\<lbrakk>Says Server B \<lbrace>Nonce M, Crypt (shrK B) \<lbrace>Crypt (shrK A) \<lbrace>Nonce Na, Key K\<rbrace>,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   185
                                             Nonce Nb, Key K\<rbrace>\<rbrace> \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   186
    evs \<in> orb\<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   187
  \<Longrightarrow>  Gets Server \<lbrace>Nonce M, Agent A, Agent B, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   188
                   Crypt (shrK A) \<lbrace>Nonce Na, Nonce M, Agent A, Agent B\<rbrace>, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   189
               Crypt (shrK B) \<lbrace>Nonce Nb, Nonce M, Nonce M, Agent A, Agent B\<rbrace>\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   190
         \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   191
by (erule rev_mp, erule orb.induct, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   192
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   193
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   194
lemma A_trusts_OR1: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   195
"\<lbrakk>Crypt (shrK A) \<lbrace>Nonce Na, Nonce M, Agent A, Agent B\<rbrace> \<in> parts (knows Spy evs);  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   196
    A \<notin> bad; evs \<in> orb\<rbrakk>                   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   197
 \<Longrightarrow> Says A B \<lbrace>Nonce M, Agent A, Agent B, Crypt (shrK A) \<lbrace>Nonce Na, Nonce M, Agent A, Agent B\<rbrace>\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   198
apply (erule rev_mp, erule orb.induct, parts_explicit, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   199
apply (blast)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   200
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   201
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   202
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   203
lemma B_trusts_OR2:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   204
 "\<lbrakk>Crypt (shrK B) \<lbrace>Nonce Nb, Nonce M, Nonce M, Agent A, Agent B\<rbrace>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   205
      \<in> parts (knows Spy evs);  B \<notin> bad; evs \<in> orb\<rbrakk>                   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   206
  \<Longrightarrow> (\<exists> X. Says B Server \<lbrace>Nonce M, Agent A, Agent B, X,  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   207
              Crypt (shrK B) \<lbrace>Nonce Nb, Nonce M, Nonce M, Agent A, Agent B\<rbrace>\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   208
          \<in> set evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   209
apply (erule rev_mp, erule orb.induct, parts_explicit, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   210
apply (blast+)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   211
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   212
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   213
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   214
lemma B_trusts_OR3: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   215
"\<lbrakk>Crypt (shrK B) \<lbrace>X, Nonce Nb, Key K\<rbrace> \<in> parts (knows Spy evs);  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   216
   B \<notin> bad; evs \<in> orb\<rbrakk>                   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   217
\<Longrightarrow> \<exists> M. Says Server B \<lbrace>Nonce M, Crypt (shrK B) \<lbrace>X, Nonce Nb, Key K\<rbrace>\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   218
         \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   219
apply (erule rev_mp, erule orb.induct, parts_explicit, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   220
apply (blast+)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   221
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   222
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   223
lemma Gets_Server_message_form: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   224
"\<lbrakk>Gets B \<lbrace>Nonce M, Crypt (shrK B) \<lbrace>X, Nonce Nb, Key K\<rbrace>\<rbrace> \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   225
    evs \<in> orb\<rbrakk>                                              
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   226
 \<Longrightarrow> (K \<notin> range shrK & (\<exists> A Na. X = (Crypt (shrK A) \<lbrace>Nonce Na, Key K\<rbrace>)))    
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   227
             | X \<in> analz (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   228
apply (case_tac "B \<in> bad")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   229
apply (drule Gets_imp_knows_Spy [THEN analz.Inj, THEN analz.Snd, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   230
                                 THEN analz.Decrypt, THEN analz.Fst])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   231
prefer 3 apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   232
prefer 3 apply (blast dest!: Gets_imp_knows_Spy [THEN parts.Inj, THEN 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   233
                                                 parts.Snd, THEN B_trusts_OR3]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   234
                             Says_Server_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   235
apply simp_all                                    
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   236
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   237
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   238
lemma unique_Na: "\<lbrakk>Says A B  \<lbrace>Nonce M, Agent A, Agent B, Crypt (shrK A) \<lbrace>Nonce Na, Nonce M, Agent A, Agent B\<rbrace>\<rbrace> \<in> set evs;   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   239
         Says A B' \<lbrace>Nonce M', Agent A, Agent B', Crypt (shrK A) \<lbrace>Nonce Na, Nonce M', Agent A, Agent B'\<rbrace>\<rbrace> \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   240
    A \<notin> bad; evs \<in> orb\<rbrakk> \<Longrightarrow> B=B' & M=M'"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   241
by (erule rev_mp, erule rev_mp, erule orb.induct, simp_all, blast+)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   242
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   243
lemma unique_Nb: "\<lbrakk>Says B Server \<lbrace>Nonce M, Agent A, Agent B, X, Crypt (shrK B) \<lbrace>Nonce Nb, Nonce M, Nonce M, Agent A, Agent B\<rbrace>\<rbrace> \<in> set evs;   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   244
         Says B Server \<lbrace>Nonce M', Agent A', Agent B, X', Crypt (shrK B) \<lbrace>Nonce Nb,Nonce M', Nonce M', Agent A', Agent B\<rbrace>\<rbrace> \<in> set evs;   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   245
    B \<notin> bad; evs \<in> orb\<rbrakk> \<Longrightarrow>   M=M' & A=A' & X=X'"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   246
by (erule rev_mp, erule rev_mp, erule orb.induct, simp_all, blast+)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   247
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   248
lemma analz_image_freshCryptK_lemma:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   249
"(Crypt K X \<in> analz (Key`nE \<union> H)) \<longrightarrow> (Crypt K X \<in> analz H) \<Longrightarrow>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   250
        (Crypt K X \<in> analz (Key`nE \<union> H)) = (Crypt K X \<in> analz H)";
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   251
by (blast intro: analz_mono [THEN [2] rev_subsetD])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   252
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   253
ML
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   254
{*
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   255
val analz_image_freshCryptK_lemma = thm "analz_image_freshCryptK_lemma";
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   256
val analz_image_freshK_simps = thms "analz_image_freshK_simps";
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   257
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   258
val analz_image_freshK_ss = 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   259
     simpset() delsimps [image_insert, image_Un]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   260
	       delsimps [imp_disjL]    (*reduces blow-up*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   261
	       addsimps thms "analz_image_freshK_simps"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   262
*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   263
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   264
method_setup analz_freshCryptK = {*
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   265
    Method.no_args
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   266
     (Method.METHOD
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   267
      (fn facts => EVERY [REPEAT_FIRST (resolve_tac [allI, ballI, impI]),
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   268
                          REPEAT_FIRST (rtac analz_image_freshCryptK_lemma),
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   269
                          ALLGOALS (asm_simp_tac analz_image_freshK_ss)])) *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   270
  "for proving useful rewrite rule"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   271
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   272
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   273
method_setup disentangle = {*
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   274
    Method.no_args
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   275
     (Method.METHOD
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   276
      (fn facts => REPEAT_FIRST (eresolve_tac [asm_rl, conjE, disjE] 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   277
                   ORELSE' hyp_subst_tac))) *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   278
  "for eliminating conjunctions, disjunctions and the like"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   279
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   280
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   281
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   282
lemma analz_image_freshCryptK [rule_format]: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   283
"evs \<in> orb \<Longrightarrow>                              
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   284
     Key K \<notin> analz (knows Spy evs) \<longrightarrow>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   285
       (\<forall> KK. KK \<subseteq> - (range shrK) \<longrightarrow>                  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   286
             (Crypt K X \<in> analz (Key`KK \<union> (knows Spy evs))) =   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   287
             (Crypt K X \<in> analz (knows Spy evs)))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   288
apply (erule orb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   289
apply (analz_mono_contra)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   290
apply (frule_tac [7] Gets_Server_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   291
apply (frule_tac [9] Says_Server_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   292
apply disentangle
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   293
apply (drule_tac [5] Gets_imp_knows_Spy [THEN analz.Inj, THEN analz.Snd, THEN analz.Snd, THEN  analz.Snd])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   294
prefer 8 apply clarify
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   295
apply (analz_freshCryptK, spy_analz, fastsimp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   296
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   297
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   298
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   299
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   300
lemma analz_insert_freshCryptK: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   301
"\<lbrakk>evs \<in> orb;  Key K \<notin> analz (knows Spy evs);  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   302
         Seskey \<notin> range shrK\<rbrakk> \<Longrightarrow>   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   303
         (Crypt K X \<in> analz (insert (Key Seskey) (knows Spy evs))) =  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   304
         (Crypt K X \<in> analz (knows Spy evs))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   305
by (simp only: analz_image_freshCryptK analz_image_freshK_simps)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   306
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   307
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   308
lemma analz_hard: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   309
"\<lbrakk>Says A B \<lbrace>Nonce M, Agent A, Agent B,  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   310
             Crypt (shrK A) \<lbrace>Nonce Na, Nonce M, Agent A, Agent B\<rbrace>\<rbrace> \<in>set evs; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   311
   Crypt (shrK A) \<lbrace>Nonce Na, Key K\<rbrace> \<in> analz (knows Spy evs);  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   312
   A \<notin> bad; B \<notin> bad; evs \<in> orb\<rbrakk>                   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   313
 \<Longrightarrow>  Says B A \<lbrace>Nonce M, Crypt (shrK A) \<lbrace>Nonce Na, Key K\<rbrace>\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   314
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   315
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   316
apply (erule orb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   317
apply (frule_tac [7] Gets_Server_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   318
apply (frule_tac [9] Says_Server_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   319
apply disentangle
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   320
txt{*letting the simplifier solve OR2*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   321
apply (drule_tac [5] Gets_imp_knows_Spy [THEN analz.Inj, THEN analz.Snd, THEN analz.Snd, THEN analz.Snd])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   322
apply (simp_all (no_asm_simp) add: analz_insert_eq pushes split_ifs)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   323
apply (spy_analz)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   324
txt{*OR1*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   325
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   326
txt{*Oops*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   327
prefer 4 apply (blast dest: analz_insert_freshCryptK)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   328
txt{*OR4 - ii*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   329
prefer 3 apply (blast)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   330
txt{*OR3*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   331
(*adding Gets_imp_ and Says_imp_ for efficiency*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   332
apply (blast dest: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   333
       A_trusts_OR1 unique_Na Key_not_used analz_insert_freshCryptK)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   334
txt{*OR4 - i *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   335
apply clarify
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   336
apply (simp add: pushes split_ifs)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   337
apply (case_tac "Aaa\<in>bad")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   338
apply (blast dest: analz_insert_freshCryptK)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   339
apply clarify
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   340
apply simp
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   341
apply (case_tac "Ba\<in>bad")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   342
apply (frule Gets_imp_knows_Spy [THEN analz.Inj, THEN analz.Snd, THEN analz.Decrypt, THEN analz.Fst] , assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   343
apply (simp (no_asm_simp))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   344
apply clarify
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   345
apply (frule Gets_imp_knows_Spy 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   346
             [THEN parts.Inj, THEN parts.Snd, THEN B_trusts_OR3],  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   347
       assumption, assumption, assumption, erule exE)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   348
apply (frule Says_Server_imp_Gets 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   349
            [THEN Gets_imp_knows_Spy, THEN parts.Inj, THEN parts.Snd, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   350
            THEN parts.Snd, THEN parts.Snd, THEN parts.Fst, THEN A_trusts_OR1],
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   351
       assumption, assumption, assumption, assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   352
apply (blast dest: Says_Server_imp_Gets B_trusts_OR2 unique_Na unique_Nb)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   353
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   354
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   355
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   356
lemma Gets_Server_message_form': 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   357
"\<lbrakk>Gets B \<lbrace>Nonce M, Crypt (shrK B) \<lbrace>X, Nonce Nb, Key K\<rbrace>\<rbrace>  \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   358
   B \<notin> bad; evs \<in> orb\<rbrakk>                              
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   359
  \<Longrightarrow> K \<notin> range shrK & (\<exists> A Na. X = (Crypt (shrK A) \<lbrace>Nonce Na, Key K\<rbrace>))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   360
by (blast dest!: B_trusts_OR3 Says_Server_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   361
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   362
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   363
lemma OR4_imp_Gets: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   364
"\<lbrakk>Says B A \<lbrace>Nonce M, Crypt (shrK A) \<lbrace>Nonce Na, Key K\<rbrace>\<rbrace> \<in> set evs;   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   365
   B \<notin> bad; evs \<in> orb\<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   366
 \<Longrightarrow> (\<exists> Nb. Gets B \<lbrace>Nonce M, Crypt (shrK B) \<lbrace>Crypt (shrK A) \<lbrace>Nonce Na, Key K\<rbrace>,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   367
                                             Nonce Nb, Key K\<rbrace>\<rbrace> \<in> set evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   368
apply (erule rev_mp, erule orb.induct, parts_explicit, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   369
prefer 3 apply (blast dest: Gets_Server_message_form')
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   370
apply blast+
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   371
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   372
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   373
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   374
lemma A_keydist_to_B: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   375
"\<lbrakk>Says A B \<lbrace>Nonce M, Agent A, Agent B,  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   376
            Crypt (shrK A) \<lbrace>Nonce Na, Nonce M, Agent A, Agent B\<rbrace>\<rbrace> \<in>set evs; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   377
   Gets A \<lbrace>Nonce M, Crypt (shrK A) \<lbrace>Nonce Na, Key K\<rbrace>\<rbrace> \<in> set evs;    
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   378
   A \<notin> bad; B \<notin> bad; evs \<in> orb\<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   379
  \<Longrightarrow> Key K \<in> analz (knows B evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   380
apply (drule Gets_imp_knows_Spy [THEN analz.Inj, THEN analz.Snd], assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   381
apply (drule analz_hard, assumption, assumption, assumption, assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   382
apply (drule OR4_imp_Gets, assumption, assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   383
apply (erule exE)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   384
(*blast doesn't do because it can't infer that Key (shrK P) \<in> (knows P evs)*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   385
apply (fastsimp dest!: Gets_imp_knows [THEN analz.Inj] analz.Decrypt)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   386
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   387
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   388
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   389
text{*Other properties as for the original protocol*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   390
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   391
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   392
end