src/HOL/Auth/Smartcard/ShoupRubinBella.thy
author berghofe
Fri, 28 Apr 2006 15:59:31 +0200
changeset 19497 630073ef9212
parent 18886 9f27383426db
child 20048 a7964311f1fb
permissions -rwxr-xr-x
Added new targets for nominal datatype package.
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 modification of the Shoup-Rubin 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
theory ShoupRubinBella imports Smartcard begin
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     8
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     9
text{*The modifications are that message 7 now mentions A, while message 10
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    10
now mentions Nb and B. The lack of explicitness of the original version was
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    11
discovered by investigating adherence to the principle of Goal
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    12
Availability. Only the updated version makes the goals of confidentiality,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    13
authentication and key distribution available to both peers.*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    14
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    15
consts
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    16
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    17
    sesK :: "nat*key => key"
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
axioms
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    20
     
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    21
   (*sesK is injective on each component*) 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    22
   inj_sesK [iff]: "(sesK(m,k) = sesK(m',k')) = (m = m' \<and> k = k')"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    23
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    24
   (*all long-term keys differ from sesK*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    25
   shrK_disj_sesK [iff]: "shrK A \<noteq> sesK(m,pk)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    26
   crdK_disj_sesK [iff]: "crdK C \<noteq> sesK(m,pk)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    27
   pin_disj_sesK  [iff]: "pin P \<noteq> sesK(m,pk)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    28
   pairK_disj_sesK[iff]: "pairK(A,B) \<noteq> sesK(m,pk)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    29
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    30
   (*needed for base case in analz_image_freshK*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    31
   Atomic_distrib [iff]: "Atomic`(KEY`K \<union> NONCE`N) =
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    32
                   Atomic`(KEY`K) \<union> Atomic`(NONCE`N)" 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    33
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    34
  (*this protocol makes the assumption of secure means
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    35
    between each agent and his smartcard*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    36
   shouprubin_assumes_securemeans [iff]: "evs \<in> srb \<Longrightarrow> secureM"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    37
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    38
constdefs
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    39
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    40
  Unique :: "[event, event list] => bool" ("Unique _ on _")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    41
   "Unique ev on evs == 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    42
      ev \<notin> set (tl (dropWhile (% z. z \<noteq> ev) evs))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    43
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    44
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    45
consts  srb   :: "event list set"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    46
inductive "srb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    47
  intros 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    48
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    49
    Nil:  "[]\<in> srb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    50
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    51
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    52
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    53
    Fake: "\<lbrakk> evsF \<in> srb;  X \<in> synth (analz (knows Spy evsF)); 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    54
             illegalUse(Card B) \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    55
          \<Longrightarrow> Says Spy A X # 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    56
              Inputs Spy (Card B) X # evsF \<in> srb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    57
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    58
(*In general this rule causes the assumption Card B \<notin> cloned
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    59
  in most guarantees for B - starting with confidentiality -
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    60
  otherwise pairK_confidential could not apply*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    61
    Forge:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    62
         "\<lbrakk> evsFo \<in> srb; Nonce Nb \<in> analz (knows Spy evsFo);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    63
             Key (pairK(A,B)) \<in> knows Spy evsFo \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    64
          \<Longrightarrow> Notes Spy (Key (sesK(Nb,pairK(A,B)))) # evsFo \<in> srb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    65
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    66
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    67
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    68
   Reception: "\<lbrakk> evsrb\<in> srb; Says A B X \<in> set evsrb \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    69
              \<Longrightarrow> Gets B X # evsrb \<in> srb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    70
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    71
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
(*A AND THE SERVER*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    74
    SR_U1:  "\<lbrakk> evs1 \<in> srb; A \<noteq> Server \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    75
          \<Longrightarrow> Says A Server \<lbrace>Agent A, Agent B\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    76
                # evs1 \<in> srb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    77
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    78
    SR_U2:  "\<lbrakk> evs2 \<in> srb; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    79
             Gets Server \<lbrace>Agent A, Agent B\<rbrace> \<in> set evs2 \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    80
          \<Longrightarrow> Says Server A \<lbrace>Nonce (Pairkey(A,B)), 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    81
                           Crypt (shrK A) \<lbrace>Nonce (Pairkey(A,B)), Agent B\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    82
                  \<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    83
                # evs2 \<in> srb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    84
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    85
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    86
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    87
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    88
(*A AND HER CARD*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    89
(*A cannot decrypt the verifier for she dosn't know shrK A,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    90
  but the pairkey is recognisable*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    91
    SR_U3:  "\<lbrakk> evs3 \<in> srb; legalUse(Card A);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    92
             Says A Server \<lbrace>Agent A, Agent B\<rbrace> \<in> set evs3;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    93
             Gets A \<lbrace>Nonce Pk, Certificate\<rbrace> \<in> set evs3 \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    94
          \<Longrightarrow> Inputs A (Card A) (Agent A)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    95
                # evs3 \<in> srb"   (*however A only queries her card 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    96
if she has previously contacted the server to initiate with some B. 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    97
Otherwise she would do so even if the Server had not been active. 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    98
Still, this doesn't and can't mean that the pairkey originated with 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    99
the server*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   100
 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   101
(*The card outputs the nonce Na to A*)               
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   102
    SR_U4:  "\<lbrakk> evs4 \<in> srb; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   103
             Nonce Na \<notin> used evs4; legalUse(Card A); A \<noteq> Server;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   104
             Inputs A (Card A) (Agent A) \<in> set evs4 \<rbrakk> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   105
       \<Longrightarrow> Outpts (Card A) A \<lbrace>Nonce Na, Crypt (crdK (Card A)) (Nonce Na)\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   106
              # evs4 \<in> srb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   107
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   108
(*The card can be exploited by the spy*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   109
(*because of the assumptions on the card, A is certainly not server nor spy*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   110
 SR_U4Fake: "\<lbrakk> evs4F \<in> srb; Nonce Na \<notin> used evs4F; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   111
             illegalUse(Card A);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   112
             Inputs Spy (Card A) (Agent A) \<in> set evs4F \<rbrakk> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   113
      \<Longrightarrow> Outpts (Card A) Spy \<lbrace>Nonce Na, Crypt (crdK (Card A)) (Nonce Na)\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   114
            # evs4F \<in> srb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   115
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   116
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   117
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
(*A TOWARDS B*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   120
    SR_U5:  "\<lbrakk> evs5 \<in> srb; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   121
             Outpts (Card A) A \<lbrace>Nonce Na, Certificate\<rbrace> \<in> set evs5;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   122
             \<forall> p q. Certificate \<noteq> \<lbrace>p, q\<rbrace> \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   123
          \<Longrightarrow> Says A B \<lbrace>Agent A, Nonce Na\<rbrace> # evs5 \<in> srb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   124
(*A must check that the verifier is not a compound message, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   125
  otherwise this would also fire after SR_U7 *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   126
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   127
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
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   130
(*B AND HIS CARD*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   131
    SR_U6:  "\<lbrakk> evs6 \<in> srb; legalUse(Card B);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   132
             Gets B \<lbrace>Agent A, Nonce Na\<rbrace> \<in> set evs6 \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   133
          \<Longrightarrow> Inputs B (Card B) \<lbrace>Agent A, Nonce Na\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   134
                # evs6 \<in> srb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   135
(*B gets back from the card the session key and various verifiers*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   136
    SR_U7:  "\<lbrakk> evs7 \<in> srb; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   137
             Nonce Nb \<notin> used evs7; legalUse(Card B); B \<noteq> Server;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   138
             K = sesK(Nb,pairK(A,B));
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   139
             Key K \<notin> used evs7;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   140
             Inputs B (Card B) \<lbrace>Agent A, Nonce Na\<rbrace> \<in> set evs7\<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   141
    \<Longrightarrow> Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key K,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   142
                            Crypt (pairK(A,B)) \<lbrace>Nonce Na, Nonce Nb\<rbrace>, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   143
                            Crypt (pairK(A,B)) (Nonce Nb)\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   144
                # evs7 \<in> srb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   145
(*The card can be exploited by the spy*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   146
(*because of the assumptions on the card, A is certainly not server nor spy*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   147
 SR_U7Fake:  "\<lbrakk> evs7F \<in> srb; Nonce Nb \<notin> used evs7F; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   148
             illegalUse(Card B);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   149
             K = sesK(Nb,pairK(A,B));
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   150
             Key K \<notin> used evs7F;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   151
             Inputs Spy (Card B) \<lbrace>Agent A, Nonce Na\<rbrace> \<in> set evs7F \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   152
          \<Longrightarrow> Outpts (Card B) Spy \<lbrace>Nonce Nb, Agent A, Key K,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   153
                            Crypt (pairK(A,B)) \<lbrace>Nonce Na, Nonce Nb\<rbrace>, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   154
                            Crypt (pairK(A,B)) (Nonce Nb)\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   155
                # evs7F \<in> srb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   156
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   157
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
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   160
(*B TOWARDS A*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   161
(*having sent an input that mentions A is the only memory B relies on,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   162
  since the output doesn't mention A - lack of explicitness*) 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   163
    SR_U8:  "\<lbrakk> evs8 \<in> srb;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   164
             Inputs B (Card B) \<lbrace>Agent A, Nonce Na\<rbrace> \<in> set evs8;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   165
             Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key K, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   166
                                 Cert1, Cert2\<rbrace> \<in> set evs8 \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   167
          \<Longrightarrow> Says B A \<lbrace>Nonce Nb, Cert1\<rbrace> # evs8 \<in> srb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   168
  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   169
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
(*A AND HER CARD*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   173
(*A cannot check the form of the verifiers - although I can prove the form of
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   174
  Cert2 - and just feeds her card with what she's got*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   175
    SR_U9:  "\<lbrakk> evs9 \<in> srb; legalUse(Card A);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   176
             Gets A \<lbrace>Nonce Pk, Cert1\<rbrace> \<in> set evs9;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   177
             Outpts (Card A) A \<lbrace>Nonce Na, Cert2\<rbrace> \<in> set evs9; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   178
             Gets A \<lbrace>Nonce Nb, Cert3\<rbrace> \<in> set evs9;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   179
             \<forall> p q. Cert2 \<noteq> \<lbrace>p, q\<rbrace> \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   180
          \<Longrightarrow> Inputs A (Card A) 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   181
                 \<lbrace>Agent B, Nonce Na, Nonce Nb, Nonce Pk,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   182
                  Cert1, Cert3, Cert2\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   183
                # evs9 \<in> srb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   184
(*But the card will only give outputs to the inputs of the correct form*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   185
    SR_U10: "\<lbrakk> evs10 \<in> srb; legalUse(Card A); A \<noteq> Server;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   186
             K = sesK(Nb,pairK(A,B));
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   187
             Inputs A (Card A) \<lbrace>Agent B, Nonce Na, Nonce Nb, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   188
                                 Nonce (Pairkey(A,B)),
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   189
                                 Crypt (shrK A) \<lbrace>Nonce (Pairkey(A,B)), 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   190
                                                   Agent B\<rbrace>,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   191
                                 Crypt (pairK(A,B)) \<lbrace>Nonce Na, Nonce Nb\<rbrace>, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   192
                                 Crypt (crdK (Card A)) (Nonce Na)\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   193
               \<in> set evs10 \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   194
          \<Longrightarrow> Outpts (Card A) A \<lbrace>Agent B, Nonce Nb, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   195
                                 Key K, Crypt (pairK(A,B)) (Nonce Nb)\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   196
                 # evs10 \<in> srb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   197
(*The card can be exploited by the spy*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   198
(*because of the assumptions on the card, A is certainly not server nor spy*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   199
SR_U10Fake: "\<lbrakk> evs10F \<in> srb; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   200
             illegalUse(Card A);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   201
             K = sesK(Nb,pairK(A,B));
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   202
             Inputs Spy (Card A) \<lbrace>Agent B, Nonce Na, Nonce Nb, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   203
                                   Nonce (Pairkey(A,B)),
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   204
                                   Crypt (shrK A) \<lbrace>Nonce (Pairkey(A,B)), 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   205
                                                    Agent B\<rbrace>,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   206
                                   Crypt (pairK(A,B)) \<lbrace>Nonce Na, Nonce Nb\<rbrace>, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   207
                                   Crypt (crdK (Card A)) (Nonce Na)\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   208
               \<in> set evs10F \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   209
          \<Longrightarrow> Outpts (Card A) Spy \<lbrace>Agent B, Nonce Nb, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   210
                                   Key K, Crypt (pairK(A,B)) (Nonce Nb)\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   211
                 # evs10F \<in> srb"
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
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   215
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   216
(*A TOWARDS B*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   217
(*having initiated with B is the only memory A relies on,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   218
  since the output doesn't mention B - lack of explicitness*) 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   219
    SR_U11: "\<lbrakk> evs11 \<in> srb;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   220
             Says A Server \<lbrace>Agent A, Agent B\<rbrace> \<in> set evs11;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   221
             Outpts (Card A) A \<lbrace>Agent B, Nonce Nb, Key K, Certificate\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   222
               \<in> set evs11 \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   223
          \<Longrightarrow> Says A B (Certificate) 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   224
                 # evs11 \<in> srb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   225
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   226
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   227
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   228
(*Both peers may leak by accident the session keys obtained from their
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   229
  cards*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   230
    Oops1:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   231
     "\<lbrakk> evsO1 \<in> srb;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   232
         Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key K, Cert1, Cert2\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   233
           \<in> set evsO1 \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   234
     \<Longrightarrow> Notes Spy \<lbrace>Key K, Nonce Nb, Agent A, Agent B\<rbrace> # evsO1 \<in> srb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   235
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   236
    Oops2:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   237
     "\<lbrakk> evsO2 \<in> srb;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   238
         Outpts (Card A) A \<lbrace>Agent B, Nonce Nb, Key K, Certificate\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   239
           \<in> set evsO2 \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   240
    \<Longrightarrow> Notes Spy \<lbrace>Key K, Nonce Nb, Agent A, Agent B\<rbrace> # evsO2 \<in> srb"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   241
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
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   244
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   245
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   246
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   247
(*To solve Fake case when it doesn't involve analz - used to be condensed
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   248
  into Fake_parts_insert_tac*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   249
declare Fake_parts_insert_in_Un  [dest]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   250
declare analz_into_parts [dest]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   251
(*declare parts_insertI [intro]*)
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
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
(*General facts about message reception*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   256
lemma Gets_imp_Says: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   257
       "\<lbrakk> Gets B X \<in> set evs; evs \<in> srb \<rbrakk> \<Longrightarrow> \<exists> A. Says A B X \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   258
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   259
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   260
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   261
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   262
lemma Gets_imp_knows_Spy: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   263
     "\<lbrakk> Gets B X \<in> set evs; evs \<in> srb \<rbrakk>  \<Longrightarrow> X \<in> knows Spy evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   264
apply (blast dest!: Gets_imp_Says Says_imp_knows_Spy)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   265
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   266
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   267
lemma Gets_imp_knows_Spy_parts_Snd: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   268
     "\<lbrakk> Gets B \<lbrace>X, Y\<rbrace> \<in> set evs; evs \<in> srb \<rbrakk>  \<Longrightarrow> Y \<in> parts (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   269
apply (blast dest!: Gets_imp_Says Says_imp_knows_Spy parts.Inj parts.Snd)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   270
done
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
lemma Gets_imp_knows_Spy_analz_Snd: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   273
     "\<lbrakk> Gets B \<lbrace>X, Y\<rbrace> \<in> set evs; evs \<in> srb \<rbrakk>  \<Longrightarrow> Y \<in> analz (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   274
apply (blast dest!: Gets_imp_Says Says_imp_knows_Spy analz.Inj analz.Snd)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   275
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   276
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   277
(*end general facts*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   278
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
(*Begin lemmas on secure means, from Event.ML, proved for shouprubin. They help
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   282
  the simplifier, especially in analz_image_freshK*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   283
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   284
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   285
lemma Inputs_imp_knows_Spy_secureM_srb: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   286
      "\<lbrakk> Inputs Spy C X \<in> set evs; evs \<in> srb \<rbrakk> \<Longrightarrow> X \<in> knows Spy evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   287
apply (simp (no_asm_simp) add: Inputs_imp_knows_Spy_secureM)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   288
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   289
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   290
lemma knows_Spy_Inputs_secureM_srb_Spy: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   291
      "evs \<in>srb \<Longrightarrow> knows Spy (Inputs Spy C X # evs) = insert X (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   292
apply (simp (no_asm_simp))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   293
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   294
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   295
lemma knows_Spy_Inputs_secureM_srb: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   296
    "\<lbrakk> A \<noteq> Spy; evs \<in>srb \<rbrakk> \<Longrightarrow> knows Spy (Inputs A C X # evs) =  knows Spy evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   297
apply (simp (no_asm_simp))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   298
done
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 knows_Spy_Outpts_secureM_srb_Spy: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   301
      "evs \<in>srb \<Longrightarrow> knows Spy (Outpts C Spy X # evs) = insert X (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   302
apply (simp (no_asm_simp))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   303
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   304
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   305
lemma knows_Spy_Outpts_secureM_srb: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   306
     "\<lbrakk> A \<noteq> Spy; evs \<in>srb \<rbrakk> \<Longrightarrow> knows Spy (Outpts C A X # evs) =  knows Spy evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   307
apply (simp (no_asm_simp))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   308
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   309
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   310
(*End lemmas on secure means for shouprubin*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   311
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   312
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   313
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   314
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   315
(*BEGIN technical lemmas - evolution of forwarding lemmas*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   316
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   317
(*If an honest agent uses a smart card, then the card is his/her own, is
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   318
  not stolen, and the agent has received suitable data to feed the card. 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   319
  In other words, these are guarantees that an honest agent can only use 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   320
  his/her own card, and must use it correctly.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   321
  On the contrary, the spy can "Inputs" any cloned cards also by the Fake rule.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   322
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   323
  Instead of Auto_tac, proofs here used to asm-simplify and then force-tac.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   324
*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   325
lemma Inputs_A_Card_3: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   326
    "\<lbrakk> Inputs A C (Agent A) \<in> set evs; A \<noteq> Spy; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   327
     \<Longrightarrow> legalUse(C) \<and> C = (Card A) \<and>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   328
      (\<exists> Pk Certificate. Gets A \<lbrace>Pk, Certificate\<rbrace> \<in> set evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   329
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   330
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   331
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   332
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   333
lemma Inputs_B_Card_6: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   334
     "\<lbrakk> Inputs B C \<lbrace>Agent A, Nonce Na\<rbrace> \<in> set evs; B \<noteq> Spy; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   335
      \<Longrightarrow> legalUse(C) \<and> C = (Card B) \<and> Gets B \<lbrace>Agent A, Nonce Na\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   336
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   337
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   338
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   339
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   340
lemma Inputs_A_Card_9: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   341
     "\<lbrakk> Inputs A C \<lbrace>Agent B, Nonce Na, Nonce Nb, Nonce Pk,   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   342
                                           Cert1, Cert2, Cert3\<rbrace> \<in> set evs; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   343
         A \<noteq> Spy; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   344
  \<Longrightarrow> legalUse(C) \<and> C = (Card A) \<and>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   345
      Gets A \<lbrace>Nonce Pk, Cert1\<rbrace> \<in> set evs     \<and>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   346
      Outpts (Card A) A \<lbrace>Nonce Na, Cert3\<rbrace> \<in> set evs        \<and>   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   347
      Gets A \<lbrace>Nonce Nb, Cert2\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   348
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   349
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   350
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   351
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   352
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   353
(*The two occurrences of A in the Outpts event don't match SR_U4Fake, where
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   354
  A cannot be the Spy. Hence the card is legally usable by rule SR_U4*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   355
lemma Outpts_A_Card_4: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   356
     "\<lbrakk> Outpts C A \<lbrace>Nonce Na, (Crypt (crdK (Card A)) (Nonce Na))\<rbrace> \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   357
         evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   358
     \<Longrightarrow> legalUse(C) \<and> C = (Card A) \<and>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   359
         Inputs A (Card A) (Agent A) \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   360
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   361
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   362
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   363
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   364
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   365
(*First certificate is made explicit so that a comment similar to the previous
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   366
  applies. This also provides Na to the Inputs event in the conclusion*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   367
lemma Outpts_B_Card_7: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   368
      "\<lbrakk> Outpts C B \<lbrace>Nonce Nb, Agent A, Key K,  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   369
                      Crypt (pairK(A,B)) \<lbrace>Nonce Na, Nonce Nb\<rbrace>,  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   370
                      Cert2\<rbrace> \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   371
         evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   372
     \<Longrightarrow> legalUse(C) \<and> C = (Card B) \<and>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   373
         Inputs B (Card B) \<lbrace>Agent A, Nonce Na\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   374
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   375
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   376
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   377
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   378
lemma Outpts_A_Card_10: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   379
     "\<lbrakk> Outpts C A \<lbrace>Agent B, Nonce Nb, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   380
                    Key K, (Crypt (pairK(A,B)) (Nonce Nb))\<rbrace> \<in> set evs; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   381
         evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   382
     \<Longrightarrow> legalUse(C) \<and> C = (Card A) \<and>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   383
         (\<exists> Na Ver1 Ver2 Ver3.  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   384
       Inputs A (Card A) \<lbrace>Agent B, Nonce Na, Nonce Nb, Nonce (Pairkey(A,B)),  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   385
                              Ver1, Ver2, Ver3\<rbrace> \<in> set evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   386
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   387
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   388
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   389
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
(*
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   393
Contrarily to original version, A doesn't need to check the form of the 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   394
certificate to learn that her peer is B. The goal is available to A.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   395
*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   396
lemma Outpts_A_Card_10_imp_Inputs: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   397
     "\<lbrakk> Outpts (Card A) A \<lbrace>Agent B, Nonce Nb, Key K, Certificate\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   398
          \<in> set evs; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   399
     \<Longrightarrow> (\<exists> Na Ver1 Ver2 Ver3.  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   400
       Inputs A (Card A) \<lbrace>Agent B, Nonce Na, Nonce Nb, Nonce (Pairkey(A,B)),  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   401
                              Ver1, Ver2, Ver3\<rbrace> \<in> set evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   402
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   403
apply simp_all
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   404
apply blast+
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   405
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   406
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   407
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   408
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   409
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   410
(*Weaker version: if the agent can't check the forms of the verifiers, then
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   411
  the agent must not be the spy so as to solve SR_U4Fake. The verifier must be
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   412
  recognised as some cyphertex in order to distinguish from case SR_U7, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   413
  concerning B's output, which also begins with a nonce.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   414
*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   415
lemma Outpts_honest_A_Card_4: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   416
     "\<lbrakk> Outpts C A \<lbrace>Nonce Na, Crypt K X\<rbrace> \<in>set evs; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   417
         A \<noteq> Spy;  evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   418
     \<Longrightarrow> legalUse(C) \<and> C = (Card A) \<and>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   419
         Inputs A (Card A) (Agent A) \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   420
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   421
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   422
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   423
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   424
(*alternative formulation of same theorem
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   425
Goal "\<lbrakk> Outpts C A \<lbrace>Nonce Na, Certificate\<rbrace> \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   426
         \<forall> p q. Certificate \<noteq> \<lbrace>p, q\<rbrace>;    
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   427
         A \<noteq> Spy; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   428
     \<Longrightarrow> legalUse(C) \<and> C = (Card A) \<and>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   429
         Inputs A (Card A) (Agent A) \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   430
same proof
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   431
*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   432
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   433
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   434
lemma Outpts_honest_B_Card_7: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   435
    "\<lbrakk> Outpts C B \<lbrace>Nonce Nb, Agent A, Key K, Cert1, Cert2\<rbrace> \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   436
       B \<noteq> Spy; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   437
   \<Longrightarrow> legalUse(C) \<and> C = (Card B) \<and>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   438
       (\<exists> Na. Inputs B (Card B) \<lbrace>Agent A, Nonce Na\<rbrace> \<in> set evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   439
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   440
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   441
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   442
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   443
lemma Outpts_honest_A_Card_10: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   444
     "\<lbrakk> Outpts C A \<lbrace>Agent B, Nonce Nb, Key K, Certificate\<rbrace> \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   445
         A \<noteq> Spy; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   446
     \<Longrightarrow> legalUse (C) \<and> C = (Card A) \<and>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   447
         (\<exists> Na Pk Ver1 Ver2 Ver3.  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   448
          Inputs A (Card A) \<lbrace>Agent B, Nonce Na, Nonce Nb, Pk,  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   449
                              Ver1, Ver2, Ver3\<rbrace> \<in> set evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   450
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   451
apply simp_all
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   452
apply blast+
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   453
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   454
(*-END-*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   455
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   456
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   457
(*Even weaker versions: if the agent can't check the forms of the verifiers
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   458
  and the agent may be the spy, then we must know what card the agent
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   459
  is getting the output from. 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   460
*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   461
lemma Outpts_which_Card_4: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   462
    "\<lbrakk> Outpts (Card A) A \<lbrace>Nonce Na, Crypt K X\<rbrace> \<in> set evs; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   463
    \<Longrightarrow> Inputs A (Card A) (Agent A) \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   464
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   465
apply (simp_all (no_asm_simp))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   466
apply clarify
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   467
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   468
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   469
lemma Outpts_which_Card_7: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   470
  "\<lbrakk> Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key K, Cert1, Cert2\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   471
       \<in> set evs;  evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   472
     \<Longrightarrow> \<exists> Na. Inputs B (Card B) \<lbrace>Agent A, Nonce Na\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   473
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   474
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   475
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   476
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   477
(*This goal is now available - in the sense of Goal Availability*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   478
lemma Outpts_which_Card_10: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   479
    "\<lbrakk> Outpts (Card A) A \<lbrace>Agent B, Nonce Nb, Key K, Certificate \<rbrace> \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   480
       evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   481
    \<Longrightarrow> \<exists> Na. Inputs A (Card A) \<lbrace>Agent B, Nonce Na, Nonce Nb, Nonce (Pairkey(A,B)), 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   482
                            Crypt (shrK A) \<lbrace>Nonce (Pairkey(A,B)), Agent B\<rbrace>,  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   483
                            Crypt (pairK(A,B)) \<lbrace>Nonce Na, Nonce Nb\<rbrace>,  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   484
                            Crypt (crdK (Card A)) (Nonce Na) \<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   485
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   486
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   487
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   488
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   489
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   490
(*Lemmas on the form of outputs*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   491
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   492
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   493
(*A needs to check that the verifier is a cipher for it to come from SR_U4
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   494
  otherwise it could come from SR_U7 *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   495
lemma Outpts_A_Card_form_4: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   496
  "\<lbrakk> Outpts (Card A) A \<lbrace>Nonce Na, Certificate\<rbrace> \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   497
         \<forall> p q. Certificate \<noteq> \<lbrace>p, q\<rbrace>; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   498
     \<Longrightarrow> Certificate = (Crypt (crdK (Card A)) (Nonce Na))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   499
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   500
apply (simp_all (no_asm_simp))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   501
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   502
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   503
lemma Outpts_B_Card_form_7: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   504
   "\<lbrakk> Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key K, Cert1, Cert2\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   505
        \<in> set evs; evs \<in> srb \<rbrakk>          
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   506
      \<Longrightarrow> \<exists> Na.    
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   507
          K = sesK(Nb,pairK(A,B)) \<and>                       
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   508
          Cert1 = (Crypt (pairK(A,B)) \<lbrace>Nonce Na, Nonce Nb\<rbrace>) \<and>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   509
          Cert2 = (Crypt (pairK(A,B)) (Nonce Nb))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   510
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   511
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   512
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   513
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   514
lemma Outpts_A_Card_form_10: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   515
   "\<lbrakk> Outpts (Card A) A \<lbrace>Agent B, Nonce Nb, Key K, Certificate\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   516
        \<in> set evs; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   517
      \<Longrightarrow> K = sesK(Nb,pairK(A,B)) \<and>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   518
          Certificate = (Crypt (pairK(A,B)) (Nonce Nb))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   519
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   520
apply (simp_all (no_asm_simp))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   521
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   522
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   523
lemma Outpts_A_Card_form_bis: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   524
  "\<lbrakk> Outpts (Card A') A' \<lbrace>Agent B', Nonce Nb', Key (sesK(Nb,pairK(A,B))), 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   525
     Certificate\<rbrace> \<in> set evs; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   526
         evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   527
      \<Longrightarrow> A' = A \<and> B' = B \<and> Nb = Nb' \<and>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   528
          Certificate = (Crypt (pairK(A,B)) (Nonce Nb))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   529
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   530
apply (simp_all (no_asm_simp))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   531
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   532
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   533
(*\<dots> and Inputs *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   534
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   535
lemma Inputs_A_Card_form_9: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   536
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   537
     "\<lbrakk> Inputs A (Card A) \<lbrace>Agent B, Nonce Na, Nonce Nb, Nonce Pk,   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   538
                             Cert1, Cert2, Cert3\<rbrace> \<in> set evs; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   539
         evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   540
  \<Longrightarrow>    Cert3 = Crypt (crdK (Card A)) (Nonce Na)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   541
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   542
apply (erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   543
apply (simp_all (no_asm_simp))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   544
(*Fake*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   545
apply force
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   546
(*SR_U9*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   547
apply (blast dest!: Outpts_A_Card_form_4)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   548
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   549
(* Pk, Cert1, Cert2 cannot be made explicit because they traversed the network in the clear *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   550
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   551
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   552
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   553
(*General guarantees on Inputs and Outpts*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   554
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   555
(*for any agents*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   556
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   557
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   558
lemma Inputs_Card_legalUse: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   559
  "\<lbrakk> Inputs A (Card A) X \<in> set evs; evs \<in> srb \<rbrakk> \<Longrightarrow> legalUse(Card A)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   560
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   561
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   562
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   563
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   564
lemma Outpts_Card_legalUse: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   565
  "\<lbrakk> Outpts (Card A) A X \<in> set evs; evs \<in> srb \<rbrakk> \<Longrightarrow> legalUse(Card A)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   566
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   567
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   568
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   569
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   570
(*for honest agents*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   571
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   572
lemma Inputs_Card: "\<lbrakk> Inputs A C X \<in> set evs; A \<noteq> Spy; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   573
      \<Longrightarrow> C = (Card A) \<and> legalUse(C)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   574
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   575
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   576
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   577
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   578
lemma Outpts_Card: "\<lbrakk> Outpts C A X \<in> set evs; A \<noteq> Spy; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   579
      \<Longrightarrow> C = (Card A) \<and> legalUse(C)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   580
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   581
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   582
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   583
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   584
lemma Inputs_Outpts_Card: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   585
     "\<lbrakk> Inputs A C X \<in> set evs \<or> Outpts C A Y \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   586
         A \<noteq> Spy; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   587
     \<Longrightarrow> C = (Card A) \<and> legalUse(Card A)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   588
apply (blast dest: Inputs_Card Outpts_Card)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   589
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   590
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   591
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   592
(*for the spy - they stress that the model behaves as it is meant to*) 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   593
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   594
(*The or version can be also proved directly.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   595
  It stresses that the spy may use either her own legally usable card or
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   596
  all the illegally usable cards.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   597
*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   598
lemma Inputs_Card_Spy: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   599
  "\<lbrakk> Inputs Spy C X \<in> set evs \<or> Outpts C Spy X \<in> set evs; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   600
      \<Longrightarrow> C = (Card Spy) \<and> legalUse(Card Spy) \<or>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   601
          (\<exists> A. C = (Card A) \<and> illegalUse(Card A))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   602
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   603
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   604
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   605
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   606
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   607
(*END technical lemmas*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   608
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   609
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   610
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   611
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   612
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   613
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   614
(*BEGIN unicity theorems: certain items uniquely identify a smart card's
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   615
                          output*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   616
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   617
(*A's card's first output: the nonce uniquely identifies the rest*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   618
lemma Outpts_A_Card_unique_nonce:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   619
     "\<lbrakk> Outpts (Card A) A \<lbrace>Nonce Na, Crypt (crdK (Card A)) (Nonce Na)\<rbrace>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   620
           \<in> set evs;   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   621
         Outpts (Card A') A' \<lbrace>Nonce Na, Crypt (crdK (Card A')) (Nonce Na)\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   622
           \<in> set evs;   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   623
         evs \<in> srb \<rbrakk> \<Longrightarrow> A=A'"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   624
apply (erule rev_mp, erule rev_mp, erule srb.induct, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   625
apply (fastsimp dest: Outpts_parts_used)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   626
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   627
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   628
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   629
(*B's card's output: the NONCE uniquely identifies the rest*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   630
lemma Outpts_B_Card_unique_nonce: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   631
     "\<lbrakk> Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key SK, Cert1, Cert2\<rbrace> \<in> set evs;   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   632
      Outpts (Card B') B' \<lbrace>Nonce Nb, Agent A', Key SK', Cert1', Cert2'\<rbrace> \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   633
       evs \<in> srb \<rbrakk> \<Longrightarrow> B=B' \<and> A=A' \<and> SK=SK' \<and> Cert1=Cert1' \<and> Cert2=Cert2'"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   634
apply (erule rev_mp, erule rev_mp, erule srb.induct, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   635
apply (fastsimp dest: Outpts_parts_used)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   636
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   637
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   638
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   639
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   640
(*B's card's output: the SESKEY uniquely identifies the rest*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   641
lemma Outpts_B_Card_unique_key: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   642
     "\<lbrakk> Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key SK, Cert1, Cert2\<rbrace> \<in> set evs;   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   643
      Outpts (Card B') B' \<lbrace>Nonce Nb', Agent A', Key SK, Cert1', Cert2'\<rbrace> \<in> set evs; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   644
       evs \<in> srb \<rbrakk> \<Longrightarrow> B=B' \<and> A=A' \<and> Nb=Nb' \<and> Cert1=Cert1' \<and> Cert2=Cert2'"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   645
apply (erule rev_mp, erule rev_mp, erule srb.induct, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   646
apply (fastsimp dest: Outpts_parts_used)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   647
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   648
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   649
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   650
lemma Outpts_A_Card_unique_key: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   651
   "\<lbrakk> Outpts (Card A) A \<lbrace>Agent B, Nonce Nb, Key K, V\<rbrace> \<in> set evs;   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   652
      Outpts (Card A') A' \<lbrace>Agent B', Nonce Nb', Key K, V'\<rbrace> \<in> set evs;   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   653
         evs \<in> srb \<rbrakk> \<Longrightarrow> A=A' \<and> B=B' \<and> Nb=Nb' \<and> V=V'"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   654
apply (erule rev_mp, erule rev_mp, erule srb.induct, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   655
apply (blast dest: Outpts_A_Card_form_bis)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   656
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   657
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   658
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   659
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   660
(*Revised unicity theorem - applies to both steps 4 and 7*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   661
lemma Outpts_A_Card_Unique: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   662
  "\<lbrakk> Outpts (Card A) A \<lbrace>Nonce Na, rest\<rbrace> \<in> set evs; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   663
     \<Longrightarrow> Unique (Outpts (Card A) A \<lbrace>Nonce Na, rest\<rbrace>) on evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   664
apply (erule rev_mp, erule srb.induct, simp_all add: Unique_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   665
apply (fastsimp dest: Outpts_parts_used)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   666
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   667
apply (fastsimp dest: Outpts_parts_used)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   668
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   669
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   670
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   671
(*can't prove the same on evs10 for it doesn't have a freshness assumption!*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   672
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   673
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   674
(*END unicity theorems*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   675
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   676
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   677
(*BEGIN counterguarantees about spy's knowledge*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   678
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   679
(*on nonces*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   680
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   681
lemma Spy_knows_Na: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   682
      "\<lbrakk> Says A B \<lbrace>Agent A, Nonce Na\<rbrace> \<in> set evs; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   683
      \<Longrightarrow> Nonce Na \<in> analz (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   684
apply (blast dest!: Says_imp_knows_Spy [THEN analz.Inj, THEN analz.Snd])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   685
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   686
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   687
lemma Spy_knows_Nb: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   688
      "\<lbrakk> Says B A \<lbrace>Nonce Nb, Certificate\<rbrace> \<in> set evs; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   689
      \<Longrightarrow> Nonce Nb \<in> analz (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   690
apply (blast dest!: Says_imp_knows_Spy [THEN analz.Inj, THEN analz.Fst])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   691
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   692
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   693
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   694
(*on Pairkey*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   695
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   696
lemma Pairkey_Gets_analz_knows_Spy: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   697
      "\<lbrakk> Gets A \<lbrace>Nonce (Pairkey(A,B)), Certificate\<rbrace> \<in> set evs; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   698
      \<Longrightarrow> Nonce (Pairkey(A,B)) \<in> analz (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   699
apply (blast dest!: Gets_imp_knows_Spy [THEN analz.Inj])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   700
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   701
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   702
lemma Pairkey_Inputs_imp_Gets: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   703
     "\<lbrakk> Inputs A (Card A)             
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   704
           \<lbrace>Agent B, Nonce Na, Nonce Nb, Nonce (Pairkey(A,B)),     
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   705
             Cert1, Cert3, Cert2\<rbrace> \<in> set evs;           
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   706
         A \<noteq> Spy; evs \<in> srb \<rbrakk>     
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   707
      \<Longrightarrow> Gets A \<lbrace>Nonce (Pairkey(A,B)), Cert1\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   708
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   709
apply (simp_all (no_asm_simp))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   710
apply force
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   711
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   712
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   713
lemma Pairkey_Inputs_analz_knows_Spy: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   714
     "\<lbrakk> Inputs A (Card A)             
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   715
           \<lbrace>Agent B, Nonce Na, Nonce Nb, Nonce (Pairkey(A,B)),     
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   716
             Cert1, Cert3, Cert2\<rbrace> \<in> set evs;           
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   717
         evs \<in> srb \<rbrakk>     
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   718
     \<Longrightarrow> Nonce (Pairkey(A,B)) \<in> analz (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   719
apply (case_tac "A = Spy")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   720
apply (fastsimp dest!: Inputs_imp_knows_Spy_secureM [THEN analz.Inj])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   721
apply (blast dest!: Pairkey_Inputs_imp_Gets [THEN Pairkey_Gets_analz_knows_Spy])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   722
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   723
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   724
(* This fails on base case because of XOR properties.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   725
lemma Pairkey_authentic:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   726
  "\<lbrakk> Nonce (Pairkey(A,B)) \<in> parts (knows Spy evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   727
     Card A \<notin> cloned; evs \<in> sr \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   728
 \<Longrightarrow> \<exists> cert. Says Server A \<lbrace>Nonce (Pairkey(A,B)), Cert\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   729
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   730
apply (erule sr.induct, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   731
apply clarify
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   732
oops
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   733
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   734
 1. \<And>x a b.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   735
       \<lbrakk>Card A \<notin> cloned; Pairkey (A, B) = Pairkey (a, b); Card a \<in> cloned;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   736
        Card b \<in> cloned\<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   737
       \<Longrightarrow> False
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   738
*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   739
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   740
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   741
(*END counterguarantees on spy's knowledge*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   742
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   743
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   744
(*BEGIN rewrite rules for parts operator*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   745
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   746
declare shrK_disj_sesK [THEN not_sym, iff] 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   747
declare pin_disj_sesK [THEN not_sym, iff]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   748
declare crdK_disj_sesK [THEN not_sym, iff]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   749
declare pairK_disj_sesK [THEN not_sym, iff]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   750
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   751
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   752
ML
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   753
{*
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   754
val Outpts_B_Card_form_7 = thm "Outpts_B_Card_form_7"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   755
val Outpts_A_Card_form_4 = thm "Outpts_A_Card_form_4"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   756
val Outpts_A_Card_form_10 = thm "Outpts_A_Card_form_10"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   757
val Gets_imp_knows_Spy = thm "Gets_imp_knows_Spy"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   758
val Outpts_B_Card_form_7 = thm "Outpts_B_Card_form_7"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   759
val Gets_imp_knows_Spy_parts_Snd = thm "Gets_imp_knows_Spy_parts_Snd"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   760
val Gets_imp_knows_Spy_analz_Snd = thm "Gets_imp_knows_Spy_analz_Snd"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   761
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   762
val prepare_tac = 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   763
 (*SR_U8*)   forward_tac [Outpts_B_Card_form_7] 14 THEN
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   764
 (*SR_U8*)   Clarify_tac 15 THEN
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   765
 (*SR_U9*)   forward_tac [Outpts_A_Card_form_4] 16 THEN 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   766
 (*SR_U11*)  forward_tac [Outpts_A_Card_form_10] 21 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   767
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   768
val parts_prepare_tac = 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   769
           prepare_tac THEN
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   770
 (*SR_U9*)   dresolve_tac [Gets_imp_knows_Spy_parts_Snd] 18 THEN 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   771
 (*SR_U9*)   dresolve_tac [Gets_imp_knows_Spy_parts_Snd] 19 THEN 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   772
 (*Oops1*) dresolve_tac [Outpts_B_Card_form_7] 25    THEN               
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   773
 (*Oops2*) dresolve_tac [Outpts_A_Card_form_10] 27 THEN                
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   774
 (*Base*)  Force_tac 1
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   775
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   776
val analz_prepare_tac = 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   777
         prepare_tac THEN
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   778
         dtac (Gets_imp_knows_Spy_analz_Snd) 18 THEN 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   779
 (*SR_U9*) dtac (Gets_imp_knows_Spy_analz_Snd) 19 THEN 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   780
         REPEAT_FIRST (eresolve_tac [asm_rl, conjE] ORELSE' hyp_subst_tac)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   781
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   782
*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   783
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   784
method_setup prepare = {*
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   785
    Method.no_args (Method.METHOD (fn facts => prepare_tac)) *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   786
  "to launch a few simple facts that'll help the simplifier"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   787
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   788
method_setup parts_prepare = {*
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   789
    Method.no_args (Method.METHOD (fn facts => parts_prepare_tac)) *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   790
  "additional facts to reason about parts"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   791
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   792
method_setup analz_prepare = {*
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   793
    Method.no_args (Method.METHOD (fn facts => analz_prepare_tac)) *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   794
  "additional facts to reason about analz"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   795
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   796
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   797
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   798
lemma Spy_parts_keys [simp]: "evs \<in> srb \<Longrightarrow>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   799
  (Key (shrK P) \<in> parts (knows Spy evs)) = (Card P \<in> cloned) \<and>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   800
  (Key (pin P) \<in> parts (knows Spy evs)) = (P \<in> bad \<or> Card P \<in> cloned) \<and>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   801
  (Key (crdK C) \<in> parts (knows Spy evs)) = (C \<in> cloned) \<and>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   802
  (Key (pairK(A,B)) \<in> parts (knows Spy evs)) = (Card B \<in> cloned)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   803
apply (erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   804
apply parts_prepare
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   805
apply simp_all
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   806
apply (blast intro: parts_insertI)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   807
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   808
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   809
(*END rewrite rules for parts operator*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   810
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   811
(*BEGIN rewrite rules for analz operator*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   812
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   813
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   814
lemma Spy_analz_shrK[simp]: "evs \<in> srb \<Longrightarrow>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   815
  (Key (shrK P) \<in> analz (knows Spy evs)) = (Card P \<in> cloned)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   816
apply (auto dest!: Spy_knows_cloned)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   817
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   818
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   819
lemma Spy_analz_crdK[simp]: "evs \<in> srb \<Longrightarrow>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   820
  (Key (crdK C) \<in> analz (knows Spy evs)) = (C \<in> cloned)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   821
apply (auto dest!: Spy_knows_cloned)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   822
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   823
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   824
lemma Spy_analz_pairK[simp]: "evs \<in> srb \<Longrightarrow>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   825
  (Key (pairK(A,B)) \<in> analz (knows Spy evs)) = (Card B \<in> cloned)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   826
apply (auto dest!: Spy_knows_cloned)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   827
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   828
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   829
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   830
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   831
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   832
(*Because initState contains a set of nonces, this is needed for base case of
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   833
  analz_image_freshK*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   834
lemma analz_image_Key_Un_Nonce: "analz (Key`K \<union> Nonce`N) = Key`K \<union> Nonce`N"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   835
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   836
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   837
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   838
ML
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   839
{*
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   840
val knows_Spy_Inputs_secureM_srb_Spy = thm "knows_Spy_Inputs_secureM_srb_Spy"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   841
val knows_Spy_Outpts_secureM_srb_Spy = thm "knows_Spy_Outpts_secureM_srb_Spy"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   842
val shouprubin_assumes_securemeans = thm "shouprubin_assumes_securemeans"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   843
val analz_image_Key_Un_Nonce= thm "analz_image_Key_Un_Nonce"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   844
*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   845
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   846
method_setup sc_analz_freshK = {*
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   847
    Method.no_args
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   848
     (Method.METHOD
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   849
      (fn facts => EVERY [REPEAT_FIRST (resolve_tac [allI, ballI, impI]),
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   850
                          REPEAT_FIRST (rtac analz_image_freshK_lemma),
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   851
                          ALLGOALS (asm_simp_tac (analz_image_freshK_ss
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   852
                                    addsimps [knows_Spy_Inputs_secureM_srb_Spy,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   853
                                              knows_Spy_Outpts_secureM_srb_Spy,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   854
                                              shouprubin_assumes_securemeans, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   855
                                              analz_image_Key_Un_Nonce]))])) *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   856
    "for proving the Session Key Compromise theorem for smartcard protocols"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   857
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   858
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   859
lemma analz_image_freshK [rule_format]: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   860
     "evs \<in> srb \<Longrightarrow>      \<forall> K KK.  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   861
          (Key K \<in> analz (Key`KK \<union> (knows Spy evs))) =  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   862
          (K \<in> KK \<or> Key K \<in> analz (knows Spy evs))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   863
apply (erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   864
apply analz_prepare
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   865
apply sc_analz_freshK
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   866
apply spy_analz
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   867
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   868
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   869
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   870
lemma analz_insert_freshK: "evs \<in> srb \<Longrightarrow>   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   871
         Key K \<in> analz (insert (Key K') (knows Spy evs)) =  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   872
         (K = K' \<or> Key K \<in> analz (knows Spy evs))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   873
apply (simp only: analz_image_freshK_simps analz_image_freshK)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   874
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   875
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   876
(*END rewrite rules for analz operator*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   877
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   878
(*BEGIN authenticity theorems*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   879
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   880
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   881
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   882
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   883
lemma Na_Nb_certificate_authentic: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   884
     "\<lbrakk> Crypt (pairK(A,B)) \<lbrace>Nonce Na, Nonce Nb\<rbrace> \<in> parts (knows Spy evs);  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   885
         \<not>illegalUse(Card B); 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   886
         evs \<in> srb \<rbrakk>           
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   887
     \<Longrightarrow> Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key (sesK(Nb,pairK(A,B))),   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   888
                Crypt (pairK(A,B)) \<lbrace>Nonce Na, Nonce Nb\<rbrace>, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   889
                Crypt (pairK(A,B)) (Nonce Nb)\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   890
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   891
apply parts_prepare
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   892
apply simp_all
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   893
(*Fake*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   894
apply spy_analz
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   895
(*SR_U7F*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   896
apply clarify
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   897
(*SR_U8*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   898
apply clarify
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   899
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   900
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   901
lemma Nb_certificate_authentic:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   902
      "\<lbrakk> Crypt (pairK(A,B)) (Nonce Nb) \<in> parts (knows Spy evs);  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   903
         B \<noteq> Spy; \<not>illegalUse(Card A); \<not>illegalUse(Card B); 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   904
         evs \<in> srb \<rbrakk>    
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   905
     \<Longrightarrow> Outpts (Card A) A \<lbrace>Agent B, Nonce Nb, Key (sesK(Nb,pairK(A,B))),  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   906
                             Crypt (pairK(A,B)) (Nonce Nb)\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   907
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   908
apply parts_prepare
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   909
apply (case_tac [17] "Aa = Spy")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   910
apply simp_all
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   911
(*Fake*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   912
apply spy_analz
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   913
(*SR_U7F, SR_U10F*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   914
apply clarify+
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   915
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   916
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   917
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   918
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   919
(*Discovering the very origin of the Nb certificate...*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   920
lemma Outpts_A_Card_imp_pairK_parts: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   921
     "\<lbrakk> Outpts (Card A) A  \<lbrace>Agent B, Nonce Nb, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   922
                    Key K, Certificate\<rbrace> \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   923
        evs \<in> srb \<rbrakk>   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   924
    \<Longrightarrow> \<exists> Na. Crypt (pairK(A,B)) \<lbrace>Nonce Na, Nonce Nb\<rbrace> \<in> parts (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   925
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   926
apply parts_prepare
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   927
apply simp_all
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   928
(*Fake*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   929
apply (blast dest: parts_insertI)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   930
(*SR_U7*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   931
apply force
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   932
(*SR_U7F*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   933
apply force
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   934
(*SR_U8*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   935
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   936
(*SR_U10*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   937
apply (blast dest: Inputs_imp_knows_Spy_secureM_srb parts.Inj Inputs_A_Card_9 Gets_imp_knows_Spy elim: knows_Spy_partsEs)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   938
(*SR_U10F*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   939
apply (blast dest: Inputs_imp_knows_Spy_secureM_srb [THEN parts.Inj] 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   940
                   Inputs_A_Card_9 Gets_imp_knows_Spy 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   941
             elim: knows_Spy_partsEs)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   942
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   943
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   944
               
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   945
lemma Nb_certificate_authentic_bis: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   946
     "\<lbrakk> Crypt (pairK(A,B)) (Nonce Nb) \<in> parts (knows Spy evs);  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   947
         B \<noteq> Spy; \<not>illegalUse(Card B); 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   948
         evs \<in> srb \<rbrakk>    
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   949
 \<Longrightarrow> \<exists> Na. Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key (sesK(Nb,pairK(A,B))),   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   950
                   Crypt (pairK(A,B)) \<lbrace>Nonce Na, Nonce Nb\<rbrace>, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   951
                   Crypt (pairK(A,B)) (Nonce Nb)\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   952
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   953
apply parts_prepare
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   954
apply (simp_all (no_asm_simp))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   955
(*Fake*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   956
apply spy_analz
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   957
(*SR_U7*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   958
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   959
(*SR_U7F*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   960
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   961
(*SR_U8*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   962
apply force
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   963
(*SR_U10*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   964
apply (blast dest: Na_Nb_certificate_authentic Inputs_imp_knows_Spy_secureM_srb [THEN parts.Inj] elim: knows_Spy_partsEs)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   965
(*SR_U10F*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   966
apply (blast dest: Na_Nb_certificate_authentic Inputs_imp_knows_Spy_secureM_srb [THEN parts.Inj] elim: knows_Spy_partsEs)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   967
(*SR_U11*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   968
apply (blast dest: Na_Nb_certificate_authentic Outpts_A_Card_imp_pairK_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   969
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   970
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   971
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   972
lemma Pairkey_certificate_authentic: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   973
    "\<lbrakk> Crypt (shrK A) \<lbrace>Nonce Pk, Agent B\<rbrace> \<in> parts (knows Spy evs);    
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   974
         Card A \<notin> cloned; evs \<in> srb \<rbrakk>        
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   975
     \<Longrightarrow> Pk = Pairkey(A,B) \<and>              
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   976
         Says Server A \<lbrace>Nonce Pk,  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   977
                        Crypt (shrK A) \<lbrace>Nonce Pk, Agent B\<rbrace>\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   978
           \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   979
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   980
apply parts_prepare
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   981
apply (simp_all (no_asm_simp))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   982
(*Fake*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   983
apply spy_analz
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   984
(*SR_U8*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   985
apply force
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   986
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   987
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   988
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   989
lemma sesK_authentic: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   990
     "\<lbrakk> Key (sesK(Nb,pairK(A,B))) \<in> parts (knows Spy evs);  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   991
         A \<noteq> Spy; B \<noteq> Spy; \<not>illegalUse(Card A); \<not>illegalUse(Card B); 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   992
         evs \<in> srb \<rbrakk>           
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   993
      \<Longrightarrow> Notes Spy \<lbrace>Key (sesK(Nb,pairK(A,B))), Nonce Nb, Agent A, Agent B\<rbrace>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   994
           \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   995
apply (erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   996
apply parts_prepare
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   997
apply (simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   998
(*fake*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   999
apply spy_analz
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1000
(*forge*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1001
apply (fastsimp dest: analz.Inj)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1002
(*SR_U7: used B\<noteq>Spy*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1003
(*SR_U7F*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1004
apply clarify
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1005
(*SR_U10: used A\<noteq>Spy*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1006
(*SR_U10F*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1007
apply clarify
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1008
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1009
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1010
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1011
(*END authenticity theorems*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1012
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1013
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1014
(*BEGIN confidentiality theorems*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1015
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1016
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1017
lemma Confidentiality: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1018
     "\<lbrakk> Notes Spy \<lbrace>Key (sesK(Nb,pairK(A,B))), Nonce Nb, Agent A, Agent B\<rbrace>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1019
           \<notin> set evs; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1020
        A \<noteq> Spy; B \<noteq> Spy; \<not>illegalUse(Card A); \<not>illegalUse(Card B); 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1021
        evs \<in> srb \<rbrakk>           
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1022
      \<Longrightarrow> Key (sesK(Nb,pairK(A,B))) \<notin> analz (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1023
apply (blast intro: sesK_authentic)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1024
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1025
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1026
lemma Confidentiality_B: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1027
     "\<lbrakk> Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key K, Cert1, Cert2\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1028
          \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1029
        Notes Spy \<lbrace>Key K, Nonce Nb, Agent A, Agent B\<rbrace> \<notin> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1030
        A \<noteq> Spy; B \<noteq> Spy; \<not>illegalUse(Card A); Card B \<notin> cloned; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1031
        evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1032
      \<Longrightarrow> Key K \<notin> analz (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1033
apply (erule rev_mp, erule rev_mp, erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1034
apply analz_prepare
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1035
apply (simp_all add: analz_insert_eq analz_insert_freshK pushes split_ifs)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1036
(*Fake*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1037
apply spy_analz
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1038
(*Forge*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1039
apply (rotate_tac 7)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1040
apply (drule parts.Inj)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1041
apply (fastsimp dest: Outpts_B_Card_form_7)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1042
(*SR_U7*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1043
apply (blast dest!: Outpts_B_Card_form_7)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1044
(*SR_U7F*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1045
apply clarify
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1046
apply (drule Outpts_parts_used)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1047
apply simp
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1048
(*faster than
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1049
  by (fast_tac (claset() addDs [Outpts_parts_used] addss (simpset())) 1)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1050
*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1051
(*SR_U10*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1052
apply (fastsimp dest: Outpts_B_Card_form_7)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1053
(*SR_U10F - uses assumption Card A not cloned*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1054
apply clarify
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1055
apply (drule Outpts_B_Card_form_7, assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1056
apply simp
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1057
(*Oops1*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1058
apply (blast dest!: Outpts_B_Card_form_7)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1059
(*Oops2*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1060
apply (blast dest!: Outpts_B_Card_form_7 Outpts_A_Card_form_10)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1061
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1062
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1063
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1064
(*END confidentiality theorems*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1065
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1066
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1067
(*BEGIN authentication theorems*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1068
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1069
lemma A_authenticates_B: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1070
     "\<lbrakk> Outpts (Card A) A  \<lbrace>Agent B, Nonce Nb, Key K, Certificate\<rbrace> \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1071
        \<not>illegalUse(Card B); 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1072
        evs \<in> srb \<rbrakk>           
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1073
 \<Longrightarrow> \<exists> Na. Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key K,   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1074
                Crypt (pairK(A,B)) \<lbrace>Nonce Na, Nonce Nb\<rbrace>, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1075
                Crypt (pairK(A,B)) (Nonce Nb)\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1076
apply (blast dest: Na_Nb_certificate_authentic Outpts_A_Card_form_10 Outpts_A_Card_imp_pairK_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1077
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1078
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1079
lemma A_authenticates_B_Gets: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1080
     "\<lbrakk> Gets A \<lbrace>Nonce Nb, Crypt (pairK(A,B)) \<lbrace>Nonce Na, Nonce Nb\<rbrace>\<rbrace>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1081
           \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1082
         \<not>illegalUse(Card B); 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1083
         evs \<in> srb \<rbrakk>           
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1084
    \<Longrightarrow> Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key (sesK(Nb, pairK (A, B))),   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1085
                             Crypt (pairK(A,B)) \<lbrace>Nonce Na, Nonce Nb\<rbrace>, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1086
                             Crypt (pairK(A,B)) (Nonce Nb)\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1087
apply (blast dest: Gets_imp_knows_Spy [THEN parts.Inj, THEN parts.Snd, THEN Na_Nb_certificate_authentic])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1088
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1089
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1090
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1091
lemma A_authenticates_B_bis: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1092
     "\<lbrakk> Outpts (Card A) A  \<lbrace>Agent B, Nonce Nb, Key K, Cert2\<rbrace> \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1093
        \<not>illegalUse(Card B); 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1094
        evs \<in> srb \<rbrakk>           
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1095
 \<Longrightarrow> \<exists> Cert1. Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key K, Cert1, Cert2\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1096
                \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1097
apply (blast dest: Na_Nb_certificate_authentic Outpts_A_Card_form_10 Outpts_A_Card_imp_pairK_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1098
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1099
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1100
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1101
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1102
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1103
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1104
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1105
lemma B_authenticates_A: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1106
     "\<lbrakk> Gets B (Crypt (pairK(A,B)) (Nonce Nb)) \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1107
         B \<noteq> Spy; \<not>illegalUse(Card A); \<not>illegalUse(Card B); 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1108
         evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1109
      \<Longrightarrow> Outpts (Card A) A  \<lbrace>Agent B, Nonce Nb, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1110
         Key (sesK(Nb,pairK(A,B))), Crypt (pairK(A,B)) (Nonce Nb)\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1111
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1112
apply (erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1113
apply (simp_all (no_asm_simp))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1114
apply (blast dest: Says_imp_knows_Spy [THEN parts.Inj] Nb_certificate_authentic)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1115
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1116
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1117
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1118
lemma B_authenticates_A_bis: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1119
     "\<lbrakk> Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key K, Cert1, Cert2\<rbrace> \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1120
        Gets B (Cert2) \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1121
         B \<noteq> Spy; \<not>illegalUse(Card A); \<not>illegalUse(Card B); 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1122
         evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1123
      \<Longrightarrow> Outpts (Card A) A  \<lbrace>Agent B, Nonce Nb, Key K, Cert2\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1124
apply (blast dest: Outpts_B_Card_form_7 B_authenticates_A)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1125
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1126
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1127
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1128
(*END authentication theorems*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1129
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1130
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1131
lemma Confidentiality_A: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1132
      "\<lbrakk> Outpts (Card A) A \<lbrace>Agent B, Nonce Nb, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1133
                       Key K, Certificate\<rbrace> \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1134
         Notes Spy \<lbrace>Key K, Nonce Nb, Agent A, Agent B\<rbrace> \<notin> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1135
         A \<noteq> Spy; B \<noteq> Spy; \<not>illegalUse(Card A); \<not>illegalUse(Card B); 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1136
         evs \<in> srb \<rbrakk>           
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1137
     \<Longrightarrow> Key K \<notin> analz (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1138
apply (drule A_authenticates_B)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1139
prefer 3
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1140
apply (erule exE)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1141
apply (drule Confidentiality_B)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1142
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1143
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1144
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1145
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1146
lemma Outpts_imp_knows_agents_secureM_srb: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1147
   "\<lbrakk> Outpts (Card A) A X \<in> set evs; evs \<in> srb \<rbrakk> \<Longrightarrow> X \<in> knows A evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1148
apply (simp (no_asm_simp) add: Outpts_imp_knows_agents_secureM)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1149
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1150
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1151
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1152
(*BEGIN key distribution theorems*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1153
lemma A_keydist_to_B: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1154
   "\<lbrakk> Outpts (Card A) A \<lbrace>Agent B, Nonce Nb, Key K, Certificate\<rbrace> \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1155
         \<not>illegalUse(Card B); 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1156
         evs \<in> srb \<rbrakk>           
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1157
     \<Longrightarrow> Key K \<in> analz (knows B evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1158
apply (drule A_authenticates_B)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1159
prefer 3
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1160
apply (erule exE)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1161
apply (rule Outpts_imp_knows_agents_secureM_srb [THEN analz.Inj, THEN analz.Snd, THEN analz.Snd, THEN analz.Fst])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1162
apply assumption+
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1163
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1164
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1165
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1166
lemma B_keydist_to_A: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1167
"\<lbrakk> Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key K, Cert1, Cert2\<rbrace> \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1168
   Gets B (Cert2) \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1169
   B \<noteq> Spy; \<not>illegalUse(Card A); \<not>illegalUse(Card B); 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1170
   evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1171
 \<Longrightarrow> Key K \<in> analz (knows A evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1172
apply (frule Outpts_B_Card_form_7)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1173
apply assumption apply simp
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1174
apply (frule B_authenticates_A)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1175
apply (rule_tac [5] Outpts_imp_knows_agents_secureM_srb [THEN analz.Inj, THEN analz.Snd, THEN analz.Snd, THEN analz.Fst])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1176
apply simp+
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1177
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1178
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1179
(*END key distribution theorems*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1180
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1181
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1182
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1183
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1184
(*BEGIN further theorems about authenticity of verifiers - useful to cards,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1185
  and somewhat to agents *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1186
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1187
(*MSG11
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1188
If B receives the verifier of msg11, then the verifier originated with msg7.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1189
This is clearly not available to B: B can't check the form of the verifier because he doesn't know pairK(A,B)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1190
*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1191
lemma Nb_certificate_authentic_B: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1192
     "\<lbrakk> Gets B (Crypt (pairK(A,B)) (Nonce Nb)) \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1193
        B \<noteq> Spy; \<not>illegalUse(Card B); 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1194
        evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1195
     \<Longrightarrow> \<exists> Na. 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1196
            Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key (sesK(Nb,pairK(A,B))),   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1197
                Crypt (pairK(A,B)) \<lbrace>Nonce Na, Nonce Nb\<rbrace>, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1198
                Crypt (pairK(A,B)) (Nonce Nb)\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1199
apply (blast dest: Gets_imp_knows_Spy [THEN parts.Inj, THEN Nb_certificate_authentic_bis])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1200
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1201
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1202
(*MSG10
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1203
If A obtains the verifier of msg10, then the verifier originated with msg7:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1204
A_authenticates_B. It is useful to A, who can check the form of the 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1205
verifier by application of Outpts_A_Card_form_10.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1206
*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1207
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1208
(*MSG9
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1209
The first verifier verifies the Pairkey to the card: since it's encrypted
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1210
under Ka, it must come from the server (if A's card is not cloned).
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1211
The second verifier verifies both nonces, since it's encrypted under the
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1212
pairK, it must originate with B's card  (if A and B's cards not cloned).
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1213
The third verifier verifies Na: since it's encrytped under the card's key,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1214
it originated with the card; so the card does not need to save Na
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1215
in the first place and do a comparison now: it just verifies Na through the
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1216
verifier. Three theorems related to these three statements.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1217
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1218
Recall that a card can check the form of the verifiers (can decrypt them),
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1219
while an agent in general cannot, if not provided with a suitable theorem.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1220
*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1221
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1222
(*Card A can't reckon the pairkey - we need to guarantee its integrity!*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1223
lemma Pairkey_certificate_authentic_A_Card: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1224
     "\<lbrakk> Inputs A (Card A)   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1225
             \<lbrace>Agent B, Nonce Na, Nonce Nb, Nonce Pk, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1226
               Crypt (shrK A) \<lbrace>Nonce Pk, Agent B\<rbrace>,  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1227
               Cert2, Cert3\<rbrace> \<in> set evs; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1228
         A \<noteq> Spy; Card A \<notin> cloned; evs \<in> srb \<rbrakk>   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1229
     \<Longrightarrow> Pk = Pairkey(A,B) \<and>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1230
         Says Server A \<lbrace>Nonce (Pairkey(A,B)),  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1231
                  Crypt (shrK A) \<lbrace>Nonce (Pairkey(A,B)), Agent B\<rbrace>\<rbrace>   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1232
           \<in> set evs "
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1233
apply (blast dest: Inputs_A_Card_9 Gets_imp_knows_Spy [THEN parts.Inj, THEN parts.Snd] Pairkey_certificate_authentic)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1234
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1235
(*the second conjunct of the thesis might be regarded as a form of integrity 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1236
  in the sense of Neuman-Ts'o*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1237
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1238
lemma Na_Nb_certificate_authentic_A_Card: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1239
      "\<lbrakk> Inputs A (Card A)   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1240
             \<lbrace>Agent B, Nonce Na, Nonce Nb, Nonce Pk, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1241
          Cert1, Crypt (pairK(A,B)) \<lbrace>Nonce Na, Nonce Nb\<rbrace>, Cert3\<rbrace> \<in> set evs; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1242
      A \<noteq> Spy; \<not>illegalUse(Card B); evs \<in> srb \<rbrakk> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1243
   \<Longrightarrow> Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key (sesK(Nb, pairK (A, B))),    
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1244
                             Crypt (pairK(A,B)) \<lbrace>Nonce Na, Nonce Nb\<rbrace>,  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1245
                             Crypt (pairK(A,B)) (Nonce Nb)\<rbrace>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1246
           \<in> set evs "
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1247
apply (frule Inputs_A_Card_9)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1248
apply assumption+
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1249
apply (blast dest: Inputs_A_Card_9 Gets_imp_knows_Spy [THEN parts.Inj, THEN parts.Snd, THEN Na_Nb_certificate_authentic])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1250
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1251
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1252
lemma Na_authentic_A_Card: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1253
     "\<lbrakk> Inputs A (Card A)   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1254
             \<lbrace>Agent B, Nonce Na, Nonce Nb, Nonce Pk, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1255
                Cert1, Cert2, Cert3\<rbrace> \<in> set evs; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1256
         A \<noteq> Spy; evs \<in> srb \<rbrakk>   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1257
     \<Longrightarrow> Outpts (Card A) A \<lbrace>Nonce Na, Cert3\<rbrace>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1258
           \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1259
apply (blast dest: Inputs_A_Card_9)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1260
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1261
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1262
(* These three theorems for Card A can be put together trivially.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1263
They are separated to highlight the different requirements on agents
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1264
and their cards.*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1265
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1266
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1267
lemma Inputs_A_Card_9_authentic: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1268
  "\<lbrakk> Inputs A (Card A)   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1269
             \<lbrace>Agent B, Nonce Na, Nonce Nb, Nonce Pk, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1270
               Crypt (shrK A) \<lbrace>Nonce Pk, Agent B\<rbrace>,  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1271
               Crypt (pairK(A,B)) \<lbrace>Nonce Na, Nonce Nb\<rbrace>, Cert3\<rbrace> \<in> set evs; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1272
    A \<noteq> Spy; Card A \<notin> cloned; \<not>illegalUse(Card B); evs \<in> srb \<rbrakk>   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1273
    \<Longrightarrow>  Says Server A \<lbrace>Nonce Pk, Crypt (shrK A) \<lbrace>Nonce Pk, Agent B\<rbrace>\<rbrace>   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1274
           \<in> set evs  \<and> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1275
       Outpts (Card B) B \<lbrace>Nonce Nb, Agent A,  Key (sesK(Nb, pairK (A, B))),    
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1276
                             Crypt (pairK(A,B)) \<lbrace>Nonce Na, Nonce Nb\<rbrace>,  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1277
                             Crypt (pairK(A,B)) (Nonce Nb)\<rbrace>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1278
           \<in> set evs  \<and> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1279
         Outpts (Card A) A \<lbrace>Nonce Na, Cert3\<rbrace>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1280
           \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1281
apply (blast dest: Inputs_A_Card_9 Na_Nb_certificate_authentic Gets_imp_knows_Spy [THEN parts.Inj, THEN parts.Snd] Pairkey_certificate_authentic)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1282
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1283
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1284
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1285
(*MSG8
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1286
Nothing to prove because the message is a cleartext that comes from the 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1287
network*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1288
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1289
(*Other messages: nothing to prove because the verifiers involved are new*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1290
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1291
(*END further theorems about authenticity of verifiers*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1292
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1293
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1294
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1295
(* BEGIN trivial guarantees on outputs for agents *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1296
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1297
(*MSG4*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1298
lemma SR_U4_imp: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1299
     "\<lbrakk> Outpts (Card A) A \<lbrace>Nonce Na, Crypt (crdK (Card A)) (Nonce Na)\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1300
           \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1301
         A \<noteq> Spy; evs \<in> srb \<rbrakk>                 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1302
     \<Longrightarrow> \<exists> Pk V. Gets A \<lbrace>Pk, V\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1303
apply (blast dest: Outpts_A_Card_4 Inputs_A_Card_3)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1304
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1305
(*weak: could strengthen the model adding verifier for the Pairkey to msg3*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1306
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1307
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1308
(*MSG7*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1309
lemma SR_U7_imp: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1310
     "\<lbrakk> Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key K,  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1311
                      Crypt (pairK(A,B)) \<lbrace>Nonce Na, Nonce Nb\<rbrace>,  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1312
                      Cert2\<rbrace> \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1313
         B \<noteq> Spy; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1314
     \<Longrightarrow> Gets B \<lbrace>Agent A, Nonce Na\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1315
apply (blast dest: Outpts_B_Card_7 Inputs_B_Card_6)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1316
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1317
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1318
(*MSG10*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1319
lemma SR_U10_imp: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1320
     "\<lbrakk> Outpts (Card A) A \<lbrace>Agent B, Nonce Nb, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1321
                           Key K, Crypt (pairK(A,B)) (Nonce Nb)\<rbrace>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1322
         \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1323
        A \<noteq> Spy; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1324
     \<Longrightarrow> \<exists> Cert1 Cert2.  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1325
                   Gets A \<lbrace>Nonce (Pairkey (A, B)), Cert1\<rbrace> \<in> set evs \<and>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1326
                   Gets A \<lbrace>Nonce Nb, Cert2\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1327
apply (blast dest: Outpts_A_Card_10 Inputs_A_Card_9)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1328
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1329
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1330
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1331
(*END trivial guarantees on outputs for agents*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1332
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1333
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1334
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1335
(*INTEGRITY*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1336
lemma Outpts_Server_not_evs: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1337
      "evs \<in> srb \<Longrightarrow> Outpts (Card Server) P X \<notin> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1338
apply (erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1339
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1340
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1341
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1342
text{*@{term step2_integrity} also is a reliability theorem*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1343
lemma Says_Server_message_form: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1344
     "\<lbrakk> Says Server A \<lbrace>Pk, Certificate\<rbrace> \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1345
         evs \<in> srb \<rbrakk>                   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1346
     \<Longrightarrow> \<exists> B. Pk = Nonce (Pairkey(A,B)) \<and>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1347
         Certificate = Crypt (shrK A) \<lbrace>Nonce (Pairkey(A,B)), Agent B\<rbrace>"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1348
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1349
apply (erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1350
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1351
apply (blast dest!: Outpts_Server_not_evs)+
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1352
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1353
(*cannot be made useful to A in form of a Gets event*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1354
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1355
text{*
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1356
  step4integrity is @{term Outpts_A_Card_form_4}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1357
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1358
  step7integrity is @{term Outpts_B_Card_form_7}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1359
*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1360
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1361
lemma step8_integrity: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1362
     "\<lbrakk> Says B A \<lbrace>Nonce Nb, Certificate\<rbrace> \<in> set evs;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1363
         B \<noteq> Server; B \<noteq> Spy; evs \<in> srb \<rbrakk>                   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1364
     \<Longrightarrow> \<exists> Cert2 K.   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1365
    Outpts (Card B) B \<lbrace>Nonce Nb, Agent A, Key K, Certificate, Cert2\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1366
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1367
apply (erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1368
prefer 18 apply (fastsimp dest: Outpts_A_Card_form_10)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1369
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1370
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1371
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1372
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1373
text{*  step9integrity is @{term Inputs_A_Card_form_9}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1374
        step10integrity is @{term Outpts_A_Card_form_10}.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1375
*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1376
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1377
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1378
lemma step11_integrity: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1379
     "\<lbrakk> Says A B (Certificate) \<in> set evs; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1380
         \<forall> p q. Certificate \<noteq> \<lbrace>p, q\<rbrace>;  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1381
         A \<noteq> Spy; evs \<in> srb \<rbrakk>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1382
     \<Longrightarrow> \<exists> K Nb.  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1383
      Outpts (Card A) A \<lbrace>Agent B, Nonce Nb, Key K, Certificate\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1384
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1385
apply (erule srb.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1386
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1387
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1388
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1389
end
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1390