src/HOL/Auth/OtwayRees.thy
author paulson
Fri Nov 29 18:03:21 1996 +0100 (1996-11-29)
changeset 2284 80ebd1a213fd
parent 2135 80477862ab33
child 2378 fc103154ad8f
permissions -rw-r--r--
Swapped arguments of Crypt (for clarity and because it is conventional)
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@2284
    33
                         Crypt (shrK A)
paulson@2284
    34
                               {|Nonce (newN evs), Agent A, Agent B|} |} 
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@2284
    44
                    Crypt 
paulson@2284
    45
                          (shrK B){|Nonce NA, Nonce (newN evs), Agent A, Agent 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@2284
    54
                    Crypt (shrK A) {|Nonce NA, Agent A, Agent B|}, 
paulson@2284
    55
                    Crypt (shrK B) {|Nonce NA, Nonce NB, Agent A, Agent B|}|}
paulson@1976
    56
               : set_of_list evs |]
paulson@1976
    57
          ==> Says Server B 
paulson@1941
    58
                  {|Nonce NA, 
paulson@2284
    59
                    Crypt (shrK A) {|Nonce NA, Key (newK evs)|},
paulson@2284
    60
                    Crypt (shrK B) {|Nonce NB, Key (newK evs)|}|}
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@2284
    66
             Says S B {|Nonce NA, X, Crypt (shrK B) {|Nonce NB, Key K|}|}
paulson@1941
    67
               : set_of_list evs;
paulson@2014
    68
             Says B Server {|Nonce NA, Agent A, Agent B, X', 
paulson@2284
    69
                             Crypt (shrK B)
paulson@2284
    70
                                   {|Nonce NA, Nonce NB, Agent A, Agent 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@2284
    77
             Says Server B {|Nonce NA, X, Crypt (shrK B) {|Nonce NB, Key K|}|}
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