src/HOL/Auth/OtwayRees_Bad.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@2002
     1
(*  Title:      HOL/Auth/OtwayRees_Bad
paulson@2002
     2
    ID:         $Id$
paulson@2002
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
paulson@2002
     4
    Copyright   1996  University of Cambridge
paulson@2002
     5
paulson@2002
     6
Inductive relation "otway" for the Otway-Rees protocol.
paulson@2002
     7
paulson@2002
     8
The FAULTY version omitting encryption of Nonce NB, as suggested on page 247 of
paulson@2002
     9
  Burrows, Abadi and Needham.  A Logic of Authentication.
paulson@2002
    10
  Proc. Royal Soc. 426 (1989)
paulson@2002
    11
*)
paulson@2002
    12
paulson@2002
    13
OtwayRees_Bad = Shared + 
paulson@2002
    14
paulson@3519
    15
consts  otway   :: event list set
paulson@2052
    16
paulson@2002
    17
inductive otway
paulson@2002
    18
  intrs 
paulson@2002
    19
         (*Initial trace is empty*)
paulson@2002
    20
    Nil  "[]: otway"
paulson@2002
    21
paulson@2032
    22
         (*The spy MAY say anything he CAN say.  We do not expect him to
paulson@2002
    23
           invent new nonces here, but he can also use NS1.  Common to
paulson@2002
    24
           all similar protocols.*)
paulson@6308
    25
    Fake "[| evs: otway;  X: synth (analz (knows Spy evs)) |]
paulson@2032
    26
          ==> Says Spy B X  # evs : otway"
paulson@2002
    27
paulson@6308
    28
         (*A message that has been sent can be received by the
paulson@6308
    29
           intended recipient.*)
paulson@6308
    30
    Reception "[| evsr: otway;  Says A B X : set evsr |]
paulson@6308
    31
               ==> Gets B X # evsr : otway"
paulson@6308
    32
paulson@2002
    33
         (*Alice initiates a protocol run*)
paulson@5434
    34
    OR1  "[| evs1: otway;  Nonce NA ~: used evs1 |]
paulson@2516
    35
          ==> Says A B {|Nonce NA, Agent A, Agent B, 
paulson@2516
    36
                         Crypt (shrK A) {|Nonce NA, Agent A, Agent B|} |} 
paulson@3659
    37
                 # evs1 : otway"
paulson@2002
    38
paulson@6333
    39
         (*Bob's response to Alice's message. 
paulson@6333
    40
           This variant of the protocol does NOT encrypt NB.*)
paulson@5434
    41
    OR2  "[| evs2: otway;  Nonce NB ~: used evs2;
paulson@6308
    42
             Gets B {|Nonce NA, Agent A, Agent B, X|} : set evs2 |]
paulson@2002
    43
          ==> Says B Server 
paulson@2516
    44
                  {|Nonce NA, Agent A, Agent B, X, Nonce NB,
paulson@2284
    45
                    Crypt (shrK B) {|Nonce NA, Agent A, Agent B|}|}
paulson@3659
    46
                 # evs2 : otway"
paulson@2002
    47
paulson@2002
    48
         (*The Server receives Bob's message and checks that the three NAs
paulson@2002
    49
           match.  Then he sends a new session key to Bob with a packet for
paulson@2002
    50
           forwarding to Alice.*)
paulson@5434
    51
    OR3  "[| evs3: otway;  Key KAB ~: used evs3;
paulson@6308
    52
             Gets Server 
paulson@2002
    53
                  {|Nonce NA, Agent A, Agent B, 
paulson@2284
    54
                    Crypt (shrK A) {|Nonce NA, Agent A, Agent B|}, 
paulson@2002
    55
                    Nonce NB, 
paulson@2284
    56
                    Crypt (shrK B) {|Nonce NA, Agent A, Agent B|}|}
paulson@3659
    57
               : set evs3 |]
paulson@2002
    58
          ==> Says Server B 
paulson@2002
    59
                  {|Nonce NA, 
paulson@2516
    60
                    Crypt (shrK A) {|Nonce NA, Key KAB|},
paulson@2516
    61
                    Crypt (shrK B) {|Nonce NB, Key KAB|}|}
paulson@3659
    62
                 # evs3 : otway"
paulson@2002
    63
paulson@2002
    64
         (*Bob receives the Server's (?) message and compares the Nonces with
paulson@5434
    65
	   those in the message he previously sent the Server.
paulson@5434
    66
           Need B ~= Server because we allow messages to self.*)
paulson@6308
    67
    OR4  "[| evs4: otway;  B ~= Server;
paulson@4522
    68
             Says B Server {|Nonce NA, Agent A, Agent B, X', Nonce NB,
paulson@4522
    69
                             Crypt (shrK B) {|Nonce NA, Agent A, Agent B|}|}
paulson@3659
    70
               : set evs4;
paulson@6308
    71
             Gets B {|Nonce NA, X, Crypt (shrK B) {|Nonce NB, Key K|}|}
paulson@3659
    72
               : set evs4 |]
paulson@3659
    73
          ==> Says B A {|Nonce NA, X|} # evs4 : otway"
paulson@2002
    74
paulson@2131
    75
         (*This message models possible leaks of session keys.  The nonces
paulson@2131
    76
           identify the protocol run.*)
paulson@5359
    77
    Oops "[| evso: otway;  
paulson@2284
    78
             Says Server B {|Nonce NA, X, Crypt (shrK B) {|Nonce NB, Key K|}|}
paulson@3659
    79
               : set evso |]
paulson@4537
    80
          ==> Notes Spy {|Nonce NA, Nonce NB, Key K|} # evso : otway"
paulson@2002
    81
paulson@2002
    82
end