src/HOL/Auth/OtwayRees.thy
author paulson
Wed, 11 Sep 1996 18:40:55 +0200
changeset 1976 1cff1f4fdb8a
parent 1941 f97a6e5b6375
child 2014 5be4c8ca7b25
permissions -rw-r--r--
Reformatting
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
     1
(*  Title:      HOL/Auth/OtwayRees
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
     2
    ID:         $Id$
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
     4
    Copyright   1996  University of Cambridge
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
     5
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
     6
Inductive relation "otway" for the Otway-Rees protocol.
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
     7
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
     8
From page 244 of
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
     9
  Burrows, Abadi and Needham.  A Logic of Authentication.
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    10
  Proc. Royal Soc. 426 (1989)
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    11
*)
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    12
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    13
OtwayRees = Shared + 
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    14
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    15
consts  otway   :: "event list set"
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    16
inductive otway
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    17
  intrs 
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    18
         (*Initial trace is empty*)
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    19
    Nil  "[]: otway"
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    20
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    21
         (*The enemy MAY say anything he CAN say.  We do not expect him to
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    22
           invent new nonces here, but he can also use NS1.  Common to
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    23
           all similar protocols.*)
1976
1cff1f4fdb8a Reformatting
paulson
parents: 1941
diff changeset
    24
    Fake "[| evs: otway;  B ~= Enemy;  X: synth (analz (sees Enemy evs)) |]
1cff1f4fdb8a Reformatting
paulson
parents: 1941
diff changeset
    25
          ==> Says Enemy B X  # evs : otway"
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    26
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    27
         (*Alice initiates a protocol run*)
1976
1cff1f4fdb8a Reformatting
paulson
parents: 1941
diff changeset
    28
    OR1  "[| evs: otway;  A ~= B |]
1cff1f4fdb8a Reformatting
paulson
parents: 1941
diff changeset
    29
          ==> Says A B {|Nonce (newN evs), Agent A, Agent B, 
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    30
                            Crypt {|Nonce (newN evs), Agent A, Agent B|} 
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    31
                                  (shrK A) |} 
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    32
                 # evs : otway"
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    33
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    34
         (*Bob's response to Alice's message.  Bob doesn't know who 
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    35
	   the sender is, hence the A' in the sender field.
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    36
           We modify the published protocol by NOT encrypting NB.*)
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    37
    OR2  "[| evs: otway;  B ~= Server;
1976
1cff1f4fdb8a Reformatting
paulson
parents: 1941
diff changeset
    38
             Says A' B {|Nonce NA, Agent A, Agent B, X|} : set_of_list evs |]
1cff1f4fdb8a Reformatting
paulson
parents: 1941
diff changeset
    39
          ==> Says B Server 
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    40
                  {|Nonce NA, Agent A, Agent B, X, Nonce (newN evs), 
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    41
                    Crypt {|Nonce NA, Agent A, Agent B|} (shrK B)|}
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    42
                 # evs : otway"
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    43
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    44
         (*The Server receives Bob's message and checks that the three NAs
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    45
           match.  Then he sends a new session key to Bob with a packet for
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    46
           forwarding to Alice.*)
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    47
    OR3  "[| evs: otway;  B ~= Server;
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    48
             Says B' Server 
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    49
                  {|Nonce NA, Agent A, Agent B, 
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    50
                    Crypt {|Nonce NA, Agent A, Agent B|} (shrK A), 
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    51
                    Nonce NB, 
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    52
                    Crypt {|Nonce NA, Agent A, Agent B|} (shrK B)|}
1976
1cff1f4fdb8a Reformatting
paulson
parents: 1941
diff changeset
    53
               : set_of_list evs |]
1cff1f4fdb8a Reformatting
paulson
parents: 1941
diff changeset
    54
          ==> Says Server B 
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    55
                  {|Nonce NA, 
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    56
                    Crypt {|Nonce NA, Key (newK evs)|} (shrK A),
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    57
                    Crypt {|Nonce NB, Key (newK evs)|} (shrK B)|}
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    58
                 # evs : otway"
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    59
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    60
         (*Bob receives the Server's (?) message and compares the Nonces with
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    61
	   those in the message he previously sent the Server.*)
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    62
    OR4  "[| evs: otway;  A ~= B;  
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    63
             Says S B {|Nonce NA, X, Crypt {|Nonce NB, Key K|} (shrK B)|}
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    64
               : set_of_list evs;
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    65
             Says B Server {|Nonce NA, Agent A, Agent B, X', Nonce NB, X''|}
1976
1cff1f4fdb8a Reformatting
paulson
parents: 1941
diff changeset
    66
               : set_of_list evs |]
1cff1f4fdb8a Reformatting
paulson
parents: 1941
diff changeset
    67
          ==> (Says B A {|Nonce NA, X|}) # evs : otway"
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    68
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    69
         (*Alice checks her Nonce, then sends a dummy message to Bob,
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    70
           using the new session key.*)
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    71
    OR5  "[| evs: otway;  
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    72
             Says B' A {|Nonce NA, Crypt {|Nonce NA, Key K|} (shrK A)|}
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    73
               : set_of_list evs;
1976
1cff1f4fdb8a Reformatting
paulson
parents: 1941
diff changeset
    74
             Says A  B {|Nonce NA, Agent A, Agent B, X|} : set_of_list evs |]
1cff1f4fdb8a Reformatting
paulson
parents: 1941
diff changeset
    75
          ==> Says A B (Crypt (Agent A) K)  # evs : otway"
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    76
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    77
end