2318
|
1 |
(* Title: HOL/Auth/NS_Public
|
|
2 |
ID: $Id$
|
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory
|
|
4 |
Copyright 1996 University of Cambridge
|
|
5 |
|
|
6 |
Inductive relation "ns_public" for the Needham-Schroeder Public-Key protocol.
|
|
7 |
Version incorporating Lowe's fix (inclusion of B's identify in round 2).
|
|
8 |
*)
|
|
9 |
|
|
10 |
NS_Public = Public +
|
|
11 |
|
|
12 |
consts lost :: agent set (*No need for it to be a variable*)
|
|
13 |
ns_public :: event list set
|
|
14 |
inductive ns_public
|
|
15 |
intrs
|
|
16 |
(*Initial trace is empty*)
|
|
17 |
Nil "[]: ns_public"
|
|
18 |
|
|
19 |
(*The spy MAY say anything he CAN say. We do not expect him to
|
|
20 |
invent new nonces here, but he can also use NS1. Common to
|
|
21 |
all similar protocols.*)
|
|
22 |
Fake "[| evs: ns_public; B ~= Spy;
|
|
23 |
X: synth (analz (sees lost Spy evs)) |]
|
|
24 |
==> Says Spy B X # evs : ns_public"
|
|
25 |
|
|
26 |
(*Alice initiates a protocol run, sending a nonce to Bob*)
|
|
27 |
NS1 "[| evs: ns_public; A ~= B |]
|
|
28 |
==> Says A B (Crypt (pubK B) {|Nonce (newN evs), Agent A|}) # evs
|
|
29 |
: ns_public"
|
|
30 |
|
|
31 |
(*Bob responds to Alice's message with a further nonce*)
|
|
32 |
NS2 "[| evs: ns_public; A ~= B;
|
|
33 |
Says A' B (Crypt (pubK B) {|Nonce NA, Agent A|})
|
|
34 |
: set_of_list evs |]
|
|
35 |
==> Says B A (Crypt (pubK A) {|Nonce NA, Nonce (newN evs), Agent B|})
|
|
36 |
# evs : ns_public"
|
|
37 |
|
|
38 |
(*Alice proves her existence by sending NB back to Bob.*)
|
|
39 |
NS3 "[| evs: ns_public; A ~= B;
|
|
40 |
Says B' A (Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|})
|
|
41 |
: set_of_list evs;
|
|
42 |
Says A B (Crypt (pubK B) {|Nonce NA, Agent A|})
|
|
43 |
: set_of_list evs |]
|
|
44 |
==> Says A B (Crypt (pubK B) (Nonce NB)) # evs : ns_public"
|
|
45 |
|
|
46 |
(**Oops message??**)
|
|
47 |
|
|
48 |
rules
|
|
49 |
(*Spy has access to his own key for spoof messages*)
|
|
50 |
Spy_in_lost "Spy: lost"
|
|
51 |
|
|
52 |
end
|