src/HOL/Auth/ZhouGollmann.thy
author paulson
Fri, 26 Sep 2003 10:34:28 +0200
changeset 14207 f20fbb141673
parent 14146 0edd2d57eaf8
child 14736 7104394df99a
permissions -rw-r--r--
Conversion of all main protocols from "Shared" to "Public". Removal of Key_supply_ax: modifications to possibility theorems. Improved presentation.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14145
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
     1
(*  Title:      HOL/Auth/ZhouGollmann
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
     2
    ID:         $Id$
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
     3
    Author:     Giampaolo Bella and L C Paulson, Cambridge Univ Computer Lab
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
     4
    Copyright   2003  University of Cambridge
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
     5
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
     6
The protocol of
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
     7
  Jianying Zhou and Dieter Gollmann,
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
     8
  A Fair Non-Repudiation Protocol,
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
     9
  Security and Privacy 1996 (Oakland)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    10
  55-61
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    11
*)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    12
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    13
theory ZhouGollmann = Public:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    14
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    15
syntax
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    16
  TTP :: agent
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    17
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    18
translations
14207
f20fbb141673 Conversion of all main protocols from "Shared" to "Public".
paulson
parents: 14146
diff changeset
    19
  "TTP" == "Server "
14145
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    20
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    21
syntax
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    22
  f_sub :: nat
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    23
  f_nro :: nat
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    24
  f_nrr :: nat
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    25
  f_con :: nat
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    26
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    27
translations
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    28
  "f_sub" == "5"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    29
  "f_nro" == "2"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    30
  "f_nrr" == "3"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    31
  "f_con" == "4"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    32
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    33
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    34
constdefs
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    35
  broken :: "agent set"    
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    36
    --{*the compromised honest agents; TTP is included as it's not allowed to
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    37
        use the protocol*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    38
   "broken == insert TTP (bad - {Spy})"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    39
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    40
declare broken_def [simp]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    41
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    42
consts  zg  :: "event list set"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    43
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    44
inductive zg
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    45
  intros
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    46
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    47
  Nil:  "[] \<in> zg"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    48
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    49
  Fake: "[| evsf \<in> zg;  X \<in> synth (analz (spies evsf)) |]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    50
	 ==> Says Spy B X  # evsf \<in> zg"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    51
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    52
Reception:  "[| evsr \<in> zg; A \<noteq> B; Says A B X \<in> set evsr |]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    53
	     ==> Gets B X # evsr \<in> zg"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    54
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    55
  (*L is fresh for honest agents.
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    56
    We don't require K to be fresh because we don't bother to prove secrecy!
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    57
    We just assume that the protocol's objective is to deliver K fairly,
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    58
    rather than to keep M secret.*)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    59
  ZG1: "[| evs1 \<in> zg;  Nonce L \<notin> used evs1; C = Crypt K (Number m);
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    60
	   K \<in> symKeys;
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    61
	   NRO = Crypt (priK A) {|Number f_nro, Agent B, Nonce L, C|}|]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    62
       ==> Says A B {|Number f_nro, Agent B, Nonce L, C, NRO|} # evs1 \<in> zg"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    63
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    64
  (*B must check that NRO is A's signature to learn the sender's name*)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    65
  ZG2: "[| evs2 \<in> zg;
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    66
	   Gets B {|Number f_nro, Agent B, Nonce L, C, NRO|} \<in> set evs2;
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    67
	   NRO = Crypt (priK A) {|Number f_nro, Agent B, Nonce L, C|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    68
	   NRR = Crypt (priK B) {|Number f_nrr, Agent A, Nonce L, C|}|]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    69
       ==> Says B A {|Number f_nrr, Agent A, Nonce L, NRR|} # evs2  \<in>  zg"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    70
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    71
  (*K is symmetric must be repeated IF there's spy*)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    72
  (*A must check that NRR is B's signature to learn the sender's name*)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    73
  (*without spy, the matching label would be enough*)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    74
  ZG3: "[| evs3 \<in> zg; C = Crypt K M; K \<in> symKeys;
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    75
	   Says A B {|Number f_nro, Agent B, Nonce L, C, NRO|} \<in> set evs3;
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    76
	   Gets A {|Number f_nrr, Agent A, Nonce L, NRR|} \<in> set evs3;
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    77
	   NRR = Crypt (priK B) {|Number f_nrr, Agent A, Nonce L, C|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    78
	   sub_K = Crypt (priK A) {|Number f_sub, Agent B, Nonce L, Key K|}|]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    79
       ==> Says A TTP {|Number f_sub, Agent B, Nonce L, Key K, sub_K|}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    80
	     # evs3 \<in> zg"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    81
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    82
 (*TTP checks that sub_K is A's signature to learn who issued K, then
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    83
   gives credentials to A and B.  The Notes event models the availability of
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    84
   the credentials, but the act of fetching them is not modelled.*)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    85
 (*Also said TTP_prepare_ftp*)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    86
  ZG4: "[| evs4 \<in> zg; K \<in> symKeys;
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    87
	   Gets TTP {|Number f_sub, Agent B, Nonce L, Key K, sub_K|}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    88
	     \<in> set evs4;
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    89
	   sub_K = Crypt (priK A) {|Number f_sub, Agent B, Nonce L, Key K|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    90
	   con_K = Crypt (priK TTP) {|Number f_con, Agent A, Agent B,
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    91
				      Nonce L, Key K|}|]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    92
       ==> Notes TTP {|Number f_con, Agent A, Agent B, Nonce L, Key K, con_K|}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    93
	     # evs4 \<in> zg"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    94
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    95
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    96
declare Says_imp_knows_Spy [THEN analz.Inj, dest]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    97
declare Fake_parts_insert_in_Un  [dest]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    98
declare analz_into_parts [dest]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
    99
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   100
declare symKey_neq_priEK [simp]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   101
declare symKey_neq_priEK [THEN not_sym, simp]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   102
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   103
14146
0edd2d57eaf8 possibility proof!
paulson
parents: 14145
diff changeset
   104
text{*A "possibility property": there are traces that reach the end*}
0edd2d57eaf8 possibility proof!
paulson
parents: 14145
diff changeset
   105
lemma "[|A \<noteq> B; TTP \<noteq> A; TTP \<noteq> B; K \<in> symKeys|] ==>
0edd2d57eaf8 possibility proof!
paulson
parents: 14145
diff changeset
   106
     \<exists>L. \<exists>evs \<in> zg.
0edd2d57eaf8 possibility proof!
paulson
parents: 14145
diff changeset
   107
           Notes TTP {|Number f_con, Agent A, Agent B, Nonce L, Key K,
0edd2d57eaf8 possibility proof!
paulson
parents: 14145
diff changeset
   108
               Crypt (priK TTP) {|Number f_con, Agent A, Agent B, Nonce L, Key K|} |}
0edd2d57eaf8 possibility proof!
paulson
parents: 14145
diff changeset
   109
               \<in> set evs"
0edd2d57eaf8 possibility proof!
paulson
parents: 14145
diff changeset
   110
apply (intro exI bexI)
0edd2d57eaf8 possibility proof!
paulson
parents: 14145
diff changeset
   111
apply (rule_tac [2] zg.Nil
0edd2d57eaf8 possibility proof!
paulson
parents: 14145
diff changeset
   112
                    [THEN zg.ZG1, THEN zg.Reception [of _ A B],
0edd2d57eaf8 possibility proof!
paulson
parents: 14145
diff changeset
   113
                     THEN zg.ZG2, THEN zg.Reception [of _ B A],
0edd2d57eaf8 possibility proof!
paulson
parents: 14145
diff changeset
   114
                     THEN zg.ZG3, THEN zg.Reception [of _ A TTP], 
0edd2d57eaf8 possibility proof!
paulson
parents: 14145
diff changeset
   115
                     THEN zg.ZG4])
0edd2d57eaf8 possibility proof!
paulson
parents: 14145
diff changeset
   116
apply (possibility, auto)
0edd2d57eaf8 possibility proof!
paulson
parents: 14145
diff changeset
   117
done
0edd2d57eaf8 possibility proof!
paulson
parents: 14145
diff changeset
   118
14145
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   119
subsection {*Basic Lemmas*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   120
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   121
lemma Gets_imp_Says:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   122
     "[| Gets B X \<in> set evs; evs \<in> zg |] ==> \<exists>A. Says A B X \<in> set evs"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   123
apply (erule rev_mp)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   124
apply (erule zg.induct, auto)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   125
done
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   126
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   127
lemma Gets_imp_knows_Spy:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   128
     "[| Gets B X \<in> set evs; evs \<in> zg |]  ==> X \<in> spies evs"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   129
by (blast dest!: Gets_imp_Says Says_imp_knows_Spy)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   130
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   131
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   132
text{*Lets us replace proofs about @{term "used evs"} by simpler proofs 
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   133
about @{term "parts (spies evs)"}.*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   134
lemma Crypt_used_imp_spies:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   135
     "[| Crypt K X \<in> used evs;  K \<noteq> priK TTP; evs \<in> zg |]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   136
      ==> Crypt K X \<in> parts (spies evs)"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   137
apply (erule rev_mp)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   138
apply (erule zg.induct)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   139
apply (simp_all add: parts_insert_knows_A) 
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   140
done
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   141
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   142
lemma Notes_TTP_imp_Gets:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   143
     "[|Notes TTP {|Number f_con, Agent A, Agent B, Nonce L, Key K, con_K |}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   144
           \<in> set evs;
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   145
        sub_K = Crypt (priK A) {|Number f_sub, Agent B, Nonce L, Key K|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   146
        evs \<in> zg|]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   147
    ==> Gets TTP {|Number f_sub, Agent B, Nonce L, Key K, sub_K|} \<in> set evs"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   148
apply (erule rev_mp)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   149
apply (erule zg.induct, auto)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   150
done
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   151
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   152
text{*For reasoning about C, which is encrypted in message ZG2*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   153
lemma ZG2_msg_in_parts_spies:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   154
     "[|Gets B {|F, B', L, C, X|} \<in> set evs; evs \<in> zg|]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   155
      ==> C \<in> parts (spies evs)"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   156
by (blast dest: Gets_imp_Says)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   157
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   158
(*classical regularity lemma on priK*)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   159
lemma Spy_see_priK [simp]:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   160
     "evs \<in> zg ==> (Key (priK A) \<in> parts (spies evs)) = (A \<in> bad)"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   161
apply (erule zg.induct)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   162
apply (frule_tac [5] ZG2_msg_in_parts_spies, auto)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   163
done
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   164
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   165
text{*So that blast can use it too*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   166
declare  Spy_see_priK [THEN [2] rev_iffD1, dest!]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   167
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   168
lemma Spy_analz_priK [simp]:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   169
     "evs \<in> zg ==> (Key (priK A) \<in> analz (spies evs)) = (A \<in> bad)"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   170
by auto 
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   171
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   172
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   173
subsection{*About NRO*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   174
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   175
text{*Below we prove that if @{term NRO} exists then @{term A} definitely
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   176
sent it, provided @{term A} is not broken.  *}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   177
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   178
text{*Strong conclusion for a good agent*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   179
lemma NRO_authenticity_good:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   180
     "[| NRO \<in> parts (spies evs);
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   181
         NRO = Crypt (priK A) {|Number f_nro, Agent B, Nonce L, C|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   182
         A \<notin> bad;  evs \<in> zg |]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   183
     ==> Says A B {|Number f_nro, Agent B, Nonce L, C, NRO|} \<in> set evs"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   184
apply clarify
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   185
apply (erule rev_mp)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   186
apply (erule zg.induct)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   187
apply (frule_tac [5] ZG2_msg_in_parts_spies, auto)  
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   188
done
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   189
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   190
text{*A compromised agent: we can't be sure whether A or the Spy sends the
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   191
message or of the precise form of the message*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   192
lemma NRO_authenticity_bad:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   193
     "[| NRO \<in> parts (spies evs);
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   194
         NRO = Crypt (priK A) {|Number f_nro, Agent B, Nonce L, C|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   195
         A \<in> bad;  evs \<in> zg |]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   196
     ==> \<exists>A' \<in> {A,Spy}. \<exists>C Y. Says A' C Y \<in> set evs & NRO \<in> parts {Y}"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   197
apply clarify
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   198
apply (erule rev_mp)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   199
apply (erule zg.induct)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   200
apply (frule_tac [5] ZG2_msg_in_parts_spies, simp_all)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   201
txt{*ZG3*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   202
   prefer 4 apply blast
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   203
txt{*ZG2*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   204
   prefer 3 apply blast
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   205
txt{*Fake*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   206
apply (simp add: parts_insert_knows_A, blast) 
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   207
txt{*ZG1*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   208
apply (auto intro!: exI)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   209
done
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   210
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   211
theorem NRO_authenticity:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   212
     "[| NRO \<in> used evs;
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   213
         NRO = Crypt (priK A) {|Number f_nro, Agent B, Nonce L, C|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   214
         A \<notin> broken;  evs \<in> zg |]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   215
     ==> \<exists>C Y. Says A C Y \<in> set evs & NRO \<in> parts {Y}"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   216
apply auto
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   217
 apply (force dest!: Crypt_used_imp_spies NRO_authenticity_good)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   218
apply (force dest!: Crypt_used_imp_spies NRO_authenticity_bad)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   219
done
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   220
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   221
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   222
subsection{*About NRR*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   223
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   224
text{*Below we prove that if @{term NRR} exists then @{term B} definitely
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   225
sent it, provided @{term B} is not broken.*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   226
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   227
text{*Strong conclusion for a good agent*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   228
lemma NRR_authenticity_good:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   229
     "[| NRR \<in> parts (spies evs);
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   230
         NRR = Crypt (priK B) {|Number f_nrr, Agent A, Nonce L, C|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   231
         B \<notin> bad;  evs \<in> zg |]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   232
     ==> Says B A {|Number f_nrr, Agent A, Nonce L, NRR|} \<in> set evs"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   233
apply clarify
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   234
apply (erule rev_mp)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   235
apply (erule zg.induct)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   236
apply (frule_tac [5] ZG2_msg_in_parts_spies, auto)  
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   237
done
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   238
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   239
lemma NRR_authenticity_bad:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   240
     "[| NRR \<in> parts (spies evs);
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   241
         NRR = Crypt (priK B) {|Number f_nrr, Agent A, Nonce L, C|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   242
         B \<in> bad;  evs \<in> zg |]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   243
     ==> \<exists>B' \<in> {B,Spy}. \<exists>C Y. Says B' C Y \<in> set evs & NRR \<in> parts {Y}"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   244
apply clarify
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   245
apply (erule rev_mp)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   246
apply (erule zg.induct)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   247
apply (frule_tac [5] ZG2_msg_in_parts_spies)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   248
apply (simp_all del: bex_simps)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   249
txt{*ZG3*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   250
   prefer 4 apply blast
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   251
txt{*Fake*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   252
apply (simp add: parts_insert_knows_A, blast)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   253
txt{*ZG1*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   254
apply (auto simp del: bex_simps)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   255
txt{*ZG2*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   256
apply (force intro!: exI)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   257
done
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   258
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   259
theorem NRR_authenticity:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   260
     "[| NRR \<in> used evs;
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   261
         NRR = Crypt (priK B) {|Number f_nrr, Agent A, Nonce L, C|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   262
         B \<notin> broken;  evs \<in> zg |]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   263
     ==> \<exists>C Y. Says B C Y \<in> set evs & NRR \<in> parts {Y}"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   264
apply auto
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   265
 apply (force dest!: Crypt_used_imp_spies NRR_authenticity_good)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   266
apply (force dest!: Crypt_used_imp_spies NRR_authenticity_bad)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   267
done
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   268
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   269
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   270
subsection{*Proofs About @{term sub_K}*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   271
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   272
text{*Below we prove that if @{term sub_K} exists then @{term A} definitely
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   273
sent it, provided @{term A} is not broken.  *}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   274
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   275
text{*Strong conclusion for a good agent*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   276
lemma sub_K_authenticity_good:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   277
     "[| sub_K \<in> parts (spies evs);
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   278
         sub_K = Crypt (priK A) {|Number f_sub, Agent B, Nonce L, Key K|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   279
         A \<notin> bad;  evs \<in> zg |]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   280
     ==> Says A TTP {|Number f_sub, Agent B, Nonce L, Key K, sub_K|} \<in> set evs"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   281
apply (erule rev_mp)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   282
apply (erule zg.induct)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   283
apply (frule_tac [5] ZG2_msg_in_parts_spies, simp_all)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   284
txt{*Fake*} 
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   285
apply (blast dest!: Fake_parts_sing_imp_Un)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   286
done
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   287
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   288
text{*A compromised agent: we can't be sure whether A or the Spy sends the
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   289
message or of the precise form of the message*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   290
lemma sub_K_authenticity_bad:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   291
     "[| sub_K \<in> parts (spies evs);
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   292
         sub_K = Crypt (priK A) {|Number f_sub, Agent B, Nonce L, Key K|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   293
         A \<in> bad;  evs \<in> zg |]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   294
     ==> \<exists>A' \<in> {A,Spy}. \<exists>C Y. Says A' C Y \<in> set evs & sub_K \<in> parts {Y}"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   295
apply clarify
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   296
apply (erule rev_mp)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   297
apply (erule zg.induct)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   298
apply (frule_tac [5] ZG2_msg_in_parts_spies)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   299
apply (simp_all del: bex_simps)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   300
txt{*Fake*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   301
apply (simp add: parts_insert_knows_A, blast)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   302
txt{*ZG1*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   303
apply (auto simp del: bex_simps)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   304
txt{*ZG3*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   305
apply (force intro!: exI)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   306
done
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   307
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   308
theorem sub_K_authenticity:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   309
     "[| sub_K \<in> used evs;
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   310
         sub_K = Crypt (priK A) {|Number f_sub, Agent B, Nonce L, Key K|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   311
         A \<notin> broken;  evs \<in> zg |]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   312
     ==> \<exists>C Y. Says A C Y \<in> set evs & sub_K \<in> parts {Y}"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   313
apply auto
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   314
 apply (force dest!: Crypt_used_imp_spies sub_K_authenticity_good)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   315
apply (force dest!: Crypt_used_imp_spies sub_K_authenticity_bad)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   316
done
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   317
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   318
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   319
subsection{*Proofs About @{term con_K}*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   320
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   321
text{*Below we prove that if @{term con_K} exists, then @{term TTP} has it,
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   322
and therefore @{term A} and @{term B}) can get it too.  Moreover, we know
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   323
that @{term A} sent @{term sub_K}*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   324
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   325
lemma con_K_authenticity:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   326
     "[|con_K \<in> used evs;
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   327
        con_K = Crypt (priK TTP)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   328
                  {|Number f_con, Agent A, Agent B, Nonce L, Key K|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   329
        evs \<in> zg |]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   330
    ==> Notes TTP {|Number f_con, Agent A, Agent B, Nonce L, Key K, con_K|}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   331
          \<in> set evs"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   332
apply clarify
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   333
apply (erule rev_mp)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   334
apply (erule zg.induct)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   335
apply (frule_tac [5] ZG2_msg_in_parts_spies, simp_all)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   336
txt{*Fake*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   337
apply (blast dest!: Fake_parts_sing_imp_Un)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   338
txt{*ZG2*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   339
apply (blast dest: parts_cut)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   340
done
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   341
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   342
text{*If @{term TTP} holds @{term con_K} then @{term A} sent
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   343
 @{term sub_K}.  We assume that @{term A} is not broken.  Nothing needs to
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   344
 be assumed about the form of @{term con_K}!*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   345
lemma Notes_TTP_imp_Says_A:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   346
     "[|Notes TTP {|Number f_con, Agent A, Agent B, Nonce L, Key K, con_K|}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   347
           \<in> set evs;
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   348
        sub_K = Crypt (priK A) {|Number f_sub, Agent B, Nonce L, Key K|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   349
        A \<notin> broken; evs \<in> zg|]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   350
    ==> \<exists>C Y. Says A C Y \<in> set evs & sub_K \<in> parts {Y}"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   351
by (blast dest!: Notes_TTP_imp_Gets [THEN Gets_imp_knows_Spy, THEN parts.Inj] intro: sub_K_authenticity)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   352
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   353
text{*If @{term con_K} exists, then @{term A} sent @{term sub_K}.*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   354
theorem B_sub_K_authenticity:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   355
     "[|con_K \<in> used evs;
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   356
        con_K = Crypt (priK TTP) {|Number f_con, Agent A, Agent B,
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   357
                                   Nonce L, Key K|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   358
        sub_K = Crypt (priK A) {|Number f_sub, Agent B, Nonce L, Key K|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   359
        A \<notin> broken; B \<noteq> TTP; evs \<in> zg|]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   360
    ==> \<exists>C Y. Says A C Y \<in> set evs & sub_K \<in> parts {Y}"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   361
by (blast dest: con_K_authenticity Notes_TTP_imp_Says_A)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   362
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   363
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   364
subsection{*Proving fairness*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   365
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   366
text{*Cannot prove that, if @{term B} has NRO, then  @{term A} has her NRR.
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   367
It would appear that @{term B} has a small advantage, though it is
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   368
useless to win disputes: @{term B} needs to present @{term con_K} as well.*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   369
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   370
text{*Strange: unicity of the label protects @{term A}?*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   371
lemma A_unicity: 
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   372
     "[|NRO = Crypt (priK A) {|Number f_nro, Agent B, Nonce L, Crypt K M|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   373
        NRO \<in> parts (spies evs);
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   374
        Says A B {|Number f_nro, Agent B, Nonce L, Crypt K M', NRO'|}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   375
          \<in> set evs;
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   376
        A \<notin> bad; evs \<in> zg |]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   377
     ==> M'=M"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   378
apply clarify
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   379
apply (erule rev_mp)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   380
apply (erule rev_mp)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   381
apply (erule zg.induct)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   382
apply (frule_tac [5] ZG2_msg_in_parts_spies, auto) 
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   383
txt{*ZG1: freshness*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   384
apply (blast dest: parts.Body) 
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   385
done
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   386
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   387
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   388
text{*Fairness lemma: if @{term sub_K} exists, then @{term A} holds 
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   389
NRR.  Relies on unicity of labels.*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   390
lemma sub_K_implies_NRR:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   391
     "[| sub_K \<in> parts (spies evs);
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   392
         NRO \<in> parts (spies evs);
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   393
         sub_K = Crypt (priK A) {|Number f_sub, Agent B, Nonce L, Key K|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   394
         NRO = Crypt (priK A) {|Number f_nro, Agent B, Nonce L, Crypt K M|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   395
         NRR = Crypt (priK B) {|Number f_nrr, Agent A, Nonce L, Crypt K M|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   396
         A \<notin> bad;  evs \<in> zg |]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   397
     ==> Gets A {|Number f_nrr, Agent A, Nonce L, NRR|} \<in> set evs"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   398
apply clarify
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   399
apply (erule rev_mp)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   400
apply (erule rev_mp)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   401
apply (erule zg.induct)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   402
apply (frule_tac [5] ZG2_msg_in_parts_spies, simp_all)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   403
txt{*Fake*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   404
apply blast 
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   405
txt{*ZG1: freshness*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   406
apply (blast dest: parts.Body) 
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   407
txt{*ZG3*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   408
apply (blast dest: A_unicity [OF refl]) 
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   409
done
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   410
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   411
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   412
lemma Crypt_used_imp_L_used:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   413
     "[| Crypt (priK TTP) {|F, A, B, L, K|} \<in> used evs; evs \<in> zg |]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   414
      ==> L \<in> used evs"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   415
apply (erule rev_mp)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   416
apply (erule zg.induct, auto)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   417
txt{*Fake*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   418
apply (blast dest!: Fake_parts_sing_imp_Un)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   419
txt{*ZG2: freshness*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   420
apply (blast dest: parts.Body) 
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   421
done
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   422
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   423
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   424
text{*Fairness for @{term A}: if @{term con_K} and @{term NRO} exist, 
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   425
then @{term A} holds NRR.  @{term A} must be uncompromised, but there is no
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   426
assumption about @{term B}.*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   427
theorem A_fairness_NRO:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   428
     "[|con_K \<in> used evs;
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   429
        NRO \<in> parts (spies evs);
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   430
        con_K = Crypt (priK TTP)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   431
                      {|Number f_con, Agent A, Agent B, Nonce L, Key K|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   432
        NRO = Crypt (priK A) {|Number f_nro, Agent B, Nonce L, Crypt K M|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   433
        NRR = Crypt (priK B) {|Number f_nrr, Agent A, Nonce L, Crypt K M|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   434
        A \<notin> bad;  evs \<in> zg |]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   435
    ==> Gets A {|Number f_nrr, Agent A, Nonce L, NRR|} \<in> set evs"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   436
apply clarify
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   437
apply (erule rev_mp)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   438
apply (erule rev_mp)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   439
apply (erule zg.induct)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   440
apply (frule_tac [5] ZG2_msg_in_parts_spies, simp_all)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   441
   txt{*Fake*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   442
   apply (simp add: parts_insert_knows_A) 
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   443
   apply (blast dest: Fake_parts_sing_imp_Un) 
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   444
  txt{*ZG1*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   445
  apply (blast dest: Crypt_used_imp_L_used) 
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   446
 txt{*ZG2*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   447
 apply (blast dest: parts_cut)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   448
txt{*ZG4*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   449
apply (blast intro: sub_K_implies_NRR [OF _ _ refl] 
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   450
             dest: Gets_imp_knows_Spy [THEN parts.Inj])
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   451
done
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   452
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   453
text{*Fairness for @{term B}: NRR exists at all, then @{term B} holds NRO.
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   454
@{term B} must be uncompromised, but there is no assumption about @{term
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   455
A}. *}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   456
theorem B_fairness_NRR:
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   457
     "[|NRR \<in> used evs;
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   458
        NRR = Crypt (priK B) {|Number f_nrr, Agent A, Nonce L, C|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   459
        NRO = Crypt (priK A) {|Number f_nro, Agent B, Nonce L, C|};
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   460
        B \<notin> bad; evs \<in> zg |]
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   461
    ==> Gets B {|Number f_nro, Agent B, Nonce L, C, NRO|} \<in> set evs"
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   462
apply clarify
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   463
apply (erule rev_mp)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   464
apply (erule zg.induct)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   465
apply (frule_tac [5] ZG2_msg_in_parts_spies, simp_all)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   466
txt{*Fake*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   467
apply (blast dest!: Fake_parts_sing_imp_Un)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   468
txt{*ZG2*}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   469
apply (blast dest: parts_cut)
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   470
done
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   471
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   472
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   473
text{*If @{term con_K} exists at all, then @{term B} can get it, by @{text
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   474
con_K_authenticity}.  Cannot conclude that also NRO is available to @{term B},
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   475
because if @{term A} were unfair, @{term A} could build message 3 without
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   476
building message 1, which contains NRO. *}
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   477
2e31b8cc8788 ZhouGollmann: new example (fair non-repudiation protocol)
paulson
parents:
diff changeset
   478
end