src/HOL/Auth/Recur.thy
author paulson
Tue, 12 Aug 2003 13:35:03 +0200
changeset 14145 2e31b8cc8788
parent 13956 8fe7e12290e1
child 14200 d8598e24f8fa
permissions -rw-r--r--
ZhouGollmann: new example (fair non-repudiation protocol)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     1
(*  Title:      HOL/Auth/Recur
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     2
    ID:         $Id$
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     4
    Copyright   1996  University of Cambridge
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     5
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     6
Inductive relation "recur" for the Recursive Authentication protocol.
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     7
*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     8
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
     9
theory Recur = Shared:
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    10
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
    11
text{*End marker for message bundles*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    12
syntax        END :: "msg"
5434
9b4bed3f394c Got rid of not_Says_to_self and most uses of ~= in definitions and theorems
paulson
parents: 5359
diff changeset
    13
translations "END" == "Number 0"
9b4bed3f394c Got rid of not_Says_to_self and most uses of ~= in definitions and theorems
paulson
parents: 5359
diff changeset
    14
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    15
(*Two session keys are distributed to each agent except for the initiator,
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    16
        who receives one.
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    17
  Perhaps the two session keys could be bundled into a single message.
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    18
*)
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    19
consts     respond :: "event list => (msg*msg*key)set"
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    20
inductive "respond evs" (*Server's response to the nested message*)
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    21
  intros
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    22
   One:  "Key KAB \<notin> used evs
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    23
          ==> (Hash[Key(shrK A)] {|Agent A, Agent B, Nonce NA, END|},
5434
9b4bed3f394c Got rid of not_Says_to_self and most uses of ~= in definitions and theorems
paulson
parents: 5359
diff changeset
    24
               {|Crypt (shrK A) {|Key KAB, Agent B, Nonce NA|}, END|},
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    25
               KAB)   \<in> respond evs"
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    26
2532
cde25bf71cc1 Improved layout and updated comments
paulson
parents: 2516
diff changeset
    27
    (*The most recent session key is passed up to the caller*)
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    28
   Cons: "[| (PA, RA, KAB) \<in> respond evs;
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    29
             Key KBC \<notin> used evs;  Key KBC \<notin> parts {RA};
5434
9b4bed3f394c Got rid of not_Says_to_self and most uses of ~= in definitions and theorems
paulson
parents: 5359
diff changeset
    30
             PA = Hash[Key(shrK A)] {|Agent A, Agent B, Nonce NA, P|} |]
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    31
          ==> (Hash[Key(shrK B)] {|Agent B, Agent C, Nonce NB, PA|},
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    32
               {|Crypt (shrK B) {|Key KBC, Agent C, Nonce NB|},
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2532
diff changeset
    33
                 Crypt (shrK B) {|Key KAB, Agent A, Nonce NB|},
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    34
                 RA|},
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    35
               KBC)
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    36
              \<in> respond evs"
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    37
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    38
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2451
diff changeset
    39
(*Induction over "respond" can be difficult due to the complexity of the
2532
cde25bf71cc1 Improved layout and updated comments
paulson
parents: 2516
diff changeset
    40
  subgoals.  Set "responses" captures the general form of certificates.
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    41
*)
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    42
consts     responses :: "event list => msg set"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    43
inductive "responses evs"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    44
  intros
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    45
    (*Server terminates lists*)
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    46
   Nil:  "END \<in> responses evs"
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    47
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    48
   Cons: "[| RA \<in> responses evs;  Key KAB \<notin> used evs |]
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    49
          ==> {|Crypt (shrK B) {|Key KAB, Agent A, Nonce NB|},
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    50
                RA|}  \<in> responses evs"
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    51
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    52
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    53
consts     recur   :: "event list set"
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3466
diff changeset
    54
inductive "recur"
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    55
  intros
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    56
         (*Initial trace is empty*)
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    57
   Nil:  "[] \<in> recur"
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    58
2532
cde25bf71cc1 Improved layout and updated comments
paulson
parents: 2516
diff changeset
    59
         (*The spy MAY say anything he CAN say.  Common to
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    60
           all similar protocols.*)
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    61
   Fake: "[| evsf \<in> recur;  X \<in> synth (analz (knows Spy evsf)) |]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    62
          ==> Says Spy B X  # evsf \<in> recur"
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    63
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    64
         (*Alice initiates a protocol run.
5434
9b4bed3f394c Got rid of not_Says_to_self and most uses of ~= in definitions and theorems
paulson
parents: 5359
diff changeset
    65
           END is a placeholder to terminate the nesting.*)
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    66
   RA1:  "[| evs1: recur;  Nonce NA \<notin> used evs1 |]
5434
9b4bed3f394c Got rid of not_Says_to_self and most uses of ~= in definitions and theorems
paulson
parents: 5359
diff changeset
    67
          ==> Says A B (Hash[Key(shrK A)] {|Agent A, Agent B, Nonce NA, END|})
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    68
              # evs1 \<in> recur"
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    69
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    70
         (*Bob's response to Alice's message.  C might be the Server.
4552
bb8ff763c93d Simplified proofs by omitting PA = {|XA, ...|} from RA2
paulson
parents: 3683
diff changeset
    71
           We omit PA = {|XA, Agent A, Agent B, Nonce NA, P|} because
bb8ff763c93d Simplified proofs by omitting PA = {|XA, ...|} from RA2
paulson
parents: 3683
diff changeset
    72
           it complicates proofs, so B may respond to any message at all!*)
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    73
   RA2:  "[| evs2: recur;  Nonce NB \<notin> used evs2;
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    74
             Says A' B PA \<in> set evs2 |]
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    75
          ==> Says B C (Hash[Key(shrK B)] {|Agent B, Agent C, Nonce NB, PA|})
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    76
              # evs2 \<in> recur"
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    77
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2532
diff changeset
    78
         (*The Server receives Bob's message and prepares a response.*)
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    79
   RA3:  "[| evs3: recur;  Says B' Server PB \<in> set evs3;
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    80
             (PB,RB,K) \<in> respond evs3 |]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    81
          ==> Says Server B RB # evs3 \<in> recur"
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    82
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    83
         (*Bob receives the returned message and compares the Nonces with
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    84
           those in the message he previously sent the Server.*)
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    85
   RA4:  "[| evs4: recur;
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    86
             Says B  C {|XH, Agent B, Agent C, Nonce NB,
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    87
                         XA, Agent A, Agent B, Nonce NA, P|} \<in> set evs4;
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    88
             Says C' B {|Crypt (shrK B) {|Key KBC, Agent C, Nonce NB|},
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    89
                         Crypt (shrK B) {|Key KAB, Agent A, Nonce NB|},
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    90
                         RA|} \<in> set evs4 |]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    91
          ==> Says B A RA # evs4 \<in> recur"
5359
bd539b72d484 Tidying
paulson
parents: 4552
diff changeset
    92
bd539b72d484 Tidying
paulson
parents: 4552
diff changeset
    93
   (*No "oops" message can easily be expressed.  Each session key is
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
    94
     associated--in two separate messages--with two nonces.  This is
5359
bd539b72d484 Tidying
paulson
parents: 4552
diff changeset
    95
     one try, but it isn't that useful.  Re domino attack, note that
bd539b72d484 Tidying
paulson
parents: 4552
diff changeset
    96
     Recur.ML proves that each session key is secure provided the two
bd539b72d484 Tidying
paulson
parents: 4552
diff changeset
    97
     peers are, even if there are compromised agents elsewhere in
bd539b72d484 Tidying
paulson
parents: 4552
diff changeset
    98
     the chain.  Oops cases proved using parts_cut, Key_in_keysFor_parts,
bd539b72d484 Tidying
paulson
parents: 4552
diff changeset
    99
     etc.
bd539b72d484 Tidying
paulson
parents: 4552
diff changeset
   100
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   101
   Oops:  "[| evso: recur;  Says Server B RB \<in> set evso;
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   102
	      RB \<in> responses evs';  Key K \<in> parts {RB} |]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   103
           ==> Notes Spy {|Key K, RB|} # evso \<in> recur"
5359
bd539b72d484 Tidying
paulson
parents: 4552
diff changeset
   104
  *)
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   105
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   106
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   107
declare Says_imp_knows_Spy [THEN analz.Inj, dest]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   108
declare parts.Body  [dest]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   109
declare analz_into_parts [dest]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   110
declare Fake_parts_insert_in_Un  [dest]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   111
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   112
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   113
(** Possibility properties: traces that reach the end
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   114
        ONE theorem would be more elegant and faster!
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   115
        By induction on a list of agents (no repetitions)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   116
**)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   117
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   118
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   119
text{*Simplest case: Alice goes directly to the server*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   120
lemma "\<exists>K NA. \<exists>evs \<in> recur.
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   121
   Says Server A {|Crypt (shrK A) {|Key K, Agent Server, Nonce NA|},
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   122
                   END|}  \<in> set evs"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   123
apply (intro exI bexI)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   124
apply (rule_tac [2] recur.Nil [THEN recur.RA1, 
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   125
                             THEN recur.RA3 [OF _ _ respond.One]], possibility)
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   126
done
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   127
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   128
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   129
text{*Case two: Alice, Bob and the server*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   130
lemma "\<exists>K. \<exists>NA. \<exists>evs \<in> recur.
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   131
        Says B A {|Crypt (shrK A) {|Key K, Agent B, Nonce NA|},
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   132
                   END|}  \<in> set evs"
13507
febb8e5d2a9d tidying of Isar scripts
paulson
parents: 11655
diff changeset
   133
apply (cut_tac Nonce_supply2 Key_supply2, clarify)
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   134
apply (intro exI bexI)
11270
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   135
apply (rule_tac [2] 
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   136
          recur.Nil [THEN recur.RA1, 
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   137
                     THEN recur.RA2,
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   138
                     THEN recur.RA3 [OF _ _ respond.One [THEN respond.Cons]],
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   139
                     THEN recur.RA4])
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   140
apply (tactic "basic_possibility_tac")
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   141
apply (tactic
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   142
      "DEPTH_SOLVE (eresolve_tac [asm_rl, less_not_refl2, less_not_refl3] 1)")
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   143
done
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   144
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   145
(*Case three: Alice, Bob, Charlie and the server
11270
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   146
  Rather slow (16 seconds) to run every time...
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   147
lemma "\<exists>K. \<exists>NA. \<exists>evs \<in> recur.
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   148
        Says B A {|Crypt (shrK A) {|Key K, Agent B, Nonce NA|},
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   149
                   END|}  \<in> set evs"
13507
febb8e5d2a9d tidying of Isar scripts
paulson
parents: 11655
diff changeset
   150
apply (tactic "cut_facts_tac [Nonce_supply3, Key_supply3] 1", clarify)
11270
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   151
apply (intro exI bexI)
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   152
apply (rule_tac [2] 
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   153
          recur.Nil [THEN recur.RA1, 
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   154
                     THEN recur.RA2, THEN recur.RA2,
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   155
                     THEN recur.RA3 
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   156
                          [OF _ _ respond.One 
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   157
                                  [THEN respond.Cons, THEN respond.Cons]],
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   158
                     THEN recur.RA4, THEN recur.RA4])
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   159
apply (tactic "basic_possibility_tac")
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   160
apply (tactic
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   161
      "DEPTH_SOLVE (swap_res_tac [refl, conjI, disjCI] 1 ORELSE \
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   162
\                   eresolve_tac [asm_rl, less_not_refl2, less_not_refl3] 1)")
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   163
done
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   164
*)
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   165
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   166
(**** Inductive proofs about recur ****)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   167
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   168
lemma respond_imp_not_used: "(PA,RB,KAB) \<in> respond evs ==> Key KAB \<notin> used evs"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   169
by (erule respond.induct, simp_all)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   170
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   171
lemma Key_in_parts_respond [rule_format]:
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   172
   "[| Key K \<in> parts {RB};  (PB,RB,K') \<in> respond evs |] ==> Key K \<notin> used evs"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   173
apply (erule rev_mp, erule respond.induct)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   174
apply (auto dest: Key_not_used respond_imp_not_used)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   175
done
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   176
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   177
text{*Simple inductive reasoning about responses*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   178
lemma respond_imp_responses:
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   179
     "(PA,RB,KAB) \<in> respond evs ==> RB \<in> responses evs"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   180
apply (erule respond.induct)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   181
apply (blast intro!: respond_imp_not_used responses.intros)+
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   182
done
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   183
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   184
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   185
(** For reasoning about the encrypted portion of messages **)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   186
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   187
lemmas RA2_analz_spies = Says_imp_spies [THEN analz.Inj]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   188
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   189
lemma RA4_analz_spies:
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   190
     "Says C' B {|Crypt K X, X', RA|} \<in> set evs ==> RA \<in> analz (spies evs)"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   191
by blast
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   192
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   193
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   194
(*RA2_analz... and RA4_analz... let us treat those cases using the same
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   195
  argument as for the Fake case.  This is possible for most, but not all,
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   196
  proofs: Fake does not invent new nonces (as in RA2), and of course Fake
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   197
  messages originate from the Spy. *)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   198
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   199
lemmas RA2_parts_spies =  RA2_analz_spies [THEN analz_into_parts]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   200
lemmas RA4_parts_spies =  RA4_analz_spies [THEN analz_into_parts]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   201
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   202
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   203
(** Theorems of the form X \<notin> parts (spies evs) imply that NOBODY
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   204
    sends messages containing X! **)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   205
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   206
(** Spy never sees another agent's shared key! (unless it's bad at start) **)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   207
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   208
lemma Spy_see_shrK [simp]:
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   209
     "evs \<in> recur ==> (Key (shrK A) \<in> parts (spies evs)) = (A \<in> bad)"
13507
febb8e5d2a9d tidying of Isar scripts
paulson
parents: 11655
diff changeset
   210
apply (erule recur.induct, auto)
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   211
txt{*RA3.  It's ugly to call auto twice, but it seems necessary.*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   212
apply (auto dest: Key_in_parts_respond simp add: parts_insert_spies)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   213
done
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   214
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   215
lemma Spy_analz_shrK [simp]:
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   216
     "evs \<in> recur ==> (Key (shrK A) \<in> analz (spies evs)) = (A \<in> bad)"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   217
by auto
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   218
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   219
lemma Spy_see_shrK_D [dest!]:
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   220
     "[|Key (shrK A) \<in> parts (knows Spy evs);  evs \<in> recur|] ==> A \<in> bad"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   221
by (blast dest: Spy_see_shrK)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   222
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   223
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   224
(*** Proofs involving analz ***)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   225
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   226
(** Session keys are not used to encrypt other session keys **)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   227
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   228
(*Version for "responses" relation.  Handles case RA3 in the theorem below.
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   229
  Note that it holds for *any* set H (not just "spies evs")
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   230
  satisfying the inductive hypothesis.*)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   231
lemma resp_analz_image_freshK_lemma:
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   232
     "[| RB \<in> responses evs;
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   233
         \<forall>K KK. KK \<subseteq> - (range shrK) -->
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   234
                   (Key K \<in> analz (Key`KK Un H)) =
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   235
                   (K \<in> KK | Key K \<in> analz H) |]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   236
     ==> \<forall>K KK. KK \<subseteq> - (range shrK) -->
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   237
                   (Key K \<in> analz (insert RB (Key`KK Un H))) =
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   238
                   (K \<in> KK | Key K \<in> analz (insert RB H))"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   239
by (erule responses.induct,
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   240
    simp_all del: image_insert
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   241
	     add: analz_image_freshK_simps)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   242
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   243
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   244
text{*Version for the protocol.  Proof is almost trivial, thanks to the lemma.*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   245
lemma raw_analz_image_freshK:
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   246
 "evs \<in> recur ==>
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   247
   \<forall>K KK. KK \<subseteq> - (range shrK) -->
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   248
          (Key K \<in> analz (Key`KK Un (spies evs))) =
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   249
          (K \<in> KK | Key K \<in> analz (spies evs))"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   250
apply (erule recur.induct)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   251
apply (drule_tac [4] RA2_analz_spies,
11281
f2a284b2d588 minor tweaks
paulson
parents: 11270
diff changeset
   252
       drule_tac [5] respond_imp_responses,
13507
febb8e5d2a9d tidying of Isar scripts
paulson
parents: 11655
diff changeset
   253
       drule_tac [6] RA4_analz_spies, analz_freshK, spy_analz)
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   254
txt{*RA3*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   255
apply (simp_all add: resp_analz_image_freshK_lemma)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   256
done
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   257
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   258
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   259
(*Instance of the lemma with H replaced by (spies evs):
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   260
   [| RB \<in> responses evs;  evs \<in> recur; |]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   261
   ==> KK \<subseteq> - (range shrK) -->
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   262
       Key K \<in> analz (insert RB (Key`KK Un spies evs)) =
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   263
       (K \<in> KK | Key K \<in> analz (insert RB (spies evs)))
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   264
*)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   265
lemmas resp_analz_image_freshK =  
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   266
       resp_analz_image_freshK_lemma [OF _ raw_analz_image_freshK]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   267
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   268
lemma analz_insert_freshK:
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   269
     "[| evs \<in> recur;  KAB \<notin> range shrK |]
11655
923e4d0d36d5 tuned parentheses in relational expressions;
wenzelm
parents: 11281
diff changeset
   270
      ==> (Key K \<in> analz (insert (Key KAB) (spies evs))) =
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   271
          (K = KAB | Key K \<in> analz (spies evs))"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   272
by (simp del: image_insert
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   273
         add: analz_image_freshK_simps raw_analz_image_freshK)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   274
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   275
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   276
text{*Everything that's hashed is already in past traffic. *}
11270
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   277
lemma Hash_imp_body:
a315a3862bb4 better treatment of methods: uses Method.ctxt_args to refer to current
paulson
parents: 11264
diff changeset
   278
     "[| Hash {|Key(shrK A), X|} \<in> parts (spies evs);
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   279
         evs \<in> recur;  A \<notin> bad |] ==> X \<in> parts (spies evs)"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   280
apply (erule rev_mp)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   281
apply (erule recur.induct,
11281
f2a284b2d588 minor tweaks
paulson
parents: 11270
diff changeset
   282
       drule_tac [6] RA4_parts_spies,
f2a284b2d588 minor tweaks
paulson
parents: 11270
diff changeset
   283
       drule_tac [5] respond_imp_responses,
f2a284b2d588 minor tweaks
paulson
parents: 11270
diff changeset
   284
       drule_tac [4] RA2_parts_spies)
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   285
txt{*RA3 requires a further induction*}
13507
febb8e5d2a9d tidying of Isar scripts
paulson
parents: 11655
diff changeset
   286
apply (erule_tac [5] responses.induct, simp_all)
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   287
txt{*Fake*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   288
apply (blast intro: parts_insertI)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   289
done
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   290
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   291
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   292
(** The Nonce NA uniquely identifies A's message.
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   293
    This theorem applies to steps RA1 and RA2!
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   294
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   295
  Unicity is not used in other proofs but is desirable in its own right.
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   296
**)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   297
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   298
lemma unique_NA:
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   299
  "[| Hash {|Key(shrK A), Agent A, B, NA, P|} \<in> parts (spies evs);
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   300
      Hash {|Key(shrK A), Agent A, B',NA, P'|} \<in> parts (spies evs);
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   301
      evs \<in> recur;  A \<notin> bad |]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   302
    ==> B=B' & P=P'"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   303
apply (erule rev_mp, erule rev_mp)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   304
apply (erule recur.induct,
11281
f2a284b2d588 minor tweaks
paulson
parents: 11270
diff changeset
   305
       drule_tac [5] respond_imp_responses)
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   306
apply (force, simp_all)
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   307
txt{*Fake*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   308
apply blast
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   309
apply (erule_tac [3] responses.induct)
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   310
txt{*RA1,2: creation of new Nonce*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   311
apply simp_all
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   312
apply (blast dest!: Hash_imp_body)+
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   313
done
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   314
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   315
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   316
(*** Lemmas concerning the Server's response
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   317
      (relations "respond" and "responses")
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   318
***)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   319
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   320
lemma shrK_in_analz_respond [simp]:
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   321
     "[| RB \<in> responses evs;  evs \<in> recur |]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   322
  ==> (Key (shrK B) \<in> analz (insert RB (spies evs))) = (B:bad)"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   323
by (erule responses.induct,
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   324
    simp_all del: image_insert
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   325
             add: analz_image_freshK_simps resp_analz_image_freshK)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   326
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   327
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   328
lemma resp_analz_insert_lemma:
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   329
     "[| Key K \<in> analz (insert RB H);
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   330
         \<forall>K KK. KK \<subseteq> - (range shrK) -->
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   331
                   (Key K \<in> analz (Key`KK Un H)) =
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   332
                   (K \<in> KK | Key K \<in> analz H);
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   333
         RB \<in> responses evs |]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   334
     ==> (Key K \<in> parts{RB} | Key K \<in> analz H)"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   335
apply (erule rev_mp, erule responses.induct)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   336
apply (simp_all del: image_insert
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   337
             add: analz_image_freshK_simps resp_analz_image_freshK_lemma)
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   338
txt{*Simplification using two distinct treatments of "image"*}
13507
febb8e5d2a9d tidying of Isar scripts
paulson
parents: 11655
diff changeset
   339
apply (simp add: parts_insert2, blast)
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   340
done
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   341
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   342
lemmas resp_analz_insert =
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   343
       resp_analz_insert_lemma [OF _ raw_analz_image_freshK]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   344
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   345
text{*The last key returned by respond indeed appears in a certificate*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   346
lemma respond_certificate:
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   347
     "(Hash[Key(shrK A)] {|Agent A, B, NA, P|}, RA, K) \<in> respond evs
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   348
      ==> Crypt (shrK A) {|Key K, B, NA|} \<in> parts {RA}"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   349
apply (ind_cases "(X, RA, K) \<in> respond evs")
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   350
apply simp_all
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   351
done
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   352
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   353
(*This unicity proof differs from all the others in the HOL/Auth directory.
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   354
  The conclusion isn't quite unicity but duplicity, in that there are two
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   355
  possibilities.  Also, the presence of two different matching messages in
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   356
  the inductive step complicates the case analysis.  Unusually for such proofs,
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   357
  the quantifiers appear to be necessary.*)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   358
lemma unique_lemma [rule_format]:
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   359
     "(PB,RB,KXY) \<in> respond evs ==>
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   360
      \<forall>A B N. Crypt (shrK A) {|Key K, Agent B, N|} \<in> parts {RB} -->
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   361
      (\<forall>A' B' N'. Crypt (shrK A') {|Key K, Agent B', N'|} \<in> parts {RB} -->
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   362
      (A'=A & B'=B) | (A'=B & B'=A))"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   363
apply (erule respond.induct)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   364
apply (simp_all add: all_conj_distrib)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   365
apply (blast dest: respond_certificate)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   366
done
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   367
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   368
lemma unique_session_keys:
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   369
     "[| Crypt (shrK A) {|Key K, Agent B, N|} \<in> parts {RB};
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   370
         Crypt (shrK A') {|Key K, Agent B', N'|} \<in> parts {RB};
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   371
         (PB,RB,KXY) \<in> respond evs |]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   372
      ==> (A'=A & B'=B) | (A'=B & B'=A)"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   373
by (rule unique_lemma, auto)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   374
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   375
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   376
(** Crucial secrecy property: Spy does not see the keys sent in msg RA3
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   377
    Does not in itself guarantee security: an attack could violate
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   378
    the premises, e.g. by having A=Spy **)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   379
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   380
lemma respond_Spy_not_see_session_key [rule_format]:
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   381
     "[| (PB,RB,KAB) \<in> respond evs;  evs \<in> recur |]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   382
      ==> \<forall>A A' N. A \<notin> bad & A' \<notin> bad -->
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   383
          Crypt (shrK A) {|Key K, Agent A', N|} \<in> parts{RB} -->
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   384
          Key K \<notin> analz (insert RB (spies evs))"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   385
apply (erule respond.induct)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   386
apply (frule_tac [2] respond_imp_responses)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   387
apply (frule_tac [2] respond_imp_not_used)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   388
apply (simp_all del: image_insert
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   389
                add: analz_image_freshK_simps split_ifs shrK_in_analz_respond
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   390
                     resp_analz_image_freshK parts_insert2)
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   391
txt{*Base case of respond*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   392
apply blast
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   393
txt{*Inductive step of respond*}
13507
febb8e5d2a9d tidying of Isar scripts
paulson
parents: 11655
diff changeset
   394
apply (intro allI conjI impI, simp_all)
13956
8fe7e12290e1 improved presentation of HOL/Auth theories
paulson
parents: 13935
diff changeset
   395
txt{*by unicity, either @{term "B=Aa"} or @{term "B=A'"}, a contradiction
8fe7e12290e1 improved presentation of HOL/Auth theories
paulson
parents: 13935
diff changeset
   396
     if @{term "B \<in> bad"}*}   
13935
paulson
parents: 13922
diff changeset
   397
apply (blast dest: unique_session_keys respond_certificate)
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   398
apply (blast dest!: respond_certificate)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   399
apply (blast dest!: resp_analz_insert)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   400
done
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   401
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   402
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   403
lemma Spy_not_see_session_key:
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   404
     "[| Crypt (shrK A) {|Key K, Agent A', N|} \<in> parts (spies evs);
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   405
         A \<notin> bad;  A' \<notin> bad;  evs \<in> recur |]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   406
      ==> Key K \<notin> analz (spies evs)"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   407
apply (erule rev_mp)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   408
apply (erule recur.induct)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   409
apply (drule_tac [4] RA2_analz_spies,
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   410
       frule_tac [5] respond_imp_responses,
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   411
       drule_tac [6] RA4_analz_spies,
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   412
       simp_all add: split_ifs analz_insert_eq analz_insert_freshK)
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   413
txt{*Fake*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   414
apply spy_analz
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   415
txt{*RA2*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   416
apply blast 
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   417
txt{*RA3 remains*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   418
apply (simp add: parts_insert_spies)
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   419
txt{*Now we split into two cases.  A single blast could do it, but it would take
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   420
  a CPU minute.*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   421
apply (safe del: impCE)
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   422
txt{*RA3, case 1: use lemma previously proved by induction*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   423
apply (blast elim: rev_notE [OF _ respond_Spy_not_see_session_key])
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   424
txt{*RA3, case 2: K is an old key*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   425
apply (blast dest: resp_analz_insert dest: Key_in_parts_respond)
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   426
txt{*RA4*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   427
apply blast 
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   428
done
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   429
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   430
(**** Authenticity properties for Agents ****)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   431
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   432
text{*The response never contains Hashes*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   433
lemma Hash_in_parts_respond:
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   434
     "[| Hash {|Key (shrK B), M|} \<in> parts (insert RB H);
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   435
         (PB,RB,K) \<in> respond evs |]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   436
      ==> Hash {|Key (shrK B), M|} \<in> parts H"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   437
apply (erule rev_mp)
13507
febb8e5d2a9d tidying of Isar scripts
paulson
parents: 11655
diff changeset
   438
apply (erule respond_imp_responses [THEN responses.induct], auto)
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   439
done
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   440
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   441
text{*Only RA1 or RA2 can have caused such a part of a message to appear.
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   442
  This result is of no use to B, who cannot verify the Hash.  Moreover,
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   443
  it can say nothing about how recent A's message is.  It might later be
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   444
  used to prove B's presence to A at the run's conclusion.*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   445
lemma Hash_auth_sender [rule_format]:
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   446
     "[| Hash {|Key(shrK A), Agent A, Agent B, NA, P|} \<in> parts(spies evs);
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   447
         A \<notin> bad;  evs \<in> recur |]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   448
      ==> Says A B (Hash[Key(shrK A)] {|Agent A, Agent B, NA, P|}) \<in> set evs"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   449
apply (unfold HPair_def)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   450
apply (erule rev_mp)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   451
apply (erule recur.induct,
11281
f2a284b2d588 minor tweaks
paulson
parents: 11270
diff changeset
   452
       drule_tac [6] RA4_parts_spies,
f2a284b2d588 minor tweaks
paulson
parents: 11270
diff changeset
   453
       drule_tac [4] RA2_parts_spies,
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   454
       simp_all)
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   455
txt{*Nil*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   456
apply force
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   457
txt{*Fake, RA3*}
11281
f2a284b2d588 minor tweaks
paulson
parents: 11270
diff changeset
   458
apply (blast dest: Hash_in_parts_respond)+
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   459
done
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   460
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   461
(** These two results subsume (for all agents) the guarantees proved
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   462
    separately for A and B in the Otway-Rees protocol.
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   463
**)
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   464
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   465
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   466
text{*Certificates can only originate with the Server.*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   467
lemma Cert_imp_Server_msg:
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   468
     "[| Crypt (shrK A) Y \<in> parts (spies evs);
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   469
         A \<notin> bad;  evs \<in> recur |]
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   470
      ==> \<exists>C RC. Says Server C RC \<in> set evs  &
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   471
                   Crypt (shrK A) Y \<in> parts {RC}"
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   472
apply (erule rev_mp, erule recur.induct, simp_all)
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   473
txt{*Fake*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   474
apply blast
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   475
txt{*RA1*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   476
apply blast
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   477
txt{*RA2: it cannot be a new Nonce, contradiction.*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   478
apply blast
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   479
txt{*RA3.  Pity that the proof is so brittle: this step requires the rewriting,
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   480
       which however would break all other steps.*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   481
apply (simp add: parts_insert_spies, blast)
13922
75ae4244a596 Changes required by the certified email protocol
paulson
parents: 13507
diff changeset
   482
txt{*RA4*}
11264
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   483
apply blast
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   484
done
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   485
a47a9288f3f6 (rough) conversion of Auth/Recur to Isar format
paulson
parents: 11185
diff changeset
   486
end