src/HOL/Auth/OtwayRees_Bad.thy
author paulson
Tue Sep 08 15:17:11 1998 +0200 (1998-09-08)
changeset 5434 9b4bed3f394c
parent 5359 bd539b72d484
child 6308 76f3865a2b1d
permissions -rw-r--r--
Got rid of not_Says_to_self and most uses of ~= in definitions and theorems
     1 (*  Title:      HOL/Auth/OtwayRees_Bad
     2     ID:         $Id$
     3     Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
     4     Copyright   1996  University of Cambridge
     5 
     6 Inductive relation "otway" for the Otway-Rees protocol.
     7 
     8 The FAULTY version omitting encryption of Nonce NB, as suggested on page 247 of
     9   Burrows, Abadi and Needham.  A Logic of Authentication.
    10   Proc. Royal Soc. 426 (1989)
    11 *)
    12 
    13 OtwayRees_Bad = Shared + 
    14 
    15 consts  otway   :: event list set
    16 
    17 inductive otway
    18   intrs 
    19          (*Initial trace is empty*)
    20     Nil  "[]: otway"
    21 
    22          (*The spy MAY say anything he CAN say.  We do not expect him to
    23            invent new nonces here, but he can also use NS1.  Common to
    24            all similar protocols.*)
    25     Fake "[| evs: otway;  X: synth (analz (spies evs)) |]
    26           ==> Says Spy B X  # evs : otway"
    27 
    28          (*Alice initiates a protocol run*)
    29     OR1  "[| evs1: otway;  Nonce NA ~: used evs1 |]
    30           ==> Says A B {|Nonce NA, Agent A, Agent B, 
    31                          Crypt (shrK A) {|Nonce NA, Agent A, Agent B|} |} 
    32                  # evs1 : otway"
    33 
    34          (*Bob's response to Alice's message.  Bob doesn't know who 
    35 	   the sender is, hence the A' in the sender field.
    36            We modify the published protocol by NOT encrypting NB.*)
    37     OR2  "[| evs2: otway;  Nonce NB ~: used evs2;
    38              Says A' B {|Nonce NA, Agent A, Agent B, X|} : set evs2 |]
    39           ==> Says B Server 
    40                   {|Nonce NA, Agent A, Agent B, X, Nonce NB,
    41                     Crypt (shrK B) {|Nonce NA, Agent A, Agent B|}|}
    42                  # evs2 : otway"
    43 
    44          (*The Server receives Bob's message and checks that the three NAs
    45            match.  Then he sends a new session key to Bob with a packet for
    46            forwarding to Alice.*)
    47     OR3  "[| evs3: otway;  Key KAB ~: used evs3;
    48              Says B' Server 
    49                   {|Nonce NA, Agent A, Agent B, 
    50                     Crypt (shrK A) {|Nonce NA, Agent A, Agent B|}, 
    51                     Nonce NB, 
    52                     Crypt (shrK B) {|Nonce NA, Agent A, Agent B|}|}
    53                : set evs3 |]
    54           ==> Says Server B 
    55                   {|Nonce NA, 
    56                     Crypt (shrK A) {|Nonce NA, Key KAB|},
    57                     Crypt (shrK B) {|Nonce NB, Key KAB|}|}
    58                  # evs3 : otway"
    59 
    60          (*Bob receives the Server's (?) message and compares the Nonces with
    61 	   those in the message he previously sent the Server.
    62            Need B ~= Server because we allow messages to self.*)
    63     OR4  "[| evs4: otway;  A ~= B;  B ~= Server;
    64              Says B Server {|Nonce NA, Agent A, Agent B, X', Nonce NB,
    65                              Crypt (shrK B) {|Nonce NA, Agent A, Agent B|}|}
    66                : set evs4;
    67              Says S' B {|Nonce NA, X, Crypt (shrK B) {|Nonce NB, Key K|}|}
    68                : set evs4 |]
    69           ==> Says B A {|Nonce NA, X|} # evs4 : otway"
    70 
    71          (*This message models possible leaks of session keys.  The nonces
    72            identify the protocol run.*)
    73     Oops "[| evso: otway;  
    74              Says Server B {|Nonce NA, X, Crypt (shrK B) {|Nonce NB, Key K|}|}
    75                : set evso |]
    76           ==> Notes Spy {|Nonce NA, Nonce NB, Key K|} # evso : otway"
    77 
    78 end