src/HOL/Auth/KerberosIV.ML
author paulson
Fri, 23 Mar 2001 12:10:05 +0100
changeset 11222 72c5997e1145
parent 11204 bb01189f0565
child 11288 7fe6593133d4
permissions -rw-r--r--
shortening and streamlining of proofs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
     1
(*  Title:      HOL/Auth/KerberosIV
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
     2
    ID:         $Id$
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
     3
    Author:     Giampaolo Bella, Cambridge University Computer Laboratory
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
     4
    Copyright   1998  University of Cambridge
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
     5
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
     6
The Kerberos protocol, version IV.  Proofs streamlined by lcp.
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
     7
*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
     8
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
     9
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
    10
AddDs  [Says_imp_knows_Spy RS parts.Inj, parts.Body];
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
    11
AddDs  [impOfSubs analz_subset_parts, impOfSubs Fake_parts_insert];
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
    12
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    13
Pretty.setdepth 20;
9000
c20d58286a51 cleaned up;
wenzelm
parents: 8954
diff changeset
    14
set timing;
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    15
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    16
AddIffs [AuthLife_LB, ServLife_LB, AutcLife_LB, RespLife_LB, Tgs_not_bad];
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    17
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    18
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    19
(** Reversed traces **)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    20
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    21
Goal "spies (evs @ [Says A B X]) = insert X (spies evs)";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    22
by (induct_tac "evs" 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    23
by (induct_tac "a" 2);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    24
by Auto_tac;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    25
qed "spies_Says_rev";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    26
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    27
Goal "spies (evs @ [Gets A X]) = spies evs";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    28
by (induct_tac "evs" 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    29
by (induct_tac "a" 2);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    30
by Auto_tac;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    31
qed "spies_Gets_rev";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    32
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    33
Goal "spies (evs @ [Notes A X]) = \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    34
\         (if A:bad then insert X (spies evs) else spies evs)";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    35
by (induct_tac "evs" 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    36
by (induct_tac "a" 2);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    37
by Auto_tac;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    38
qed "spies_Notes_rev";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    39
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    40
Goal "spies evs = spies (rev evs)";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    41
by (induct_tac "evs" 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    42
by (induct_tac "a" 2);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    43
by (ALLGOALS 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    44
    (asm_simp_tac (simpset() addsimps [spies_Says_rev, spies_Gets_rev, 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    45
				       spies_Notes_rev])));
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    46
qed "spies_evs_rev";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    47
bind_thm ("parts_spies_evs_revD2", spies_evs_rev RS equalityD2 RS parts_mono);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    48
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    49
Goal "spies (takeWhile P evs)  <=  spies evs";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    50
by (induct_tac "evs" 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    51
by (induct_tac "a" 2);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    52
by Auto_tac;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    53
(* Resembles "used_subset_append" in Event.ML*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    54
qed "spies_takeWhile";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    55
bind_thm ("parts_spies_takeWhile_mono", spies_takeWhile RS parts_mono);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    56
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    57
Goal "~P(x) --> takeWhile P (xs @ [x]) = takeWhile P xs";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    58
by (induct_tac "xs" 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    59
by Auto_tac;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    60
qed "takeWhile_tail";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    61
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    62
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    63
(*****************LEMMAS ABOUT AuthKeys****************)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    64
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    65
Goalw [AuthKeys_def] "AuthKeys [] = {}";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    66
by (Simp_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    67
qed "AuthKeys_empty";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    68
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    69
Goalw [AuthKeys_def] 
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
    70
 "(\\<forall>A Tk akey Peer.              \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
    71
\  ev \\<noteq> Says Kas A (Crypt (shrK A) {|akey, Agent Peer, Tk,      \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    72
\             (Crypt (shrK Peer) {|Agent A, Agent Peer, akey, Tk|})|}))\ 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    73
\      ==> AuthKeys (ev # evs) = AuthKeys evs";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    74
by Auto_tac;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    75
qed "AuthKeys_not_insert";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    76
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    77
Goalw [AuthKeys_def] 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    78
  "AuthKeys \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    79
\    (Says Kas A (Crypt (shrK A) {|Key K, Agent Peer, Number Tk, \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    80
\     (Crypt (shrK Peer) {|Agent A, Agent Peer, Key K, Number Tk|})|}) # evs) \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    81
\      = insert K (AuthKeys evs)";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    82
by Auto_tac;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    83
qed "AuthKeys_insert";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    84
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    85
Goalw [AuthKeys_def] 
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
    86
   "K \\<in> AuthKeys \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    87
\   (Says Kas A (Crypt (shrK A) {|Key K', Agent Peer, Number Tk, \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    88
\    (Crypt (shrK Peer) {|Agent A, Agent Peer, Key K', Number Tk|})|}) # evs) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
    89
\       ==> K = K' | K \\<in> AuthKeys evs";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    90
by Auto_tac;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    91
qed "AuthKeys_simp";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    92
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    93
Goalw [AuthKeys_def]  
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    94
   "Says Kas A (Crypt (shrK A) {|Key K, Agent Tgs, Number Tk, \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
    95
\    (Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key K, Number Tk|})|}) \\<in> set evs \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
    96
\       ==> K \\<in> AuthKeys evs";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    97
by Auto_tac;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    98
qed "AuthKeysI";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
    99
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   100
Goalw [AuthKeys_def] "K \\<in> AuthKeys evs ==> Key K \\<in> used evs";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   101
by (Simp_tac 1);
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   102
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   103
qed "AuthKeys_used";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   104
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   105
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   106
(**** FORWARDING LEMMAS ****)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   107
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   108
(*--For reasoning about the encrypted portion of message K3--*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   109
Goal "Says Kas' A (Crypt KeyA {|AuthKey, Peer, Tk, AuthTicket|}) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   110
\              \\<in> set evs ==> AuthTicket \\<in> parts (spies evs)";
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   111
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   112
qed "K3_msg_in_parts_spies";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   113
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   114
Goal "Says Kas A (Crypt KeyA {|AuthKey, Peer, Tk, AuthTicket|}) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   115
\              \\<in> set evs ==> AuthKey \\<in> parts (spies evs)";
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   116
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   117
qed "Oops_parts_spies1";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   118
                              
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   119
Goal "[| Says Kas A (Crypt KeyA {|Key AuthKey, Peer, Tk, AuthTicket|}) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   120
\          \\<in> set evs ;\
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   121
\        evs \\<in> kerberos |] ==> AuthKey \\<notin> range shrK";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   122
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   123
by (etac kerberos.induct 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   124
by Auto_tac;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   125
qed "Oops_range_spies1";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   126
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   127
(*--For reasoning about the encrypted portion of message K5--*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   128
Goal "Says Tgs' A (Crypt AuthKey {|ServKey, Agent B, Tt, ServTicket|})\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   129
 \             \\<in> set evs ==> ServTicket \\<in> parts (spies evs)";
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   130
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   131
qed "K5_msg_in_parts_spies";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   132
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   133
Goal "Says Tgs A (Crypt AuthKey {|ServKey, Agent B, Tt, ServTicket|})\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   134
\                  \\<in> set evs ==> ServKey \\<in> parts (spies evs)";
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   135
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   136
qed "Oops_parts_spies2";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   137
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   138
Goal "[| Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Tt, ServTicket|}) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   139
\          \\<in> set evs ;\
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   140
\        evs \\<in> kerberos |] ==> ServKey \\<notin> range shrK";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   141
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   142
by (etac kerberos.induct 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   143
by Auto_tac;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   144
qed "Oops_range_spies2";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   145
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   146
Goal "Says S A (Crypt K {|SesKey, B, TimeStamp, Ticket|}) \\<in> set evs \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   147
\     ==> Ticket \\<in> parts (spies evs)";
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   148
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   149
qed "Says_ticket_in_parts_spies";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   150
(*Replaces both K3_msg_in_parts_spies and K5_msg_in_parts_spies*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   151
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   152
fun parts_induct_tac i = 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   153
    etac kerberos.induct i  THEN 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   154
    REPEAT (FIRSTGOAL analz_mono_contra_tac)  THEN
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
   155
    ftac K3_msg_in_parts_spies (i+4)  THEN
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
   156
    ftac K5_msg_in_parts_spies (i+6)  THEN
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
   157
    ftac Oops_parts_spies1 (i+8)  THEN
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
   158
    ftac Oops_parts_spies2 (i+9) THEN
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   159
    prove_simple_subgoals_tac 1;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   160
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   161
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   162
(*Spy never sees another agent's shared key! (unless it's lost at start)*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   163
Goal "evs \\<in> kerberos ==> (Key (shrK A) \\<in> parts (spies evs)) = (A \\<in> bad)";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   164
by (parts_induct_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   165
by (ALLGOALS Blast_tac);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   166
qed "Spy_see_shrK";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   167
Addsimps [Spy_see_shrK];
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   168
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   169
Goal "evs \\<in> kerberos ==> (Key (shrK A) \\<in> analz (spies evs)) = (A \\<in> bad)";
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   170
by Auto_tac;
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   171
qed "Spy_analz_shrK";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   172
Addsimps [Spy_analz_shrK];
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   173
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   174
Goal "[| Key (shrK A) \\<in> parts (spies evs);  evs \\<in> kerberos |] ==> A:bad";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   175
by (blast_tac (claset() addDs [Spy_see_shrK]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   176
qed "Spy_see_shrK_D";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   177
bind_thm ("Spy_analz_shrK_D", analz_subset_parts RS subsetD RS Spy_see_shrK_D);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   178
AddSDs [Spy_see_shrK_D, Spy_analz_shrK_D];
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   179
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   180
(*Nobody can have used non-existent keys!*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   181
Goal "evs \\<in> kerberos ==>      \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   182
\     Key K \\<notin> used evs --> K \\<notin> keysFor (parts (spies evs))";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   183
by (parts_induct_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   184
(*Fake*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   185
by (blast_tac (claset() addSDs [keysFor_parts_insert]) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   186
(*Others*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   187
by (ALLGOALS Blast_tac);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   188
qed_spec_mp "new_keys_not_used";
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   189
Addsimps [new_keys_not_used];
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   190
11204
bb01189f0565 minor tuning
paulson
parents: 11185
diff changeset
   191
(*Earlier, all protocol proofs declared this theorem.  
bb01189f0565 minor tuning
paulson
parents: 11185
diff changeset
   192
  But few of them actually need it! (Another is Yahalom) *)
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   193
bind_thm ("new_keys_not_analzd",
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   194
          [analz_subset_parts RS keysFor_mono,
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   195
           new_keys_not_used] MRS contra_subsetD);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   196
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   197
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   198
(*********************** REGULARITY LEMMAS ***********************)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   199
(*       concerning the form of items passed in messages         *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   200
(*****************************************************************)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   201
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   202
(*Describes the form of AuthKey, AuthTicket, and K sent by Kas*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   203
Goal "[| Says Kas A (Crypt K {|Key AuthKey, Agent Peer, Tk, AuthTicket|}) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   204
\          \\<in> set evs;                 \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   205
\        evs \\<in> kerberos |]             \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   206
\     ==> AuthKey \\<notin> range shrK & AuthKey \\<in> AuthKeys evs & \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   207
\ AuthTicket = (Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Tk|} ) &\
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   208
\            K = shrK A  & Peer = Tgs";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   209
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   210
by (etac kerberos.induct 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   211
by (ALLGOALS (simp_tac (simpset() addsimps [AuthKeys_def, AuthKeys_insert])));
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   212
by (ALLGOALS Blast_tac);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   213
qed "Says_Kas_message_form";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   214
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   215
(*This lemma is essential for proving Says_Tgs_message_form: 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   216
  
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   217
  the session key AuthKey
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   218
  supplied by Kas in the authentication ticket
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   219
  cannot be a long-term key!
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   220
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   221
  Generalised to any session keys (both AuthKey and ServKey).
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   222
*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   223
Goal "[| Crypt (shrK Tgs_B) {|Agent A, Agent Tgs_B, Key SesKey, Number T|}\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   224
\           \\<in> parts (spies evs); Tgs_B \\<notin> bad;\
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   225
\        evs \\<in> kerberos |]    \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   226
\     ==> SesKey \\<notin> range shrK";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   227
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   228
by (parts_induct_tac 1);
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   229
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   230
qed "SesKey_is_session_key";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   231
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   232
Goal "[| Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Tk|}  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   233
\          \\<in> parts (spies evs);                              \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   234
\        evs \\<in> kerberos |]                          \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   235
\     ==> Says Kas A (Crypt (shrK A) {|Key AuthKey, Agent Tgs, Tk, \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   236
\                Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Tk|}|})  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   237
\           \\<in> set evs";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   238
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   239
by (parts_induct_tac 1);
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   240
(*Fake, K4*)
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   241
by (ALLGOALS Blast_tac);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   242
qed "A_trusts_AuthTicket";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   243
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   244
Goal "[| Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Number Tk|}\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   245
\          \\<in> parts (spies evs);\
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   246
\        evs \\<in> kerberos |]    \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   247
\     ==> AuthKey \\<in> AuthKeys evs";
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
   248
by (ftac A_trusts_AuthTicket 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   249
by (assume_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   250
by (simp_tac (simpset() addsimps [AuthKeys_def]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   251
by (Blast_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   252
qed "AuthTicket_crypt_AuthKey";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   253
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   254
(*Describes the form of ServKey, ServTicket and AuthKey sent by Tgs*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   255
Goal "[| Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Tt, ServTicket|})\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   256
\          \\<in> set evs; \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   257
\        evs \\<in> kerberos |]    \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   258
\  ==> B \\<noteq> Tgs & ServKey \\<notin> range shrK & ServKey \\<notin> AuthKeys evs &\
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   259
\      ServTicket = (Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Tt|} ) & \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   260
\      AuthKey \\<notin> range shrK & AuthKey \\<in> AuthKeys evs";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   261
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   262
by (etac kerberos.induct 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   263
by (ALLGOALS
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   264
    (asm_full_simp_tac
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   265
     (simpset() addsimps [AuthKeys_insert, AuthKeys_not_insert,
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   266
			  AuthKeys_empty, AuthKeys_simp])));
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   267
by (blast_tac (claset()) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   268
by Auto_tac;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   269
by (blast_tac (claset() addSDs [AuthKeys_used, Says_Kas_message_form]) 1);
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   270
by (blast_tac (claset() addSDs [SesKey_is_session_key]) 1);
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   271
by (blast_tac (claset() addDs [AuthTicket_crypt_AuthKey]) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   272
qed "Says_Tgs_message_form";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   273
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   274
(*If a certain encrypted message appears then it originated with Kas*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   275
Goal "[| Crypt (shrK A) {|Key AuthKey, Peer, Tk, AuthTicket|}  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   276
\          \\<in> parts (spies evs);                              \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   277
\        A \\<notin> bad;  evs \\<in> kerberos |]                        \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   278
\     ==> Says Kas A (Crypt (shrK A) {|Key AuthKey, Peer, Tk, AuthTicket|})  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   279
\           \\<in> set evs";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   280
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   281
by (parts_induct_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   282
(*Fake*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   283
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   284
(*K4*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   285
by (blast_tac (claset() addSDs [A_trusts_AuthTicket RS Says_Kas_message_form])
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   286
    1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   287
qed "A_trusts_AuthKey";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   288
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   289
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   290
(*If a certain encrypted message appears then it originated with Tgs*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   291
Goal "[| Crypt AuthKey {|Key ServKey, Agent B, Tt, ServTicket|}     \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   292
\          \\<in> parts (spies evs);                                     \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   293
\        Key AuthKey \\<notin> analz (spies evs);           \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   294
\        AuthKey \\<notin> range shrK;                      \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   295
\        evs \\<in> kerberos |]         \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   296
\==> \\<exists>A. Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Tt, ServTicket|})\
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   297
\      \\<in> set evs";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   298
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   299
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   300
by (parts_induct_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   301
(*Fake*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   302
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   303
(*K2*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   304
by (Blast_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   305
(*K4*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   306
by Auto_tac;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   307
qed "A_trusts_K4";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   308
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   309
Goal "[| Crypt (shrK A) {|Key AuthKey, Agent Tgs, Tk, AuthTicket|} \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   310
\          \\<in> parts (spies evs);          \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   311
\        A \\<notin> bad;                       \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   312
\        evs \\<in> kerberos |]                \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   313
\   ==> AuthKey \\<notin> range shrK &               \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   314
\       AuthTicket = Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Tk|}";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   315
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   316
by (parts_induct_tac 1);
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   317
by (ALLGOALS Blast_tac);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   318
qed "AuthTicket_form";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   319
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   320
(* This form holds also over an AuthTicket, but is not needed below.     *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   321
Goal "[| Crypt AuthKey {|Key ServKey, Agent B, Tt, ServTicket|} \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   322
\             \\<in> parts (spies evs); \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   323
\           Key AuthKey \\<notin> analz (spies evs);  \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   324
\           evs \\<in> kerberos |]                                       \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   325
\        ==> ServKey \\<notin> range shrK &  \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   326
\   (\\<exists>A. ServTicket = Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Tt|})";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   327
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   328
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   329
by (parts_induct_tac 1);
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   330
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   331
qed "ServTicket_form";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   332
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   333
Goal "[| Says Kas' A (Crypt (shrK A) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   334
\             {|Key AuthKey, Agent Tgs, Tk, AuthTicket|} ) \\<in> set evs; \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   335
\        evs \\<in> kerberos |]    \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   336
\     ==> AuthKey \\<notin> range shrK & \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   337
\         AuthTicket = \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   338
\                 Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Tk|}\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   339
\         | AuthTicket \\<in> analz (spies evs)";
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   340
by (blast_tac (claset() addDs [Says_imp_spies RS analz.Inj, 
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   341
                               AuthTicket_form]) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   342
qed "Says_kas_message_form";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   343
(* Essentially the same as AuthTicket_form *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   344
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   345
Goal "[| Says Tgs' A (Crypt AuthKey \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   346
\             {|Key ServKey, Agent B, Tt, ServTicket|} ) \\<in> set evs; \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   347
\        evs \\<in> kerberos |]    \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   348
\     ==> ServKey \\<notin> range shrK & \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   349
\         (\\<exists>A. ServTicket = \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   350
\                 Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Tt|})  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   351
\          | ServTicket \\<in> analz (spies evs)";
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   352
by (blast_tac (claset() addDs [Says_imp_spies RS analz.Inj, 
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   353
                               ServTicket_form]) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   354
qed "Says_tgs_message_form";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   355
(* This form MUST be used in analz_sees_tac below *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   356
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   357
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   358
(*****************UNICITY THEOREMS****************)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   359
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   360
(* The session key, if secure, uniquely identifies the Ticket
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   361
   whether AuthTicket or ServTicket. As a matter of fact, one can read
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   362
   also Tgs in the place of B.                                     *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   363
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   364
Goal "[| Crypt (shrK B)  {|Agent A,  Agent B,  Key SesKey, T|}        \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   365
\          \\<in> parts (spies evs);            \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   366
\        Crypt (shrK B') {|Agent A', Agent B', Key SesKey, T'|}     \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   367
\          \\<in> parts (spies evs);  Key SesKey \\<notin> analz (spies evs);   \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   368
\        evs \\<in> kerberos |]  \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   369
\     ==> A=A' & B=B' & T=T'";
11104
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   370
by (etac rev_mp 1);
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   371
by (etac rev_mp 1);
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   372
by (etac rev_mp 1);
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   373
by (parts_induct_tac 1);
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   374
(*Fake, K2, K4*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   375
by (ALLGOALS Blast_tac); 
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   376
qed "unique_CryptKey";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   377
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   378
(*An AuthKey is encrypted by one and only one Shared key.
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   379
  A ServKey is encrypted by one and only one AuthKey.
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   380
*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   381
Goal "[| Crypt K  {|Key SesKey,  Agent B, T, Ticket|}        \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   382
\          \\<in> parts (spies evs);            \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   383
\        Crypt K' {|Key SesKey,  Agent B', T', Ticket'|}     \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   384
\          \\<in> parts (spies evs);  Key SesKey \\<notin> analz (spies evs);            \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   385
\        evs \\<in> kerberos |]  \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   386
\     ==> K=K' & B=B' & T=T' & Ticket=Ticket'";
11104
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   387
by (etac rev_mp 1);
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   388
by (etac rev_mp 1);
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   389
by (etac rev_mp 1);
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   390
by (parts_induct_tac 1);
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   391
(*Fake, K2, K4*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   392
by (ALLGOALS Blast_tac); 
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   393
qed "Key_unique_SesKey";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   394
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   395
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   396
(*
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   397
  At reception of any message mentioning A, Kas associates shrK A with
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   398
  a new AuthKey. Realistic, as the user gets a new AuthKey at each login.
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   399
  Similarly, at reception of any message mentioning an AuthKey
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   400
  (a legitimate user could make several requests to Tgs - by K3), Tgs 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   401
  associates it with a new ServKey.
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   402
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   403
  Therefore, a goal like
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   404
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   405
   "evs \\<in> kerberos \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   406
  \  ==> Key Kc \\<notin> analz (spies evs) -->   \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   407
  \        (\\<exists>K' B' T' Ticket'. \\<forall>K B T Ticket.                          \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   408
  \         Crypt Kc {|Key K, Agent B, T, Ticket|}    \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   409
  \          \\<in> parts (spies evs) --> K=K' & B=B' & T=T' & Ticket=Ticket')";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   410
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   411
  would fail on the K2 and K4 cases.
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   412
*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   413
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   414
Goal "[| Says Kas A                                          \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   415
\             (Crypt Ka {|Key AuthKey, Agent Tgs, Tk, X|}) \\<in> set evs;     \ 
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   416
\        Says Kas A'                                         \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   417
\             (Crypt Ka' {|Key AuthKey, Agent Tgs, Tk', X'|}) \\<in> set evs;   \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   418
\        evs \\<in> kerberos |] ==> A=A' & Ka=Ka' & Tk=Tk' & X=X'";
11104
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   419
by (etac rev_mp 1);
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   420
by (etac rev_mp 1);
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   421
by (parts_induct_tac 1);
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   422
(*K2*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   423
by (Blast_tac 1); 
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   424
qed "unique_AuthKeys";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   425
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   426
(* ServKey uniquely identifies the message from Tgs *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   427
Goal "[| Says Tgs A                                             \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   428
\             (Crypt K {|Key ServKey, Agent B, Tt, X|}) \\<in> set evs; \ 
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   429
\        Says Tgs A'                                                 \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   430
\             (Crypt K' {|Key ServKey, Agent B', Tt', X'|}) \\<in> set evs; \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   431
\        evs \\<in> kerberos |] ==> A=A' & B=B' & K=K' & Tt=Tt' & X=X'";
11104
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   432
by (etac rev_mp 1);
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   433
by (etac rev_mp 1);
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   434
by (parts_induct_tac 1);
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   435
(*K4*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   436
by (Blast_tac 1); 
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   437
qed "unique_ServKeys";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   438
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   439
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   440
(*****************LEMMAS ABOUT the predicate KeyCryptKey****************)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   441
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   442
Goalw [KeyCryptKey_def] "~ KeyCryptKey AuthKey ServKey []";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   443
by (Simp_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   444
qed "not_KeyCryptKey_Nil";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   445
AddIffs [not_KeyCryptKey_Nil];
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   446
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   447
Goalw [KeyCryptKey_def]
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   448
 "[| Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, tt, X |}) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   449
\             \\<in> set evs;    \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   450
\           evs \\<in> kerberos |] ==> KeyCryptKey AuthKey ServKey evs";
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   451
by (blast_tac (claset() addDs [Says_Tgs_message_form]) 1); 
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   452
qed "KeyCryptKeyI";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   453
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   454
Goalw [KeyCryptKey_def]
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   455
   "KeyCryptKey AuthKey ServKey (Says S A X # evs) =                       \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   456
\    (Tgs = S &                                                            \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   457
\     (\\<exists>B tt. X = Crypt AuthKey        \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   458
\               {|Key ServKey, Agent B, tt,  \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   459
\                 Crypt (shrK B) {|Agent A, Agent B, Key ServKey, tt|} |}) \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   460
\    | KeyCryptKey AuthKey ServKey evs)";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   461
by (Simp_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   462
by (Blast_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   463
qed "KeyCryptKey_Says";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   464
Addsimps [KeyCryptKey_Says];
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   465
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   466
(*A fresh AuthKey cannot be associated with any other
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   467
  (with respect to a given trace). *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   468
Goalw [KeyCryptKey_def]
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   469
 "[| Key AuthKey \\<notin> used evs; evs \\<in> kerberos |] \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   470
\        ==> ~ KeyCryptKey AuthKey ServKey evs";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   471
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   472
by (parts_induct_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   473
by (Asm_full_simp_tac 1);
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   474
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   475
qed "Auth_fresh_not_KeyCryptKey";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   476
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   477
(*A fresh ServKey cannot be associated with any other
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   478
  (with respect to a given trace). *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   479
Goalw [KeyCryptKey_def]
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   480
 "Key ServKey \\<notin> used evs ==> ~ KeyCryptKey AuthKey ServKey evs";
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   481
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   482
qed "Serv_fresh_not_KeyCryptKey";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   483
11204
bb01189f0565 minor tuning
paulson
parents: 11185
diff changeset
   484
Goal
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   485
 "[| Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, tk|}\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   486
\             \\<in> parts (spies evs);  evs \\<in> kerberos |] \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   487
\        ==> ~ KeyCryptKey K AuthKey evs";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   488
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   489
by (parts_induct_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   490
(*K4*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   491
by (Blast_tac 3);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   492
(*K2: by freshness*)
11204
bb01189f0565 minor tuning
paulson
parents: 11185
diff changeset
   493
by (asm_full_simp_tac (simpset() addsimps [KeyCryptKey_def]) 2); 
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   494
by (ALLGOALS Blast_tac); 
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   495
qed "AuthKey_not_KeyCryptKey";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   496
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   497
(*A secure serverkey cannot have been used to encrypt others*)
11204
bb01189f0565 minor tuning
paulson
parents: 11185
diff changeset
   498
Goal
bb01189f0565 minor tuning
paulson
parents: 11185
diff changeset
   499
 "[| Crypt (shrK B) {|Agent A, Agent B, Key SK, tt|} \\<in> parts (spies evs); \
bb01189f0565 minor tuning
paulson
parents: 11185
diff changeset
   500
\    Key SK \\<notin> analz (spies evs);             \
bb01189f0565 minor tuning
paulson
parents: 11185
diff changeset
   501
\    B \\<noteq> Tgs;  evs \\<in> kerberos |] \
bb01189f0565 minor tuning
paulson
parents: 11185
diff changeset
   502
\ ==> ~ KeyCryptKey SK K evs";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   503
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   504
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   505
by (parts_induct_tac 1);
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   506
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   507
(*K4 splits into distinct subcases*)
11204
bb01189f0565 minor tuning
paulson
parents: 11185
diff changeset
   508
by Auto_tac;  
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   509
(*ServKey can't have been enclosed in two certificates*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   510
by (blast_tac (claset() addDs [unique_CryptKey]) 2);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   511
(*ServKey is fresh and so could not have been used, by new_keys_not_used*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   512
by (force_tac (claset() addSDs [Crypt_imp_invKey_keysFor],
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   513
	       simpset() addsimps [KeyCryptKey_def]) 1); 
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   514
qed "ServKey_not_KeyCryptKey";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   515
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   516
(*Long term keys are not issued as ServKeys*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   517
Goalw [KeyCryptKey_def]
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   518
 "evs \\<in> kerberos ==> ~ KeyCryptKey K (shrK A) evs";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   519
by (parts_induct_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   520
qed "shrK_not_KeyCryptKey";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   521
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   522
(*The Tgs message associates ServKey with AuthKey and therefore not with any 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   523
  other key AuthKey.*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   524
Goalw [KeyCryptKey_def]
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   525
 "[| Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, tt, X |}) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   526
\      \\<in> set evs;                                         \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   527
\    AuthKey' \\<noteq> AuthKey;  evs \\<in> kerberos |]                      \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   528
\ ==> ~ KeyCryptKey AuthKey' ServKey evs";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   529
by (blast_tac (claset() addDs [unique_ServKeys]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   530
qed "Says_Tgs_KeyCryptKey";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   531
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   532
Goal "[| KeyCryptKey AuthKey ServKey evs;  evs \\<in> kerberos |] \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   533
\     ==> ~ KeyCryptKey ServKey K evs";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   534
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   535
by (parts_induct_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   536
by (Step_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   537
by (ALLGOALS Asm_full_simp_tac);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   538
(*K4 splits into subcases*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   539
by (blast_tac (claset() addSDs [AuthKey_not_KeyCryptKey]) 4);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   540
(*ServKey is fresh and so could not have been used, by new_keys_not_used*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   541
by (force_tac (claset() addSDs [Says_imp_spies RS parts.Inj,
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   542
				Crypt_imp_invKey_keysFor],
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   543
               simpset() addsimps [KeyCryptKey_def]) 2); 
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   544
(*Others by freshness*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   545
by (ALLGOALS Blast_tac);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   546
qed "KeyCryptKey_not_KeyCryptKey";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   547
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   548
(*The only session keys that can be found with the help of session keys are
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   549
  those sent by Tgs in step K4.  *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   550
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   551
(*We take some pains to express the property
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   552
  as a logical equivalence so that the simplifier can apply it.*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   553
Goal "P --> (Key K \\<in> analz (Key`KK Un H)) --> (K:KK | Key K \\<in> analz H)  \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   554
\     ==>       \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   555
\     P --> (Key K \\<in> analz (Key`KK Un H)) = (K:KK | Key K \\<in> analz H)";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   556
by (blast_tac (claset() addIs [impOfSubs analz_mono]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   557
qed "Key_analz_image_Key_lemma";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   558
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   559
Goal "[| KeyCryptKey K K' evs; evs \\<in> kerberos |] \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   560
\     ==> Key K' \\<in> analz (insert (Key K) (spies evs))";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   561
by (full_simp_tac (simpset() addsimps [KeyCryptKey_def]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   562
by (Clarify_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   563
by (dresolve_tac [Says_imp_spies RS analz.Inj RS analz_insertI] 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   564
by Auto_tac;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   565
qed "KeyCryptKey_analz_insert";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   566
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   567
Goal "[| K \\<in> AuthKeys evs Un range shrK;  evs \\<in> kerberos |]  \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   568
\     ==> \\<forall>SK. ~ KeyCryptKey SK K evs";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   569
by (asm_full_simp_tac (simpset() addsimps [KeyCryptKey_def]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   570
by (blast_tac (claset() addDs [Says_Tgs_message_form]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   571
qed "AuthKeys_are_not_KeyCryptKey";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   572
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   573
Goal "[| K \\<notin> AuthKeys evs; \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   574
\        K \\<notin> range shrK; evs \\<in> kerberos |]  \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   575
\     ==> \\<forall>SK. ~ KeyCryptKey K SK evs";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   576
by (asm_full_simp_tac (simpset() addsimps [KeyCryptKey_def]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   577
by (blast_tac (claset() addDs [Says_Tgs_message_form]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   578
qed "not_AuthKeys_not_KeyCryptKey";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   579
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   580
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   581
(*****************SECRECY THEOREMS****************)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   582
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   583
(*For proofs involving analz.*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   584
val analz_sees_tac = 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   585
  EVERY 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   586
   [REPEAT (FIRSTGOAL analz_mono_contra_tac),
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
   587
    ftac Oops_range_spies2 10, 
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
   588
    ftac Oops_range_spies1 9, 
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
   589
    ftac Says_tgs_message_form 7,
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
   590
    ftac Says_kas_message_form 5, 
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   591
    REPEAT_FIRST (eresolve_tac [asm_rl, conjE, disjE, exE]
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   592
		  ORELSE' hyp_subst_tac)];
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   593
8954
4fbdda40bb5f rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents: 8741
diff changeset
   594
(*For the Oops2 case of the next theorem*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   595
Goal "[| evs \\<in> kerberos;  \
8954
4fbdda40bb5f rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents: 8741
diff changeset
   596
\        Says Tgs A (Crypt AuthKey \
4fbdda40bb5f rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents: 8741
diff changeset
   597
\                    {|Key ServKey, Agent B, Number Tt, ServTicket|}) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   598
\          \\<in> set evs |] \
8954
4fbdda40bb5f rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents: 8741
diff changeset
   599
\     ==> ~ KeyCryptKey ServKey SK evs";
4fbdda40bb5f rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents: 8741
diff changeset
   600
by (blast_tac (claset() addDs [KeyCryptKeyI, KeyCryptKey_not_KeyCryptKey]) 1);
4fbdda40bb5f rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents: 8741
diff changeset
   601
qed "Oops2_not_KeyCryptKey";
4fbdda40bb5f rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents: 8741
diff changeset
   602
4fbdda40bb5f rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents: 8741
diff changeset
   603
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   604
(* Big simplification law for keys SK that are not crypted by keys in KK   *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   605
(* It helps prove three, otherwise hard, facts about keys. These facts are *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   606
(* exploited as simplification laws for analz, and also "limit the damage" *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   607
(* in case of loss of a key to the spy. See ESORICS98.                     *)
8954
4fbdda40bb5f rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents: 8741
diff changeset
   608
(* [simplified by LCP]                                                     *)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   609
Goal "evs \\<in> kerberos ==>                                         \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   610
\     (\\<forall>SK KK. KK <= -(range shrK) -->                   \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   611
\     (\\<forall>K \\<in> KK. ~ KeyCryptKey K SK evs)   -->           \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   612
\     (Key SK \\<in> analz (Key`KK Un (spies evs))) =        \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   613
\     (SK \\<in> KK | Key SK \\<in> analz (spies evs)))";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   614
by (etac kerberos.induct 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   615
by analz_sees_tac;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   616
by (REPEAT_FIRST (rtac allI));
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   617
by (REPEAT_FIRST (rtac (Key_analz_image_Key_lemma RS impI)));
8954
4fbdda40bb5f rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents: 8741
diff changeset
   618
(*Case-splits for Oops1 & 5: the negated case simplifies using the ind hyp*)
4fbdda40bb5f rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents: 8741
diff changeset
   619
by (case_tac "KeyCryptKey AuthKey SK evsO1" 11); 
4fbdda40bb5f rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents: 8741
diff changeset
   620
by (case_tac "KeyCryptKey ServKey SK evs5" 8);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   621
by (ALLGOALS  
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   622
    (asm_simp_tac 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   623
     (analz_image_freshK_ss addsimps
8954
4fbdda40bb5f rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents: 8741
diff changeset
   624
        [KeyCryptKey_Says, shrK_not_KeyCryptKey, Oops2_not_KeyCryptKey,
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   625
	 Auth_fresh_not_KeyCryptKey, Serv_fresh_not_KeyCryptKey, 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   626
	 Says_Tgs_KeyCryptKey, Spy_analz_shrK])));
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   627
(*Fake*) 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   628
by (spy_analz_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   629
(* Base + K2 done by the simplifier! *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   630
(*K3*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   631
by (Blast_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   632
(*K4*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   633
by (blast_tac (claset() addSDs [AuthKey_not_KeyCryptKey]) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   634
(*K5*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   635
by (case_tac "Key ServKey \\<in> analz (spies evs5)" 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   636
(*If ServKey is compromised then the result follows directly...*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   637
by (asm_simp_tac 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   638
     (simpset() addsimps [analz_insert_eq, 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   639
			 impOfSubs (Un_upper2 RS analz_mono)]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   640
(*...therefore ServKey is uncompromised.*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   641
(*The KeyCryptKey ServKey SK evs5 case leads to a contradiction.*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   642
by (blast_tac (claset() addSEs [ServKey_not_KeyCryptKey RSN(2, rev_notE)]
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   643
		        delrules [allE, ballE]) 1);
8954
4fbdda40bb5f rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents: 8741
diff changeset
   644
(** Level 13: Oops1 **)
4fbdda40bb5f rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents: 8741
diff changeset
   645
by (Asm_full_simp_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   646
by (blast_tac (claset() addSDs [KeyCryptKey_analz_insert]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   647
qed_spec_mp "Key_analz_image_Key";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   648
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   649
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   650
(* First simplification law for analz: no session keys encrypt  *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   651
(* authentication keys or shared keys.                          *)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   652
Goal "[| evs \\<in> kerberos;  K \\<in> (AuthKeys evs) Un range shrK;      \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   653
\        SesKey \\<notin> range shrK |]                                 \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   654
\     ==> Key K \\<in> analz (insert (Key SesKey) (spies evs)) = \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   655
\         (K = SesKey | Key K \\<in> analz (spies evs))";
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
   656
by (ftac AuthKeys_are_not_KeyCryptKey 1 THEN assume_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   657
by (asm_full_simp_tac (analz_image_freshK_ss addsimps [Key_analz_image_Key]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   658
qed "analz_insert_freshK1";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   659
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   660
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   661
(* Second simplification law for analz: no service keys encrypt *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   662
(* any other keys.					        *)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   663
Goal "[| evs \\<in> kerberos;  ServKey \\<notin> (AuthKeys evs); ServKey \\<notin> range shrK|]\
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   664
\     ==> Key K \\<in> analz (insert (Key ServKey) (spies evs)) = \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   665
\         (K = ServKey | Key K \\<in> analz (spies evs))";
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
   666
by (ftac not_AuthKeys_not_KeyCryptKey 1 
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   667
    THEN assume_tac 1
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   668
    THEN assume_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   669
by (asm_full_simp_tac (analz_image_freshK_ss addsimps [Key_analz_image_Key]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   670
qed "analz_insert_freshK2";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   671
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   672
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   673
(* Third simplification law for analz: only one authentication key *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   674
(* encrypts a certain service key.                                 *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   675
Goal  
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   676
 "[| Says Tgs A    \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   677
\           (Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|}) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   678
\             \\<in> set evs;          \ 
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   679
\           AuthKey \\<noteq> AuthKey'; AuthKey' \\<notin> range shrK; evs \\<in> kerberos |]    \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   680
\       ==> Key ServKey \\<in> analz (insert (Key AuthKey') (spies evs)) =  \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   681
\               (ServKey = AuthKey' | Key ServKey \\<in> analz (spies evs))";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   682
by (dres_inst_tac [("AuthKey'","AuthKey'")] Says_Tgs_KeyCryptKey 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   683
by (Blast_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   684
by (assume_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   685
by (asm_full_simp_tac (analz_image_freshK_ss addsimps [Key_analz_image_Key]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   686
qed "analz_insert_freshK3";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   687
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   688
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   689
(*a weakness of the protocol*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   690
Goal "[| Says Tgs A    \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   691
\             (Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|}) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   692
\          \\<in> set evs;          \ 
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   693
\        Key AuthKey \\<in> analz (spies evs); evs \\<in> kerberos |]    \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   694
\     ==> Key ServKey \\<in> analz (spies evs)";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   695
by (force_tac (claset() addDs [Says_imp_spies RS analz.Inj RS 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   696
			       analz.Decrypt RS analz.Fst],
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   697
	       simpset()) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   698
qed "AuthKey_compromises_ServKey";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   699
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   700
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   701
(********************** Guarantees for Kas *****************************)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   702
Goal "[| Crypt AuthKey {|Key ServKey, Agent B, Tt, \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   703
\                     Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Tt|}|}\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   704
\          \\<in> parts (spies evs); \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   705
\        Key ServKey \\<notin> analz (spies evs);                          \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   706
\        B \\<noteq> Tgs; evs \\<in> kerberos |]                            \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   707
\     ==> ServKey \\<notin> AuthKeys evs";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   708
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   709
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   710
by (asm_full_simp_tac (simpset() addsimps [AuthKeys_def]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   711
by (parts_induct_tac 1);
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   712
by (ALLGOALS Blast_tac);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   713
bind_thm ("ServKey_notin_AuthKeys", result() RSN (2, rev_notE));
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   714
bind_thm ("ServKey_notin_AuthKeysD", result());
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   715
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   716
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   717
(** If Spy sees the Authentication Key sent in msg K2, then 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   718
    the Key has expired  **)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   719
Goal "[| A \\<notin> bad;  evs \\<in> kerberos |]           \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   720
\     ==> Says Kas A                             \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   721
\              (Crypt (shrK A)                      \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   722
\                 {|Key AuthKey, Agent Tgs, Number Tk,     \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   723
\         Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Number Tk|}|})\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   724
\           \\<in> set evs -->                 \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   725
\         Key AuthKey \\<in> analz (spies evs) -->                       \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   726
\         ExpirAuth Tk evs";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   727
by (etac kerberos.induct 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   728
by analz_sees_tac;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   729
by (ALLGOALS 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   730
    (asm_simp_tac 
8741
61bc5ed22b62 removal of less_SucI, le_SucI from default simpset
paulson
parents: 7499
diff changeset
   731
     (simpset() addsimps ([Says_Kas_message_form, less_SucI,
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   732
			   analz_insert_eq, not_parts_not_analz, 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   733
			   analz_insert_freshK1] @ pushes))));
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   734
(*Fake*) 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   735
by (spy_analz_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   736
(*K2*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   737
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   738
(*K4*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   739
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   740
(*Level 8: K5*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   741
by (blast_tac (claset() addEs [ServKey_notin_AuthKeys]
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   742
                        addDs [Says_Kas_message_form]
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   743
                        addIs [less_SucI]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   744
(*Oops1*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   745
by (blast_tac (claset() addSDs [unique_AuthKeys] addIs [less_SucI]) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   746
(*Oops2*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   747
by (blast_tac (claset() addDs [Says_Tgs_message_form,
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   748
                               Says_Kas_message_form]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   749
val lemma = result() RS mp RS mp RSN(1,rev_notE);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   750
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   751
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   752
Goal "[| Says Kas A                                             \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   753
\             (Crypt Ka {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|})  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   754
\          \\<in> set evs;                                \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   755
\        ~ ExpirAuth Tk evs;                         \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   756
\        A \\<notin> bad;  evs \\<in> kerberos |]            \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   757
\     ==> Key AuthKey \\<notin> analz (spies evs)";
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   758
by (blast_tac (claset() addDs [Says_Kas_message_form, lemma]) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   759
qed "Confidentiality_Kas";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   760
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   761
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   762
(********************** Guarantees for Tgs *****************************)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   763
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   764
(** If Spy sees the Service Key sent in msg K4, then 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   765
    the Key has expired  **)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   766
Goal "[| A \\<notin> bad;  B \\<notin> bad; B \\<noteq> Tgs; evs \\<in> kerberos |]           \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   767
\  ==> Key AuthKey \\<notin> analz (spies evs) --> \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   768
\      Says Tgs A            \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   769
\        (Crypt AuthKey                      \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   770
\           {|Key ServKey, Agent B, Number Tt,     \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   771
\             Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|}|})\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   772
\        \\<in> set evs -->                 \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   773
\      Key ServKey \\<in> analz (spies evs) -->                       \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   774
\      ExpirServ Tt evs";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   775
by (etac kerberos.induct 1);
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   776
(*The Oops1 case is unusual: must simplify Authkey \\<notin> analz (spies (ev#evs))
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   777
  rather than weakening it to Authkey \\<notin> analz (spies evs), for we then
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   778
  conclude AuthKey \\<noteq> AuthKeya.*)
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   779
by (Clarify_tac 9);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   780
by analz_sees_tac;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   781
by (rotate_tac ~1 11);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   782
by (ALLGOALS 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   783
    (asm_full_simp_tac 
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   784
     (simpset() addsimps [less_SucI, new_keys_not_analzd,
8741
61bc5ed22b62 removal of less_SucI, le_SucI from default simpset
paulson
parents: 7499
diff changeset
   785
			  Says_Kas_message_form, Says_Tgs_message_form,
61bc5ed22b62 removal of less_SucI, le_SucI from default simpset
paulson
parents: 7499
diff changeset
   786
			  analz_insert_eq, not_parts_not_analz, 
61bc5ed22b62 removal of less_SucI, le_SucI from default simpset
paulson
parents: 7499
diff changeset
   787
			  analz_insert_freshK1, analz_insert_freshK2] 
61bc5ed22b62 removal of less_SucI, le_SucI from default simpset
paulson
parents: 7499
diff changeset
   788
			 @ pushes)));
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   789
(*Fake*) 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   790
by (spy_analz_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   791
(*K2*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   792
by (blast_tac (claset()
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   793
            addIs [parts_insertI, less_SucI]) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   794
(*K4*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   795
by (blast_tac (claset() addDs [A_trusts_AuthTicket, Confidentiality_Kas]) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   796
by (ALLGOALS Clarify_tac);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   797
(*Oops2*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   798
by (blast_tac (claset() addDs [Says_imp_spies RS parts.Inj, 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   799
                               Key_unique_SesKey] addIs [less_SucI]) 3);
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   800
(** Level 10 **)
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   801
(*Oops1*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   802
by (blast_tac (claset() addDs [analz_insert_freshK3,
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   803
			       Says_Kas_message_form, Says_Tgs_message_form] 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   804
                        addIs  [less_SucI]) 2);
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   805
(*K5*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   806
by (thin_tac "Says Aa Tgs ?X \\<in> set ?evs" 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   807
by (forward_tac [Says_imp_spies RS parts.Inj RS ServKey_notin_AuthKeysD] 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   808
by (assume_tac 1 THEN Blast_tac 1 THEN assume_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   809
by (rotate_tac ~1 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   810
by (asm_full_simp_tac (simpset() addsimps [analz_insert_freshK2]) 1);
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   811
by (blast_tac (claset() addDs [Says_imp_spies RS parts.Inj, Key_unique_SesKey] 
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   812
                        addIs  [less_SucI]) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   813
val lemma = result() RS mp RS mp RS mp RSN(1,rev_notE);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   814
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   815
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   816
(* In the real world Tgs can't check wheter AuthKey is secure! *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   817
Goal 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   818
 "[| Says Tgs A      \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   819
\             (Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|}) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   820
\             \\<in> set evs;              \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   821
\           Key AuthKey \\<notin> analz (spies evs);        \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   822
\           ~ ExpirServ Tt evs;                         \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   823
\           A \\<notin> bad;  B \\<notin> bad; B \\<noteq> Tgs; evs \\<in> kerberos |]            \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   824
\        ==> Key ServKey \\<notin> analz (spies evs)";
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   825
by (blast_tac (claset() addDs [Says_Tgs_message_form, lemma]) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   826
qed "Confidentiality_Tgs1";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   827
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   828
(* In the real world Tgs CAN check what Kas sends! *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   829
Goal 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   830
 "[| Says Kas A                                             \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   831
\              (Crypt Ka {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|})  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   832
\             \\<in> set evs;                                \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   833
\           Says Tgs A      \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   834
\             (Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|}) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   835
\             \\<in> set evs;              \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   836
\           ~ ExpirAuth Tk evs; ~ ExpirServ Tt evs;                         \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   837
\           A \\<notin> bad;  B \\<notin> bad; B \\<noteq> Tgs; evs \\<in> kerberos |]            \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   838
\        ==> Key ServKey \\<notin> analz (spies evs)";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   839
by (blast_tac (claset() addSDs [Confidentiality_Kas,
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   840
                                Confidentiality_Tgs1]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   841
qed "Confidentiality_Tgs2";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   842
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   843
(*Most general form*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   844
val Confidentiality_Tgs3 = A_trusts_AuthTicket RS Confidentiality_Tgs2;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   845
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   846
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   847
(********************** Guarantees for Alice *****************************)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   848
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   849
val Confidentiality_Auth_A = A_trusts_AuthKey RS Confidentiality_Kas;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   850
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   851
Goal
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   852
 "[| Says Kas A \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   853
\      (Crypt (shrK A) {|Key AuthKey, Agent Tgs, Tk, AuthTicket|}) \\<in> set evs;\
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   854
\    Crypt AuthKey {|Key ServKey, Agent B, Tt, ServTicket|}     \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   855
\      \\<in> parts (spies evs);                                       \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   856
\    Key AuthKey \\<notin> analz (spies evs);            \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   857
\    evs \\<in> kerberos |]         \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   858
\==> Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Tt, ServTicket|})\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   859
\      \\<in> set evs";
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
   860
by (ftac Says_Kas_message_form 1 THEN assume_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   861
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   862
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   863
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   864
by (parts_induct_tac 1);
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   865
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   866
(*K2 and K4 remain*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   867
by (blast_tac (claset() addSDs [unique_CryptKey]) 2);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   868
by (blast_tac (claset() addSDs [A_trusts_K4, Says_Tgs_message_form, 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   869
				AuthKeys_used]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   870
qed "A_trusts_K4_bis";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   871
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   872
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   873
Goal "[| Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|}  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   874
\          \\<in> parts (spies evs);                              \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   875
\        Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|}     \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   876
\          \\<in> parts (spies evs);                                       \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   877
\        ~ ExpirAuth Tk evs; ~ ExpirServ Tt evs;                         \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   878
\        A \\<notin> bad;  B \\<notin> bad; B \\<noteq> Tgs; evs \\<in> kerberos |]            \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   879
\     ==> Key ServKey \\<notin> analz (spies evs)";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   880
by (dtac A_trusts_AuthKey 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   881
by (assume_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   882
by (assume_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   883
by (blast_tac (claset() addDs [Confidentiality_Kas, 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   884
                               Says_Kas_message_form,
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   885
                               A_trusts_K4_bis, Confidentiality_Tgs2]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   886
qed "Confidentiality_Serv_A";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   887
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   888
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   889
(********************** Guarantees for Bob *****************************)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   890
(* Theorems for the refined model have suffix "refined"                *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   891
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   892
Goal
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   893
"[| Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|})\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   894
\            \\<in> set evs; evs \\<in> kerberos|]  \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   895
\  ==> \\<exists>Tk. Says Kas A (Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk,\
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   896
\          Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Number Tk|}|})\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   897
\            \\<in> set evs";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   898
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   899
by (parts_induct_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   900
by Auto_tac;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   901
by (blast_tac (claset() addSDs [Says_imp_spies RS parts.Inj RS parts.Fst RS
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   902
                               A_trusts_AuthTicket]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   903
qed "K4_imp_K2";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   904
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   905
Goal
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   906
"[| Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|})\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   907
\     \\<in> set evs; evs \\<in> kerberos|]  \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   908
\  ==> \\<exists>Tk. (Says Kas A (Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk,\
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   909
\          Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Number Tk|}|})\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   910
\            \\<in> set evs   \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   911
\         & ServLife + Tt <= AuthLife + Tk)";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   912
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   913
by (parts_induct_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   914
by Auto_tac;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   915
by (blast_tac (claset() addSDs [Says_imp_spies RS parts.Inj RS parts.Fst RS
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   916
                               A_trusts_AuthTicket]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   917
qed "K4_imp_K2_refined";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   918
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   919
Goal "[| Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Tt|}  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   920
\          \\<in> parts (spies evs);  B \\<noteq> Tgs;  B \\<notin> bad;       \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   921
\        evs \\<in> kerberos |]                        \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   922
\==> \\<exists>AuthKey. \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   923
\      Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Tt,  \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   924
\                  Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Tt|}|}) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   925
\      \\<in> set evs";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   926
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   927
by (parts_induct_tac 1);
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   928
by (ALLGOALS Blast_tac);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   929
qed "B_trusts_ServKey";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   930
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   931
Goal "[| Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|}  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   932
\          \\<in> parts (spies evs);  B \\<noteq> Tgs;  B \\<notin> bad;       \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   933
\        evs \\<in> kerberos |]                        \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   934
\  ==> \\<exists>AuthKey Tk. Says Kas A (Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk,\
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   935
\          Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Number Tk|}|})\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   936
\            \\<in> set evs";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   937
by (blast_tac (claset() addSDs [B_trusts_ServKey, K4_imp_K2]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   938
qed "B_trusts_ServTicket_Kas";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   939
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   940
Goal "[| Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|}  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   941
\          \\<in> parts (spies evs); B \\<noteq> Tgs; B \\<notin> bad;       \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   942
\        evs \\<in> kerberos |]                        \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   943
\  ==> \\<exists>AuthKey Tk. (Says Kas A (Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk,\
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   944
\          Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Number Tk|}|})\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   945
\            \\<in> set evs            \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   946
\          & ServLife + Tt <= AuthLife + Tk)";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   947
by (blast_tac (claset() addSDs [B_trusts_ServKey,K4_imp_K2_refined]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   948
qed "B_trusts_ServTicket_Kas_refined";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   949
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   950
Goal "[| Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|}  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   951
\          \\<in> parts (spies evs); B \\<noteq> Tgs; B \\<notin> bad;        \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   952
\        evs \\<in> kerberos |]                        \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   953
\==> \\<exists>Tk AuthKey.        \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   954
\    Says Kas A (Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   955
\                  Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Number Tk|}|})\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   956
\      \\<in> set evs         \ 
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   957
\    & Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Number Tt,  \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   958
\                  Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|}|}) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   959
\      \\<in> set evs";
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   960
by (blast_tac (claset() addDs [B_trusts_ServKey, K4_imp_K2]) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   961
qed "B_trusts_ServTicket";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   962
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   963
Goal "[| Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|}  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   964
\          \\<in> parts (spies evs); B \\<noteq> Tgs; B \\<notin> bad;        \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   965
\        evs \\<in> kerberos |]                        \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   966
\==> \\<exists>Tk AuthKey.        \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   967
\    (Says Kas A (Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   968
\                  Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Number Tk|}|})\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   969
\      \\<in> set evs         \ 
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   970
\    & Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Number Tt,  \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   971
\                  Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|}|}) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   972
\      \\<in> set evs         \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   973
\    & ServLife + Tt <= AuthLife + Tk)";
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   974
by (blast_tac (claset() addDs [B_trusts_ServKey, K4_imp_K2_refined]) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   975
qed "B_trusts_ServTicket_refined";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   976
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   977
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   978
Goal "[| ~ ExpirServ Tt evs; ServLife + Tt <= AuthLife + Tk |]        \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   979
\  ==> ~ ExpirAuth Tk evs";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   980
by (blast_tac (claset() addDs [leI,le_trans] addEs [leE]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   981
qed "NotExpirServ_NotExpirAuth_refined";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   982
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   983
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   984
Goal "[| Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|} \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   985
\          \\<in> parts (spies evs);                                        \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   986
\        Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|} \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   987
\          \\<in> parts (spies evs);                                         \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   988
\        Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|}\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   989
\          \\<in> parts (spies evs);                     \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   990
\        ~ ExpirServ Tt evs; ~ ExpirAuth Tk evs;     \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   991
\        A \\<notin> bad;  B \\<notin> bad; B \\<noteq> Tgs; evs \\<in> kerberos |]            \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
   992
\     ==> Key ServKey \\<notin> analz (spies evs)";
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
   993
by (ftac A_trusts_AuthKey 1);
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
   994
by (ftac Confidentiality_Kas 3);
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
   995
by (ftac B_trusts_ServTicket 6);
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   996
by (blast_tac (claset() addSDs [Confidentiality_Tgs2]
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   997
			addDs [Says_Kas_message_form, A_trusts_K4, 
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
   998
                               unique_ServKeys, unique_AuthKeys]) 9);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
   999
by (ALLGOALS assume_tac);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1000
(*
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1001
The proof above is fast.  It can be done in one command in 50 secs:
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1002
by (blast_tac (claset() addDs [A_trusts_AuthKey, A_trusts_K4,
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1003
                               Says_Kas_message_form, B_trusts_ServTicket,
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1004
                               unique_ServKeys, unique_AuthKeys,
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1005
                               Confidentiality_Kas, 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1006
                               Confidentiality_Tgs2]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1007
*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1008
qed "Confidentiality_B";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1009
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1010
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1011
(*Most general form -- only for refined model! *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1012
Goal "[| Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|}  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1013
\          \\<in> parts (spies evs);                      \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1014
\        ~ ExpirServ Tt evs;                         \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1015
\        A \\<notin> bad;  B \\<notin> bad; B \\<noteq> Tgs; evs \\<in> kerberos |]            \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1016
\     ==> Key ServKey \\<notin> analz (spies evs)";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1017
by (blast_tac (claset() addDs [B_trusts_ServTicket_refined,
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1018
			       NotExpirServ_NotExpirAuth_refined, 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1019
                               Confidentiality_Tgs2]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1020
qed "Confidentiality_B_refined";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1021
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1022
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1023
(********************** Authenticity theorems *****************************)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1024
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1025
(***1. Session Keys authenticity: they originated with servers.***)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1026
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1027
(*Authenticity of AuthKey for A: "A_trusts_AuthKey"*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1028
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1029
(*Authenticity of ServKey for A: "A_trusts_ServKey"*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1030
Goal "[| Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|} \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1031
\          \\<in> parts (spies evs);                                     \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1032
\        Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|}   \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1033
\          \\<in> parts (spies evs);                                        \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1034
\        ~ ExpirAuth Tk evs; A \\<notin> bad; evs \\<in> kerberos |]         \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1035
\==>Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|})\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1036
\      \\<in> set evs";
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1037
by (blast_tac (claset() addDs [A_trusts_AuthKey, Confidentiality_Auth_A, 
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1038
                               A_trusts_K4_bis]) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1039
qed "A_trusts_ServKey"; 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1040
(*Note: requires a temporal check*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1041
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1042
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1043
(*Authenticity of ServKey for B: "B_trusts_ServKey"*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1044
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1045
(***2. Parties authenticity: each party verifies "the identity of
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1046
       another party who generated some data" (quoted from Neuman & Ts'o).***)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1047
       
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1048
       (*These guarantees don't assess whether two parties agree on 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1049
         the same session key: sending a message containing a key
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1050
         doesn't a priori state knowledge of the key.***)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1051
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1052
(*B checks authenticity of A: theorems "A_Authenticity", 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1053
                                       "A_authenticity_refined" *)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1054
Goal "[| Crypt ServKey {|Agent A, Number Ta|} \\<in> parts (spies evs);  \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1055
\        Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Number Tt, \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1056
\                                    ServTicket|}) \\<in> set evs;       \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1057
\        Key ServKey \\<notin> analz (spies evs);                \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1058
\        A \\<notin> bad; B \\<notin> bad; evs \\<in> kerberos |]   \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1059
\==> Says A B {|ServTicket, Crypt ServKey {|Agent A, Number Ta|}|} \\<in> set evs";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1060
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1061
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1062
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1063
by (etac kerberos.induct 1);
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
  1064
by (ftac Says_ticket_in_parts_spies 5);
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
  1065
by (ftac Says_ticket_in_parts_spies 7);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1066
by (REPEAT (FIRSTGOAL analz_mono_contra_tac));
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1067
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib])));
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1068
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1069
(*K3*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1070
by (blast_tac (claset() addDs [A_trusts_AuthKey,
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1071
                               Says_Kas_message_form, 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1072
                               Says_Tgs_message_form]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1073
(*K4*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1074
by (force_tac (claset() addSDs [Crypt_imp_keysFor], simpset()) 1); 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1075
(*K5*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1076
by (blast_tac (claset() addDs [Key_unique_SesKey]) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1077
qed "Says_Auth";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1078
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1079
(*The second assumption tells B what kind of key ServKey is.*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1080
Goal "[| Crypt ServKey {|Agent A, Number Ta|} \\<in> parts (spies evs);     \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1081
\        Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|}       \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1082
\          \\<in> parts (spies evs);                                         \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1083
\        Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|}  \ 
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1084
\          \\<in> parts (spies evs);                                          \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1085
\        Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|}  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1086
\          \\<in> parts (spies evs);                                            \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1087
\        ~ ExpirServ Tt evs; ~ ExpirAuth Tk evs;  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1088
\        B \\<noteq> Tgs; A \\<notin> bad;  B \\<notin> bad;  evs \\<in> kerberos |]         \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1089
\  ==> Says A B {|Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|},\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1090
\                 Crypt ServKey {|Agent A, Number Ta|} |} \\<in> set evs";
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1091
by (blast_tac (claset() addIs [Says_Auth]
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1092
                        addDs [Confidentiality_B, Key_unique_SesKey,
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1093
                               B_trusts_ServKey]) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1094
qed "A_Authenticity";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1095
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1096
(*Stronger form in the refined model*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1097
Goal "[| Crypt ServKey {|Agent A, Number Ta2|} \\<in> parts (spies evs);     \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1098
\        Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|}       \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1099
\          \\<in> parts (spies evs);                                         \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1100
\        ~ ExpirServ Tt evs;                                        \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1101
\        B \\<noteq> Tgs; A \\<notin> bad;  B \\<notin> bad;  evs \\<in> kerberos |]         \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1102
\  ==> Says A B {|Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|},\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1103
\                 Crypt ServKey {|Agent A, Number Ta2|} |} \\<in> set evs";
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1104
by (blast_tac (claset() addDs [Confidentiality_B_refined, B_trusts_ServKey, 
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1105
                               Key_unique_SesKey]
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1106
                        addIs [Says_Auth]) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1107
qed "A_Authenticity_refined";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1108
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1109
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1110
(*A checks authenticity of B: theorem "B_authenticity"*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1111
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1112
Goal "[| Crypt ServKey (Number Ta) \\<in> parts (spies evs);  \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1113
\        Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Number Tt, \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1114
\                                    ServTicket|}) \\<in> set evs;       \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1115
\        Key ServKey \\<notin> analz (spies evs);                \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1116
\        A \\<notin> bad; B \\<notin> bad; evs \\<in> kerberos |]   \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1117
\     ==> Says B A (Crypt ServKey (Number Ta)) \\<in> set evs";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1118
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1119
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1120
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1121
by (etac kerberos.induct 1);
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
  1122
by (ftac Says_ticket_in_parts_spies 5);
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
  1123
by (ftac Says_ticket_in_parts_spies 7);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1124
by (REPEAT (FIRSTGOAL analz_mono_contra_tac));
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1125
by (ALLGOALS Asm_simp_tac);
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1126
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1127
by (force_tac (claset() addSDs [Crypt_imp_keysFor], simpset()) 1); 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1128
by (Clarify_tac 1);
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
  1129
by (ftac Says_Tgs_message_form 1 THEN assume_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1130
by (Clarify_tac 1);  (*PROOF FAILED if omitted*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1131
by (blast_tac (claset() addDs [unique_CryptKey]) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1132
qed "Says_K6";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1133
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1134
Goal "[| Crypt AuthKey {|Key ServKey, Agent B, T, ServTicket|}   \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1135
\          \\<in> parts (spies evs);    \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1136
\        Key AuthKey \\<notin> analz (spies evs); AuthKey \\<notin> range shrK;  \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1137
\        evs \\<in> kerberos |]              \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1138
\ ==> \\<exists>A. Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, T, ServTicket|})\
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1139
\             \\<in> set evs";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1140
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1141
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1142
by (parts_induct_tac 1);
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1143
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1144
by (Blast_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1145
by (Blast_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1146
qed "K4_trustworthy";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1147
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1148
Goal "[| Crypt ServKey (Number Ta) \\<in> parts (spies evs);           \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1149
\        Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|} \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1150
\          \\<in> parts (spies evs);                                        \ 
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1151
\        Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|}\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1152
\          \\<in> parts (spies evs);                                          \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1153
\        ~ ExpirAuth Tk evs; ~ ExpirServ Tt evs;                         \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1154
\        A \\<notin> bad;  B \\<notin> bad; B \\<noteq> Tgs; evs \\<in> kerberos |]            \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1155
\     ==> Says B A (Crypt ServKey (Number Ta)) \\<in> set evs";
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
  1156
by (ftac A_trusts_AuthKey 1);
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
  1157
by (ftac Says_Kas_message_form 3);
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
  1158
by (ftac Confidentiality_Kas 4);
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
  1159
by (ftac K4_trustworthy 7);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1160
by (Blast_tac 8);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1161
by (etac exE 9);
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
  1162
by (ftac K4_imp_K2 9);
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1163
(*Yes the proof's a mess, but I don't know how to improve it.*)
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1164
by (blast_tac (claset() addDs [Key_unique_SesKey]
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1165
                        addSIs [Says_K6]
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1166
                        addDs [Confidentiality_Tgs1]) 10);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1167
by (ALLGOALS assume_tac);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1168
qed "B_Authenticity";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1169
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1170
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1171
(***3. Parties' knowledge of session keys. A knows a session key if she
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1172
       used it to build a cipher.***)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1173
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1174
Goal "[| Says B A (Crypt ServKey (Number Ta)) \\<in> set evs;           \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1175
\        Key ServKey \\<notin> analz (spies evs);                          \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1176
\        A \\<notin> bad;  B \\<notin> bad; B \\<noteq> Tgs; evs \\<in> kerberos |]            \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1177
\     ==> B Issues A with (Crypt ServKey (Number Ta)) on evs";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1178
by (simp_tac (simpset() addsimps [Issues_def]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1179
by (rtac exI 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1180
by (rtac conjI 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1181
by (assume_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1182
by (Simp_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1183
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1184
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1185
by (etac kerberos.induct 1);
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
  1186
by (ftac Says_ticket_in_parts_spies 5);
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
  1187
by (ftac Says_ticket_in_parts_spies 7);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1188
by (REPEAT (FIRSTGOAL analz_mono_contra_tac));
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1189
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib])));
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1190
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1191
(*K6 requires numerous lemmas*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1192
by (asm_full_simp_tac (simpset() addsimps [takeWhile_tail]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1193
by (blast_tac (claset() addDs [B_trusts_ServTicket,
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1194
                               impOfSubs parts_spies_takeWhile_mono,
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1195
                               impOfSubs parts_spies_evs_revD2]
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1196
                        addIs [Says_K6]) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1197
qed "B_Knows_B_Knows_ServKey_lemma";
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1198
(*Key ServKey \\<notin> analz (spies evs) could be relaxed by Confidentiality_B
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1199
  but this is irrelevant because B knows what he knows!                  *)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1200
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1201
Goal "[| Says B A (Crypt ServKey (Number Ta)) \\<in> set evs;           \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1202
\        Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|}\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1203
\           \\<in> parts (spies evs);\
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1204
\        Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|}\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1205
\           \\<in> parts (spies evs);\
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1206
\        Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|}\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1207
\          \\<in> parts (spies evs);     \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1208
\        ~ ExpirServ Tt evs; ~ ExpirAuth Tk evs;              \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1209
\        A \\<notin> bad;  B \\<notin> bad; B \\<noteq> Tgs; evs \\<in> kerberos |]            \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1210
\     ==> B Issues A with (Crypt ServKey (Number Ta)) on evs";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1211
by (blast_tac (claset() addSDs [Confidentiality_B,
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1212
	                       B_Knows_B_Knows_ServKey_lemma]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1213
qed "B_Knows_B_Knows_ServKey";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1214
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1215
Goal "[| Says B A (Crypt ServKey (Number Ta)) \\<in> set evs;           \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1216
\        Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|}\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1217
\           \\<in> parts (spies evs);\
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1218
\        ~ ExpirServ Tt evs;            \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1219
\        A \\<notin> bad;  B \\<notin> bad; B \\<noteq> Tgs; evs \\<in> kerberos |]            \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1220
\     ==> B Issues A with (Crypt ServKey (Number Ta)) on evs";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1221
by (blast_tac (claset() addSDs [Confidentiality_B_refined,
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1222
	                       B_Knows_B_Knows_ServKey_lemma]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1223
qed "B_Knows_B_Knows_ServKey_refined";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1224
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1225
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1226
Goal "[| Crypt ServKey (Number Ta) \\<in> parts (spies evs);           \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1227
\        Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|} \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1228
\          \\<in> parts (spies evs);                                        \ 
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1229
\        Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|}\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1230
\          \\<in> parts (spies evs);                                          \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1231
\        ~ ExpirAuth Tk evs; ~ ExpirServ Tt evs;                         \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1232
\        A \\<notin> bad;  B \\<notin> bad; B \\<noteq> Tgs; evs \\<in> kerberos |]            \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1233
\     ==> B Issues A with (Crypt ServKey (Number Ta)) on evs";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1234
by (blast_tac (claset() addSDs [B_Authenticity, Confidentiality_Serv_A,
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1235
                                B_Knows_B_Knows_ServKey_lemma]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1236
qed "A_Knows_B_Knows_ServKey";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1237
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1238
Goal "[| Says A Tgs     \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1239
\            {|AuthTicket, Crypt AuthKey {|Agent A, Number Ta|}, Agent B|}\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1240
\          \\<in> set evs;      \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1241
\        A \\<notin> bad;  evs \\<in> kerberos |]         \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1242
\     ==> \\<exists>Tk. Says Kas A (Crypt (shrK A) \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1243
\                     {|Key AuthKey, Agent Tgs, Tk, AuthTicket|}) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1244
\                  \\<in> set evs";
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1245
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1246
by (parts_induct_tac 1);
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1247
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1248
by (Blast_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1249
by (blast_tac (claset() addDs [Says_imp_spies RS parts.Inj RS 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1250
			       A_trusts_AuthKey]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1251
qed "K3_imp_K2";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1252
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1253
Goal "[| Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|}   \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1254
\          \\<in> parts (spies evs);                    \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1255
\        Says Kas A (Crypt (shrK A) \
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1256
\                    {|Key AuthKey, Agent Tgs, Tk, AuthTicket|}) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1257
\        \\<in> set evs;    \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1258
\        Key AuthKey \\<notin> analz (spies evs);       \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1259
\        B \\<noteq> Tgs; A \\<notin> bad;  B \\<notin> bad;  evs \\<in> kerberos |]         \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1260
\  ==> Says Tgs A (Crypt AuthKey        \ 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1261
\                    {|Key ServKey, Agent B, Number Tt, ServTicket|})  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1262
\        \\<in> set evs";      
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1263
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1264
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1265
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1266
by (parts_induct_tac 1);
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1267
by (Blast_tac 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1268
by (force_tac (claset() addSDs [Crypt_imp_keysFor], simpset()) 1); 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1269
by (blast_tac (claset() addDs [Says_imp_spies RS parts.Inj RS parts.Fst RS
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1270
                               A_trusts_AuthTicket, unique_AuthKeys]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1271
qed "K4_trustworthy'";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1272
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1273
Goal "[| Says A B {|ServTicket, Crypt ServKey {|Agent A, Number Ta|}|} \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1274
\          \\<in> set evs;       \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1275
\        Key ServKey \\<notin> analz (spies evs);       \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1276
\        B \\<noteq> Tgs; A \\<notin> bad;  B \\<notin> bad;  evs \\<in> kerberos |]         \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1277
\  ==> A Issues B with (Crypt ServKey {|Agent A, Number Ta|}) on evs";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1278
by (simp_tac (simpset() addsimps [Issues_def]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1279
by (rtac exI 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1280
by (rtac conjI 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1281
by (assume_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1282
by (Simp_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1283
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1284
by (etac rev_mp 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1285
by (etac kerberos.induct 1);
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
  1286
by (ftac Says_ticket_in_parts_spies 5);
23e090051cb8 isatool expandshort;
wenzelm
parents: 7494
diff changeset
  1287
by (ftac Says_ticket_in_parts_spies 7);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1288
by (REPEAT (FIRSTGOAL analz_mono_contra_tac));
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1289
by (ALLGOALS Asm_simp_tac);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1290
by (Clarify_tac 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1291
(*K6*)
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1292
by Auto_tac;
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1293
by (asm_full_simp_tac (simpset() addsimps [takeWhile_tail]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1294
(*Level 15: case study necessary because the assumption doesn't state
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1295
  the form of ServTicket. The guarantee becomes stronger.*)
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1296
by (blast_tac (claset() addDs [Says_imp_spies RS analz.Inj RS analz_Decrypt',
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1297
                               K3_imp_K2, K4_trustworthy',
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1298
                               impOfSubs parts_spies_takeWhile_mono,
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1299
                               impOfSubs parts_spies_evs_revD2]
11222
72c5997e1145 shortening and streamlining of proofs
paulson
parents: 11204
diff changeset
  1300
                        addIs [Says_Auth]) 1);
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1301
by (asm_full_simp_tac (simpset() addsimps [takeWhile_tail]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1302
qed "A_Knows_A_Knows_ServKey_lemma";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1303
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1304
Goal "[| Says A B {|ServTicket, Crypt ServKey {|Agent A, Number Ta|}|} \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1305
\          \\<in> set evs;       \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1306
\        Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|}\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1307
\          \\<in> parts (spies evs);\
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1308
\        Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|}\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1309
\          \\<in> parts (spies evs);                                        \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1310
\        ~ ExpirAuth Tk evs; ~ ExpirServ Tt evs;\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1311
\        B \\<noteq> Tgs; A \\<notin> bad;  B \\<notin> bad;  evs \\<in> kerberos |]         \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1312
\  ==> A Issues B with (Crypt ServKey {|Agent A, Number Ta|}) on evs";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1313
by (blast_tac (claset() addSDs [Confidentiality_Serv_A,
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1314
	                       A_Knows_A_Knows_ServKey_lemma]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1315
qed "A_Knows_A_Knows_ServKey";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1316
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1317
Goal "[| Crypt ServKey {|Agent A, Number Ta|} \\<in> parts (spies evs);     \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1318
\        Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|}       \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1319
\          \\<in> parts (spies evs);                                         \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1320
\        Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|}  \ 
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1321
\          \\<in> parts (spies evs);                                          \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1322
\        Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|}  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1323
\          \\<in> parts (spies evs);                                            \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1324
\        ~ ExpirServ Tt evs; ~ ExpirAuth Tk evs;  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1325
\        B \\<noteq> Tgs; A \\<notin> bad;  B \\<notin> bad;  evs \\<in> kerberos |]         \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1326
\  ==> A Issues B with (Crypt ServKey {|Agent A, Number Ta|}) on evs";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1327
by (blast_tac (claset() addDs [A_Authenticity, Confidentiality_B,
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1328
	                       A_Knows_A_Knows_ServKey_lemma]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1329
qed "B_Knows_A_Knows_ServKey";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1330
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1331
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1332
Goal "[| Crypt ServKey {|Agent A, Number Ta|} \\<in> parts (spies evs);     \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1333
\        Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|}       \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1334
\          \\<in> parts (spies evs);                                         \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1335
\        ~ ExpirServ Tt evs;                                        \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11104
diff changeset
  1336
\        B \\<noteq> Tgs; A \\<notin> bad;  B \\<notin> bad;  evs \\<in> kerberos |]         \
6452
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1337
\  ==> A Issues B with (Crypt ServKey {|Agent A, Number Ta|}) on evs";
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1338
by (blast_tac (claset() addDs [A_Authenticity_refined, 
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1339
                               Confidentiality_B_refined,
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1340
	                       A_Knows_A_Knows_ServKey_lemma]) 1);
6a1b393ccdc0 addition of Kerberos IV example
paulson
parents:
diff changeset
  1341
qed "B_Knows_A_Knows_ServKey_refined";