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