src/HOL/Auth/Yahalom2.thy
changeset 2111 81c8d46edfa3
child 2155 dc85854810eb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/HOL/Auth/Yahalom2.thy	Fri Oct 18 11:43:14 1996 +0200
     1.3 @@ -0,0 +1,72 @@
     1.4 +(*  Title:      HOL/Auth/Yahalom
     1.5 +    ID:         $Id$
     1.6 +    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
     1.7 +    Copyright   1996  University of Cambridge
     1.8 +
     1.9 +Inductive relation "yahalom" for the Yahalom protocol, Variant 2.
    1.10 +
    1.11 +This version trades encryption of NB for additional explicitness in YM3.
    1.12 +
    1.13 +From page 259 of
    1.14 +  Burrows, Abadi and Needham.  A Logic of Authentication.
    1.15 +  Proc. Royal Soc. 426 (1989)
    1.16 +*)
    1.17 +
    1.18 +Yahalom2 = Shared + 
    1.19 +
    1.20 +consts  yahalom   :: "agent set => event list set"
    1.21 +inductive "yahalom lost"
    1.22 +  intrs 
    1.23 +         (*Initial trace is empty*)
    1.24 +    Nil  "[]: yahalom lost"
    1.25 +
    1.26 +         (*The spy MAY say anything he CAN say.  We do not expect him to
    1.27 +           invent new nonces here, but he can also use NS1.  Common to
    1.28 +           all similar protocols.*)
    1.29 +    Fake "[| evs: yahalom lost;  B ~= Spy;  
    1.30 +             X: synth (analz (sees lost Spy evs)) |]
    1.31 +          ==> Says Spy B X  # evs : yahalom lost"
    1.32 +
    1.33 +         (*Alice initiates a protocol run*)
    1.34 +    YM1  "[| evs: yahalom lost;  A ~= B |]
    1.35 +          ==> Says A B {|Agent A, Nonce (newN evs)|} # evs : yahalom lost"
    1.36 +
    1.37 +         (*Bob's response to Alice's message.  Bob doesn't know who 
    1.38 +	   the sender is, hence the A' in the sender field.*)
    1.39 +    YM2  "[| evs: yahalom lost;  B ~= Server;
    1.40 +             Says A' B {|Agent A, Nonce NA|} : set_of_list evs |]
    1.41 +          ==> Says B Server 
    1.42 +                  {|Agent B, Nonce (newN evs), 
    1.43 +                    Crypt {|Agent A, Nonce NA|} (shrK B)|}
    1.44 +                 # evs : yahalom lost"
    1.45 +
    1.46 +         (*The Server receives Bob's message.  He responds by sending a
    1.47 +            new session key to Alice, with a packet for forwarding to Bob.*)
    1.48 +    YM3  "[| evs: yahalom lost;  A ~= Server;
    1.49 +             Says B' Server 
    1.50 +                  {|Agent B, Nonce NB, Crypt {|Agent A, Nonce NA|} (shrK B)|}
    1.51 +               : set_of_list evs |]
    1.52 +          ==> Says Server A
    1.53 +               {|Nonce NB, 
    1.54 +                 Crypt {|Agent B, Key (newK evs), Nonce NA|} (shrK A),
    1.55 +                 Crypt {|Agent A, Key (newK evs), Nonce NB, Nonce NB|} (shrK B)|}
    1.56 +                 # evs : yahalom lost"
    1.57 +
    1.58 +         (*Alice receives the Server's (?) message, checks her Nonce, and
    1.59 +           uses the new session key to send Bob his Nonce.*)
    1.60 +    YM4  "[| evs: yahalom lost;  A ~= B;  
    1.61 +             Says S A {|Nonce NB, Crypt {|Agent B, Key K, Nonce NA|} (shrK A),
    1.62 +                        X|}
    1.63 +               : set_of_list evs;
    1.64 +             Says A B {|Agent A, Nonce NA|} : set_of_list evs |]
    1.65 +          ==> Says A B {|X, Crypt (Nonce NB) K|} # evs : yahalom lost"
    1.66 +
    1.67 +         (*This message models possible leaks of session keys.  The Nonce NA
    1.68 +           identifies the protocol run.  We can't be sure about NB.*)
    1.69 +    Revl "[| evs: yahalom lost;  A ~= Spy;
    1.70 +             Says S A {|Nonce NB, Crypt {|Agent B, Key K, Nonce NA|} (shrK A),
    1.71 +                        X|}
    1.72 +               : set_of_list evs |]
    1.73 +          ==> Says A Spy {|Nonce NA, Key K|} # evs : yahalom lost"
    1.74 +
    1.75 +end