Differential Cryptanalysis of the Data Encryption Standard
Differential Cryptanalysis of the Data Encryption Standard
of the
Data Encryption Standard
Eli Biham1
Adi Shamir2
December 7, 2009
1
Computer Science Department, Technion – Israel Institute of Technology,
Haifa 32000, Israel.
Email: [email protected], WWW: http://www.cs.technion.ac.il/˜biham/.
2
Department of Applied Mathematics and
Computer Science, The Weizmann Institute of Science, Rehovot 76100, Israel.
Email: [email protected].
This version of the book is processed from the author’s original LaTeX files, and may be
differently paginated than the printed book by Springer (1993).
Copyright: Eli Biham and Adi Shamir.
Preface
The security of iterated cryptosystems and hash functions has been an
active research area for many years. The best known and most widely
used function of this type is the Data Encryption Standard (DES). It was
developed at IBM and adopted by the National Bureau of Standards in the
mid 70’s, and has successfully withstood all the attacks published so far
in the open literature. Since the introduction of DES, many other iterated
cryptosystems were developed, but their design and analysis were based on
ad-hoc heuristic arguments, with no theoretical justification.
We would like to use this opportunity to thank our colleagues who con-
tributed remarks, suggestions, ideas and designs. Shoji Miyaguchi’s FEAL
cryptosystem motivated the first version of our attack, and Ralph Merkle’s
Snefru motivated its extension to hash functions. We had valuable dis-
cussions with Henry Gilbert and Matthew Kwan, who carried out related
attacks on some of the cryptosystems discussed here, and we received valu-
able remarks from Philip Zimmermann. Don Coppersmith, Martin Hell-
man, and Alan Konheim sent us many helpful comments and suggestions
vi
which greatly improved the presentation of our results. Finally, the encour-
agement and help of our families are greatly appreciated.
Remark: Shortly before this book was sent to the publishers, Don
Coppersmith (who was a member of the DES design team at IBM in the
early 70’s) revealed that his team was aware of differential cryptanalysis
back in 1974, and designed the S boxes and the permutation in order to
optimally defeat it. They had to keep this information secret for 18 years for
national security reasons since it was such a potent form of cryptanalysis,
but decided to break the silence after we rediscovered and published it. In
response to our question, Don refused to reveal whether this is the strongest
attack on the DES that his team was aware of, but reiterated his belief that
the DES is still viable.
Contents
1 Introduction 1
2 Results 7
Glossary 169
Bibliography 177
Index 180
1
Introduction
Iterated cryptosystems are a family of cryptographically strong functions
based on iterating a weaker function n times. Each iteration is called a
round and the cryptosystem is called an n-round cryptosystem. The round-
function is a function of the output of the previous round and of a sub-
key which is a key dependent value calculated via a key scheduling algo-
rithm. The round-function is usually based on lookup tables (also known
as substitutions or S boxes), bit permutations, arithmetic operations and
the exclusive-or (denoted by ⊕ and XOR) operation. In most applications
the encryption algorithm is assumed to be known and the secrecy of the
data depends only on the secrecy of the randomly chosen key.
4 219
5 29
6 22
7 –
Table 1.1. The key search reduction factor in Chaum and Evertse’s attack.
and that the cost per solution was between $1–100. The preprocessing was
estimated to take 2.3 years on the same machine.
There has been a considerable controversy about the key size of 56 bits
in DES. Some researchers have proposed to strengthen DES by increasing
the key size[2,18] or even making all the subkeys independent. However,
these modifications were not adopted by the NBS.
In 1985 Chaum and Evertse[7] showed that a meet in the middle attack
can reduce the key search for variants of DES with a small number of rounds
by the factors shown in Table 1.1. They also showed that a slightly modified
version of DES reduced to seven rounds can be solved with a reduction
factor of 2. However, they proved that a meet in the middle attack of this
kind is not applicable to DES reduced to eight or more rounds.
In their method they look for a set of data bits (J) in a middle round and
a set of key bits (I) for which any change of the values of the I bits cannot
change the value of the J bits in either directions. Knowing those fixed
sets and given several plaintext/ciphertext pairs the following algorithm is
used:
1. Try all the keys in which all the key bits in I are zero. Partially
encrypt and decrypt a plaintext/ciphertext pair to get the data in
the middle round.
2. Discard the keys for which the J bits are not the same under partial
encryption/decryption.
3. For the remaining keys try all the possible values of the key bits in I.
1. Introduction 4
The analysis does not require the plaintext P or ciphertext T but uses
the quantity P ⊕T and requires a huge number of random inputs. The S box
pairs vary in the extent of correlation they produce so that, for example,
the pair S7/S8 needs about 1017 samples but pair S2/S3 needs about 1021 .
With about 1023 samples, all but the pair S3/S4 should give results (i.e.,
a total of 14 bits of key information). To exploit all pairs the cryptanalyst
needs about 1026 samples. The S boxes do not appear to have been designed
to minimize the correlation but they are somewhat better than a random
choice in this respect. Since the number of samples is larger than the 264
size of the sample space, this attack is purely theoretical, and cannot be
carried out. However, for DES reduced to eight rounds the sample size of
1012 or 1013 (about 240 ) is on the verge of practicality. Therefore, Davies’
analysis had penetrated more rounds than previously reported attacks.
During the last decade several cryptosystems which are variants of DES
were suggested. Schaumuller-Bichl suggested three such cryptosystems [31,
33]. Two of them (called C80 and C82) are based on the DES structure
with the replacement of the F function by nonreversible functions. The
third one, called The Generalized DES Scheme (GDES), is an attempt to
speed up DES. GDES has 16 rounds with the original DES F function
but with a larger block size which is divided into more than two parts.
She claimed that GDES increases the encryption speed of DES without
decreasing its security.
Functions which map arbitrarily long messages into fixed length values
are called hash functions. A hash function is called cryptographically strong
if it is difficult to find any message that maps to a given value or any pair of
messages that map to the same value. Many cryptographic hash functions
are designed using the same building blocks as iterated cryptosystems,
like the XOR operation, S boxes and iteration of a simple round-function
many times. A universal attack on hash functions can be derived from the
birthday paradox: Given about 2m/2 random messages where m is the size
of the hash value, there is a high probability that two of the messages hash
to the same value. The complexity of this attack is the standard tool to
compare the strength of hash functions.
to break the two-pass variant of Snefru by finding two messages which hash
to the same value. A similar reward was later announced for breaking the
four-pass variant of Snefru.
Results
In this chapter we summarize the complexities of the major attacks de-
scribed in this book. In the data collection phase, many pairs are encrypted
under the unknown key on the target machine. The resultant ciphertexts
are then fed into a data analysis algorithm, whose goal is to find the key.
The complexities are quoted in terms of the number of encryptions needed
to create all the necessary pairs in the data collection phase, since the data
analysis algorithm is usually faster and uses fewer and simpler operations.
These complexities are calculated for the electronic code book (ECB) mode
of operation; however, the quoted known plaintext complexities hold even
when the cipher block chaining (CBC) mode, the cipher feedback (CFB)
mode, or the output feedback (OFB) mode are used.
4 23 233 24 233
6 28 236 28 236
8 214 238 216 240
9 224 244 226 245
10 224 243 235 249
11 231 247 236 250
12 231 247 243 253
13 239 252 244 254
14 239 251 251 257
15 247 256 252 258
16 247 255 260 261
Our attacks on DES reduced to 10–16 rounds are not affected by the
choice of the P permutation, and thus the replacement of the P permu-
tation by any other permutation cannot make DES stronger, but many
replaced permutations would allow even much faster attacks on the resul-
tant cryptosystems. Even the replacement of the order of the eight DES S
boxes (without changing their values) can make DES much weaker: DES
with 16 rounds with a particular replaced order is breakable using about
238 chosen plaintexts. The replacement of the XOR operation by the more
complex addition operation makes this cryptosystem much weaker. DES
with random S boxes is shown to be very easy to break. Even a minimal
change of one entry in one of the DES S boxes can make DES easier to
break. A generalized version of DES (called GDES) is shown to be trivially
breakable by a chosen plaintext attack with six encryptions in less than
2. Results 9
4 8 234
8 128 236
12 221 242
16 229 246
20 237 250
24 245 254
28 256 260
30 260 262
31 263 263
The FEAL-8 cryptosystem can be broken with about 128 chosen plain-
texts or with about 236 known plaintexts. As a reaction to our attack on
FEAL-8, two new versions were introduced: FEAL-N[23], with any even
number of rounds and FEAL-NX[24] with a key size extended to 128 bits.
Nevertheless, FEAL-N and FEAL-NX can be broken for any N ≤ 31 rounds
faster than exhaustive search by either a chosen plaintext attack or a known
plaintext attack. A summary of the differential cryptanalytic results on
FEAL with various numbers of rounds appears in Table 2.2.
Lucifer with eight rounds is breakable within 221 steps using 24 ciphertext
pairs. The other variant of Lucifer reduced to eight rounds is even weaker.
Introduction to Differential
Cryptanalysis
Differential cryptanalysis is a method which analyzes the effect of particular
differences in plaintext pairs on the differences of the resultant ciphertext
pairs. These differences can be used to assign probabilities to the possible
keys and to locate the most probable key. This method usually works on
many pairs of plaintexts with the same particular difference using the re-
sultant ciphertext pairs. For DES and many other DES-like cryptosystems
the difference is chosen as a fixed XORed value of the two plaintexts. In this
introduction we show how these differences can be analyzed and exploited.
Due to its importance, we use DES as the canonical example of an iterated
cryptosystem, but try to make the definitions and theorems applicable to
other cryptosystems as well.
Plaintext (P)
K1
A a
F
K2
B b
F
K3
C c
F
K4
D d
F
K5
E e
F
K6
F f
F
K7
G g
F
K8
H h
F
Ciphertext (T)
S1 S2 S3 S4 S5 S6 S7 S8
I I I I I I I I
S1 S2 S3 S4 S5 S6 S7 S8
S1 S2 S3 S4 S5 S6 S7 S8
O O O O O O O O
S box number i and the round marker X are optional. For example
S1Ea denotes the first six bits of E(a). S1Ka denotes the first six
bits of the subkey K1. S1Ia denotes the input of the S box S1 which
is S1Ia = S1Ea ⊕ S1Ka . S1Oa denotes the output of S1 which is
S1Oa = S1(S1Ia ). See Figure 3.2 for more details.
3.2 Overview
The F function of DES takes a 32-bit input and a 48-bit key. The input is
expanded (by the E expansion) to 48 bits and XORed with the key (see
Figure 3.2). The result is fed into the S boxes and the resultant bits are
permuted.
The XOR with the key does not change the XOR value in the pair, i.e.,
the expanded XOR stays valid even after the XOR with the key, by the
formula:
(X ⊕ K) ⊕ (X ∗ ⊕ K) = X ⊕ X ∗ .
The output of the S boxes is mixed by the P permutation and the output
XOR of the P permutation is the permuted value of its input XOR, by the
formula:
P (X) ⊕ P (X ∗ ) = P (X ⊕ X ∗ ).
The output XOR of the F function is linear in the XOR operation that
connects the different rounds:
(X ⊕ Y ) ⊕ (X ∗ ⊕ Y ∗ ) = (X ⊕ X ∗ ) ⊕ (Y ⊕ Y ∗ ).
The XOR of pairs is thus invariant in the key and is linear in the E expan-
sion, the P permutation and the XOR operation.
14 4 13 1 2 15 11 8 3 10 6 12 5 9 0 7
0 15 7 4 14 2 13 1 10 6 12 11 9 5 3 8
4 1 14 8 13 6 2 11 15 12 9 7 3 10 5 0
15 12 8 2 4 9 1 7 5 11 3 14 10 0 6 13
In DES any S box has 64 · 64 possible input pairs, and each one of them
has an input XOR and an output XOR. There are only 64 · 16 possible
tuples of input and output XORs. Therefore, each tuple results in average
from four pairs. However, not all the tuples exist as a result of a pair,
and the existing ones do not have a uniform distribution. Very important
properties of the S boxes are derived from the analysis of the tables that
summarize this distribution:
Definition 3.2 A table that shows the distribution of the input XORs and
output XORs of all the possible pairs of an S box is called the difference
distribution table of the S box. In this table each row corresponds to a
particular input XOR, each column corresponds to a particular output
XOR and the entries themselves count the number of possible pairs with
such an input XOR and an output XOR.
Example 3.3 The first line of Table 3.2 shows that for the zero input
XOR, the output XOR must be zero too, as we noticed above. Also, the
different lines in the table have different output XOR distributions.
1
See Appendix A for the description of all the S boxes and their interpretation.
The difference distribution tables of all the S boxes appear in Appendix B.
3.2. Overview 17
Examples 3.3 and 3.4 demonstrate that for a fixed input XOR, the pos-
sible output XORs do not have a uniform distribution. The following Def-
inition extends Definition 3.3 with probabilities.
Definition 3.4 We say that X may cause Y with probability p by an S box
if for a fraction p of the pairs in which the input XOR of the S box equals
X, the output XOR equals Y .
Example 3.5 34x → 2x results from 16 out of the 64 pairs of S1, i.e., with
probability 14 . 34x → 4x results only from two out of the 64 pairs of S1,
1
i.e., with probability 32 .
The difference distribution tables let us find the possible input and out-
put values of pairs given their input and output XORs. The following ex-
ample shows a simple case:
Example 3.6 Consider the entry 34x → 4x in the difference distribution
table of S1. Since the entry 34x → 4x has value 2, only two pairs satisfy
these XORs. These pairs are duals. If the first pair is S1I , S1∗I then the
other pair is S1∗I , S1I . By looking at Table 3.4 we see that these inputs must
be 13x and 27x , whose corresponding outputs are 6x and 2x respectively.
Next we show how to find the key bits using known input pairs and
output XORs of an S box in the F function.
3.2. Overview 19
S box Percentage
S1 79.4
S2 78.6
S3 79.6
S4 68.5
S5 76.5
S6 80.4
S7 77.2
S8 77.1
Table 3.3. Percentage of the possible entries in the various difference dis-
tribution tables.
Output
XOR
(S1′O ) Possible Inputs (S1I )
Table 3.4. Possible input values for the input XOR S1′I = 34x by the
output XOR (in hexadecimal).
Example 3.7 Assume we know that S1E = 1x , S1∗E = 35x and S1′O = Dx
and we want to find the key value S1K . The input XOR is S1′E = S1′I = 34x
regardless of the actual value of S1K . By consulting Table 3.2 we can see
that the input to the S box has eight possibilities. These eight possibilities
make eight possibilities for the key (by SK = SE ⊕ SI ) as described in
Table 3.5. Each line in the table describes two pairs with the same two
inputs but with the opposite order. Each pair leads to one key, so each line
leads to two keys (which are SE ⊕ SI and SE ⊕ SI∗ ). The right key value
S1K must occur in this table.
Using additional pairs we can get additional candidates for S1K . Assume
that we get an input pair S1E = 21x , S1∗E = 15x whose output XOR is
S1′O = 3x . The possible inputs to the S box where 34x → 3x and the
corresponding possible keys are described in Table 3.6. The right key must
occur in both tables. The only common key values in Tables 3.5 and 3.6 are
17x and 23x . These two values are indistinguishable with this input XOR
3.2. Overview 20
06, 32 07, 33
10, 24 11, 25
16, 22 17, 23
1C, 28 1D, 29
Table 3.5. Possible keys for 34x → Dx by S1 with input 1x , 35x (in hex-
adecimal).
01, 35 20, 14
02, 36 23, 17
15, 21 34, 00
Table 3.6. Possible keys for 34x → 3x by S1 with input 21x , 15x (in hex-
adecimal).
since 17x ⊕ 23x = 34x = S1′E , but may become distinguishable by using a
pair with a different input XOR value (S1′E 6= 34x ).
the subkey.
The following definition extends Definitions 3.3 and 3.4 for use with the
F function:
Definition 3.5 Let X and Y be two values (representing potential input
and output XOR values of the F function). We say that X may cause Y
with probability p by the F function if for a fraction p of all the possible
input pairs encrypted by all the possible subkey values in which the input
XOR of the F function equals X, the output XOR equals Y . If p > 0 we
denote this possibility by X → Y .
Lemma 3.1 In DES, if X → Y with probability p by the F function then
every fixed input pair Z, Z ∗ with Z ′ = Z ⊕ Z ∗ = X causes the F function
output XOR to be Y by the same fraction p of the possible subkey values.
Proof To prove the lemma it suffices to show the property for each of the
′
S boxes. For each input XOR of the data SE there is SI′ = SE
′
regardless
of SK . If there are k possible input pairs to the S box with this input
XOR that may cause a given output XOR, we can choose precisely k key
∗
values SK = SE ⊕ SI , each taking the fixed input pair SE , SE to one of
the possible input pairs SI , SI∗ of the S box and thus causing the given
output XOR. Thus, the fraction p is held constant for all the input pairs,
and therefore equals the average over all the input pairs.
In other iterated cryptosystems this lemma does not necessarily hold. How-
ever, we assume that the fraction is very close to p, which is usually the
case.
Corollary 3.1 The probability p of X → Y by the F function is the
product of pi in which Xi → Yi by the S boxes Si (i ∈ {1, . . . , 8}) where
X1 X2 X3 X4 X5 X6 X7 X8 = E(X) and Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8 = P −1 (Y ).
The above discussion about finding the key bits entering S boxes can
be extended to find the subkey entering the F function. The method is as
follows:
pair. (Note that the input pair of the last round is known since it
appears as part of the ciphertext pair).
4. For each possible key value, count the number of pairs that result with
the expected output XOR using this key value in the last round.
5. The right key value is the (hopefully unique) key value suggested by
all the pairs.
3.3 Characteristics
We are left with the problem of pushing the knowledge of the XORs of
the plaintext pairs as many rounds as possible (in Step 3) without making
them all zeroes. When the XORs of the pairs are zero, i.e., both texts are
equal, the outputs are equal too, which makes all the keys equally likely.
The pushing mechanism is a statistical characteristic of the cryptosystem
which is an extension of the single round analysis. Before we define it
formally we give an informal definition and three examples.
Definition 3.6 (informal) Associated with any pair of encryptions are
the XOR value of its two plaintexts, the XOR of its ciphertexts, the XORs of
the inputs of each round in the two executions and the XORs of the outputs
of each round in the two executions. These XOR values form an n-round
characteristic. A characteristic has a probability, which is the probability
that a random pair with the chosen plaintext XOR has the round and
ciphertext XORs specified in the characteristic. We denote the plaintext
XOR of a characteristic by ΩP and its ciphertext XOR by ΩT .
ΩP = (L′ , 0x )
A′ = 0x a′ = 0 x p=1
F
ΩT = (L′ , 0x )
14
S1 : 0Cx → Ex with probability 64
S2, . . . , S8 : 00x → 0x with probability 1.
ΩP = (L′ , 60 00 00 00x )
14
A′ = 00 80 82 00x a′ = 60 00 00 00x p= 64
F
= P (E0 00 00 00x )
1
One-round characteristics with probability 4 are possible using non-zero
input XORs in S2 or S6.
ΩP = 00 80 82 00 60 00 00 00x
14
A′ = 00 80 82 00x a′ = 60 00 00 00x p= 64
F
B′ = 0 b′ = 0 p=1
F
ΩT = 60 00 00 00 00 00 00 00x
output XOR of the F function equals λiO . Every pair which is not a right
pair with respect to the characteristic and the independent key is called
a wrong pair with respect to the characteristic and the independent key.
Throughout this book we refer them shortly by right pair and wrong pair.
Definition 3.9 An n-round characteristic Ω1 = (Ω1P , Ω1Λ , Ω1T ) can be con-
catenated with an m-round characteristic Ω2 = (Ω2P , Ω2Λ , Ω2T ) if Ω1T equals
the swapped value of the two halves of Ω2P . The concatenation of the char-
acteristics Ω1 and Ω2 (if they can be concatenated) is the characteristic
Ω = (Ω1P , ΩΛ , Ω2T ) where ΩΛ is the concatenation of the lists Ω1Λ and Ω2Λ .
The following definitions and theorem deal with the probability of char-
acteristics:
Definition 3.10 Round i of a characteristic Ω has probability pΩ i
i if λI →
i Ω
λO with probability pi by the F function.
Definition 3.11 An n-round characteristic Ω has probability pΩ if pΩ is
the product of the probabilities of its n rounds:
n
Y
pΩ = pΩ
i .
i=1
characteristic’s plaintext XOR is a right pair using a fixed key (the one we
try to find). As shown in the next chapter, this probability is not constant
for all the keys, but we can assume that for randomly chosen key it is well
approximated by the probability of the characteristic.
ΩP = 00 80 82 00 60 00 00 00x
14
A′ = 00 80 82 00x a′ = 60 00 00 00x p= 64
F
B′ = 0 b′ = 0 p=1
F
14
C ′ = 00 80 82 00x c′ = 60 00 00 00x p= 64
F
ΩT = ΩP = 00 80 82 00 60 00 00 00x
where in the fourth round (if added) d′ = 00 80 82 00. We see that when the
plaintexts differ in the five specified bit locations, with probability about
0.05 there is a difference of only three bits at the input of the fourth round.
3.3. Characteristics 27
This structure of three rounds with a zero input XOR in the middle
round is very useful and forms the best possible probability for three-round
characteristics2. A similar structure can be used in five-round character-
istics. The middle round has zero input and output XORs and there is a
symmetry around it, i.e.,
ΩP = (L′ , R′ )
C′ = 0 c′ = 0 p=1
F
D ′ = R′ d′ = L′ ⊕ A′ p = pb
F
E ′ = A′ e′ = R ′ p = pa
F
ΩT = ΩP = (L′ , R′ )
2
Since less than two differing S boxes are impossible and there are charac-
teristics of this structure with two differing S boxes, each with the best possible
probability ( 14 ).
3.3. Characteristics 28
Among the most useful characteristics are those that can be iterated.
Definition 3.12 A characteristic Ω = (ΩP , ΩΛ , ΩT ) is called an iterative
characteristic if it can be concatenated with itself.
There are several kinds of iterative characteristics, but the simplest ones
are the most useful. These characteristics are based on a non-zero input
XOR to the F function that may cause a zero output XOR (i.e., two differ-
ent inputs yield the same output). This is possible in DES if at least three
neighboring S boxes differ in the pair (this phenomena is also described in
[4,13]). The structure of these characteristics is described in the following
example.
Example 3.13 If the input XOR of the F function is marked by ψ, such
that ψ → 0, then we have the following iterative characteristic:
ΩP = (ψ, 0)
A′ = 0 a′ = 0 p=1
F
ΩT = (0, ψ)
1
The best such characteristic has probability about 234 . A five-round char-
acteristic based on this iterative
characteristic iterated two and a half times
1 2 1
has probability about 234 ≈ 55000 (since the first half of this charac-
teristic which consists of the single round in which a′ = 0 and A′ = 0 has
probability 1).
3.4. The Signal to Noise Ratio 29
This section and the following ones deal with more advanced tools and
techniques that are not necessary in order to understand the fundamental
principles of the differential cryptanalytic attacks and may not be clear
to the first-time reader. We suggest that such a reader should continue
directly to the next chapter.
smaller number of S boxes, and use all the other S boxes only to identify
and discard those wrong pairs in which the input XORs in such S boxes
cannot cause the expected output XORs. Since about 20% of the entries in
the difference distribution tables of the S boxes are impossible, about 20%
of the wrong pairs can be discarded by each S box before they are actually
counted.
that when the signal to noise ratio is about 1–2, about 20–40 occurrences
of right pairs are sufficient. When the signal to noise ratio is much higher
even 3–4 right pairs are usually enough. When the signal to noise ratio is
much smaller the identification of the right value of the subkey bits requires
an unreasonably large number of pairs.
The known plaintext attack is not limited to the electronic code book
(ECB) mode of operation, but is also applicable to the cipher block chaining
(CBC) mode, the 64-bit cipher feedback (CFB) mode, and the 64-bit output
feedback (OFB) mode3 , since it is easy to calculate the real inputs of the
encryption function when the plaintexts and the ciphertexts are known.
3
The Output feedback mode with less than 64-bit blocks is not vulnerable to
this known plaintext attack. However, its use is not advisable[10] since it contains
cycles of size about 232 .
3.6. Structures 32
3.6 Structures
We can use these structures in two ways. When an attack uses n pairs
of each one of two characteristics we can use n/2 quartets which contain
the same information as each of the n pairs of each characteristic. Thus,
we save half the data. Using octets we can save 2/3 of the data. The other
approach is used when an attack can simultaneously use several alternative
characteristics and count on the same key bits. We can again have the
same factors by using structures of ciphertexts which simultaneously count
according to the various characteristics.
4
Differential Cryptanalysis of
DES Variants
In this chapter we attack several variants of DES: variants of DES with
fewer than 16 rounds, variants with independent keys, variants with mod-
ified internal operations and S boxes, and the GDES variant.
Ω1P = 20 00 00 00 00 00 00 00x
A′ = 0x a′ = 0 x p=1
F
Ω1T = 20 00 00 00 00 00 00 00x
where in the second round (if added) b′ = 20 00 00 00x .
Plaintext (P)
K1
A a
F
K2
B b
F
K3
C c
F
K4
D d
F
Ciphertext (T)
one bit in each S box input. Thus, about six output bits differ at the third
round. These bits are XORed with the known difference of the input of S1
in the second round (d′ = b′ ⊕ C ′ ), making a difference of about seven bits
in the input of the fourth round and about 11 bits after the E expansion.
Such an avalanche makes it very likely that the input of all the S boxes
differ at the fourth round. Even if an input of an S box does not differ in
one pair, it can differ in another pair and the exact value of d′ is usually
different for every pair.
Given four encrypted pairs we use a separate counting procedure for each
one of the seven S boxes in the fourth round. We try all the 64 possible
4.1. DES Reduced to Four Rounds 35
So far we have found 7 · 6 = 42 bits of the subkey of the last round (K4).
If the subkeys are calculated via the key scheduling algorithm of DES,
these are 42 actual key bits out of the 56 key bits, and thus 14 key bits
are still missing. One can now try all the 214 possibilities of the missing
bits and decrypt the given ciphertexts using the resulting keys. The right
key should satisfy the known plaintext XOR value for all the pairs, but the
other 214 − 1 values have only probability 2−64 to satisfy this condition.
Ω2P = 02 22 22 22 00 00 00 00x
A′ = 0x a′ = 0 x p=1
F
Ω2T = 02 22 22 22 00 00 00 00x
The value of S1′Eb is zero. Thus, S1′Ob = 0. As above we find S1′Od using
Equation 4.1 and similarly we can find the corresponding six key bits S1Kd .
Now we know the complete fourth round subkey K4. Using K4 we par-
tially decrypt all the given ciphertexts by “peeling off” the effect of the
last round. As a result we remain with ciphertexts of a three-round cryp-
tosystem. In this cryptosystem, we can use the characteristic Ω2 again to
4.1. DES Reduced to Four Rounds 36
calculate the subkey of the third round (K3). The inputs to the third round
c and c∗ are known as halves of the ciphertexts of the three-round cryp-
tosystem. The input XOR c′ is easily calculated. The output XOR C ′ is
calculated by C ′ = b′ ⊕ d′ where b′ equals the left half of Ω2P and d′ equals
the right half of the ciphertext XOR (TR′ ). The counting method is used
to count the number of occurrences of the possible keys of all the eight S
boxes at the third round. The values that are counted for all the pairs are
likely to be the right key values. As a result the complete K3 is found with
high probability.
′
• SEa 6= 0 for all the S boxes using either P3′ or P4′ .
′
• The value of SEa derived from P3′ is different from the value of SEa
′
′
derived from P4 , for every S box.
Then b and b∗ are known by decryption of the third round and B ′ is known
by B ′ = a′ ⊕ c′ = PR′ ⊕ c′ . The counting method is used to find K2.
This time it has to use the appropriate PR′ value for each pair. Now a, a∗
and a′ are known by decryption of the second round and A′ is known by
A′ = PL′ ⊕ b′ . The counting method finds K1. Using K1, K2, K3 and K4
we can decrypt the original ciphertexts to get the corresponding plaintexts
and then verify their plaintext XOR values. If we find only one possibility
for all the subkeys the verification must succeed. If several possibilities are
found then only one of them is likely to be verified successfully, and thus
the right key can be identified.
known plaintext variant of the attack needs about 233.5 known plaintexts
(see Section 3.5 for the conversion to known plaintext attacks).
The cryptanalysis of DES reduced to six rounds is more complex than the
cryptanalysis of the four-round version. We use two characteristics with
1
probability 16 , and choose the key value that is counted most often. Each
one of the two characteristics lets us find the 30 key bits of K6 which enter
five S boxes in the sixth round, but three of the S boxes are common so
the total number of key bits found by the two characteristics is 42. The
other 14 key bits can be found later by means of exhaustive search or by
a more careful counting on the key bits entering the eighth S box in the
sixth round.
Ω1P = 40 08 00 00 04 00 00 00x
1
A′ = 40 08 00 00x a′ = 04 00 00 00x p= 4
F
B ′ = 0x b′ = 0x p=1
F
1
C ′ = 40 08 00 00x c′ = 04 00 00 00x p= 4
F
Ω1T = 40 08 00 00 04 00 00 00x
Five S boxes in the fourth round (S2, S5, . . . , S8) have zero input XORs
′ ′
(SEd = 0) and thus their output XORs are zero (SOd = 0). The correspond-
ing output XORs in the sixth round can be found by F ′ = c′ ⊕ D′ ⊕ TL′ .
Since the right key value is not suggested by all the pairs (due to the prob-
abilistic nature of the characteristic), we cannot use a separate counting
4.2. DES Reduced to Six Rounds 38
procedure for the subkey bits entering each S box. In order to increase the
signal to noise ratio we should simultaneously count on subkey bits enter-
ing several S boxes. The best approach is to count on all the 30 countable
subkey bits together, which maximizes the probability that the right key
value is the one counted most often. A straightforward implementation of
this method requires 230 counters, which is impractical on most comput-
ers. However, the improved counting procedure described at the end of this
section achieves exactly the same result with much smaller memory.
The same efficient algorithm is used to find the 30 key bits of S1, S2, S4,
S5 and S6 using the second characteristic Ω2 which is:
Ω2P = 00 20 00 08 00 00 04 00x
1
A′ = 00 20 00 08x a′ = 00 00 04 00x p= 4
F
B ′ = 0x b′ = 0x p=1
F
1
C ′ = 00 20 00 08x c′ = 00 00 04 00x p= 4
F
Ω2T = 00 20 00 08 00 00 04 00x
Again, five S boxes in the fourth round (S1, S2, S4, S5 and S6) have zero
input XORs. The computed key values of the common S boxes S2, S5 and S6
should be the same in both calculations (otherwise we should analyze more
pairs or consider additional candidate keys with almost maximal counts).
If this test is successful, we have probably found 42 bits of K6.
DES has 56 key bits, of which 14 bits are still unknown. The simplest way
to find them is to search all the 214 possibilities for the expected plaintext
XOR value of the decrypted ciphertexts. A faster way is to start looking
for the six missing bits of K6 which enter S3 (the other eight key bits occur
only in other subkeys). At first we use our partial knowledge of the key to
discard wrong pairs. For each pair we check if at the five S boxes having
4.2. DES Reduced to Six Rounds 39
S1 ++++++ 3+..++
S2 ++3+++ +3+333
S3 ++++++ ++++++
S4 ++++3+ ++..++
S5 3+++++ +++.++
S6 ++++3+ +.+.++
S7 3+++++ +++.++
S8 ++3+++ ++++++
′ ′
SEd = 0 by the characteristic, the value of SOf obtained by f and f ∗ and
the known key bits form the expected value from F ′ = c′ ⊕ D′ ⊕ TL′ . If
not, this cannot be a right pair. Otherwise it is almost certainly a right
pair (since the condition can be satisfied accidentally only with probability
1
2−20 ). For the remainder of the cryptanalysis we use only the (roughly) 16
of the pairs which are believed to be the right pairs. This filtration greatly
improves the signal to noise ratio of the following scheme, which otherwise
would be impractical.
Table 4.1 describes the known bits of the input of the F function and of
the subkey at the fifth round, assuming we know the 42 key bits. The digit
‘3’ means that the bit depends on the exact value of the missing key bits
that enter S3 in the sixth round. ‘+’ means that it depends only on known
key bits. The eight key bits which are not used at all in the subkey K6
are marked by ‘.’. This table shows that by guessing the six missing bits
of K6 we can verify its correctness by calculating e and e∗ for each right
pair by a single round decryption with K6 and by verifying that the values
of S2′Oe , S3′Oe and S8′Oe (for which all the input and key bits are known)
are as expected by E ′ = d′ ⊕ f ′ . Furthermore, for the five other S boxes
we can verify that there are values of the missing key bits which are not
used in K6, such that the output XORs are as expected. The verification
of most of the 64 possibilities of the six missing bits of K6 should fail, and
with high probability only one possibility survives. This value completes
K6. Only eight key bits are missing now. They can be found by trying all
the 256 possibilities, or by applying a similar analysis to key bits that enter
S boxes in the fifth round.
How much data is needed? The signal to noise ratio of the first part of
the algorithm (which finds 30 key bits) is
1
230 · 16
S/N = = 230−4−10 = 216 .
45
4.2. DES Reduced to Six Rounds 40
The signal to noise ratio is high and thus only 7–8 right pairs of each
1
characteristic are needed. Since the characteristics’ probability is 16 , we
need about 120 pairs of each characteristic for the analysis. The signal to
noise ratio of the later part is
26 · 1
S/N = = 16.
4
This is lower, but we do not care since we can almost certainly identify
and use only the 7–8 right pairs from the first part (while eliminating most
of the noise) and intersect the sets of possible key values. To reduce the
number of ciphertexts needed we use quartets which combine the two char-
acteristics. As a result only 240 ciphertexts (representing 120 pairs of each
characteristic) are needed for the complete cryptanalysis. The conversion of
this attack to a known plaintext attack needs about 236 known plaintexts.
Using the clique method with 240 ciphertexts it takes about 0.3 seconds
on a personal computer to find the key in 95% of the tests conducted on
DES reduced to six rounds. When 320 ciphertexts are used the program
succeeds in almost all the cases. The program uses about 100K bytes of
4.3. DES Reduced to Eight Rounds 41
DES reduced to eight rounds can be broken using about 25000 ciphertext
pairs for which the plaintext XOR is P ′ = 40 5C 00 00 04 00 00 00x .
The method finds 30 bits of K8. 18 additional key bits can be found using
similar manipulations on the pairs. The remaining eight key bits can be
found using exhaustive search.
ΩP = 40 5C 00 00 04 00 00 00x
1
A′ = 40 08 00 00x a′ = 04 00 00 00x p= 4
F
= P (0A 00 00 00x )
10·16
B ′ = 04 00 00 00x b′ = 00 54 00 00x p= 64·64
F
= P (00 10 00 00x )
C′ = 0 c′ = 0 p=1
F
10·16
D′ = 04 00 00 00x d′ = 00 54 00 00x p= 64·64
F
1
E ′ = 40 08 00 00x e′ = 04 00 00 00x p= 4
F
ΩT = ΩP = 40 5C 00 00 04 00 00 00x
4.3. DES Reduced to Eight Rounds 42
1
This characteristic has probability 10485.76 . The input XOR in the sixth
′
round of a right pair is f = 40 5C 00 00x . Consequently, for five S boxes
′ ′ ′
SEf = SIf = 0 and SOf = 0.
′ ′
In right pairs, the five S boxes S2, S5, S6, S7 and S8 satisfy SEf = SIf =0
′ ′ ′ ′ ′ ′ ′
and SOf = 0. By the formula H = TL ⊕ g = TL ⊕ e ⊕ F we can find
the output XORs of the corresponding S boxes in the eighth round. The
input data of the eighth round is known from the ciphertexts. Therefore,
we can use the counting method to find the 30 subkey bits entering the
five S boxes at the eighth round. The signal to noise ratio of this counting
230
scheme is S/N = 45 ·10485.76 = 100.
f ′ = X0 5V Z0 00x
To find the other bits, we filter all the pairs and leave just the pairs with
′
the expected SO value using the known values of h and the known bits of
4.3. DES Reduced to Eight Rounds 44
S1 +4++++ 3+..4+
S2 ++3++1 134333
S3 +14+++ +1+41+
S4 ++++31 11..1+
S5 31++4+ +++.++
S6 4++13+ +.+.++
S7 3+4+++ +++.++
S8 ++31+4 ++++++
K8 entering S6, S7 and S8. The expected number of the remaining pairs
is 53. This number is so small that we can afford to analyze each pair much
more thoroughly than in the first phase, and thus recover more key bits.
The next bits we are looking for are the twelve bits of K8 that correspond
to S2 and S5. We use a similar counting method (exploiting the enhanced
signal to noise ratio created by the higher concentration of right pairs) and
then filter more pairs. A wrong pair is not discarded by either this filter
or its predecessor with probability 2−20 and thus almost all the remaining
pairs are right pairs.
Using the known subkey bits of K8 we can calculate the values of 20 bits
of each of H and H ∗ for each pair and thus 20 bits of each of g and g ∗ (by
g = TL ⊕ H). Table 4.2 shows the dependence of the g bits and the subkey
bits of K7 at the seventh round on the known and unknown subkey bits of
K8 at the eighth round. The digits 1, 3 and 4 mean that they depend on
the value of the unknown key bits entering the corresponding S box in the
eighth round. ‘+’ means that it depends only on the known bits of K8. The
eight key bits which are not used at all in K8 are marked by ‘.’.
they can be found by exhaustive search of 256 cases, using one ciphertext
pair, and verifying that the plaintext XOR is as expected.
To save disk space we can filter the pairs as soon as they are created
and discard all the identifiable wrong pairs (leaving 0.85 ≈ 13 of all the
pairs). Therefore, in the case of counting on 24 bits, the 25000 pairs are
reduced to about 7500 pairs. However, when the counting is carried out
on 18 bits, the 150000 pairs are reduced to 50000 pairs. For this case, we
devised another criterion which discards most of the wrong pairs while
leaving almost all the right pairs. This criterion is based on a carefully
chosen weighting function and discards any pair whose weight is lower than
a particular threshold. This criterion is the extension of the filtering of the
identifiable wrong pairs (where the threshold is actually zero) and is based
on the idea that a right pair typically suggests more possible key values
than a wrong pair. The weighting function is the product of the number of
possible keys of each of the five countable S boxes (i.e., the number in the
corresponding entry in the difference distribution tables). The threshold is
chosen to maximize the number of discarded pairs, while leaving as many
right pairs as possible. The best threshold value was experimentally found
to be 8192, which discards about 97% of the wrong pairs and leaves almost
all the right pairs. This reduces the number of pairs we actually analyze
from 150000 to about 7500, with a corresponding reduction in the running
time of the attack.
The attacking program finds the key in less than two minutes on a per-
sonal computer using 150000 pairs with 95% success rate. Using 250000
pairs the success rate is increased to almost 100%. The program uses 460K
bytes of memory, most of it for the counting array (one byte suffices for
each counter since the maximum count is about 53, and thus the total ar-
ray size is 218 bytes), and the preprocessed speed up tables. The program
which counts using 224 memory cells finds the key using only 25000 pairs.
A known plaintext attack needs about 240 plaintexts.
We can see that the input bits number 2 and 6 are always equal. In
12 4
addition for 16 of the input values they are both 0 and for 16 of them they
are both 1. If we know the XOR of the key bits entering these two bits
of S2 in the first round (i.e., bits 57 and 42 of the key) we can use only
4.3. DES Reduced to Eight Rounds 46
plaintexts whose corresponding bits (i.e., bits 5 and 9) have the same XOR
value (causing bits number 2 and 6 to be equal). Other pairs of plaintexts
cannot satisfy the characteristic. The probability of the characteristic and
the signal to noise ratio are then twice as good, and let us use less than
half the number of pairs.
If we know the values of both bits in a key, we can choose the two bits
in the plaintexts such that the bit values entering S2 are both zero. In
this case the probability of S2 becomes 12 16
16 instead of 64 . Thus, we get a
factor of three in the probability and the signal to noise ratio. The higher
signal to noise ratio lets us use less than 13 of the pairs needed originally.
A factor of four can be easily obtained by a characteristic that holds for
all the inputs in which bit number 1 has value 1 and both bits number 2
and 6 have value 0.
ΩP = 84 41 13 46 40 5C 00 00x
12·14·16
A′ = 80 41 13 46x a′ = 40 5C 00 00x p= 643
F 1
= P (30 EF 00 00x ) ≈ 100
ΩT = 04 00 00 00 40 5C 00 00x
1
The following two-round iterative characteristic with probability about 234
can be used to cryptanalyze (at least in principle) variants of DES with an
arbitrary number of rounds:
4.4. DES with an Arbitrary Number of Rounds 48
ΩP = (ψ, 0) = 19 60 00 00 00 00 00 00x
A′ = 0 a′ = 0 p=1
F
14·8·10
B′ = 0 b′ = ψ = p= 643
F 1
19 60 00 00x ≈ 234
ΩT = (0, ψ) = 00 00 00 00 19 60 00 00x
4.4.1 3R-Attacks
In 3R-attacks, counting can be done on the bits of the subkey of the last
round that enter S boxes whose corresponding S boxes in the round which
follows the last round of the characteristic have zero input XORs. The four,
six, eight and nine-round attacks described in the previous sections are of
this type.
In DES reduced to eight rounds the first 30 subkey bits can be found using
the iterative characteristic with five rounds (whose probability is about
1
55000 ) by an attack which is similar to the one described in Section 4.3.
224
Using an array of size 224 we have S/N = 44 ·0.8·55000 = 1.5, and we need
20 30 230
about 2 pairs. Using an array of size 2 we have S/N = 45 ·55000 = 19.
About 67% (1 − 0.85 ) of the wrong pairs can be discarded a-priori.
For DES reduced to ten or more rounds, the signal to noise ratio of the
3R-attacks becomes too small, and thus 3R-attacks on these variants are
not recommended.
4.4. DES with an Arbitrary Number of Rounds 50
4.4.2 2R-Attacks
In 2R-attacks counting can be done on all the bits of the subkey of the last
round. Wrong pairs can be discarded if the input XORs of the S boxes in
the previous round may not cause the expected output XORs. An S box
whose input XOR is zero should also have an output XOR of zero, i.e., the
1
success rate of this check is 16 . For the other S boxes the success rate is
about 0.8.
G′ = 0 g′ = 0
F
H ′ = TR′ h′ = ψ
F
I ′ = TL′ ⊕ ψ i′ = TR′
F
T ′ = (TL′ , TR′ ).
We can discard wrong pairs in which ψ 6→ TR′ or TR′ 6→ TL′ ⊕ ψ and count
the possible occurrences of the key bits in the remaining pairs. At h′ → H ′
′ ′ ′
five S boxes satisfy SEh = SIh = 0 and thus SOh must be zero (which
1
happens for wrong pairs with probability 16 ), while the other three S boxes
′ ′
satisfy SIh → SOh (which happens for wrong pairs with probability 0.8).
48 −23.6
Therefore the counting on all the 48 bits of K9 has S/N = 482·0.8·23 ·( 1 )5 ≈
16
18 −23.6
2 ·2
229 and counting on 18 bits has S/N = 43 ·0.8 5 ·0.83 ·( 1 )5 ≈ 2
11
. Even a
16
separate counting on the six key bits entering each S box is possible with
6 −23.6
S/N = 4·0.827 ·0.8
·2
3 ·( 1 )5 = 12. The identification of the wrong pairs leaves
1 5
16
only 0.8 · 16 · 0.88 ≈ 2−23.5 of the wrong pairs and thus only about one
3
wrong pair remains per each right pair. The characteristic’s probability is
2−23.6 and thus we need about 226 pairs for the cryptanalysis. This attack
needs more data than the previous 3R-attack on DES reduced to nine
rounds but needs much less memory. Due to the very good identification of
wrong pairs (only about eight pairs are not discarded, four right pairs and
4.4. DES with an Arbitrary Number of Rounds 51
four wrong pairs) it is possible to use the clique method on all the 48 bits.
4.4.3 1R-Attacks
In 1R-attacks counting can be done on all the bits of the subkey of the last
round which enter S boxes with non-zero input XORs. Verification of the
values of TR′ itself and checks on all the other S boxes in the last round to
find whether the input XOR may cause the output XOR can be done. For
those S boxes with a zero input XOR the output XOR should be zero too,
1
i.e., the check’s success rate is 16 . Since the input XOR of the last round
is constant, we cannot distinguish between several subkey values. However,
the number of such values is small (eight in all the 1R-attacks described
here) and each can be checked later in parallel by the next part of the
algorithm (either via exhaustive search or by a differential cryptanalytic
method).
H′ = 0 h′ = ψ
F
I′ = 0 i′ = 0
F
J ′ = TL′ j′ = ψ
F
T ′ = (TL′ , ψ).
We can identify the right pairs easily. Those pairs satisfy TR′ = ψ, and the
20 bits in TL′ going out of S4, . . . , S8 are zero. This also holds for 2−52 of
the wrong pairs. For the other three S boxes we count the possible values
18 −31.5
of their 18 key bits with S/N = 2 43·2 33
·2−52 ≈ 2 . Thus we need about 2
34
pairs.
4.4.4 Summary
For the sake of clarity, we summarize in Table 4.5 all the cryptanalytic
results obtained so far, even though they are not the best attacks described
in this book. The various columns in Table 4.5 are:
4 23 23 42 1 1 16 [6] 24 233
6 27 27 30 3 1/16 216 ∗ 28 236
8 215 213 30 5 1/10486 15.6 [24] 216 240
9 225 224 30 6 1/1000000 1.0 [30] 226 245
10 234 4 18 9 2−31.5 233 ∗ 235 249
11 235 211 48 9 2−31.5 221 ∗ 236 250
12 242 4 18 11 2−39.4 225 ∗ 243 253
13 243 219 48 11 2−39.4 6 [30] 244 254
14 250 4 18 13 2−47.2 217 ∗ 251 257
15 251 227 48 13 2−47.2 4 [42] 252 258
16 257 25 18 15 2−55.1 29 ∗ 258 261
The known plaintext attack is faster than exhaustive search for variants with up to 13
rounds. The chosen plaintext attack is faster than exhaustive search for variants with up
to 15 rounds. The best results described in this book are summarized in Table 5.2.
Needed Pairs: The number of pairs encrypted during the data collection
phase.
Analyzed Pairs: The number of pairs which are actually analyzed by the
data analysis phase of the attack. This number excludes the iden-
tifiable wrong pairs which can be easily discarded during the data
collection phase.
Found Bits: The number of key bits found in the first part of the attack
by using a single characteristic. The other key bits are found later by
a variety of other techniques.
Characteristic: The number of rounds and the probability of the charac-
teristic used in the attack.
S/N : The signal to noise ratio of the attack. The number in brackets (if
any) denotes the number of initial bits found with that signal to noise
ratio. An asterisk denotes that the clique method is preferable over
the counting method and then the S/N is based on the number of
found bits.
Chosen Plains: The number of chosen plaintexts needed by the chosen
plaintext attack.
4.4. DES with an Arbitrary Number of Rounds 54
Table 4.6. Possible inputs and outputs for 32x → 0 by S2 (in binary).
Table 4.7. Possible inputs and outputs for 2Cx → 0 by S3 (in binary).
As described in Section 4.3.1, we can use the individual values of the input
and output bits of the S boxes in order to marginally improve the proba-
bility of our characteristics. In this subsection we show how to apply this
idea to the iterative characteristic.
The XOR value of bit 6 of S2I and of bit 2 of S3I equals the XOR value
of the corresponding key bits in S2K and S3K since the corresponding bits
in S2E and S3E are the same bit due to the E expansion. If the XOR value
of these key bits is known to be 1 then the probability of the two-round
14·8·8 7 1
iterative characteristic becomes 64 2 ·32 = 210 ≈ 146 . If their XOR value is
4.4. DES with an Arbitrary Number of Rounds 55
0 1
128 1.6 · 2−51 1.6 · 2−65 1.6 · 2−51 1.25 · 252
1 7
128 1.6 · 2−53 1.6 · 2−63 1.6 · 2−53 1.25 · 254
2 21
128 1.6 · 2−55 1.6 · 2−61 1.625 · 2−55 1.23 · 256
3 35
128 1.6 · 2−57 1.6 · 2−59 2−56 258
4 35
128 1.6 · 2−59 1.6 · 2−57 2−56 258
5 21
128 1.6 · 2−61 1.6 · 2−55 1.625 · 2−55 1.23 · 256
6 7
128 1.6 · 2−63 1.6 · 2−53 1.6 · 2−53 1.25 · 254
7 1
128 1.6 · 2−65 1.6 · 2−51 1.6 · 2−51 1.25 · 252
14·8·2 7 1
known to be 0 then the probability becomes 642 ·32 = 212 ≈ 585 .
The other characteristic described with the same probability has an op-
posite behavior. When 36x → 0 by S2 the value of bit number 6 is always 0
and thus the probabilities are exchanged. If the XOR of the key bits is 0
1 1
then the probability is 146 and if it is 1 then the probability is 585 .
Consider for example, an attack on DES with 16 rounds. There are seven
rounds in which the input XOR is assumed to be ψ. Suppose that, out of
these seven rounds, we have n rounds (0 ≤ n ≤ 7) whose key bit number 6
of S2K equals key bit number 2 of S3K . In this case, the probability of the
15-round characteristic is
n 7−n
7 7 47−n
≈ 1.6 .
212 210 265
n
For the other characteristic the probability is 1.6 2465 . Table 4.8 describes
the probabilities for each number n of equalities among the key bits and
the relative frequency of such keys.
In this section we study the intricate relationship between the structure and
the security of DES by modifying DES in a variety of ways and applying
differential cryptanalytic techniques to the modified variants. The modi-
fied operations are the P permutation, the S boxes and their order in the
encryption process, the XOR operation, and the E expansion. The results
shed considerable light on the (unpublished) design rules of the DES.
ΩP = 00 00 00 00 00 60 00 00x
12
A′ = 00 60 00 00x a′ = 00 60 00 00x p= 64
F
12
B ′ = 00 60 00 00x b′ = 00 60 00 00x p= 64
F
C′ = 0 c′ = 0 p=1
F
ΩT = 00 60 00 00 00 00 00 00x .
with probability about 2−16.5 the input XORs and the output XORs of
five S boxes in round 14 are zero, and in this case 18 bits of the ciphertext
XOR of right pairs are zero. Therefore, we can easily discard almost all
the wrong pairs. This attack requires up to 220 pairs. Attacks in which two
output bits of an S box enter as the two private bits of the same S box in
the following round may be mounted for about 9% of the replacements of P
by random permutations, and their complexity is between 220 –242 . Many
other random permutations may be attacked using other characteristics.
The DES cryptosystem specifies a certain order of the eight S boxes. Even
a modification of the order of the S boxes can make the cryptosystem much
weaker. Consider for example the case in which S1, S7 and S4 are brought
together in this order (without loss of generality, in the first three S box
entries) and the other S boxes are set in any order. Then there is a similar
two-round iterative characteristic, denoted by ψ • = 1D 40 00 00x whose
1
probability is about 73 :
ΩP = 1D 40 00 00 00 00 00 00x
A′ = 0 a′ = 0 p=1
F
14·16·16
B′ = 0 b′ = 1D 40 00 00x p= 643
F 1
≈ 73
ΩT = 00 00 00 00 1D 40 00 00x .
1
The 15-round characteristic has probability 737 ≈ 2−43 and thus the
4.5. Modified Variants of DES 58
The 17-round characteristic has probability 7318 ≈ 2−50 and thus the
18-round cryptosystem can be attacked using about 253 chosen plaintexts
18 −50
with S/N = 243 ·2·2−52 = 214 .
In these attacks the clique method can be used due to the excellent
identification of wrong pairs (only 2−53 of them remain). As in the attack
based on the iterative characteristic this attack is independent of the choice
of the P permutation.
In DES there are two XOR operations in each round. The first XORs the ex-
panded input with the subkey within the F function while the other XORs
the output of the F function with the other half of the input data. The
following subsections describe three possible modifications which replace
some of the XOR operations by addition operations. The same analysis
applies when the XORs are replaced by subtraction operations.
ΩP = 00 00 00 00 00 0C 00 00x
1
A′ = 0 a′ = 00 0C 00 00x p= 64
F
B′ = 0 b′ = 0 p=1
F
ΩT = 00 0C 00 00 00 00 00 00x
1 7
The 15-round characteristic has probability ( 64 ) = 2−42 . The 1R-attack
counting scheme which finds the six subkey bits entering S4 in the sixteenth
26 18
round has S/N = 242 ·2−32 ·2−24 ·4 = 2 . Thus the attack on this modified
16-round DES requires about 244 pairs of encryptions. The six key bits
entering S3 can then be found using the same encryptions with even higher
signal to noise ratio. Either exhaustive search of the 244 possible keys (with
12 fixed bits) or similar analysis with other characteristics recover the right
key. The total complexity of this attack is thus 245 . The known plaintext
variant of this attack needs about 254 known plaintexts.
Modifying all the XORs by additions changes the probability of this char-
acteristic from 2−6 to 2−8 . This happens because the additional addition
operation (for example c = a + B) does not change the input XOR (c′ = a′
for B ′ = 0) with probability 14 . Thus the 16-round characteristic has prob-
ability 2−64 , the 15-round characteristic has probability 2−58 , the 14-round
characteristic has probability 2−56 and the 13-round characteristic has
probability 2−50 .
The analysis of this attack shows that 252 pairs are needed to cryptana-
lyze the 14-round cryptosystem. The attacks on the 15-round and 16-round
cryptosystems are slower than exhaustive search.
n−1
1 1
characteristic with an odd n has probability 16 · ( 16 ) 2 = 2−2−2n .
In a random S box there is a very high probability (about 0.998) that there
are two different inputs that differ in the two middle input bits of an S
box (which do not affect the neighboring S boxes) which have the same
output. In this case there is an iterative characteristic which is (without
loss of generality the S box is S1 and S1′I = Cx ):
ΩP = 60 00 00 00 00 00 00 00x
A′ = 0 a′ = 0 p=1
F
ΩT = 00 00 00 00 60 00 00 00x
97% of the sets of eight S boxes have such iterative characteristic with
probability 18 or more. The corresponding 13-round characteristics have
probability 2−18 and the 3R-attack on 42 subkey bits needs 220 pairs with
S/N = 210 . Table 4.9 describes the relationship between the probability of
the characteristic, the number of pairs needed, and the probability that a
set of random S boxes has such a characteristic.
S boxes) two different inputs that differ only in the private bits of one S
box must have different outputs. But there is a high probability that there
are two different inputs differing in the input bits of two S boxes which
have the same output. In this case there is an iterative characteristic which
is (without loss of generality the difference is in S1 and S2, and the input
XOR is 7E 00 00 00x ):
ΩP = 7E 00 00 00 00 00 00 00x
A′ = 0 a′ = 0 p=1
F
ΩT = 00 00 00 00 7E 00 00 00x
In random tests we found several attacks that use between 243 to 247 pairs.
We estimate that attacks that use this number of pairs can be found for
more than 90% of the 16-round cryptosystems which use S boxes chosen
as four random permutations.
S boxes of DES1 we can force this S box to have two inputs which differ
only in one private input bit of the S box and have the same output. For
example, such a modification may set the value of S(4) to be equal to
S(0) (i.e., the third value in the first line to be equal to the first value in
the first line). Then, the two inputs 0 and 4 have the same output, and
1
thus the probability of 4 → 0 by this S box is 32 . A two-round iterative
1
characteristic based on this property has probability 32 and is (without
loss of generality the difference is in S1):
ΩP = 20 00 00 00 00 00 00 00x
A′ = 0 a′ = 0 p=1
F
1
B′ = 0 b′ = 20 00 00 00x p= 32
F
ΩT = 00 00 00 00 20 00 00 00x
1
This modification violates the permutation property in the S boxes of DES.
2
Note that any function with a uniform difference distribution table must have
a non-uniform output distribution in which some output values result from more
4.5. Modified Variants of DES 63
Variants of DES with such S boxes turn out to be easier to attack. The
regularity implies that the input XORs which modify only private input
bits of the S boxes (which are not replicated to two S boxes) may cause zero
4 1
output XOR with probability 64 = 16 . Therefore, the following two-round
1
iterative characteristic has probability 16 :
ΩP = 60 00 00 00 00 00 00 00x
A′ = 0 a′ = 0 p=1
F
1
B′ = 0 b′ = 60 00 00 00x p= 16
F
ΩT = 00 00 00 00 60 00 00 00x .
input values than others. This unavoidable property can be used by the crypt-
analyst to design efficient non-differential attacks, in addition to the differential
attacks described in this subsection.
4.5. Modified Variants of DES 64
ΩP = B0 00 00 00 00 00 05 00x
1
A′ = 10 00 00 00x a′ = 00 00 05 00x p= 4
F
1
B ′ = 00 00 02 00x b′ = A0 00 00 00x p= 8
F
1
C ′ = 10 00 00 00x c′ = 00 00 07 00x p= 4
F
= A′
1
D′ = 00 00 02 00x d′ = B0 00 00 00x p= 2
F
= B′
ΩT = 00 00 05 00 B0 00 00 00x
Only 228 pairs are needed to break the 16-round cryptosystem using a
2R-attack. There are several additional characteristics that can be used to
attack the cryptosystem with a similar number of pairs.
modified cryptosystem requires only about 252 pairs (rather than 257 pairs).
The attack on DES reduced to eight rounds with independent keys is ba-
sically similar to the attack on DES reduced to eight rounds described in
Section 4.3. We start by using the same algorithm to find the first 30 bits
of K8 and then proceed to find the remaining bits of K8 and the bits of all
the other subkeys by variants of this algorithm. The attack uses the same
characteristic as in the attack described in Section 4.3 plus 100 pairs with
two additional characteristics.
After finding the first 30 bits of K8, we filter the pairs, identify the right
pairs and discard all the wrong pairs (with relatively few errors). The other
18 bits of K8 cannot be found yet since we cannot assume that the subkeys
are related to each other by the key scheduling algorithm. To avoid this
problem we first look for bits of K7. Table 4.2 shows the bits in g that can be
calculated for any given ciphertext (the known key bits there are irrelevant
to our case). For each of the eight S boxes of the seventh round and for each
of its 64 possible key values we count the number of pairs for which this
key value is possible. A key value is possible for an S box in a pair if there
is an input pair to the S box whose computable bits have the calculated
value, the other bits have any value and the output XOR is as expected
by the characteristic and the ciphertexts (by G′ = f ′ ⊕ h′ = f ′ ⊕ TR′ ). The
most frequent key value is likely to be the right key value. Since there is
not enough data to make this key value unique we look for the set of key
values with maximal counts and choose the bits that have the same value
in all the members of this set. Those bits are likely to have the right values.
The other bits stay unknown. Experience has shown that the known bits
of S1Kg , S3Kg and S4Kg are at the locations denoted by ‘1’ bits in 2Fx ,
27x and 3Cx respectively. If some of these bits are unknown it is almost
certainly due to a mistaken value of the known bits of K8.
4.6. DES with Independent Keys 66
By the knowledge of the subkey bits of the eighth round we can calculate
several input bits of the seventh round for any ciphertext. The input to the
seventh round g has missing bits that enter all the S boxes. There is one
S box whose input depends just on one missing bit while the inputs of all
the other S boxes depend on two missing bits at least. This S box is S1
whose input bit could be calculated if the output of S4 of the eighth round
were known. To find the key bits of S4Kh we try all the 64 possibilities of
its value for each pair, and find the key bits value by the counting method.
Now each of the inputs of S3Eg and S4Eg have one missing bit: S3Eg could
be calculated if S1Oh were known and S4Eg could be calculated if S3Oh
were known. To find these subkey bits we try all the 128 possibilities of
S1Kh and the missing bit of S3Kg and then the 128 possibilities of S3Kh
and the missing bit of S4Kg . Now K8 is completely known. To find K7 we
repeat the algorithm of finding K7 described above with the difference that
now we know K8 completely. Only one bit of K7 remains indistinguishable.
This bit is bit number 2 of S1Kg .
So far we have used the filtered pairs. These pairs are assumed to be
right pairs whose f ′ is as expected. They cannot help finding K6 since the
input XORs of five of the S boxes are zero, and thus 30 bits of K6 cannot
be found at all. The other three S boxes have constant input XORs so there
are two indistinguishable values for the subkey bits entering each S box. In
order to find K6 we have to use wrong pairs for which the characteristic
holds in the first three of the five rounds. From now on we use all the pairs
and filter them by a different criterion in each phase of the cryptanalysis.
• K6: To find K6 we decrypt two rounds of the ciphertexts and get the
values of f and f ∗ . We assume that the first three rounds of the charac-
teristic hold in the chosen pairs so d′ is as expected with zero input XORs
entering six S boxes. Thus we can calculate the output XORs of these S
boxes in the sixth round by F ′ = c′ ⊕D′ ⊕g ′ . Since c′ = 0 and SEd
′
is zero in
′ ′
the six S boxes, we get that F = g in the output bits of these S boxes. The
filtering chooses all the pairs for which f ′ and F ′ satisfy SEf
′ ′
→ SOf for S1,
S2, S5, . . . , S8. Using the resultant pairs we count on the 12 subkey bits
entering S1 and S2 and the missing bit of K7 (needed for the decryption of
the seventh round).
To find the other bits of K6 we filter the pairs again by using the known
bits of K6 to check the output XOR of S1 and S2, and count on S5Kf , . . . ,
S8Kf , a separate counting for each S box (we have a very good filtering so
the signal to noise ratio is high enough). In parallel we count on S3Kf and
on S4Kf , using the assumption that e′ is as expected by the characteristic
(four rounds hold) and using the filter that discards any pair for which
′
SOe 6= 0 for S1, S3, . . . , S8 (since only S2′Ee 6= 0). Several possibilities
are found for some of the S boxes’ key bits, and the following phases are
4.6. DES with Independent Keys 67
• K4: At the second round there must be S2′Eb = S6′Eb = 0 for any pair
(these S box inputs do not depend on the differing bits of the plaintexts). d
and d∗ are found by partial decryption. In addition D′ = a′ ⊕B ′ ⊕e′ so S2′Od
and S6′Od are known and there must be S2′Ed → S2′Od and S6′Ed → S6′Od .
If it does not hold for even one pair it is not a filtering problem: it can only
result from a wrong value of the subkeys K5, . . . , K8. A separate counting
is done for each of the six S boxes S1, S2, S5, . . . , S8. The counting on
the other S boxes S3 and S4 is done only for pairs whose d′ is as expected
by the characteristic, since otherwise we cannot know the value of S3′Od
and S4′Od because S3′Ob and S4′Ob are unknown. Since S3′Ed and S4′Ed are
constants there are two indistinguishable values for each of their keys. As
usual we create a list of the possible K4 values and try them in parallel.
• K3: c and c∗ can be found by partial decryption of the last five rounds
′ ′
using K4, . . . , K8. SEa = 0 in all the S boxes except S2. Thus SOc can
′ ′ ′ ′
be found for S1, S3, . . . , S8 by C = PL ⊕ A ⊕ d . For every pair there
′ ′
must be SEc → SOc . Therefore, even if only one S box (S1 or S3, . . . , S8)
′ ′
of one pair does not match SEc → SOc then the values of K4, . . . , K8 are
wrong. If this does not happen, the counting is done in parallel for all the
S boxes except S2 using all the pairs. S2′Ea 6= 0, thus the calculation of
S2′Oc is impossible without further assumptions. Therefore we assume that
the values of A′ and b′ are as expected by the characteristic. The filtering
′
discards any pair that does not have SOb = 0 for S1, S2 and S5, . . . , S8
′ ′ ′ ′ ′ ′
using B = a ⊕ c = PR ⊕ c (since we assume SEb = 0 in these S boxes).
The counting of S2Kc is done using the filtered pairs.
• K2 and K1: The plaintext XOR used above is useless to find K2 and
K1 since all the pairs have S2′Eb = S6′Eb = 0 and for all the S boxes of
′
the first round except S2 there is SEa = 0. The key bits cannot be found
at all for these S boxes. Therefore, in order to find K1 and K2 we must
use additional plaintext XORs. We need only 100 pairs with the additional
plaintext XORs, which can be obtained without adding new ciphertexts
by arranging some of the original ciphertexts in quartets. These plaintext
XORs and the algorithm of finding K1 and K2 are very similar to the case
of K1 and K2 in the four round version. See the end of Section 4.1 for more
4.6. DES with Independent Keys 68
details.
The GDES blocks are divided into q parts of 32 bits each. The F function
is calculated once per round on the rightmost part, and the result is XORed
into all the other parts, which are then cyclically rotated to the right. After
the last round the order of the parts is exchanged to make the encryption
and decryption differ only in the order of the subkeys. The scheme is shown
in Figure 4.2, where n is the number of rounds of the GDES cryptosystem,
(j) (j−1) (q)
Bi = Bi−1 ⊕ F (Bi−1 , Ki) j ∈ {2, . . . , q}, i ∈ {1, . . . , n}
(1) (q)
Bi = Bi−1 i ∈ {1, . . . , n},
(1) (q) (q) (1)
B0 = (B0 , . . . , B0 ) is the plaintext and Bnt = (Bn , . . . , Bn ) is the
ciphertext.
Thus, the following formulae are satisfied for any i, j ∈ {1, . . . , q − n}:
(i) (j)
B0 ⊕ B0 = Bn(n+i) ⊕ Bn(n+j)
(i) (j)
B0 = B0 ⇐⇒ Bn(n+i) = Bn(n+j)
(q−n+1) (q)
and for pairs of plaintexts for which B0 , . . . , B0 are kept
′(q−n+1) ′(q)
constant (i.e., B0 = . . . = B0 = 0):
′(i) ′(m+i)
B0 = Bm = Bn′(n+i) ∀i ∈ {1, . . . , q − n}, ∀m ∈ {0, . . . , n}.
4.7. The Generalized DES Scheme (GDES) 70
Plaintext
. . .
K1
F
. . .
K2
. . .
Ki
F
. . .
Kn
Ciphertext (swapped)
(q−n+2)
2. In GDES with n ≤ q, any pair of encryptions in which B0 , ...,
(q)
B0 are kept constant satisfies:
′(q−n+1) ′(q)
B0 = Bn−1 = Bn′(1) .
4. In GDES with n = q − 1,
′(j)
B0 = 0 ∀j ∈ {2, . . . , q}
implies that
Bn′(j) = 0 ∀j ∈ {1, . . . , q − 1}
and
′(1)
Bn′(q) = B0 .
5. In GDES with n = 2q − 2,
′(1)
B0 = η1
′(2)
B0 = η2
′(j)
B0 = 0 ∀j ∈ {3, . . . , q}
where η1 = 44 08 00 00x and η2 = 04 00 00 00x or η1 = 00 20 04 08x
and η2 = 00 00 04 00x implies that
Bn′(j) = 0 ∀j ∈ {1, . . . , q − 2}
Bn′(q−1) = η2
Bn′(q) = η1
1
with probability 16 since η2 → η1 ⊕ η2 with probability 14 . There are
additional values for η1 and η2 with smaller probabilities.
6. In GDES with n = 2q − 1,
′(1)
B0 = ψ
and
′(j)
B0 = 0 ∀j ∈ {2, . . . , q}
(where ψ is the value used in Section 4.4: ψ = 19 60 00 00x ) implies
that
Bn′(j) = 0 ∀j ∈ {1, . . . , q − 1}
and
Bn′(q) = ψ
1
with probability about 234 .
GDES with n = lq − 1 satisfies it for any
1 l−1
l ≥ 2 with probability about 234 .
odd q can be attacked by variants of our technique. All the attacks can
find the independent keys, and thus are not affected by the key scheduling
algorithm. The special case of q = 8 and n = 16 which is suggested in
[31,33] as a faster and more secure alternative to DES is breakable with
just six ciphertexts in a fraction of a second on a personal computer.
Using a known plaintext attack we are given several plaintexts (each one
(1) (q)
of the form B0 = (B0 ,. . . ,B0 )) and the corresponding ciphertexts (each
(q) (1)
one of the form Bnt = (Bn ,. . . ,Bn )). Then
M n Mq
(q) (j)
F (Bj−1 , Kj) = B0 ⊕ Bn(j)
j=1 j=1
Using pairs whose plaintext XORs are known we can compute the input
and output XORs of the F functions by the same method used in the
known plaintext attack. We can thus find all the subkeys (starting with the
subkey of the last round and working backwards towards the first round)
using three pairs of ciphertexts with different plaintext XORs.
4.7. The Generalized DES Scheme (GDES) 73
The other q − 1 subkeys can be found using a similar attack with two
additional ciphertexts.
This attack is similar to the previous one, and uses ciphertext pairs satis-
fying:
′(1)
B0 = η1
′(2)
B0 = η2
′(j)
B0 = 0 ∀j ∈ {3, . . . , q}.
where η1 and η2 are defined in Subsection 4.7.1. The right pairs with respect
1
to the corresponding (2q − 2)-round characteristic are about 16 of all the
pairs. We can identify most of the wrong pairs by checking that the input
XOR cannot cause the output XOR. This happens with probability about
0.8 for each S box. Thus only 0.88q = 0.16q of the wrong pairs remain. When
1
q ≥ 3 this is less than 0.88·3 = 250 of the pairs. This excellent identification
makes it possible to consider only 48 pairs, and identify the three expected
occurrences of right pairs among them. We can further decrease this amount
to 24 pairs by using quartets of two characteristics.
′(j)
B0 = 0 ∀j ∈ {2, . . . , q}.
248 · 2−8(l−2)
S/N = ≈ 264−8l+2.5q .
48 · 0.88q−13 · 2−20
This attack shows that any GDES which is faster than DES is also less
secure than DES. GDES with n = 8q rounds is just as fast as DES. Con-
sider GDES with n = 8q − 1 which is slightly faster than DES. The usable
characteristic has 7q − 1 rounds and six repetitions of the iterative charac-
1 6
teristic. Thus its probability is about 234 ≈ 2−48 . Counting on all the
48 bits of the subkey of the last round has
248 · 2−48
S/N = ≈ 22.5q .
48 · 0.88q−13 · 2−20
Therefore, about 4–8 right pairs are needed, giving a total of 8 · 248 = 251
pairs. This complexity decreases rapidly when we try to make GDES even
faster by making n substantially smaller than 8q.
The recommended parameters for GDES are q = 8 and n = 16. In this sub-
section we show that even the independent-key version of any GDES with
n = 2q can be broken with just 16 ciphertexts with particular differences
in the plaintexts. The complexity can be reduced to six ciphertexts if the
subkeys are derived from the standard key scheduling algorithm.
• A random plaintext P .
• The nine plaintexts obtained from P by XORing 66 00 00 00x ,
60 60 00 00x , 60 00 60 00x , 60 00 00 60x , 60 00 00 06x , 9E 5F AC 7Dx ,
4.7. The Generalized DES Scheme (GDES) 75
(1)
F 7 A5 35 C7x , 7A F A 78 D5x and 21 22 E3 2Cx into B0 (the first
32 bits of P ).
• The six plaintexts obtained from P by XORing A6 BD EF B7x ,
F 4 F 3 82 3Cx , 4F 5C 37 51x, 2B 76 7A DBx , 5A 19 F 9 68x and
(i)
33 EE DD F Fx into all the B0 blocks.
1. The first plaintext is the randomly chosen basis for the differential
attack.
2. Five plaintexts have the maximal number of unchanged inputs to S
boxes in the q th round compared with P and with each other. At
least five of the inputs to each S box in the q th round are unchanged,
which makes it possible to find the subkey of the last round.
3. Four other plaintexts have a maximal difference in the S boxes of the
q th round. This is used to find the subkeys of the q + 1th and all the
subsequent rounds (There is not enough variability in the previous
values to find all those subkeys).
4. Six plaintexts have a maximal difference in the S boxes of the first q
rounds. This makes it possible to find the first q subkeys.
Note that if the subkeys are derived by the key scheduling algorithm of
DES then 48 bits out of the 56 key bits are known at this point. The others
can be easily found by trying all the 256 possibilities of the missing eight
key bits. We thus proceed to analyze the case of independent keys, which
requires 10 additional ciphertexts.
In the following q − 1 rounds we get the input and the input XOR of the
F function from the (partially decrypted) ciphertexts. The output XOR is
calculated by the formula:
q
M
(q) ′(1)
F ′ (Br−1 , Kr) = B0 ⊕ Br′(j)
j=2
4.7.2.7 Summary
Differential Cryptanalysis of
the Full 16-Round DES
In this chapter we describe the first known attack which is capable of
breaking the full 16-round DES in less than the complexity of exhaustive
search of 255 keys. The data analysis phase computes the key by analyzing
about 236 ciphertexts in 237 time. The 236 usable ciphertexts are obtained
during the data collection phase from a larger pool of 247 chosen plaintexts
by a simple bit repetition criteria which discards more than 99.9% of the
ciphertexts as soon as they are generated. This attack is not applicable to
the independent-key variant of DES.
ΩP = (ψ, 0) = 19 60 00 00 00 00 00 00x
A′ = 0 a′ = 0 p=1
F
1
B′ = 0 b′ = ψ = p≈ 234
F
19 60 00 00x
ΩT = (0, ψ) = 00 00 00 00 19 60 00 00x
B′ = 0 b′ = 0
F
0 ψ=
F
19 60 00 00x
The 13-round
0 0 characteristic with
F
probability 2−47.2
0 ψ
F
0 0
F
G′ = h′ = TR′ g′ = ψ
F
T ′ = (TL′ , TR′ )
The problem in this approach is that we do not know the actual value
of vk , which cancels the output XOR of the first F function, and thus
we do not know on which 212 plaintext pairs to concentrate. Trying all
the 224 possible pairs takes too long, but we can use their cross-product
structure to isolate the right pairs among them in just 212 time. In any
right pair, the ciphertext XOR should have 20 zero bits at its right half at
the positions corresponding to the outputs of the five S boxes S4, . . . , S8 in
the 15th round. We can thus sort (or hash) the two groups of 212 ciphertexts
Ti , T̄j by these 20 bit positions, and detect all the repeated occurrences
of values among the 224 ciphertext pairs in about 212 time. Any pair of
plaintexts which fails this test has a non-zero ciphertext XOR at those 20
bit positions, and thus cannot be a right pair by definition. Since each one
of the 224 possible pairs passes this test with probability 2−20 , we expect
about 24 = 16 pairs to survive. By testing additional S boxes in the first,
fifteenth, and sixteenth rounds and eliminating all the pairs whose XOR
values are indicated as impossible in the difference distribution tables of
the various S boxes, we can discard about 92.55% of these surviving pairs1
leaving only 16 · 0.0745 = 1.19 pairs per structure as the expected output
of the data collection phase. All these additional tests can be implemented
by a few table lookup operations into small precomputed tables, and their
time complexity is much smaller than the time required to perform one trial
encryption during an exhaustive search. Note that this filtering process
removes only wrong pairs but not all of them and thus the input of the
data analysis phase is still a mixture of right and wrong pairs.
1
2
A fraction of about 16 14
· 13
16
· 15
16
· 0.88 = 0.0745 of these pairs remain and
thus a fraction of about 0.9255 of them are discarded. The input XOR values
of the S boxes in the first and the fifteenth rounds of right pairs are known and
fixed, and thus we use the fraction of non-zero entries of the corresponding lines
14 13
in the difference distribution tables whose values are 16 , 16 and 15
16
, rather than
the fraction of the non-zero entries in the whole tables, which is approximated
by 0.8.
5. Differential Cryptanalysis of the Full 16-Round DES 82
The data analysis phase of the attacks described in the previous chapter
uses huge arrays of up to 242 counters to find the most popular values
of certain key bits. The new attack described in this chapter uses only
negligible space. We want to count on all the key bits simultaneously but
cannot afford an array of 256 counters. Instead, we immediately try each
suggested value of the key. A key value is suggested when it can create
the output XOR values of the last round as well as the expected output
XOR of the first round and the fifteenth round for the particular plaintexts
and ciphertexts. In the first round and in the fifteenth round the input
XORs of S4 and S5, . . . , S8 are always zero. Due to the key scheduling
algorithm, all the 28 bits of the left key register are used as inputs to the
S boxes S1, S2 and S3 in the first and the fifteenth rounds and S1, . . . , S4
in the sixteenth round. Only 24 bits of the right key register are used in
the sixteenth round. Thus, 28 + 24 = 52 key bits enter these S boxes. The
fraction of 52-bit values that remain after comparing the output XOR of the
last round to its expected value and discarding the ones whose values are
−32 −12
not possible is 20.88 . Only a fraction of 142· 13 · 15 of the remaining ones exist
16 16 16
after comparing the output XOR of the three S boxes in the first round to
its expected value. A similar fraction of the remaining 52-bit values remain
by analyzing the three S boxes in the fifteenth round. Each analyzed pair
−32 −12 −12
suggests about 252 · 20.88 · 142· 13 · 15 · 142· 13 · 15 = 0.84 values for these 52 bits
16 16 16 16 16 16
of the key, each value corresponding to 16 possible values of the full 56-bit
key. Therefore, each structure suggests about 1.19 · 0.84 · 16 = 16 choices for
the whole key. By peeling off two additional rounds we can verify each such
key by performing about one quarter of a DES encryption (i.e., executing
two rounds for each one of the two members of the pair), leaving only about
2−12 of the choices of the key. This filtering costs about 16· 14 = 4 equivalent
DES operations per structure. Each remaining choice of the 56-bit key is
verified via trial encryption of one of the plaintexts and comparing the
result to the corresponding ciphertext. If the test succeeds, there is a very
high probability that this key is the right key. Note that the signal to noise
252 ·2−47.2 16.8
ratio of this counting scheme is S/N = 1.19/2 12 ·0.84 = 2 .
K16
K1 S1 2 1 1 2
S2 2 1 2 1
S3 2 3 1
S4 2 3 1
X 1 3
S5 1 2 2 1
S6 3 2 1
S7 2 2 2
S8 2 3 1
X 1 2 1
X denotes the key bits which are not used in the subkey.
Table 5.1. The number of common bits entering the S boxes in the first
round (K1) and in the sixteenth round (K16).
To compute bits from the right key register, we first extract actual S
box input bits from their assumed XORed values. In the fifteenth round
we know the input XORs and the output XORs of S1, S2 and S3. We can
thus generate about 4–5 candidate inputs for each one of these S boxes,
and deduce the corresponding bits in g by XORing with the known bits of
the left key register. In a similar way, we can calculate the outputs of the S
boxes S1, S2, S3 and S4 in the sixteenth round, XOR these bits of H with
the known bits of the left half of the ciphertext TL and get 16 bits of g,
from which two bits enter S1, two bits enter S2 and three bits enter S3 in
the fifteenth round. By comparing these bit values to the candidate inputs
of the S boxes we end up with about one candidate input for S1, one for S2,
and only about half of the trials would result with a candidate input for S3.
We can now deduce all the bits of g which enter these three S boxes and
deduce the corresponding bits of H by H = g ⊕ TL . Two of these bits are
outputs of S5, two bits are outputs of S6, three are outputs of S7 and one
is an output of S8. For each of these four S boxes we know the input XOR
and the output XOR, and can deduce about 4–5 possible inputs. Since we
also know actual output bits, the number of possible inputs is reduced to
about one for S5 and S6, two for S8, but only half of the trials would result
with a candidate for S7. We can deduce 24 out of the 28 bits of the right
5. Differential Cryptanalysis of the Full 16-Round DES 84
key register by XORing the 24 computed bits at the inputs of these four S
boxes with the expanded value of the known right half of the ciphertext.
Ω†P = (ψ † , 0) = 1B 60 00 00 00 00 00 00x
A′ = 0 a′ = 0 p=1
F
1
B′ = 0 b′ = ψ † = p≈ 234
F
1B 60 00 00x
This characteristic has the same probability as the previous one. With these
metastructures, we can obtain four times as many pairs from twice as many
plaintexts, and thus reduce the number of chosen plaintexts encrypted in
the data collection phase from 248 to 247 .
this attack can be carried out even if the analyzed ciphertexts are derived
from up to 233 different keys due to frequent key changes during the data
collection phase. The attack can be carried out incrementally with any
number of available ciphertexts, and its probability of success grows linearly
with this number (e.g., when 229 usable ciphertexts are generated from a
smaller pool of 240 plaintexts, the analysis time decreases to 230 and the
probability of success is about 1%).
The general form of this attack can be summarized in the following way:
Given a characteristic with probability p and signal to noise ratio S/N for
a cryptosystem with k key bits, we can apply an attack which encrypts
2
p chosen plaintexts in the data collection phase and whose complexity is
2k
S/N trial encryptions in the data analysis phase. The number of chosen
plaintexts can be reduced to p1 by using appropriate metastructures, and
the effective time complexity can be reduced by a factor of f ≤ 1 if a
tested key can be discarded by carrying out only a fraction f of the rounds.
Therefore, this attack can be mounted whenever p > 21−k and S/N > 1.
This attack requires fewer chosen plaintexts compared to the corresponding
counting schemes, but if the signal to noise ratio is too low or if the number
of the key bits on which we count is small, the time complexity of the data
analysis phase may be higher than the corresponding complexity of the
counting scheme.
This is currently our best attack on DES, and its performance for var-
ious variants with reduced number of rounds is summarized in Table 5.2.
Variants with an even number of rounds n have a characteristic with
1 (n−4)/2
probability p = 234 , require p−1 chosen plaintexts, and analyze
p−1 · 2−10.75 plaintexts in time complexity p−1 · 2−10 . The known plaintext
5.1. Variants of the Attack 86
8 214 238 4 29
9 224 244 2 232 †
10 224 243 214 215
11 231 247 2 232 †
12 231 247 221 221
13 239 252 2 232 †
14 239 251 229 229
15 247 256 27 237
16 247 255 236 237
†
The complexity of the analysis can be greatly reduced for
these variants by using about four times as many plaintexts with
the clique method.
variant of this attack needs about 231.5 · p−0.5 known plaintexts (using the
symmetry of the cryptosystem which makes it possible to double the num-
ber of known encryptions by reversing the roles of the plaintexts and the
ciphertexts). Variants with an odd number of rounds n have a character-
1 (n−3)/2
istic with probability p = 234 , require p−1 chosen plaintexts, and
−1 −40.2
analyze p · 2 plaintexts in time complexity p−1 · 2−10 . For such odd
−40.2
values of n, if p > 2 then the number of analyzed plaintexts is two and
the complexity of the data analysis phase is 232 . However, using about four
times as many chosen plaintexts, we can use the clique method (described
in Section 4.2) and reduce the time complexity of the data analysis phase
to less than a second on a personal computer. The known plaintext attacks
need about 232 · p−0.5 known plaintexts (in this case the symmetry does
not help).
Differential Cryptanalysis of
FEAL
FEAL was suggested as a software-oriented cryptosystem which can be eas-
ily and efficiently implemented on microprocessors. The structure of FEAL
is similar to DES with a modified F function, initial and final permutations
and key scheduling algorithm. In the F function, the P permutation and
the S boxes of DES are replaced by byte rotations and addition operations.
The S boxes S0 and S1 of FEAL get two input bytes and calculate one out-
put byte as Si (x, y) = ROL2(x + y + i (mod 256)), where ROL2 rotates
its input byte two bits to the left. The F function gets a 32-bit input and a
16-bit subkey and calculates a 32-bit output by applying the S boxes four
times sequentially. The initial and the final permutations are replaced by
initial and final transformations, in which the whole 64-bit data is XORed
with 64-bit subkeys and the right half of the data is XORed with the left
half. Figure 6.1 describes the structure of an eight-round FEAL and its
F function. The key scheduling algorithm is replaced by a key processing
algorithm, which makes the subkeys depend on the key in a more complex
way. The key processing algorithm and its Fk function are described in
Figure 6.2.
The plaintext and the ciphertext: The plaintext and the ciphertext are de-
noted by P and T respectively. Unlike the case of DES, they denote
the real plaintext and ciphertext without ignoring the initial and final
transformations of FEAL. Thus, the characteristic’s input XOR ΩP
is different from the corresponding plaintext XOR P ′ .
Rotation operations: The operations of cyclically rotating the byte X by
n bits to the left and to the right are denoted by ROLn(X) and
6. Differential Cryptanalysis of FEAL 89
P
(K89,Kab)
K0
A a
F
K1 f0 f1 f2 f3
B b
F
K2 k0
C c
F k1
K3
D d
F
S1
K4
E e
F
S0
K5
F f
F S0 S1
K6
G g
F
F0 F1 F2 F3
K7
H h
F
(Kcd,Kef)
T Si (x, y) = ROL2(x + y + i (mod 256))
RORn(X) respectively.
The S boxes: The S boxes of FEAL S0 and S1 are denoted by Si (X, Y ) for
the inputs X and Y and for i ∈ {0, 1}. Their definition is: Si (x, y) =
ROL2(x + y + i (mod 256)).
Selecting one byte or one bit: The ith byte of a multi-byte value X or the
ith bit of the byte X are denoted by Xi . The j th bit of the ith byte
of a multi-byte value X is denoted by Xi,j . The index 0 denotes the
least significant byte and bit as appropriate.
Useful operations: The 32-bit value (0, K0 , K1 , 0) where K is 16-bit long is
denoted by am(K). The 16-bit value (X0 ⊕ X1 , X2 ⊕ X3 ) where X is
32-bit long is denoted by mx(X).
Since each S box has 16 input bits and only eight output bits it is not
recommended to use the difference distribution tables directly. Instead, in
the first stage of the analysis we use the joint distribution table of the two
6. Differential Cryptanalysis of FEAL 90
Key (K)
Fk a0 a1 a2 a3
(K0, K1)
Fk
(K2, K3)
b0
Fk S1
(K4, K5)
b1
Fk S0
(K6, K7) b2
Fk
(K8, K9) b3
Fk S0 S1
(Ka, Kb)
Fk F0 F1 F2 F3
(Kc, Kd)
Fk
(Ke, Kf)
Figure 6.2. The key processing algorithm of FEAL-8 and its Fk function.
middle S boxes in the F function (inside the gray rectangle in Figure 6.1).
This combination has 16 input bits and 16 output bits, and the table has
many interesting entries. For example, there are two entries with proba-
bility 1 which are 00 00x → 00 00x and 80 80x → 00 02x . About 98% of
the entries are impossible (contain value 0). The average value of all the
entries is 1, but the average value of the non-zero entries is about 50. In
Section 6.3 we describe how we can easily decide whether X → Y for any
particular X and Y without consulting the table.
The S boxes also have the following properties with respect to pairs: Let
Z = Si (X, Y ). If X ′ = 80x and Y ′ = 80x then Z ′ = 00x. If X ′ = 80x and
Y ′ = 00x then Z ′ = 02x . For any input XORs X ′ and Y ′ of the S boxes
the most probable output XOR is Z ′ = ROL2(X ′ ⊕ Y ′ ). This output XOR
is obtained with probability about 2#(X1′ |Y ′ ) (where #X is the number of
bits set to 1 in the lower seven bits of the byte X and | is the or operator)
since each bit which is different in the pairs (in X and X ∗ , or in Y and
Y ∗ ) gives rise to a different carry with probability 12 .
The input of the F function in the last round is a function of the cipher-
text XORed with an additional subkey of the final transformation rather
than just a function of the ciphertext (as in DES). There is an equivalent
description of FEAL in which the XOR with the subkeys in the final trans-
formation is eliminated and the 16-bit subkeys XORed to the two middle
6. Differential Cryptanalysis of FEAL 91
bytes of the inputs of the F function in the various rounds are replaced by
32-bit values.
Definition 6.1 The 32-bit subkeys of the equivalent description in which
the XOR with the subkeys in the final transformation is eliminated are
called actual subkeys. The actual subkey which replaces the subkey Ki
is denoted by AKi. The 16-bit XOR combinations mx(AKi) = (AKi0 ⊕
AKi1 , AKi2 ⊕ AKi3 ) are called 16-bit actual subkeys. The actual subkey
of the last round of a cryptosystem is called the last actual subkey.
The actual subkeys of the final transformation are eliminated and thus their
equivalent values are zero. Our attack finds the actual subkeys rather than
the subkeys themselves since it finds XORs of the ciphertexts and internal
values in the F function.
ΩP = (L′ , 0x )
A′ = 0x a′ = 0 x p=1
F
ΩT = (L′ , 0x )
ΩP = (L′ , 80 80 80 80x )
ΩP = 02 00 00 02 80 80 80 80x
B′ = 0 b′ = 0 p=1
F
ΩT = 02 00 00 02 80 80 80 80x
1
The following is a five-round characteristic with probability 16 :
6. Differential Cryptanalysis of FEAL 93
ΩP = 00 80 02 8A 00 00 02 02x
C′ = 0 c′ = 0 p=1
F
ΩT = 00 80 02 8A 00 00 02 02x
1
A second five-round characteristic with probability 16 is described later.
ΩP = 80 60 80 00 80 60 80 00x
ΩT = 80 60 80 00 80 60 80 00x .
ΩP = A2 00 80 00 80 80 00 00x
C′ = 0 c′ = 0 p=1
F
ΩT = A2 00 80 00 80 80 00 00x
Four shorter characteristics are derived from the first rounds of this five-
round characteristic. Each characteristic has a different number of rounds
but all of them have the same value of ΩP . The one-round characteristic
which is derived from the first round of the five-round characteristic has
probability 1. The two-round and the three-round characteristics which
are derived from the first two and three rounds have probability 1/4. The
four-round characteristic has probability 1/16.
h = TL ⊕ TR
h′ = TL′ ⊕ TR′
6.1. Cryptanalysis of FEAL-8 96
Before the counting method is used to find the 16-bit last actual subkey,
15
filtering can be done to discard about 16 of the wrong pairs. Since the
addition operation is linear in its least significant bit and since h′ → H ′ ,
the following equations hold:
h′0,0 ′
= H0,2 ′
⊕ H1,0
h′3,0 ′
= H3,2 ′
⊕ H2,0
h′2,0 ′
= H2,2 ′
⊕ H1,0 ⊕ h′3,0
h′1,0 ′
= H1,2 ⊕ h′0,0 ⊕ h′2,0 ⊕ h′3,0 .
Similar equations hold for f ′ → F ′ . Since these equations are linear and
the value of F ′ ⊕ H ′ is known, we can deduce the XOR of these four bits
in f ′ and in h′ : fi,0
′
⊕ h′i,0 , i ∈ {0, . . . , 3}. Both f ′ and h′ are known for
a right pair, and therefore by comparing these four bits to their expected
values we can discard about 15 16 of the wrong pairs. All the right pairs must
be verified correctly. Since the right pairs occur with the characteristic’s
1
probability of 16 , about half of the remaining pairs are right pairs.
The following counting scheme is used to complete the last actual subkey.
For each pair (out of all the pairs) we calculate Ĥ and Ĥ ∗ and get Ĥ ′ . Then
we calculate ĝ ′ = T̂L′ ⊕ Ĥ ′ , F̂ ′ = ê′ ⊕ ĝ ′ and a few other bits of g ′ and discard
any pair for which we can conclude that g ′ 6→ G′ by the F function using
the bits we have found.
6.1. Cryptanalysis of FEAL-8 97
We try the 128 possibilities for the lowest seven bits of AK70 . For each
value we calculate H0 , H0∗ , H0′ = H0 ⊕ H0∗ and F0′ = e′0 ⊕ H0′ ⊕ TL0 ′
and
′ ′ ′
verify that f0 (from the characteristic) and F1 (from F̂ ) may cause this
F0′ . We count the number of the pairs satisfying this condition. The value
of AK70 which is counted most often is likely to be the right value. We
cannot distinguish the upper bit of the value, so we try just 128 possibilities
(instead of 256 as was expected) and then try the two possible values in
the following steps, till the wrong one fails. In a similar way we find seven
bits of AK73 . As a result, we find eight possibilities for the last actual
subkey AK7. Unlike the case of DES, we cannot easily deduce key bits
from a single actual subkey. However, we can reduce the cryptosystem to a
seven-round cryptosystem by “peeling off” the last round using the known
last actual subkey, and can analyze the resultant cryptosystem by similar
methods.
We assume that the last actual subkey is already known, and that the
cryptosystem can be reduced to a seven-round cryptosystem. A right pair
with respect to the five-round characteristic satisfies
f′ = A2 00 80 00x
g′ = TL′ ⊕ H ′
G′ = h′ ⊕ f ′ = h′ ⊕ A2 00 80 00x
F′ = e′ ⊕ g ′ = TL′ ⊕ H ′ ⊕ 80 80 00 00x .
We verify that f ′ → F ′ and g ′ → G′ and count in two steps: the first step
counts on the 16-bit actual subkey and the second step counts on each one
of the other two bytes of the actual subkey. The signal to noise ratio of the
first step which finds the 16-bit actual subkey mx(AK6) is
216
S/N = 4 ≈ 229 .
1 2
16 · 17 · 7 ·1
The signal to noise ratio of the second step which finds AK60 and AK63
is
28
S/N = 4 ≈ 231 .
1 −16
16 · 7 · 2 ·1
In the first step one bit is indistinguishable and in the second step two
bits are indistinguishable. Therefore, we try all the eight resulting possi-
bilities of AK6 in parallel in the following steps. In total we find at most
6.1. Cryptanalysis of FEAL-8 98
64 possibilities for the last two actual subkeys and can thus reduce the
cryptosystem to six rounds.
Using the last two actual subkeys we can calculate H and G for any cipher-
text T and reduce the cryptosystem to six rounds. All the right pairs with
respect to the five-round characteristic satisfy f ′ = h′ ⊕ G′ = A2 00 80 00x
and f ′ → g ′ ⊕ 80 80 00 00x (g ′ can be calculated using the known AK7).
Two bytes of AK5 equal their counterparts in AK7. We try all the 216
possibilities of the 16-bit actual subkey mx(AK5). For each possibility
and each pair we calculate F , F ∗ and F ′ = F ⊕ F ∗ . A right pair satis-
fies F ′ = g ′ ⊕ 80 80 00 00x . We count the number of pairs which satisfy
f ′ = A2 00 80 00x (as is enforced by the five-round characteristic) and
whose above values of F ′ are equal, and f ′ → F ′ . The value of mx(AK5)
which is counted most often is likely to be the real value. The signal to
noise ratio of this step is
216
S/N = = 260 .
16 · 2−32 · 2−16
In this step we can always distinguish all the bits of the actual subkey.
Given AK5 we reduce the cryptosystem to five rounds and find AK4
using the three-round characteristic. Two bytes of AK4 have the same
value as their counterparts in AK6. For each possible value of mx(AK4)
we count the number of pairs which satisfy e′ = g ′ ⊕ F ′ 6= 80 80 00 00x
(the pairs whose e′ = 80 80 00 00x are useless because they enforce a fixed
output XOR), e′ → E ′ and d′ → D′ = g ′ ⊕ F ′ . AK3 is calculated similarly
by counting the pairs which satisfy d′ = A0 00 80 00x and d′ → D′ . AK2
is also calculated similarly using the one-round characteristic and counting
the pairs which satisfy c′ 6= 0, c′ → C ′ and b′ → B ′ . AK1 is similarly
calculated by counting the pairs which satisfy b′ → B ′ .
AK0 cannot be calculated using these pairs since their plaintext XOR
always cause A′ = 02 00 00 00x and thus all the possibilities succeed un-
der the A′ condition with equal probability. However, it can be found us-
ing other characteristics. The actual subkeys of the initial transformation
AK89 and AKab cannot be found without the value of a plaintext even if
all the other actual subkeys are known. In our case AK0, AK89 and AKab
are not needed since the key itself can be obtained from the actual subkeys
which we have already found.
Although we find the actual subkeys with the (correct) assumption that
6.1. Cryptanalysis of FEAL-8 99
many actual subkeys have common values in two of their bytes, it is possible
to extend this attack to the general case in which all the actual subkeys
are independent (i.e., 8 · 32 + 2 · 32 = 320 independent bits).
Using the values of the actual subkeys AK1–AK7 the following XORs of
the original subkeys can be obtained:
K5 ⊕ K7
K4 ⊕ K6
K3 ⊕ K5 (6.1)
K2 ⊕ K4
K1 ⊕ K3.
The key itself can be derived from these values by analyzing the structure
of the key processing algorithm.
We start by trying all the 256 possible values of K51 . For each value we
calculate [the values in brackets are known from (6.1)]:
K71 = K51 ⊕ [K51 ⊕ K71 ]
K31 = K51 ⊕ [K31 ⊕ K51 ]
K11 = K31 ⊕ [K11 ⊕ K31 ].
By the fourth round of the key processing algorithm:
K70 = K11 ⊕ K51 ⊕ S1−1 (K71 , K31 )
K50 = K70 ⊕ [K50 ⊕ K70 ]
K30 = K50 ⊕ [K30 ⊕ K50 ]
K10 = K30 ⊕ [K10 ⊕ K30 ].
Now, we find two bytes of the key itself, one by the third round of the key
processing algorithm and the other by the second round:
K7 = K31 ⊕ K50 ⊕ S1−1 (K51 , K11 )
K3 = K11 ⊕ K30 ⊕ S1−1 (K31 , K7 )
and verify by the first round of the key processing algorithm that
S1 (K10 ⊕ K7 , K3 ) = K11 .
For each remaining value we try all the 256 possibilities of K40 . Then
K60 = K40 ⊕ [K40 ⊕ K60 ]
K20 = K40 ⊕ [K20 ⊕ K40 ].
6.2. Cryptanalysis of FEAL-N and FEAL-NX with N ≤ 31 Rounds 100
The rest of the key can be found by the third round of the key processing
algorithm:
Given the key, we verify that it is really processed to the known actual
subkeys and that the XOR of a decrypted pair of ciphertexts equals the cho-
sen plaintext XOR value. If this verification succeeds, then the calculated
key is very likely to be the real key.
6.1.5 Summary
uses a longer 128-bit key and a different key processing algorithm. Since our
attack ignores the key processing algorithm and finds the actual subkeys,
we can apply it to both FEAL-N and FEAL-NX with identical complexity
and performance.
ΩP = 80 60 80 00 80 60 80 00x
ΩT = 80 60 80 00 80 60 80 00x .
tinguishable. Therefore, we must try the following steps in parallel for the
four possibilities of these two bits. The verification of g ′ → G′ leaves only
2−19 of the pairs (since for either g ′ = 80 60 80 00x or g ′ = 80 E0 80 00x
there are only about 213 possible output XORs G′ and 213 · 2−32 = 2−19 ).
The verification of h′ → H ′ leaves 2−11 of the pairs (the fraction of the
non-zero entries in the difference distribution table of the F function). The
signal to noise ratio of this process is thus
232
S/N = = 255−2N .
22(N −2) · 2−19 · 1
The identification leaves
I = 22(N −2) · 2−19 · 2−11 = 22N −34
wrong pairs for each right pair. Therefore, the right value of the last actual
subkey is counted with a detectably higher probability than a random value
up to N ≤ 28 rounds, and thus we can break FEAL-N with 2R-attacks for
any N ≤ 28 rounds, faster than via exhaustive search. The results of these
attacks and their known plaintext variants are shown in Table 6.1.
Note that in both the 1R-attacks and the 2R-attacks we use octets with
four characteristics (this is a special case in which an octet can have four
6.2. Cryptanalysis of FEAL-N and FEAL-NX with N ≤ 31 Rounds 103
Rounds Char S/N Pairs Cho- Kno- Char S/N Pairs Cho- Kno-
Prob Nee- sen wn Prob Nee- sen wn
ded Plain Plain ded Plain Plain
8 2−12 239 214 213 238.5 2−14 250 217 216 240
9 2−14 237 216 215 239.5 2−16 248 219 218 241
10 2−16 235 218 217 240.5 2−18 246 221 220 242
11 2−18 233 220 219 241.5 2−20 244 223 222 243
12 2−20 231 222 221 242.5 2−22 242 225 224 244
13 2−22 229 224 223 243.5 2−24 240 227 226 245
14 2−24 227 226 225 244.5 2−26 238 229 228 246
15 2−26 225 228 227 245.5 2−28 236 231 230 247
16 2−28 223 230 229 246.5 2−30 234 233 232 248
17 2−30 221 232 231 247.5 2−32 232 235 234 249
18 2−32 219 234 233 248.5 2−34 230 237 236 250
19 2−34 217 236 235 249.5 2−36 228 239 238 251
20 2−36 215 238 237 250.5 2−38 226 241 240 252
21 2−38 213 240 239 251.5 2−40 224 243 242 253
22 2−40 211 242 241 252.5 2−42 222 245 244 254
23 2−42 29 244 243 253.5 2−44 220 247 246 255
24 2−44 27 246 245 254.5 2−46 218 249 248 256
25 2−46 25 249 248 256 2−48 216 251 250 257
26 2−48 23 252 251 257.5 2−50 214 253 252 258
27 2−50 2 255 254 259 2−52 212 255 254 259
28 2−52 2−1 258 257 260.5 2−54 210 257 256 260
29 2−54 2−3 2−56 28 259 258 261
30 2−56 2−58 26 261 260 262
31 2−58 2−60 24 264 263 263.5
32 2−60 2−62 22 267 266
characteristics since Ω4P = Ω1P ⊕ Ω2P ⊕ Ω3P ). These four characteristics are
the four possible rotations of the given characteristic. Thus, each octet
gives rise to 16 pairs which greatly reduces the required number of chosen
plaintexts. In both kinds of attacks there are two indistinguishable bits at
each of the last two actual subkeys. The attacking program should try all
the 16 possible values of these bits when analyzing the earlier subkeys.
6.3. Other Properties of FEAL 104
X0 = S0−1 (Y0 , Y1 )
X3 = S1−1 (Y3 , Y2 )
X2 ⊕ K 1 = X2 ⊕ X3 ⊕ K1 = S0−1 (Y2 , Y1 )
X1 ⊕ K 0 = X0 ⊕ X1 ⊕ K0 = S1−1 (Y1 , [X2 ⊕ K1 ]).
Z3 = S1 (X3 , Z2 ⊕ Y3 ).
In particular,
Z3,2 = X3,0 ⊕ Z2,0 ⊕ Y3,0 ⊕ 1
since the S box is linear in the least significant bit of the addition
operation.
3. The following equation of the subkeys is satisfied by FEAL-8:
K0† = d
K0 ⊕ Kcd
K1† = d ⊕ Kef
K1 ⊕ Kcd d
6.3. Other Properties of FEAL 105
K2† = d
K2 ⊕ Kcd
K3† = d ⊕ Kef
K3 ⊕ Kcd d
K4† = d
K4 ⊕ Kcd
K5† = d ⊕ Kef
K5 ⊕ Kcd d
K6† = d
K6 ⊕ Kcd
K7† = d ⊕ Kef
K7 ⊕ Kcd d
K89† = d ⊕ Kef)
K89 ⊕ am(Kcd d
Kab †
= Kab ⊕ am(Kef d)
Kcd† = (Kcd0 , 0, 0, Kcd3)
Kef † = (Kef0 , 0, 0, Kef3)
where for any 32-bit X, X̂ is the 16-bit value of its two middle bytes
(i.e., (X1 , X2 )). The encryption and decryption using the new values
of the subkeys give the same results as with the original values. An-
other equivalent description of the subkeys is denoted by the actual
subkeys in which the subkeys of the rounds are extended to 32 bits
and the subkey of the final transformation is eliminated.
5. The following property can be most useful in deciding whether some
input XOR may cause some output XOR by the F function and to
find actual values of input bits from the input XOR and the output
XOR. The decision is done in parallel for each S box in the F function.
Let Z = Si (X, Y ) and Z ∗ = Si (X ∗ , Y ∗ ). The least significant bit of
the addition operation satisfies Z2′ = X0′ ⊕ Y0′ . Let C be the byte
of carries in the addition operation (X + Y + i) (mod 256) in Si ,
defined as C = (X + Y + i (mod 256)) ⊕ X ⊕ Y (i is interpreted as
the 0/1 carry into the least significant bit). Cj is the carry bit passed
from the (j − 1)th bit of the addition operation in Si to the j th bit.
Thus,
1, if Xj−1 + Yj−1 + Cj−1 ≥ 2;
∀j ∈ {1, . . . , 7} : Cj =
0, if Xj−1 + Yj−1 + Cj−1 ≤ 1
and Cj′ is the value of Cj ⊕ Cj∗ . C0 = i and thus the value of C0′ is
always zero. Since C = ROR2(Z)⊕X ⊕Y , C ′ can be easily calculated
from the input XORs and the output XOR by
C ′ = ROR2(Z ′ ) ⊕ X ′ ⊕ Y ′ .
From the combination of the values of Xj′ , Yj′ , Cj′ and Cj+1
′
(for j ∈
{0, . . . , 6}) we can derive some new information. For example, assume
that Xj′ = Yj′ = 0 and Cj′ = 1 and consider the two possibilities of
′ ′
Cj+1 . If Cj+1 = 0 then either (a) Xj +Yj +Cj ≤ 1 and Xj∗ +Yj∗ +Cj∗ ≤
1 and thus Xj = Yj = 0, or (b) Xj +Yj +Cj ≥ 2 and Xj∗ +Yj∗ +Cj∗ ≥ 2
6.3. Other Properties of FEAL 106
′
and thus Xj = Yj = 1. In both cases Xj = Yj . If Cj+1 = 1 then
′
similarly Xj 6= Yj and therefore in general Xj ⊕ Yj = Cj+1 . Table 6.2
generalizes this observation for all the combinations of Xj′ , Yj′ and
Cj′ . The entries marked by ∗ are particularly useful because they can
be used to identify wrong pairs. The entries marked by † can be used
to derive the values of the bits X0 and Y0 . The entries marked by ‡
can be used to derive the value of Xj ⊕ Yj and the value of Z2 ).
7
Differential Cryptanalysis of
Other Cryptosystems
Each value 0 describes a byte which has equal values in both executions of
the encryption of the pair (zero XOR). Each letter denotes a XOR value
which is not zero. A letter with a superscript 0 denotes a XOR value which
can be either zero or non-zero. The exact values of the non-zero XOR values
may vary for different right pairs. The superscript † means that the byte
of the output XOR must be equal to the corresponding byte of the left
half in order to cause the input XOR byte of the S box in the next round
to be zero. Each occurrence of † causes a reduction of the probability of
1
the characteristic by 255 . The superscript ‡ means that the byte of the
output XOR must not be equal to the corresponding byte of the left half in
order to prevent a zero value in the corresponding byte in the next round,
so that it can become zero in one of the following rounds, after XORing
with another non-zero value. Each occurrence of ‡ causes a reduction of
254
the probability of the characteristic by 255 . Therefore, the probability of
1 4
254 3
this characteristic is 255 · 255 ≈ 2−32 . The input XOR ΩP of the
characteristic has two degrees of freedom: A and B, each one can have
255 possible values. Therefore, the characteristic has 2552 ≈ 216 possible
plaintext XORs.
Looking at the characteristic we can see that the output XOR of the
tenth round is easily extracted by XORing the right half of the plaintext
7.1. Cryptanalysis of Khafre 109
XOR with the right half of the ciphertext XOR and rotating the result by
16 bits (ROT16(PR′ ⊕ TR′ )). This happens since the tenth round is the only
even round whose output XOR is not zero. There are 232 possibilities for the
value of ROT16(PR′ ⊕TR′ ). However, there are only about 215 possible input
pairs of the S box itself. Therefore, there are at most about 215 possible
output XORs in the tenth round. As a consequence, most of the remaining
wrong pairs can be easily discarded, leaving only about 2−17 of the 2−8
of the wrong pairs that remained in the previous test. In addition, the
two input values of the S box and the two output values can be identified
uniquely.
The input XOR value C of the S box in the tenth round equals the upper
byte of the output XOR in the seventh round. The input XOR B and the
lower byte of the output XOR A of the S box in the seventh round are
known from the plaintext XOR. There are only 128 possible pairs of inputs
(with that input XOR) to the S box in the seventh round. 16 bits of the
output XOR of this S box are known. Therefore, we can discard each pair
whose corresponding 16 bit value is not as expected. The probability of a
wrong pair to pass this test is about 27 · 2−16 = 2−9 .
For each of the remaining pairs, we can find the actual values of the
inputs to the S box in the fifteenth round since we know its eight-bit input
XOR and eight bits of its output XOR. There are only 27 pairs with this
input XOR and therefore about half of the wrong pairs can be discarded.
Then, we can calculate the input values to the S box in the thirteenth
round by a similar calculation and discard about half of the remaining
wrong pairs. The input values to the S box in the eleventh round can be
found with much better identification, since all the 32 bits of the output
XOR are known at this stage. We can discard most of the remaining wrong
pairs and leave only about 27 · 2−32 = 2−25 of them.
Up to now, we discarded almost all the wrong pairs, leaving only a neg-
ligible fraction of about 2−8 · 2−17 · 2−9 · 2−1 · 2−1 · 2−25 = 2−61 of them.
For the right pairs, we found the actual input values of the S boxes in
all the five rounds with non-zero input XORs. However, we do not know
which value belongs to which encryption in the pair, and thus we have two
possible relations for each of these five values. We can find 16 possibilities
for the lower byte of the left half of the last subkey by XORing through a
trail from the tenth round forward to the ciphertext (two possible values
of the input XOR of the tenth round and two possible values of the output
XOR of each one of the eleventh, the thirteenth and the fifteenth rounds).
Using the counting method with three right pairs among 3 · 232 pairs, we
can uniquely identify the value of this byte of the subkey, identify the right
pairs themselves, and identify the exact choice of inputs to the S boxes
in the five rounds for each encryption in the right pairs. Identification of
7.1. Cryptanalysis of Khafre 110
the values of the input to the S box of the last round is possible using
the counting method which identifies two more bytes of the last subkey.
A similar identification may be done for the fourteenth round and then to
the twelfth round, each finding two more bytes of the subkey. In total we
find seven bytes of the last subkey. We can complete the value of the last
subkey using another characteristic in which the first non-zero input XOR
to an S box is in the eighth round, and reduce the cryptosystem to eight
rounds (since in Khafre the subkeys are XORed into the data only once
every eight rounds). The eight-round cryptosystem is already known to be
breakable even if the S boxes themselves are unknown (see [22]).
This attack on Khafre with 16 rounds needs about three right pairs ob-
tained from a pool of about 3 · 232 pairs (3 · 233 ciphertexts). This number
of ciphertexts can be drastically reduced by using a compact structure of
216 encryptions which contains about 231 pairs. Therefore, the structure
has probability about half to contain a right pair. The structure is simple:
choose a constant random value for six of the bytes of the plaintexts, ex-
cluding the second and the sixth bytes. Choose all the 216 possible values
for the second and sixth bytes of the plaintexts and encrypt all the plain-
texts. This structure also contains pairs with the additional characteristic
needed to complete the last subkey. In order to have about three right
pairs, we have to choose about six such structures, with a total of about
6 · 216 ≈ 400000 plaintexts.
The attacking program finds the last subkey in less than 45 minutes on a
personal computer using 400000 encryptions with 90% success rate. Using
about 590000 encryptions the success rate is increased to more than 99%
and the execution time is increased to about an hour. The program uses
about 500K bytes of memory, most of which is used to store the plaintexts
and the ciphertexts.
Using characteristics with probability about 2−24 we need about 3·224 pairs
which are formed by 3 · 225 encryptions. Using structures of 28 encryptions
which contain 215 pairs the attack needs about 3·217 encryptions (the same
as with the characteristic with probability about 2−32 ). Known plaintext
differential cryptanalytic attacks based on this characteristic need about
41.5 2
241.5 encryptions (since (22·264) ·28 = 226 > 3·224 ). The above characteristic
can be extended to a 24-round characteristic with probability about 2−56 .
Attacks on 24-round Khafre based on this characteristic need about 260
pairs. Using structures of 28 encryptions with 215 pairs they need about
253 encryptions. The differential cryptanalytic known plaintext attack on
24-round Khafre based on this characteristic needs about 258.5 encryptions
58.5 2
(since (22·264) · 28 = 260 ).
The best usable characteristic of Khafre that we have found is the fol-
7.1. Cryptanalysis of Khafre 112
Two of the odd rounds (the ninth and the eleventh rounds) have non-zero
output XORs. The XOR of these two output XORs (with a rotation of one
of them) can be easily extracted for right pairs. Since this XOR is a combi-
nation of four outputs (rather than two as in the previous characteristics),
the identification of the right pairs is much more complex, but is still pos-
sible. The differential cryptanalytic chosen plaintext attack based on this
characteristic needs three right pairs which are likely to be found in a pool
of 3 · 216 pairs. Using structures of 28 encryptions which contain 215 pairs
8
about 2215 · 3 · 216 = 1536 encryptions are needed. The implementation of
this chosen plaintext attack takes about an hour on a personal computer.
The known plaintext differential cryptanalytic attack based on this char-
37.5 2
acteristic needs about 237.5 encryptions (since (22·264) · 28 = 218 > 3 · 216 ).
A summary of our best results for 16-round Khafre and 24-round Khafre
is given in Table 7.1 which describes the number of pairs needed for the
attack, the number of chosen plaintexts needed, and the number of known
7.2. Cryptanalysis of REDOC-II 113
3. Add the resultant values of the three bytes pointed to by the numbers
in the second row of the table and store the result in the byte pointed
to by the first column in the row.
4. Similarly add according to the third, fourth and fifth rows.
1. Divide the block into two half-blocks of five bytes each. The half-
blocks are called the left half and the right half.
2. XOR the values of two particular bytes in the right half (in the first
round: the first two bytes) with two particular mask bytes. The re-
sultant two bytes are indexes of two enclave tables.
3. Process the left half by the first enclave table indexed by the above
two bytes.
4. Process the resultant left half by the second enclave table indexed by
the above two bytes.
5. XOR the values of two particular bytes in the resultant left half (in
the first round: the first two bytes) with two particular mask bytes.
The resultant two bytes are indexes of two enclave tables.
6. XOR the left half to the right half.
7. Process the resultant right half by the first enclave table indexed by
the above two bytes.
8. Process the resultant right half by the second enclave table indexed
by the above two bytes.
9. XOR the right half to the left half.
An important property of the enclave tables is that they are linear op-
erations in terms of addition which can be simulated by a matrix-vector
product. By modifying only most significant bits in the input, only most
significant bits in the output are modified. Moreover, the linear modifica-
tion table of the most significant output bits by the most significant input
bits uniquely identifies the enclave table used. This property can even be
used in the variable enclave phase. The left half of the input with two of
the bytes of the right half affect the choice of the enclave tables used in
this phase. However, three of the bytes of the right half do not affect the
choice of the enclave tables (in the first round they are the eighth, ninth
and tenth bytes) and thus the modifications of the most significant bits of
the output are linear functions of the modifications of the most significant
bits of these input bytes. Note that since we XOR the right half to the left
7.2. Cryptanalysis of REDOC-II 115
half as the last step in the variable enclave phase we get a symmetric mod-
ification in both halves and therefore, an even number of modified most
significant bits.
where A, B ∈ {1, . . . , 127} and C, D, E, F ∈ {0, 64} (not all of them zero).
1
In total, this characteristic has probability about 256 . The ciphertext XOR
has 60 zero bits (six in each byte) and the XORed value of the most sig-
nificant bits of the ciphertext XOR is zero as well. Similar characteristics
exist in which the difference is at the ninth and tenth bytes rather than at
the eighth byte. Differences in more than one of these three bytes is also
possible with smaller probabilities, but if the difference is the same in all
the differing bytes and the values of all the differing bytes in the plaintexts
1
are equal then the probability remains about 256 .
For each of the 16 · 16 = 256 possible values of the masks of the substitu-
tion phases we count the number of pairs whose differing byte after the two
substitutions resulting from the masks differ only by the most significant
bit. For each one of the 128 possible values of the mask of the permutation
phase we count the number of pairs whose ciphertext XOR permuted by
the resulting inverse permutation is symmetric and has zeroes in the second
and the seventh bytes. The right values of these mask bytes are likely to be
the ones counted most frequently and thus can be identified. This attack
needs about 1000 pairs and finds three masks of the processed key.
pairs use the same enclave tables and thus with probability about half the
structure contains four right pairs, and with probability about half does
not contain any right pair. Using three such structures with identical eight
bytes, where 32 plaintexts differ by the ninth byte, 32 differ by the tenth
byte and 32 differ by both the ninth and the tenth bytes with equal values
in both bytes in each plaintext, we are guaranteed to have at least one
structure whose choosing byte of the second key XOR has no difference
and thus to have about four right pairs. This enhanced attack needs only
96 chosen plaintexts.
REDOC-II with more than one round is also vulnerable to this attack.
The following characteristic is a two-round extension of the above charac-
teristic (for simplicity we use in the second round the same choosing bytes
as in the first round, rather than the new choosing bytes of the second
round).
After Phase Data XOR
ΩP 0 0 0 0 0 0 0 A 0 0
First Subst 0 0 0 0 0 0 0 B 0 0 For some B
Second Subst 0 0 0 0 0 0 0 64 0 0 p ≈ 1/128
Key XOR 0 0 0 0 0 0 0 64 0 0
Enclave C 0 D E F C 0 D E F p ≈ 4/31 (see †)
Key XOR C 0 D E F C 0 D E F
Permutation 0 0 0 0 0 0 0 G H I p ≈ 1/15 (see ‡)
First Subst 0 0 0 0 0 0 0 J K 0 Some J and K
Second Subst 0 0 0 0 0 0 0 64 64 0 p ≈ (1/128)2
Key XOR 0 0 0 0 0 0 0 64 64 0
Enclave L 0 M N P L 0 M N P p ≈ 1/2
Key XOR L 0 M N P L 0 M N P (see •)
Permutation Some permutation of L,0,M ,N ,P ,L,0,M ,N ,P
ΩT Some permutation of L,0,M ,N ,P ,L,0,M ,N ,P
1 4 3
1 2 1
This characteristic has probability about 128 · 31 · 45 · 128 · 2 ≈ 2−29
31
and the attack needs about 2 pairs. Using structures of 128 encryptions
whose differences are restricted to a single byte (either the eighth, ninth or
the tenth byte) we are guaranteed to have 64 pairs whose difference after
the first two substitution phases is only in one most significant bit, and
each of them has a probability of about 2−22 to be a right pair. Therefore,
there is a right pair in such a structure with probability about 2−16 and
the attack needs about 4 · 216 · 128 = 225 encryptions to find four right pairs
7.2. Cryptanalysis of REDOC-II 117
1
This characteristic has probability about 45 . Similar characteristics with
four differing bytes in the ciphertexts, six differing bytes and eight differing
1 1 1
bytes have probabilities about 140 , 210 and 180 respectively. Using special
structures, we can attack one-round REDOC-II using 40 chosen ciphertexts
in order to find the three mask bytes. The variants with two, three and four
rounds can be attacked using 224 , 245 and 266 chosen ciphertexts respec-
tively. The conversion of these attacks to known plaintext attacks gives
7.2. Cryptanalysis of REDOC-II 118
This extension starts by calculating the matrix which describes the dou-
ble enclave of the right half of the enclave phase. In the first step we look
for the value of the entry which corresponds to the influence of the eighth
input byte on the second output byte by trying the triplets of the value
XORed with the input byte before it is multiplied, the multiplication fac-
tor and the value added after the multiplication from the other four input
bytes. For each such triplet we check whether all the pairs in the structure
suggest the same value to be XORed with the sum to make the output
byte. The right value of the triplet should be suggested by all the pairs in
the structure. Usually several triplets remain undiscarded, and all of them
have the same factor. This factor should be the value of the corresponding
entry in the matrix. The two entries which correspond to the ninth and to
the tenth input bytes can be found similarly. Using the values of these three
entries we can find more bits of the twelve entries of the matrix which cor-
respond to the same three input bytes and to the four other output bytes.
These values usually suffice to identify uniquely the pair of enclave tables
used in the double enclave and to complete the matrix.
The attacker should follow the following steps. First, find the values
which are XORed with the inputs of the right half of the data (by the first
key XOR phase and by the left half of the data after its double enclave).
Then find the values which are XORed with the output of the right double
enclave to make the outputs. Derive the relationship between the values
XORed with the inputs and the values XORed with the outputs, derive
some entries of the key tables and calculate the masks of the right double
enclave and the XOR of the masks of the two key XOR phases. Find ad-
ditional entries of the key tables by reversing the left double enclave and
finding its masks. Complete the missing entries of the key tables using the
additional encryptions (especially the second bytes of the key tables which
cannot be found otherwise). Finally, derive the actual indexes of the key
tables and calculate the actual values of the missing masks from the key
tables.
The three masks of the substitution and the permutation phases of the
one-round variant can be found within less than a second on a personal
7.3. Cryptanalysis of LOKI 119
The difference distribution table of the larger S box of LOKI has much
1
smaller probabilities than the ones of DES (average 256 and maximum
1
64 ). However, it is possible to have non-zero input XORs in two S boxes
resulting with the same output, whereas in DES this requires at least three
S boxes. We have found the following two-round iterative characteristic
with probability 118
220 ≈ 2
−13.12
(this probability is calculated using the
observation that two neighboring S boxes have four common input bits,
otherwise we get a slightly smaller probability):
7.3. Cryptanalysis of LOKI 120
ΩP = 00 00 00 00 00 00 05 10x
118
A′ = 0 a′ = 00 00 05 10x p= 220
F
B′ = 0 b′ = 0 p=1
F
ΩT = 00 00 05 10 00 00 00 00x .
ΩP = 00 00 00 00 00 00 00 E0x
32
A′ = 00 00 00 10x a′ = 00 00 00 E0x p= 212
F
= P (00 00 00 02x )
14
B ′ = 00 00 00 10x b′ = 00 00 00 10x p= 212
F
18
C ′ = 00 00 00 10x c′ = 00 00 00 F 0x p= 212
F
D′ = 0 d′ = 0 p=1
F
18
E ′ = 00 00 00 10x e′ = 00 00 00 F 0x p= 212
F
14
F ′ = 00 00 00 10x f ′ = 00 00 00 10x p= 212
F
32
G′ = 00 00 00 10x g ′ = 00 00 00 E0x p= 212
F
H′ = 0 h′ = 0 p=1
F
ΩT = 00 00 00 E0 00 00 00 00x .
This iterative characteristic has probability about 2−46 and its extension to
nine rounds has the same probability. Using this characteristic it is possible
to break LOKI with up to eleven rounds with less than 264 chosen or known
plaintexts.
7.3. Cryptanalysis of LOKI 122
Careful analysis of the structure of LOKI has revealed that any key has
15 equivalent keys which encrypt any plaintext to the same ciphertext due
to a key complementation property. These 15 keys are the original key
XORed with the 15 possible 64-bit hexadecimal numbers whose digits are
identical (i.e., hhhhhhhhhhhhhhhhx where h ∈ {1x , . . . , Fx }). Encryption
with these keys results with the same inputs to the F functions in all the
16 executions. Therefore, most of the keys are redundant and a known
plaintext attack can be carried out with a complexity of 260 rather than
264 .
If we are allowed to choose the initial value, then for any message it is
easy to find 255 other messages which hash to the same value by the Double
Block Hash (DBH) mode of LOKI. This is done by XORing both H−1 and
M2 with gggggggghhhhhhhhx and XORing M1 with hhhhhhhhggggggggx
without changing H0 (where g ∈ {0x, . . . , Fx } and h ∈ {0x , . . . , Fx }).
After this research was completed, Matthew Kwan[19,5] found the fol-
lowing three-round iterative characteristic of LOKI with probability 2−14.4 :
ΩP = 00 00 00 00 00 40 00 00x
28
A′ = 00 40 00 00x a′ = 00 40 00 00x p= 4096
F
28
B ′ = 00 40 00 00x b′ = 00 40 00 00x p= 4096
F
C′ = 0 c′ = 0 p=1
F
ΩT = 00 40 00 00 00 00 00 00x .
This characteristic can be used to break LOKI with up to 14 rounds, and re-
quires up to 260 chosen plaintexts. He also found many additional fixpoints
of LOKI.
Plaintext (P)
S S S S S S S S K1
S S S S S S S S K2
S S S S S S S S K3
S S S S S S S S Ki
S S S S S S S S K13
P
S S S S S S S S K14
P
S S S S S S S S K15
S S S S S S S S K16
Ciphertext (T)
eight rounds requires less than 256 chosen plaintexts and negligible time
complexity.
Given an input of an S box, the outputs of the two possible S boxes are
known. Each output bit may be the same in both S boxes or may differ.
Usually only one or two output bits are the same in both S boxes. In few
cases, one output bit is equal in all the four output values obtained when
two input values differing by one bit (for example 8x and Ax ) enter the two
7.4. Cryptanalysis of Lucifer 125
Table 7.3. Output bits that are equal for both S boxes.
.000 .1..
0.00 .1..
001. ...0
.110 0...
10.0 ...1
110. .0..
Table 7.4. Output bits that are equal for both S boxes for two input values.
possible S boxes. There are pairs of inputs for which the same output bits
stay fixed for both values and the same bits differ using either one of the
two S boxes. In particular, there are pairs for which three output bits are
equal although their fourth bit differ using either S box.
The published description of this variant of Lucifer does not specify the
particular choice of the S boxes. For the sake of concreteness, we use the
third and fourth lines of S1 of DES as the S boxes S0 and S1 of Lucifer.
Other choices of the S boxes give similar results. Table 7.3 describes the S
boxes and the equal bits of the outputs of the two S boxes. We see that 11
inputs have two equal bits in the outputs, four inputs have one equal bit
and for one input all the output bits differ. Table 7.4 describes the equal
bits of two input values that differ by one bit using both S boxes. A binary
7.4. Cryptanalysis of Lucifer 126
Table 7.5. Output bits that are equal in pairs for either S box.
Table 7.5 describes pairs that have many equal bits, such that the re-
placement of one input with the other leaves those output bits unchanged
using either S box. In this table ‘0’ and ‘1’ means that the output bit is
‘0’ or ‘1’ respectively at all the cases. ‘+’ means that at either S box, the
output bit is equal for both inputs of the pairs. ‘-’ means the output bit
value is different for the inputs of the pairs for either S box. ‘.’ means that
neither of the above cases holds.
Since Feistel did not fix the parameters of Lucifer in his paper[15], we
show two attacks on variants with various choices of the blocksize and the
P permutation, and with fixed S boxes derived from the S boxes of DES.
Other choices of S boxes do not seems to strengthen the resultant ciphers.
The following attack breaks eight-round Lucifer with 32-bit blocks, with
the DES P permutation and with S boxes based on the third and fourth
lines of S1 of DES. Most of the possible choices of the S boxes and the
permutation are breakable with a similar complexity.
S1 3x , 6x , Ax , Cx , Dx
S2 2x
S3 Ax
S4 0x , 4x , 8x , Bx , Ex
S5 6x
S6 7x , 8x , Ax
S7 2x , 3x , Dx
S8 2x , 9x
Table 7.6. Input values that cause a bit in the fourth round to be zero.
†
The first line of the table represents the first plain-
text. The other lines represent values that are common
to the encryptions of all the 450 plaintexts.
Table 7.7. Common input and output bits of the various rounds.
the input of the fourth round to be zero. The fixed input and output values
in the various rounds are given in Table 7.7. I1 is the plaintext. Oi denotes
the output of the S boxes for input Ii . Ii+1 is the input of round i + 1
which is the permuted value of Oi .
The key bits of the following rounds can be found by the following algo-
rithm:
1. Try all the possible values of the key bits of the eighth, seventh and
sixth rounds with the key bits of the four S boxes in the fifth round
that are affected by the output of S5 in the fourth round, and the
key bit of S5 in the fourth round (total of 29 bits).
2. For each of them, partially decrypt the ciphertexts to get the input
bits of S5 in the fourth round. If for any one of them the bit number 17
is non-zero then the tried key is wrong.
7.4. Cryptanalysis of Lucifer 128
This algorithm has a time complexity of 229 and needs about 29–35 chosen
plaintexts.
There are similar attacks on Lucifer with 128-bit blocks with a chosen
fixed bit in the fourth round (or possibly even the fifth round for some
choices of the P permutation and the S boxes). In these attacks the above
algorithm starts by finding 53 out of the 8 × 32 = 256 key bits, uses about
53–60 ciphertexts, and has a time complexity of about 253 .
The following attack breaks eight-round Lucifer with 128-bit blocks. This
attack is described in general terms to allow any choice of the P permuta-
tion.
1. One S box in the first round has an output bit which enters the third
bit of the chosen S box in the second round. If this output bit is:
bit 2: choose 1011 and 1100 as the input bits.
bit 3: choose 0011 and 1101 as the input bits.
bit 4: choose 0001 and 1111 as the input bits.
These input bits are actual bits of the plaintexts. The outputs of this
S box differ only by the bit which enters the chosen S box in the
second round.
2. All the other plaintext bits are chosen identically for both members
of each pair.
7.4. Cryptanalysis of Lucifer 129
3. In particular, for the three other S boxes whose output bits enter
the chosen S box in the second round, choose input values (using
Table 7.3) which cause the output bit that enters the chosen S box
in the second round to have identical value under S0 and under S1
and such that the value of these bits would be the constant derived
from the chosen inputs 8x and Ax of the S box in the second round.
After the first round the partially encrypted values differ only in one bit
(the output of the S box from step 1). Thus, in the second round only one S
box has different input values (1000 and 1010, respectively). In the output
two bits differ. In the third round two S boxes have different inputs. Their
outputs enter seven S boxes in the fourth round (they may enter eight S
boxes, but with a proper choice they may enter seven S boxes). The output
bits of the seven S boxes enter about 20–28 S boxes in the fifth round.
Therefore, the outputs of at least four S boxes do not differ. In the sixth
round we choose an S box with one of these bits as its input. We try all the
possible values of the key bits of this S box, of the four affected S boxes
in the seventh round and of the 16 affected S boxes in the eighth round.
For each of their choices we verify the equality of the input bit in the sixth
round. Since we try 221 choices and each wrong pair has probability half
to succeed, we need about 21–30 pairs to find the value of the 21 key bits.
Once these key bits are found, the other key bits can be found with a
similar method using the known key bits.
Differential Cryptanalysis of
Hash Functions
hi = H(hi−1 kci )
Message Length
0 H H H H H H H Output
block = E(input);
return(output);
}
block = input;
for index = 0 to NO OF PASSES-1 do { (for each pass)
for byteInWord = 0 to 3 do {
for i = 0 to INPUT BLOCK SIZE-1 do { (for each round)
SBoxEntry = {fetch entry number block[i] mod 256 of S box
number 2 · index + (i/2) mod 2};
block[(i + 1) mod INPUT BLOCK SIZE] ⊕= SBoxEntry;
block[(i - 1) mod INPUT BLOCK SIZE] ⊕= SBoxEntry;
}
shift = shiftTable[byteInWord];
for i = 0 to INPUT BLOCK SIZE-1 do
block[i] = {rotate block[i] by shift bits to the right};
}
}
return(output);
}
functions H and E are given by Figures 8.2 and 8.3. In the codes the block
sizes are measured in units of 32-bit words and the values of the constants
are:
8.1. Cryptanalysis of Snefru 132
Rotate
by the thin lines along the edges). The gray area in the middle represents
the modified words (non-zero XORs) in the characteristic. The brighter
gray area represents the bytes with zero XORs in these words. The two
black lines at the top-left and the bottom-right corners point to the words
which are used in the calculation of the hash value by the function H (for
m = 128). Since both of them occur in the white (unmodified) part of
the block, the two messages hash to the same value. Figure 8.6 describes
the modified bytes in intermediate rounds of the characteristic. In this
figure each row represents a round. This same attack can break two-pass
Snefru with any m ≤ 224 bits. Similar attacks with modification of bytes
of three to seven consecutive words of the input XOR of the characteristic
are possible with the same characteristic’s probability. Figure 8.7 describes
a characteristic which modifies seven bytes.
Rotate
The black box attacks are independent of the (unknown) S boxes. The
attack is applicable even if different S boxes are used in different rounds.
A summary of the black box attacks on Snefru is given in Table 8.1. Only
one byte is modified in each word.
8.1. Cryptanalysis of Snefru 136
Another observation is that the values of the last and the first modified
bytes can be chosen directly. For each choice of the modifications of all the
bytes except the last, there is exactly one possibility for the modified value
of the last byte which cancels the difference from the previous word. This
value can be easily calculated and thus we can save a factor of 28 relative to
the characteristic’s probability. The first modified bytes can also be chosen
(with a small loop) to save another factor of 28 . Therefore, a total factor of
216 can be saved. Additional choices of bytes do not change the complexity.
This attack can also find many partners which hash to the same value
as a given message. For two-pass Snefru, given a message we create new
messages by modifying the value of seven bytes by the characteristic in
Figure 8.7. By trying about 240 such messages we can find with a high
probability a second message which hashes to the same value as the given
message. Moreover, the modification of the last modified byte (typically in
word 12) may be chosen after the garbling from the previous bytes is known.
Therefore, the value of this modified byte can be chosen directly to cancel
the garbling, and can decrease the complexity of this attack by a factor of
28 . If the modification is in a middle round it is possible to verify the value
of the first modified byte after choosing the last one directly and decrease
8.1. Cryptanalysis of Snefru 139
Table 8.3. Summary of the attacks which find partners of given messages.
1. The following two messages hash to the same value by two-pass Snefru.
The messages are 48-byte long and are denoted as 12 words. The messages
8.1. Cryptanalysis of Snefru 141
2. The following four messages hash to the same value as the (chosen) zero
message:
Message
IV H H H H H H Output
ΩP = (ψ, ψ, 0, 0).
8.2. Cryptanalysis of N-Hash 143
Mi
g X1 X2 X3 X4
U
EXG
V1 P1 F P2 F
PS
V2
PS
V3
PS
V4
Hi-1 PS Hi
V5 P3 F P4 F
PS
V6
PS
V7
PS
V8
PS Y1 Y2 Y3 Y4
f0 f1 f2 f3
k0
k1
k2
k3
S1
S0
S0 S1
F0 F1 F2 F3
3 28
6 224
9 240
12 256
15 272
1
With probability 256 the difference after the first round is
(0, 0, ϕ, ϕ).
1
With probability 16 the difference after the second round is
(ψ, ψ, ϕ, ϕ).
1
And with probability 16 the difference after the third round is
ΩT = ΩP = (ψ, ψ, 0, 0).
Non-Differential Cryptanalysis
of DES with a Small Number
of Rounds
In this chapter we describe several novel attacks on DES reduced to 3–6
rounds which are not based on the ciphertext pair paradigm. These attacks
are of three kinds: ciphertext only attacks, known plaintext attacks and
statistical known plaintext attacks. Compared to differential attacks, they
analyze fewer ciphertexts but require more time.
This attack assumes that the eight plaintext bytes are ASCII characters
whose most significant bits are zeroes, and crucially depends on the fact
that the initial permutation (IP ) moves the most significant bits of all these
bytes into a single byte. This byte is the fifth byte of the permuted plaintext
which is the first byte of the right half. Given a ciphertext T = (TL , TR )
we can easily calculate eight bits of the output of the second round by
B = a ⊕ c = PR ⊕ TR . From Table A.4 we see that these eight bits are the
output of seven S boxes in the second round (two of them are outputs of
S5). The attack is as follows:
1. We try all the possibilities of the key bits entering S5 in the second
round and all the key bits entering the six S boxes S1, S2, S3, S4, S6
and S8 in the third round whose output bits are XORed into the data
bits entering S5 in the second round. Three of these bits are counted
twice (in both rounds) and thus only 39 bits are exhaustively tried.
2. Using the tried key bits and any ciphertext we can calculate the
output of the six S boxes in the third round and the input and the
output of S5 in the second round.
9.1. Ciphertext Only Attacks 147
Since we start with 239 possible keys and only 41 of them survive each test,
we need about log4 239 = 19.5 ciphertexts. When the correct 39 key bits are
determined, we can exhaustively try all the possible values of the remaining
17 bits by checking whether the decoded plaintexts are ASCII characters.
This ciphertext only attack requires a total of 239 steps and 20 ciphertexts
to break DES reduced to three rounds.
In this attack we assume that the plaintext bytes belong to a smaller set
in which the three most significant bits are constant. Such sets are the
ASCII capital letters, the ASCII lower case letters and the ASCII digits.
The three most significant bits of all the eight plaintext bytes are packed
into three bytes by the initial permutation. These three bytes are the first
byte of the left half and the first and second bytes of the right half. Since
the first and second bytes of the right half are constant in all the plaintext
blocks, the inputs of S2 and S3 in the first round are constant and thus
their outputs are constant as well. We can calculate the output of the third
round by C = PL ⊕ A ⊕ TL . Two bits of the eight constant bits in PL have
corresponding constant bits in A: one of them is an output of S2 and the
other is an output of S3 (see Table A.4). Since TL is known, the two bits
in C are known up to a XOR with a constant. These bits are outputs of
S2 and S3. Trying all the 64 possibilities of the key bits entering S2 in the
third round, we can check that in any pair of ciphertexts the output bit of
S2 satisfies C1 ⊕ TL 1 = C2 ⊕ TL 2 . Since half the keys satisfy this condition,
we need about 1 + log2 64 = 7 ciphertexts to find the six key bits entering
S2 in the third round. The same ciphertexts can be used to find the six key
bits entering S3 in the third round. This leaves 44 unknown key bits which
can be found later.
two output bits (one in S2 and one in S3 in the third round) are known
up to a constant. We try all the possible key values of the six key bits of
S2 (or similarly S3) in the third round and all the possible key values of
the six S boxes in the fourth round whose output bits are XORed with the
data bits entering S2 (or S3) in the third round. We try a total of 36 key
bits entering the fourth round and six key bits entering the third round,
but five bits are common (six when using S3) and thus we have to try 237
possible key values. We need about 1 + log2 237 = 1 + 37 = 38 ciphertexts
to make the computed key unique.
The DES key scheduling algorithm divides the 56 key bits into two 28-bit
key registers (called the C register and the D register, see Appendix A.1).
Each register supplies the key bits to the same four S boxes in all the
rounds. The following attack exploits this particular aspect of DES.
Consider DES reduced to three rounds with a single known plaintext and
its corresponding ciphertext. The exclusive-or value of the output of the
first round and the third round is known by A ⊕ C = PL ⊕ TL .
We first try all the 228 possibilities of one key register. Each candidate
makes it possible to compute the output of four S boxes in the first round
and the output of the same S boxes in the third round. We know their
expected exclusive-or value. Since the value has 16 bits, only about 2−16 of
the candidates survive this test. Thus we get about 212 possibilities for the
first 28 bits of the key. In a similar way we get about 212 possibilities for the
other 28 bits of the key. Therefore we find about 212 · 212 = 224 possibilities
for the full key, which can be exhaustively searched. The complexity of this
algorithm is about 229 , and can be reduced to about 221 by choosing the key
bits entering each S box sequentially rather than in parallel, and discarding
partial keys as soon as they lead to a contradiction. Using several known
plaintexts, the complexity of this attack can be reduced to 28 .
9.3. Statistical Known Plaintext Attacks 149
In this attack we use the fact that for all the S boxes there is a weak
correlation between the value of the XOR of the four output bits and the
value of bit number 2 of the input (this phenomenon was pointed out by
Shamir[34], but at the time it did not seen to make cryptanalysis easier). In
particular, for every two inputs of an S box, if the XOR of the four output
bits of the first input equals the corresponding value of the second input
then both bits 2 of the input are equal with a certain probability. This
probability is different for each S box and varies between 0.56 and 0.70.
S1 S4 66% 16 75
S2 S8 57% 8 195
S3 S1 58% 7 240
S4 S2 56% 9 370
S5 S1 70% 16 50
S6 S8 61% 8 135
S7 S5 60% 14 210
S8 S6 63% 12 120
Table 9.1. Number of encryptions needed to find SKd for each S box.
a high probability. We try all the 64 possibilities of the key bits entering
the corresponding S box in the fourth round and the two possibilities of
the constant and verify that the specific output bit of the S box equals
its expected value. The right key value is counted in about 56%–70% of
the encryptions, depending on the exact S box. Any wrong key value is
counted in about half of the encryptions. The key value which is counted
most frequently is likely to be the right value. For each tried S box, this
attack finds a total of seven bits: six of them are actual key bits and the
seventh is an XOR of two key bits.
The attack obtains the best results when the probability is as high as
possible. To increase the probability we use only encryptions with specific
values of SOa ⊕ SOc which maximize this probability. For instance, when
S5Oa ⊕ S5Oc = 0 this probability is about 0.81. There is a tradeoff between
the number of allowed values and the corresponding probability. As the
number of allowed values increases, the probability decreases so we need
more data to carry out the attack. However, as the number of allowed
values decreases we need more data to make the occurrence of these values
sufficiently probable. Table 9.1 describes the best tradeoff achievable by
this attack. To make the best use of this attack it is advisable to use about
200 plaintext/ciphertext pairs, from which we can find almost 28 key bits,
and search exhaustively for the (about 228 ) remaining possibilities of the
key. Using about 370 plaintext/ciphertext pairs we can find almost 42 key
bits and search exhaustively for the (about 214 ) remaining possibilities of
the key.
9.3. Statistical Known Plaintext Attacks 151
This attack is again similar to the attack on five rounds, but we also have
to count all the possibilities of the 36 subkey bits of the sixth round which
enter S boxes whose output bits enter the counted S box in the fifth round
by the P permutation. In total we count on 49 bits. The total complexity
of this attack is about 255 –256 but the basic operation (which is similar to
a single application of the F function) is simpler than an encryption, and
thus the time needed is marginally faster than exhaustive search.
Appendix A
Description of DES
The Data Encryption Standard (DES)[28] is a blockcipher which encrypts
64-bit plaintexts into 64-bit ciphertexts under 56-bit keys. In the descrip-
tion of DES, the bit locations are numbered from 1 to 64 for 64-bit values,
and similarly for shorter values. Bit number 1 is the most significant bit of
the first byte, and bit number 64 is the least significant bit of the eighth
byte. The 56-bit key is represented as a 64-bit value, in which 56 bits are
the key bits, while all the bits whose numbers are multiples of eight are
used as parity bits, and are ignored by the algorithm.
The first part of the algorithm permutes the plaintext by an initial per-
mutation IP while the final part of the algorithm permutes the bits by the
inverse of the initial permutation, called final permutation. The body of
the algorithm, which is executed between these two permutations, divides
the block of the data into two 32-bit halves: the right half of the data and
the left half of the data. The basic step of the algorithm is called a round,
in which two new halves are calculated using the previous two halves and
a 48-bit subkey, which is calculated by a key scheduling algorithm from the
key. In DES, the body of the algorithm is composed of 16 rounds, which
use 16 different subkeys K1, K2, . . . , K16, where K1 is used in the first
round, K2 in used in the second round, and so on. In the round itself, an
F function is calculated with the right half of the data and the subkey
as inputs. The left half of the data is XORed with the output of the F
function. Between any two rounds, the two halves are exchanged (but not
before the first round nor after the last round). Figure A.1 describes this
structure of DES.
IP PC-1
K1
C D
F ROL1 ROL1
K2
PC-2
F ROL1 ROL1
K3
PC-2
F ROL2 ROL2
Ki
PC-2
F ROL ROL
K13
PC-2
F ROL2 ROL2
K14
PC-2
F ROL2 ROL2
K15
PC-2
F ROL2 ROL2
K16
PC-2
F ROL1 ROL1
PC-2
FP
Ciphertext (T)
58 50 42 34 26 18 10 2
60 52 44 36 28 20 12 4
62 54 46 38 30 22 14 6
64 56 48 40 32 24 16 8
57 49 41 33 25 17 9 1
59 51 43 35 27 19 11 3
61 53 45 37 29 21 13 5
63 55 47 39 31 23 15 7
16 7 20 21
29 12 28 17
1 15 23 26
5 18 31 10
2 8 24 14
32 27 3 9
19 13 30 6
22 11 4 25
corresponds to an output bit, and contains the number of the input bit
which is copied into that location. For example, the first bit in the output
of the P permutation has the same value as bit number 16 of its input. For
easy reference, we also include Table A.4 which describes how the output
bits of each S box in any particular round are permuted and expanded
towards the S boxes in the following round.
The S boxes of DES are six-bit to four-bit lookup tables. Each S box maps
64 possible input values into 16 output values. In the standard description
32 1 2 3 4 5
4 5 6 7 8 9
8 9 10 11 12 13
12 13 14 15 16 17
16 17 18 19 20 21
20 21 22 23 24 25
24 25 26 27 28 29
28 29 30 31 32 1
From To
1 S1 1 80 00 00 00 9 S2.6 S3.2 00 80 00 00 S7
2 2 40 00 00 00 17 S4.6 S5.2 00 00 80 00
3 3 20 00 00 00 23 S6.4 00 00 02 00
4 4 10 00 00 00 31 S8.4 00 00 00 02
5 S2 1 08 00 00 00 13 S3.6 S4.2 00 08 00 00 S6
6 2 04 00 00 00 28 S7.5 S8.1 00 00 00 10
7 3 02 00 00 00 2 S1.3 40 00 00 00
8 4 01 00 00 00 18 S5.3 00 00 40 00
9 S3 1 00 80 00 00 24 S6.5 S7.1 00 00 01 00 S1
10 2 00 40 00 00 16 S4.5 S5.1 00 01 00 00
11 3 00 20 00 00 30 S8.3 00 00 00 04
12 4 00 10 00 00 6 S2.3 04 00 00 00
13 S4 1 00 08 00 00 26 S7.3 00 00 00 40 S2
14 2 00 04 00 00 20 S5.5 S6.1 00 00 10 00
15 3 00 02 00 00 10 S3.3 00 40 00 00
16 4 00 01 00 00 1 S8.6 S1.2 80 00 00 00
17 S5 1 00 00 80 00 8 S2.5 S3.1 01 00 00 00 S8
18 2 00 00 40 00 14 S4.3 00 04 00 00
19 3 00 00 20 00 25 S6.6 S7.2 00 00 00 80
20 4 00 00 10 00 3 S1.4 20 00 00 00
21 S6 1 00 00 08 00 4 S1.5 S2.1 10 00 00 00 S4
22 2 00 00 04 00 29 S7.6 S8.2 00 00 00 08
23 3 00 00 02 00 11 S3.4 00 20 00 00
24 4 00 00 01 00 19 S5.4 00 00 20 00
25 S7 1 00 00 00 80 32 S8.5 S1.1 00 00 00 01 S5
26 2 00 00 00 40 12 S3.5 S4.1 00 10 00 00
27 3 00 00 00 20 22 S6.3 00 00 04 00
28 4 00 00 00 10 7 S2.4 02 00 00 00
29 S8 1 00 00 00 08 5 S1.6 S2.2 08 00 00 00 S3
30 2 00 00 00 04 27 S7.4 00 00 00 20
31 3 00 00 00 02 15 S4.4 00 02 00 00
32 4 00 00 00 01 21 S5.6 S6.2 00 00 08 00
14 4 13 1 2 15 11 8 3 10 6 12 5 9 0 7
0 15 7 4 14 2 13 1 10 6 12 11 9 5 3 8
4 1 14 8 13 6 2 11 15 12 9 7 3 10 5 0
15 12 8 2 4 9 1 7 5 11 3 14 10 0 6 13
15 1 8 14 6 11 3 4 9 7 2 13 12 0 5 10
3 13 4 7 15 2 8 14 12 0 1 10 6 9 11 5
0 14 7 11 10 4 13 1 5 8 12 6 9 3 2 15
13 8 10 1 3 15 4 2 11 6 7 12 0 5 14 9
10 0 9 14 6 3 15 5 1 13 12 7 11 4 2 8
13 7 0 9 3 4 6 10 2 8 5 14 12 11 15 1
13 6 4 9 8 15 3 0 11 1 2 12 5 10 14 7
1 10 13 0 6 9 8 7 4 15 14 3 11 5 2 12
7 13 14 3 0 6 9 10 1 2 8 5 11 12 4 15
13 8 11 5 6 15 0 3 4 7 2 12 1 10 14 9
10 6 9 0 12 11 7 13 15 1 3 14 5 2 8 4
3 15 0 6 10 1 13 8 9 4 5 11 12 7 2 14
2 12 4 1 7 10 11 6 8 5 3 15 13 0 14 9
14 11 2 12 4 7 13 1 5 0 15 10 3 9 8 6
4 2 1 11 10 13 7 8 15 9 12 5 6 3 0 14
11 8 12 7 1 14 2 13 6 15 0 9 10 4 5 3
12 1 10 15 9 2 6 8 0 13 3 4 14 7 5 11
10 15 4 2 7 12 9 5 6 1 13 14 0 11 3 8
9 14 15 5 2 8 12 3 7 0 4 10 1 13 11 6
4 3 2 12 9 5 15 10 11 14 1 7 6 0 8 13
4 11 2 14 15 0 8 13 3 12 9 7 5 10 6 1
13 0 11 7 4 9 1 10 14 3 5 12 2 15 8 6
1 4 11 13 12 3 7 14 10 15 6 8 0 5 9 2
6 11 13 8 1 4 10 7 9 5 0 15 14 2 3 12
The key scheduling algorithm calculates the values of the 16 48-bit subkeys
K1, K2, . . . , K16 from the 56-bit key. These subkeys are later used as inputs
to the F functions in the various rounds of the encryption algorithm. The
first part of the key scheduling algorithm permutes the 56 key bits by a
permutation called PC-1 which is described in Table A.14 and divides them
into two 28-bit key registers called the C register and the D register. The
key bits are numbered from 1 to 64, while the eight bits whose numbers
are multiples of eight (8, 16, 24, . . . , 64) are parity bits, and thus only 56
bits are participating in the algorithm itself. The bits of the C register are
57, 49, . . . , 36 of the key and the bits of the D register are 63, 55, . . . , 4 of
the key. In each round the registers C and D are rotated one or two bits
to the left, as is defined in Table A.15. Then, PC-2 takes the concatenated
value of the C and the D registers, selects 48 bits (24 bits from each key
13 2 8 4 6 15 11 1 10 9 3 14 5 0 12 7
1 15 13 8 10 3 7 4 12 5 6 11 0 14 9 2
7 11 4 1 9 12 14 2 0 6 10 13 15 3 5 8
2 1 14 7 4 10 8 13 15 12 9 0 3 5 6 11
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31
32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62
33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63
Table A.13. The input values which correspond to the standard description
of the S boxes.
57 49 41 33 25 17 9
1 58 50 42 34 26 18
10 2 59 51 43 35 27
19 11 3 60 52 44 36
63 55 47 39 31 23 15
7 62 54 46 38 30 22
14 6 61 53 45 37 29
21 13 5 28 20 12 4
register) and permutes them to form the 48-bit subkey of the corresponding
round. PC-2 is described in Table A.16. The outline of the key scheduling
algorithm is given in Figure A.1.
Round 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Rotations 1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 1
14 17 11 24 1 5
3 28 15 6 21 10
23 19 12 4 26 8
16 7 27 20 13 2
41 52 31 37 47 55
30 40 51 45 33 48
44 49 39 56 34 53
46 42 50 36 29 32
The other two modes of operation are feedback modes which generate
long pseudo-random bit streams by repeatedly encrypting an initial value.
The ith block of pseudo-random bits Vi is then XORed with the ith plaintext
block Pi to form the ith ciphertext block Ti = Pi ⊕ Vi .
Both feedback modes have variants with shift-registers which use fewer
than 64 bits from Vi−1 or Ti−1 as feedback. However, these variants are
slower than the 64-bit variants, and the OFB variants with less than 64
bits of feedback have short cycles[10].
Appendix B
The first row in the table is special. Since in the first row the input XOR
is zero, the output XOR must be zero as well. Therefore, the entry with
zero output XOR counts all the 64 pairs whose input XOR is zero and the
other entries in this row do not count any pair at all. In other rows, many
possible values arise. For example, for the input XOR 1x , eleven output
XORs are possible. For the input XOR 34x and the output XOR 2x the
number of possible pairs is 16, and thus a quarter of the pairs with this
input XOR lead to the output XOR 2x .
Appendix B. The Difference Distribution Tables of DES 161
of pairs is likely to be the real key. All counting schemes count the
number of pairs suggesting each possible key value, but they differ
by the characteristic they use, the number of key bits they count on
and the signal to noise ratio.
Cryptanalytic Attack: An algorithm in which an attacker can uncover the
plaintexts of given ciphertexts without knowing the key, or even find
the key itself. The four major types of cryptanalytic attacks are:
ciphertext only attacks, known plaintext attacks, chosen plaintext
attacks and adaptive attacks.
Cryptosystem: A tool for making data unintelligible to unauthorized
parties. Cryptosystems use keys to encrypt plaintexts to ciphertexts.
When the key is known, transforming plaintexts to ciphertexts should
be easy. When the key is unknown, extracting any information about
the key or the plaintexts should be very difficult.
Data Analysis Phase: Differential cryptanalytic attacks on cryptosystems
are divided into two phases. In the data collection phase many
plaintexts are encrypted on the target machine with the unknown
key. In the data analysis phase the resultant ciphertexts are analyzed
by the attacker in order to find the key.
Data Collection Phase: See the description of the Data Analysis Phase.
Data Encryption Standard: See DES.
Dependent Key: A key from which subkeys are derived via some key
scheduling algorithm. This is the standard type of key for iterated
cryptosystems. In this book, dependent keys are viewed as a special
type of independent keys.
DES: A cryptosystem which was developed by IBM[28] and adopted
by the NBS in 1977 as the standard cryptosystem for securing
civilian applications dealing with sensitive but unclassified data. See
Appendix A for technical description.
DES-like Cryptosystem: An iterated cryptosystem whose structure is
similar to DES: In each round the data is divided into two halves,
an F function operates on the right half, its output is XORed into
the left half, and the halves are exchanged.
Design rules: The design rules of DES were never published due to national
security reasons. Recently, Don Coppersmith who was one of the
designers of DES announced that the design team at IBM was aware
of differential cryptanalysis in 1974 and that DES was specifically
designed to defeat it.
Glossary 172
S Box: A lookup table which maps short input strings into short output
strings. In many iterated cryptosystems (like DES) the S boxes
are the only non-linear operations, and thus the strength of the
cryptosystem crucially depends on the choice of the S boxes.
Signal to Noise Ratio: The expected ratio between the number of times
the correct key value is counted by right pairs and the number of
times an incorrect key value is counted (by right or wrong pairs) in
a particular counting scheme. The number of pairs required by the
counting scheme can be approximated by using the signal to noise
ratio. A counting scheme whose signal to noise ratio is high requires
relatively few pairs (with relatively few right pairs among them). A
counting scheme whose signal to noise ratio is too low may require
an unrealistic number of pairs. The signal to noise ratio is denoted
by S/N .
Snefru: A hash function[21] which uses fixed eight-bit to 32-bit S boxes.
Snefru hashes messages of arbitrary length into 128-bit values.
Structure: A structure groups together many related plaintexts in a way
which saves data by allowing many pairs to exist in a relatively small
group of plaintexts. Typical examples of structures are quartets and
octets.
Subkey: A key dependent value used in one round of an iterated
cryptosystem. DES has 16 rounds and uses 16 subkeys derived from
the key by placing each key bit in about 14 subkeys via the key
scheduling algorithm. In other iterated cryptosystems the subkeys
are derived by more complex procedures. In FEAL, this procedure is
called key processing algorithm.
Wrong Pair: Any pair of plaintexts which is not a right pair.
Bibliography
[1] Carlisle M. Adams, On Immunity against Biham and Shamir’s
“Differential Cryptanalysis”, Information Processing Letters, Vol. 41,
No. 2, pp. 77–80, 1992.
[2] Thomas A. Berson, Long Key Variants of DES, Advances in Cryptology,
proceedings of CRYPTO’82, pp. 311–313, 1982.
[3] Eli Biham, Adi Shamir, Differential Cryptanalysis of FEAL and N-
Hash, technical report CS91-17, Department of Applied Mathematics
and Computer Science, The Weizmann Institute of Science, 1991. The
extended abstract appears in Lecture Notes in Computer Science,
Advances in Cryptology, proceedings of EUROCRYPT’91, pp. 1–16,
1991.
[4] E. F. Brickell, J. H. Moore, M. R. Purtill, Structure in the S-Boxes of
the DES, Lecture Notes in Computer Science, Advances in Cryptology,
proceedings of CRYPTO’86, pp. 3–7, 1986.
[5] Lawrence Brown, Matthew Kwan, Josef Pieprzyk, Jennifer Seberry,
Improving Resistance to Differential Cryptanalysis and the Redesign of
LOKI, Lecture Notes in Computer Science, Advances in Cryptology,
proceedings of ASIACRYPT’91, 1991, to appear.
[6] Lawrence Brown, Josef Pieprzyk, Jennifer Seberry, LOKI - A Crypto-
graphic Primitive for Authentication and Secrecy Applications, Lecture
Notes in Computer Science, Advances in Cryptology, proceedings of
AUSCRYPT’90, pp. 229–236, 1990.
[7] David Chaum, Jan-Hendrik Evertse, Cryptanalysis of DES with
a reduced number of rounds, Sequences of linear factors in block
ciphers, Lecture Notes in Computer Science, Advances in Cryptology,
proceedings of CRYPTO’85, pp. 192–211, 1985.
[8] Thomas W. Cusick, Michael C. Wood, The REDOC-II Cryptosys-
tem, Lecture Notes in Computer Science, Advances in Cryptology,
proceedings of CRYPTO’90, pp. 545–563, 1990.
[9] D. W. Davies, private communication.
[10] D. W. Davies, G. I. P. Parkin, The average Cycle Size of the Key Stream
in Output Feedback Encipherment, Lecture Notes in Computer Science,
Cryptography, proceedings of the Workshop on Cryptography, Burg
Feuerstein, Germany, March 29–April 2 1982, pp. 263–279, 1982. Also
in Advances in Cryptology, proceedings of CRYPTO’82, pp. 97–98,
1982.
Bibliography 178
[24] Shoji Miyaguchi, The FEAL cipher family, Lecture Notes in Computer
Science, Advances in Cryptology, proceedings of CRYPTO’90, pp. 627–
638, 1990.
Bibliography 179
180
Index 181