src/HOL/Auth/KerberosIV_Gets.thy
author wenzelm
Tue, 19 Sep 2006 18:18:11 +0200
changeset 20610 09ef37366a31
parent 18886 9f27383426db
child 20768 1d478c2d621f
permissions -rwxr-xr-x
moved Import/susp.ML to Pure/General;
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
(*  Title:      HOL/Auth/KerberosIV
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     2
    ID:         $Id$
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     3
    Author:     Giampaolo Bella, Cambridge University Computer Laboratory
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     4
    Copyright   1998  University of Cambridge
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     5
*)
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
header{*The Kerberos Protocol, Version IV*}
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
theory KerberosIV_Gets imports Public begin
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
text{*The "u" prefix indicates theorems referring to an updated version of the protocol. The "r" suffix indicates theorems where the confidentiality assumptions are relaxed by the corresponding arguments.*}
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
syntax
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    14
  Kas :: agent
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    15
  Tgs :: agent  --{*the two servers are translations...*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    16
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    17
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    18
translations
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    19
  "Kas"       == "Server "
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    20
  "Tgs"       == "Friend 0"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    21
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    22
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    23
axioms
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    24
  Tgs_not_bad [iff]: "Tgs \<notin> bad"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    25
   --{*Tgs is secure --- we already know that Kas is secure*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    26
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    27
(*The current time is just the length of the trace!*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    28
syntax
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    29
    CT :: "event list=>nat"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    30
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    31
    expiredAK :: "[nat, event list] => bool"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    32
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    33
    expiredSK :: "[nat, event list] => bool"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    34
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    35
    expiredA :: "[nat, event list] => bool"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    36
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    37
    valid :: "[nat, nat] => bool" ("valid _ wrt _")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    38
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    39
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    40
constdefs
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    41
 (* authKeys are those contained in an authTicket *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    42
    authKeys :: "event list => key set"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    43
    "authKeys evs == {authK. \<exists>A Peer Ta. Says Kas A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    44
                        (Crypt (shrK A) \<lbrace>Key authK, Agent Peer, Number Ta,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    45
               (Crypt (shrK Peer) \<lbrace>Agent A, Agent Peer, Key authK, Number Ta\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    46
                  \<rbrace>) \<in> set evs}"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    47
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    48
 (* States than an event really appears only once on a trace *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    49
  Unique :: "[event, event list] => bool" ("Unique _ on _")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    50
   "Unique ev on evs == 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    51
      ev \<notin> set (tl (dropWhile (% z. z \<noteq> ev) evs))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    52
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    53
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    54
consts
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    55
    (*Duration of the authentication key*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    56
    authKlife   :: nat
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    57
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    58
    (*Duration of the service key*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    59
    servKlife   :: nat
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    60
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    61
    (*Duration of an authenticator*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    62
    authlife   :: nat
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
    (*Upper bound on the time of reaction of a server*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    65
    replylife   :: nat
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    66
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    67
specification (authKlife)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    68
  authKlife_LB [iff]: "2 \<le> authKlife"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    69
    by blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    70
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    71
specification (servKlife)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    72
  servKlife_LB [iff]: "2 + authKlife \<le> servKlife"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    73
    by blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    74
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    75
specification (authlife)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    76
  authlife_LB [iff]: "Suc 0 \<le> authlife"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    77
    by blast
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
specification (replylife)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    80
  replylife_LB [iff]: "Suc 0 \<le> replylife"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    81
    by blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    82
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    83
translations
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    84
   "CT" == "length "
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    85
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    86
   "expiredAK Ta evs" == "authKlife + Ta < CT evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    87
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    88
   "expiredSK Ts evs" == "servKlife + Ts < CT evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    89
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    90
   "expiredA T evs" == "authlife + T < CT evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    91
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    92
   "valid T1 wrt T2" == "T1 <= replylife + T2"
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
(*---------------------------------------------------------------------*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    95
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    96
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    97
(* Predicate formalising the association between authKeys and servKeys *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    98
constdefs
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    99
  AKcryptSK :: "[key, key, event list] => bool"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   100
  "AKcryptSK authK servK evs ==
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   101
     \<exists>A B Ts.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   102
       Says Tgs A (Crypt authK
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   103
                     \<lbrace>Key servK, Agent B, Number Ts,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   104
                       Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace> \<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   105
         \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   106
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   107
consts
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
kerbIV_gets   :: "event list set"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   110
inductive "kerbIV_gets"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   111
  intros
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   112
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   113
   Nil:  "[] \<in> kerbIV_gets"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   114
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   115
   Fake: "\<lbrakk> evsf \<in> kerbIV_gets;  X \<in> synth (analz (spies evsf)) \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   116
          \<Longrightarrow> Says Spy B X  # evsf \<in> kerbIV_gets"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   117
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   118
   Reception: "\<lbrakk> evsr \<in> kerbIV_gets;  Says A B X \<in> set evsr \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   119
                \<Longrightarrow> Gets B X # evsr \<in> kerbIV_gets"
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
(* FROM the initiator *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   122
   K1:   "\<lbrakk> evs1 \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   123
          \<Longrightarrow> Says A Kas \<lbrace>Agent A, Agent Tgs, Number (CT evs1)\<rbrace> # evs1
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   124
          \<in> kerbIV_gets"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   125
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   126
(* Adding the timestamp serves to A in K3 to check that
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   127
   she doesn't get a reply too late. This kind of timeouts are ordinary.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   128
   If a server's reply is late, then it is likely to be fake. *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   129
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   130
(*---------------------------------------------------------------------*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   131
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   132
(*FROM Kas *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   133
   K2:  "\<lbrakk> evs2 \<in> kerbIV_gets; Key authK \<notin> used evs2; authK \<in> symKeys;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   134
            Gets Kas \<lbrace>Agent A, Agent Tgs, Number T1\<rbrace> \<in> set evs2 \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   135
          \<Longrightarrow> Says Kas A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   136
                (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number (CT evs2),
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   137
                      (Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   138
                          Number (CT evs2)\<rbrace>)\<rbrace>) # evs2 \<in> kerbIV_gets"
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 internal encryption builds the authTicket.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   141
  The timestamp doesn't change inside the two encryptions: the external copy
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   142
  will be used by the initiator in K3; the one inside the
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   143
  authTicket by Tgs in K4.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   144
*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   145
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   146
(*---------------------------------------------------------------------*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   147
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   148
(* FROM the initiator *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   149
   K3:  "\<lbrakk> evs3 \<in> kerbIV_gets;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   150
            Says A Kas \<lbrace>Agent A, Agent Tgs, Number T1\<rbrace> \<in> set evs3;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   151
            Gets A (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   152
              authTicket\<rbrace>) \<in> set evs3;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   153
            valid Ta wrt T1
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   154
         \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   155
          \<Longrightarrow> Says A Tgs \<lbrace>authTicket,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   156
                           (Crypt authK \<lbrace>Agent A, Number (CT evs3)\<rbrace>),
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   157
                           Agent B\<rbrace> # evs3 \<in> kerbIV_gets"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   158
(*The two events amongst the premises allow A to accept only those authKeys
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   159
  that are not issued late. *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   160
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   161
(*---------------------------------------------------------------------*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   162
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   163
(* FROM Tgs *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   164
(* Note that the last temporal check is not mentioned in the original MIT
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   165
   specification. Adding it makes many goals "available" to the peers. 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   166
   Theorems that exploit it have the suffix `_u', which stands for updated 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   167
   protocol.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   168
*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   169
   K4:  "\<lbrakk> evs4 \<in> kerbIV_gets; Key servK \<notin> used evs4; servK \<in> symKeys;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   170
            B \<noteq> Tgs;  authK \<in> symKeys;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   171
            Gets Tgs \<lbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   172
             (Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   173
				 Number Ta\<rbrace>),
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   174
             (Crypt authK \<lbrace>Agent A, Number T2\<rbrace>), Agent B\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   175
	        \<in> set evs4;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   176
            \<not> expiredAK Ta evs4;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   177
            \<not> expiredA T2 evs4;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   178
            servKlife + (CT evs4) <= authKlife + Ta
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   179
         \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   180
          \<Longrightarrow> Says Tgs A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   181
                (Crypt authK \<lbrace>Key servK, Agent B, Number (CT evs4),
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   182
			       Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   183
		 			        Number (CT evs4)\<rbrace> \<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   184
	        # evs4 \<in> kerbIV_gets"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   185
(* Tgs creates a new session key per each request for a service, without
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   186
   checking if there is still a fresh one for that service.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   187
   The cipher under Tgs' key is the authTicket, the cipher under B's key
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   188
   is the servTicket, which is built now.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   189
   NOTE that the last temporal check is not present in the MIT specification.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   190
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   191
*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   192
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   193
(*---------------------------------------------------------------------*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   194
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   195
(* FROM the initiator *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   196
   K5:  "\<lbrakk> evs5 \<in> kerbIV_gets; authK \<in> symKeys; servK \<in> symKeys;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   197
            Says A Tgs
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   198
                \<lbrace>authTicket, Crypt authK \<lbrace>Agent A, Number T2\<rbrace>,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   199
		  Agent B\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   200
              \<in> set evs5;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   201
            Gets A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   202
             (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   203
                \<in> set evs5;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   204
            valid Ts wrt T2 \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   205
          \<Longrightarrow> Says A B \<lbrace>servTicket,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   206
			 Crypt servK \<lbrace>Agent A, Number (CT evs5)\<rbrace> \<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   207
               # evs5 \<in> kerbIV_gets"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   208
(* Checks similar to those in K3. *)
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
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   212
(* FROM the responder*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   213
    K6:  "\<lbrakk> evs6 \<in> kerbIV_gets;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   214
            Gets B \<lbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   215
              (Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>),
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   216
              (Crypt servK \<lbrace>Agent A, Number T3\<rbrace>)\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   217
            \<in> set evs6;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   218
            \<not> expiredSK Ts evs6;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   219
            \<not> expiredA T3 evs6
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   220
         \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   221
          \<Longrightarrow> Says B A (Crypt servK (Number T3))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   222
               # evs6 \<in> kerbIV_gets"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   223
(* Checks similar to those in K4. *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   224
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   225
(*---------------------------------------------------------------------*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   226
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   227
(* Leaking an authK... *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   228
   Oops1: "\<lbrakk> evsO1 \<in> kerbIV_gets;  A \<noteq> Spy;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   229
              Says Kas A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   230
                (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   231
                                  authTicket\<rbrace>)  \<in> set evsO1;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   232
              expiredAK Ta evsO1 \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   233
          \<Longrightarrow> Says A Spy \<lbrace>Agent A, Agent Tgs, Number Ta, Key authK\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   234
               # evsO1 \<in> kerbIV_gets"
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
(*Leaking a servK... *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   239
   Oops2: "\<lbrakk> evsO2 \<in> kerbIV_gets;  A \<noteq> Spy;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   240
              Says Tgs A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   241
                (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   242
                   \<in> set evsO2;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   243
              expiredSK Ts evsO2 \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   244
          \<Longrightarrow> Says A Spy \<lbrace>Agent A, Agent B, Number Ts, Key servK\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   245
               # evsO2 \<in> kerbIV_gets"
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
declare Says_imp_knows_Spy [THEN parts.Inj, dest]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   250
declare parts.Body [dest]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   251
declare analz_into_parts [dest]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   252
declare Fake_parts_insert_in_Un [dest]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   253
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   254
subsection{*Lemmas about reception event*}
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_Says :
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   257
     "\<lbrakk> Gets B X \<in> set evs; evs \<in> kerbIV_gets \<rbrakk> \<Longrightarrow> \<exists>A. Says A B X \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   258
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   259
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   260
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   261
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   262
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   263
lemma Gets_imp_knows_Spy: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   264
     "\<lbrakk> Gets B X \<in> set evs; evs \<in> kerbIV_gets \<rbrakk>  \<Longrightarrow> X \<in> knows Spy evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   265
apply (blast dest!: Gets_imp_Says Says_imp_knows_Spy)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   266
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   267
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   268
(*Needed for force to work for example in new_keys_not_used*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   269
declare Gets_imp_knows_Spy [THEN parts.Inj, dest]
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
lemma Gets_imp_knows:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   272
     "\<lbrakk> Gets B X \<in> set evs; evs \<in> kerbIV_gets \<rbrakk>  \<Longrightarrow> X \<in> knows B evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   273
apply (case_tac "B = Spy")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   274
apply (blast dest!: Gets_imp_knows_Spy)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   275
apply (blast dest!: Gets_imp_knows_agents)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   276
done
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
subsection{*Lemmas about @{term authKeys}*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   279
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   280
lemma authKeys_empty: "authKeys [] = {}"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   281
apply (unfold authKeys_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   282
apply (simp (no_asm))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   283
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   284
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   285
lemma authKeys_not_insert:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   286
 "(\<forall>A Ta akey Peer.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   287
   ev \<noteq> Says Kas A (Crypt (shrK A) \<lbrace>akey, Agent Peer, Ta,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   288
              (Crypt (shrK Peer) \<lbrace>Agent A, Agent Peer, akey, Ta\<rbrace>)\<rbrace>))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   289
       \<Longrightarrow> authKeys (ev # evs) = authKeys evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   290
by (unfold authKeys_def, auto)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   291
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   292
lemma authKeys_insert:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   293
  "authKeys
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   294
     (Says Kas A (Crypt (shrK A) \<lbrace>Key K, Agent Peer, Number Ta,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   295
      (Crypt (shrK Peer) \<lbrace>Agent A, Agent Peer, Key K, Number Ta\<rbrace>)\<rbrace>) # evs)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   296
       = insert K (authKeys evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   297
by (unfold authKeys_def, auto)
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 authKeys_simp:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   300
   "K \<in> authKeys
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   301
    (Says Kas A (Crypt (shrK A) \<lbrace>Key K', Agent Peer, Number Ta,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   302
     (Crypt (shrK Peer) \<lbrace>Agent A, Agent Peer, Key K', Number Ta\<rbrace>)\<rbrace>) # evs)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   303
        \<Longrightarrow> K = K' | K \<in> authKeys evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   304
by (unfold authKeys_def, auto)
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
lemma authKeysI:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   307
   "Says Kas A (Crypt (shrK A) \<lbrace>Key K, Agent Tgs, Number Ta,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   308
     (Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key K, Number Ta\<rbrace>)\<rbrace>) \<in> set evs
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   309
        \<Longrightarrow> K \<in> authKeys evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   310
by (unfold authKeys_def, auto)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   311
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   312
lemma authKeys_used: "K \<in> authKeys evs \<Longrightarrow> Key K \<in> used evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   313
by (simp add: authKeys_def, blast)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   314
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   315
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   316
subsection{*Forwarding Lemmas*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   317
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   318
lemma Says_ticket_parts:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   319
     "Says S A (Crypt K \<lbrace>SesKey, B, TimeStamp, Ticket\<rbrace>) \<in> set evs
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   320
      \<Longrightarrow> Ticket \<in> parts (spies evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   321
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   322
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   323
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   324
lemma Gets_ticket_parts:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   325
     "\<lbrakk>Gets A (Crypt K \<lbrace>SesKey, Peer, Ta, Ticket\<rbrace>) \<in> set evs; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   326
      \<Longrightarrow> Ticket \<in> parts (spies evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   327
apply (blast dest: Gets_imp_knows_Spy [THEN parts.Inj])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   328
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   329
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   330
lemma Oops_range_spies1:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   331
     "\<lbrakk> Says Kas A (Crypt KeyA \<lbrace>Key authK, Peer, Ta, authTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   332
           \<in> set evs ;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   333
         evs \<in> kerbIV_gets \<rbrakk> \<Longrightarrow> authK \<notin> range shrK & authK \<in> symKeys"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   334
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   335
apply (erule kerbIV_gets.induct, auto)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   336
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   337
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   338
lemma Oops_range_spies2:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   339
     "\<lbrakk> Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Ts, servTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   340
           \<in> set evs ;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   341
         evs \<in> kerbIV_gets \<rbrakk> \<Longrightarrow> servK \<notin> range shrK & servK \<in> symKeys"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   342
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   343
apply (erule kerbIV_gets.induct, 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
(*Spy never sees another agent's shared key! (unless it's lost at start)*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   348
lemma Spy_see_shrK [simp]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   349
     "evs \<in> kerbIV_gets \<Longrightarrow> (Key (shrK A) \<in> parts (spies evs)) = (A \<in> bad)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   350
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   351
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   352
apply (frule_tac [6] Gets_ticket_parts, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   353
apply (blast+)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   354
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   355
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   356
lemma Spy_analz_shrK [simp]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   357
     "evs \<in> kerbIV_gets \<Longrightarrow> (Key (shrK A) \<in> analz (spies evs)) = (A \<in> bad)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   358
by auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   359
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   360
lemma Spy_see_shrK_D [dest!]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   361
     "\<lbrakk> Key (shrK A) \<in> parts (spies evs);  evs \<in> kerbIV_gets \<rbrakk> \<Longrightarrow> A:bad"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   362
by (blast dest: Spy_see_shrK)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   363
lemmas Spy_analz_shrK_D = analz_subset_parts [THEN subsetD, THEN Spy_see_shrK_D, dest!]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   364
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   365
text{*Nobody can have used non-existent keys!*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   366
lemma new_keys_not_used [simp]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   367
    "\<lbrakk>Key K \<notin> used evs; K \<in> symKeys; evs \<in> kerbIV_gets\<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   368
     \<Longrightarrow> K \<notin> keysFor (parts (spies evs))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   369
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   370
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   371
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   372
apply (frule_tac [6] Gets_ticket_parts, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   373
txt{*Fake*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   374
apply (force dest!: keysFor_parts_insert)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   375
txt{*Others*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   376
apply (force dest!: analz_shrK_Decrypt)+
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   377
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   378
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   379
(*Earlier, all protocol proofs declared this theorem.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   380
  But few of them actually need it! (Another is Yahalom) *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   381
lemma new_keys_not_analzd:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   382
 "\<lbrakk>evs \<in> kerbIV_gets; K \<in> symKeys; Key K \<notin> used evs\<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   383
  \<Longrightarrow> K \<notin> keysFor (analz (spies evs))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   384
by (blast dest: new_keys_not_used intro: keysFor_mono [THEN subsetD])
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
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   387
subsection{*Regularity Lemmas*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   388
text{*These concern the form of items passed in messages*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   389
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   390
text{*Describes the form of all components sent by Kas*}
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 Says_Kas_message_form:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   393
     "\<lbrakk> Says Kas A (Crypt K \<lbrace>Key authK, Agent Peer, Number Ta, authTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   394
           \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   395
         evs \<in> kerbIV_gets \<rbrakk> \<Longrightarrow>  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   396
  K = shrK A  & Peer = Tgs &
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   397
  authK \<notin> range shrK & authK \<in> authKeys evs & authK \<in> symKeys & 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   398
  authTicket = (Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   399
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   400
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   401
apply (simp_all (no_asm) add: authKeys_def authKeys_insert)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   402
apply blast+
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   403
done
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
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   406
lemma SesKey_is_session_key:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   407
     "\<lbrakk> Crypt (shrK Tgs_B) \<lbrace>Agent A, Agent Tgs_B, Key SesKey, Number T\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   408
            \<in> parts (spies evs); Tgs_B \<notin> bad;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   409
         evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   410
      \<Longrightarrow> SesKey \<notin> range shrK"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   411
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   412
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   413
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   414
apply (frule_tac [6] Gets_ticket_parts, simp_all, blast)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   415
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   416
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   417
lemma authTicket_authentic:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   418
     "\<lbrakk> Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   419
           \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   420
         evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   421
      \<Longrightarrow> Says Kas A (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   422
                 Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   423
            \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   424
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   425
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   426
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   427
apply (frule_tac [6] Gets_ticket_parts, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   428
txt{*Fake, K4*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   429
apply (blast+)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   430
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   431
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   432
lemma authTicket_crypt_authK:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   433
     "\<lbrakk> Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   434
           \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   435
         evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   436
      \<Longrightarrow> authK \<in> authKeys evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   437
apply (frule authTicket_authentic, assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   438
apply (simp (no_asm) add: authKeys_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   439
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   440
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   441
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   442
lemma Says_Tgs_message_form:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   443
     "\<lbrakk> Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   444
           \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   445
         evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   446
  \<Longrightarrow> B \<noteq> Tgs & 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   447
      authK \<notin> range shrK & authK \<in> authKeys evs & authK \<in> symKeys &
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   448
      servK \<notin> range shrK & servK \<notin> authKeys evs & servK \<in> symKeys &
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   449
      servTicket = (Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   450
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   451
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   452
apply (simp_all add: authKeys_insert authKeys_not_insert authKeys_empty authKeys_simp, blast, auto)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   453
txt{*Three subcases of Message 4*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   454
apply (blast dest!: SesKey_is_session_key)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   455
apply (blast dest: authTicket_crypt_authK)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   456
apply (blast dest!: authKeys_used Says_Kas_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   457
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   458
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   459
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   460
lemma authTicket_form:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   461
     "\<lbrakk> Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Ta, authTicket\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   462
           \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   463
         A \<notin> bad;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   464
         evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   465
    \<Longrightarrow> authK \<notin> range shrK & authK \<in> symKeys & 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   466
        authTicket = Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Ta\<rbrace>"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   467
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   468
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   469
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   470
apply (frule_tac [6] Gets_ticket_parts, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   471
apply blast+
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   472
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   473
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   474
text{* This form holds also over an authTicket, but is not needed below.*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   475
lemma servTicket_form:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   476
     "\<lbrakk> Crypt authK \<lbrace>Key servK, Agent B, Ts, servTicket\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   477
              \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   478
            Key authK \<notin> analz (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   479
            evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   480
         \<Longrightarrow> servK \<notin> range shrK & servK \<in> symKeys & 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   481
    (\<exists>A. servTicket = Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Ts\<rbrace>)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   482
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   483
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   484
apply (erule kerbIV_gets.induct, analz_mono_contra)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   485
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   486
apply (frule_tac [6] Gets_ticket_parts, simp_all, blast)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   487
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   488
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   489
text{* Essentially the same as @{text authTicket_form} *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   490
lemma Says_kas_message_form:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   491
     "\<lbrakk> Gets A (Crypt (shrK A)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   492
              \<lbrace>Key authK, Agent Tgs, Ta, authTicket\<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   493
         evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   494
      \<Longrightarrow> authK \<notin> range shrK & authK \<in> symKeys & 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   495
          authTicket =
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   496
                  Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Ta\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   497
          | authTicket \<in> analz (spies evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   498
by (blast dest: analz_shrK_Decrypt authTicket_form
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   499
                Gets_imp_knows_Spy [THEN analz.Inj])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   500
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   501
lemma Says_tgs_message_form:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   502
 "\<lbrakk> Gets A (Crypt authK \<lbrace>Key servK, Agent B, Ts, servTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   503
       \<in> set evs;  authK \<in> symKeys;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   504
     evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   505
  \<Longrightarrow> servK \<notin> range shrK &
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   506
      (\<exists>A. servTicket =
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   507
	      Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Ts\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   508
       | servTicket \<in> analz (spies evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   509
apply (frule Gets_imp_knows_Spy [THEN analz.Inj], auto)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   510
 apply (force dest!: servTicket_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   511
apply (frule analz_into_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   512
apply (frule servTicket_form, auto)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   513
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   514
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   515
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   516
subsection{*Authenticity theorems: confirm origin of sensitive messages*}
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 authK_authentic:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   519
     "\<lbrakk> Crypt (shrK A) \<lbrace>Key authK, Peer, Ta, authTicket\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   520
           \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   521
         A \<notin> bad;  evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   522
      \<Longrightarrow> Says Kas A (Crypt (shrK A) \<lbrace>Key authK, Peer, Ta, authTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   523
            \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   524
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   525
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   526
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   527
apply (frule_tac [6] Gets_ticket_parts, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   528
txt{*Fake*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   529
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   530
txt{*K4*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   531
apply (blast dest!: authTicket_authentic [THEN Says_Kas_message_form])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   532
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   533
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   534
text{*If a certain encrypted message appears then it originated with Tgs*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   535
lemma servK_authentic:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   536
     "\<lbrakk> Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   537
           \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   538
         Key authK \<notin> analz (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   539
         authK \<notin> range shrK;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   540
         evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   541
 \<Longrightarrow> \<exists>A. Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   542
       \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   543
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   544
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   545
apply (erule kerbIV_gets.induct, analz_mono_contra)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   546
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   547
apply (frule_tac [6] Gets_ticket_parts, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   548
txt{*Fake*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   549
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   550
txt{*K2*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   551
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   552
txt{*K4*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   553
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   554
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   555
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   556
lemma servK_authentic_bis:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   557
     "\<lbrakk> Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   558
           \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   559
         Key authK \<notin> analz (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   560
         B \<noteq> Tgs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   561
         evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   562
 \<Longrightarrow> \<exists>A. Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   563
       \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   564
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   565
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   566
apply (erule kerbIV_gets.induct, analz_mono_contra)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   567
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   568
apply (frule_tac [6] Gets_ticket_parts, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   569
txt{*Fake*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   570
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   571
txt{*K4*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   572
apply blast
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
text{*Authenticity of servK for B*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   576
lemma servTicket_authentic_Tgs:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   577
     "\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   578
           \<in> parts (spies evs); B \<noteq> Tgs;  B \<notin> bad;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   579
         evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   580
 \<Longrightarrow> \<exists>authK.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   581
       Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   582
                   Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   583
       \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   584
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   585
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   586
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   587
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   588
apply (frule_tac [6] Gets_ticket_parts, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   589
apply blast+
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   590
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   591
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   592
text{*Anticipated here from next subsection*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   593
lemma K4_imp_K2:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   594
"\<lbrakk> Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   595
      \<in> set evs;  evs \<in> kerbIV_gets\<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   596
   \<Longrightarrow> \<exists>Ta. Says Kas A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   597
        (Crypt (shrK A)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   598
         \<lbrace>Key authK, Agent Tgs, Number Ta,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   599
           Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   600
        \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   601
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   602
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   603
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   604
apply (frule_tac [6] Gets_ticket_parts, simp_all, auto)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   605
apply (blast dest!: Gets_imp_knows_Spy [THEN parts.Inj, THEN parts.Fst, THEN authTicket_authentic])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   606
done
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
text{*Anticipated here from next subsection*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   609
lemma u_K4_imp_K2:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   610
"\<lbrakk> Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   611
      \<in> set evs; evs \<in> kerbIV_gets\<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   612
   \<Longrightarrow> \<exists>Ta. (Says Kas A (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   613
           Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   614
             \<in> set evs
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   615
          & servKlife + Ts <= authKlife + Ta)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   616
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   617
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   618
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   619
apply (frule_tac [6] Gets_ticket_parts, simp_all, auto)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   620
apply (blast dest!: Gets_imp_knows_Spy [THEN parts.Inj, THEN parts.Fst, THEN authTicket_authentic])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   621
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   622
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   623
lemma servTicket_authentic_Kas:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   624
     "\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   625
           \<in> parts (spies evs);  B \<noteq> Tgs;  B \<notin> bad;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   626
         evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   627
  \<Longrightarrow> \<exists>authK Ta.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   628
       Says Kas A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   629
         (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   630
            Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   631
        \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   632
apply (blast dest!: servTicket_authentic_Tgs K4_imp_K2)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   633
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   634
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   635
lemma u_servTicket_authentic_Kas:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   636
     "\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   637
           \<in> parts (spies evs);  B \<noteq> Tgs;  B \<notin> bad;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   638
         evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   639
  \<Longrightarrow> \<exists>authK Ta. Says Kas A (Crypt(shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   640
           Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   641
             \<in> set evs
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   642
           & servKlife + Ts <= authKlife + Ta"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   643
apply (blast dest!: servTicket_authentic_Tgs u_K4_imp_K2)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   644
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   645
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   646
lemma servTicket_authentic:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   647
     "\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   648
           \<in> parts (spies evs);  B \<noteq> Tgs;  B \<notin> bad;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   649
         evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   650
 \<Longrightarrow> \<exists>Ta authK.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   651
     Says Kas A (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   652
                   Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   653
       \<in> set evs
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   654
     & Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   655
                   Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   656
       \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   657
apply (blast dest: servTicket_authentic_Tgs K4_imp_K2)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   658
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   659
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   660
lemma u_servTicket_authentic:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   661
     "\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   662
           \<in> parts (spies evs);  B \<noteq> Tgs;  B \<notin> bad;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   663
         evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   664
 \<Longrightarrow> \<exists>Ta authK.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   665
     (Says Kas A (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   666
                   Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   667
       \<in> set evs
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   668
     & Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   669
                   Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   670
       \<in> set evs
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   671
     & servKlife + Ts <= authKlife + Ta)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   672
apply (blast dest: servTicket_authentic_Tgs u_K4_imp_K2)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   673
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   674
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   675
lemma u_NotexpiredSK_NotexpiredAK:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   676
     "\<lbrakk> \<not> expiredSK Ts evs; servKlife + Ts <= authKlife + Ta \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   677
      \<Longrightarrow> \<not> expiredAK Ta evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   678
apply (blast dest: leI le_trans dest: leD)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   679
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   680
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   681
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   682
subsection{* Reliability: friendly agents send something if something else happened*}
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
lemma K3_imp_K2:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   685
     "\<lbrakk> Says A Tgs
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   686
             \<lbrace>authTicket, Crypt authK \<lbrace>Agent A, Number T2\<rbrace>, Agent B\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   687
           \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   688
         A \<notin> bad;  evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   689
      \<Longrightarrow> \<exists>Ta. Says Kas A (Crypt (shrK A)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   690
                      \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   691
                   \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   692
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   693
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   694
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   695
apply (frule_tac [6] Gets_ticket_parts, simp_all, blast, blast)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   696
apply (blast dest: Gets_imp_knows_Spy [THEN parts.Inj, THEN authK_authentic])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   697
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   698
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   699
text{*Anticipated here from next subsection. An authK is encrypted by one and only one Shared key. A servK is encrypted by one and only one authK.*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   700
lemma Key_unique_SesKey:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   701
     "\<lbrakk> Crypt K  \<lbrace>Key SesKey,  Agent B, T, Ticket\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   702
           \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   703
         Crypt K' \<lbrace>Key SesKey,  Agent B', T', Ticket'\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   704
           \<in> parts (spies evs);  Key SesKey \<notin> analz (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   705
         evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   706
      \<Longrightarrow> K=K' & B=B' & T=T' & Ticket=Ticket'"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   707
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   708
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   709
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   710
apply (erule kerbIV_gets.induct, analz_mono_contra)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   711
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   712
apply (frule_tac [6] Gets_ticket_parts, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   713
txt{*Fake, K2, K4*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   714
apply (blast+)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   715
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   716
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   717
lemma Tgs_authenticates_A:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   718
  "\<lbrakk>  Crypt authK \<lbrace>Agent A, Number T2\<rbrace> \<in> parts (spies evs); 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   719
      Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   720
           \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   721
      Key authK \<notin> analz (spies evs); A \<notin> bad; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   722
 \<Longrightarrow> \<exists> B. Says A Tgs \<lbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   723
          Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   724
          Crypt authK \<lbrace>Agent A, Number T2\<rbrace>, Agent B \<rbrace> \<in> set evs"  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   725
apply (drule authTicket_authentic, assumption, rotate_tac 4)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   726
apply (erule rev_mp, erule rev_mp, erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   727
apply (erule kerbIV_gets.induct, analz_mono_contra)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   728
apply (frule_tac [6] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   729
apply (frule_tac [9] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   730
apply (simp_all (no_asm_simp) add: all_conj_distrib)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   731
txt{*Fake*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   732
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   733
txt{*K2*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   734
apply (force dest!: Crypt_imp_keysFor)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   735
txt{*K3*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   736
apply (blast dest: Key_unique_SesKey)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   737
txt{*K5*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   738
txt{*If authKa were compromised, so would be authK*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   739
apply (case_tac "Key authKa \<in> analz (spies evs5)")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   740
apply (force dest!: Gets_imp_knows_Spy [THEN analz.Inj, THEN analz.Decrypt, THEN analz.Fst])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   741
txt{*Besides, since authKa originated with Kas anyway...*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   742
apply (clarify, drule K3_imp_K2, assumption, assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   743
apply (clarify, drule Says_Kas_message_form, assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   744
txt{*...it cannot be a shared key*. Therefore @{term servK_authentic} applies. 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   745
     Contradition: Tgs used authK as a servkey, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   746
     while Kas used it as an authkey*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   747
apply (blast dest: servK_authentic Says_Tgs_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   748
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   749
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   750
lemma Says_K5:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   751
     "\<lbrakk> Crypt servK \<lbrace>Agent A, Number T3\<rbrace> \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   752
         Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   753
                                     servTicket\<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   754
         Key servK \<notin> analz (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   755
         A \<notin> bad; B \<notin> bad; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   756
 \<Longrightarrow> Says A B \<lbrace>servTicket, Crypt servK \<lbrace>Agent A, Number T3\<rbrace>\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   757
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   758
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   759
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   760
apply (erule kerbIV_gets.induct, analz_mono_contra)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   761
apply (frule_tac [6] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   762
apply (frule_tac [9] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   763
apply (simp_all (no_asm_simp) add: all_conj_distrib)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   764
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   765
txt{*K3*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   766
apply (blast dest: authK_authentic Says_Kas_message_form Says_Tgs_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   767
txt{*K4*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   768
apply (force dest!: Crypt_imp_keysFor)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   769
txt{*K5*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   770
apply (blast dest: Key_unique_SesKey)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   771
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   772
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   773
text{*Anticipated here from next subsection*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   774
lemma unique_CryptKey:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   775
     "\<lbrakk> Crypt (shrK B)  \<lbrace>Agent A,  Agent B,  Key SesKey, T\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   776
           \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   777
         Crypt (shrK B') \<lbrace>Agent A', Agent B', Key SesKey, T'\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   778
           \<in> parts (spies evs);  Key SesKey \<notin> analz (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   779
         evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   780
      \<Longrightarrow> A=A' & B=B' & T=T'"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   781
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   782
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   783
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   784
apply (erule kerbIV_gets.induct, analz_mono_contra)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   785
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   786
apply (frule_tac [6] Gets_ticket_parts, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   787
txt{*Fake, K2, K4*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   788
apply (blast+)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   789
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   790
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   791
lemma Says_K6:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   792
     "\<lbrakk> Crypt servK (Number T3) \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   793
         Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   794
                                     servTicket\<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   795
         Key servK \<notin> analz (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   796
         A \<notin> bad; B \<notin> bad; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   797
      \<Longrightarrow> Says B A (Crypt servK (Number T3)) \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   798
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   799
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   800
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   801
apply (erule kerbIV_gets.induct, analz_mono_contra)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   802
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   803
apply (frule_tac [6] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   804
apply (simp_all (no_asm_simp))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   805
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   806
apply (force dest!: Crypt_imp_keysFor, clarify)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   807
apply (frule Says_Tgs_message_form, assumption, clarify) (*PROOF FAILED if omitted*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   808
apply (blast dest: unique_CryptKey)
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
text{*Needs a unicity theorem, hence moved here*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   812
lemma servK_authentic_ter:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   813
 "\<lbrakk> Says Kas A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   814
    (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   815
     Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   816
       \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   817
     Key authK \<notin> analz (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   818
     evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   819
 \<Longrightarrow> Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   820
       \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   821
apply (frule Says_Kas_message_form, assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   822
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   823
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   824
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   825
apply (erule kerbIV_gets.induct, analz_mono_contra)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   826
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   827
apply (frule_tac [6] Gets_ticket_parts, simp_all, blast)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   828
txt{*K2 and K4 remain*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   829
prefer 2 apply (blast dest!: unique_CryptKey)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   830
apply (blast dest!: servK_authentic Says_Tgs_message_form authKeys_used)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   831
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   832
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   833
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   834
subsection{*Unicity Theorems*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   835
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   836
text{* The session key, if secure, uniquely identifies the Ticket
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   837
   whether authTicket or servTicket. As a matter of fact, one can read
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   838
   also Tgs in the place of B.                                     *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   839
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   840
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   841
lemma unique_authKeys:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   842
     "\<lbrakk> Says Kas A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   843
              (Crypt Ka \<lbrace>Key authK, Agent Tgs, Ta, X\<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   844
         Says Kas A'
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   845
              (Crypt Ka' \<lbrace>Key authK, Agent Tgs, Ta', X'\<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   846
         evs \<in> kerbIV_gets \<rbrakk> \<Longrightarrow> A=A' & Ka=Ka' & Ta=Ta' & X=X'"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   847
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   848
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   849
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   850
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   851
apply (frule_tac [6] Gets_ticket_parts, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   852
txt{*K2*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   853
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   854
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   855
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   856
text{* servK uniquely identifies the message from Tgs *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   857
lemma unique_servKeys:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   858
     "\<lbrakk> Says Tgs A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   859
              (Crypt K \<lbrace>Key servK, Agent B, Ts, X\<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   860
         Says Tgs A'
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   861
              (Crypt K' \<lbrace>Key servK, Agent B', Ts', X'\<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   862
         evs \<in> kerbIV_gets \<rbrakk> \<Longrightarrow> A=A' & B=B' & K=K' & Ts=Ts' & X=X'"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   863
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   864
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   865
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   866
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   867
apply (frule_tac [6] Gets_ticket_parts, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   868
txt{*K4*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   869
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   870
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   871
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   872
text{* Revised unicity theorems *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   873
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   874
lemma Kas_Unique:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   875
     "\<lbrakk> Says Kas A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   876
              (Crypt Ka \<lbrace>Key authK, Agent Tgs, Ta, authTicket\<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   877
        evs \<in> kerbIV_gets \<rbrakk> \<Longrightarrow> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   878
   Unique (Says Kas A (Crypt Ka \<lbrace>Key authK, Agent Tgs, Ta, authTicket\<rbrace>)) 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   879
   on evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   880
apply (erule rev_mp, erule kerbIV_gets.induct, simp_all add: Unique_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   881
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   882
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   883
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   884
lemma Tgs_Unique:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   885
     "\<lbrakk> Says Tgs A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   886
              (Crypt authK \<lbrace>Key servK, Agent B, Ts, servTicket\<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   887
        evs \<in> kerbIV_gets \<rbrakk> \<Longrightarrow> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   888
  Unique (Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Ts, servTicket\<rbrace>)) 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   889
  on evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   890
apply (erule rev_mp, erule kerbIV_gets.induct, simp_all add: Unique_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   891
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   892
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   893
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   894
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   895
subsection{*Lemmas About the Predicate @{term AKcryptSK}*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   896
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   897
lemma not_AKcryptSK_Nil [iff]: "\<not> AKcryptSK authK servK []"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   898
by (simp add: AKcryptSK_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   899
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   900
lemma AKcryptSKI:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   901
 "\<lbrakk> Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, X \<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   902
     evs \<in> kerbIV_gets \<rbrakk> \<Longrightarrow> AKcryptSK authK servK evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   903
apply (unfold AKcryptSK_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   904
apply (blast dest: Says_Tgs_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   905
done
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
lemma AKcryptSK_Says [simp]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   908
   "AKcryptSK authK servK (Says S A X # evs) =
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   909
     (Tgs = S &
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   910
      (\<exists>B Ts. X = Crypt authK
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   911
                \<lbrace>Key servK, Agent B, Number Ts,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   912
                  Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace> \<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   913
     | AKcryptSK authK servK evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   914
apply (unfold AKcryptSK_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   915
apply (simp (no_asm))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   916
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   917
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   918
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   919
(*A fresh authK cannot be associated with any other
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   920
  (with respect to a given trace). *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   921
lemma Auth_fresh_not_AKcryptSK:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   922
     "\<lbrakk> Key authK \<notin> used evs; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   923
      \<Longrightarrow> \<not> AKcryptSK authK servK evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   924
apply (unfold AKcryptSK_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   925
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   926
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   927
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   928
apply (frule_tac [6] Gets_ticket_parts, simp_all, blast)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   929
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   930
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   931
(*A fresh servK cannot be associated with any other
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   932
  (with respect to a given trace). *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   933
lemma Serv_fresh_not_AKcryptSK:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   934
 "Key servK \<notin> used evs \<Longrightarrow> \<not> AKcryptSK authK servK evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   935
apply (unfold AKcryptSK_def, blast)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   936
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   937
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   938
lemma authK_not_AKcryptSK:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   939
     "\<lbrakk> Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, tk\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   940
           \<in> parts (spies evs);  evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   941
      \<Longrightarrow> \<not> AKcryptSK K authK evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   942
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   943
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   944
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   945
apply (frule_tac [6] Gets_ticket_parts, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   946
txt{*Fake*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   947
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   948
txt{*Reception*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   949
apply (simp add: AKcryptSK_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   950
txt{*K2: by freshness*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   951
apply (simp add: AKcryptSK_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   952
txt{*K4*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   953
apply (blast+)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   954
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   955
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   956
text{*A secure serverkey cannot have been used to encrypt others*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   957
lemma servK_not_AKcryptSK:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   958
 "\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key SK, Number Ts\<rbrace> \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   959
     Key SK \<notin> analz (spies evs);  SK \<in> symKeys;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   960
     B \<noteq> Tgs;  evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   961
  \<Longrightarrow> \<not> AKcryptSK SK K evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   962
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   963
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   964
apply (erule kerbIV_gets.induct, analz_mono_contra)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   965
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   966
apply (frule_tac [6] Gets_ticket_parts, simp_all, blast)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   967
txt{*Reception*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   968
apply (simp add: AKcryptSK_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   969
txt{*K4 splits into distinct subcases*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   970
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   971
txt{*servK can't have been enclosed in two certificates*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   972
 prefer 2 apply (blast dest: unique_CryptKey)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   973
txt{*servK is fresh and so could not have been used, by
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   974
   @{text new_keys_not_used}*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   975
apply (force dest!: Crypt_imp_invKey_keysFor simp add: AKcryptSK_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   976
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   977
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   978
text{*Long term keys are not issued as servKeys*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   979
lemma shrK_not_AKcryptSK:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   980
     "evs \<in> kerbIV_gets \<Longrightarrow> \<not> AKcryptSK K (shrK A) evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   981
apply (unfold AKcryptSK_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   982
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   983
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   984
apply (frule_tac [6] Gets_ticket_parts, auto)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   985
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   986
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   987
text{*The Tgs message associates servK with authK and therefore not with any
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   988
  other key authK.*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   989
lemma Says_Tgs_AKcryptSK:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   990
     "\<lbrakk> Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, X \<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   991
           \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   992
         authK' \<noteq> authK;  evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   993
      \<Longrightarrow> \<not> AKcryptSK authK' servK evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   994
apply (unfold AKcryptSK_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   995
apply (blast dest: unique_servKeys)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   996
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   997
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   998
text{*Equivalently*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   999
lemma not_different_AKcryptSK:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1000
     "\<lbrakk> AKcryptSK authK servK evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1001
        authK' \<noteq> authK;  evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1002
      \<Longrightarrow> \<not> AKcryptSK authK' servK evs  \<and> servK \<in> symKeys"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1003
apply (simp add: AKcryptSK_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1004
apply (blast dest: unique_servKeys Says_Tgs_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1005
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1006
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1007
lemma AKcryptSK_not_AKcryptSK:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1008
     "\<lbrakk> AKcryptSK authK servK evs;  evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1009
      \<Longrightarrow> \<not> AKcryptSK servK K evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1010
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1011
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1012
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1013
apply (frule_tac [6] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1014
txt{*Reception*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1015
prefer 3 apply (simp add: AKcryptSK_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1016
apply (simp_all, safe)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1017
txt{*K4 splits into subcases*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1018
prefer 4 apply (blast dest!: authK_not_AKcryptSK)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1019
txt{*servK is fresh and so could not have been used, by
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1020
   @{text new_keys_not_used}*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1021
 prefer 2 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1022
 apply (force dest!: Crypt_imp_invKey_keysFor simp add: AKcryptSK_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1023
txt{*Others by freshness*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1024
apply (blast+)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1025
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1026
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1027
text{*The only session keys that can be found with the help of session keys are
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1028
  those sent by Tgs in step K4.  *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1029
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1030
text{*We take some pains to express the property
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1031
  as a logical equivalence so that the simplifier can apply it.*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1032
lemma Key_analz_image_Key_lemma:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1033
     "P \<longrightarrow> (Key K \<in> analz (Key`KK Un H)) \<longrightarrow> (K:KK | Key K \<in> analz H)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1034
      \<Longrightarrow>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1035
      P \<longrightarrow> (Key K \<in> analz (Key`KK Un H)) = (K:KK | Key K \<in> analz H)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1036
by (blast intro: analz_mono [THEN subsetD])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1037
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1038
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1039
lemma AKcryptSK_analz_insert:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1040
     "\<lbrakk> AKcryptSK K K' evs; K \<in> symKeys; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1041
      \<Longrightarrow> Key K' \<in> analz (insert (Key K) (spies evs))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1042
apply (simp add: AKcryptSK_def, clarify)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1043
apply (drule Says_imp_spies [THEN analz.Inj, THEN analz_insertI], auto)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1044
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1045
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1046
lemma authKeys_are_not_AKcryptSK:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1047
     "\<lbrakk> K \<in> authKeys evs Un range shrK;  evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1048
      \<Longrightarrow> \<forall>SK. \<not> AKcryptSK SK K evs \<and> K \<in> symKeys"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1049
apply (simp add: authKeys_def AKcryptSK_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1050
apply (blast dest: Says_Kas_message_form Says_Tgs_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1051
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1052
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1053
lemma not_authKeys_not_AKcryptSK:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1054
     "\<lbrakk> K \<notin> authKeys evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1055
         K \<notin> range shrK; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1056
      \<Longrightarrow> \<forall>SK. \<not> AKcryptSK K SK evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1057
apply (simp add: AKcryptSK_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1058
apply (blast dest: Says_Tgs_message_form)
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
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1062
subsection{*Secrecy Theorems*}
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
text{*For the Oops2 case of the next theorem*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1065
lemma Oops2_not_AKcryptSK:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1066
     "\<lbrakk> evs \<in> kerbIV_gets;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1067
         Says Tgs A (Crypt authK
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1068
                     \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1069
           \<in> set evs \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1070
      \<Longrightarrow> \<not> AKcryptSK servK SK evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1071
apply (blast dest: AKcryptSKI AKcryptSK_not_AKcryptSK)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1072
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1073
   
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1074
text{* Big simplification law for keys SK that are not crypted by keys in KK
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1075
 It helps prove three, otherwise hard, facts about keys. These facts are
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1076
 exploited as simplification laws for analz, and also "limit the damage"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1077
 in case of loss of a key to the spy. See ESORICS98. *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1078
lemma Key_analz_image_Key [rule_format (no_asm)]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1079
     "evs \<in> kerbIV_gets \<Longrightarrow>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1080
      (\<forall>SK KK. SK \<in> symKeys & KK <= -(range shrK) \<longrightarrow>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1081
       (\<forall>K \<in> KK. \<not> AKcryptSK K SK evs)   \<longrightarrow>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1082
       (Key SK \<in> analz (Key`KK Un (spies evs))) =
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1083
       (SK \<in> KK | Key SK \<in> analz (spies evs)))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1084
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1085
apply (frule_tac [11] Oops_range_spies2)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1086
apply (frule_tac [10] Oops_range_spies1)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1087
apply (frule_tac [8] Says_tgs_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1088
apply (frule_tac [6] Says_kas_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1089
apply (safe del: impI intro!: Key_analz_image_Key_lemma [THEN impI])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1090
txt{*Case-splits for Oops1 and message 5: the negated case simplifies using
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1091
 the induction hypothesis*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1092
apply (case_tac [12] "AKcryptSK authK SK evsO1")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1093
apply (case_tac [9] "AKcryptSK servK SK evs5")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1094
apply (simp_all del: image_insert
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1095
        add: analz_image_freshK_simps AKcryptSK_Says shrK_not_AKcryptSK
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1096
             Oops2_not_AKcryptSK Auth_fresh_not_AKcryptSK
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1097
       Serv_fresh_not_AKcryptSK Says_Tgs_AKcryptSK Spy_analz_shrK)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1098
  --{*18 seconds on a 1.8GHz machine??*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1099
txt{*Fake*} 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1100
apply spy_analz
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1101
txt{*Reception*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1102
apply (simp add: AKcryptSK_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1103
txt{*K2*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1104
apply blast 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1105
txt{*K3*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1106
apply blast 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1107
txt{*K4*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1108
apply (blast dest!: authK_not_AKcryptSK)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1109
txt{*K5*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1110
apply (case_tac "Key servK \<in> analz (spies evs5) ")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1111
txt{*If servK is compromised then the result follows directly...*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1112
apply (simp (no_asm_simp) add: analz_insert_eq Un_upper2 [THEN analz_mono, THEN subsetD])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1113
txt{*...therefore servK is uncompromised.*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1114
txt{*The AKcryptSK servK SK evs5 case leads to a contradiction.*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1115
apply (blast elim!: servK_not_AKcryptSK [THEN [2] rev_notE] del: allE ballE)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1116
txt{*Another K5 case*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1117
apply blast 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1118
txt{*Oops1*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1119
apply simp 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1120
apply (blast dest!: AKcryptSK_analz_insert)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1121
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1122
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1123
text{* First simplification law for analz: no session keys encrypt
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1124
authentication keys or shared keys. *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1125
lemma analz_insert_freshK1:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1126
     "\<lbrakk> evs \<in> kerbIV_gets;  K \<in> authKeys evs Un range shrK;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1127
        SesKey \<notin> range shrK \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1128
      \<Longrightarrow> (Key K \<in> analz (insert (Key SesKey) (spies evs))) =
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1129
          (K = SesKey | Key K \<in> analz (spies evs))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1130
apply (frule authKeys_are_not_AKcryptSK, assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1131
apply (simp del: image_insert
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1132
            add: analz_image_freshK_simps add: Key_analz_image_Key)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1133
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1134
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1135
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1136
text{* Second simplification law for analz: no service keys encrypt any other keys.*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1137
lemma analz_insert_freshK2:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1138
     "\<lbrakk> evs \<in> kerbIV_gets;  servK \<notin> (authKeys evs); servK \<notin> range shrK;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1139
        K \<in> symKeys \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1140
      \<Longrightarrow> (Key K \<in> analz (insert (Key servK) (spies evs))) =
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1141
          (K = servK | Key K \<in> analz (spies evs))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1142
apply (frule not_authKeys_not_AKcryptSK, assumption, assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1143
apply (simp del: image_insert
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1144
            add: analz_image_freshK_simps add: Key_analz_image_Key)
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
text{* Third simplification law for analz: only one authentication key encrypts a certain service key.*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1149
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1150
lemma analz_insert_freshK3:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1151
 "\<lbrakk> AKcryptSK authK servK evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1152
    authK' \<noteq> authK; authK' \<notin> range shrK; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1153
        \<Longrightarrow> (Key servK \<in> analz (insert (Key authK') (spies evs))) =
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1154
                (servK = authK' | Key servK \<in> analz (spies evs))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1155
apply (drule_tac authK' = authK' in not_different_AKcryptSK, blast, assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1156
apply (simp del: image_insert
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1157
            add: analz_image_freshK_simps add: Key_analz_image_Key)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1158
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1159
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1160
lemma analz_insert_freshK3_bis:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1161
 "\<lbrakk> Says Tgs A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1162
            (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1163
        \<in> set evs; 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1164
     authK \<noteq> authK'; authK' \<notin> range shrK; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1165
        \<Longrightarrow> (Key servK \<in> analz (insert (Key authK') (spies evs))) =
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1166
                (servK = authK' | Key servK \<in> analz (spies evs))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1167
apply (frule AKcryptSKI, assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1168
apply (simp add: analz_insert_freshK3)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1169
done
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
text{*a weakness of the protocol*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1172
lemma authK_compromises_servK:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1173
     "\<lbrakk> Says Tgs A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1174
              (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1175
           \<in> set evs;  authK \<in> symKeys;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1176
         Key authK \<in> analz (spies evs); evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1177
      \<Longrightarrow> Key servK \<in> analz (spies evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1178
by (force dest: Says_imp_spies [THEN analz.Inj, THEN analz.Decrypt, THEN analz.Fst])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1179
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1180
lemma servK_notin_authKeysD:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1181
     "\<lbrakk> Crypt authK \<lbrace>Key servK, Agent B, Ts,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1182
                      Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Ts\<rbrace>\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1183
           \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1184
         Key servK \<notin> analz (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1185
         B \<noteq> Tgs; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1186
      \<Longrightarrow> servK \<notin> authKeys evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1187
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1188
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1189
apply (simp add: authKeys_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1190
apply (erule kerbIV_gets.induct, analz_mono_contra)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1191
apply (frule_tac [8] Gets_ticket_parts)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1192
apply (frule_tac [6] Gets_ticket_parts, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1193
apply (blast+)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1194
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1195
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
text{*If Spy sees the Authentication Key sent in msg K2, then
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1198
    the Key has expired.*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1199
lemma Confidentiality_Kas_lemma [rule_format]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1200
     "\<lbrakk> authK \<in> symKeys; A \<notin> bad;  evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1201
      \<Longrightarrow> Says Kas A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1202
               (Crypt (shrK A)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1203
                  \<lbrace>Key authK, Agent Tgs, Number Ta,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1204
          Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1205
            \<in> set evs \<longrightarrow>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1206
          Key authK \<in> analz (spies evs) \<longrightarrow>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1207
          expiredAK Ta evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1208
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1209
apply (frule_tac [11] Oops_range_spies2)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1210
apply (frule_tac [10] Oops_range_spies1)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1211
apply (frule_tac [8] Says_tgs_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1212
apply (frule_tac [6] Says_kas_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1213
apply (safe del: impI conjI impCE)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1214
apply (simp_all (no_asm_simp) add: Says_Kas_message_form less_SucI analz_insert_eq not_parts_not_analz analz_insert_freshK1 pushes)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1215
txt{*Fake*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1216
apply spy_analz
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1217
txt{*K2*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1218
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1219
txt{*K4*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1220
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1221
txt{*Level 8: K5*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1222
apply (blast dest: servK_notin_authKeysD Says_Kas_message_form intro: less_SucI)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1223
txt{*Oops1*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1224
apply (blast dest!: unique_authKeys intro: less_SucI)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1225
txt{*Oops2*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1226
apply (blast dest: Says_Tgs_message_form Says_Kas_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1227
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1228
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1229
lemma Confidentiality_Kas:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1230
     "\<lbrakk> Says Kas A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1231
              (Crypt Ka \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1232
           \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1233
         \<not> expiredAK Ta evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1234
         A \<notin> bad;  evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1235
      \<Longrightarrow> Key authK \<notin> analz (spies evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1236
by (blast dest: Says_Kas_message_form Confidentiality_Kas_lemma)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1237
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1238
text{*If Spy sees the Service Key sent in msg K4, then
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1239
    the Key has expired.*}
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 Confidentiality_lemma [rule_format]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1242
     "\<lbrakk> Says Tgs A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1243
	    (Crypt authK
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1244
	       \<lbrace>Key servK, Agent B, Number Ts,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1245
		 Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1246
	   \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1247
	Key authK \<notin> analz (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1248
        servK \<in> symKeys;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1249
	A \<notin> bad;  B \<notin> bad; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1250
      \<Longrightarrow> Key servK \<in> analz (spies evs) \<longrightarrow>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1251
	  expiredSK Ts evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1252
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1253
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1254
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1255
apply (rule_tac [10] impI)+;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1256
  --{*The Oops1 case is unusual: must simplify
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1257
    @{term "Authkey \<notin> analz (spies (ev#evs))"}, not letting
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1258
   @{text analz_mono_contra} weaken it to
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1259
   @{term "Authkey \<notin> analz (spies evs)"},
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1260
  for we then conclude @{term "authK \<noteq> authKa"}.*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1261
apply analz_mono_contra
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1262
apply (frule_tac [11] Oops_range_spies2)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1263
apply (frule_tac [10] Oops_range_spies1)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1264
apply (frule_tac [8] Says_tgs_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1265
apply (frule_tac [6] Says_kas_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1266
apply (safe del: impI conjI impCE)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1267
apply (simp_all add: less_SucI new_keys_not_analzd Says_Kas_message_form Says_Tgs_message_form analz_insert_eq not_parts_not_analz analz_insert_freshK1 analz_insert_freshK2 analz_insert_freshK3_bis pushes)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1268
txt{*Fake*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1269
apply spy_analz
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1270
txt{*K2*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1271
apply (blast intro: parts_insertI less_SucI)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1272
txt{*K4*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1273
apply (blast dest: authTicket_authentic Confidentiality_Kas)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1274
txt{*Oops2*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1275
  prefer 3
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1276
  apply (blast dest: Says_imp_spies [THEN parts.Inj] Key_unique_SesKey intro: less_SucI)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1277
txt{*Oops1*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1278
 prefer 2
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1279
apply (blast dest: Says_Kas_message_form Says_Tgs_message_form intro: less_SucI)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1280
txt{*K5. Not clear how this step could be integrated with the main
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1281
       simplification step. Done in KerberosV.thy*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1282
apply clarify
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1283
apply (erule_tac V = "Says Aa Tgs ?X \<in> set ?evs" in thin_rl)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1284
apply (frule Gets_imp_knows_Spy [THEN parts.Inj, THEN servK_notin_authKeysD])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1285
apply (assumption, assumption, blast, assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1286
apply (simp add: analz_insert_freshK2)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1287
apply (blast dest: Says_imp_spies [THEN parts.Inj] Key_unique_SesKey intro: less_SucI)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1288
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1289
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1290
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1291
text{* In the real world Tgs can't check wheter authK is secure! *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1292
lemma Confidentiality_Tgs:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1293
     "\<lbrakk> Says Tgs A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1294
              (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1295
           \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1296
         Key authK \<notin> analz (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1297
         \<not> expiredSK Ts evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1298
         A \<notin> bad;  B \<notin> bad; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1299
      \<Longrightarrow> Key servK \<notin> analz (spies evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1300
apply (blast dest: Says_Tgs_message_form Confidentiality_lemma)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1301
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1302
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1303
text{* In the real world Tgs CAN check what Kas sends! *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1304
lemma Confidentiality_Tgs_bis:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1305
     "\<lbrakk> Says Kas A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1306
               (Crypt Ka \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1307
           \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1308
         Says Tgs A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1309
              (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1310
           \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1311
         \<not> expiredAK Ta evs; \<not> expiredSK Ts evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1312
         A \<notin> bad;  B \<notin> bad; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1313
      \<Longrightarrow> Key servK \<notin> analz (spies evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1314
apply (blast dest!: Confidentiality_Kas Confidentiality_Tgs)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1315
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1316
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1317
text{*Most general form*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1318
lemmas Confidentiality_Tgs_ter = authTicket_authentic [THEN Confidentiality_Tgs_bis]
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
lemmas Confidentiality_Auth_A = authK_authentic [THEN Confidentiality_Kas]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1321
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1322
text{*Needs a confidentiality guarantee, hence moved here.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1323
      Authenticity of servK for A*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1324
lemma servK_authentic_bis_r:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1325
     "\<lbrakk> Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1326
           \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1327
         Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1328
           \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1329
         \<not> expiredAK Ta evs; A \<notin> bad; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1330
 \<Longrightarrow>Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1331
       \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1332
apply (blast dest: authK_authentic Confidentiality_Auth_A servK_authentic_ter)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1333
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1334
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1335
lemma Confidentiality_Serv_A:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1336
     "\<lbrakk> Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1337
           \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1338
         Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1339
           \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1340
         \<not> expiredAK Ta evs; \<not> expiredSK Ts evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1341
         A \<notin> bad;  B \<notin> bad; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1342
      \<Longrightarrow> Key servK \<notin> analz (spies evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1343
apply (drule authK_authentic, assumption, assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1344
apply (blast dest: Confidentiality_Kas Says_Kas_message_form servK_authentic_ter Confidentiality_Tgs_bis)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1345
done
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
lemma Confidentiality_B:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1348
     "\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1349
           \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1350
         Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1351
           \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1352
         Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1353
           \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1354
         \<not> expiredSK Ts evs; \<not> expiredAK Ta evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1355
         A \<notin> bad;  B \<notin> bad; B \<noteq> Tgs; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1356
      \<Longrightarrow> Key servK \<notin> analz (spies evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1357
apply (frule authK_authentic)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1358
apply (frule_tac [3] Confidentiality_Kas)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1359
apply (frule_tac [6] servTicket_authentic, auto)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1360
apply (blast dest!: Confidentiality_Tgs_bis dest: Says_Kas_message_form servK_authentic unique_servKeys unique_authKeys)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1361
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1362
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1363
lemma u_Confidentiality_B:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1364
     "\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1365
           \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1366
         \<not> expiredSK Ts evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1367
         A \<notin> bad;  B \<notin> bad;  B \<noteq> Tgs; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1368
      \<Longrightarrow> Key servK \<notin> analz (spies evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1369
apply (blast dest: u_servTicket_authentic u_NotexpiredSK_NotexpiredAK Confidentiality_Tgs_bis)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1370
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1371
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1372
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1373
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1374
subsection{*2. Parties' strong authentication: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1375
       non-injective agreement on the session key. The same guarantees also
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1376
       express key distribution, hence their names*}
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
text{*Authentication here still is weak agreement - of B with A*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1379
lemma A_authenticates_B:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1380
     "\<lbrakk> Crypt servK (Number T3) \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1381
         Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1382
           \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1383
         Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1384
           \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1385
         Key authK \<notin> analz (spies evs); Key servK \<notin> analz (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1386
         A \<notin> bad;  B \<notin> bad; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1387
      \<Longrightarrow> Says B A (Crypt servK (Number T3)) \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1388
apply (frule authK_authentic)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1389
apply assumption+
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1390
apply (frule servK_authentic)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1391
prefer 2 apply (blast dest: authK_authentic Says_Kas_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1392
apply assumption+
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1393
apply (blast dest: K4_imp_K2 Key_unique_SesKey intro!: Says_K6)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1394
(*Single command proof: slower!
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1395
apply (blast dest: authK_authentic servK_authentic Says_Kas_message_form Key_unique_SesKey K4_imp_K2 intro!: Says_K6)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1396
*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1397
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1398
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1399
(*These two have never been proved, because never were they needed before!*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1400
lemma shrK_in_initState_Server[iff]:  "Key (shrK A) \<in> initState Kas"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1401
by (induct_tac "A", auto)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1402
lemma shrK_in_knows_Server [iff]: "Key (shrK A) \<in> knows Kas evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1403
by (simp add: initState_subset_knows [THEN subsetD])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1404
(*Because of our simple model of Tgs, the equivalent for it required an axiom*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1405
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1406
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1407
lemma A_authenticates_and_keydist_to_Kas:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1408
   "\<lbrakk> Gets A (Crypt (shrK A) \<lbrace>Key authK, Peer, Ta, authTicket\<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1409
      A \<notin> bad;  evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1410
  \<Longrightarrow> Says Kas A (Crypt (shrK A) \<lbrace>Key authK, Peer, Ta, authTicket\<rbrace>) \<in> set evs
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1411
  \<and> Key authK \<in> analz(knows Kas evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1412
apply (force dest!: authK_authentic Says_imp_knows [THEN analz.Inj, THEN analz.Decrypt, THEN analz.Fst])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1413
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1414
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1415
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1416
lemma K3_imp_Gets:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1417
  "\<lbrakk> Says A Tgs \<lbrace>Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1418
                 Crypt authK \<lbrace>Agent A, Number T2\<rbrace>, Agent B\<rbrace> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1419
      \<in> set evs;  A \<notin> bad; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1420
 \<Longrightarrow>  Gets A (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1421
                 Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1422
       \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1423
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1424
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1425
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1426
apply (blast dest: authTicket_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1427
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1428
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1429
lemma Tgs_authenticates_and_keydist_to_A:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1430
  "\<lbrakk>  Gets Tgs \<lbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1431
          Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1432
          Crypt authK \<lbrace>Agent A, Number T2\<rbrace>, Agent B \<rbrace> \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1433
      Key authK \<notin> analz (spies evs); A \<notin> bad; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1434
 \<Longrightarrow> \<exists> B. Says A Tgs \<lbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1435
          Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1436
          Crypt authK \<lbrace>Agent A, Number T2\<rbrace>, Agent B \<rbrace> \<in> set evs
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1437
 \<and>  Key authK \<in> analz (knows A evs)"  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1438
apply (frule Gets_imp_knows_Spy [THEN parts.Inj, THEN parts.Fst], assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1439
apply (drule Gets_imp_knows_Spy [THEN parts.Inj, THEN parts.Snd, THEN parts.Fst], assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1440
apply (drule Tgs_authenticates_A, assumption+, simp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1441
apply (force dest!: K3_imp_Gets Gets_imp_knows [THEN analz.Inj, THEN analz.Decrypt, THEN analz.Fst])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1442
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1443
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1444
lemma K4_imp_Gets:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1445
  "\<lbrakk> Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1446
       \<in> set evs; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1447
 \<Longrightarrow> \<exists> Ta X. 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1448
     Gets Tgs \<lbrace>Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>, X\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1449
       \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1450
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1451
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1452
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1453
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1454
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1455
lemma A_authenticates_and_keydist_to_Tgs:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1456
 "\<lbrakk>  Gets A (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1457
       \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1458
     Gets A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1459
       \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1460
     Key authK \<notin> analz (spies evs); A \<notin> bad;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1461
     evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1462
 \<Longrightarrow> Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1463
       \<in> set evs
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1464
  \<and> Key authK \<in> analz (knows Tgs evs)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1465
  \<and> Key servK \<in> analz (knows Tgs evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1466
apply (drule Gets_imp_knows_Spy [THEN parts.Inj], assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1467
apply (drule Gets_imp_knows_Spy [THEN parts.Inj], assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1468
apply (frule authK_authentic, assumption+)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1469
apply (drule servK_authentic_ter, assumption+)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1470
apply (frule K4_imp_Gets, assumption, erule exE, erule exE)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1471
apply (drule Gets_imp_knows [THEN analz.Inj, THEN analz.Fst, THEN analz.Decrypt, THEN analz.Snd, THEN analz.Snd, THEN analz.Fst], assumption, force)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1472
apply (frule Says_imp_knows [THEN analz.Inj, THEN analz.Decrypt, THEN analz.Fst])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1473
apply (force dest!: authK_authentic Says_Kas_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1474
apply simp
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1475
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1476
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1477
lemma K5_imp_Gets:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1478
  "\<lbrakk> Says A B \<lbrace>servTicket, Crypt servK \<lbrace>Agent A, Number T3\<rbrace>\<rbrace> \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1479
    A \<notin> bad; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1480
 \<Longrightarrow> \<exists> authK Ts authTicket T2.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1481
    Gets A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>) \<in> set evs
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1482
 \<and> Says A Tgs \<lbrace>authTicket, Crypt authK \<lbrace>Agent A, Number T2\<rbrace>, Agent B\<rbrace>  \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1483
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1484
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1485
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1486
done 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1487
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1488
lemma K3_imp_Gets:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1489
  "\<lbrakk> Says A Tgs \<lbrace>authTicket, Crypt authK \<lbrace>Agent A, Number T2\<rbrace>, Agent B\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1490
       \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1491
    A \<notin> bad; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1492
 \<Longrightarrow> \<exists> Ta. Gets A (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace>) \<in> set evs";
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1493
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1494
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1495
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1496
done 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1497
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1498
lemma B_authenticates_and_keydist_to_A:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1499
     "\<lbrakk> Gets B \<lbrace>Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1500
                Crypt servK \<lbrace>Agent A, Number T3\<rbrace>\<rbrace> \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1501
        Key servK \<notin> analz (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1502
        A \<notin> bad; B \<notin> bad; B \<noteq> Tgs; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1503
 \<Longrightarrow> Says A B \<lbrace>Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1504
               Crypt servK \<lbrace>Agent A, Number T3\<rbrace>\<rbrace> \<in> set evs
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1505
  \<and> Key servK \<in> analz (knows A evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1506
apply (frule Gets_imp_knows_Spy [THEN parts.Inj, THEN parts.Fst, THEN servTicket_authentic_Tgs], assumption+)  
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1507
apply (drule Gets_imp_knows_Spy [THEN parts.Inj, THEN parts.Snd], assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1508
apply (erule exE, drule Says_K5, assumption+)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1509
apply (frule K5_imp_Gets, assumption+)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1510
apply clarify
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1511
apply (drule K3_imp_Gets, assumption+)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1512
apply (erule exE)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1513
apply (frule Gets_imp_knows_Spy [THEN parts.Inj, THEN authK_authentic, THEN Says_Kas_message_form], assumption+, clarify)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1514
apply (force dest!: Gets_imp_knows [THEN analz.Inj, THEN analz.Decrypt, THEN analz.Fst])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1515
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1516
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1517
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1518
lemma K6_imp_Gets:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1519
  "\<lbrakk> Says B A (Crypt servK (Number T3)) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1520
     B \<notin> bad; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1521
\<Longrightarrow> \<exists> Ts X. Gets B \<lbrace>Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>,X\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1522
       \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1523
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1524
apply (erule kerbIV_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1525
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1526
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1527
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1528
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1529
lemma A_authenticates_and_keydist_to_B:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1530
  "\<lbrakk> Gets A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1531
             Crypt servK (Number T3)\<rbrace> \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1532
     Gets A (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1533
           \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1534
     Key authK \<notin> analz (spies evs); Key servK \<notin> analz (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1535
     A \<notin> bad;  B \<notin> bad; evs \<in> kerbIV_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1536
 \<Longrightarrow> Says B A (Crypt servK (Number T3)) \<in> set evs 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1537
   \<and> Key servK \<in> analz (knows B evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1538
apply (frule Gets_imp_knows_Spy [THEN parts.Inj, THEN parts.Fst], assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1539
apply (drule Gets_imp_knows_Spy [THEN parts.Inj, THEN parts.Snd], assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1540
apply (drule Gets_imp_knows_Spy [THEN parts.Inj], assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1541
apply (drule A_authenticates_B, assumption+)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1542
apply (force dest!: K6_imp_Gets Gets_imp_knows [THEN analz.Inj, THEN analz.Fst, THEN analz.Decrypt, THEN analz.Snd, THEN analz.Snd, THEN analz.Fst])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1543
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1544
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1545
 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1546
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1547
end
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
  1548