src/HOL/Auth/NS_Shared.thy
changeset 1934 58573e7041b4
child 1943 20574dca5a3e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/HOL/Auth/NS_Shared.thy	Wed Aug 21 13:25:27 1996 +0200
     1.3 @@ -0,0 +1,67 @@
     1.4 +(*  Title:      HOL/Auth/NS_Shared
     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 "ns_shared" for Needham-Schroeder Shared-Key protocol.
    1.10 +
    1.11 +From page 247 of
    1.12 +  Burrows, Abadi and Needham.  A Logic of Authentication.
    1.13 +  Proc. Royal Soc. 426 (1989)
    1.14 +*)
    1.15 +
    1.16 +NS_Shared = Shared + 
    1.17 +
    1.18 +consts  ns_shared   :: "event list set"
    1.19 +inductive ns_shared
    1.20 +  intrs 
    1.21 +         (*Initial trace is empty*)
    1.22 +    Nil  "[]: ns_shared"
    1.23 +
    1.24 +         (*The enemy MAY say anything he CAN say.  We do not expect him to
    1.25 +           invent new nonces here, but he can also use NS1.  Common to
    1.26 +           all similar protocols.*)
    1.27 +    Fake "[| evs: ns_shared;  B ~= Enemy;  X: synth (analz (sees Enemy evs))
    1.28 +          |] ==> (Says Enemy B X) # evs : ns_shared"
    1.29 +
    1.30 +         (*Alice initiates a protocol run*)
    1.31 +    NS1  "[| evs: ns_shared;  A ~= Server
    1.32 +          |] ==> (Says A Server {|Agent A, Agent B, Nonce (newN evs)|}) 
    1.33 +                 # evs : ns_shared"
    1.34 +
    1.35 +         (*Server's response to Alice's message.
    1.36 +           !! It may respond more than once to A's request !!
    1.37 +	   Server doesn't know who the true sender is, hence the A' in
    1.38 +               the sender field.*)
    1.39 +    NS2  "[| evs: ns_shared;  A ~= B;  A ~= Server;
    1.40 +             (Says A' Server {|Agent A, Agent B, Nonce NA|}) : set_of_list evs
    1.41 +          |] ==> (Says Server A 
    1.42 +                  (Crypt {|Nonce NA, Agent B, Key (newK evs),   
    1.43 +                           (Crypt {|Key (newK evs), Agent A|} (serverKey B))|}
    1.44 +                   (serverKey A))) # evs : ns_shared"
    1.45 +
    1.46 +          (*We can't assume S=Server.  Agent A "remembers" her nonce.
    1.47 +            May assume WLOG that she is NOT the Enemy: the Fake rule
    1.48 +            covers this case.  Can inductively show A ~= Server*)
    1.49 +    NS3  "[| evs: ns_shared;  A ~= B;
    1.50 +             (Says S A (Crypt {|Nonce NA, Agent B, Key K, X|} (serverKey A))) 
    1.51 +               : set_of_list evs;
    1.52 +             A = Friend i;
    1.53 +             (Says A Server {|Agent A, Agent B, Nonce NA|}) : set_of_list evs
    1.54 +          |] ==> (Says A B X) # evs : ns_shared"
    1.55 +
    1.56 +         (*Bob's nonce exchange.  He does not know who the message came
    1.57 +           from, but responds to A because she is mentioned inside.*)
    1.58 +    NS4  "[| evs: ns_shared;  A ~= B;  
    1.59 +             (Says A' B (Crypt {|Key K, Agent A|} (serverKey B))) 
    1.60 +               : set_of_list evs
    1.61 +          |] ==> (Says B A (Crypt (Nonce (newN evs)) K)) # evs : ns_shared"
    1.62 +
    1.63 +         (*Alice responds with (Suc N), if she has seen the key before.*)
    1.64 +    NS5  "[| evs: ns_shared;  A ~= B;  
    1.65 +             (Says B' A (Crypt (Nonce N) K)) : set_of_list evs;
    1.66 +             (Says S  A (Crypt {|Nonce NA, Agent B, Key K, X|} (serverKey A))) 
    1.67 +               : set_of_list evs
    1.68 +          |] ==> (Says A B (Crypt (Nonce (Suc N)) K)) # evs : ns_shared"
    1.69 +
    1.70 +end