src/HOL/Auth/Yahalom.thy
author paulson
Thu Sep 12 10:40:05 1996 +0200 (1996-09-12)
changeset 1985 84cf16192e03
child 1995 c80e58e78d9c
permissions -rw-r--r--
Tidied many proofs, using AddIffs to let equivalences take
the place of separate Intr and Elim rules. Also deleted most named clasets.
paulson@1985
     1
(*  Title:      HOL/Auth/OtwayRees
paulson@1985
     2
    ID:         $Id$
paulson@1985
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
paulson@1985
     4
    Copyright   1996  University of Cambridge
paulson@1985
     5
paulson@1985
     6
Inductive relation "yahalom" for the Yahalom protocol.
paulson@1985
     7
paulson@1985
     8
From page 257 of
paulson@1985
     9
  Burrows, Abadi and Needham.  A Logic of Authentication.
paulson@1985
    10
  Proc. Royal Soc. 426 (1989)
paulson@1985
    11
*)
paulson@1985
    12
paulson@1985
    13
OtwayRees = Shared + 
paulson@1985
    14
paulson@1985
    15
consts  yahalom   :: "event list set"
paulson@1985
    16
inductive yahalom
paulson@1985
    17
  intrs 
paulson@1985
    18
         (*Initial trace is empty*)
paulson@1985
    19
    Nil  "[]: yahalom"
paulson@1985
    20
paulson@1985
    21
         (*The enemy MAY say anything he CAN say.  We do not expect him to
paulson@1985
    22
           invent new nonces here, but he can also use NS1.  Common to
paulson@1985
    23
           all similar protocols.*)
paulson@1985
    24
    Fake "[| evs: yahalom;  B ~= Enemy;  X: synth (analz (sees Enemy evs)) |]
paulson@1985
    25
          ==> Says Enemy B X  # evs : yahalom"
paulson@1985
    26
paulson@1985
    27
         (*Alice initiates a protocol run*)
paulson@1985
    28
    YM1  "[| evs: yahalom;  A ~= B |]
paulson@1985
    29
          ==> Says A B {|Nonce (newN evs), Agent A |} # evs : yahalom"
paulson@1985
    30
paulson@1985
    31
         (*Bob's response to Alice's message.  Bob doesn't know who 
paulson@1985
    32
	   the sender is, hence the A' in the sender field.
paulson@1985
    33
           We modify the published protocol by NOT encrypting NB.*)
paulson@1985
    34
    YM2  "[| evs: yahalom;  B ~= Server;
paulson@1985
    35
             Says A' B {|Nonce NA, Agent A|} : set_of_list evs |]
paulson@1985
    36
          ==> Says B Server 
paulson@1985
    37
                  {|Agent B, 
paulson@1985
    38
                    Crypt {|Agent A, Nonce NA, Nonce (newN evs)|} (shrK B)|}
paulson@1985
    39
                 # evs : yahalom"
paulson@1985
    40
paulson@1985
    41
         (*The Server receives Bob's message.  He responds by sending a
paulson@1985
    42
            new session key to Alice, with a packet for forwarding to Bob.*)
paulson@1985
    43
    YM3  "[| evs: yahalom;  B ~= Server;
paulson@1985
    44
             Says B' Server 
paulson@1985
    45
                  {|Nonce NA, Agent A, Agent B, 
paulson@1985
    46
                    Crypt {|Nonce NA, Agent A, Agent B|} (shrK A), 
paulson@1985
    47
                    Nonce NB, 
paulson@1985
    48
                    Crypt {|Nonce NA, Agent A, Agent B|} (shrK B)|}
paulson@1985
    49
               : set_of_list evs |]
paulson@1985
    50
          ==> Says Server B 
paulson@1985
    51
                  {|Nonce NA, 
paulson@1985
    52
                    Crypt {|Nonce NA, Key (newK evs)|} (shrK A),
paulson@1985
    53
                    Crypt {|Nonce NB, Key (newK evs)|} (shrK B)|}
paulson@1985
    54
                 # evs : yahalom"
paulson@1985
    55
paulson@1985
    56
         (*Bob receives the Server's (?) message and compares the Nonces with
paulson@1985
    57
	   those in the message he previously sent the Server.*)
paulson@1985
    58
    YM4  "[| evs: yahalom;  A ~= B;  
paulson@1985
    59
             Says S B {|Nonce NA, X, Crypt {|Nonce NB, Key K|} (shrK B)|}
paulson@1985
    60
               : set_of_list evs;
paulson@1985
    61
             Says B Server {|Nonce NA, Agent A, Agent B, X', Nonce NB, X''|}
paulson@1985
    62
               : set_of_list evs |]
paulson@1985
    63
          ==> (Says B A {|Nonce NA, X|}) # evs : yahalom"
paulson@1985
    64
paulson@1985
    65
         (*Alice checks her Nonce, then sends a dummy message to Bob,
paulson@1985
    66
           using the new session key.*)
paulson@1985
    67
    YM5  "[| evs: yahalom;  
paulson@1985
    68
             Says B' A {|Nonce NA, Crypt {|Nonce NA, Key K|} (shrK A)|}
paulson@1985
    69
               : set_of_list evs;
paulson@1985
    70
             Says A  B {|Nonce NA, Agent A, Agent B, X|} : set_of_list evs |]
paulson@1985
    71
          ==> Says A B (Crypt (Agent A) K)  # evs : yahalom"
paulson@1985
    72
paulson@1985
    73
end