src/HOL/Auth/OtwayRees_AN.thy
author paulson
Fri Nov 29 18:03:21 1996 +0100 (1996-11-29)
changeset 2284 80ebd1a213fd
parent 2131 3106a99d30a5
child 2378 fc103154ad8f
permissions -rw-r--r--
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson@2090
     1
(*  Title:      HOL/Auth/OtwayRees
paulson@2090
     2
    ID:         $Id$
paulson@2090
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
paulson@2090
     4
    Copyright   1996  University of Cambridge
paulson@2090
     5
paulson@2090
     6
Inductive relation "otway" for the Otway-Rees protocol.
paulson@2090
     7
paulson@2090
     8
Simplified version with minimal encryption but explicit messages
paulson@2090
     9
paulson@2090
    10
From page 11 of
paulson@2090
    11
  Abadi and Needham.  Prudent Engineering Practice for Cryptographic Protocols.
paulson@2090
    12
  IEEE Trans. SE 22 (1), 1996
paulson@2090
    13
*)
paulson@2090
    14
paulson@2090
    15
OtwayRees_AN = Shared + 
paulson@2090
    16
paulson@2090
    17
consts  otway   :: "agent set => event list set"
paulson@2090
    18
inductive "otway lost"
paulson@2090
    19
  intrs 
paulson@2090
    20
         (*Initial trace is empty*)
paulson@2090
    21
    Nil  "[]: otway lost"
paulson@2090
    22
paulson@2090
    23
         (*The spy MAY say anything he CAN say.  We do not expect him to
paulson@2090
    24
           invent new nonces here, but he can also use NS1.  Common to
paulson@2090
    25
           all similar protocols.*)
paulson@2090
    26
    Fake "[| evs: otway lost;  B ~= Spy;  
paulson@2090
    27
             X: synth (analz (sees lost Spy evs)) |]
paulson@2090
    28
          ==> Says Spy B X  # evs : otway lost"
paulson@2090
    29
paulson@2090
    30
         (*Alice initiates a protocol run*)
paulson@2090
    31
    OR1  "[| evs: otway lost;  A ~= B;  B ~= Server |]
paulson@2090
    32
          ==> Says A B {|Agent A, Agent B, Nonce (newN evs)|}
paulson@2090
    33
                 # evs : otway lost"
paulson@2090
    34
paulson@2090
    35
         (*Bob's response to Alice's message.  Bob doesn't know who 
paulson@2090
    36
	   the sender is, hence the A' in the sender field.*)
paulson@2090
    37
    OR2  "[| evs: otway lost;  B ~= Server;
paulson@2090
    38
             Says A' B {|Agent A, Agent B, Nonce NA|} : set_of_list evs |]
paulson@2090
    39
          ==> Says B Server {|Agent A, Agent B, Nonce NA, Nonce (newN evs)|}
paulson@2090
    40
                 # evs : otway lost"
paulson@2090
    41
paulson@2090
    42
         (*The Server receives Bob's message.  Then he sends a new
paulson@2090
    43
           session key to Bob with a packet for forwarding to Alice.*)
paulson@2090
    44
    OR3  "[| evs: otway lost;  B ~= Server;  A ~= B;
paulson@2090
    45
             Says B' Server {|Agent A, Agent B, Nonce NA, Nonce NB|}
paulson@2090
    46
               : set_of_list evs |]
paulson@2090
    47
          ==> Says Server B 
paulson@2284
    48
               {|Crypt (shrK A) {|Nonce NA, Agent A, Agent B, Key(newK evs)|},
paulson@2284
    49
                 Crypt (shrK B) {|Nonce NB, Agent A, Agent B, Key(newK evs)|}|}
paulson@2090
    50
              # evs : otway lost"
paulson@2090
    51
paulson@2090
    52
         (*Bob receives the Server's (?) message and compares the Nonces with
paulson@2090
    53
	   those in the message he previously sent the Server.*)
paulson@2131
    54
    OR4  "[| evs: otway lost;  A ~= B;
paulson@2090
    55
             Says S B {|X, 
paulson@2284
    56
                        Crypt (shrK B) {|Nonce NB, Agent A, Agent B, Key K|}|}
paulson@2090
    57
               : set_of_list evs;
paulson@2090
    58
             Says B Server {|Agent A, Agent B, Nonce NA, Nonce NB|}
paulson@2090
    59
               : set_of_list evs |]
paulson@2090
    60
          ==> Says B A X # evs : otway lost"
paulson@2090
    61
paulson@2131
    62
         (*This message models possible leaks of session keys.  The nonces
paulson@2131
    63
           identify the protocol run.  B is not assumed to know shrK A.*)
paulson@2131
    64
    Oops "[| evs: otway lost;  B ~= Spy;
paulson@2131
    65
             Says Server B 
paulson@2284
    66
                      {|Crypt (shrK A) {|Nonce NA, Agent A, Agent B, Key K|}, 
paulson@2284
    67
                        Crypt (shrK B) {|Nonce NB, Agent A, Agent B, Key K|}|}
paulson@2131
    68
               : set_of_list evs |]
paulson@2131
    69
          ==> Says B Spy {|Nonce NA, Nonce NB, Key K|} # evs : otway lost"
paulson@2090
    70
paulson@2090
    71
end