src/HOL/Auth/OtwayRees_Bad.thy
author paulson
Tue, 01 Oct 1996 18:10:33 +0200
changeset 2052 d9f7f4b2613e
parent 2032 1bbf1bdcaf56
child 2108 17fca2a71f8d
permissions -rw-r--r--
Working again with new theory Shared
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
     1
(*  Title:      HOL/Auth/OtwayRees_Bad
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
     2
    ID:         $Id$
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
     4
    Copyright   1996  University of Cambridge
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
     5
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
     6
Inductive relation "otway" for the Otway-Rees protocol.
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
     7
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
     8
The FAULTY version omitting encryption of Nonce NB, as suggested on page 247 of
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
     9
  Burrows, Abadi and Needham.  A Logic of Authentication.
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    10
  Proc. Royal Soc. 426 (1989)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    11
*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    12
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    13
OtwayRees_Bad = Shared + 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    14
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
    15
consts  lost    :: agent set        (*No need for it to be a variable*)
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
    16
	otway   :: event list set
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
    17
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    18
inductive otway
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    19
  intrs 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    20
         (*Initial trace is empty*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    21
    Nil  "[]: otway"
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    22
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
    23
         (*The spy MAY say anything he CAN say.  We do not expect him to
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    24
           invent new nonces here, but he can also use NS1.  Common to
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    25
           all similar protocols.*)
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
    26
    Fake "[| evs: otway;  B ~= Spy;  X: synth (analz (sees lost Spy evs)) |]
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
    27
          ==> Says Spy B X  # evs : otway"
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    28
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    29
         (*Alice initiates a protocol run*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    30
    OR1  "[| evs: otway;  A ~= B;  B ~= Server |]
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    31
          ==> Says A B {|Nonce (newN evs), Agent A, Agent B, 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    32
                         Crypt {|Nonce (newN evs), Agent A, Agent B|} 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    33
                               (shrK A) |} 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    34
                 # evs : otway"
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    35
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    36
         (*Bob's response to Alice's message.  Bob doesn't know who 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    37
	   the sender is, hence the A' in the sender field.
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    38
           We modify the published protocol by NOT encrypting NB.*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    39
    OR2  "[| evs: otway;  B ~= Server;
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    40
             Says A' B {|Nonce NA, Agent A, Agent B, X|} : set_of_list evs |]
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    41
          ==> Says B Server 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    42
                  {|Nonce NA, Agent A, Agent B, X, Nonce (newN evs), 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    43
                    Crypt {|Nonce NA, Agent A, Agent B|} (shrK B)|}
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    44
                 # evs : otway"
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    45
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    46
         (*The Server receives Bob's message and checks that the three NAs
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    47
           match.  Then he sends a new session key to Bob with a packet for
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    48
           forwarding to Alice.*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    49
    OR3  "[| evs: otway;  B ~= Server;
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    50
             Says B' Server 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    51
                  {|Nonce NA, Agent A, Agent B, 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    52
                    Crypt {|Nonce NA, Agent A, Agent B|} (shrK A), 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    53
                    Nonce NB, 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    54
                    Crypt {|Nonce NA, Agent A, Agent B|} (shrK B)|}
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    55
               : set_of_list evs |]
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    56
          ==> Says Server B 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    57
                  {|Nonce NA, 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    58
                    Crypt {|Nonce NA, Key (newK evs)|} (shrK A),
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    59
                    Crypt {|Nonce NB, Key (newK evs)|} (shrK B)|}
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    60
                 # evs : otway"
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    61
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    62
         (*Bob receives the Server's (?) message and compares the Nonces with
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    63
	   those in the message he previously sent the Server.*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    64
    OR4  "[| evs: otway;  A ~= B;  B ~= Server;
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    65
             Says S B {|Nonce NA, X, Crypt {|Nonce NB, Key K|} (shrK B)|}
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    66
               : set_of_list evs;
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    67
             Says B Server {|Nonce NA, Agent A, Agent B, X', Nonce NB, X''|}
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    68
               : set_of_list evs |]
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    69
          ==> Says B A {|Nonce NA, X|} # evs : otway"
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    70
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    71
         (*This message models possible leaks of session keys.  Alice's Nonce
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    72
           identifies the protocol run.*)
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
    73
    Reveal "[| evs: otway;  A ~= Spy;
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    74
               Says B' A {|Nonce NA, Crypt {|Nonce NA, Key K|} (shrK A)|}
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    75
                 : set_of_list evs;
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    76
               Says A  B {|Nonce NA, Agent A, Agent B, 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    77
                           Crypt {|Nonce NA, Agent A, Agent B|} (shrK A)|}
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    78
                 : set_of_list evs |]
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
    79
            ==> Says A Spy {|Nonce NA, Key K|} # evs : otway"
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    80
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    81
end