<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>The coin ipping selector for selective encryption</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Richard Ostert</string-name>
          <email>ostertag@dcs.fmph.uniba.sk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science, Faculty of Mathematics</institution>
          ,
          <addr-line>Physics and Informatics</addr-line>
          ,
          <institution>Comenius University</institution>
          ,
          <addr-line>MlynskÆ dolina, 842 48 Bratislava</addr-line>
          ,
          <country>Slovak Republic</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Some applications require high-speed encryption even at the expense of reduced security. With a xed secure, but slow cryptographic algorithm, there still is an appealing possibility for encryption speedup by encrypting only some portion of data. In this paper we analyze the ciphertext security obtained this way. We show that it is not possible to exclude from encryption even a small constant fraction of data without signicantly compromising security.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Volume of data is nowadays bigger than ever.
Multimedia are a typical example. Fast real-time on-demand
encryption of multiple multimedia streams requires
specialized powerful hardware.</p>
      <p>It is sometimes not possible (or economical) to
use powerful enough hardware solution. Then we can
replace the encryption algorithm with a faster
although maybe less secure one. Another possibility is
to use selective encryption with the original secure
algorithm. In this case we encrypt only some fraction
of plaintext. Let p denote the fraction of encrypted
plaintext. The parameter p ranges between 0 (no
encryption) and 1 (full encryption) and is used to control
the balance between the encryption speedup and the
security.</p>
      <p>
        For example, selective encryption is used for
online encryption of MPEG video [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. In this case, the
knowledge of the internal data structure is exploited
in order to encrypt only DC coecients and sign bits
of motion vectors. Similar techniques are also used for
pictures [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. For overview of selective encryption
methods see [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Security of these algorithms is not formally
proved.
      </p>
      <p>We formally analyze security of selective
encryption in this paper. As we are interested in a general
case, we make no assumptions on the internal data
structure or on statistical properties of the plaintext.</p>
      <p>We originally hoped that it could be possible to
selectively encrypt portion of plaintext while
maintaining reasonable security. However, we show that this
? Supported by VEGA grant No. 1/3106/06.
does not work. Since we prove a negative result, it is
only better if assumptions are more disadvantageous
for the attacker than in practical usage:
1. One-time pad is used as the encrypting algorithm.</p>
      <p>One-time pad is the rst and only encryption
algorithm for which there is a proof of perfect secrecy if
the key is truly random, never reused, and kept
secret. We choose this cipher to abstract from
eventual weaknesses of the actual cipher which can be
exploited by attacker. Theoretical results obtained
this way can be used in practice as upper bounds
for security of any other selected encryption
algorithm.
2. Attacker can manage no more than ciphertext-only
attack.</p>
      <p>The attacker is assumed to have access only to
a ciphertext and full description of selective
encryption algorithm. This means that the attacker
knows the enciphering algorithm and also the method
of bit selection for enciphering.
3. Attack is peformed using brute force.</p>
      <p>Key space is searched from the most probable key
to the least probable key omitting impossible keys
to minimize the attacker’s work. We assume that
the selection algorithm chooses bits for encrypting
independently from plaintext content (besides its
length). In general it cannot be expected that a
better attack is possible. However in actual
situation specic properties 1 of plaintext can lead to a
more ecient attack.
4. Attack complexity measure is dened as a fraction
of key space that attacker has to search in average
to nd the key.</p>
      <p>Attacker tries every possible key until he nds
one that deciphers to the desired plaintext. We
ignore the complexity of verifying whether
deciphered plaintext is the original one. For selective
encryption with p = 1 (one-time pad), the
expected attack complexity is 1=2. For selective
encryption with p = 0 expected complexity is 0. We
1 E.g. high redundancy of plaintext poses an even greater
risk for selective encryption then for full text encryption.
consider every cipher for which attack
complexity approaches 0 as plaintext length goes to +1
insecure.</p>
      <p>We assume that encrypting p percent of plaintext
bits with selective encryption reduces sender’s work
to p percent omitting overhead necessary for selecting
those bits. In this situation we will be satised with
(and accept this as reasonable degradation of
security) reduction of attack complexity from 1=2 to p=2,
because this means that attacker’s work is in average
also reduced to p percent but no more.
2</p>
      <p>
        Selectors
In this paper we will assume that plaintext is a bit
sequence sequence of zeros and ones. Let n &gt; 0 denote
plaintext sequence length. If we want to selectively
encrypt p 2 (0; 1) percent of plaintext, then we have to
choose k = np bits of plaintext for encryption. In [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]
we analyzed dierent ways of bit selection for
selective encryption. We introduced the notion of selector
algorithm which performs selection of the k bits for
encryption based on n and p. The output of selector
on input n and p is a bit sequence of length n with
k = np ones indicating positions of bits chosen for
encryption. Selective encryption algorithm proceeds in
the following way:
1. The selector selects k = np bits for encryption.
2. Encrypt only selected bits with one-time pad 2.
As it can be seen our model was limited to selections
which have exactly k = np bits selected. In [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] we
proved that among the analyzed selectors only fully
random selection of exactly p percents of bits provides
reasonable security for p 1=2. In this place it is
necessary to mention that in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] we measured the attack
complexity by the number of possible plaintexts 3.
      </p>
      <p>Because we are interested in the values of p &lt; 1=2
we relax the assumption that exactly k = np bits have
to be selected, and we only require that in average
k bits have to be selected. This relaxation allows for
using a selector which for every bit ips a biased coin
one falls with probability p, zero with probability
1 p. Lets call this selector coin ipping selector. We
hope that this step allow us to go with p below 1=2
because it introduce more uncertainty to attacker as
all plaintext are now possible. For that reason we have
to also change our attack complexity measure and we
choose one mentioned in previous section.
2 Xor them with truly random noise.
3 For example, let p = 1=2. For a random bit selector
there are 2n 1 possible plaintexts for every ciphertext.
If the selector do not use randomness and
deterministically selects every even bit, there are only 2n=2 possible
plaintexts.</p>
      <p>The coin ipping selector analysis
In the rest of the paper we will show the behavior of
the attack complexity for the coin ipping selector for
large messages (we will assume that n goes to innity).
3.1</p>
      <p>Average fraction of key space equation
Firstly we need to determine the probability of the
key of length n with exactly k ones on xedly chosen
positions if in the selective encryption the coin
ipping selector is used. Let denote this probability as
PK(n; k; p), where p is probability of encrypting.</p>
    </sec>
    <sec id="sec-2">
      <title>Theorem 1.</title>
      <p>PK(n; k; p) =
p k
2
1
p n k
2</p>
    </sec>
    <sec id="sec-3">
      <title>Proof.</title>
      <p>n k
PK(n; k; p) = X
i=0
n
i
k pk+i(1
p)(n k) i 1</p>
      <p>2k+i ;
because we can get the key with exactly k ones on
xedly chosen positions from any selection with
exactly k + i ones with k ones on those xedly chosen
positions and i ones arbitrarily chosen from remaining
n k positions. Also one-time pad has to select for
those k positions bit 1 and for remaining i positions
bit 0 (thus we get 2 (k+i)). We can simplify the last
equation as follows:
p k nXk
2</p>
      <p>i=0
p k p
2</p>
      <p>2
=
+ (1
n
i
k
p)
p i
2
n k
=
(1</p>
      <p>p)(n k) i =
p k
2
1
p n k
2
:</p>
      <p>tu</p>
      <p>Derivative of the function PK(n; k; p) with respect
to k is:</p>
      <p>PK(n; k; p) ln</p>
      <p>p
2
p</p>
      <p>:
Since for all studied n &gt; 0 and 0 &lt; p &lt; 1
expression ln( 2 p p ) is negative and PK(n; k; p) is positive we
know, that PK(n; k; p) is strictly decreasing function
with respect to k 2 h0; ni. Thus eective attacker will
start searching key space from the most probable 0n
key to the least probable 1n key in direction of
increasing number of ones in the key. Sort all 2n keys in this
order4 in an array with indexes from 1 to 2n. Then
denote L(n; k) index of rst key of length n with k
4 Ordering of keys with equal number of ones is irrelevant
since all have the same probability. It can be arbitrary
but xed.
ones and U (n; k) will denote index of the last key of
length n with k ones. It can easily be seen that:</p>
      <p>L(n; k) = 1 + kX1 n , U (n; k) = Xk
i
n
i
2
k=0</p>
      <p>p
2 p
k n Xk n + 1
k i
i=0</p>
      <p>=</p>
      <p>Let us denote average fraction of key space which
attacker has to search before he nds the key as F (n; p).</p>
      <p>Now, when we have I(n; p), equation for F is obvious:</p>
      <p>F (n; p) =
2n Although we have assumed that p &lt; 1 we can
verI(n; p) = X i Pr(n; p; i): ify, that F (n; 1) = 1=2 as expected. We can not use
i=1 F (n; 0) because Pr(n; 0; k) is not a valid probability
Since Pr(n; p; i) is constant for all i between L(n; k) distribution over keys of length n.
and U (n; k) we can write:
Since PK(n; k; p) does not depend on i we can move it
in front of inner sum. The inner sum then reduces to:
i = [U (n; k)</p>
      <p>L(n; k) + 1]</p>
      <p>L(n; k) + U (n; k)</p>
      <p>2
Thus equation for I(n; p) changes to:
k=0
Xn PK(n; k; p) 1 n "1
2 k
n + 2 Xk
k
i=0
n #
i
It is obvious that x(n; 0) = 2 and x(n; k+1) x(n; k) =
nk++11 . So x(n; k) = 1 + Pik=0 n +i1 . After substituting
x(n; k) and PK(n; k; p) we can write I(n; p) as:
p k
2
1
p n k n
2
k
"</p>
      <p>k
1 + X</p>
      <p>i=0
p n we get:
2
n + 1 #
i
Based on Figure 1 we will now try to show that for all
p &lt; 1 holds limn!1 F (n; p) = 0. This will be
unwelcome result. It means that even if we encrypt nearly
the entire plaintext up to some small fraction, this
small fraction is still sucient to reduce attack
complexity to a negligible fraction compared to full text
encryption.</p>
      <p>Since we want to prove that the limit goes to zero,
it is possible to simplify the proof by realizing that
F (n; p) 0 and show that some simpler upper bound
f0(n; p)+f1(n; p)+f2(n; p) F (n; p) goes to zero too.</p>
      <p>We choose fi(n; p) as follows</p>
      <p>1
f0(n; p) = 2n+1 ;</p>
      <p>1
f1(n; p) = 2n+1</p>
      <p>1
f2(n; p) = 2n+1
2
2
2
2
p n X</p>
      <p>k=0
p n n</p>
      <p>X
k=
2 p
p
p
2 p
k n Sn+1;</p>
      <p>k k
k n Sn+1;</p>
      <p>k k
where Skn+1 denotes Pik=0 n +i1 and is n2 12 n 58 . To
prove the main limit it is sucient to show that for all
i 2 f0; 1; 2g limn!1 fi(n; p) equals to zero. For i = 0
it is trivial so we move to i = 1. In the proof we will
use following lemma.</p>
      <p>lim
n!1</p>
      <p>Pn=2 '(n)pn n
k=0 k = 0:</p>
      <p>2n
Theorem 3. Let p &lt; 1. Then limn!1 f1(n; p) = 0.</p>
      <p>Proof. Firstly we replace f1(n; p) with even simpler
upper bound:
f1(n; p)</p>
      <p>1
2n+1
1
2n+1
1 5
2 n 8 : ak &gt; ak+1:
Proof. We rewrite theorem inequality as a fraction. So
we get 8p 2 (0; 1) 9m 8n &gt; m 8k n2 21 n 58 :
ak+1 &lt; 1 , 2
ak
p n k n k
p k + 1 &lt; 1 , k + 1 &lt;
2 p</p>
      <p>:
p
Because nk+1k &lt; nk k it is sucient to nd an arbitrary
m that 8n &gt; m 8k n2 12 n 58 :
n k
k
&lt;
2 p
p
, n &lt; k + k
2 p
p</p>
      <p>2
, n &lt; k</p>
      <p>p
Now we have showed that for all p 2 (0; 1), if we set</p>
      <p>8
m to 1 1 p 3 , then
8n &gt; m 8k</p>
      <p>Now we are able to proof the last theorem on the
limit of function f2.</p>
      <p>Theorem 4. Let p &lt; 1. Then limn!1 f2(n; p) = 0.</p>
      <p>Proof. Again we replace f2(n; p) with even simpler
upper bound:</p>
      <p>
        1
2n+1
2
By solving this inequality we get that it holds for every
Lemma 1 (for proof see [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]). Let '(n) be any func- k &gt; p2 n. Because we start with k = n2 21 n 58 , we will
tion satisfying limn!1 '(n) = 1. Then now solve for which n holds:
      </p>
      <p>In the proof for i = 2 we will utilize another two
lemmas.</p>
      <p>
        Now we use lemma 3 and the fact that we are
interested in limit for n ! 1. Thus for large enough n we
Lemma 2 (for proof see [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] equation 9.98). Let can upper bound the last equation by
jkj 21 n 58 . Then binomial coecient around center 2 p n
for n ! 1 can be aproximated as follows: (n + 1) a =
n
2
n
k
=
      </p>
      <p>2n
p 2 n
e 2 kn2 1 + O n 8
1
=
2
10 125
=
ak 100
75
50
25
0
50
45
40
35
15
10
5
0</p>
      <p>=
= p n n2
In the sequel we get rid of binomial coecient by
ap</p>
      <p>1
plying lemma 2. We omit the 1 + O(n 8 ) factor from
following equations to save space.
We want to prove now that the last equation goes to
zero as n approaches 1. We will do so by showing
that logarithm of the equation goes to 1. We also
omit constant factor p2= as it is irrelevant in this
context.
Since n2 ln(2 p)p is most inuencing summand as n
goes to innity and ln(2 p)p &lt; 0 we have proved that
the equation goes to 1. If we again omit the 1 +</p>
      <p>1
O(n 8 ) factor from the right-hand side of inequality
we get for large enough n that
f2(n; p)
r 2
[(2</p>
      <p>
        n
p)p] 2
2
p
In this paper we have showed that even the coin
ipping selector tremendously decreases the security of
selective encryption for any p &lt; 1. In other words it
means that even if we encrypt nearly the entire
plaintext up to some small fraction, this small fraction is
still enough to reduce attack complexity to negligible
fraction compared to full text encryption. The same
result holds for random bit selector from [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] if the
attacker and the attack complexity from this paper is
assumed. As a conclusion we can say, that every
studied selector signicantly degrades security even if the
encrypted fraction is closed to 1 for large enough
messages.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Shi</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bhargava</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>A fast mpeg video encryption algorithm</article-title>
          .
          <source>In: Proceedings of the sixth ACM international conference on Multimedia</source>
          , ACM Press (
          <year>1998</year>
          )
          <fpage>81</fpage>
          <lpage>88</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Droogenbroeck</surname>
            ,
            <given-names>M.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Benedett</surname>
          </string-name>
          , R.:
          <article-title>Techniques for a selective encryption of uncompressed and compressed images</article-title>
          .
          <source>In: Proceedings of ACIVS 2002</source>
          (
          <article-title>Advanced Concepts for Intelligent Vision Systems</article-title>
          ), Ghent, Belgium (
          <year>2002</year>
          )
          <fpage>90</fpage>
          <lpage>97</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Liu</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Eskicioglu</surname>
            ,
            <given-names>A.M.:</given-names>
          </string-name>
          <article-title>Selective encryption of multimedia content in distribution networks: Challenges and new directions</article-title>
          .
          <source>ASTED International Conference on Communications, Internet and Information Technology (CIIT</source>
          <year>2003</year>
          )
          <article-title>(</article-title>
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>OstertÆg</surname>
            , R., Ko†inÆr,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Analza selektorov pre selektvne †ifrovanie</article-title>
          . In: ITAT 2006:
          <article-title>Information Technologies-Applications and Theory, Se‹a: PONT (</article-title>
          <year>2006</year>
          )
          <fpage>131137</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>OlejÆr</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stanek</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>On cryptographic properties of random Boolean functions</article-title>
          .
          <source>J.UCS: Journal of Universal Computer Science</source>
          <volume>4</volume>
          (
          <year>1998</year>
          )
          <fpage>705718</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Graham</surname>
            ,
            <given-names>R.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Knuth</surname>
            ,
            <given-names>D.E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Patashnik</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          :
          <article-title>Concrete Mathematics: A Foundation for Computer Science</article-title>
          . Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA (
          <year>1994</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>