Linear Cryptanalysis Method For DES Cipher
Linear Cryptanalysis Method For DES Cipher
DES Cipher
Mitsuru Matsui
Computer & Information Systems Laboratory
Mitsubishi Electric Corporation
5-1-1, Ofuna, Kamakura, Kanagawa 247, Japan
Email matsui8mmt.isl.melco.co.jp
Abstract
We introduce a new method for cryptanalysisof DES cipher, which is essentially
a known-plaintext attack. As a result, it is possible to break 8-round DES cipher
with 22' known-plaintexts and 16-round DES cipher with 2" known-plaintexts,
respectively. Moreover, this method is applicable to an only-ciphertext attack
in certain situations. For example, if plaintexts consist of natural English sen-
tences represented by ASCII codes, 8-round DES cipher is breakable with Z2'
ciphertexts only.
1 Introduction
Differential Cryptanalysis has been one of main topics in cryptology since the first
paper by Biham and Shamir in 1990 [l]. They have broken FEAL cipher in the
subsequent paper [2], and recently succeeded in breaking the full Ibround DES cipher
by a chosen-plaintext attack [3].
Although Differential Cryptanalysis is a technique for a chosen-plaintext attack,
it is more noteworthy that it can be applied to a known-plaintext attack on condition
that sufficiently many plaintexts are available.
On the other hand, several new approaches t o known-plaintext attacks have been
also studied in special cases. As regards FEAL cipher, for example, Tardy-Corfdir
and Gilbert have presented a statistical method to break FEAL-4 and FEAL-6 [4],
and Matsui and Yamagishi have described a deterministic method to break FEAL-8
by a known-plaintext attack [S], respectively.
In this paper we introduce an essentially known-plaintext attack of DES cipher.
The purpose of this method is to obtain a linear approximate expression of a given
cipher algorithm. For this purpose, we begin by constructing a statistical linear path
between input and output bits of each Sbox. Then we extend this path to the entire
algorithm, and finally reach a linear approximate expression without any intermediate
value.
T. Helleseth (Ed.): Advances in Cryptology - EUROCRYPT '93, LNCS 765, pp. 386-397, 1994.
0 Spnnger-Verlag Berlin Heidelberg 1994
Our main results on the known-plaintext attack of DES cipher are as follows. The
experiments were implemented with C language programs on HP9750 workstation
computer (PA-RISC/66MHz).
0 ground DES is breakable with 221 known-plaintexts in 40 seconds;
0 If plaintexts consist of random ASCII codes, ground DES is breakable with 2''
ciphertexts only.
We shall also illustrate a situation in which 16-round DES is still breakable faster
than an exhaustive search for 56-bit keys by the only-ciphertext attack.
2 Preliminaries
wp
Figure 1 shows a data randomization part of DES cipher. We omit the initial permu-
tation IP a,pd the final permutation IP-' unless otherwise indicated. The following
notations are used throughout this paper, where the right most bit is referred to as
the zero-th bit.
P
C : The 64-bit
corresponding
plaintext.
64-bit ciphertext. F I (11,K 1
PH : The left 32-bit of P.
PL : The right 32-bit of P. Kz
F z (xa K z
CH : The left 32-bit of C. Fz
CL : The right 32-bit of C.
Xi : The 32-bit intermediate value
in the i-th round.
Ki : The 48-bit subkey in the i-th round.
&(Xi, X i ) : The i-th round F-function.
A[i] : The i-th bit of A.
+-$Y
C"
F n (Xnv Kn
C
A[i,j,...,k] : A[i]@ A [ j ] @ ,...,e A [ k ] .
[Fiz. 11 D E S c i p h e r
388
-
The success rate of this method clearly increases when N or ( p 1/21 does. We now
refer to the most effective linear expression (i.e. Ip - 1/21 is maximal ) &s the best
expression and the probability p as the best probability. Then our main concern is
the following:
P1 How to find effective linear expressions.
P2 An explicit description of the success rate by N and p.
P3 A search for the best expression and a calculation of the best probability.
The first aim of this paper is to solve these problems for DES cipher. For this purpose,
we begin by studying linear approximations of S-boxes in Chapter 4, and will reach
an effective linear expression in Chapter 5. In this stage, the success rate will be
also shown in Lemma 2. As for the search problem, which was solved by a computer
program, we summarize the results in the annex.
For a practical known-plaintext attack of n-round DES cipher, we make use of the
best expression of (n-])-round DES cipher; that is to say, regarding the final round
as having been deciphered using Kn, we accept a term of F-function in the linear ex-
pression. Consequently, we obtain the following type of expression which holds with
the best probability of (n-1)-round DES cipher:
f“ii, i 2 , ..,4 @ C[jl,jz, ..,jb] J’n(CL, Kn)[hj11, -, k p , ..,kc].
= K[ki, (2)
If one substitutes an incorrect candidate for K,,in equation (2), the effectiveness of
this equation clearly decreases. Therefore, the following maximum likelihood method
can be applied to deduce K,,and K[kl,k l , ..,kc]:
389
Algorithm 2
Step1 For each candidate K$)( i = 1,2, ...) of K,, let T be the number of plaintexts
such that the left side of equation (2) is equal to zero.
S t e p 2 Let Tma=be the maximal value and Tminbe the minimal value of all Z's.
The success rate of this method will be discussed in Lemma 4 and Lemma 5.
The next aim of this paper is to consider the case where plaintexts are not random.
Assume that, for example, the probability that P[il,6, ..,i.] = 0 is not equal t o 1/2.
Then even if we eliminate the term P[il,6 ,..,].i fiom equation (2), the resultant
equation may be still effective. This concludes that Algorithm 2 can be directly
applied to an only-ciphertext attack of DES cipher.
We will study the known-plaintext attack of DES cipher in Chapter 6 and develop
the only-ciphertext attack procedure in Chapter 7.
Example 1
NS5(16,15) = 12. (4)
When NS,(a,B) is not equal to 32, we may say that there is a correlation between
the input and the output bits of S,. For example, equation (4) indicates that the
fourth input bit of S5 coincides with an XORed value of all output bits with prob-
ability 12/64 = 0.19. Consequently, taking account of the E expansion and the P
390
permutation in F-function, we see the following equation which holds with probability
0.19 for fixed K and randomly given X:
Table 1 describes part of distribution table of S-box S5, where the vertical and the
horizontal axes indicate a and /3 respectively, and each entry shows NS5(a,/3) - 32.
A complete table tells us that equation (4) is the most effective linear approximation
-
in all Sboxes 1i.e. INS,(a,/3) 321 is maximal ); therefore, equation (5) is the best
approximation of F-function.
The following Lemma is now trivial from the definition of S-boxes.
Lemma 1
(1) NS,(a,/3) is even.
(2) If LI = 1,32 or 33, then NS,,(a,/3) = 32 for all S, and /?.
1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5
1 ~ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
21 4-2 2-2 2-4 0 4 0 2-2 2-2 0-4
3 I 0 -2 6 -2 -2 4 -4 0 0 -2 6 -2 -2 4 -4
41 2-2 0 0 2-2 0 0 2 2 4-4-2-2 0
5 1 2 2-4 010-6-4 0 2-10 0 4-2 2 4
6 I -2 -4 -6 -2 -4 2 0 0 -2 0 -2 -6 -8 2 0
71 2 0 2-2 8 6 0 - 4 6 0-6-2 0-6-4
8 1 0 2 6 0 0-2-6-2 2 4-12 2 6-4 4
9 I -4 6 -2 0 -4 -6 -6 6 -2 0 -4 2 -6 -8 -4
101 4 0 0-2-6 2 2 2 2-2 2 4-4-4 0
11 I 4 4 4 6 2 -2 -2 -2 -2 -2 2 0 -8 -4 0
12 I 2 0 -2 0 2 4 10 -2 4 -2 -8 -2 4 -6 -4
13 I 6 0 2 0 -2 4 -10 -2 0 -2 4 -2 8 -6 0
14 I 72 -2 0 -2 4 0 2 -2 0 4 2 -4 6 -2 -4
151-2-2 8 6 4 0 2 2 4 8-2 8-6 2 0
16 I 2 -2 0 0 -2 -6 -8 0 -2 -2 -4 0 2 10 -20
171 2-2 0 4 2-2-4 4 2 2 0-8-6 2 4
18 I -2 0 -2 2 -4 -2 -8 4 6 4 6 -2 4 -6 0
1 9 1 -6 0 2 -2 4 2 0 4 -6 4 2 -6 4 -2 0
201 4-4 0 0 0 0 0-4-4 4 4 0 4-4 0
211 4 0-4-4 4-8-8 0 0-4 4 8 4 0 4
221 0 6 6 2-2 4 0 4 0 6 2 2 2 0 0
23 I 4 -6 -2 6 -2 -4 4 4 -4 -6 2 -2 2 0 4
241 6 0 2 4-10-4 2 2 0-2 0 2 4-2-4
251 2 4 -6 0 -2 4 -2 6 8 6 4 10 0 2 -4
261 2 2-8-2 4 0 2-2 0 4 2 0-2-2 0
2 7 ) 2 6-4-6 0 0 2 6 8 0-2-4-6-2 0
281 0-2 2 4 0-6 2-2 6-4 0 2-2 0 0
29 I 4 -2 6 -8 0 -2 2 10 -2 -8 -8 2 2 0 4
30 I -4 -8 0 -2 -2 -2 2 -2 2 -2 6 4 4 4 0
31 I -4 8 -8 2 -6 -6 -2 -2 2 -2 -2 -8 0 0 -4
321 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Next, we show an example of h o u n d DES cipher (Figure 3). In this case, we apply
equation (5) to the second and fourth rounds, and the following linear equation (which
is deduced from N&(27,4) = 22) to the first and final rounds:
K3 3K=
c n v ' CL
C
[Fig, 21 3 - r o u n d D E S c i p h e r
[Fig. 31 5 - r o u n d D E S c i p h e r
393
Although this equation contains 48-bit subkey Ka,the number of subkey bits which
Ka)[15]is only six, namely, K8[42]-K8[47]. Therefore,
essentially influences F~(CL,
we need 64 counters to carry out Algorithm 2. As regards the success rate of this
method, we c a prove the following lemma, which generalizes Lemma 2.
Lemma 4 Let N be the number of given random plaintezts and p be the probability
that equation (2) holds, and assume Ip - 1/21 is suficiently small. Then the success
rate of Algorithm 2 depends on 11,12, ...,l d , and a l p - 1/21 only.
where the product is taken over all subkey candidates except Kn.
Although q(')'s are not independent in our situation, our experiments have shown that
Lemma 5 gives a practically good approximation of the success rate, as can be seen
in the following.
Now let d = 1 and ll = 15 in equation (2). Then a numerical calculation of
expression (15) is as follows.
N I 2(p- 1/21-' I 41p- 1/21-' I -
81p 1/21-2 1 1 6 1 ~ -1/21-2
Success Rate I 48.6% I 78.5% I 96.7% I 99.9%
Table 3. The success rate of Algorithm 2 by Lemma 5 ( d = 1, 11 = 15).
Since this method can be also applied to deduction of the subkey bits of the first round,
we finally obtain 14 subkey bits by carrying out Algorithm 2 twice with negligible
memory. It is easy to deduce the remaining key bits, and we omit the detail. Our
computer experiments indicate results better than Table 3: The program completes
394
deriving the whole key bits in 20 seconds using 411.95 x2-l01-’ u known-plaintexts
and in 40 seconds using 811.95 x 2”01’2 2: 221 known-plaintexts. The success rate of
each attack is 88% and 99%, respectively.
The method to break 1Zround DES cipher is almost same as 8-round DES cipher.
We have succeeded in deriving the key completely in 50 hours using 811.91 x 2-’61’a 2:
2” known-plaintexts. Similarly, according to Lemma 4, it is possible to break 16-round
DES using 811.19 x2-=1-:, 21 247known-plaintexts by solving the following expression:
] ‘ C L [ l8,24,29]
&[7,18,24] @ P.[12,16] @ C ~ [ l 5 @ ~, @ F16(CLl K16)[15]
= Ki[19, 231 8 K3[22] @ K4[4] @ K5[22] @ K7[22] @ Ka[44] @
K0[22] @ K11[22] 8 Ki2[44] @ K13[22] @ K15[22]. (16)
Once finding 14 key bits, the remaining 42 key bits should be deduced exhaustively.
Then one can break l6-round DES cipher with negligibly small memory faster than
an exhaustive search for 56 key bits.
@ Fa(c~,
p~[27]@ Cn[27] @ CL[~] K8)[27]
= K2[1] @ Ks[8] @ K4[1] @ &[1] @ K7[8]. (17)
We note that P~[27]corresponds to the 39-th bit of the “real” plaintext before the
initial permutation IP. Therefore, assuming that the plaintexts consist of ASCII
codes, this bit must be equal to zero; that is, equation (17) has no plaintext bit.
In fact, under this assumption, a similar discussion to the previous chapter tells us
that seven key bits can be derived from equation (17) with high success rate using
812-”1-’ = ciphertexts only.
Moreover, assuming that the plaintexts consist of natural English sentences r e p
resented by ASCII codes, we can also make use of a linear approximation illustrated
in Figure 5. Then we easily see the following expression which holds with probability
+
1/2 25(-2/64)(-6/64)(10/64)(-20/64)3 = 1/2 - 1.83 x 2-12:
by eliminating &[7,18,24] from equation (18) holds with probability 1/2-2 x (0.35-
0.5) x 1.83 x 2-" = 1/2+ 1.10 x 2-l'. This indicates that seven key bits can be deduced
with high success rate using 811.10 x 2-'sI-2 2:2m uphertexts only.
Finally, we show a situation in which ldround DES cipher is still breakable faster
than an exhaustive search for 56 bits key. We now return to equation (16), which
contains five plaintext bits, and suppose that these bits are independently equal to
zero with probability 80% and all other plaintext bits are random. Then the linear
equation which is obtained by eliminating these five bits from equation (16) holds with
+ - +
probability 1/2 25(0.8 0.5)" x 1.19 x 2-22 = 1/2 1.48 x 2-26. This concludes that
seven key bits can be obtained with high success rate using 8 1 1 . 4 8 ~ 2 - ~ 1=
- ~1 . 8 2 2"
~
ciphertexts only.
P I /PL
K1 I K1
x5
+%s
I K8
CH1: C C H
C
V ' CL
[ F i g . 41 O n l y - C i p h e r t e x t [Fig, 51 O n l y - C i p h e r t e x t
A t t a c k o f 8 - r o u n d D E S (1) A t t a c k o f 8 - r o u n d DES (2)
396
8 Concluding Remarks
We have introduced a new method for cryptanalysis of DES cipher. This method
has enabled us the first known-plaintext attack of the full 16-round DES cipher and
the initial step toward an only-ciphertext attack. To go more deeply into the only-
ciphertext attack, however, we have to deal with several problems resulting from
non-randomness of plaintexts. The detail discussion of this type of attack including
complete tables and proofs, which we have omitted for lack of space, will appear in
the full paper.
References
[l] E.Biham and A.Shamir, “Differential Cryptanalysis of DESlike Cryptosystems,”
Journal of Cryptology,Vol.4,pp.3-72,(1991).
[3] E.Biham and AShamir, “Differential Cryptanalysis of the full 16-round DES,”
CR YPTO ‘92 Eztended A Qstracts,pp. 12-1-12-5,( 1992).
[7] R.A.Rueppe1, “Analysis and Design of Stream Ciphers,” Springer Verlag,( 1986).
397
Annex. The best expression and the best probability of DES cipher.