src/HOL/Auth/Kerberos_BAN_Gets.thy
author wenzelm
Tue, 03 Sep 2013 01:12:40 +0200
changeset 53374 a14d2a854c02
parent 44890 22f665a2e91c
child 55417 01fbfb60c33e
permissions -rw-r--r--
tuned proofs -- clarified flow of facts wrt. calculation;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37936
1e4c5015a72e updated some headers;
wenzelm
parents: 36866
diff changeset
     1
(*  Title:      HOL/Auth/Kerberos_BAN_Gets.thy
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     2
    Author:     Giampaolo Bella, Catania University
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     3
*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     4
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     5
header{*The Kerberos Protocol, BAN Version, with Gets event*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     6
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     7
theory Kerberos_BAN_Gets imports Public begin
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     8
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
     9
text{*From page 251 of
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    10
  Burrows, Abadi and Needham (1989).  A Logic of Authentication.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    11
  Proc. Royal Soc. 426
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
  Confidentiality (secrecy) and authentication properties rely on
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    14
  temporal checks: strong guarantees in a little abstracted - but
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    15
  very realistic - model.
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
(* Temporal modelization: session keys can be leaked
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    19
                          ONLY when they have expired *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    20
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    21
consts
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
    (*Duration of the session key*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    24
    sesKlife   :: nat
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    25
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    26
    (*Duration of the authenticator*)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    27
    authlife :: nat
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    28
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    29
text{*The ticket should remain fresh for two journeys on the network at least*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    30
text{*The Gets event causes longer traces for the protocol to reach its end*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    31
specification (sesKlife)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    32
  sesKlife_LB [iff]: "4 \<le> sesKlife"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    33
    by blast
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
text{*The authenticator only for one journey*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    36
text{*The Gets event causes longer traces for the protocol to reach its end*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    37
specification (authlife)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    38
  authlife_LB [iff]:    "2 \<le> authlife"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    39
    by blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    40
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    41
20768
1d478c2d621f replaced syntax/translations by abbreviation;
wenzelm
parents: 18886
diff changeset
    42
abbreviation
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20768
diff changeset
    43
  CT :: "event list=>nat" where
20768
1d478c2d621f replaced syntax/translations by abbreviation;
wenzelm
parents: 18886
diff changeset
    44
  "CT == length"
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    45
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20768
diff changeset
    46
abbreviation
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20768
diff changeset
    47
  expiredK :: "[nat, event list] => bool" where
20768
1d478c2d621f replaced syntax/translations by abbreviation;
wenzelm
parents: 18886
diff changeset
    48
  "expiredK T evs == sesKlife + T < CT evs"
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    49
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20768
diff changeset
    50
abbreviation
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20768
diff changeset
    51
  expiredA :: "[nat, event list] => bool" where
20768
1d478c2d621f replaced syntax/translations by abbreviation;
wenzelm
parents: 18886
diff changeset
    52
  "expiredA T evs == authlife + T < CT evs"
18886
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
36866
426d5781bb25 modernized specifications;
wenzelm
parents: 32960
diff changeset
    55
definition
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    56
 (* Yields the subtrace of a given trace from its beginning to a given event *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    57
  before :: "[event, event list] => event list" ("before _ on _")
36866
426d5781bb25 modernized specifications;
wenzelm
parents: 32960
diff changeset
    58
  where "before ev on evs = takeWhile (% z. z ~= ev) (rev evs)"
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    59
36866
426d5781bb25 modernized specifications;
wenzelm
parents: 32960
diff changeset
    60
definition
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    61
 (* States than an event really appears only once on a trace *)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    62
  Unique :: "[event, event list] => bool" ("Unique _ on _")
36866
426d5781bb25 modernized specifications;
wenzelm
parents: 32960
diff changeset
    63
  where "Unique ev on evs = (ev \<notin> set (tl (dropWhile (% z. z \<noteq> ev) evs)))"
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    64
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    65
23746
a455e69c31cc Adapted to new inductive definition package.
berghofe
parents: 21404
diff changeset
    66
inductive_set bankerb_gets :: "event list set"
a455e69c31cc Adapted to new inductive definition package.
berghofe
parents: 21404
diff changeset
    67
 where
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    68
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    69
   Nil:  "[] \<in> bankerb_gets"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    70
23746
a455e69c31cc Adapted to new inductive definition package.
berghofe
parents: 21404
diff changeset
    71
 | Fake: "\<lbrakk> evsf \<in> bankerb_gets;  X \<in> synth (analz (knows Spy evsf)) \<rbrakk>
32960
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
    72
          \<Longrightarrow> Says Spy B X # evsf \<in> bankerb_gets"
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    73
23746
a455e69c31cc Adapted to new inductive definition package.
berghofe
parents: 21404
diff changeset
    74
 | Reception: "\<lbrakk> evsr\<in> bankerb_gets; Says A B X \<in> set evsr \<rbrakk>
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    75
                \<Longrightarrow> Gets B X # evsr \<in> bankerb_gets"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    76
23746
a455e69c31cc Adapted to new inductive definition package.
berghofe
parents: 21404
diff changeset
    77
 | BK1:  "\<lbrakk> evs1 \<in> bankerb_gets \<rbrakk>
32960
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
    78
          \<Longrightarrow> Says A Server \<lbrace>Agent A, Agent B\<rbrace> # evs1
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
    79
                \<in>  bankerb_gets"
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    80
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    81
23746
a455e69c31cc Adapted to new inductive definition package.
berghofe
parents: 21404
diff changeset
    82
 | BK2:  "\<lbrakk> evs2 \<in> bankerb_gets;  Key K \<notin> used evs2; K \<in> symKeys;
32960
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
    83
             Gets Server \<lbrace>Agent A, Agent B\<rbrace> \<in> set evs2 \<rbrakk>
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
    84
          \<Longrightarrow> Says Server A
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
    85
                (Crypt (shrK A)
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
    86
                   \<lbrace>Number (CT evs2), Agent B, Key K,
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
    87
                    (Crypt (shrK B) \<lbrace>Number (CT evs2), Agent A, Key K\<rbrace>)\<rbrace>)
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
    88
                # evs2 \<in> bankerb_gets"
18886
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
23746
a455e69c31cc Adapted to new inductive definition package.
berghofe
parents: 21404
diff changeset
    91
 | BK3:  "\<lbrakk> evs3 \<in> bankerb_gets;
32960
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
    92
             Gets A (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>)
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
    93
               \<in> set evs3;
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
    94
             Says A Server \<lbrace>Agent A, Agent B\<rbrace> \<in> set evs3;
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
    95
             \<not> expiredK Tk evs3 \<rbrakk>
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
    96
          \<Longrightarrow> Says A B \<lbrace>Ticket, Crypt K \<lbrace>Agent A, Number (CT evs3)\<rbrace> \<rbrace>
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
    97
               # evs3 \<in> bankerb_gets"
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    98
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
    99
23746
a455e69c31cc Adapted to new inductive definition package.
berghofe
parents: 21404
diff changeset
   100
 | BK4:  "\<lbrakk> evs4 \<in> bankerb_gets;
32960
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
   101
             Gets B \<lbrace>(Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>),
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
   102
                         (Crypt K \<lbrace>Agent A, Number Ta\<rbrace>) \<rbrace>: set evs4;
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
   103
             \<not> expiredK Tk evs4;  \<not> expiredA Ta evs4 \<rbrakk>
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
   104
          \<Longrightarrow> Says B A (Crypt K (Number Ta)) # evs4
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
   105
                \<in> bankerb_gets"
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   106
32960
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
   107
        (*Old session keys may become compromised*)
23746
a455e69c31cc Adapted to new inductive definition package.
berghofe
parents: 21404
diff changeset
   108
 | Oops: "\<lbrakk> evso \<in> bankerb_gets;
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   109
         Says Server A (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>)
32960
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
   110
               \<in> set evso;
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
   111
             expiredK Tk evso \<rbrakk>
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
   112
          \<Longrightarrow> Notes Spy \<lbrace>Number Tk, Key K\<rbrace> # evso \<in> bankerb_gets"
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   113
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   114
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   115
declare Says_imp_knows_Spy [THEN parts.Inj, dest]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   116
declare parts.Body [dest]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   117
declare analz_into_parts [dest]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   118
declare Fake_parts_insert_in_Un [dest]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   119
declare knows_Spy_partsEs [elim]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   120
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   121
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   122
text{*A "possibility property": there are traces that reach the end.*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   123
lemma "\<lbrakk>Key K \<notin> used []; K \<in> symKeys\<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   124
       \<Longrightarrow> \<exists>Timestamp. \<exists>evs \<in> bankerb_gets.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   125
             Says B A (Crypt K (Number Timestamp))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   126
                  \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   127
apply (cut_tac sesKlife_LB)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   128
apply (cut_tac authlife_LB)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   129
apply (intro exI bexI)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   130
apply (rule_tac [2]
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   131
           bankerb_gets.Nil [THEN bankerb_gets.BK1, THEN bankerb_gets.Reception,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   132
                            THEN bankerb_gets.BK2, THEN bankerb_gets.Reception,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   133
                            THEN bankerb_gets.BK3, THEN bankerb_gets.Reception,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   134
                            THEN bankerb_gets.BK4])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   135
apply (possibility, simp_all (no_asm_simp) add: used_Cons)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   136
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   137
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   138
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   139
text{*Lemmas about reception invariant: if a message is received it certainly
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   140
was sent*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   141
lemma Gets_imp_Says :
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   142
     "\<lbrakk> Gets B X \<in> set evs; evs \<in> bankerb_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
   143
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   144
apply (erule bankerb_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   145
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   146
done
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
lemma Gets_imp_knows_Spy: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   149
     "\<lbrakk> Gets B X \<in> set evs; evs \<in> bankerb_gets \<rbrakk>  \<Longrightarrow> X \<in> knows Spy evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   150
apply (blast dest!: Gets_imp_Says Says_imp_knows_Spy)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   151
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   152
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   153
lemma Gets_imp_knows_Spy_parts[dest]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   154
    "\<lbrakk> Gets B X \<in> set evs; evs \<in> bankerb_gets \<rbrakk>  \<Longrightarrow> X \<in> parts (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   155
apply (blast dest: Gets_imp_knows_Spy [THEN parts.Inj])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   156
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   157
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   158
lemma Gets_imp_knows:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   159
     "\<lbrakk> Gets B X \<in> set evs; evs \<in> bankerb_gets \<rbrakk>  \<Longrightarrow> X \<in> knows B evs"
39251
8756b44582e2 Tidied up proofs using sledgehammer, also deleting unnecessary semicolons
paulson
parents: 37936
diff changeset
   160
by (metis Gets_imp_knows_Spy Gets_imp_knows_agents)
18886
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
lemma Gets_imp_knows_analz:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   163
    "\<lbrakk> Gets B X \<in> set evs; evs \<in> bankerb_gets \<rbrakk>  \<Longrightarrow> X \<in> analz (knows B evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   164
apply (blast dest: Gets_imp_knows [THEN analz.Inj])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   165
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   166
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   167
text{*Lemmas for reasoning about predicate "before"*}
39251
8756b44582e2 Tidied up proofs using sledgehammer, also deleting unnecessary semicolons
paulson
parents: 37936
diff changeset
   168
lemma used_Says_rev: "used (evs @ [Says A B X]) = parts {X} \<union> (used evs)"
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   169
apply (induct_tac "evs")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   170
apply simp
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   171
apply (induct_tac "a")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   172
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   173
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   174
39251
8756b44582e2 Tidied up proofs using sledgehammer, also deleting unnecessary semicolons
paulson
parents: 37936
diff changeset
   175
lemma used_Notes_rev: "used (evs @ [Notes A X]) = parts {X} \<union> (used evs)"
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   176
apply (induct_tac "evs")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   177
apply simp
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   178
apply (induct_tac "a")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   179
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   180
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   181
39251
8756b44582e2 Tidied up proofs using sledgehammer, also deleting unnecessary semicolons
paulson
parents: 37936
diff changeset
   182
lemma used_Gets_rev: "used (evs @ [Gets B X]) = used evs"
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   183
apply (induct_tac "evs")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   184
apply simp
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   185
apply (induct_tac "a")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   186
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   187
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   188
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   189
lemma used_evs_rev: "used evs = used (rev evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   190
apply (induct_tac "evs")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   191
apply simp
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   192
apply (induct_tac "a")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   193
apply (simp add: used_Says_rev)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   194
apply (simp add: used_Gets_rev)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   195
apply (simp add: used_Notes_rev)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   196
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   197
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   198
lemma used_takeWhile_used [rule_format]: 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   199
      "x : used (takeWhile P X) --> x : used X"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   200
apply (induct_tac "X")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   201
apply simp
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   202
apply (induct_tac "a")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   203
apply (simp_all add: used_Nil)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   204
apply (blast dest!: initState_into_used)+
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   205
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   206
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   207
lemma set_evs_rev: "set evs = set (rev evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   208
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   209
done
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
lemma takeWhile_void [rule_format]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   212
      "x \<notin> set evs \<longrightarrow> takeWhile (\<lambda>z. z \<noteq> x) evs = evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   213
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   214
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   215
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   216
(**** Inductive proofs about bankerb_gets ****)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   217
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   218
text{*Forwarding Lemma for reasoning about the encrypted portion of message BK3*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   219
lemma BK3_msg_in_parts_knows_Spy:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   220
     "\<lbrakk>Gets A (Crypt KA \<lbrace>Timestamp, B, K, X\<rbrace>) \<in> set evs; evs \<in> bankerb_gets \<rbrakk> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   221
      \<Longrightarrow> X \<in> parts (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   222
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   223
done
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
lemma Oops_parts_knows_Spy:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   226
     "Says Server A (Crypt (shrK A) \<lbrace>Timestamp, B, K, X\<rbrace>) \<in> set evs
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   227
      \<Longrightarrow> K \<in> parts (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   228
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   229
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   230
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   231
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   232
text{*Spy never sees another agent's shared key! (unless it's bad at start)*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   233
lemma Spy_see_shrK [simp]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   234
     "evs \<in> bankerb_gets \<Longrightarrow> (Key (shrK A) \<in> parts (knows Spy evs)) = (A \<in> bad)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   235
apply (erule bankerb_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   236
apply (frule_tac [8] Oops_parts_knows_Spy)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   237
apply (frule_tac [6] BK3_msg_in_parts_knows_Spy, simp_all, blast+)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   238
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   239
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   240
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   241
lemma Spy_analz_shrK [simp]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   242
     "evs \<in> bankerb_gets \<Longrightarrow> (Key (shrK A) \<in> analz (knows Spy evs)) = (A \<in> bad)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   243
by auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   244
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   245
lemma Spy_see_shrK_D [dest!]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   246
     "\<lbrakk> Key (shrK A) \<in> parts (knows Spy evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   247
                evs \<in> bankerb_gets \<rbrakk> \<Longrightarrow> A:bad"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   248
by (blast dest: Spy_see_shrK)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   249
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   250
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
   251
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   252
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   253
text{*Nobody can have used non-existent keys!*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   254
lemma new_keys_not_used [simp]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   255
    "\<lbrakk>Key K \<notin> used evs; K \<in> symKeys; evs \<in> bankerb_gets\<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   256
     \<Longrightarrow> K \<notin> keysFor (parts (knows Spy evs))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   257
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   258
apply (erule bankerb_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   259
apply (frule_tac [8] Oops_parts_knows_Spy)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   260
apply (frule_tac [6] BK3_msg_in_parts_knows_Spy, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   261
txt{*Fake*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   262
apply (force dest!: keysFor_parts_insert)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   263
txt{*BK2, BK3, BK4*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   264
apply (force dest!: analz_shrK_Decrypt)+
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   265
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   266
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   267
subsection{* Lemmas concerning the form of items passed in messages *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   268
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   269
text{*Describes the form of K, X and K' when the Server sends this message.*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   270
lemma Says_Server_message_form:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   271
     "\<lbrakk> Says Server A (Crypt K' \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   272
         \<in> set evs; evs \<in> bankerb_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   273
      \<Longrightarrow> K' = shrK A & K \<notin> range shrK &
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   274
          Ticket = (Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>) &
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   275
          Key K \<notin> used(before
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   276
                  Says Server A (Crypt K' \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   277
                  on evs) &
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   278
          Tk = CT(before 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   279
                  Says Server A (Crypt K' \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   280
                  on evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   281
apply (unfold before_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   282
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   283
apply (erule bankerb_gets.induct, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   284
txt{*We need this simplification only for Message 2*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   285
apply (simp (no_asm) add: takeWhile_tail)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   286
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   287
txt{*Two subcases of Message 2. Subcase: used before*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   288
apply (blast dest: used_evs_rev [THEN equalityD2, THEN contra_subsetD] 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   289
                   used_takeWhile_used)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   290
txt{*subcase: CT before*}
44890
22f665a2e91c new fastforce replacing fastsimp - less confusing name
nipkow
parents: 39251
diff changeset
   291
apply (fastforce dest!: set_evs_rev [THEN equalityD2, THEN contra_subsetD, THEN takeWhile_void])
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   292
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   293
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   294
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   295
text{*If the encrypted message appears then it originated with the Server
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   296
  PROVIDED that A is NOT compromised!
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   297
  This allows A to verify freshness of the session key.
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 Kab_authentic:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   300
     "\<lbrakk> Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   301
           \<in> parts (knows Spy evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   302
         A \<notin> bad;  evs \<in> bankerb_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   303
       \<Longrightarrow> Says Server A (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   304
             \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   305
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   306
apply (erule bankerb_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   307
apply (frule_tac [8] Oops_parts_knows_Spy)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   308
apply (frule_tac [6] BK3_msg_in_parts_knows_Spy, simp_all, blast)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   309
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   310
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   311
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   312
text{*If the TICKET appears then it originated with the Server*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   313
text{*FRESHNESS OF THE SESSION KEY to B*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   314
lemma ticket_authentic:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   315
     "\<lbrakk> Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace> \<in> parts (knows Spy evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   316
         B \<notin> bad;  evs \<in> bankerb_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   317
       \<Longrightarrow> Says Server A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   318
            (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   319
                          Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   320
           \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   321
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   322
apply (erule bankerb_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   323
apply (frule_tac [8] Oops_parts_knows_Spy)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   324
apply (frule_tac [6] BK3_msg_in_parts_knows_Spy, simp_all, blast)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   325
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   326
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   327
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   328
text{*EITHER describes the form of X when the following message is sent,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   329
  OR     reduces it to the Fake case.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   330
  Use @{text Says_Server_message_form} if applicable.*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   331
lemma Gets_Server_message_form:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   332
     "\<lbrakk> Gets A (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   333
            \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   334
         evs \<in> bankerb_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   335
 \<Longrightarrow> (K \<notin> range shrK & X = (Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>))
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   336
          | X \<in> analz (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   337
apply (case_tac "A \<in> bad")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   338
apply (force dest!: Gets_imp_knows_Spy [THEN analz.Inj])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   339
apply (blast dest!: Kab_authentic Says_Server_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   340
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   341
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   342
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   343
text{*Reliability guarantees: honest agents act as we expect*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   344
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   345
lemma BK3_imp_Gets:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   346
   "\<lbrakk> Says A B \<lbrace>Ticket, Crypt K \<lbrace>Agent A, Number Ta\<rbrace>\<rbrace> \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   347
      A \<notin> bad; evs \<in> bankerb_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   348
    \<Longrightarrow> \<exists> Tk. Gets A (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   349
      \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   350
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   351
apply (erule bankerb_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   352
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   353
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   354
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   355
lemma BK4_imp_Gets:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   356
   "\<lbrakk> Says B A (Crypt K (Number Ta)) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   357
      B \<notin> bad; evs \<in> bankerb_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   358
  \<Longrightarrow> \<exists> Tk. Gets B \<lbrace>Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>,
32960
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 23746
diff changeset
   359
                    Crypt K \<lbrace>Agent A, Number Ta\<rbrace>\<rbrace> \<in> set evs"
18886
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   360
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   361
apply (erule bankerb_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   362
apply auto
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   363
done
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
lemma Gets_A_knows_K:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   366
  "\<lbrakk> Gets A (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   367
     evs \<in> bankerb_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   368
 \<Longrightarrow> Key K \<in> analz (knows A evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   369
apply (force dest: Gets_imp_knows_analz)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   370
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   371
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   372
lemma Gets_B_knows_K:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   373
  "\<lbrakk> Gets B \<lbrace>Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   374
             Crypt K \<lbrace>Agent A, Number Ta\<rbrace>\<rbrace> \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   375
     evs \<in> bankerb_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   376
 \<Longrightarrow> Key K \<in> analz (knows B evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   377
apply (force dest: Gets_imp_knows_analz)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   378
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   379
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   380
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   381
(****
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   382
 The following is to prove theorems of the form
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   383
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   384
  Key K \<in> analz (insert (Key KAB) (knows Spy evs)) \<Longrightarrow>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   385
  Key K \<in> analz (knows Spy evs)
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
 A more general formula must be proved inductively.
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   388
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   389
****)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   390
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   391
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   392
text{* Session keys are not used to encrypt other session keys *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   393
lemma analz_image_freshK [rule_format (no_asm)]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   394
     "evs \<in> bankerb_gets \<Longrightarrow>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   395
   \<forall>K KK. KK \<subseteq> - (range shrK) \<longrightarrow>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   396
          (Key K \<in> analz (Key`KK Un (knows Spy evs))) =
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   397
          (K \<in> KK | Key K \<in> analz (knows Spy evs))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   398
apply (erule bankerb_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   399
apply (drule_tac [8] Says_Server_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   400
apply (erule_tac [6] Gets_Server_message_form [THEN disjE], analz_freshK, spy_analz, auto) 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   401
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   402
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   403
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   404
lemma analz_insert_freshK:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   405
     "\<lbrakk> evs \<in> bankerb_gets;  KAB \<notin> range shrK \<rbrakk> \<Longrightarrow>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   406
      (Key K \<in> analz (insert (Key KAB) (knows Spy evs))) =
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   407
      (K = KAB | Key K \<in> analz (knows Spy evs))"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   408
by (simp only: analz_image_freshK analz_image_freshK_simps)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   409
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   410
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   411
text{* The session key K uniquely identifies the message *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   412
lemma unique_session_keys:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   413
     "\<lbrakk> Says Server A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   414
           (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   415
         Says Server A'
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   416
          (Crypt (shrK A') \<lbrace>Number Tk', Agent B', Key K, X'\<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   417
         evs \<in> bankerb_gets \<rbrakk> \<Longrightarrow> A=A' & Tk=Tk' & B=B' & X = X'"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   418
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   419
apply (erule rev_mp)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   420
apply (erule bankerb_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   421
apply (frule_tac [8] Oops_parts_knows_Spy)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   422
apply (frule_tac [6] BK3_msg_in_parts_knows_Spy, simp_all)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   423
txt{*BK2: it can't be a new key*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   424
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   425
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   426
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   427
lemma unique_session_keys_Gets:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   428
     "\<lbrakk> Gets A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   429
           (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   430
        Gets A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   431
          (Crypt (shrK A) \<lbrace>Number Tk', Agent B', Key K, X'\<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   432
        A \<notin> bad; evs \<in> bankerb_gets \<rbrakk> \<Longrightarrow> Tk=Tk' & B=B' & X = X'"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   433
apply (blast dest!: Kab_authentic unique_session_keys)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   434
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   435
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   436
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   437
lemma Server_Unique:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   438
     "\<lbrakk> Says Server A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   439
            (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   440
        evs \<in> bankerb_gets \<rbrakk> \<Longrightarrow> 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   441
   Unique Says Server A (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   442
   on evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   443
apply (erule rev_mp, erule bankerb_gets.induct, simp_all add: Unique_def)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   444
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   445
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   446
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   447
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   448
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   449
subsection{*Non-temporal guarantees, explicitly relying on non-occurrence of
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   450
oops events - refined below by temporal guarantees*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   451
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   452
text{*Non temporal treatment of confidentiality*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   453
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   454
text{* Lemma: the session key sent in msg BK2 would be lost by oops
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   455
    if the spy could see it! *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   456
lemma lemma_conf [rule_format (no_asm)]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   457
     "\<lbrakk> A \<notin> bad;  B \<notin> bad;  evs \<in> bankerb_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   458
  \<Longrightarrow> Says Server A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   459
          (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   460
                            Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   461
         \<in> set evs \<longrightarrow>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   462
      Key K \<in> analz (knows Spy evs) \<longrightarrow> Notes Spy \<lbrace>Number Tk, Key K\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   463
apply (erule bankerb_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   464
apply (frule_tac [8] Says_Server_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   465
apply (frule_tac [6] Gets_Server_message_form [THEN disjE])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   466
apply (simp_all (no_asm_simp) add: analz_insert_eq analz_insert_freshK pushes)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   467
txt{*Fake*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   468
apply spy_analz
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   469
txt{*BK2*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   470
apply (blast intro: parts_insertI)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   471
txt{*BK3*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   472
apply (case_tac "Aa \<in> bad")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   473
 prefer 2 apply (blast dest: Kab_authentic unique_session_keys)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   474
apply (blast dest: Gets_imp_knows_Spy [THEN analz.Inj] Crypt_Spy_analz_bad elim!: MPair_analz)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   475
txt{*Oops*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   476
apply (blast dest: unique_session_keys)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   477
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   478
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   479
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   480
text{*Confidentiality for the Server: Spy does not see the keys sent in msg BK2
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   481
as long as they have not expired.*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   482
lemma Confidentiality_S:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   483
     "\<lbrakk> Says Server A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   484
          (Crypt K' \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   485
        Notes Spy \<lbrace>Number Tk, Key K\<rbrace> \<notin> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   486
         A \<notin> bad;  B \<notin> bad;  evs \<in> bankerb_gets
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   487
      \<rbrakk> \<Longrightarrow> Key K \<notin> analz (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   488
apply (frule Says_Server_message_form, assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   489
apply (blast intro: lemma_conf)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   490
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   491
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   492
text{*Confidentiality for Alice*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   493
lemma Confidentiality_A:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   494
     "\<lbrakk> Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace> \<in> parts (knows Spy evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   495
        Notes Spy \<lbrace>Number Tk, Key K\<rbrace> \<notin> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   496
        A \<notin> bad;  B \<notin> bad;  evs \<in> bankerb_gets
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   497
      \<rbrakk> \<Longrightarrow> Key K \<notin> analz (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   498
by (blast dest!: Kab_authentic Confidentiality_S)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   499
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   500
text{*Confidentiality for Bob*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   501
lemma Confidentiality_B:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   502
     "\<lbrakk> Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   503
          \<in> parts (knows Spy evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   504
        Notes Spy \<lbrace>Number Tk, Key K\<rbrace> \<notin> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   505
        A \<notin> bad;  B \<notin> bad;  evs \<in> bankerb_gets
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   506
      \<rbrakk> \<Longrightarrow> Key K \<notin> analz (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   507
by (blast dest!: ticket_authentic Confidentiality_S)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   508
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   509
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   510
text{*Non temporal treatment of authentication*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   511
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   512
text{*Lemmas @{text lemma_A} and @{text lemma_B} in fact are common to both temporal and non-temporal treatments*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   513
lemma lemma_A [rule_format]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   514
     "\<lbrakk> A \<notin> bad; B \<notin> bad; evs \<in> bankerb_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   515
      \<Longrightarrow>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   516
         Key K \<notin> analz (knows Spy evs) \<longrightarrow>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   517
         Says Server A (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   518
         \<in> set evs \<longrightarrow>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   519
          Crypt K \<lbrace>Agent A, Number Ta\<rbrace> \<in> parts (knows Spy evs) \<longrightarrow>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   520
         Says A B \<lbrace>X, Crypt K \<lbrace>Agent A, Number Ta\<rbrace>\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   521
             \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   522
apply (erule bankerb_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   523
apply (frule_tac [8] Oops_parts_knows_Spy)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   524
apply (frule_tac [6] Gets_Server_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   525
apply (frule_tac [7] BK3_msg_in_parts_knows_Spy, analz_mono_contra)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   526
apply (simp_all (no_asm_simp) add: all_conj_distrib)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   527
txt{*Fake*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   528
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   529
txt{*BK2*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   530
apply (force dest: Crypt_imp_invKey_keysFor)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   531
txt{*BK3*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   532
apply (blast dest: Kab_authentic unique_session_keys)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   533
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   534
lemma lemma_B [rule_format]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   535
     "\<lbrakk> B \<notin> bad;  evs \<in> bankerb_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   536
      \<Longrightarrow> Key K \<notin> analz (knows Spy evs) \<longrightarrow>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   537
          Says Server A (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   538
          \<in> set evs \<longrightarrow>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   539
          Crypt K (Number Ta) \<in> parts (knows Spy evs) \<longrightarrow>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   540
          Says B A (Crypt K (Number Ta)) \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   541
apply (erule bankerb_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   542
apply (frule_tac [8] Oops_parts_knows_Spy)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   543
apply (frule_tac [6] Gets_Server_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   544
apply (drule_tac [7] BK3_msg_in_parts_knows_Spy, analz_mono_contra)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   545
apply (simp_all (no_asm_simp) add: all_conj_distrib)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   546
txt{*Fake*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   547
apply blast
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   548
txt{*BK2*} 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   549
apply (force dest: Crypt_imp_invKey_keysFor)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   550
txt{*BK4*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   551
apply (blast dest: ticket_authentic unique_session_keys
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   552
                   Gets_imp_knows_Spy [THEN analz.Inj] Crypt_Spy_analz_bad)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   553
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   554
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   555
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   556
text{*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
   557
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   558
text{*Authentication of A to B*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   559
lemma B_authenticates_A_r:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   560
     "\<lbrakk> Crypt K \<lbrace>Agent A, Number Ta\<rbrace> \<in> parts (knows Spy evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   561
         Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>  \<in> parts (knows Spy evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   562
        Notes Spy \<lbrace>Number Tk, Key K\<rbrace> \<notin> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   563
         A \<notin> bad;  B \<notin> bad;  evs \<in> bankerb_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   564
      \<Longrightarrow> Says A B \<lbrace>Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   565
                     Crypt K \<lbrace>Agent A, Number Ta\<rbrace>\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   566
by (blast dest!: ticket_authentic
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   567
          intro!: lemma_A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   568
          elim!: Confidentiality_S [THEN [2] rev_notE])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   569
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   570
text{*Authentication of B to A*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   571
lemma A_authenticates_B_r:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   572
     "\<lbrakk> Crypt K (Number Ta) \<in> parts (knows Spy evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   573
        Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace> \<in> parts (knows Spy evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   574
        Notes Spy \<lbrace>Number Tk, Key K\<rbrace> \<notin> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   575
        A \<notin> bad;  B \<notin> bad;  evs \<in> bankerb_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   576
      \<Longrightarrow> Says B A (Crypt K (Number Ta)) \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   577
by (blast dest!: Kab_authentic
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   578
          intro!: lemma_B elim!: Confidentiality_S [THEN [2] rev_notE])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   579
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   580
lemma B_authenticates_A:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   581
     "\<lbrakk> Crypt K \<lbrace>Agent A, Number Ta\<rbrace> \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   582
         Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>  \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   583
        Key K \<notin> analz (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   584
         A \<notin> bad;  B \<notin> bad;  evs \<in> bankerb_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   585
      \<Longrightarrow> Says A B \<lbrace>Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   586
                     Crypt K \<lbrace>Agent A, Number Ta\<rbrace>\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   587
apply (blast dest!: ticket_authentic intro!: lemma_A)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   588
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   589
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   590
lemma A_authenticates_B:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   591
     "\<lbrakk> Crypt K (Number Ta) \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   592
        Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace> \<in> parts (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   593
        Key K \<notin> analz (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   594
        A \<notin> bad;  B \<notin> bad;  evs \<in> bankerb_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   595
      \<Longrightarrow> Says B A (Crypt K (Number Ta)) \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   596
apply (blast dest!: Kab_authentic intro!: lemma_B)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   597
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   598
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   599
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   600
subsection{*Temporal guarantees, relying on a temporal check that insures that
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   601
no oops event occurred. These are available in the sense of goal availability*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   602
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   603
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   604
text{*Temporal treatment of confidentiality*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   605
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   606
text{* Lemma: the session key sent in msg BK2 would be EXPIRED
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   607
    if the spy could see it! *}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   608
lemma lemma_conf_temporal [rule_format (no_asm)]:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   609
     "\<lbrakk> A \<notin> bad;  B \<notin> bad;  evs \<in> bankerb_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   610
  \<Longrightarrow> Says Server A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   611
          (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   612
                            Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>\<rbrace>)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   613
         \<in> set evs \<longrightarrow>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   614
      Key K \<in> analz (knows Spy evs) \<longrightarrow> expiredK Tk evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   615
apply (erule bankerb_gets.induct)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   616
apply (frule_tac [8] Says_Server_message_form)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   617
apply (frule_tac [6] Gets_Server_message_form [THEN disjE])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   618
apply (simp_all (no_asm_simp) add: less_SucI analz_insert_eq analz_insert_freshK pushes)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   619
txt{*Fake*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   620
apply spy_analz
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   621
txt{*BK2*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   622
apply (blast intro: parts_insertI less_SucI)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   623
txt{*BK3*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   624
apply (case_tac "Aa \<in> bad")
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   625
 prefer 2 apply (blast dest: Kab_authentic unique_session_keys)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   626
apply (blast dest: Gets_imp_knows_Spy [THEN analz.Inj] Crypt_Spy_analz_bad elim!: MPair_analz intro: less_SucI)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   627
txt{*Oops: PROOF FAILS if unsafe intro below*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   628
apply (blast dest: unique_session_keys intro!: less_SucI)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   629
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   630
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   631
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   632
text{*Confidentiality for the Server: Spy does not see the keys sent in msg BK2
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   633
as long as they have not expired.*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   634
lemma Confidentiality_S_temporal:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   635
     "\<lbrakk> Says Server A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   636
          (Crypt K' \<lbrace>Number T, Agent B, Key K, X\<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   637
         \<not> expiredK T evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   638
         A \<notin> bad;  B \<notin> bad;  evs \<in> bankerb_gets
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   639
      \<rbrakk> \<Longrightarrow> Key K \<notin> analz (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   640
apply (frule Says_Server_message_form, assumption)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   641
apply (blast intro: lemma_conf_temporal)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   642
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   643
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   644
text{*Confidentiality for Alice*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   645
lemma Confidentiality_A_temporal:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   646
     "\<lbrakk> Crypt (shrK A) \<lbrace>Number T, Agent B, Key K, X\<rbrace> \<in> parts (knows Spy evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   647
         \<not> expiredK T evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   648
         A \<notin> bad;  B \<notin> bad;  evs \<in> bankerb_gets
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   649
      \<rbrakk> \<Longrightarrow> Key K \<notin> analz (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   650
by (blast dest!: Kab_authentic Confidentiality_S_temporal)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   651
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   652
text{*Confidentiality for Bob*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   653
lemma Confidentiality_B_temporal:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   654
     "\<lbrakk> Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   655
          \<in> parts (knows Spy evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   656
        \<not> expiredK Tk evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   657
        A \<notin> bad;  B \<notin> bad;  evs \<in> bankerb_gets
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   658
      \<rbrakk> \<Longrightarrow> Key K \<notin> analz (knows Spy evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   659
by (blast dest!: ticket_authentic Confidentiality_S_temporal)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   660
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   661
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   662
text{*Temporal treatment of authentication*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   663
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   664
text{*Authentication of A to B*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   665
lemma B_authenticates_A_temporal:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   666
     "\<lbrakk> Crypt K \<lbrace>Agent A, Number Ta\<rbrace> \<in> parts (knows Spy evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   667
         Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   668
         \<in> parts (knows Spy evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   669
         \<not> expiredK Tk evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   670
         A \<notin> bad;  B \<notin> bad;  evs \<in> bankerb_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   671
      \<Longrightarrow> Says A B \<lbrace>Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   672
                     Crypt K \<lbrace>Agent A, Number Ta\<rbrace>\<rbrace> \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   673
by (blast dest!: ticket_authentic
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   674
          intro!: lemma_A
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   675
          elim!: Confidentiality_S_temporal [THEN [2] rev_notE])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   676
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   677
text{*Authentication of B to A*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   678
lemma A_authenticates_B_temporal:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   679
     "\<lbrakk> Crypt K (Number Ta) \<in> parts (knows Spy evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   680
         Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, X\<rbrace>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   681
         \<in> parts (knows Spy evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   682
         \<not> expiredK Tk evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   683
         A \<notin> bad;  B \<notin> bad;  evs \<in> bankerb_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   684
      \<Longrightarrow> Says B A (Crypt K (Number Ta)) \<in> set evs"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   685
by (blast dest!: Kab_authentic
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   686
          intro!: lemma_B elim!: Confidentiality_S_temporal [THEN [2] rev_notE])
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   687
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   688
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   689
subsection{*Combined guarantees of key distribution and non-injective agreement on the session keys*}
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   690
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   691
lemma B_authenticates_and_keydist_to_A:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   692
     "\<lbrakk> Gets B \<lbrace>Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   693
                Crypt K \<lbrace>Agent A, Number Ta\<rbrace>\<rbrace> \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   694
        Key K \<notin> analz (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   695
        A \<notin> bad;  B \<notin> bad;  evs \<in> bankerb_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   696
    \<Longrightarrow> Says A B \<lbrace>Crypt (shrK B) \<lbrace>Number Tk, Agent A, Key K\<rbrace>,
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   697
                  Crypt K \<lbrace>Agent A, Number Ta\<rbrace>\<rbrace> \<in> set evs 
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   698
     \<and>  Key K \<in> analz (knows A evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   699
apply (blast dest: B_authenticates_A BK3_imp_Gets Gets_A_knows_K)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   700
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   701
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   702
lemma A_authenticates_and_keydist_to_B:
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   703
     "\<lbrakk> Gets A (Crypt (shrK A) \<lbrace>Number Tk, Agent B, Key K, Ticket\<rbrace>) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   704
        Gets A (Crypt K (Number Ta)) \<in> set evs;
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   705
        Key K \<notin> analz (spies evs);
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   706
        A \<notin> bad;  B \<notin> bad;  evs \<in> bankerb_gets \<rbrakk>
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   707
    \<Longrightarrow> Says B A (Crypt K (Number Ta)) \<in> set evs
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   708
    \<and>   Key K \<in> analz (knows B evs)"
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   709
apply (blast dest: A_authenticates_B BK4_imp_Gets Gets_B_knows_K)
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   710
done
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   711
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   712
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   713
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   714
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   715
9f27383426db new and updated protocol proofs by Giamp Bella
paulson
parents:
diff changeset
   716
end