src/HOL/Auth/OtwayRees.thy
author paulson
Mon Sep 23 18:21:31 1996 +0200 (1996-09-23)
changeset 2014 5be4c8ca7b25
parent 1976 1cff1f4fdb8a
child 2032 1bbf1bdcaf56
permissions -rw-r--r--
Correction of protocol; addition of Reveal message; proofs of
correctness in its presence
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@1941
    17
consts  otway   :: "event list set"
paulson@1941
    18
inductive otway
paulson@1941
    19
  intrs 
paulson@1941
    20
         (*Initial trace is empty*)
paulson@1941
    21
    Nil  "[]: otway"
paulson@1941
    22
paulson@1941
    23
         (*The enemy 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@1976
    26
    Fake "[| evs: otway;  B ~= Enemy;  X: synth (analz (sees Enemy evs)) |]
paulson@1976
    27
          ==> Says Enemy B X  # evs : otway"
paulson@1941
    28
paulson@1941
    29
         (*Alice initiates a protocol run*)
paulson@2014
    30
    OR1  "[| evs: otway;  A ~= B;  B ~= Server |]
paulson@1976
    31
          ==> Says A B {|Nonce (newN evs), Agent A, Agent B, 
paulson@2014
    32
                         Crypt {|Nonce (newN evs), Agent A, Agent B|} 
paulson@2014
    33
                               (shrK A) |} 
paulson@1941
    34
                 # evs : 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@1941
    38
           We modify the published protocol by NOT encrypting NB.*)
paulson@1941
    39
    OR2  "[| evs: otway;  B ~= Server;
paulson@1976
    40
             Says A' B {|Nonce NA, Agent A, Agent B, X|} : set_of_list evs |]
paulson@1976
    41
          ==> Says B Server 
paulson@2014
    42
                  {|Nonce NA, Agent A, Agent B, X, 
paulson@2014
    43
                    Crypt {|Nonce NA, Nonce (newN evs), 
paulson@2014
    44
                            Agent A, Agent B|} (shrK B)|}
paulson@1941
    45
                 # evs : 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@1941
    50
    OR3  "[| evs: otway;  B ~= Server;
paulson@1941
    51
             Says B' Server 
paulson@1941
    52
                  {|Nonce NA, Agent A, Agent B, 
paulson@1941
    53
                    Crypt {|Nonce NA, Agent A, Agent B|} (shrK A), 
paulson@2014
    54
                    Crypt {|Nonce NA, Nonce NB, Agent A, Agent B|} (shrK B)|}
paulson@1976
    55
               : set_of_list evs |]
paulson@1976
    56
          ==> Says Server B 
paulson@1941
    57
                  {|Nonce NA, 
paulson@1941
    58
                    Crypt {|Nonce NA, Key (newK evs)|} (shrK A),
paulson@1941
    59
                    Crypt {|Nonce NB, Key (newK evs)|} (shrK B)|}
paulson@1941
    60
                 # evs : 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@2014
    64
    OR4  "[| evs: otway;  A ~= B;  B ~= Server;
paulson@1941
    65
             Says S B {|Nonce NA, X, Crypt {|Nonce NB, Key K|} (shrK B)|}
paulson@1941
    66
               : set_of_list evs;
paulson@2014
    67
             Says B Server {|Nonce NA, Agent A, Agent B, X', 
paulson@2014
    68
                             Crypt {|Nonce NA, Nonce NB, Agent A, Agent B|} 
paulson@2014
    69
                                   (shrK B)|}
paulson@1976
    70
               : set_of_list evs |]
paulson@2014
    71
          ==> Says B A {|Nonce NA, X|} # evs : otway"
paulson@1941
    72
paulson@2014
    73
         (*This message models possible leaks of session keys.  Alice's Nonce
paulson@2014
    74
           identifies the protocol run.*)
paulson@2014
    75
    Reveal "[| evs: otway;  A ~= Enemy;
paulson@2014
    76
               Says B' A {|Nonce NA, Crypt {|Nonce NA, Key K|} (shrK A)|}
paulson@2014
    77
                 : set_of_list evs;
paulson@2014
    78
               Says A  B {|Nonce NA, Agent A, Agent B, 
paulson@2014
    79
                           Crypt {|Nonce NA, Agent A, Agent B|} (shrK A)|}
paulson@2014
    80
                 : set_of_list evs |]
paulson@2014
    81
            ==> Says A Enemy {|Nonce NA, Key K|} # evs : otway"
paulson@1941
    82
paulson@1941
    83
end