src/HOL/Auth/OtwayRees_AN.thy
author paulson
Thu, 19 Dec 1996 11:58:39 +0100
changeset 2451 ce85a2aafc7a
parent 2378 fc103154ad8f
child 2516 4d68fbe6378b
permissions -rw-r--r--
Extensive tidying and simplification, largely stemming from changing newN and newK to take an integer argument
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     1
(*  Title:      HOL/Auth/OtwayRees
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     2
    ID:         $Id$
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     4
    Copyright   1996  University of Cambridge
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     5
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     6
Inductive relation "otway" for the Otway-Rees protocol.
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     7
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     8
Simplified version with minimal encryption but explicit messages
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     9
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    10
From page 11 of
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    11
  Abadi and Needham.  Prudent Engineering Practice for Cryptographic Protocols.
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    12
  IEEE Trans. SE 22 (1), 1996
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    13
*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    14
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    15
OtwayRees_AN = Shared + 
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    16
2378
fc103154ad8f Removed needless quotation marks
paulson
parents: 2284
diff changeset
    17
consts  otway   :: agent set => event list set
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    18
inductive "otway lost"
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    19
  intrs 
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    20
         (*Initial trace is empty*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    21
    Nil  "[]: otway lost"
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    22
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    23
         (*The spy MAY say anything he CAN say.  We do not expect him to
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    24
           invent new nonces here, but he can also use NS1.  Common to
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    25
           all similar protocols.*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    26
    Fake "[| evs: otway lost;  B ~= Spy;  
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    27
             X: synth (analz (sees lost Spy evs)) |]
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    28
          ==> Says Spy B X  # evs : otway lost"
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    29
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    30
         (*Alice initiates a protocol run*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    31
    OR1  "[| evs: otway lost;  A ~= B;  B ~= Server |]
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2378
diff changeset
    32
          ==> Says A B {|Agent A, Agent B, Nonce (newN(length evs))|}
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    33
                 # evs : otway lost"
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    34
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    35
         (*Bob's response to Alice's message.  Bob doesn't know who 
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    36
	   the sender is, hence the A' in the sender field.*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    37
    OR2  "[| evs: otway lost;  B ~= Server;
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    38
             Says A' B {|Agent A, Agent B, Nonce NA|} : set_of_list evs |]
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2378
diff changeset
    39
          ==> Says B Server {|Agent A, Agent B, Nonce NA, 
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2378
diff changeset
    40
                              Nonce (newN(length evs))|}
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    41
                 # evs : otway lost"
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    42
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    43
         (*The Server receives Bob's message.  Then he sends a new
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    44
           session key to Bob with a packet for forwarding to Alice.*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    45
    OR3  "[| evs: otway lost;  B ~= Server;  A ~= B;
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    46
             Says B' Server {|Agent A, Agent B, Nonce NA, Nonce NB|}
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    47
               : set_of_list evs |]
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    48
          ==> Says Server B 
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2378
diff changeset
    49
               {|Crypt (shrK A) {|Nonce NA, Agent A, Agent B, 
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2378
diff changeset
    50
                                  Key(newK(length evs))|},
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2378
diff changeset
    51
                 Crypt (shrK B) {|Nonce NB, Agent A, Agent B, 
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2378
diff changeset
    52
                                  Key(newK(length evs))|}|}
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    53
              # evs : otway lost"
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    54
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    55
         (*Bob receives the Server's (?) message and compares the Nonces with
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    56
	   those in the message he previously sent the Server.*)
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2090
diff changeset
    57
    OR4  "[| evs: otway lost;  A ~= B;
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    58
             Says S B {|X, 
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2131
diff changeset
    59
                        Crypt (shrK B) {|Nonce NB, Agent A, Agent B, Key K|}|}
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    60
               : set_of_list evs;
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    61
             Says B Server {|Agent A, Agent B, Nonce NA, Nonce NB|}
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    62
               : set_of_list evs |]
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    63
          ==> Says B A X # evs : otway lost"
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    64
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2090
diff changeset
    65
         (*This message models possible leaks of session keys.  The nonces
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2090
diff changeset
    66
           identify the protocol run.  B is not assumed to know shrK A.*)
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2090
diff changeset
    67
    Oops "[| evs: otway lost;  B ~= Spy;
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2090
diff changeset
    68
             Says Server B 
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2131
diff changeset
    69
                      {|Crypt (shrK A) {|Nonce NA, Agent A, Agent B, Key K|}, 
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2131
diff changeset
    70
                        Crypt (shrK B) {|Nonce NB, Agent A, Agent B, Key K|}|}
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2090
diff changeset
    71
               : set_of_list evs |]
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2090
diff changeset
    72
          ==> Says B Spy {|Nonce NA, Nonce NB, Key K|} # evs : otway lost"
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    73
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    74
end