src/HOL/Auth/OtwayRees.thy
author paulson
Fri Jul 04 17:34:55 1997 +0200 (1997-07-04)
changeset 3500 0d8ad2f192d8
parent 3465 e85c24717cad
child 3519 ab0a9fbed4c0
permissions -rw-r--r--
New constant "certificate"--just an abbreviation
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@2378
    17
consts  otway   :: agent set => event list set
paulson@2032
    18
inductive "otway lost"
paulson@1941
    19
  intrs 
paulson@1941
    20
         (*Initial trace is empty*)
paulson@2032
    21
    Nil  "[]: otway lost"
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@2032
    26
    Fake "[| evs: otway lost;  B ~= Spy;  
paulson@2032
    27
             X: synth (analz (sees lost Spy evs)) |]
paulson@2032
    28
          ==> Says Spy B X  # evs : otway lost"
paulson@1941
    29
paulson@1941
    30
         (*Alice initiates a protocol run*)
paulson@2516
    31
    OR1  "[| evs: otway lost;  A ~= B;  B ~= Server;  Nonce NA ~: used evs |]
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@2032
    34
                 # evs : otway lost"
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@2516
    39
    OR2  "[| evs: otway lost;  B ~= Server;  Nonce NB ~: used evs;
nipkow@3465
    40
             Says A' B {|Nonce NA, Agent A, Agent B, X|} : set evs |]
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@2032
    45
                 # evs : otway lost"
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@2516
    50
    OR3  "[| evs: otway lost;  B ~= Server;  Key KAB ~: used evs;
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|}|}
nipkow@3465
    55
               : set evs |]
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@2032
    60
                 # evs : otway lost"
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@2135
    64
    OR4  "[| evs: otway lost;  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|}|}
nipkow@3465
    68
               : set evs;
paulson@2837
    69
             Says S' B {|Nonce NA, X, Crypt (shrK B) {|Nonce NB, Key K|}|}
nipkow@3465
    70
               : set evs |]
paulson@2032
    71
          ==> Says B A {|Nonce NA, X|} # evs : otway lost"
paulson@1941
    72
paulson@2135
    73
         (*This message models possible leaks of session keys.  The nonces
paulson@2135
    74
           identify the protocol run.*)
paulson@2135
    75
    Oops "[| evs: otway lost;  B ~= Spy;
paulson@2284
    76
             Says Server B {|Nonce NA, X, Crypt (shrK B) {|Nonce NB, Key K|}|}
nipkow@3465
    77
               : set evs |]
paulson@2135
    78
          ==> Says B Spy {|Nonce NA, Nonce NB, Key K|} # evs : otway lost"
paulson@1941
    79
paulson@1941
    80
end