src/HOL/Auth/OtwayRees.thy
author paulson
Tue Nov 11 11:16:18 1997 +0100 (1997-11-11)
changeset 4198 c63639beeff1
parent 3683 aafe719dff14
child 4537 4e835bd9fada
permissions -rw-r--r--
Fixed spelling error
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@3519
    17
consts  otway   :: event list set
paulson@3519
    18
inductive "otway"
paulson@1941
    19
  intrs 
paulson@1941
    20
         (*Initial trace is empty*)
paulson@3519
    21
    Nil  "[]: otway"
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@3519
    26
    Fake "[| evs: otway;  B ~= Spy;  
paulson@3683
    27
             X: synth (analz (spies evs)) |]
paulson@3519
    28
          ==> Says Spy B X  # evs : otway"
paulson@1941
    29
paulson@1941
    30
         (*Alice initiates a protocol run*)
paulson@3659
    31
    OR1  "[| evs1: otway;  A ~= B;  B ~= Server;  Nonce NA ~: used evs1 |]
paulson@2516
    32
          ==> Says A B {|Nonce NA, Agent A, Agent B, 
paulson@2516
    33
                         Crypt (shrK A) {|Nonce NA, Agent A, Agent B|} |} 
paulson@3659
    34
                 # evs1 : otway"
paulson@1941
    35
paulson@1941
    36
         (*Bob's response to Alice's message.  Bob doesn't know who 
paulson@1941
    37
	   the sender is, hence the A' in the sender field.
paulson@2105
    38
           Note that NB is encrypted.*)
paulson@3659
    39
    OR2  "[| evs2: otway;  B ~= Server;  Nonce NB ~: used evs2;
paulson@3659
    40
             Says A' B {|Nonce NA, Agent A, Agent B, X|} : set evs2 |]
paulson@1976
    41
          ==> Says B Server 
paulson@2014
    42
                  {|Nonce NA, Agent A, Agent B, X, 
paulson@2451
    43
                    Crypt (shrK B)
paulson@2516
    44
                      {|Nonce NA, Nonce NB, Agent A, Agent B|}|}
paulson@3659
    45
                 # evs2 : otway"
paulson@1941
    46
paulson@1941
    47
         (*The Server receives Bob's message and checks that the three NAs
paulson@1941
    48
           match.  Then he sends a new session key to Bob with a packet for
paulson@1941
    49
           forwarding to Alice.*)
paulson@3659
    50
    OR3  "[| evs3: otway;  B ~= Server;  Key KAB ~: used evs3;
paulson@1941
    51
             Says B' Server 
paulson@1941
    52
                  {|Nonce NA, Agent A, Agent B, 
paulson@2284
    53
                    Crypt (shrK A) {|Nonce NA, Agent A, Agent B|}, 
paulson@2284
    54
                    Crypt (shrK B) {|Nonce NA, Nonce NB, Agent A, Agent B|}|}
paulson@3659
    55
               : set evs3 |]
paulson@1976
    56
          ==> Says Server B 
paulson@1941
    57
                  {|Nonce NA, 
paulson@2516
    58
                    Crypt (shrK A) {|Nonce NA, Key KAB|},
paulson@2516
    59
                    Crypt (shrK B) {|Nonce NB, Key KAB|}|}
paulson@3659
    60
                 # evs3 : otway"
paulson@1941
    61
paulson@1941
    62
         (*Bob receives the Server's (?) message and compares the Nonces with
paulson@1941
    63
	   those in the message he previously sent the Server.*)
paulson@3659
    64
    OR4  "[| evs4: otway;  A ~= B;  
paulson@2014
    65
             Says B Server {|Nonce NA, Agent A, Agent B, X', 
paulson@2284
    66
                             Crypt (shrK B)
paulson@2284
    67
                                   {|Nonce NA, Nonce NB, Agent A, Agent B|}|}
paulson@3659
    68
               : set evs4;
paulson@2837
    69
             Says S' B {|Nonce NA, X, Crypt (shrK B) {|Nonce NB, Key K|}|}
paulson@3659
    70
               : set evs4 |]
paulson@3659
    71
          ==> Says B A {|Nonce NA, X|} # evs4 : otway"
paulson@1941
    72
paulson@2135
    73
         (*This message models possible leaks of session keys.  The nonces
paulson@2135
    74
           identify the protocol run.*)
paulson@3659
    75
    Oops "[| evso: otway;  B ~= Spy;
paulson@2284
    76
             Says Server B {|Nonce NA, X, Crypt (shrK B) {|Nonce NB, Key K|}|}
paulson@3659
    77
               : set evso |]
paulson@3659
    78
          ==> Says B Spy {|Nonce NA, Nonce NB, Key K|} # evso : otway"
paulson@1941
    79
paulson@1941
    80
end