src/HOL/Auth/OtwayRees_AN.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@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@2516
    10
Note that the formalization does not even assume that nonces are fresh.
paulson@2516
    11
This is because the protocol does not rely on uniqueness of nonces for
paulson@2516
    12
security, only for freshness, and the proof script does not prove freshness
paulson@2516
    13
properties.
paulson@2516
    14
paulson@2090
    15
From page 11 of
paulson@2090
    16
  Abadi and Needham.  Prudent Engineering Practice for Cryptographic Protocols.
paulson@2090
    17
  IEEE Trans. SE 22 (1), 1996
paulson@2090
    18
*)
paulson@2090
    19
paulson@2090
    20
OtwayRees_AN = Shared + 
paulson@2090
    21
paulson@3519
    22
consts  otway   :: event list set
paulson@3519
    23
inductive "otway"
paulson@2090
    24
  intrs 
paulson@2090
    25
         (*Initial trace is empty*)
paulson@3519
    26
    Nil  "[]: otway"
paulson@2090
    27
paulson@2090
    28
         (*The spy MAY say anything he CAN say.  We do not expect him to
paulson@2090
    29
           invent new nonces here, but he can also use NS1.  Common to
paulson@2090
    30
           all similar protocols.*)
paulson@3519
    31
    Fake "[| evs: otway;  B ~= Spy;  
paulson@3683
    32
             X: synth (analz (spies evs)) |]
paulson@3519
    33
          ==> Says Spy B X  # evs : otway"
paulson@2090
    34
paulson@2090
    35
         (*Alice initiates a protocol run*)
paulson@3659
    36
    OR1  "[| evs1: otway;  A ~= B;  B ~= Server |]
paulson@3659
    37
          ==> Says A B {|Agent A, Agent B, Nonce NA|} # evs1 : otway"
paulson@2090
    38
paulson@2090
    39
         (*Bob's response to Alice's message.  Bob doesn't know who 
paulson@2090
    40
	   the sender is, hence the A' in the sender field.*)
paulson@3659
    41
    OR2  "[| evs2: otway;  B ~= Server;
paulson@3659
    42
             Says A' B {|Agent A, Agent B, Nonce NA|} : set evs2 |]
paulson@2516
    43
          ==> Says B Server {|Agent A, Agent B, Nonce NA, Nonce NB|}
paulson@3659
    44
                 # evs2 : otway"
paulson@2090
    45
paulson@2090
    46
         (*The Server receives Bob's message.  Then he sends a new
paulson@2090
    47
           session key to Bob with a packet for forwarding to Alice.*)
paulson@3659
    48
    OR3  "[| evs3: otway;  B ~= Server;  A ~= B;  Key KAB ~: used evs3;
paulson@2090
    49
             Says B' Server {|Agent A, Agent B, Nonce NA, Nonce NB|}
paulson@3659
    50
               : set evs3 |]
paulson@2090
    51
          ==> Says Server B 
paulson@2516
    52
               {|Crypt (shrK A) {|Nonce NA, Agent A, Agent B, Key KAB|},
paulson@2516
    53
                 Crypt (shrK B) {|Nonce NB, Agent A, Agent B, Key KAB|}|}
paulson@3659
    54
              # evs3 : otway"
paulson@2090
    55
paulson@2090
    56
         (*Bob receives the Server's (?) message and compares the Nonces with
paulson@2090
    57
	   those in the message he previously sent the Server.*)
paulson@3659
    58
    OR4  "[| evs4: otway;  A ~= B;
paulson@3659
    59
             Says B Server {|Agent A, Agent B, Nonce NA, Nonce NB|} : set evs4;
paulson@2837
    60
             Says S' B {|X, Crypt(shrK B){|Nonce NB,Agent A,Agent B,Key K|}|}
paulson@3659
    61
               : set evs4 |]
paulson@3659
    62
          ==> Says B A X # evs4 : otway"
paulson@2090
    63
paulson@2131
    64
         (*This message models possible leaks of session keys.  The nonces
paulson@2131
    65
           identify the protocol run.  B is not assumed to know shrK A.*)
paulson@3659
    66
    Oops "[| evso: otway;  B ~= Spy;
paulson@2131
    67
             Says Server B 
paulson@2284
    68
                      {|Crypt (shrK A) {|Nonce NA, Agent A, Agent B, Key K|}, 
paulson@2284
    69
                        Crypt (shrK B) {|Nonce NB, Agent A, Agent B, Key K|}|}
paulson@3659
    70
               : set evso |]
paulson@3659
    71
          ==> Says B Spy {|Nonce NA, Nonce NB, Key K|} # evso : otway"
paulson@2090
    72
paulson@2090
    73
end