src/HOL/Auth/OtwayRees.thy
author paulson
Thu, 12 Apr 2001 12:45:05 +0200
changeset 11251 a6816d47f41d
parent 11230 756c5034f08b
child 11655 923e4d0d36d5
permissions -rw-r--r--
converted many HOL/Auth theories to Isar scripts
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11251
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
     1
(*  Title:      HOL/Auth/OtwayRees
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
     2
    ID:         $Id$
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
     4
    Copyright   1996  University of Cambridge
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
     5
6308
76f3865a2b1d Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents: 5434
diff changeset
     6
Inductive relation "otway" for the Otway-Rees protocol
76f3865a2b1d Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents: 5434
diff changeset
     7
extended by Gets primitive.
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
     8
2014
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
     9
Version that encrypts Nonce NB
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    10
11251
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    11
From page 244 of
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    12
  Burrows, Abadi and Needham.  A Logic of Authentication.
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    13
  Proc. Royal Soc. 426 (1989)
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    14
*)
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    15
11251
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    16
theory OtwayRees = Shared:
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    17
6308
76f3865a2b1d Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents: 5434
diff changeset
    18
11251
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    19
consts  otway   :: "event list set"
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3465
diff changeset
    20
inductive "otway"
11251
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    21
  intros
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    22
         (*Initial trace is empty*)
11251
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    23
   Nil:  "[] \<in> otway"
5434
9b4bed3f394c Got rid of not_Says_to_self and most uses of ~= in definitions and theorems
paulson
parents: 5359
diff changeset
    24
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2014
diff changeset
    25
         (*The spy MAY say anything he CAN say.  We do not expect him to
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    26
           invent new nonces here, but he can also use NS1.  Common to
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    27
           all similar protocols.*)
11251
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    28
   Fake: "[| evsf \<in> otway;  X \<in> synth (analz (knows Spy evsf)) |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    29
          ==> Says Spy B X  # evsf \<in> otway"
6308
76f3865a2b1d Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents: 5434
diff changeset
    30
76f3865a2b1d Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents: 5434
diff changeset
    31
         (*A message that has been sent can be received by the
76f3865a2b1d Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents: 5434
diff changeset
    32
           intended recipient.*)
11251
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    33
   Reception: "[| evsr \<in> otway;  Says A B X \<in>set evsr |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    34
               ==> Gets B X # evsr \<in> otway"
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    35
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    36
         (*Alice initiates a protocol run*)
11251
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    37
   OR1:  "[| evs1 \<in> otway;  Nonce NA \<notin> used evs1 |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    38
          ==> Says A B {|Nonce NA, Agent A, Agent B,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    39
                         Crypt (shrK A) {|Nonce NA, Agent A, Agent B|} |}
3659
eddedfe2f3f8 Renamed "evs" to "evs1", "evs2", etc. in protocol inductive definition
paulson
parents: 3519
diff changeset
    40
                 # evs1 : otway"
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    41
6333
b1dec44d0018 deleted obsolete comments
paulson
parents: 6308
diff changeset
    42
         (*Bob's response to Alice's message.  Note that NB is encrypted.*)
11251
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    43
   OR2:  "[| evs2 \<in> otway;  Nonce NB \<notin> used evs2;
6308
76f3865a2b1d Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents: 5434
diff changeset
    44
             Gets B {|Nonce NA, Agent A, Agent B, X|} : set evs2 |]
11251
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    45
          ==> Says B Server
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    46
                  {|Nonce NA, Agent A, Agent B, X,
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2378
diff changeset
    47
                    Crypt (shrK B)
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2451
diff changeset
    48
                      {|Nonce NA, Nonce NB, Agent A, Agent B|}|}
3659
eddedfe2f3f8 Renamed "evs" to "evs1", "evs2", etc. in protocol inductive definition
paulson
parents: 3519
diff changeset
    49
                 # evs2 : otway"
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    50
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    51
         (*The Server receives Bob's message and checks that the three NAs
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    52
           match.  Then he sends a new session key to Bob with a packet for
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    53
           forwarding to Alice.*)
11251
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    54
   OR3:  "[| evs3 \<in> otway;  Key KAB \<notin> used evs3;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    55
             Gets Server
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    56
                  {|Nonce NA, Agent A, Agent B,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    57
                    Crypt (shrK A) {|Nonce NA, Agent A, Agent B|},
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2135
diff changeset
    58
                    Crypt (shrK B) {|Nonce NA, Nonce NB, Agent A, Agent B|}|}
3659
eddedfe2f3f8 Renamed "evs" to "evs1", "evs2", etc. in protocol inductive definition
paulson
parents: 3519
diff changeset
    59
               : set evs3 |]
11251
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    60
          ==> Says Server B
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    61
                  {|Nonce NA,
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2451
diff changeset
    62
                    Crypt (shrK A) {|Nonce NA, Key KAB|},
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2451
diff changeset
    63
                    Crypt (shrK B) {|Nonce NB, Key KAB|}|}
3659
eddedfe2f3f8 Renamed "evs" to "evs1", "evs2", etc. in protocol inductive definition
paulson
parents: 3519
diff changeset
    64
                 # evs3 : otway"
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    65
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    66
         (*Bob receives the Server's (?) message and compares the Nonces with
5434
9b4bed3f394c Got rid of not_Says_to_self and most uses of ~= in definitions and theorems
paulson
parents: 5359
diff changeset
    67
	   those in the message he previously sent the Server.
11251
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    68
           Need B \<noteq> Server because we allow messages to self.*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    69
   OR4:  "[| evs4 \<in> otway;  B \<noteq> Server;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    70
             Says B Server {|Nonce NA, Agent A, Agent B, X',
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2135
diff changeset
    71
                             Crypt (shrK B)
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2135
diff changeset
    72
                                   {|Nonce NA, Nonce NB, Agent A, Agent B|}|}
3659
eddedfe2f3f8 Renamed "evs" to "evs1", "evs2", etc. in protocol inductive definition
paulson
parents: 3519
diff changeset
    73
               : set evs4;
6308
76f3865a2b1d Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents: 5434
diff changeset
    74
             Gets B {|Nonce NA, X, Crypt (shrK B) {|Nonce NB, Key K|}|}
3659
eddedfe2f3f8 Renamed "evs" to "evs1", "evs2", etc. in protocol inductive definition
paulson
parents: 3519
diff changeset
    75
               : set evs4 |]
eddedfe2f3f8 Renamed "evs" to "evs1", "evs2", etc. in protocol inductive definition
paulson
parents: 3519
diff changeset
    76
          ==> Says B A {|Nonce NA, X|} # evs4 : otway"
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    77
2135
80477862ab33 Minor corrections
paulson
parents: 2105
diff changeset
    78
         (*This message models possible leaks of session keys.  The nonces
80477862ab33 Minor corrections
paulson
parents: 2105
diff changeset
    79
           identify the protocol run.*)
11251
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    80
   Oops: "[| evso \<in> otway;
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2135
diff changeset
    81
             Says Server B {|Nonce NA, X, Crypt (shrK B) {|Nonce NB, Key K|}|}
3659
eddedfe2f3f8 Renamed "evs" to "evs1", "evs2", etc. in protocol inductive definition
paulson
parents: 3519
diff changeset
    82
               : set evso |]
4537
4e835bd9fada Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents: 3683
diff changeset
    83
          ==> Notes Spy {|Nonce NA, Nonce NB, Key K|} # evso : otway"
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    84
11251
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    85
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    86
declare Says_imp_knows_Spy [THEN analz.Inj, dest]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    87
declare parts.Body  [dest]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    88
declare analz_into_parts [dest]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    89
declare Fake_parts_insert_in_Un  [dest]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    90
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    91
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    92
(*A "possibility property": there are traces that reach the end*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    93
lemma "B \<noteq> Server
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    94
      ==> \<exists>K. \<exists>evs \<in> otway.
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    95
             Says B A {|Nonce NA, Crypt (shrK A) {|Nonce NA, Key K|}|}
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    96
               \<in> set evs"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    97
apply (intro exI bexI)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    98
apply (rule_tac [2] otway.Nil
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
    99
                    [THEN otway.OR1, THEN otway.Reception,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   100
                     THEN otway.OR2, THEN otway.Reception,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   101
                     THEN otway.OR3, THEN otway.Reception, THEN otway.OR4])
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   102
apply possibility
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   103
done
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   104
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   105
lemma Gets_imp_Says [dest!]:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   106
     "[| Gets B X \<in> set evs; evs \<in> otway |] ==> \<exists>A. Says A B X \<in> set evs"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   107
apply (erule rev_mp)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   108
apply (erule otway.induct)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   109
apply auto
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   110
done
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   111
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   112
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   113
(**** Inductive proofs about otway ****)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   114
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   115
(** For reasoning about the encrypted portion of messages **)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   116
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   117
lemma OR2_analz_knows_Spy:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   118
     "[| Gets B {|N, Agent A, Agent B, X|} \<in> set evs;  evs \<in> otway |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   119
      ==> X \<in> analz (knows Spy evs)"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   120
by blast
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   121
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   122
lemma OR4_analz_knows_Spy:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   123
     "[| Gets B {|N, X, Crypt (shrK B) X'|} \<in> set evs;  evs \<in> otway |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   124
      ==> X \<in> analz (knows Spy evs)"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   125
by blast
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   126
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   127
(*These lemmas assist simplification by removing forwarded X-variables.
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   128
  We can replace them by rewriting with parts_insert2 and proving using
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   129
  dest: parts_cut, but the proofs become more difficult.*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   130
lemmas OR2_parts_knows_Spy =
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   131
    OR2_analz_knows_Spy [THEN analz_into_parts, standard]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   132
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   133
(*There could be OR4_parts_knows_Spy and Oops_parts_knows_Spy, but for
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   134
  some reason proofs work without them!*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   135
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   136
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   137
(** Theorems of the form X \<notin> parts (knows Spy evs) imply that NOBODY
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   138
    sends messages containing X! **)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   139
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   140
(*Spy never sees a good agent's shared key!*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   141
lemma Spy_see_shrK [simp]:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   142
     "evs \<in> otway ==> (Key (shrK A) \<in> parts (knows Spy evs)) = (A \<in> bad)"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   143
apply (erule otway.induct, force,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   144
       drule_tac [4] OR2_parts_knows_Spy, simp_all)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   145
apply blast+
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   146
done
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   147
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   148
lemma Spy_analz_shrK [simp]:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   149
     "evs \<in> otway ==> (Key (shrK A) \<in> analz (knows Spy evs)) = (A \<in> bad)"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   150
by auto
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   151
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   152
lemma Spy_see_shrK_D [dest!]:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   153
     "[|Key (shrK A) \<in> parts (knows Spy evs);  evs \<in> otway|] ==> A \<in> bad"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   154
by (blast dest: Spy_see_shrK)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   155
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   156
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   157
(*** Proofs involving analz ***)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   158
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   159
(*Describes the form of K and NA when the Server sends this message.  Also
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   160
  for Oops case.*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   161
lemma Says_Server_message_form:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   162
     "[| Says Server B {|NA, X, Crypt (shrK B) {|NB, Key K|}|} \<in> set evs;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   163
         evs \<in> otway |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   164
      ==> K \<notin> range shrK & (\<exists>i. NA = Nonce i) & (\<exists>j. NB = Nonce j)"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   165
apply (erule rev_mp, erule otway.induct, simp_all)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   166
apply blast
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   167
done
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   168
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   169
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   170
(****
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   171
 The following is to prove theorems of the form
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   172
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   173
  Key K \<in> analz (insert (Key KAB) (knows Spy evs)) ==>
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   174
  Key K \<in> analz (knows Spy evs)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   175
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   176
 A more general formula must be proved inductively.
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   177
****)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   178
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   179
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   180
(** Session keys are not used to encrypt other session keys **)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   181
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   182
(*The equality makes the induction hypothesis easier to apply*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   183
lemma analz_image_freshK [rule_format]:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   184
 "evs \<in> otway ==>
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   185
   \<forall>K KK. KK <= -(range shrK) -->
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   186
          (Key K \<in> analz (Key`KK Un (knows Spy evs))) =
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   187
          (K \<in> KK | Key K \<in> analz (knows Spy evs))"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   188
apply (erule otway.induct, force)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   189
apply (frule_tac [7] Says_Server_message_form)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   190
apply (drule_tac [6] OR4_analz_knows_Spy)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   191
apply (drule_tac [4] OR2_analz_knows_Spy)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   192
apply analz_freshK
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   193
apply spy_analz
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   194
done
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   195
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   196
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   197
lemma analz_insert_freshK:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   198
  "[| evs \<in> otway;  KAB \<notin> range shrK |] ==>
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   199
      Key K \<in> analz (insert (Key KAB) (knows Spy evs)) =
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   200
      (K = KAB | Key K \<in> analz (knows Spy evs))"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   201
by (simp only: analz_image_freshK analz_image_freshK_simps)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   202
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   203
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   204
(*** The Key K uniquely identifies the Server's  message. **)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   205
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   206
lemma unique_session_keys:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   207
     "[| Says Server B {|NA, X, Crypt (shrK B) {|NB, K|}|}   \<in> set evs;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   208
         Says Server B' {|NA',X',Crypt (shrK B') {|NB',K|}|} \<in> set evs;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   209
         evs \<in> otway |] ==> X=X' & B=B' & NA=NA' & NB=NB'"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   210
apply (erule rev_mp)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   211
apply (erule rev_mp)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   212
apply (erule otway.induct, simp_all)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   213
(*Remaining cases: OR3 and OR4*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   214
apply blast+
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   215
done
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   216
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   217
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   218
(**** Authenticity properties relating to NA ****)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   219
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   220
(*Only OR1 can have caused such a part of a message to appear.*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   221
lemma Crypt_imp_OR1 [rule_format]:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   222
 "[| A \<notin> bad;  evs \<in> otway |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   223
  ==> Crypt (shrK A) {|NA, Agent A, Agent B|} \<in> parts (knows Spy evs) -->
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   224
      Says A B {|NA, Agent A, Agent B,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   225
                 Crypt (shrK A) {|NA, Agent A, Agent B|}|}
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   226
        \<in> set evs"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   227
apply (erule otway.induct, force,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   228
       drule_tac [4] OR2_parts_knows_Spy, simp_all)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   229
apply blast+
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   230
done
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   231
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   232
lemma Crypt_imp_OR1_Gets:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   233
     "[| Gets B {|NA, Agent A, Agent B,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   234
                  Crypt (shrK A) {|NA, Agent A, Agent B|}|} \<in> set evs;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   235
         A \<notin> bad; evs \<in> otway |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   236
       ==> Says A B {|NA, Agent A, Agent B,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   237
                      Crypt (shrK A) {|NA, Agent A, Agent B|}|}
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   238
             \<in> set evs"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   239
by (blast dest: Crypt_imp_OR1)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   240
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   241
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   242
(** The Nonce NA uniquely identifies A's message. **)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   243
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   244
lemma unique_NA:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   245
     "[| Crypt (shrK A) {|NA, Agent A, Agent B|} \<in> parts (knows Spy evs);
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   246
         Crypt (shrK A) {|NA, Agent A, Agent C|} \<in> parts (knows Spy evs);
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   247
         evs \<in> otway;  A \<notin> bad |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   248
      ==> B = C"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   249
apply (erule rev_mp, erule rev_mp)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   250
apply (erule otway.induct, force,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   251
       drule_tac [4] OR2_parts_knows_Spy, simp_all)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   252
apply blast+
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   253
done
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   254
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   255
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   256
(*It is impossible to re-use a nonce in both OR1 and OR2.  This holds because
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   257
  OR2 encrypts Nonce NB.  It prevents the attack that can occur in the
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   258
  over-simplified version of this protocol: see OtwayRees_Bad.*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   259
lemma no_nonce_OR1_OR2:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   260
   "[| Crypt (shrK A) {|NA, Agent A, Agent B|} \<in> parts (knows Spy evs);
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   261
       A \<notin> bad;  evs \<in> otway |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   262
    ==> Crypt (shrK A) {|NA', NA, Agent A', Agent A|} \<notin> parts (knows Spy evs)"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   263
apply (erule rev_mp)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   264
apply (erule otway.induct, force,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   265
       drule_tac [4] OR2_parts_knows_Spy, simp_all)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   266
apply blast+
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   267
done
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   268
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   269
(*Crucial property: If the encrypted message appears, and A has used NA
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   270
  to start a run, then it originated with the Server!*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   271
lemma NA_Crypt_imp_Server_msg [rule_format]:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   272
     "[| A \<notin> bad;  evs \<in> otway |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   273
      ==> Says A B {|NA, Agent A, Agent B,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   274
                     Crypt (shrK A) {|NA, Agent A, Agent B|}|} \<in> set evs -->
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   275
          Crypt (shrK A) {|NA, Key K|} \<in> parts (knows Spy evs)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   276
          --> (\<exists>NB. Says Server B
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   277
                         {|NA,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   278
                           Crypt (shrK A) {|NA, Key K|},
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   279
                           Crypt (shrK B) {|NB, Key K|}|} \<in> set evs)"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   280
apply (erule otway.induct, force,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   281
       drule_tac [4] OR2_parts_knows_Spy, simp_all)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   282
apply blast
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   283
(*OR1: it cannot be a new Nonce, contradiction.*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   284
apply blast
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   285
(*OR3*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   286
apply (blast dest!: no_nonce_OR1_OR2 intro: unique_NA)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   287
(*OR4*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   288
apply (blast intro!: Crypt_imp_OR1)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   289
done
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   290
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   291
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   292
(*Corollary: if A receives B's OR4 message and the nonce NA agrees
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   293
  then the key really did come from the Server!  CANNOT prove this of the
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   294
  bad form of this protocol, even though we can prove
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   295
  Spy_not_see_encrypted_key*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   296
lemma A_trusts_OR4:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   297
     "[| Says A  B {|NA, Agent A, Agent B,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   298
                     Crypt (shrK A) {|NA, Agent A, Agent B|}|} \<in> set evs;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   299
         Says B' A {|NA, Crypt (shrK A) {|NA, Key K|}|} \<in> set evs;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   300
     A \<notin> bad;  evs \<in> otway |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   301
  ==> \<exists>NB. Says Server B
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   302
               {|NA,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   303
                 Crypt (shrK A) {|NA, Key K|},
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   304
                 Crypt (shrK B) {|NB, Key K|}|}
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   305
                 \<in> set evs"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   306
by (blast intro!: NA_Crypt_imp_Server_msg)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   307
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   308
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   309
(** Crucial secrecy property: Spy does not see the keys sent in msg OR3
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   310
    Does not in itself guarantee security: an attack could violate
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   311
    the premises, e.g. by having A=Spy **)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   312
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   313
lemma secrecy_lemma:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   314
 "[| A \<notin> bad;  B \<notin> bad;  evs \<in> otway |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   315
  ==> Says Server B
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   316
        {|NA, Crypt (shrK A) {|NA, Key K|},
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   317
          Crypt (shrK B) {|NB, Key K|}|} \<in> set evs -->
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   318
      Notes Spy {|NA, NB, Key K|} \<notin> set evs -->
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   319
      Key K \<notin> analz (knows Spy evs)"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   320
apply (erule otway.induct, force)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   321
apply (frule_tac [7] Says_Server_message_form)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   322
apply (drule_tac [6] OR4_analz_knows_Spy)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   323
apply (drule_tac [4] OR2_analz_knows_Spy)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   324
apply (simp_all add: analz_insert_eq analz_insert_freshK pushes)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   325
apply spy_analz  (*Fake*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   326
(*OR3, OR4, Oops*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   327
apply (blast dest: unique_session_keys)+
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   328
done
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   329
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   330
lemma Spy_not_see_encrypted_key:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   331
     "[| Says Server B
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   332
          {|NA, Crypt (shrK A) {|NA, Key K|},
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   333
                Crypt (shrK B) {|NB, Key K|}|} \<in> set evs;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   334
         Notes Spy {|NA, NB, Key K|} \<notin> set evs;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   335
         A \<notin> bad;  B \<notin> bad;  evs \<in> otway |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   336
      ==> Key K \<notin> analz (knows Spy evs)"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   337
by (blast dest: Says_Server_message_form secrecy_lemma)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   338
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   339
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   340
(*A's guarantee.  The Oops premise quantifies over NB because A cannot know
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   341
  what it is.*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   342
lemma A_gets_good_key:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   343
     "[| Says A  B {|NA, Agent A, Agent B,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   344
                     Crypt (shrK A) {|NA, Agent A, Agent B|}|} \<in> set evs;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   345
         Says B' A {|NA, Crypt (shrK A) {|NA, Key K|}|} \<in> set evs;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   346
         \<forall>NB. Notes Spy {|NA, NB, Key K|} \<notin> set evs;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   347
         A \<notin> bad;  B \<notin> bad;  evs \<in> otway |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   348
      ==> Key K \<notin> analz (knows Spy evs)"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   349
by (blast dest!: A_trusts_OR4 Spy_not_see_encrypted_key)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   350
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   351
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   352
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   353
(**** Authenticity properties relating to NB ****)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   354
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   355
(*Only OR2 can have caused such a part of a message to appear.  We do not
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   356
  know anything about X: it does NOT have to have the right form.*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   357
lemma Crypt_imp_OR2:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   358
     "[| Crypt (shrK B) {|NA, NB, Agent A, Agent B|} \<in> parts (knows Spy evs);
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   359
         B \<notin> bad;  evs \<in> otway |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   360
      ==> \<exists>X. Says B Server
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   361
                 {|NA, Agent A, Agent B, X,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   362
                   Crypt (shrK B) {|NA, NB, Agent A, Agent B|}|}
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   363
                 \<in> set evs"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   364
apply (erule rev_mp)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   365
apply (erule otway.induct, force,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   366
       drule_tac [4] OR2_parts_knows_Spy, simp_all)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   367
apply blast+
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   368
done
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   369
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   370
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   371
(** The Nonce NB uniquely identifies B's  message. **)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   372
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   373
lemma unique_NB:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   374
     "[| Crypt (shrK B) {|NA, NB, Agent A, Agent B|} \<in> parts(knows Spy evs);
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   375
         Crypt (shrK B) {|NC, NB, Agent C, Agent B|} \<in> parts(knows Spy evs);
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   376
           evs \<in> otway;  B \<notin> bad |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   377
         ==> NC = NA & C = A"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   378
apply (erule rev_mp, erule rev_mp)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   379
apply (erule otway.induct, force,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   380
       drule_tac [4] OR2_parts_knows_Spy, simp_all)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   381
(*Fake, OR2*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   382
apply blast+
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   383
done
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   384
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   385
(*If the encrypted message appears, and B has used Nonce NB,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   386
  then it originated with the Server!  Quite messy proof.*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   387
lemma NB_Crypt_imp_Server_msg [rule_format]:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   388
 "[| B \<notin> bad;  evs \<in> otway |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   389
  ==> Crypt (shrK B) {|NB, Key K|} \<in> parts (knows Spy evs)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   390
      --> (\<forall>X'. Says B Server
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   391
                     {|NA, Agent A, Agent B, X',
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   392
                       Crypt (shrK B) {|NA, NB, Agent A, Agent B|}|}
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   393
           \<in> set evs
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   394
           --> Says Server B
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   395
                {|NA, Crypt (shrK A) {|NA, Key K|},
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   396
                      Crypt (shrK B) {|NB, Key K|}|}
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   397
                    \<in> set evs)"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   398
apply simp
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   399
apply (erule otway.induct, force,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   400
       drule_tac [4] OR2_parts_knows_Spy, simp_all)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   401
apply blast
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   402
(*OR1: it cannot be a new Nonce, contradiction.*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   403
(*OR2*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   404
apply blast
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   405
(*OR3: needs elim: MPair_parts or it takes forever!*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   406
apply (blast dest: unique_NB dest!: no_nonce_OR1_OR2)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   407
(*OR4*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   408
apply (blast dest!: Crypt_imp_OR2)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   409
done
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   410
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   411
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   412
(*Guarantee for B: if it gets a message with matching NB then the Server
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   413
  has sent the correct message.*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   414
lemma B_trusts_OR3:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   415
     "[| Says B Server {|NA, Agent A, Agent B, X',
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   416
                         Crypt (shrK B) {|NA, NB, Agent A, Agent B|} |}
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   417
           \<in> set evs;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   418
         Gets B {|NA, X, Crypt (shrK B) {|NB, Key K|}|} \<in> set evs;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   419
         B \<notin> bad;  evs \<in> otway |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   420
      ==> Says Server B
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   421
               {|NA,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   422
                 Crypt (shrK A) {|NA, Key K|},
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   423
                 Crypt (shrK B) {|NB, Key K|}|}
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   424
                 \<in> set evs"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   425
by (blast intro!: NB_Crypt_imp_Server_msg)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   426
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   427
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   428
(*The obvious combination of B_trusts_OR3 with Spy_not_see_encrypted_key*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   429
lemma B_gets_good_key:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   430
     "[| Says B Server {|NA, Agent A, Agent B, X',
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   431
                         Crypt (shrK B) {|NA, NB, Agent A, Agent B|} |}
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   432
           \<in> set evs;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   433
         Gets B {|NA, X, Crypt (shrK B) {|NB, Key K|}|} \<in> set evs;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   434
         Notes Spy {|NA, NB, Key K|} \<notin> set evs;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   435
         A \<notin> bad;  B \<notin> bad;  evs \<in> otway |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   436
      ==> Key K \<notin> analz (knows Spy evs)"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   437
by (blast dest!: B_trusts_OR3 Spy_not_see_encrypted_key)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   438
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   439
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   440
lemma OR3_imp_OR2:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   441
     "[| Says Server B
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   442
              {|NA, Crypt (shrK A) {|NA, Key K|},
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   443
                Crypt (shrK B) {|NB, Key K|}|} \<in> set evs;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   444
         B \<notin> bad;  evs \<in> otway |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   445
  ==> \<exists>X. Says B Server {|NA, Agent A, Agent B, X,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   446
                            Crypt (shrK B) {|NA, NB, Agent A, Agent B|} |}
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   447
              \<in> set evs"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   448
apply (erule rev_mp)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   449
apply (erule otway.induct, simp_all)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   450
apply (blast dest!: Crypt_imp_OR2)+
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   451
done
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   452
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   453
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   454
(*After getting and checking OR4, agent A can trust that B has been active.
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   455
  We could probably prove that X has the expected form, but that is not
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   456
  strictly necessary for authentication.*)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   457
lemma A_auths_B:
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   458
     "[| Says B' A {|NA, Crypt (shrK A) {|NA, Key K|}|} \<in> set evs;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   459
         Says A  B {|NA, Agent A, Agent B,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   460
                     Crypt (shrK A) {|NA, Agent A, Agent B|}|} \<in> set evs;
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   461
         A \<notin> bad;  B \<notin> bad;  evs \<in> otway |]
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   462
  ==> \<exists>NB X. Says B Server {|NA, Agent A, Agent B, X,
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   463
                               Crypt (shrK B)  {|NA, NB, Agent A, Agent B|} |}
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   464
                 \<in> set evs"
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   465
by (blast dest!: A_trusts_OR4 OR3_imp_OR2)
a6816d47f41d converted many HOL/Auth theories to Isar scripts
paulson
parents: 11230
diff changeset
   466
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
   467
end