src/HOL/Auth/Kerberos_BAN.ML
author berghofe
Thu, 10 Oct 2002 14:18:01 +0200
changeset 13635 c41e88151b54
parent 11655 923e4d0d36d5
permissions -rw-r--r--
Added functions Suml and Sumr which are useful for constructing datatypes involving function types.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
     1
(*  Title:      HOL/Auth/Kerberos_BAN
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
     2
    ID:         $Id$
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
     3
    Author:     Giampaolo Bella, Cambridge University Computer Laboratory
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
     4
    Copyright   1998  University of Cambridge
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
     5
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
     6
The Kerberos protocol, BAN version.
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
     7
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
     8
From page 251 of
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
     9
  Burrows, Abadi and Needham.  A Logic of Authentication.
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    10
  Proc. Royal Soc. 426 (1989)
5064
77bd19f782e6 simplified and tidied the proofs
paulson
parents: 5053
diff changeset
    11
5223
4cb05273f764 Removal of obsolete "open" commands from heads of .ML files
paulson
parents: 5114
diff changeset
    12
  Confidentiality (secrecy) and authentication properties rely on 
4cb05273f764 Removal of obsolete "open" commands from heads of .ML files
paulson
parents: 5114
diff changeset
    13
  temporal checks: strong guarantees in a little abstracted - but
4cb05273f764 Removal of obsolete "open" commands from heads of .ML files
paulson
parents: 5114
diff changeset
    14
  very realistic - model (see .thy).
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    15
5223
4cb05273f764 Removal of obsolete "open" commands from heads of .ML files
paulson
parents: 5114
diff changeset
    16
Tidied by lcp.
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    17
*)
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    18
11150
67387142225e Streamlining for the bug fix in Blast.
paulson
parents: 11104
diff changeset
    19
AddDs  [Says_imp_knows_Spy RS parts.Inj, parts.Body];
67387142225e Streamlining for the bug fix in Blast.
paulson
parents: 11104
diff changeset
    20
AddDs  [impOfSubs analz_subset_parts, impOfSubs Fake_parts_insert];
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    21
5064
77bd19f782e6 simplified and tidied the proofs
paulson
parents: 5053
diff changeset
    22
AddIffs [SesKeyLife_LB, AutLife_LB];
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    23
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    24
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    25
(*A "possibility property": there are traces that reach the end.*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
    26
Goal "\\<exists>Timestamp K. \\<exists>evs \\<in> kerberos_ban.    \
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    27
\            Says B A (Crypt K (Number Timestamp)) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
    28
\                 \\<in> set evs";
5352
paulson
parents: 5223
diff changeset
    29
by (cut_facts_tac [SesKeyLife_LB] 1);
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    30
by (REPEAT (resolve_tac [exI,bexI] 1));
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    31
by (rtac (kerberos_ban.Nil RS kerberos_ban.Kb1 RS kerberos_ban.Kb2 RS 
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    32
          kerberos_ban.Kb3 RS kerberos_ban.Kb4) 2);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    33
by possibility_tac;
5352
paulson
parents: 5223
diff changeset
    34
by (ALLGOALS Asm_simp_tac);
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    35
result();
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    36
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    37
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    38
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    39
(**** Inductive proofs about kerberos_ban ****)
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    40
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    41
(*Forwarding Lemma for reasoning about the encrypted portion of message Kb3*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
    42
Goal "Says S A (Crypt KA {|Timestamp, B, K, X|}) \\<in> set evs \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
    43
\             ==> X \\<in> parts (spies evs)";
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    44
by (Blast_tac 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    45
qed "Kb3_msg_in_parts_spies";
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    46
                              
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
    47
Goal "Says Server A (Crypt (shrK A) {|Timestamp, B, K, X|}) \\<in> set evs \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
    48
\        ==> K \\<in> parts (spies evs)";
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    49
by (Blast_tac 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    50
qed "Oops_parts_spies";
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    51
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
    52
(*For proving the easier theorems about X \\<notin> parts (spies evs).*)
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    53
fun parts_induct_tac i = 
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    54
    etac kerberos_ban.induct i  THEN 
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 5983
diff changeset
    55
    ftac Oops_parts_spies (i+6)  THEN
23e090051cb8 isatool expandshort;
wenzelm
parents: 5983
diff changeset
    56
    ftac Kb3_msg_in_parts_spies (i+4)     THEN
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    57
    prove_simple_subgoals_tac i;
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    58
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    59
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    60
(*Spy never sees another agent's shared key! (unless it's bad at start)*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
    61
Goal "evs \\<in> kerberos_ban ==> (Key (shrK A) \\<in> parts (spies evs)) = (A \\<in> bad)";
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    62
by (parts_induct_tac 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    63
by (ALLGOALS Blast_tac);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    64
qed "Spy_see_shrK";
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    65
Addsimps [Spy_see_shrK];
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    66
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    67
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
    68
Goal "evs \\<in> kerberos_ban ==> (Key (shrK A) \\<in> analz (spies evs)) = (A \\<in> bad)";
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    69
by Auto_tac;
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    70
qed "Spy_analz_shrK";
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    71
Addsimps [Spy_analz_shrK];
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    72
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
    73
Goal  "[| Key (shrK A) \\<in> parts (spies evs);       \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
    74
\               evs \\<in> kerberos_ban |] ==> A:bad";
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    75
by (blast_tac (claset() addDs [Spy_see_shrK]) 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    76
qed "Spy_see_shrK_D";
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    77
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    78
bind_thm ("Spy_analz_shrK_D", analz_subset_parts RS subsetD RS Spy_see_shrK_D);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    79
AddSDs [Spy_see_shrK_D, Spy_analz_shrK_D];
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    80
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    81
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    82
(*Nobody can have used non-existent keys!*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
    83
Goal "evs \\<in> kerberos_ban ==>      \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
    84
\      Key K \\<notin> used evs --> K \\<notin> keysFor (parts (spies evs))";
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    85
by (parts_induct_tac 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    86
(*Fake*)
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    87
by (blast_tac (claset() addSDs [keysFor_parts_insert]) 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    88
(*Kb2, Kb3, Kb4*)
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    89
by (ALLGOALS Blast_tac);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    90
qed_spec_mp "new_keys_not_used";
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
    91
Addsimps [new_keys_not_used];
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    92
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    93
(** Lemmas concerning the form of items passed in messages **)
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    94
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
    95
(*Describes the form of K, X and K' when the Server sends this message.*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    96
Goal "[| Says Server A (Crypt K' {|Number Ts, Agent B, Key K, X|})  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
    97
\        \\<in> set evs; evs \\<in> kerberos_ban |]                           \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
    98
\     ==> K \\<notin> range shrK &                                         \
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    99
\         X = (Crypt (shrK B) {|Number Ts, Agent A, Key K|}) &      \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   100
\         K' = shrK A";
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   101
by (etac rev_mp 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   102
by (etac kerberos_ban.induct 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   103
by Auto_tac;
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   104
qed "Says_Server_message_form";
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   105
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   106
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   107
(*If the encrypted message appears then it originated with the Server
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   108
  PROVIDED that A is NOT compromised!
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   109
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   110
  This shows implicitly the FRESHNESS OF THE SESSION KEY to A
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   111
*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   112
Goal "[| Crypt (shrK A) {|Number Ts, Agent B, Key K, X|} \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   113
\          \\<in> parts (spies evs);                          \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   114
\        A \\<notin> bad;  evs \\<in> kerberos_ban |]                \
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   115
\      ==> Says Server A (Crypt (shrK A) {|Number Ts, Agent B, Key K, X|}) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   116
\            \\<in> set evs";
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   117
by (etac rev_mp 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   118
by (parts_induct_tac 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   119
by (Blast_tac 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   120
qed "A_trusts_K_by_Kb2";
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   121
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   122
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   123
(*If the TICKET appears then it originated with the Server*)
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   124
(*FRESHNESS OF THE SESSION KEY to B*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   125
Goal "[| Crypt (shrK B) {|Number Ts, Agent A, Key K|} \\<in> parts (spies evs); \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   126
\        B \\<notin> bad;  evs \\<in> kerberos_ban |]                        \
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   127
\      ==> Says Server A                                         \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   128
\           (Crypt (shrK A) {|Number Ts, Agent B, Key K,                   \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   129
\                         Crypt (shrK B) {|Number Ts, Agent A, Key K|}|})  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   130
\          \\<in> set evs";
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   131
by (etac rev_mp 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   132
by (parts_induct_tac 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   133
by (Blast_tac 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   134
qed "B_trusts_K_by_Kb3";
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   135
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   136
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   137
(*EITHER describes the form of X when the following message is sent, 
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   138
  OR     reduces it to the Fake case.
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   139
  Use Says_Server_message_form if applicable.*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   140
Goal "[| Says S A (Crypt (shrK A) {|Number Ts, Agent B, Key K, X|})     \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   141
\           \\<in> set evs;                                                  \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   142
\        evs \\<in> kerberos_ban |]                                          \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   143
\==> (K \\<notin> range shrK & X = (Crypt (shrK B) {|Number Ts, Agent A, Key K|}))\
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   144
\         | X \\<in> analz (spies evs)";
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   145
by (case_tac "A \\<in> bad" 1);
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   146
by (fast_tac (claset() addSDs [Says_imp_spies RS analz.Inj]
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   147
                      addss (simpset())) 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   148
by (forward_tac [Says_imp_spies RS parts.Inj] 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   149
by (blast_tac (claset() addSDs [A_trusts_K_by_Kb2, 
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   150
				Says_Server_message_form]) 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   151
qed "Says_S_message_form";
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   152
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   153
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   154
(*For proofs involving analz.*)
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   155
val analz_spies_tac = 
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 5983
diff changeset
   156
    ftac Says_Server_message_form 7 THEN
23e090051cb8 isatool expandshort;
wenzelm
parents: 5983
diff changeset
   157
    ftac Says_S_message_form 5 THEN 
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   158
    REPEAT_FIRST (eresolve_tac [asm_rl, conjE, disjE] ORELSE' hyp_subst_tac);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   159
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   160
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   161
(****
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   162
 The following is to prove theorems of the form
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   163
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   164
  Key K \\<in> analz (insert (Key KAB) (spies evs)) ==>
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   165
  Key K \\<in> analz (spies evs)
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   166
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   167
 A more general formula must be proved inductively.
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   168
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   169
****)
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   170
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   171
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   172
(** Session keys are not used to encrypt other session keys **)
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   173
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   174
Goal "evs \\<in> kerberos_ban ==>                          \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   175
\  \\<forall>K KK. KK <= - (range shrK) -->                 \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   176
\         (Key K \\<in> analz (Key`KK Un (spies evs))) =  \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   177
\         (K \\<in> KK | Key K \\<in> analz (spies evs))";
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   178
by (etac kerberos_ban.induct 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   179
by analz_spies_tac;
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   180
by (REPEAT_FIRST (resolve_tac [allI, impI]));
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   181
by (REPEAT_FIRST (rtac analz_image_freshK_lemma));
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   182
(*Takes 5 secs*)
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   183
by (ALLGOALS (asm_simp_tac analz_image_freshK_ss));
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   184
(*Fake*) 
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   185
by (spy_analz_tac 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   186
qed_spec_mp "analz_image_freshK";
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   187
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   188
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   189
Goal "[| evs \\<in> kerberos_ban;  KAB \\<notin> range shrK |] ==>     \
11655
923e4d0d36d5 tuned parentheses in relational expressions;
wenzelm
parents: 11185
diff changeset
   190
\     (Key K \\<in> analz (insert (Key KAB) (spies evs))) =       \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   191
\     (K = KAB | Key K \\<in> analz (spies evs))";
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   192
by (asm_simp_tac (analz_image_freshK_ss addsimps [analz_image_freshK]) 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   193
qed "analz_insert_freshK";
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   194
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   195
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   196
(** The session key K uniquely identifies the message **)
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   197
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   198
Goal "[| Says Server A                                    \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   199
\          (Crypt (shrK A) {|Number Ts, Agent B, Key K, X|}) \\<in> set evs; \ 
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   200
\        Says Server A'                                   \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   201
\         (Crypt (shrK A') {|Number Ts', Agent B', Key K, X'|}) \\<in> set evs;\
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   202
\        evs \\<in> kerberos_ban |] ==> A=A' & Ts=Ts' & B=B' & X = X'";
11104
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   203
by (etac rev_mp 1);
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   204
by (etac rev_mp 1);
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   205
by (parts_induct_tac 1);
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   206
(*Kb2: it can't be a new key*)
f2024fed9f0c partial conversion to Isar script style
paulson
parents: 10833
diff changeset
   207
by (Blast_tac 1);
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   208
qed "unique_session_keys";
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   209
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   210
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   211
(** Lemma: the session key sent in msg Kb2 would be EXPIRED
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   212
    if the spy could see it!
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   213
**)
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   214
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   215
Goal "[| A \\<notin> bad;  B \\<notin> bad;  evs \\<in> kerberos_ban |]           \
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   216
\ ==> Says Server A                                            \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   217
\         (Crypt (shrK A) {|Number Ts, Agent B, Key K,         \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   218
\                           Crypt (shrK B) {|Number Ts, Agent A, Key K|}|})\
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   219
\        \\<in> set evs -->                                         \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   220
\     Key K \\<in> analz (spies evs) --> Expired Ts evs"; 
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   221
by (etac kerberos_ban.induct 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   222
by analz_spies_tac;
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   223
by (ALLGOALS
8741
61bc5ed22b62 removal of less_SucI, le_SucI from default simpset
paulson
parents: 7499
diff changeset
   224
    (asm_simp_tac (simpset() addsimps [less_SucI, analz_insert_eq, 
11150
67387142225e Streamlining for the bug fix in Blast.
paulson
parents: 11104
diff changeset
   225
				       analz_insert_freshK] @ pushes)));
67387142225e Streamlining for the bug fix in Blast.
paulson
parents: 11104
diff changeset
   226
(*Oops: PROOF FAILED if addIs below*)
67387142225e Streamlining for the bug fix in Blast.
paulson
parents: 11104
diff changeset
   227
by (blast_tac (claset() addDs [unique_session_keys] addSIs [less_SucI]) 4);
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   228
(*Kb2*)
5064
77bd19f782e6 simplified and tidied the proofs
paulson
parents: 5053
diff changeset
   229
by (blast_tac (claset() addIs [parts_insertI, less_SucI]) 2);
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   230
(*Fake*) 
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   231
by (spy_analz_tac 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   232
(**LEVEL 6 **)
5064
77bd19f782e6 simplified and tidied the proofs
paulson
parents: 5053
diff changeset
   233
(*Kb3*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   234
by (case_tac "Aa \\<in> bad" 1);
5064
77bd19f782e6 simplified and tidied the proofs
paulson
parents: 5053
diff changeset
   235
by (blast_tac (claset() addDs [A_trusts_K_by_Kb2, unique_session_keys]) 2);
77bd19f782e6 simplified and tidied the proofs
paulson
parents: 5053
diff changeset
   236
by (blast_tac (claset() addDs [Says_imp_spies RS analz.Inj,
77bd19f782e6 simplified and tidied the proofs
paulson
parents: 5053
diff changeset
   237
                               Crypt_Spy_analz_bad, analz.Fst, analz.Snd]
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   238
                        addIs [less_SucI]) 1);
5479
5a5dfb0f0d7d fixed PROOF FAILED
paulson
parents: 5434
diff changeset
   239
qed_spec_mp "lemma2";
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   240
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   241
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   242
(** CONFIDENTIALITY for the SERVER:
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   243
                     Spy does not see the keys sent in msg Kb2 
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   244
                     as long as they have NOT EXPIRED
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   245
**)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   246
Goal "[| Says Server A                                           \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   247
\         (Crypt K' {|Number T, Agent B, Key K, X|}) \\<in> set evs;  \
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   248
\        ~ Expired T evs;                                        \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   249
\        A \\<notin> bad;  B \\<notin> bad;  evs \\<in> kerberos_ban                \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   250
\     |] ==> Key K \\<notin> analz (spies evs)";
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 5983
diff changeset
   251
by (ftac Says_Server_message_form 1 THEN assume_tac 1);
5479
5a5dfb0f0d7d fixed PROOF FAILED
paulson
parents: 5434
diff changeset
   252
by (blast_tac (claset() addIs [lemma2]) 1);
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   253
qed "Confidentiality_S";
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   254
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   255
(**** THE COUNTERPART OF CONFIDENTIALITY 
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   256
      [|...; Expired Ts evs; ...|] ==> Key K \\<in> analz (spies evs)
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   257
      WOULD HOLD ONLY IF AN OOPS OCCURRED! ---> Nothing to prove!   ****)
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   258
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   259
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   260
(** CONFIDENTIALITY for ALICE: **)
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   261
(** Also A_trusts_K_by_Kb2 RS Confidentiality_S **)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   262
Goal "[| Crypt (shrK A) {|Number T, Agent B, Key K, X|} \\<in> parts (spies evs);\
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   263
\        ~ Expired T evs;          \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   264
\        A \\<notin> bad;  B \\<notin> bad;  evs \\<in> kerberos_ban                \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   265
\     |] ==> Key K \\<notin> analz (spies evs)";
5064
77bd19f782e6 simplified and tidied the proofs
paulson
parents: 5053
diff changeset
   266
by (blast_tac (claset() addSDs [A_trusts_K_by_Kb2, Confidentiality_S]) 1);
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   267
qed "Confidentiality_A";
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   268
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   269
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   270
(** CONFIDENTIALITY for BOB: **)
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   271
(** Also B_trusts_K_by_Kb3 RS Confidentiality_S **)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   272
Goal "[| Crypt (shrK B) {|Number Tk, Agent A, Key K|} \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   273
\         \\<in> parts (spies evs);              \
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   274
\       ~ Expired Tk evs;          \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   275
\       A \\<notin> bad;  B \\<notin> bad;  evs \\<in> kerberos_ban                \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   276
\     |] ==> Key K \\<notin> analz (spies evs)";             
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   277
by (blast_tac (claset() addSDs [B_trusts_K_by_Kb3, 
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   278
                                Confidentiality_S]) 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   279
qed "Confidentiality_B";
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   280
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   281
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   282
Goal "[| B \\<notin> bad;  evs \\<in> kerberos_ban |]                        \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   283
\     ==> Key K \\<notin> analz (spies evs) -->                    \
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   284
\         Says Server A (Crypt (shrK A) {|Number Ts, Agent B, Key K, X|}) \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   285
\         \\<in> set evs -->                                             \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   286
\         Crypt K (Number Ta) \\<in> parts (spies evs) -->        \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   287
\         Says B A (Crypt K (Number Ta)) \\<in> set evs";
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   288
by (etac kerberos_ban.induct 1);
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 5983
diff changeset
   289
by (ftac Says_S_message_form 5 THEN assume_tac 5);     
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   290
by (dtac Kb3_msg_in_parts_spies 5);
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 5983
diff changeset
   291
by (ftac Oops_parts_spies 7);
5064
77bd19f782e6 simplified and tidied the proofs
paulson
parents: 5053
diff changeset
   292
by (REPEAT (FIRSTGOAL analz_mono_contra_tac));
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   293
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib])));
5064
77bd19f782e6 simplified and tidied the proofs
paulson
parents: 5053
diff changeset
   294
(**LEVEL 6**)
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   295
by (Blast_tac 1);
5064
77bd19f782e6 simplified and tidied the proofs
paulson
parents: 5053
diff changeset
   296
by (Clarify_tac 1);
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   297
(*
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   298
Subgoal 1: contradiction from the assumptions  
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   299
Key K \\<notin> used evs2  and Crypt K (Number Ta) \\<in> parts (spies evs2)
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   300
*)
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   301
by (dtac Crypt_imp_invKey_keysFor 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   302
by (Asm_full_simp_tac 1);
5064
77bd19f782e6 simplified and tidied the proofs
paulson
parents: 5053
diff changeset
   303
(* the two tactics above detect the contradiction*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   304
by (case_tac "Ba \\<in> bad" 1);  (*splits up the subgoal by the stated case*)
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   305
by (blast_tac (claset() addDs [Says_imp_spies RS parts.Inj RS parts.Fst RS 
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   306
                              B_trusts_K_by_Kb3, 
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   307
			      unique_session_keys]) 2);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   308
by (blast_tac (claset() addDs [Says_imp_spies RS analz.Inj RS analz.Fst RS 
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   309
			      Crypt_Spy_analz_bad]) 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   310
val lemma_B = result();
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   311
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   312
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   313
(*AUTHENTICATION OF B TO A*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   314
Goal "[| Crypt K (Number Ta) \\<in> parts (spies evs);           \
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   315
\        Crypt (shrK A) {|Number Ts, Agent B, Key K, X|}    \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   316
\        \\<in> parts (spies evs);                               \
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   317
\        ~ Expired Ts evs;                                  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   318
\        A \\<notin> bad;  B \\<notin> bad;  evs \\<in> kerberos_ban |]        \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   319
\     ==> Says B A (Crypt K (Number Ta)) \\<in> set evs";
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   320
by (blast_tac (claset() addSDs [A_trusts_K_by_Kb2]
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   321
                        addSIs [lemma_B RS mp RS mp RS mp]
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   322
                        addSEs [Confidentiality_S RSN (2,rev_notE)]) 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   323
qed "Authentication_B";
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   324
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   325
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   326
Goal "[| A \\<notin> bad; B \\<notin> bad; evs \\<in> kerberos_ban |]      ==>         \ 
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   327
\        Key K \\<notin> analz (spies evs) -->         \
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   328
\        Says Server A (Crypt (shrK A) {|Number Ts, Agent B, Key K, X|})  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   329
\        \\<in> set evs -->  \
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   330
\         Crypt K {|Agent A, Number Ta|} \\<in> parts (spies evs) -->\
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   331
\        Says A B {|X, Crypt K {|Agent A, Number Ta|}|}  \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   332
\            \\<in> set evs";
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   333
by (etac kerberos_ban.induct 1);
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 5983
diff changeset
   334
by (ftac Says_S_message_form 5 THEN assume_tac 5);     
23e090051cb8 isatool expandshort;
wenzelm
parents: 5983
diff changeset
   335
by (ftac Kb3_msg_in_parts_spies 5);
23e090051cb8 isatool expandshort;
wenzelm
parents: 5983
diff changeset
   336
by (ftac Oops_parts_spies 7);
5064
77bd19f782e6 simplified and tidied the proofs
paulson
parents: 5053
diff changeset
   337
by (REPEAT (FIRSTGOAL analz_mono_contra_tac));
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   338
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib])));
5064
77bd19f782e6 simplified and tidied the proofs
paulson
parents: 5053
diff changeset
   339
(**LEVEL 6**)
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   340
by (Blast_tac 1);
5064
77bd19f782e6 simplified and tidied the proofs
paulson
parents: 5053
diff changeset
   341
by (Clarify_tac 1);
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   342
by (dtac Crypt_imp_invKey_keysFor 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   343
by (Asm_full_simp_tac 1);
5064
77bd19f782e6 simplified and tidied the proofs
paulson
parents: 5053
diff changeset
   344
by (blast_tac (claset() addDs [A_trusts_K_by_Kb2, unique_session_keys]) 1);
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   345
val lemma_A = result();
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   346
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   347
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   348
(*AUTHENTICATION OF A TO B*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   349
Goal "[| Crypt K {|Agent A, Number Ta|} \\<in> parts (spies evs);  \
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   350
\        Crypt (shrK B) {|Number Ts, Agent A, Key K|}         \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   351
\        \\<in> parts (spies evs);                                 \
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   352
\        ~ Expired Ts evs;                                    \
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   353
\        A \\<notin> bad;  B \\<notin> bad;  evs \\<in> kerberos_ban |]          \
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   354
\     ==> Says A B {|Crypt (shrK B) {|Number Ts, Agent A, Key K|}, \    
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 11150
diff changeset
   355
\                    Crypt K {|Agent A, Number Ta|}|} \\<in> set evs";
5053
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   356
by (blast_tac (claset() addSDs [B_trusts_K_by_Kb3]
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   357
                        addSIs [lemma_A RS mp RS mp RS mp]
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   358
                        addSEs [Confidentiality_S RSN (2,rev_notE)]) 1);
75d20f367e94 New example Kerberos_BAN by G Bella
paulson
parents:
diff changeset
   359
qed "Authentication_A";