src/HOL/Auth/Yahalom.thy
author paulson
Fri Sep 13 13:16:57 1996 +0200 (1996-09-13)
changeset 1995 c80e58e78d9c
parent 1985 84cf16192e03
child 2032 1bbf1bdcaf56
permissions -rw-r--r--
Addition of Yahalom protocol
paulson@1995
     1
(*  Title:      HOL/Auth/Yahalom
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@1995
    13
Yahalom = 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@1995
    29
          ==> Says A B {|Agent A, Nonce (newN evs)|} # evs : yahalom"
paulson@1985
    30
paulson@1985
    31
         (*Bob's response to Alice's message.  Bob doesn't know who 
paulson@1995
    32
	   the sender is, hence the A' in the sender field.*)
paulson@1985
    33
    YM2  "[| evs: yahalom;  B ~= Server;
paulson@1995
    34
             Says A' B {|Agent A, Nonce NA|} : set_of_list evs |]
paulson@1985
    35
          ==> Says B Server 
paulson@1985
    36
                  {|Agent B, 
paulson@1985
    37
                    Crypt {|Agent A, Nonce NA, Nonce (newN evs)|} (shrK B)|}
paulson@1985
    38
                 # evs : yahalom"
paulson@1985
    39
paulson@1985
    40
         (*The Server receives Bob's message.  He responds by sending a
paulson@1985
    41
            new session key to Alice, with a packet for forwarding to Bob.*)
paulson@1995
    42
    YM3  "[| evs: yahalom;  A ~= Server;
paulson@1985
    43
             Says B' Server 
paulson@1995
    44
                  {|Agent B, Crypt {|Agent A, Nonce NA, Nonce NB|} (shrK B)|}
paulson@1985
    45
               : set_of_list evs |]
paulson@1995
    46
          ==> Says Server A
paulson@1995
    47
                  {|Crypt {|Agent B, Key (newK evs), 
paulson@1995
    48
                            Nonce NA, Nonce NB|} (shrK A),
paulson@1995
    49
                    Crypt {|Agent A, Key (newK evs)|} (shrK B)|}
paulson@1985
    50
                 # evs : yahalom"
paulson@1985
    51
paulson@1995
    52
         (*Alice receives the Server's (?) message, checks her Nonce, and
paulson@1995
    53
           uses the new session key to send Bob his Nonce.*)
paulson@1985
    54
    YM4  "[| evs: yahalom;  A ~= B;  
paulson@1995
    55
             Says S A {|Crypt {|Agent B, Key K, Nonce NA, Nonce NB|} (shrK A),
paulson@1995
    56
                        X|}
paulson@1985
    57
               : set_of_list evs;
paulson@1995
    58
             Says A B {|Agent A, Nonce NA|} : set_of_list evs |]
paulson@1995
    59
          ==> Says A B {|X, Crypt (Nonce NB) K|} # evs : yahalom"
paulson@1985
    60
paulson@1985
    61
end