src/HOL/Auth/OtwayRees.thy
author paulson
Mon, 23 Sep 1996 18:21:31 +0200
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
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
2014
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
     8
Version that encrypts Nonce NB
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
     9
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    10
From page 244 of
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    11
  Burrows, Abadi and Needham.  A Logic of Authentication.
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    12
  Proc. Royal Soc. 426 (1989)
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    13
*)
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
OtwayRees = Shared + 
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    16
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    17
consts  otway   :: "event list set"
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    18
inductive otway
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    19
  intrs 
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    20
         (*Initial trace is empty*)
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    21
    Nil  "[]: otway"
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    22
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    23
         (*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
    24
           invent new nonces here, but he can also use NS1.  Common to
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    25
           all similar protocols.*)
1976
1cff1f4fdb8a Reformatting
paulson
parents: 1941
diff changeset
    26
    Fake "[| evs: otway;  B ~= Enemy;  X: synth (analz (sees Enemy evs)) |]
1cff1f4fdb8a Reformatting
paulson
parents: 1941
diff changeset
    27
          ==> Says Enemy B X  # evs : otway"
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    28
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    29
         (*Alice initiates a protocol run*)
2014
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    30
    OR1  "[| evs: otway;  A ~= B;  B ~= Server |]
1976
1cff1f4fdb8a Reformatting
paulson
parents: 1941
diff changeset
    31
          ==> Says A B {|Nonce (newN evs), Agent A, Agent B, 
2014
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    32
                         Crypt {|Nonce (newN evs), Agent A, Agent B|} 
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    33
                               (shrK A) |} 
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    34
                 # evs : otway"
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    35
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    36
         (*Bob's response to Alice's message.  Bob doesn't know who 
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    37
	   the sender is, hence the A' in the sender field.
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    38
           We modify the published protocol by NOT encrypting NB.*)
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    39
    OR2  "[| evs: otway;  B ~= Server;
1976
1cff1f4fdb8a Reformatting
paulson
parents: 1941
diff changeset
    40
             Says A' B {|Nonce NA, Agent A, Agent B, X|} : set_of_list evs |]
1cff1f4fdb8a Reformatting
paulson
parents: 1941
diff changeset
    41
          ==> Says B Server 
2014
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    42
                  {|Nonce NA, Agent A, Agent B, X, 
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    43
                    Crypt {|Nonce NA, Nonce (newN evs), 
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    44
                            Agent A, Agent B|} (shrK B)|}
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    45
                 # evs : otway"
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    46
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    47
         (*The Server receives Bob's message and checks that the three NAs
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    48
           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
    49
           forwarding to Alice.*)
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    50
    OR3  "[| evs: otway;  B ~= Server;
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    51
             Says B' Server 
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    52
                  {|Nonce NA, Agent A, Agent B, 
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    53
                    Crypt {|Nonce NA, Agent A, Agent B|} (shrK A), 
2014
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    54
                    Crypt {|Nonce NA, Nonce NB, Agent A, Agent B|} (shrK B)|}
1976
1cff1f4fdb8a Reformatting
paulson
parents: 1941
diff changeset
    55
               : set_of_list evs |]
1cff1f4fdb8a Reformatting
paulson
parents: 1941
diff changeset
    56
          ==> Says Server B 
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    57
                  {|Nonce NA, 
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    58
                    Crypt {|Nonce NA, Key (newK evs)|} (shrK A),
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    59
                    Crypt {|Nonce NB, Key (newK evs)|} (shrK B)|}
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    60
                 # evs : otway"
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    61
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    62
         (*Bob receives the Server's (?) message and compares the Nonces with
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    63
	   those in the message he previously sent the Server.*)
2014
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    64
    OR4  "[| evs: otway;  A ~= B;  B ~= Server;
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    65
             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
    66
               : set_of_list evs;
2014
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    67
             Says B Server {|Nonce NA, Agent A, Agent B, X', 
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    68
                             Crypt {|Nonce NA, Nonce NB, Agent A, Agent B|} 
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    69
                                   (shrK B)|}
1976
1cff1f4fdb8a Reformatting
paulson
parents: 1941
diff changeset
    70
               : set_of_list evs |]
2014
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    71
          ==> Says B A {|Nonce NA, X|} # evs : otway"
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    72
2014
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    73
         (*This message models possible leaks of session keys.  Alice's Nonce
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    74
           identifies the protocol run.*)
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    75
    Reveal "[| evs: otway;  A ~= Enemy;
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    76
               Says B' A {|Nonce NA, Crypt {|Nonce NA, Key K|} (shrK A)|}
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    77
                 : set_of_list evs;
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    78
               Says A  B {|Nonce NA, Agent A, Agent B, 
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    79
                           Crypt {|Nonce NA, Agent A, Agent B|} (shrK A)|}
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    80
                 : set_of_list evs |]
5be4c8ca7b25 Correction of protocol; addition of Reveal message; proofs of
paulson
parents: 1976
diff changeset
    81
            ==> Says A Enemy {|Nonce NA, Key K|} # evs : otway"
1941
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    82
f97a6e5b6375 Initial working proof of Otway-Rees protocol
paulson
parents:
diff changeset
    83
end