src/HOL/Auth/Yahalom2.thy
author paulson
Fri Oct 18 11:43:14 1996 +0200 (1996-10-18)
changeset 2111 81c8d46edfa3
child 2155 dc85854810eb
permissions -rw-r--r--
New version of Yahalom, as recommended on p 259 of BAN paper
paulson@2111
     1
(*  Title:      HOL/Auth/Yahalom
paulson@2111
     2
    ID:         $Id$
paulson@2111
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
paulson@2111
     4
    Copyright   1996  University of Cambridge
paulson@2111
     5
paulson@2111
     6
Inductive relation "yahalom" for the Yahalom protocol, Variant 2.
paulson@2111
     7
paulson@2111
     8
This version trades encryption of NB for additional explicitness in YM3.
paulson@2111
     9
paulson@2111
    10
From page 259 of
paulson@2111
    11
  Burrows, Abadi and Needham.  A Logic of Authentication.
paulson@2111
    12
  Proc. Royal Soc. 426 (1989)
paulson@2111
    13
*)
paulson@2111
    14
paulson@2111
    15
Yahalom2 = Shared + 
paulson@2111
    16
paulson@2111
    17
consts  yahalom   :: "agent set => event list set"
paulson@2111
    18
inductive "yahalom lost"
paulson@2111
    19
  intrs 
paulson@2111
    20
         (*Initial trace is empty*)
paulson@2111
    21
    Nil  "[]: yahalom lost"
paulson@2111
    22
paulson@2111
    23
         (*The spy MAY say anything he CAN say.  We do not expect him to
paulson@2111
    24
           invent new nonces here, but he can also use NS1.  Common to
paulson@2111
    25
           all similar protocols.*)
paulson@2111
    26
    Fake "[| evs: yahalom lost;  B ~= Spy;  
paulson@2111
    27
             X: synth (analz (sees lost Spy evs)) |]
paulson@2111
    28
          ==> Says Spy B X  # evs : yahalom lost"
paulson@2111
    29
paulson@2111
    30
         (*Alice initiates a protocol run*)
paulson@2111
    31
    YM1  "[| evs: yahalom lost;  A ~= B |]
paulson@2111
    32
          ==> Says A B {|Agent A, Nonce (newN evs)|} # evs : yahalom lost"
paulson@2111
    33
paulson@2111
    34
         (*Bob's response to Alice's message.  Bob doesn't know who 
paulson@2111
    35
	   the sender is, hence the A' in the sender field.*)
paulson@2111
    36
    YM2  "[| evs: yahalom lost;  B ~= Server;
paulson@2111
    37
             Says A' B {|Agent A, Nonce NA|} : set_of_list evs |]
paulson@2111
    38
          ==> Says B Server 
paulson@2111
    39
                  {|Agent B, Nonce (newN evs), 
paulson@2111
    40
                    Crypt {|Agent A, Nonce NA|} (shrK B)|}
paulson@2111
    41
                 # evs : yahalom lost"
paulson@2111
    42
paulson@2111
    43
         (*The Server receives Bob's message.  He responds by sending a
paulson@2111
    44
            new session key to Alice, with a packet for forwarding to Bob.*)
paulson@2111
    45
    YM3  "[| evs: yahalom lost;  A ~= Server;
paulson@2111
    46
             Says B' Server 
paulson@2111
    47
                  {|Agent B, Nonce NB, Crypt {|Agent A, Nonce NA|} (shrK B)|}
paulson@2111
    48
               : set_of_list evs |]
paulson@2111
    49
          ==> Says Server A
paulson@2111
    50
               {|Nonce NB, 
paulson@2111
    51
                 Crypt {|Agent B, Key (newK evs), Nonce NA|} (shrK A),
paulson@2111
    52
                 Crypt {|Agent A, Key (newK evs), Nonce NB, Nonce NB|} (shrK B)|}
paulson@2111
    53
                 # evs : yahalom lost"
paulson@2111
    54
paulson@2111
    55
         (*Alice receives the Server's (?) message, checks her Nonce, and
paulson@2111
    56
           uses the new session key to send Bob his Nonce.*)
paulson@2111
    57
    YM4  "[| evs: yahalom lost;  A ~= B;  
paulson@2111
    58
             Says S A {|Nonce NB, Crypt {|Agent B, Key K, Nonce NA|} (shrK A),
paulson@2111
    59
                        X|}
paulson@2111
    60
               : set_of_list evs;
paulson@2111
    61
             Says A B {|Agent A, Nonce NA|} : set_of_list evs |]
paulson@2111
    62
          ==> Says A B {|X, Crypt (Nonce NB) K|} # evs : yahalom lost"
paulson@2111
    63
paulson@2111
    64
         (*This message models possible leaks of session keys.  The Nonce NA
paulson@2111
    65
           identifies the protocol run.  We can't be sure about NB.*)
paulson@2111
    66
    Revl "[| evs: yahalom lost;  A ~= Spy;
paulson@2111
    67
             Says S A {|Nonce NB, Crypt {|Agent B, Key K, Nonce NA|} (shrK A),
paulson@2111
    68
                        X|}
paulson@2111
    69
               : set_of_list evs |]
paulson@2111
    70
          ==> Says A Spy {|Nonce NA, Key K|} # evs : yahalom lost"
paulson@2111
    71
paulson@2111
    72
end