src/HOL/Auth/OtwayRees_AN.thy
author paulson
Thu Sep 23 13:06:31 1999 +0200 (1999-09-23)
changeset 7584 5be4bb8e4e3f
parent 6333 b1dec44d0018
child 11185 1b737b4c2108
permissions -rw-r--r--
tidied; added lemma restrict_to_left
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@6308
    31
    Fake "[| evs: otway;  X: synth (analz (knows Spy evs)) |]
paulson@3519
    32
          ==> Says Spy B X  # evs : otway"
paulson@2090
    33
paulson@6308
    34
         (*A message that has been sent can be received by the
paulson@6308
    35
           intended recipient.*)
paulson@6308
    36
    Reception "[| evsr: otway;  Says A B X : set evsr |]
paulson@6308
    37
               ==> Gets B X # evsr : otway"
paulson@6308
    38
paulson@2090
    39
         (*Alice initiates a protocol run*)
paulson@5434
    40
    OR1  "[| evs1: otway |]
paulson@3659
    41
          ==> Says A B {|Agent A, Agent B, Nonce NA|} # evs1 : otway"
paulson@2090
    42
paulson@6333
    43
         (*Bob's response to Alice's message.*)
paulson@5434
    44
    OR2  "[| evs2: otway;  
paulson@6308
    45
             Gets B {|Agent A, Agent B, Nonce NA|} : set evs2 |]
paulson@2516
    46
          ==> Says B Server {|Agent A, Agent B, Nonce NA, Nonce NB|}
paulson@3659
    47
                 # evs2 : otway"
paulson@2090
    48
paulson@2090
    49
         (*The Server receives Bob's message.  Then he sends a new
paulson@2090
    50
           session key to Bob with a packet for forwarding to Alice.*)
paulson@5434
    51
    OR3  "[| evs3: otway;  Key KAB ~: used evs3;
paulson@6308
    52
             Gets Server {|Agent A, Agent B, Nonce NA, Nonce NB|}
paulson@3659
    53
               : set evs3 |]
paulson@2090
    54
          ==> Says Server B 
paulson@2516
    55
               {|Crypt (shrK A) {|Nonce NA, Agent A, Agent B, Key KAB|},
paulson@2516
    56
                 Crypt (shrK B) {|Nonce NB, Agent A, Agent B, Key KAB|}|}
paulson@3659
    57
              # evs3 : otway"
paulson@2090
    58
paulson@2090
    59
         (*Bob receives the Server's (?) message and compares the Nonces with
paulson@5434
    60
	   those in the message he previously sent the Server.
paulson@5434
    61
           Need B ~= Server because we allow messages to self.*)
paulson@5434
    62
    OR4  "[| evs4: otway;  B ~= Server; 
paulson@3659
    63
             Says B Server {|Agent A, Agent B, Nonce NA, Nonce NB|} : set evs4;
paulson@6308
    64
             Gets B {|X, Crypt(shrK B){|Nonce NB,Agent A,Agent B,Key K|}|}
paulson@3659
    65
               : set evs4 |]
paulson@3659
    66
          ==> Says B A X # evs4 : otway"
paulson@2090
    67
paulson@2131
    68
         (*This message models possible leaks of session keys.  The nonces
paulson@2131
    69
           identify the protocol run.  B is not assumed to know shrK A.*)
paulson@5359
    70
    Oops "[| evso: otway;  
paulson@2131
    71
             Says Server B 
paulson@2284
    72
                      {|Crypt (shrK A) {|Nonce NA, Agent A, Agent B, Key K|}, 
paulson@2284
    73
                        Crypt (shrK B) {|Nonce NB, Agent A, Agent B, Key K|}|}
paulson@3659
    74
               : set evso |]
paulson@4537
    75
          ==> Notes Spy {|Nonce NA, Nonce NB, Key K|} # evso : otway"
paulson@2090
    76
paulson@2090
    77
end