src/HOL/Auth/OtwayRees.thy
author paulson
Mon Oct 28 15:59:39 1996 +0100 (1996-10-28)
changeset 2135 80477862ab33
parent 2105 782772e744dc
child 2284 80ebd1a213fd
permissions -rw-r--r--
Minor corrections
paulson@1941
     1
(*  Title:      HOL/Auth/OtwayRees
paulson@1941
     2
    ID:         $Id$
paulson@1941
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
paulson@1941
     4
    Copyright   1996  University of Cambridge
paulson@1941
     5
paulson@1941
     6
Inductive relation "otway" for the Otway-Rees protocol.
paulson@1941
     7
paulson@2014
     8
Version that encrypts Nonce NB
paulson@2014
     9
paulson@1941
    10
From page 244 of
paulson@1941
    11
  Burrows, Abadi and Needham.  A Logic of Authentication.
paulson@1941
    12
  Proc. Royal Soc. 426 (1989)
paulson@1941
    13
*)
paulson@1941
    14
paulson@1941
    15
OtwayRees = Shared + 
paulson@1941
    16
paulson@2032
    17
consts  otway   :: "agent set => event list set"
paulson@2032
    18
inductive "otway lost"
paulson@1941
    19
  intrs 
paulson@1941
    20
         (*Initial trace is empty*)
paulson@2032
    21
    Nil  "[]: otway lost"
paulson@1941
    22
paulson@2032
    23
         (*The spy MAY say anything he CAN say.  We do not expect him to
paulson@1941
    24
           invent new nonces here, but he can also use NS1.  Common to
paulson@1941
    25
           all similar protocols.*)
paulson@2032
    26
    Fake "[| evs: otway lost;  B ~= Spy;  
paulson@2032
    27
             X: synth (analz (sees lost Spy evs)) |]
paulson@2032
    28
          ==> Says Spy B X  # evs : otway lost"
paulson@1941
    29
paulson@1941
    30
         (*Alice initiates a protocol run*)
paulson@2032
    31
    OR1  "[| evs: otway lost;  A ~= B;  B ~= Server |]
paulson@1976
    32
          ==> Says A B {|Nonce (newN evs), Agent A, Agent B, 
paulson@2014
    33
                         Crypt {|Nonce (newN evs), Agent A, Agent B|} 
paulson@2014
    34
                               (shrK A) |} 
paulson@2032
    35
                 # evs : otway lost"
paulson@1941
    36
paulson@1941
    37
         (*Bob's response to Alice's message.  Bob doesn't know who 
paulson@1941
    38
	   the sender is, hence the A' in the sender field.
paulson@2105
    39
           Note that NB is encrypted.*)
paulson@2032
    40
    OR2  "[| evs: otway lost;  B ~= Server;
paulson@1976
    41
             Says A' B {|Nonce NA, Agent A, Agent B, X|} : set_of_list evs |]
paulson@1976
    42
          ==> Says B Server 
paulson@2014
    43
                  {|Nonce NA, Agent A, Agent B, X, 
paulson@2014
    44
                    Crypt {|Nonce NA, Nonce (newN evs), 
paulson@2014
    45
                            Agent A, Agent B|} (shrK B)|}
paulson@2032
    46
                 # evs : otway lost"
paulson@1941
    47
paulson@1941
    48
         (*The Server receives Bob's message and checks that the three NAs
paulson@1941
    49
           match.  Then he sends a new session key to Bob with a packet for
paulson@1941
    50
           forwarding to Alice.*)
paulson@2032
    51
    OR3  "[| evs: otway lost;  B ~= Server;
paulson@1941
    52
             Says B' Server 
paulson@1941
    53
                  {|Nonce NA, Agent A, Agent B, 
paulson@1941
    54
                    Crypt {|Nonce NA, Agent A, Agent B|} (shrK A), 
paulson@2014
    55
                    Crypt {|Nonce NA, Nonce NB, Agent A, Agent B|} (shrK B)|}
paulson@1976
    56
               : set_of_list evs |]
paulson@1976
    57
          ==> Says Server B 
paulson@1941
    58
                  {|Nonce NA, 
paulson@1941
    59
                    Crypt {|Nonce NA, Key (newK evs)|} (shrK A),
paulson@1941
    60
                    Crypt {|Nonce NB, Key (newK evs)|} (shrK B)|}
paulson@2032
    61
                 # evs : otway lost"
paulson@1941
    62
paulson@1941
    63
         (*Bob receives the Server's (?) message and compares the Nonces with
paulson@1941
    64
	   those in the message he previously sent the Server.*)
paulson@2135
    65
    OR4  "[| evs: otway lost;  A ~= B;  
paulson@1941
    66
             Says S B {|Nonce NA, X, Crypt {|Nonce NB, Key K|} (shrK B)|}
paulson@1941
    67
               : set_of_list evs;
paulson@2014
    68
             Says B Server {|Nonce NA, Agent A, Agent B, X', 
paulson@2014
    69
                             Crypt {|Nonce NA, Nonce NB, Agent A, Agent B|} 
paulson@2014
    70
                                   (shrK B)|}
paulson@1976
    71
               : set_of_list evs |]
paulson@2032
    72
          ==> Says B A {|Nonce NA, X|} # evs : otway lost"
paulson@1941
    73
paulson@2135
    74
         (*This message models possible leaks of session keys.  The nonces
paulson@2135
    75
           identify the protocol run.*)
paulson@2135
    76
    Oops "[| evs: otway lost;  B ~= Spy;
paulson@2135
    77
             Says Server B {|Nonce NA, X, Crypt {|Nonce NB, Key K|} (shrK B)|}
paulson@2064
    78
               : set_of_list evs |]
paulson@2135
    79
          ==> Says B Spy {|Nonce NA, Nonce NB, Key K|} # evs : otway lost"
paulson@1941
    80
paulson@1941
    81
end