src/HOL/Auth/OtwayRees.thy
author paulson
Wed Sep 11 18:40:55 1996 +0200 (1996-09-11)
changeset 1976 1cff1f4fdb8a
parent 1941 f97a6e5b6375
child 2014 5be4c8ca7b25
permissions -rw-r--r--
Reformatting
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@1941
     8
From page 244 of
paulson@1941
     9
  Burrows, Abadi and Needham.  A Logic of Authentication.
paulson@1941
    10
  Proc. Royal Soc. 426 (1989)
paulson@1941
    11
*)
paulson@1941
    12
paulson@1941
    13
OtwayRees = Shared + 
paulson@1941
    14
paulson@1941
    15
consts  otway   :: "event list set"
paulson@1941
    16
inductive otway
paulson@1941
    17
  intrs 
paulson@1941
    18
         (*Initial trace is empty*)
paulson@1941
    19
    Nil  "[]: otway"
paulson@1941
    20
paulson@1941
    21
         (*The enemy MAY say anything he CAN say.  We do not expect him to
paulson@1941
    22
           invent new nonces here, but he can also use NS1.  Common to
paulson@1941
    23
           all similar protocols.*)
paulson@1976
    24
    Fake "[| evs: otway;  B ~= Enemy;  X: synth (analz (sees Enemy evs)) |]
paulson@1976
    25
          ==> Says Enemy B X  # evs : otway"
paulson@1941
    26
paulson@1941
    27
         (*Alice initiates a protocol run*)
paulson@1976
    28
    OR1  "[| evs: otway;  A ~= B |]
paulson@1976
    29
          ==> Says A B {|Nonce (newN evs), Agent A, Agent B, 
paulson@1941
    30
                            Crypt {|Nonce (newN evs), Agent A, Agent B|} 
paulson@1941
    31
                                  (shrK A) |} 
paulson@1941
    32
                 # evs : otway"
paulson@1941
    33
paulson@1941
    34
         (*Bob's response to Alice's message.  Bob doesn't know who 
paulson@1941
    35
	   the sender is, hence the A' in the sender field.
paulson@1941
    36
           We modify the published protocol by NOT encrypting NB.*)
paulson@1941
    37
    OR2  "[| evs: otway;  B ~= Server;
paulson@1976
    38
             Says A' B {|Nonce NA, Agent A, Agent B, X|} : set_of_list evs |]
paulson@1976
    39
          ==> Says B Server 
paulson@1941
    40
                  {|Nonce NA, Agent A, Agent B, X, Nonce (newN evs), 
paulson@1941
    41
                    Crypt {|Nonce NA, Agent A, Agent B|} (shrK B)|}
paulson@1941
    42
                 # evs : otway"
paulson@1941
    43
paulson@1941
    44
         (*The Server receives Bob's message and checks that the three NAs
paulson@1941
    45
           match.  Then he sends a new session key to Bob with a packet for
paulson@1941
    46
           forwarding to Alice.*)
paulson@1941
    47
    OR3  "[| evs: otway;  B ~= Server;
paulson@1941
    48
             Says B' Server 
paulson@1941
    49
                  {|Nonce NA, Agent A, Agent B, 
paulson@1941
    50
                    Crypt {|Nonce NA, Agent A, Agent B|} (shrK A), 
paulson@1941
    51
                    Nonce NB, 
paulson@1941
    52
                    Crypt {|Nonce NA, Agent A, Agent B|} (shrK B)|}
paulson@1976
    53
               : set_of_list evs |]
paulson@1976
    54
          ==> Says Server B 
paulson@1941
    55
                  {|Nonce NA, 
paulson@1941
    56
                    Crypt {|Nonce NA, Key (newK evs)|} (shrK A),
paulson@1941
    57
                    Crypt {|Nonce NB, Key (newK evs)|} (shrK B)|}
paulson@1941
    58
                 # evs : otway"
paulson@1941
    59
paulson@1941
    60
         (*Bob receives the Server's (?) message and compares the Nonces with
paulson@1941
    61
	   those in the message he previously sent the Server.*)
paulson@1941
    62
    OR4  "[| evs: otway;  A ~= B;  
paulson@1941
    63
             Says S B {|Nonce NA, X, Crypt {|Nonce NB, Key K|} (shrK B)|}
paulson@1941
    64
               : set_of_list evs;
paulson@1941
    65
             Says B Server {|Nonce NA, Agent A, Agent B, X', Nonce NB, X''|}
paulson@1976
    66
               : set_of_list evs |]
paulson@1976
    67
          ==> (Says B A {|Nonce NA, X|}) # evs : otway"
paulson@1941
    68
paulson@1941
    69
         (*Alice checks her Nonce, then sends a dummy message to Bob,
paulson@1941
    70
           using the new session key.*)
paulson@1941
    71
    OR5  "[| evs: otway;  
paulson@1941
    72
             Says B' A {|Nonce NA, Crypt {|Nonce NA, Key K|} (shrK A)|}
paulson@1941
    73
               : set_of_list evs;
paulson@1976
    74
             Says A  B {|Nonce NA, Agent A, Agent B, X|} : set_of_list evs |]
paulson@1976
    75
          ==> Says A B (Crypt (Agent A) K)  # evs : otway"
paulson@1941
    76
paulson@1941
    77
end