src/HOL/Auth/Recur.ML
author paulson
Tue, 07 Jan 1997 16:29:43 +0100
changeset 2485 c4368c967c56
parent 2481 ee461c8bc9c3
child 2516 4d68fbe6378b
permissions -rw-r--r--
Simplification of some proofs, especially by eliminating the equality in RA2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     1
(*  Title:      HOL/Auth/Recur
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     2
    ID:         $Id$
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     4
    Copyright   1996  University of Cambridge
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     5
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     6
Inductive relation "recur" for the Recursive Authentication protocol.
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     7
*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     8
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     9
open Recur;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    10
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    11
proof_timing:=true;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    12
HOL_quantifiers := false;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    13
Pretty.setdepth 25;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    14
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    15
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    16
(** Possibility properties: traces that reach the end 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    17
	ONE theorem would be more elegant and faster!
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    18
	By induction on a list of agents (no repetitions)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    19
**)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    20
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    21
(*Simplest case: Alice goes directly to the server*)
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
    22
goal thy
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    23
 "!!A. A ~= Server   \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    24
\ ==> EX K NA. EX evs: recur lost.          \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    25
\     Says Server A {|Agent A,              \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    26
\                     Crypt (shrK A) {|Key K, Agent Server, Nonce NA|}, \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    27
\                       Agent Server|}      \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    28
\         : set_of_list evs";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    29
by (REPEAT (resolve_tac [exI,bexI] 1));
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
    30
by (rtac (recur.Nil RS recur.RA1 RS 
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
    31
	  (respond.One RSN (4,recur.RA3))) 2);
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
    32
by (REPEAT
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
    33
    (ALLGOALS (asm_simp_tac (!simpset setsolver safe_solver))
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
    34
     THEN
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
    35
     REPEAT_FIRST (eq_assume_tac ORELSE' resolve_tac [refl, conjI])));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    36
result();
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    37
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    38
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    39
(*Case two: Alice, Bob and the server*)
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
    40
goal thy
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    41
 "!!A B. [| A ~= B; A ~= Server; B ~= Server |]   \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    42
\ ==> EX K. EX NA. EX evs: recur lost.          \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    43
\       Says B A {|Agent A, Crypt (shrK A) {|Key K, Agent B, Nonce NA|}, \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    44
\                       Agent Server|}                          \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    45
\         : set_of_list evs";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    46
by (REPEAT (resolve_tac [exI,bexI] 1));
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
    47
by (rtac (recur.Nil RS recur.RA1 RS recur.RA2 RS 
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
    48
	  (respond.One RS respond.Cons RSN (4,recur.RA3)) RS
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
    49
	  recur.RA4) 2);
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
    50
bw HPair_def;
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    51
by (REPEAT
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    52
    (REPEAT_FIRST (eq_assume_tac ORELSE' resolve_tac [refl, conjI])
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    53
     THEN
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    54
     ALLGOALS (asm_simp_tac (!simpset setsolver safe_solver))));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    55
result();
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    56
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    57
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    58
(*Case three: Alice, Bob, Charlie and the server*)
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
    59
goal thy
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    60
 "!!A B. [| A ~= B; A ~= Server; B ~= Server |]   \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    61
\ ==> EX K. EX NA. EX evs: recur lost.          \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    62
\       Says B A {|Agent A, Crypt (shrK A) {|Key K, Agent B, Nonce NA|}, \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    63
\                       Agent Server|}                          \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    64
\         : set_of_list evs";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    65
by (REPEAT (resolve_tac [exI,bexI] 1));
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
    66
by (rtac (recur.Nil RS recur.RA1 RS recur.RA2 RS recur.RA2 RS 
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    67
	  (respond.One RS respond.Cons RS respond.Cons RSN
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
    68
	   (4,recur.RA3)) RS recur.RA4 RS recur.RA4) 2);
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
    69
bw HPair_def;
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    70
by (REPEAT	(*SLOW: 37 seconds*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    71
    (REPEAT_FIRST (eq_assume_tac ORELSE' resolve_tac [refl, conjI])
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    72
     THEN
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    73
     ALLGOALS (asm_simp_tac (!simpset setsolver safe_solver))));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    74
by (ALLGOALS 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    75
    (SELECT_GOAL (DEPTH_SOLVE
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    76
		  (swap_res_tac [refl, conjI, disjI1, disjI2] 1 APPEND 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    77
		   etac not_sym 1))));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    78
result();
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    79
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    80
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    81
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    82
(**** Inductive proofs about recur ****)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    83
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    84
(*Monotonicity*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    85
goal thy "!!evs. lost' <= lost ==> recur lost' <= recur lost";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    86
by (rtac subsetI 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    87
by (etac recur.induct 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    88
by (REPEAT_FIRST
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    89
    (best_tac (!claset addIs (impOfSubs (sees_mono RS analz_mono RS synth_mono)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    90
                              :: recur.intrs))));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    91
qed "recur_mono";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    92
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    93
(*Nobody sends themselves messages*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    94
goal thy "!!evs. evs : recur lost ==> ALL A X. Says A A X ~: set_of_list evs";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    95
by (etac recur.induct 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    96
by (Auto_tac());
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    97
qed_spec_mp "not_Says_to_self";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    98
Addsimps [not_Says_to_self];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    99
AddSEs   [not_Says_to_self RSN (2, rev_notE)];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   100
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   101
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   102
(*Simple inductive reasoning about responses*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   103
goal thy "!!j. (j,PA,RB) : respond i ==> RB : responses i";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   104
by (etac respond.induct 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   105
by (REPEAT (ares_tac responses.intrs 1));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   106
qed "respond_imp_responses";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   107
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   108
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   109
(** For reasoning about the encrypted portion of messages **)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   110
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   111
val RA2_analz_sees_Spy = Says_imp_sees_Spy RS analz.Inj |> standard;
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   112
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   113
goal thy "!!evs. Says C' B {|Agent B, X, Agent B, X', RA|} : set_of_list evs \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   114
\                ==> RA : analz (sees lost Spy evs)";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   115
by (fast_tac (!claset addSDs [Says_imp_sees_Spy RS analz.Inj]) 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   116
qed "RA4_analz_sees_Spy";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   117
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   118
(*RA2_analz... and RA4_analz... let us treat those cases using the same 
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   119
  argument as for the Fake case.  This is possible for most, but not all,
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   120
  proofs: Fake does not invent new nonces (as in RA2), and of course Fake
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   121
  messages originate from the Spy. *)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   122
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   123
bind_thm ("RA2_parts_sees_Spy",
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   124
          RA2_analz_sees_Spy RS (impOfSubs analz_subset_parts));
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   125
bind_thm ("RA4_parts_sees_Spy",
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   126
          RA4_analz_sees_Spy RS (impOfSubs analz_subset_parts));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   127
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   128
(*We instantiate the variable to "lost".  Leaving it as a Var makes proofs
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   129
  harder to complete, since simplification does less for us.*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   130
val parts_Fake_tac = 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   131
    let val tac = forw_inst_tac [("lost","lost")] 
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   132
    in  tac RA2_parts_sees_Spy 4              THEN
2485
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   133
        etac subst 4 (*RA2: DELETE needless definition of PA!*)  THEN
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   134
	forward_tac [respond_imp_responses] 5 THEN
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   135
	tac RA4_parts_sees_Spy 6
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   136
    end;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   137
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   138
(*For proving the easier theorems about X ~: parts (sees lost Spy evs) *)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   139
fun parts_induct_tac i = SELECT_GOAL
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   140
    (DETERM (etac recur.induct 1 THEN parts_Fake_tac THEN
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   141
             (*Fake message*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   142
             TRY (best_tac (!claset addDs [impOfSubs analz_subset_parts,
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   143
                                           impOfSubs Fake_parts_insert]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   144
                                    addss (!simpset)) 2)) THEN
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   145
     (*Base case*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   146
     fast_tac (!claset addss (!simpset)) 1 THEN
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   147
     ALLGOALS Asm_simp_tac) i;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   148
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   149
(** Theorems of the form X ~: parts (sees lost Spy evs) imply that NOBODY
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   150
    sends messages containing X! **)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   151
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   152
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   153
(** Spy never sees another agent's long-term key (unless initially lost) **)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   154
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   155
goal thy 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   156
 "!!evs. (j,PB,RB) : respond i \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   157
\  ==> Key K : parts {RB} --> (EX j'. K = newK2(i,j') & j<=j')";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   158
be respond.induct 1;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   159
by (Auto_tac());
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   160
by (best_tac (!claset addDs [Suc_leD]) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   161
qed_spec_mp "Key_in_parts_respond";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   162
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   163
goal thy 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   164
 "!!evs. evs : recur lost \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   165
\        ==> (Key (shrK A) : parts (sees lost Spy evs)) = (A : lost)";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   166
by (parts_induct_tac 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   167
(*RA2*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   168
by (best_tac (!claset addSEs partsEs addSDs [parts_cut]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   169
                      addss (!simpset)) 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   170
(*RA3*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   171
by (fast_tac (!claset addDs [Key_in_parts_respond]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   172
                      addss (!simpset addsimps [parts_insert_sees])) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   173
qed "Spy_see_shrK";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   174
Addsimps [Spy_see_shrK];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   175
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   176
goal thy 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   177
 "!!evs. evs : recur lost \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   178
\        ==> (Key (shrK A) : analz (sees lost Spy evs)) = (A : lost)";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   179
by (auto_tac(!claset addDs [impOfSubs analz_subset_parts], !simpset));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   180
qed "Spy_analz_shrK";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   181
Addsimps [Spy_analz_shrK];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   182
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   183
goal thy  "!!A. [| Key (shrK A) : parts (sees lost Spy evs);       \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   184
\                  evs : recur lost |] ==> A:lost";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   185
by (fast_tac (!claset addDs [Spy_see_shrK]) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   186
qed "Spy_see_shrK_D";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   187
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   188
bind_thm ("Spy_analz_shrK_D", analz_subset_parts RS subsetD RS Spy_see_shrK_D);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   189
AddSDs [Spy_see_shrK_D, Spy_analz_shrK_D];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   190
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   191
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   192
(*** Future keys can't be seen or used! ***)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   193
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   194
(*Nobody can have SEEN keys that will be generated in the future. *)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   195
goal thy "!!evs. evs : recur lost ==> \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   196
\                length evs <= i -->   \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   197
\                Key (newK2(i,j)) ~: parts (sees lost Spy evs)";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   198
by (parts_induct_tac 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   199
(*RA2*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   200
by (best_tac (!claset addSEs partsEs 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   201
	              addSDs [parts_cut]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   202
                      addDs  [Suc_leD]
2485
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   203
                      addss  (!simpset)) 3);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   204
(*Fake*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   205
by (best_tac (!claset addDs [impOfSubs analz_subset_parts,
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   206
			     impOfSubs parts_insert_subset_Un,
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   207
			     Suc_leD]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   208
		      addss (!simpset)) 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   209
(*For RA3*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   210
by (asm_simp_tac (!simpset addsimps [parts_insert_sees]) 2);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   211
(*RA1-RA4*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   212
by (REPEAT (best_tac (!claset addDs [Key_in_parts_respond, Suc_leD]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   213
		              addss (!simpset)) 1));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   214
qed_spec_mp "new_keys_not_seen";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   215
Addsimps [new_keys_not_seen];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   216
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   217
(*Variant: old messages must contain old keys!*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   218
goal thy 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   219
 "!!evs. [| Says A B X : set_of_list evs;     \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   220
\           Key (newK2(i,j)) : parts {X};     \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   221
\           evs : recur lost                 \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   222
\        |] ==> i < length evs";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   223
by (rtac ccontr 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   224
by (dtac leI 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   225
by (fast_tac (!claset addSDs [new_keys_not_seen, Says_imp_sees_Spy]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   226
                      addIs  [impOfSubs parts_mono]) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   227
qed "Says_imp_old_keys";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   228
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   229
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   230
(*** Future nonces can't be seen or used! ***)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   231
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   232
goal thy 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   233
 "!!evs. (j, PB, RB) : respond i \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   234
\        ==> Nonce N : parts {RB} --> Nonce N : parts {PB}";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   235
be respond.induct 1;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   236
by (Auto_tac());
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   237
qed_spec_mp "Nonce_in_parts_respond";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   238
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   239
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   240
goal thy "!!i. evs : recur lost ==> \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   241
\              length evs <= i --> Nonce(newN i) ~: parts (sees lost Spy evs)";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   242
by (parts_induct_tac 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   243
(*For RA3*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   244
by (asm_simp_tac (!simpset addsimps [parts_insert_sees]) 4);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   245
by (deepen_tac (!claset addSDs [Says_imp_sees_Spy RS parts.Inj]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   246
                        addDs  [Nonce_in_parts_respond, parts_cut, Suc_leD]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   247
			addss (!simpset)) 0 4);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   248
(*Fake*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   249
by (fast_tac (!claset addDs  [impOfSubs analz_subset_parts,
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   250
			      impOfSubs parts_insert_subset_Un,
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   251
			      Suc_leD]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   252
		      addss (!simpset)) 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   253
(*RA1, RA2, RA4*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   254
by (REPEAT_FIRST  (fast_tac (!claset 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   255
                              addSEs partsEs
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   256
                              addEs [leD RS notE]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   257
                              addDs [Suc_leD]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   258
                              addss (!simpset))));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   259
qed_spec_mp "new_nonces_not_seen";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   260
Addsimps [new_nonces_not_seen];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   261
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   262
(*Variant: old messages must contain old nonces!*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   263
goal thy "!!evs. [| Says A B X : set_of_list evs;    \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   264
\                   Nonce (newN i) : parts {X};      \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   265
\                   evs : recur lost                 \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   266
\                |] ==> i < length evs";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   267
by (rtac ccontr 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   268
by (dtac leI 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   269
by (fast_tac (!claset addSDs [new_nonces_not_seen, Says_imp_sees_Spy]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   270
                      addIs  [impOfSubs parts_mono]) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   271
qed "Says_imp_old_nonces";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   272
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   273
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   274
(** Nobody can have USED keys that will be generated in the future. **)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   275
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   276
goal thy
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   277
 "!!evs. (j,PB,RB) : respond i \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   278
\        ==> K : keysFor (parts {RB}) --> (EX A. K = shrK A)";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   279
be (respond_imp_responses RS responses.induct) 1;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   280
by (Auto_tac());
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   281
qed_spec_mp "Key_in_keysFor_parts_respond";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   282
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   283
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   284
goal thy "!!i. evs : recur lost ==>          \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   285
\       length evs <= i --> newK2(i,j) ~: keysFor (parts (sees lost Spy evs))";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   286
by (parts_induct_tac 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   287
(*RA3*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   288
by (fast_tac (!claset addDs  [Key_in_keysFor_parts_respond, Suc_leD]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   289
		      addss  (!simpset addsimps [parts_insert_sees])) 4);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   290
(*RA2*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   291
by (fast_tac (!claset addSEs partsEs 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   292
	              addDs  [Suc_leD] addss (!simpset)) 3);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   293
(*Fake, RA1, RA4*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   294
by (REPEAT 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   295
    (best_tac
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   296
      (!claset addDs [impOfSubs (analz_subset_parts RS keysFor_mono),
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   297
                      impOfSubs (parts_insert_subset_Un RS keysFor_mono),
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   298
                      Suc_leD]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   299
               addEs [new_keys_not_seen RS not_parts_not_analz RSN(2,rev_notE)]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   300
               addss (!simpset)) 1));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   301
qed_spec_mp "new_keys_not_used";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   302
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   303
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   304
bind_thm ("new_keys_not_analzd",
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   305
          [analz_subset_parts RS keysFor_mono,
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   306
           new_keys_not_used] MRS contra_subsetD);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   307
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   308
Addsimps [new_keys_not_used, new_keys_not_analzd];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   309
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   310
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   311
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   312
(*** Proofs involving analz ***)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   313
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   314
(*For proofs involving analz.  We again instantiate the variable to "lost".*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   315
val analz_Fake_tac = 
2485
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   316
    etac subst 4 (*RA2: DELETE needless definition of PA!*)  THEN
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   317
    dres_inst_tac [("lost","lost")] RA2_analz_sees_Spy 4 THEN 
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   318
    forward_tac [respond_imp_responses] 5                THEN
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   319
    dres_inst_tac [("lost","lost")] RA4_analz_sees_Spy 6;
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   320
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   321
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   322
Delsimps [image_insert];
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   323
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   324
(** Session keys are not used to encrypt other session keys **)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   325
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   326
(*Version for "responses" relation.  Handles case RA3 in the theorem below.  
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   327
  Note that it holds for *any* set H (not just "sees lost Spy evs")
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   328
  satisfying the inductive hypothesis.*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   329
goal thy  
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   330
 "!!evs. [| RB : responses i;                             \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   331
\           ALL K I. (Key K : analz (Key``(newK``I) Un H)) = \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   332
\           (K : newK``I | Key K : analz H) |]                \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   333
\       ==> ALL K I. (Key K : analz (insert RB (Key``(newK``I) Un H))) = \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   334
\           (K : newK``I | Key K : analz (insert RB H))";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   335
be responses.induct 1;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   336
by (ALLGOALS
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   337
    (asm_simp_tac 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   338
     (!simpset addsimps [insert_Key_singleton, insert_Key_image, 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   339
			 Un_assoc RS sym, pushKey_newK]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   340
               setloop split_tac [expand_if])));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   341
by (fast_tac (!claset addIs [image_eqI] addss (!simpset)) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   342
qed "resp_analz_image_newK_lemma";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   343
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   344
(*Version for the protocol.  Proof is almost trivial, thanks to the lemma.*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   345
goal thy  
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   346
 "!!evs. evs : recur lost ==>                                            \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   347
\  ALL K I. (Key K : analz (Key``(newK``I) Un (sees lost Spy evs))) = \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   348
\           (K : newK``I | Key K : analz (sees lost Spy evs))";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   349
by (etac recur.induct 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   350
by analz_Fake_tac;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   351
by (REPEAT_FIRST (ares_tac [allI, analz_image_newK_lemma]));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   352
by (ALLGOALS (asm_simp_tac (!simpset addsimps [resp_analz_image_newK_lemma])));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   353
(*Base*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   354
by (fast_tac (!claset addIs [image_eqI] addss (!simpset)) 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   355
(*RA4, RA2, Fake*) 
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   356
by (REPEAT (spy_analz_tac 1));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   357
val raw_analz_image_newK = result();
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   358
qed_spec_mp "analz_image_newK";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   359
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   360
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   361
(*Instance of the lemma with H replaced by (sees lost Spy evs):
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   362
   [| RB : responses i;  evs : recur lost |]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   363
   ==> Key xa : analz (insert RB (Key``newK``x Un sees lost Spy evs)) =
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   364
       (xa : newK``x | Key xa : analz (insert RB (sees lost Spy evs))) 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   365
*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   366
bind_thm ("resp_analz_image_newK",
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   367
	  raw_analz_image_newK RSN
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   368
	    (2, resp_analz_image_newK_lemma) RS spec RS spec);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   369
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   370
goal thy
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   371
 "!!evs. evs : recur lost ==>                               \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   372
\        Key K : analz (insert (Key (newK x)) (sees lost Spy evs)) = \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   373
\        (K = newK x | Key K : analz (sees lost Spy evs))";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   374
by (asm_simp_tac (HOL_ss addsimps [pushKey_newK, analz_image_newK, 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   375
                                   insert_Key_singleton]) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   376
by (Fast_tac 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   377
qed "analz_insert_Key_newK";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   378
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   379
2485
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   380
(*This is more general than proving Hash_new_nonces_not_seen: we don't prove
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   381
  that "future nonces" can't be hashed, but that everything that's hashed is
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   382
  already in past traffic. *)
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   383
goal thy "!!i. [| evs : recur lost;  A ~: lost |] ==>              \
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   384
\              Hash {|Key(shrK A), X|} : parts (sees lost Spy evs) -->  \
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   385
\              X : parts (sees lost Spy evs)";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   386
be recur.induct 1;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   387
by parts_Fake_tac;
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   388
(*RA3 requires a further induction*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   389
be responses.induct 5;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   390
by (ALLGOALS Asm_simp_tac);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   391
(*Fake*)
2485
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   392
by (best_tac (!claset addDs [impOfSubs analz_subset_parts,
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   393
			     impOfSubs Fake_parts_insert]
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   394
	              addss (!simpset addsimps [parts_insert_sees])) 2);
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   395
(*Two others*)
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   396
by (REPEAT (fast_tac (!claset addss (!simpset)) 1));
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   397
bind_thm ("Hash_imp_body", result() RSN (2, rev_mp));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   398
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   399
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   400
(** The Nonce NA uniquely identifies A's message. 
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   401
    This theorem applies to rounds RA1 and RA2!
2455
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   402
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   403
  Unicity is not used in other proofs but is desirable in its own right.
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   404
**)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   405
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   406
goal thy 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   407
 "!!evs. [| evs : recur lost; A ~: lost |]               \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   408
\ ==> EX B' P'. ALL B P.    \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   409
\        Hash {|Key(shrK A), Agent A, Agent B, Nonce NA, P|} \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   410
\          : parts (sees lost Spy evs)  -->  B=B' & P=P'";
2485
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   411
by (parts_induct_tac 1);
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   412
be responses.induct 3;
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   413
by (ALLGOALS (simp_tac (!simpset addsimps [all_conj_distrib]))); 
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   414
by (step_tac (!claset addSEs partsEs) 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   415
(*RA1: creation of new Nonce.  Move assertion into global context*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   416
by (expand_case_tac "NA = ?y" 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   417
by (best_tac (!claset addSIs [exI]
2485
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   418
                      addSDs [Hash_imp_body]
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   419
		      addSEs (new_nonces_not_seen::partsEs)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   420
		      addss (!simpset)) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   421
by (best_tac (!claset addss  (!simpset)) 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   422
(*RA2: creation of new Nonce*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   423
by (expand_case_tac "NA = ?y" 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   424
by (best_tac (!claset addSIs [exI]
2485
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   425
		      addSDs [Hash_imp_body]
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   426
		      addSEs (new_nonces_not_seen::partsEs)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   427
		      addss  (!simpset)) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   428
by (best_tac (!claset addss  (!simpset)) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   429
val lemma = result();
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   430
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   431
goalw thy [HPair_def]
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   432
 "!!evs.[| HPair (Key(shrK A)) {|Agent A, Agent B, Nonce NA, P|}   \
2485
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   433
\            : parts (sees lost Spy evs);                          \
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   434
\          HPair (Key(shrK A)) {|Agent A, Agent B', Nonce NA, P'|} \
2485
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   435
\            : parts (sees lost Spy evs);                          \
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   436
\          evs : recur lost;  A ~: lost |]                         \
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   437
\        ==> B=B' & P=P'";
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   438
by (REPEAT (eresolve_tac partsEs 1));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   439
by (prove_unique_tac lemma 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   440
qed "unique_NA";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   441
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   442
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   443
(*** Lemmas concerning the Server's response
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   444
      (relations "respond" and "responses") 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   445
***)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   446
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   447
goal thy
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   448
 "!!evs. [| RB : responses i;  evs : recur lost |] \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   449
\ ==> (Key (shrK B) : analz (insert RB (sees lost Spy evs))) = (B:lost)";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   450
be responses.induct 1;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   451
by (ALLGOALS
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   452
    (asm_simp_tac 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   453
     (!simpset addsimps [resp_analz_image_newK, insert_Key_singleton]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   454
               setloop split_tac [expand_if])));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   455
qed "shrK_in_analz_respond";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   456
Addsimps [shrK_in_analz_respond];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   457
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   458
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   459
goal thy  
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   460
 "!!evs. [| RB : responses i;                             \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   461
\           ALL K I. (Key K : analz (Key``(newK``I) Un H)) = \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   462
\           (K : newK``I | Key K : analz H) |]                \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   463
\       ==> (Key K : analz (insert RB H)) --> \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   464
\                  (Key K : parts{RB} | Key K : analz H)";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   465
be responses.induct 1;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   466
by (ALLGOALS
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   467
    (asm_simp_tac 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   468
     (!simpset addsimps [read_instantiate [("H", "?ff``?xx")] parts_insert,
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   469
			 resp_analz_image_newK_lemma,
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   470
			 insert_Key_singleton, insert_Key_image, 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   471
			 Un_assoc RS sym, pushKey_newK]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   472
               setloop split_tac [expand_if])));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   473
(*The "Message" simpset gives the standard treatment of "image"*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   474
by (simp_tac (simpset_of "Message") 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   475
by (fast_tac (!claset delrules [allE]) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   476
qed "resp_analz_insert_lemma";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   477
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   478
bind_thm ("resp_analz_insert",
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   479
	  raw_analz_image_newK RSN
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   480
	    (2, resp_analz_insert_lemma) RSN(2, rev_mp));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   481
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   482
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   483
(*The Server does not send such messages.  This theorem lets us avoid
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   484
  assuming B~=Server in RA4.*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   485
goal thy 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   486
 "!!evs. evs : recur lost       \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   487
\ ==> ALL C X Y P. Says Server C {|X, Agent Server, Agent C, Y, P|} \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   488
\                  ~: set_of_list evs";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   489
by (etac recur.induct 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   490
be (respond.induct) 5;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   491
by (Auto_tac());
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   492
qed_spec_mp "Says_Server_not";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   493
AddSEs [Says_Server_not RSN (2,rev_notE)];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   494
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   495
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   496
goal thy 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   497
 "!!i. (j,PB,RB) : respond i               \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   498
\  ==> EX A' B'. ALL A B N.                \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   499
\        Crypt (shrK A) {|Key K, Agent B, N|} : parts {RB} \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   500
\          -->   (A'=A & B'=B) | (A'=B & B'=A)";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   501
be respond.induct 1;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   502
by (ALLGOALS (asm_full_simp_tac (!simpset addsimps [all_conj_distrib]))); 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   503
(*Base case*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   504
by (Fast_tac 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   505
by (Step_tac 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   506
by (expand_case_tac "K = ?y" 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   507
by (best_tac (!claset addSIs [exI]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   508
                      addSEs partsEs
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   509
                      addDs [Key_in_parts_respond]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   510
                      addss (!simpset)) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   511
by (expand_case_tac "K = ?y" 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   512
by (REPEAT (ares_tac [exI] 2));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   513
by (ex_strip_tac 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   514
be respond.elim 1;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   515
by (REPEAT_FIRST (etac Pair_inject ORELSE' hyp_subst_tac));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   516
by (ALLGOALS (asm_full_simp_tac 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   517
	      (!simpset addsimps [all_conj_distrib, ex_disj_distrib]))); 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   518
by (Fast_tac 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   519
by (Fast_tac 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   520
val lemma = result();
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   521
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   522
goal thy 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   523
 "!!RB. [| Crypt (shrK A) {|Key K, Agent B, N|} : parts {RB};    \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   524
\          Crypt (shrK A') {|Key K, Agent B', N'|} : parts {RB};   \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   525
\          (j,PB,RB) : respond i |]               \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   526
\ ==>   (A'=A & B'=B) | (A'=B & B'=A)";
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   527
by (prove_unique_tac lemma 1);	(*50 seconds??, due to the disjunctions*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   528
qed "unique_session_keys";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   529
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   530
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   531
(** Crucial secrecy property: Spy does not see the keys sent in msg RA3
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   532
    Does not in itself guarantee security: an attack could violate 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   533
    the premises, e.g. by having A=Spy **)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   534
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   535
goal thy 
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   536
 "!!j. (j, HPair (Key(shrK A)) {|Agent A, B, NA, P|}, RA) : respond i \
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   537
\ ==> Crypt (shrK A) {|Key (newK2 (i,j)), B, NA|} : parts {RA}";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   538
be respond.elim 1;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   539
by (ALLGOALS Asm_full_simp_tac);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   540
qed "newK2_respond_lemma";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   541
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   542
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   543
goal thy 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   544
 "!!evs. [| (j,PB,RB) : respond (length evs);  evs : recur lost |]       \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   545
\        ==> ALL A A' N. A ~: lost & A' ~: lost -->  \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   546
\            Crypt (shrK A) {|Key K, Agent A', N|} : parts{RB} -->  \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   547
\            Key K ~: analz (insert RB (sees lost Spy evs))";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   548
be respond.induct 1;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   549
by (forward_tac [respond_imp_responses] 2);
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   550
by (ALLGOALS (*4 MINUTES???*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   551
    (asm_simp_tac 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   552
     (!simpset addsimps 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   553
	  ([analz_image_newK, not_parts_not_analz,
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   554
	    read_instantiate [("H", "?ff``?xx")] parts_insert,
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   555
	    Un_assoc RS sym, resp_analz_image_newK,
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   556
	    insert_Key_singleton, analz_insert_Key_newK])
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   557
      setloop split_tac [expand_if])));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   558
by (ALLGOALS (simp_tac (simpset_of "Message")));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   559
by (Fast_tac 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   560
by (step_tac (!claset addSEs [MPair_parts]) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   561
(** LEVEL 6 **)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   562
by (fast_tac (!claset addDs [resp_analz_insert, Key_in_parts_respond]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   563
                      addSEs [new_keys_not_seen RS not_parts_not_analz 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   564
			      RSN(2,rev_notE)]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   565
                      addss (!simpset)) 4);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   566
by (fast_tac (!claset addSDs [newK2_respond_lemma]) 3);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   567
by (best_tac (!claset addSEs partsEs
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   568
                      addDs [Key_in_parts_respond]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   569
                      addss (!simpset)) 2);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   570
by (thin_tac "ALL x.?P(x)" 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   571
be respond.elim 1;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   572
by (fast_tac (!claset addss (!simpset)) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   573
by (step_tac (!claset addss (!simpset)) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   574
by (best_tac (!claset addSEs partsEs
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   575
                      addDs [Key_in_parts_respond]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   576
                      addss (!simpset)) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   577
qed_spec_mp "respond_Spy_not_see_encrypted_key";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   578
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   579
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   580
goal thy
2455
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   581
 "!!evs. [| A ~: lost;  A' ~: lost;  evs : recur lost |]            \
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   582
\        ==> Says Server B RB : set_of_list evs -->                 \
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   583
\            Crypt (shrK A) {|Key K, Agent A', N|} : parts{RB} -->  \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   584
\            Key K ~: analz (sees lost Spy evs)";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   585
by (etac recur.induct 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   586
by analz_Fake_tac;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   587
by (ALLGOALS
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   588
    (asm_simp_tac
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   589
     (!simpset addsimps [not_parts_not_analz, analz_insert_Key_newK] 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   590
               setloop split_tac [expand_if])));
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   591
(*RA4*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   592
by (spy_analz_tac 4);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   593
(*Fake*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   594
by (spy_analz_tac 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   595
by (step_tac (!claset delrules [impCE]) 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   596
(*RA2*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   597
by (spy_analz_tac 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   598
(*RA3, case 2: K is an old key*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   599
by (fast_tac (!claset addSDs [resp_analz_insert]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   600
		      addSEs partsEs
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   601
                      addDs [Key_in_parts_respond]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   602
	              addEs [Says_imp_old_keys RS less_irrefl]) 2);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   603
(*RA3, case 1: use lemma previously proved by induction*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   604
by (fast_tac (!claset addSEs [respond_Spy_not_see_encrypted_key RSN
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   605
			      (2,rev_notE)]) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   606
bind_thm ("Spy_not_see_encrypted_key", result() RS mp RSN (2, rev_mp));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   607
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   608
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   609
goal thy 
2455
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   610
 "!!evs. [| Says Server B RB : set_of_list evs;                 \
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   611
\           Crypt (shrK A) {|Key K, Agent A', N|} : parts{RB};  \
2455
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   612
\           C ~: {A,A',Server};                                 \
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   613
\           A ~: lost;  A' ~: lost;  evs : recur lost |]        \
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   614
\        ==> Key K ~: analz (sees lost C evs)";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   615
by (rtac (subset_insertI RS sees_mono RS analz_mono RS contra_subsetD) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   616
by (rtac (sees_lost_agent_subset_sees_Spy RS analz_mono RS contra_subsetD) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   617
by (FIRSTGOAL (rtac Spy_not_see_encrypted_key));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   618
by (REPEAT_FIRST (fast_tac (!claset addIs [recur_mono RS subsetD])));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   619
qed "Agent_not_see_encrypted_key";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   620
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   621
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   622
(**** Authenticity properties for Agents ****)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   623
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   624
(*The response never contains Hashes*)
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   625
(*NEEDED????????????????*)
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   626
goal thy
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   627
 "!!evs. (j,PB,RB) : respond i \
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   628
\        ==> Hash {|Key (shrK B), M|} : parts (insert RB H) --> \
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   629
\            Hash {|Key (shrK B), M|} : parts H";
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   630
be (respond_imp_responses RS responses.induct) 1;
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   631
by (Auto_tac());
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   632
bind_thm ("Hash_in_parts_respond", result() RSN (2, rev_mp));
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   633
2455
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   634
(*NEEDED????????????????*)
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   635
(*Only RA1 or RA2 can have caused such a part of a message to appear.*)
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   636
goalw thy [HPair_def]
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   637
 "!!evs. [| Hash {|Key(shrK A), Agent A, Agent B, NA, P|}         \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   638
\             : parts (sees lost Spy evs);                        \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   639
\            A ~: lost;  evs : recur lost |]                        \
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   640
\        ==> Says A B (HPair (Key(shrK A)) {|Agent A, Agent B, NA, P|})  \
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   641
\             : set_of_list evs";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   642
be rev_mp 1;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   643
by (parts_induct_tac 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   644
(*RA3*)
2485
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   645
by (fast_tac (!claset addSDs [Hash_in_parts_respond]) 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   646
qed_spec_mp "Hash_auth_sender";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   647
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   648
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   649
val nonce_not_seen_now = le_refl RSN (2, new_nonces_not_seen) RSN (2,rev_notE);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   650
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   651
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   652
(** These two results should subsume (for all agents) the guarantees proved
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   653
    separately for A and B in the Otway-Rees protocol.
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   654
**)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   655
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   656
2455
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   657
(*Encrypted messages can only originate with the Server.*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   658
goal thy 
2455
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   659
 "!!evs. [| A ~: lost;  A ~= Spy;  evs : recur lost |]       \
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   660
\    ==> Crypt (shrK A) Y : parts (sees lost Spy evs)        \
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   661
\        --> (EX C RC. Says Server C RC : set_of_list evs &  \
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   662
\                      Crypt (shrK A) Y : parts {RC})";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   663
by (parts_induct_tac 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   664
(*RA4*)
2455
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   665
by (Fast_tac 4);
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   666
(*RA3*)
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   667
by (full_simp_tac (!simpset addsimps [parts_insert_sees]) 3
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   668
    THEN Fast_tac 3);
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   669
(*RA1*)
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   670
by (Fast_tac 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   671
(*RA2: it cannot be a new Nonce, contradiction.*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   672
by (deepen_tac (!claset delrules [impCE]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   673
                      addSIs [disjI2]
2455
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   674
                      addSEs [MPair_parts]
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   675
                      addDs  [parts_cut, parts.Body]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   676
                      addss  (!simpset)) 0 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   677
qed_spec_mp "Crypt_imp_Server_msg";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   678
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   679
2455
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   680
(*Corollary: if A receives B's message then the key came from the Server*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   681
goal thy 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   682
 "!!evs. [| Says B' A RA : set_of_list evs;                        \
2455
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   683
\           Crypt (shrK A) {|Key K, Agent A', NA|} : parts {RA};   \
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   684
\           A ~: lost;  A ~= Spy;  evs : recur lost |]             \
2455
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   685
\        ==> EX C RC. Says Server C RC : set_of_list evs &         \
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   686
\                       Crypt (shrK A) {|Key K, Agent A', NA|} : parts {RC}";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   687
by (best_tac (!claset addSIs [Crypt_imp_Server_msg]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   688
                      addDs  [Says_imp_sees_Spy RS parts.Inj RSN (2,parts_cut)]
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   689
                      addss  (!simpset)) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   690
qed "Agent_trust";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   691
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   692
2455
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   693
(*Overall guarantee: if A receives a certificant mentioning A'
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   694
  then the only other agent who knows the key is A'.*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   695
goal thy 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   696
 "!!evs. [| Says B' A RA : set_of_list evs;                           \
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   697
\           Crypt (shrK A) {|Key K, Agent A', NA|} : parts {RA};      \
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   698
\           C ~: {A,A',Server};                                       \
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   699
\           A ~: lost;  A' ~: lost;  A ~= Spy;  evs : recur lost |]   \
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   700
\        ==> Key K ~: analz (sees lost C evs)";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   701
by (dtac Agent_trust 1 THEN REPEAT_FIRST assume_tac);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   702
by (fast_tac (!claset addSEs [Agent_not_see_encrypted_key RSN(2,rev_notE)]) 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   703
qed "Agent_secrecy";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   704