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