src/HOL/Auth/OtwayRees_AN.thy
author paulson
Fri Jul 04 17:34:55 1997 +0200 (1997-07-04)
changeset 3500 0d8ad2f192d8
parent 3466 30791e5a69c4
child 3519 ab0a9fbed4c0
permissions -rw-r--r--
New constant "certificate"--just an abbreviation
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@2378
    22
consts  otway   :: agent set => event list set
paulson@2090
    23
inductive "otway lost"
paulson@2090
    24
  intrs 
paulson@2090
    25
         (*Initial trace is empty*)
paulson@2090
    26
    Nil  "[]: otway lost"
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@2090
    31
    Fake "[| evs: otway lost;  B ~= Spy;  
paulson@2090
    32
             X: synth (analz (sees lost Spy evs)) |]
paulson@2090
    33
          ==> Says Spy B X  # evs : otway lost"
paulson@2090
    34
paulson@2090
    35
         (*Alice initiates a protocol run*)
paulson@2090
    36
    OR1  "[| evs: otway lost;  A ~= B;  B ~= Server |]
paulson@2516
    37
          ==> Says A B {|Agent A, Agent B, Nonce NA|} # evs : otway lost"
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@2090
    41
    OR2  "[| evs: otway lost;  B ~= Server;
nipkow@3465
    42
             Says A' B {|Agent A, Agent B, Nonce NA|} : set evs |]
paulson@2516
    43
          ==> Says B Server {|Agent A, Agent B, Nonce NA, Nonce NB|}
paulson@2090
    44
                 # evs : otway lost"
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@2516
    48
    OR3  "[| evs: otway lost;  B ~= Server;  A ~= B;  Key KAB ~: used evs;
paulson@2090
    49
             Says B' Server {|Agent A, Agent B, Nonce NA, Nonce NB|}
nipkow@3465
    50
               : set evs |]
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@2090
    54
              # evs : otway lost"
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@2131
    58
    OR4  "[| evs: otway lost;  A ~= B;
paulson@3466
    59
             Says B Server {|Agent A, Agent B, Nonce NA, Nonce NB|} : set evs;
paulson@2837
    60
             Says S' B {|X, Crypt(shrK B){|Nonce NB,Agent A,Agent B,Key K|}|}
nipkow@3465
    61
               : set evs |]
paulson@2090
    62
          ==> Says B A X # evs : otway lost"
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@2131
    66
    Oops "[| evs: otway lost;  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|}|}
nipkow@3465
    70
               : set evs |]
paulson@2131
    71
          ==> Says B Spy {|Nonce NA, Nonce NB, Key K|} # evs : otway lost"
paulson@2090
    72
paulson@2090
    73
end