src/HOL/Auth/WooLam.ML
author paulson
Wed, 02 Sep 1998 10:35:11 +0200
changeset 5421 01fc8d6a40f2
parent 5223 4cb05273f764
child 5434 9b4bed3f394c
permissions -rw-r--r--
small simplification to not_Says_to_self
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
     1
(*  Title:      HOL/Auth/WooLam
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
     2
    ID:         $Id$
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
     4
    Copyright   1996  University of Cambridge
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
     5
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
     6
Inductive relation "woolam" for the Woo-Lam protocol.
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
     7
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
     8
Simplified version from page 11 of
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
     9
  Abadi and Needham.  Prudent Engineering Practice for Cryptographic Protocols.
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    10
  IEEE Trans. S.E. 22(1), 1996, pages 6-15.
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    11
*)
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    12
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
    13
AddEs spies_partsEs;
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
    14
AddDs [impOfSubs analz_subset_parts];
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
    15
AddDs [impOfSubs Fake_parts_insert];
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
    16
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    17
2321
083912bc5775 Updated a comment
paulson
parents: 2283
diff changeset
    18
(*A "possibility property": there are traces that reach the end*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    19
Goal "[| A ~= B; A ~= Server; B ~= Server |]   \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    20
\     ==> EX NB. EX evs: woolam.               \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    21
\           Says Server B (Crypt (shrK B) {|Agent A, Nonce NB|}) : set evs";
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    22
by (REPEAT (resolve_tac [exI,bexI] 1));
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    23
by (rtac (woolam.Nil RS woolam.WL1 RS woolam.WL2 RS woolam.WL3 RS 
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2451
diff changeset
    24
          woolam.WL4 RS woolam.WL5) 2);
3471
cd37ec057028 Now the possibility proof calls the appropriate tactic
paulson
parents: 3466
diff changeset
    25
by possibility_tac;
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    26
result();
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    27
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    28
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    29
(**** Inductive proofs about woolam ****)
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    30
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    31
(*Nobody sends themselves messages*)
5421
01fc8d6a40f2 small simplification to not_Says_to_self
paulson
parents: 5223
diff changeset
    32
Goal "evs : woolam ==> ALL X. Says A A X ~: set evs";
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    33
by (etac woolam.induct 1);
4477
b3e5857d8d99 New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents: 4470
diff changeset
    34
by Auto_tac;
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    35
qed_spec_mp "not_Says_to_self";
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    36
Addsimps [not_Says_to_self];
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    37
AddSEs   [not_Says_to_self RSN (2, rev_notE)];
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    38
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    39
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    40
(** For reasoning about the encrypted portion of messages **)
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    41
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    42
Goal "Says A' B X : set evs ==> X : analz (spies evs)";
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3519
diff changeset
    43
by (etac (Says_imp_spies RS analz.Inj) 1);
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3519
diff changeset
    44
qed "WL4_analz_spies";
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    45
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3519
diff changeset
    46
bind_thm ("WL4_parts_spies",
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3519
diff changeset
    47
          WL4_analz_spies RS (impOfSubs analz_subset_parts));
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    48
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3519
diff changeset
    49
(*For proving the easier theorems about X ~: parts (spies evs) *)
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3471
diff changeset
    50
fun parts_induct_tac i = 
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3471
diff changeset
    51
    etac woolam.induct i  THEN 
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3519
diff changeset
    52
    forward_tac [WL4_parts_spies] (i+5)  THEN
3471
cd37ec057028 Now the possibility proof calls the appropriate tactic
paulson
parents: 3466
diff changeset
    53
    prove_simple_subgoals_tac 1;
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    54
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    55
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3519
diff changeset
    56
(** Theorems of the form X ~: parts (spies evs) imply that NOBODY
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    57
    sends messages containing X! **)
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    58
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3519
diff changeset
    59
(*Spy never sees another agent's shared key! (unless it's bad at start)*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    60
Goal "evs : woolam ==> (Key (shrK A) : parts (spies evs)) = (A : bad)";
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3471
diff changeset
    61
by (parts_induct_tac 1);
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
    62
by (Blast_tac 1);
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    63
qed "Spy_see_shrK";
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    64
Addsimps [Spy_see_shrK];
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    65
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    66
Goal "evs : woolam ==> (Key (shrK A) : analz (spies evs)) = (A : bad)";
4477
b3e5857d8d99 New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents: 4470
diff changeset
    67
by Auto_tac;
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    68
qed "Spy_analz_shrK";
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    69
Addsimps [Spy_analz_shrK];
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    70
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
    71
AddSDs [Spy_see_shrK RSN (2, rev_iffD1), 
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
    72
	Spy_analz_shrK RSN (2, rev_iffD1)];
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    73
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    74
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    75
(**** Autheticity properties for Woo-Lam ****)
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    76
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    77
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    78
(*** WL4 ***)
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    79
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    80
(*If the encrypted message appears then it originated with Alice*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    81
Goal "[| Crypt (shrK A) (Nonce NB) : parts (spies evs);  \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    82
\        A ~: bad;  evs : woolam |]                      \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    83
\     ==> EX B. Says A B (Crypt (shrK A) (Nonce NB)) : set evs";
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
    84
by (etac rev_mp 1);
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3471
diff changeset
    85
by (parts_induct_tac 1);
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
    86
by (ALLGOALS Blast_tac);
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
    87
qed "NB_Crypt_imp_Alice_msg";
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    88
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    89
(*Guarantee for Server: if it gets a message containing a certificate from 
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    90
  Alice, then she originated that certificate.  But we DO NOT know that B
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    91
  ever saw it: the Spy may have rerouted the message to the Server.*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    92
Goal "[| Says B' Server {|Agent A, Agent B, Crypt (shrK A) (Nonce NB)|} \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    93
\          : set evs;                                                   \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    94
\        A ~: bad;  evs : woolam |]                                     \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    95
\     ==> EX B. Says A B (Crypt (shrK A) (Nonce NB)) : set evs";
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
    96
by (blast_tac (claset() addSIs [NB_Crypt_imp_Alice_msg]) 1);
2321
083912bc5775 Updated a comment
paulson
parents: 2283
diff changeset
    97
qed "Server_trusts_WL4";
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
    98
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
    99
AddDs [Server_trusts_WL4];
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
   100
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
   101
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
   102
(*** WL5 ***)
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
   103
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
   104
(*Server sent WL5 only if it received the right sort of message*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   105
Goal "[| Says Server B (Crypt (shrK B) {|Agent A, NB|}) : set evs;      \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   106
\        evs : woolam |]                                                \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   107
\     ==> EX B'. Says B' Server {|Agent A, Agent B, Crypt (shrK A) NB|} \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   108
\            : set evs";
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
   109
by (etac rev_mp 1);
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3471
diff changeset
   110
by (parts_induct_tac 1);
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   111
by (ALLGOALS Blast_tac);
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
   112
qed "Server_sent_WL5";
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
   113
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
   114
AddDs [Server_sent_WL5];
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
   115
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
   116
(*If the encrypted message appears then it originated with the Server!*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   117
Goal "[| Crypt (shrK B) {|Agent A, NB|} : parts (spies evs);  \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   118
\        B ~: bad;  evs : woolam |]                           \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   119
\     ==> Says Server B (Crypt (shrK B) {|Agent A, NB|}) : set evs";
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
   120
by (etac rev_mp 1);
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3471
diff changeset
   121
by (parts_induct_tac 1);
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
   122
by (Blast_tac 1);
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
   123
qed_spec_mp "NB_Crypt_imp_Server_msg";
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
   124
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
   125
(*Guarantee for B.  If B gets the Server's certificate then A has encrypted
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
   126
  the nonce using her key.  This event can be no older than the nonce itself.
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
   127
  But A may have sent the nonce to some other agent and it could have reached
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
   128
  the Server via the Spy.*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   129
Goal "[| Says S B (Crypt (shrK B) {|Agent A, Nonce NB|}): set evs; \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   130
\        A ~: bad;  B ~: bad;  evs : woolam  |]                  \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   131
\     ==> EX B. Says A B (Crypt (shrK A) (Nonce NB)) : set evs";
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
   132
by (blast_tac (claset() addSDs [NB_Crypt_imp_Server_msg]) 1);
2321
083912bc5775 Updated a comment
paulson
parents: 2283
diff changeset
   133
qed "B_trusts_WL5";
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
   134
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
   135
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
   136
(*B only issues challenges in response to WL1.  Not used.*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   137
Goal "[| Says B A (Nonce NB) : set evs;  B ~= Spy;  evs : woolam |]  \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   138
\     ==> EX A'. Says A' B (Agent A) : set evs";
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
   139
by (etac rev_mp 1);
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3471
diff changeset
   140
by (parts_induct_tac 1);
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   141
by (ALLGOALS Blast_tac);
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
   142
qed "B_said_WL2";
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
   143
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
   144
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
   145
(**CANNOT be proved because A doesn't know where challenges come from...
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   146
Goal "[| A ~: bad;  B ~= Spy;  evs : woolam |]           \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   147
\ ==> Crypt (shrK A) (Nonce NB) : parts (spies evs) &  \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   148
\     Says B A (Nonce NB) : set evs                       \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   149
\     --> Says A B (Crypt (shrK A) (Nonce NB)) : set evs";
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3471
diff changeset
   150
by (parts_induct_tac 1);
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
   151
by (Blast_tac 1);
3730
6933d20f335f Step_tac -> Safe_tac
paulson
parents: 3683
diff changeset
   152
by Safe_tac;
2274
1b1b46adc9b3 Addition of Woo-Lam protocol
paulson
parents:
diff changeset
   153
**)