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