src/HOL/Auth/Yahalom.thy
author paulson
Fri Dec 13 11:00:44 1996 +0100 (1996-12-13)
changeset 2378 fc103154ad8f
parent 2284 80ebd1a213fd
child 2451 ce85a2aafc7a
permissions -rw-r--r--
Removed needless quotation marks
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@2378
    15
consts  yahalom   :: agent set => event list set
paulson@2032
    16
inductive "yahalom lost"
paulson@1985
    17
  intrs 
paulson@1985
    18
         (*Initial trace is empty*)
paulson@2032
    19
    Nil  "[]: yahalom lost"
paulson@1985
    20
paulson@2032
    21
         (*The spy 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@2032
    24
    Fake "[| evs: yahalom lost;  B ~= Spy;  
paulson@2032
    25
             X: synth (analz (sees lost Spy evs)) |]
paulson@2032
    26
          ==> Says Spy B X  # evs : yahalom lost"
paulson@1985
    27
paulson@1985
    28
         (*Alice initiates a protocol run*)
paulson@2032
    29
    YM1  "[| evs: yahalom lost;  A ~= B |]
paulson@2032
    30
          ==> Says A B {|Agent A, Nonce (newN evs)|} # evs : yahalom lost"
paulson@1985
    31
paulson@1985
    32
         (*Bob's response to Alice's message.  Bob doesn't know who 
paulson@1995
    33
	   the sender is, hence the A' in the sender field.*)
paulson@2032
    34
    YM2  "[| evs: yahalom lost;  B ~= Server;
paulson@1995
    35
             Says A' B {|Agent A, Nonce NA|} : set_of_list evs |]
paulson@1985
    36
          ==> Says B Server 
paulson@1985
    37
                  {|Agent B, 
paulson@2284
    38
                    Crypt (shrK B) {|Agent A, Nonce NA, Nonce (newN evs)|}|}
paulson@2032
    39
                 # evs : yahalom lost"
paulson@1985
    40
paulson@1985
    41
         (*The Server receives Bob's message.  He responds by sending a
paulson@1985
    42
            new session key to Alice, with a packet for forwarding to Bob.*)
paulson@2032
    43
    YM3  "[| evs: yahalom lost;  A ~= Server;
paulson@1985
    44
             Says B' Server 
paulson@2284
    45
                  {|Agent B, Crypt (shrK B) {|Agent A, Nonce NA, Nonce NB|}|}
paulson@1985
    46
               : set_of_list evs |]
paulson@1995
    47
          ==> Says Server A
paulson@2284
    48
                  {|Crypt (shrK A) {|Agent B, Key (newK evs), 
paulson@2284
    49
                            Nonce NA, Nonce NB|},
paulson@2284
    50
                    Crypt (shrK B) {|Agent A, Key (newK evs)|}|}
paulson@2032
    51
                 # evs : yahalom lost"
paulson@1985
    52
paulson@1995
    53
         (*Alice receives the Server's (?) message, checks her Nonce, and
paulson@1995
    54
           uses the new session key to send Bob his Nonce.*)
paulson@2125
    55
    YM4  "[| evs: yahalom lost;  A ~= Server;  A ~= B;  
paulson@2284
    56
             Says S A {|Crypt (shrK A) {|Agent B, Key K, Nonce NA, Nonce NB|},
paulson@2125
    57
                        X|}  : set_of_list evs;
paulson@1995
    58
             Says A B {|Agent A, Nonce NA|} : set_of_list evs |]
paulson@2284
    59
          ==> Says A B {|X, Crypt K (Nonce NB)|} # evs : yahalom lost"
paulson@1985
    60
paulson@2110
    61
         (*This message models possible leaks of session keys.  The Nonces
paulson@2156
    62
           identify the protocol run.  Quoting Server here ensures they are
paulson@2156
    63
           correct.*)
paulson@2125
    64
    Oops "[| evs: yahalom lost;  A ~= Spy;
paulson@2284
    65
             Says Server A {|Crypt (shrK A)
paulson@2284
    66
                                   {|Agent B, Key K, Nonce NA, Nonce NB|},
paulson@2125
    67
                             X|}  : set_of_list evs |]
paulson@2110
    68
          ==> Says A Spy {|Nonce NA, Nonce NB, Key K|} # evs : yahalom lost"
paulson@2110
    69
paulson@1985
    70
end