src/HOL/Auth/OtwayRees_AN.thy
author paulson
Thu Sep 23 13:06:31 1999 +0200 (1999-09-23)
changeset 7584 5be4bb8e4e3f
parent 6333 b1dec44d0018
child 11185 1b737b4c2108
permissions -rw-r--r--
tidied; added lemma restrict_to_left
     1 (*  Title:      HOL/Auth/OtwayRees
     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 Simplified version with minimal encryption but explicit messages
     9 
    10 Note that the formalization does not even assume that nonces are fresh.
    11 This is because the protocol does not rely on uniqueness of nonces for
    12 security, only for freshness, and the proof script does not prove freshness
    13 properties.
    14 
    15 From page 11 of
    16   Abadi and Needham.  Prudent Engineering Practice for Cryptographic Protocols.
    17   IEEE Trans. SE 22 (1), 1996
    18 *)
    19 
    20 OtwayRees_AN = Shared + 
    21 
    22 consts  otway   :: event list set
    23 inductive "otway"
    24   intrs 
    25          (*Initial trace is empty*)
    26     Nil  "[]: otway"
    27 
    28          (*The spy MAY say anything he CAN say.  We do not expect him to
    29            invent new nonces here, but he can also use NS1.  Common to
    30            all similar protocols.*)
    31     Fake "[| evs: otway;  X: synth (analz (knows Spy evs)) |]
    32           ==> Says Spy B X  # evs : otway"
    33 
    34          (*A message that has been sent can be received by the
    35            intended recipient.*)
    36     Reception "[| evsr: otway;  Says A B X : set evsr |]
    37                ==> Gets B X # evsr : otway"
    38 
    39          (*Alice initiates a protocol run*)
    40     OR1  "[| evs1: otway |]
    41           ==> Says A B {|Agent A, Agent B, Nonce NA|} # evs1 : otway"
    42 
    43          (*Bob's response to Alice's message.*)
    44     OR2  "[| evs2: otway;  
    45              Gets B {|Agent A, Agent B, Nonce NA|} : set evs2 |]
    46           ==> Says B Server {|Agent A, Agent B, Nonce NA, Nonce NB|}
    47                  # evs2 : otway"
    48 
    49          (*The Server receives Bob's message.  Then he sends a new
    50            session key to Bob with a packet for forwarding to Alice.*)
    51     OR3  "[| evs3: otway;  Key KAB ~: used evs3;
    52              Gets Server {|Agent A, Agent B, Nonce NA, Nonce NB|}
    53                : set evs3 |]
    54           ==> Says Server B 
    55                {|Crypt (shrK A) {|Nonce NA, Agent A, Agent B, Key KAB|},
    56                  Crypt (shrK B) {|Nonce NB, Agent A, Agent B, Key KAB|}|}
    57               # evs3 : otway"
    58 
    59          (*Bob receives the Server's (?) message and compares the Nonces with
    60 	   those in the message he previously sent the Server.
    61            Need B ~= Server because we allow messages to self.*)
    62     OR4  "[| evs4: otway;  B ~= Server; 
    63              Says B Server {|Agent A, Agent B, Nonce NA, Nonce NB|} : set evs4;
    64              Gets B {|X, Crypt(shrK B){|Nonce NB,Agent A,Agent B,Key K|}|}
    65                : set evs4 |]
    66           ==> Says B A X # evs4 : otway"
    67 
    68          (*This message models possible leaks of session keys.  The nonces
    69            identify the protocol run.  B is not assumed to know shrK A.*)
    70     Oops "[| evso: otway;  
    71              Says Server B 
    72                       {|Crypt (shrK A) {|Nonce NA, Agent A, Agent B, Key K|}, 
    73                         Crypt (shrK B) {|Nonce NB, Agent A, Agent B, Key K|}|}
    74                : set evso |]
    75           ==> Notes Spy {|Nonce NA, Nonce NB, Key K|} # evso : otway"
    76 
    77 end