src/HOL/Auth/NS_Public_Bad.thy
author paulson
Fri Sep 05 12:24:13 1997 +0200 (1997-09-05)
changeset 3659 eddedfe2f3f8
parent 3541 2f5ac0f047a6
child 3683 aafe719dff14
permissions -rw-r--r--
Renamed "evs" to "evs1", "evs2", etc. in protocol inductive definition
paulson@2318
     1
(*  Title:      HOL/Auth/NS_Public_Bad
paulson@2318
     2
    ID:         $Id$
paulson@2318
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
paulson@2318
     4
    Copyright   1996  University of Cambridge
paulson@2318
     5
paulson@2318
     6
Inductive relation "ns_public" for the Needham-Schroeder Public-Key protocol.
paulson@2318
     7
Flawed version, vulnerable to Lowe's attack.
paulson@2318
     8
paulson@2318
     9
From page 260 of
paulson@2318
    10
  Burrows, Abadi and Needham.  A Logic of Authentication.
paulson@2318
    11
  Proc. Royal Soc. 426 (1989)
paulson@2318
    12
*)
paulson@2318
    13
paulson@2318
    14
NS_Public_Bad = Public + 
paulson@2318
    15
paulson@3519
    16
consts  ns_public  :: event list set
paulson@2549
    17
paulson@2318
    18
inductive ns_public
paulson@2318
    19
  intrs 
paulson@2318
    20
         (*Initial trace is empty*)
paulson@2318
    21
    Nil  "[]: ns_public"
paulson@2318
    22
paulson@2318
    23
         (*The spy MAY say anything he CAN say.  We do not expect him to
paulson@2318
    24
           invent new nonces here, but he can also use NS1.  Common to
paulson@2318
    25
           all similar protocols.*)
paulson@2318
    26
    Fake "[| evs: ns_public;  B ~= Spy;  
paulson@3519
    27
             X: synth (analz (sees Spy evs)) |]
paulson@2318
    28
          ==> Says Spy B X  # evs : ns_public"
paulson@2318
    29
paulson@2318
    30
         (*Alice initiates a protocol run, sending a nonce to Bob*)
paulson@3659
    31
    NS1  "[| evs1: ns_public;  A ~= B;  Nonce NA ~: used evs1 |]
paulson@2497
    32
          ==> Says A B (Crypt (pubK B) {|Nonce NA, Agent A|})
paulson@3659
    33
                # evs1  :  ns_public"
paulson@2318
    34
paulson@2318
    35
         (*Bob responds to Alice's message with a further nonce*)
paulson@3659
    36
    NS2  "[| evs2: ns_public;  A ~= B;  Nonce NB ~: used evs2;
paulson@3659
    37
             Says A' B (Crypt (pubK B) {|Nonce NA, Agent A|}) : set evs2 |]
paulson@2497
    38
          ==> Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB|})
paulson@3659
    39
                # evs2  :  ns_public"
paulson@2318
    40
paulson@2318
    41
         (*Alice proves her existence by sending NB back to Bob.*)
paulson@3659
    42
    NS3  "[| evs3: ns_public;
paulson@3659
    43
             Says A  B (Crypt (pubK B) {|Nonce NA, Agent A|}) : set evs3;
paulson@3659
    44
             Says B' A (Crypt (pubK A) {|Nonce NA, Nonce NB|}) : set evs3 |]
paulson@3659
    45
          ==> Says A B (Crypt (pubK B) (Nonce NB)) # evs3 : ns_public"
paulson@2318
    46
paulson@2318
    47
  (**Oops message??**)
paulson@2318
    48
paulson@2318
    49
end