src/HOL/Auth/NS_Public.thy
author paulson
Mon Jul 14 12:47:21 1997 +0200 (1997-07-14)
changeset 3519 ab0a9fbed4c0
parent 3466 30791e5a69c4
child 3541 2f5ac0f047a6
permissions -rw-r--r--
Changing "lost" from a parameter of protocol definitions to a constant.

Advantages: no "lost" argument everywhere; fewer Vars in subgoals;
less need for specially instantiated rules
Disadvantage: can no longer prove "Agent_not_see_encrypted_key", but this
theorem was never used, and its original proof was also broken
the introduction of the "Notes" constructor.
paulson@2318
     1
(*  Title:      HOL/Auth/NS_Public
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@2538
     7
Version incorporating Lowe's fix (inclusion of B's identity in round 2).
paulson@2318
     8
*)
paulson@2318
     9
paulson@2318
    10
NS_Public = Public + 
paulson@2318
    11
paulson@3519
    12
consts  ns_public  :: event list set
paulson@2549
    13
paulson@2318
    14
inductive ns_public
paulson@2318
    15
  intrs 
paulson@2318
    16
         (*Initial trace is empty*)
paulson@2318
    17
    Nil  "[]: ns_public"
paulson@2318
    18
paulson@2318
    19
         (*The spy MAY say anything he CAN say.  We do not expect him to
paulson@2318
    20
           invent new nonces here, but he can also use NS1.  Common to
paulson@2318
    21
           all similar protocols.*)
paulson@2318
    22
    Fake "[| evs: ns_public;  B ~= Spy;  
paulson@3519
    23
             X: synth (analz (sees Spy evs)) |]
paulson@2318
    24
          ==> Says Spy B X  # evs : ns_public"
paulson@2318
    25
paulson@2318
    26
         (*Alice initiates a protocol run, sending a nonce to Bob*)
paulson@2497
    27
    NS1  "[| evs: ns_public;  A ~= B;  Nonce NA ~: used evs |]
paulson@2497
    28
          ==> Says A B (Crypt (pubK B) {|Nonce NA, Agent A|})
paulson@2451
    29
                 # evs  :  ns_public"
paulson@2318
    30
paulson@2318
    31
         (*Bob responds to Alice's message with a further nonce*)
paulson@2497
    32
    NS2  "[| evs: ns_public;  A ~= B;  Nonce NB ~: used evs;
paulson@3466
    33
             Says A' B (Crypt (pubK B) {|Nonce NA, Agent A|}) : set evs |]
paulson@2497
    34
          ==> Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|})
paulson@2451
    35
                # evs  :  ns_public"
paulson@2318
    36
paulson@2318
    37
         (*Alice proves her existence by sending NB back to Bob.*)
paulson@2318
    38
    NS3  "[| evs: ns_public;  A ~= B;
nipkow@3465
    39
             Says A  B (Crypt (pubK B) {|Nonce NA, Agent A|}) : set evs;
paulson@2516
    40
             Says B' A (Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|})
nipkow@3465
    41
               : set evs |]
paulson@2318
    42
          ==> Says A B (Crypt (pubK B) (Nonce NB)) # evs : ns_public"
paulson@2318
    43
paulson@2318
    44
  (**Oops message??**)
paulson@2318
    45
paulson@2318
    46
end