Chapter 4
Cryptanalysis on Block Ciphers

In this chapter, several cryptanalyses against block ciphers are introduced. The discussion is mainly focused on AES-128, which is the AES with a 128-bit key, although many of the discussions can also be applied to other block ciphers in general.

The ideal security of block ciphers and the goal of the cryptanalysis are firstly defined. Then, many techniques in several cryptanalytic approaches are introduced. The first topic is the differential cryptanalysis, which provides the basic concepts of cryptanalysis. The second topic is the impossible differential cryptanalysis. Finally, the last topic is the integral cryptanalysis. Key recovery attacks against reduced-round versions of AES-128 are demonstrated for each approach.

4.1 Basics of Cryptanalysis

4.1.1 Block Ciphers

Block cipher E takes as input a key K of a fixed bit-length, and produces a one-to-one map (permutation) from b-bit plaintext to b-bit ciphertext, where b is a bit-length of the fixed block size. Let k be a bit-length of the fixed key size. Then, block ciphers are described as follows:

4.1 equation
4.2 equation

The permutation c4-math-0009 is required to behave completely independent for different choices of K. The model of block cipher is depicted in Figure 4.1.

c4f001

Figure 4.1 Model of block cipher

On the one hand, from mathematical perspective, any key size and any block size are acceptable. On the other hand, from engineering perspective, suitable choices of those sizes are limited.

The key size is often determined by a cost of managing keys and required security for the block cipher. Long keys have higher security than short keys, while the managing cost for long keys is more expensive than the one for short keys.

The block size is often determined by the processor size of the target platform. For example, if block ciphers are designed to be used in a high-end software with a 64-bit processor, typical choices of the block size are a multiple of 64 bits such as 128 bits or 256 bits. If they are designed to be suitable for resource-restricted environment such as an RFID tag, a smaller block size is chosen. Several examples of the key size and block size of widely used block ciphers are summarized in Table 4.1.

Table 4.1 Key size and block size of widely used block ciphers

Algorithm Key size, k Block size, b
AES-128 128 128
AES-192 192 128
AES-256 256 128
Camellia-128 128 128
Camellia-192 192 128
Camellia-256 256 128
Triple-DES 168 64
PRESENT 80 64
PRESENT 128 64
HIGHT 128 64

4.1.2 Security of Block Ciphers

Block ciphers are required to provide some robustness against cryptanalysis. To measure the security of block ciphers, security notions must be defined. There are several classes of security notions. Three major notions are key recovery resistance, plaintext recovery resistance, and indistinguishability from a random permutation.

  1. Key recovery resistance: For any choice of the key K, the block cipher must resist the attack that efficiently recovers the value of K.
  2. Plaintext recovery resistance: For any choice of the key K, and for any choice of the ciphertext C, the block cipher must resist the attack that efficiently recovers the corresponding plaintext value P such that c4-math-0018.
  3. Indistinguishability: For any choice of the key K, the permutation c4-math-0020 must be indistinguishable from a random permutation. This notion is often referred as pseudo-random permutation. In detail, under a fixed key, a block cipher becomes a b-bit permutation. Without the knowledge of the key K, nobody can compute a valid pair of plaintext and ciphertext. Then, another b-bit permutation is chosen randomly from all the possible b-bit permutations, which is called a random permutation. Suppose that there is a b-bit permutation in which either of a block cipher with an unknown fixed key or a random permutation is implemented. An observer aims to distinguish which of the block cipher or the random permutation is implemented without the knowledge of the key. The indistinguishability is depicted in Figure 4.2.
c4f002

Figure 4.2 Indistinguishability

Here, the term “efficiently” in the security notions leaves ambiguity. More details are explained in a later section explaining generic attacks.

If the key recovery resistance is broken on a block cipher, the other two notions are broken automatically. Therefore, the key recovery resistance is the weakest security notion among the above three. That is to say, from a designer's point of view, the key recovery resistance is the easiest security notion to satisfy, while from an attacker's point of view, it is the hardest security notion to break. The definition of “success of the attack” depends on which class of security notions is expected on that cipher. In general, block ciphers are expected to have ideal security. Thus, efficiently breaking indistinguishability is considered to be a significant vulnerability for block ciphers.

4.1.3 Attack Models

To measure the security of block ciphers, not only the security notion but also the attacker's ability must be defined. The assumed attacker's ability is often referred as the attack model, which is mainly classified by the information that attackers can obtain.

  1. Ciphertext only attack: The attacker can only observe ciphertexts produced by the encryption system. As long as plaintexts are chosen accordingly to the uniform distribution, the corresponding ciphertexts also follow the uniform distribution. Therefore, in the ciphertext only attack, the attacker must suppose the bias of the plaintexts such as the bias in natural languages or ASCII codes. It is rare to see that modern symmetric-key ciphers are broken by the ciphertext only attack.
  2. Known plaintext attack: The attacker can observe pairs of plaintext and the corresponding ciphertext. Owing to the knowledge of plaintexts, the known plaintext attack is stronger than the ciphertext only attack. The known plaintext attack, in practice, simulates the attacker who eavesdrops the communication between two players. The attacker does not have any control of the plaintext to be encrypted.
  3. Chosen plaintext attack: The attacker has an ability to make the system encrypt any plaintext of the attacker's choice. The attacker can observe the corresponding ciphertext. Owing to the ability of choosing plaintexts, the chosen plaintext attack is stronger than the known plaintext attack. The chosen plaintext attack, in practice, simulates the attacker who impersonates a valid communication player. In the chosen plaintext attack, the plaintexts to be encrypted must be chosen before the attack. Once one of the chosen plaintexts is encrypted, the attacker loses the ability to choose new plaintexts.
  4. Adaptively chosen plaintext attack: The attacker has an ability to choose plaintexts to be encrypted even after chosen messages are encrypted by the system. The adaptively chosen plaintext attack, in practice, simulates the online active attackers who change the attack strategy depending on the behavior of the system.
  5. Chosen ciphertext attack: Chosen ciphertext attack is a similar model as the chosen plaintext attack. The attacker has an ability to make the system decrypt any ciphertext of the attacker's choice. From mathematical perspective, the ability of choosing plaintexts is as strong as the ability of choosing ciphertexts. However, considering the usage in practice, the latter model is often regarded to be stronger than the former model.
  6. Adaptively chosen ciphertext attack: Adaptively chosen ciphertext attack is a similar model as the adaptively chosen plaintext attack. The attacker has an ability to choose ciphertexts to be decrypted even after chosen ciphertexts are decrypted by the system.

It is possible to combine models for the plaintext and the ciphertext. Thus, the strongest attack model that can be directly obtained from the above classification is the adaptively chosen plaintext and ciphertext attack.

Block ciphers are usually required to have ideal security. Thus, the indistinguishability must be ensured against the adaptively chosen plaintext and ciphertext attack.

Note that the attackers cannot compute the correspondence between plaintexts and ciphertexts by themselves because the key value is unknown. In any of the above-mentioned attack models, the corresponding ciphertext (resp. plaintext) of known or chosen plaintext (resp. ciphertext) can be obtained only by forcing the system to output the result. Those requests to the system are called queries. A system that returns results from queries is called an oracle. In particular, an oracle that accepts plaintexts as queries and returns the corresponding ciphertexts is called an encryption oracle. Similarly, an oracle that accepts ciphertexts as queries and returns the corresponding plaintexts is called a decryption oracle. As an example, the chosen ciphertext attack is described in Figure 4.3.

c4f003

Figure 4.3 Chosen ciphertext attack accessing decryption oracle

Other than the above-mentioned models, cryptographers developed various types of attack models. Some of them were introduced only for an academic interest. Two examples of those complicated models are introduced below, however, those are not discussed more in this book.

  1. Multikey model: There are several users with their own keys in the system. The attacker, under some plaintext or ciphertext model, can access any user. For example, if the attack model is the known plaintext attack in the multikey model, the attacker can eavesdrop pairs of plaintext and ciphertext from multiple users.
  2. Related-key model: The related-key model is a variant of the multikey model, in which the attacker has more knowledge about the users' keys. Suppose that there are i users, c4-math-0027 in the system, and they use the key labeled as c4-math-0028, respectively. The assumption in the related-key model is that the attacker does not know the value of c4-math-0029, however, the relation of each key pair is known. The bit-wise XOR is a typical example of the relation in the related-key model. Namely, for two indices c4-math-0030, the values of c4-math-0031 and c4-math-0032 are unknown, but their relation c4-math-0033 is known.

4.1.4 Complexity of Cryptanalysis

The efficiency of the cryptanalysis is usually measured by three types of quantity: data, time, and memory.

  1. Data: The data quantity is measured by the number of queries.
  2. Time: The time quantity is measured by computational cost executed by an attacker offline. The unit of the computational cost is usually the cost of one execution of the encryption algorithm c4-math-0034 or the decryption algorithm c4-math-0035. The computational cost for the oracle is not counted as the computational cost of the attack.
  3. Memory: An attacker often needs to store queried plaintexts (resp. ciphertexts) and returned ciphertexts (resp. plaintexts) from the oracle. The attacker may need to store intermediate values generated during the attack. To store such data, a certain amount of memory is required. The memory quantity is measured by memory requirement. In many cases, the unit of the memory requirement is one value of the block size (b bits), or a byte (8 bits).

A triplet of those three types of quantity is called attack complexity. Let c4-math-0037 be the data, time, and memory quantity of an attack against some security notion under some attack model. This indicates that if

  1. the attacker can ask D queries to the oracle under the assumed attack model,
  2. the attacker can spend the cost of executing the encryption or decryption algorithm T times, and
  3. the attacker has enough memory to store M data of the size b bits,

the attacker succeeds in attacking the target cipher with respect to the target security notion in the target attack model.

4.1.5 Generic Attacks

Because block ciphers use a fixed size key, it is information-theoretically impossible to keep the key secret permanently. There always exists an attack that recovers the key in a finite time. This principle is applied to any block cipher even if it is ideally designed. Such attacks are called generic attacks. In the following, two generic attacks against block ciphers are explained.

4.1.5.1 Brute Force Attack (Exhaustive Search)

In the brute force attack, the attacker tries to recover the k-bit correct key value by simply examining all the c4-math-0043 possibilities. The attack is often called an exhaustive search. The brute force attack starts by obtaining pairs of plaintext and ciphertext. The number of necessary pairs depends on the key size (k bits) and the block size (b bits). For simplicity, suppose that the block size is bigger than the key size, that is, c4-math-0046. In this case, the attack requires only one pair of a plaintext and the corresponding ciphertext. The attack consists of the online phase for collecting a pair of plaintext and ciphertext in the known plaintext attack and the offline phase for recovering the correct key value.

In the online phase, the attacker makes one query of a known plaintext c4-math-0047 to the encryption oracle, and receives the corresponding ciphertext c4-math-0048. Then, with the knowledge of a valid pair c4-math-0049, the attacker aims to recover the correct key in the offline phase. Let G be a k-bit variable representing the key guess. The brute force attack computes the value of c4-math-0052 for all the c4-math-0053 possibilities of G, and checks the match of the computedresults and c4-math-0055. The detailed process of the brute force attack is shown in Algorithm 4.1.

If G is the correct guess, the equation c4-math-0065 is satisfied with probability 1. If G is not the correct guess, c4-math-0067 occurs with probability c4-math-0068. When b is bigger than k, the event of the probability c4-math-0071 is unlikely to occur by c4-math-0072 trials. Thus, Algorithm 4.1 can successfully return the correct key K. The brute force attack is illustrated in Figure 4.4. Because it works in the known plaintext attack, the attack can also work in the stronger attack models.

c4f004

Figure 4.4 Brute force attack for c4-math-0074

When c4-math-0075, the data complexity of the brute force attack is one known plaintext. The time complexity of the brute force attack is c4-math-0076 encryption operations. The brute force attack does not need to store any intermediate value during the attack but for a pair of a plaintext and a ciphertext c4-math-0077. Thus, the memory requirement of the brute force attack is negligible.

Let us consider the case when the key size is equal to the block size, that is, c4-math-0078. The attack algorithm basically follows Algorithm 4.1. However, the probability that a wrong guess satisfies c4-math-0079 is not negligible. Owing to the assumption c4-math-0080 wrong keys are examined. Then, an event with probability c4-math-0081 is satisfied after c4-math-0082 trials with the following number:

4.3 equation

By assuming that the block size, b, is big enough,

4.4 equation

Therefore, besides the correct key K, one false positive (a value wrongly judged to be the correct key) is expected. If more than one key candidates remain, it is impossible to determine the correct key value only with one pair of c4-math-0087. Then, the attack needs to obtain another pair c4-math-0088, and also examines the match of c4-math-0089 and c4-math-0090 for the remaining key candidates. The correct key guess can also satisfy the match of those two values, while the wrong key guess succeeds the test only with probability c4-math-0091. In the end, the brute force attack successfully recovers the correct key K with at most two pairs of plaintexts and ciphertexts.

Finally, let us consider the case when the key size is much bigger than the block size, that is, c4-math-0093. The attack procedure is basically the same as the other cases but for the number of necessary pairs to detect the correct key K. Each pair of plaintext and ciphertext c4-math-0095 yields a b-bit relation c4-math-0097. This can be regarded as a b-bit filter for the key K, that is, the k-bit key space can be reduced to c4-math-0101 bits by checking the match of a b-bit relation. Therefore, to reduce the key space to 1, the number of necessary pairs is described by

4.5 equation

The attack procedure is shown in Algorithm 4.2.

The procedure in Algorithm 4.2 first checks the match of c4-math-0116 and c4-math-0117, and then checks the match of the other pairs. By processing the attack in this order, the computational cost can be optimized to c4-math-0118 encryption operations compared to the case that the match of all pairs is checked simultaneously.

 

 

4.1.5.2 Codebook Attack (Dictionary Attack)

Codebook means the set of all plaintexts and the corresponding ciphertexts. For any newly given ciphertext, the attacker can obtain the corresponding plaintext by looking up the codebook. Thus, the plaintext recovery resistance is broken. The attack is also called a dictionary attack. The codebook attack is illustrated in Figure 4.5. The codebook attack breaks the plaintext recovery resistance irrespective of the key size. Note that even with the codebook, the attacker cannot obtain any information of the key K only by observing the correspondence of plaintexts and ciphertexts even if the key size k is smaller than the block size b.

c4f005

Figure 4.5 Codebook attack

The codebook attack requires to obtain all the c4-math-0133 plaintext–ciphertext pairs. The attack can work under the known plaintext model. The data complexity of the codebook attack is c4-math-0134 pairs of plaintexts and ciphertexts. The time complexity of the codebook attack is one access of look-up table, which is negligible. The attack requires to store all c4-math-0135 plaintext–ciphertext pairs in a local memory as the look-up table. Thus, the memory requirement is c4-math-0136-bit values.

4.1.6 Goal of Shortcut Attacks (Cryptanalysis)

For any block cipher, being attacked by generic attacks is not regarded to be a flaw of the design because it is theoretically impossible to prevent. The purpose of discussing generic attacks is that they can be used to know the goal of the design. That is to say, for secure block ciphers, any attack with a less cost than the one in the generic attack must be prevented.

Such attacks are called shortcut attacks. For a block cipher, allowing a shortcut attack is usually considered to be a significant vulnerability. In other words, the goal of the cryptanalysis is finding a shortcut attack, while the goal of the cipher's designer is preventing any shortcut attack.

Recall the two generic attacks explained earlier. The brute force attack indicates that with the attack complexity (Data, Time, Memory) c4-math-0137, the key is recovered in any block cipher, where c4-math-0138 represents “negligibly small.” The codebook attack indicates that with the attack complexity (Data, Time, Memory) c4-math-0139, the plaintext is recovered in any block cipher. Considering those facts, the number of queries for any shortcut attack must be smaller than c4-math-0140, and the computational cost for any shortcut attack must be smaller than c4-math-0141. The memory requirement of a valid shortcut attack is often bounded by c4-math-0142. In summary, the following lemma is obtained for a shortcut attack.

In some cases, the attack with a complexity of c4-math-0144, and c4-math-0145 is discussed. This is because there is no generic method to recover the key faster than the brute force attack even with the full codebook. This motivation is theoretically true, but in practice, the cipher's security has already been broken. The key recovery attack with the full codebook is less interesting than the key recovery attack without the full codebook.

From the next section, several popular approaches of the cryptanalysis against block ciphers are introduced.

4.2 Differential Cryptanalysis

4.2.1 Basic Concept and Definition

Differential cryptanalysis was established by Biham and Shamir. Suppose that two input messages M and c4-math-0147 are processed by the same function F. Namely, c4-math-0149 and c4-math-0150 are computed. The differential cryptanalysis focuses on the difference of two computations.

Suppose that two values x and c4-math-0156 with a difference c4-math-0157 are processed by the function F, and let c4-math-0159 be the output difference. Then, c4-math-0160 is computed as follows:

4.8 equation

The concept of the difference is illustrated in Figure 4.6. The fact that the difference c4-math-0167 becomes c4-math-0168 after some operation is called “c4-math-0169 is propagated to c4-math-0170 (with some operation).”

c4f006

Figure 4.6 Illustration of difference

4.2.2 Motivation of Differential Cryptanalysis

What for the differential cryptanalysis focuses on the difference of two computations rather than the result for each value? The reason is that, in many computations widely adopted in current block cipher algorithms, deterministic (probability 1) differential propagation can be constructed even without knowing the key value. This fact makes the cryptanalysis easy.

In many block ciphers, the key or values derived by the key is mixed to the plaintext or values derived by the plaintext with the XOR operation. Recall the specification of AES in Section 1.5. As the first operation, XOR of the plaintext and the key is taken, and the updated state c4-math-0171 is computed. The operation is depicted in Figure 4.7.

c4f007

Figure 4.7 Mixing key and plaintext in AES

Let us check how the differential cryptanalysis impact the block cipher analysis, by comparing it with the analysis focusing on a single value.

4.2.2.1 Analysis with a Single Value

Suppose that the attacker obtains a single plaintext P in the known plaintext attack model. The attacker does not know the key value K. In AES, the plaintext is XORed with the key K, and the value of the state c4-math-0175 is represented as c4-math-0176. Because K is unknown to the attacker, the value of c4-math-0178 is unknown to the attacker. Thus, the attacker loses all information about the computation, and cannot continue the attack for the subsequent computations.

4.2.2.2 Analysis with Difference of Two Values

Suppose that the attacker obtains two plaintexts P and c4-math-0180 in the known plaintext attack model. Then, the difference of the two plaintexts is represented as c4-math-0181. The attacker does not know the key value K. After taking XOR of the plaintext and the key, the state value c4-math-0183 for the two plaintexts is represented by c4-math-0184 and c4-math-0185. Then, the difference of the values of c4-math-0186 for the two plaintexts is represented as

4.11 equation
4.12 equation
4.13 equation

Although each of the value of c4-math-0191 and c4-math-0192 is unknown, the attacker still knows their difference irrespective of the key value K. The above-mentioned two cases are depicted in Figure 4.8.

c4f008

Figure 4.8 Comparison of analysis with value and with difference

4.2.3 Probability of Differential Propagation

For a given pair of values x and c4-math-0195 and a function F without any secret value, the corresponding difference after processing F can be computed deterministically, or the difference of c4-math-0198 and c4-math-0199 can be computed without any error probability.

The goal of the differential cryptanalysis is recovering the secret key K of a target block cipher c4-math-0201. The attacker usually cannot compute the difference of c4-math-0202 and c4-math-0203 without knowing K.

To solve the issue, the differential cryptanalysis often specifies the difference of input values to a function c4-math-0205, input difference, and the difference of output values from c4-math-0206, output difference, without specifying the exact input value of x, and then evaluates the probability that the event c4-math-0208 is satisfied when x is randomly chosen according to the uniform distribution. This probability is represented by

4.15 equation

As a case study, consider the differential propagation of a 4-bit to 4-bit function c4-math-0211, which is defined in Table 4.2. Note that c4-math-0212 is the S-box computation adopted in a lightweight block cipher TWINE.

Table 4.2 A 4-bit to 4-bit function c4-math-0213

Input x 0 1 2 3 4 5 6 7 8 9 A B C D E F
Output c4-math-0215 C 0 F A 2 B 9 5 8 3 D 7 1 E 6 4

All values are described in the hexadecimal format.

Consider calculating the probability that the input difference 5 changes into the output difference A, after the computation of c4-math-0216, that is, c4-math-0217. To calculate the probability, for all possible input values c4-math-0218, another input value is obtained by XORing the input difference, c4-math-0219, and the difference of c4-math-0220 and c4-math-0221 is computed. Then, the probability that the output difference is A is calculated. For c4-math-0222, two input values are 0 and c4-math-0223. The output difference is c4-math-0224. The same evaluation is done for all c4-math-0225. The result is summarized in Table 4.3.

Table 4.3 Output difference of c4-math-0226 when input difference is 5

x c4-math-0228 c4-math-0229 c4-math-0230 c4-math-0231
0 5 C B 7
1 4 0 2 2
2 7 F 5 A
3 6 A 9 3
4 1 2 0 2
5 0 B C 7
6 3 9 A 3
7 2 5 F A
8 D 8 E 6
9 C 3 1 2
A F D 4 9
B E 7 6 1
C 9 1 3 2
D 8 E 8 6
E B 6 7 1
F A 4 D 9

From Table 4.3, 2 out of 16 possibilities will result in the output difference A. Therefore,

4.16 equation

Similarly, the probability of the differential propagation from 5 to other output differences can be obtained from Table 4.3.

4.18 equation
4.19 equation
4.20 equation
4.21 equation
4.22 equation
4.23 equation
4.24 equation
4.25 equation
4.26 equation
4.27 equation
4.28 equation
4.29 equation
4.30 equation
4.31 equation

The probability of the differential propagation is formally defined as follows.

4.2.4 Deterministic Differential Propagation in Linear Computations

The case study in Figure 4.8 can be generalized more. Let c4-math-0259 be a function that returns XOR of two n-bit input values. Then, XOR of a plaintext and the fixed key K can be represented as c4-math-0262. As shown in Equation (4.14), for any value of P and c4-math-0264, the input difference to c4-math-0265 and the output difference from c4-math-0266 become identical. That is to say, the following lemma holds for c4-math-0267.

Moreover, the probability that a difference other than c4-math-0271 is output is 0. Namely, the following lemma holds.

More generally, suppose that two values for the first input variable to c4-math-0276 have a difference c4-math-0277 and two values for the second input variable have a difference c4-math-0278. Then, the following lemma holds for c4-math-0279.

Note that Lemma 4.2.4 is the special case of Lemma 4.2.6, in which the difference of the second input variable is 0.

An interesting observation in Equation (4.36) is that

4.37 equation

That is to say, the output difference can be computed as if the difference were the input value to the function c4-math-0284. In the differential cryptanalysis, an attacker aims to obtain a high probability differential propagation only with determining differences without determining the paired values. The approach is useful for block cipher analysis because the plaintext values become unknown quickly owing to the key.

Not only for the XOR operation but also for any type of linear computations, the differential propagation can be computed deterministically without determining the exact paired values. A linear function L satisfies the following property:

4.38 equation

Therefore, the difference of two values a and b after a linear computationL can be computed by taking their difference as input to L. Namely, the following lemma holds, which is illustrated in Figure 4.9.

c4f009

Figure 4.9 Computing output difference in a linear computation L

Other two examples of the computation that are widely adopted in current block cipher algorithms are the rotation operation and the multiplication over a finite field.

  1. Rotation: Let “c4-math-0298” be the left rotation by r-bits. Then, for any input difference c4-math-0300,
    4.41 equation

    The differential propagation of the 3-bit rotation for 8-bit values is depicted in Figure 4.10. c4-math-0302 holds for any choices of x and c4-math-0304.

  2. Multiplication over a finite field: Let “c4-math-0305” be the multiplication with a constant t over a finite field. Then, for any input difference c4-math-0307,
    4.42 equation
c4f010

Figure 4.10 Differential propagation over a rotation operation

A composition of more than one linear computations are also linear. Hence, for any composition of linear computations, the output difference can be computed deterministically from the input difference. An example is the c4-math-0309 operation in AES. The c4-math-0310 operation linearly maps a 32-bit value to another 32-bit value, whose computation consists of the multiplications over a finite field and XOR of several values. Thus, if the input difference to the c4-math-0311 operation is determined, the corresponding output difference can be deterministically computed without determining the exact values.

As an application to AES, the deterministic differential propagation for the linear computation part of the AES round function is explained below, which is described in Figure 4.11.

c4f011

Figure 4.11 Differential propagation for linear operations of AES round function

The linear operation part of the AES round function in round i is c4-math-0313, and c4-math-0314. Suppose that difference of the input state to the c4-math-0315 operation c4-math-0316 has a nonzero byte difference c4-math-0317 in the third row of the second column. Hereafter, a sequence of 16-byte values is used to represent a 128-bit value of the state. More precisely, the state whose jth byte value is c4-math-0319 for c4-math-0320 is denoted by

4.43 equation

With this notation, the above c4-math-0322 is represented as

4.44 equation

After the c4-math-0324 operation, each byte in the third row is rotated by 2 bytes to left. Thus, in the difference of the state c4-math-0325, a nonzero byte difference c4-math-0326 moves to the third row in the fourth column, that is,

4.45 equation

Then, the c4-math-0328 operation is applied. Regarding the first, second, and third columns, the output difference is computed as

4.46 equation

Therefore, the differences for those columns are c4-math-0330. Regarding the fourth column, the output difference is computed as

4.47 equation

In the end, after the c4-math-0332 operation, the difference of the state value c4-math-0333 becomes as follows:

4.48 equation

Finally, the c4-math-0339 operation is applied, which computes XOR of the state and the subkey. From Lemma 4.2.4, the output difference of the XOR operation is the same as the input difference. Thus, the difference after the c4-math-0340 operation is represented as follows:

4.49 equation

which concludes the differential propagation for the linear computation part of the AES round function.

4.2.5 Probabilistic Differential Propagation in Nonlinear Computations

When a function F does not satisfy the definition of linear operation, that is,

4.50 equation

no efficient method is known to derive a high probability differential propagation. Hence, all the possibilities must be taken into consideration according to Equation (4.33) in the definition of the probability of differential propagation.

AES adopts a single nonlinear operation in a round function, which is the c4-math-0344 operation. c4-math-0345 applies an S-box to each byte of the state in order to substitute a byte (8-bit) value into another one according to a prespecified conversion table. Analyzing 8-bit to 8-bit S-box is complicated. Hence, in this section, the 4-bit to 4-bit S-box c4-math-0346 defined in Table 4.2 is mainly analyzed as a small example, and the extension to the 8-bit to 8-bit S-box is explained later.

For a nonlinear function, the attacker aims to obtain the probability of the differential propagation for all possible patterns. Most of the block ciphers adopt a small size S-box, for example, a 4-bit S-box or an 8-bit S-box, in order to avoid inefficiency when it is implemented. Hence, computing all the possibilities is usually feasible. In detail, the attacker computes Equation (4.33) for all the choices of the input difference c4-math-0347 and the output difference c4-math-0348. Equations (4.17)–(4.32) show the probabilities of the differential propagation when c4-math-0349 is fixed to 5 and c4-math-0350 is unfixed. To complete it, the analysis is iterated by changing c4-math-0351 for all the possibilities.

Owing to the redundancy, the detailed analysis is omitted. The result is shown in Table 4.4. The row with c4-math-0353 corresponds to Equations (4.17)–(4.32). Table 4.4 is called a differential distribution table. Hereafter, the differential distribution table is denoted by DDT. Each entry of the DDT represents the number of values that satisfies

of the corresponding c4-math-0355 and c4-math-0356. The probability of the differential propagation is obtained by dividing the number in each entry with the number of possible values of x, that is, c4-math-0358. This indicates that the differential propagation whose entry is 4 occurs with a higher probability than the others.

Table 4.4 Differential distribution table of c4-math-0352

Output difference
0 1 2 3 4 5 6 7 8 9 A B C D E F
0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 2 0 0 2 0 0 0 2 2 2 4 0 0 2
2 0 0 0 2 2 2 0 2 0 0 4 2 0 0 2 0
3 0 0 2 0 0 2 2 2 2 0 0 0 0 0 2 4
4 0 0 0 2 0 0 2 0 0 2 0 4 0 2 2 2
5 0 2 4 2 0 0 2 2 0 2 2 0 0 0 0 0
6 0 2 0 0 0 4 0 2 0 2 0 0 2 2 2 0
Input 7 0 0 0 2 2 2 2 0 2 4 0 0 2 0 0 0
difference 8 0 2 2 4 2 2 0 0 0 0 0 0 0 2 0 2
9 0 0 0 2 0 0 0 2 4 0 2 0 2 2 0 2
A 0 2 0 0 2 0 0 4 2 2 0 2 0 0 0 2
B 0 0 2 0 2 0 2 2 0 0 0 2 2 4 0 0
C 0 0 2 0 2 0 0 0 2 2 2 0 0 2 4 0
D 0 4 2 2 0 0 0 0 2 0 0 2 2 0 2 0
E 0 2 0 0 4 0 2 0 0 0 2 0 2 0 2 2
F 0 2 0 0 0 2 4 0 2 0 2 2 0 2 0 0

The DDT of c4-math-0359 has several properties.

  1. Each entry is even: When c4-math-0360, where c4-math-0361, satisfies the differential propagation in Equation (4.51), c4-math-0362) always satisfies Equation (4.51). Hence, each entry of DDT is always an even number.
  2. Deterministic propagation for zero difference: c4-math-0363 means that the pair has an identical value. Thus, the output value is also identical. When c4-math-0364 is c4-math-0365 with probability 1.
  3. Minimizing differential probability: To avoid a high probability differential propagation, each entry of DDT should be as small as possible. Combining the above-mentioned two properties, the best design strategy of c4-math-0366 against the differential cryptanalysis is having one entry with 4 and six entries with 2 in all the rows and columns.

The S-box used in AES has the similar property to c4-math-0367. Because the input and the output size of the AES S-box is 8 bits, or 256, the DDT of the AES S-box has 256 rows and 256 columns. Owing to its large size, the exact DDT is omitted in this book. Two important properties are summarized as follows.

 

 

 

As an application to AES, the probability of the differential propagation for one round is explained below, which is described in Figure 4.12.

c4f012

Figure 4.12 Differential propagation for AES one round

The analysis starts from two input values to the c4-math-0378 operation in round i denoted by state c4-math-0380. The input difference c4-math-0381 is set to have a nonzero byte difference a in the third row of the second column, that is,

4.52 equation

Then, the S-box is applied to all bytes in the state by the c4-math-0384 operation. From Lemma 4.2.8, for any nonzero input difference, there exists one output difference that will be produced with probability c4-math-0385. Denote the output difference by b. Thus, the difference of the output state c4-math-0387 is

4.53 equation

and the probability of the differential propagation is as follows:

4.54 equation

The propagation from c4-math-0390 to c4-math-0391 is the same as the one in Figure 4.11. Then, with probability 1, the difference of the state c4-math-0392 becomes as follows:

4.55 equation

In the end, the following differential propagation with probability c4-math-0394 is obtained for AES one round.

4.56 equation

4.2.6 Probability of Differential Propagation for Multiple Rounds

Equation (4.33) in the definition of the probability of the differential propagation can be computed only if the computation size is small, that is, the value of z in Equation (4.33) is small. Namely, it can be evaluated for the 4-bit to 4-bit mapping c4-math-0397 or the 8-bit to 8-bit mapping of the AES S-box S, while it cannot be evaluated for a 128-bit to 128-bit mapping of the entire AES operation. The goal of the attacker is attacking as many rounds as possible, thus the analysis for a larger map is necessary.

When a differential propagation for multiple rounds is evaluated, the differential cryptanalysis iteratively applies the analysis for a single round by assuming that the probability of the differential propagation can be evaluated independently for each round. The validity of this assumption comes from the fact that the internal state value is XORed by an unknown subkey in every round. Suppose that all subkeys are chosen accordingly to the uniform distribution. Then, between two c4-math-0399 operations, the internal state value becomes uniformly random owing to the subkey XOR, which makes the probability evaluation of the two c4-math-0400 operations independent. Note that the key schedule function of AES is not so strong that c4-math-0401 and c4-math-0402 can be completely random. In this sense, the assumption of the independent probability evaluation in different rounds is not true. However, to make the discussion simple, it is usually assumed that each subkey is chosen uniformly randomly. Hereafter, the same assumption is applied in thisbook.

An example analysis for AES reduced to two rounds (for round i and round c4-math-0404) is illustrated in Figure 4.13. The analysis for round i is the same as Figure 4.12, and another round is appended after the last state in round i.

c4f013

Figure 4.13 Differential propagation for AES two rounds

By following the assumption of the independence in different rounds, the probability of the differential propagation in round c4-math-0407 is evaluated independently from the one in round i. For each nonzero input difference to the S-box, c4-math-0409, and c4-math-0410, Lemma 4.2.8 ensures that there exists one output difference that will be produced with probability c4-math-0411. Let c4-math-0412, and e be those output differences from the S-box. There are 4 bytes with a nonzero difference, and the probability that the propagation is achieved in all bytes simultaneously is obtained by multiplying the probability of each event. Thus,

4.57 equation

After the c4-math-0415 operation, the remaining is the linear computation, and thus the differential propagation is determined with probability 1. The probability of the differential propagation in round c4-math-0416 shown in Figure 4.13 is concluded as:

4.58 equation

Finally, the probability of the differential propagation for two rounds is obtained by multiplying the probability for round i and for round c4-math-0419. Thus,

4.59 equation

If the assumption of independence between different rounds is not used, the probability for round c4-math-0421 must be a conditional probability that the input value is the output of round i, that is,

4.60 equation

Evaluating the conditional probability especially for many rounds is hard (computationally infeasible). To make the analysis simple and effective, the differential cryptanalysis usually assumes the independence of differential propagations in different rounds.

4.2.7 Differential Characteristic for AES Reduced to Three Rounds

In the differential cryptanalysis, the attacker first chooses a pair of an input difference and an output difference that will be propagated with a high probability. How the difference will propagate in the attack between the chosen differences is called differential characteristic.

As explained so far, the probability of the differential characteristic decreases only by the c4-math-0424 operation. A byte with nonzero difference through the c4-math-0425 operation is called an active byte with respect to the difference, or simply an active byte. The attack strategy is choosing active-byte positions so that the number of active bytes is minimized.

Regarding AES, a differential characteristic with a relatively high probability, c4-math-0427, can be constructed up to three rounds, which is described in Figure 4.14. Its details are explained below. AES adopts different round functions for the middle rounds and the last round. In the differential cryptanalysis, the attacker later appends several rounds after the differential characteristic in order to recover the key. When the differential characteristic is constructed, only the round function for the middle rounds is considered.

c4f014

Figure 4.14 Differential characteristic for AES three rounds with probability c4-math-0426

The last two rounds of the differential characteristic in Figure 4.14 are the same as the ones in Figure 4.13. The analysis starts from the single active byte at state c4-math-0428 whose difference is denoted by a. This is propagated to b after the c4-math-0431 operation with a probability c4-math-0432. After the c4-math-0433 operation in round 2, a single active byte expands to 4 active bytes, and then those derive four differential propagation with probability c4-math-0434 for the c4-math-0435 operation in round 3. The remaining computations in round 3 are linear computations, and thus the attacker obtains the corresponding difference at state c4-math-0436 with probability 1.

Then, another round is appended to those two rounds. If one more round is appended in the end of the two rounds, that is, as round 4, the number of active bytes will increase by 16 bytes, which is inefficient. Therefore, another round is appended to the beginning of those two rounds, that is, as round 1. The attacker computes the propagation of the difference c4-math-0437 in the backward direction. The c4-math-0438 operation simply computes XOR of the subkey c4-math-0439 and the state value c4-math-0440. As shown in Lemma 4.2.4, the difference never changes with the constant XOR, which derives the following difference in state c4-math-0441.

4.61 equation

The inverse c4-math-0443 operation is then applied. No difference exists for the first, second, and the third columns. Thus, the difference after the inverse c4-math-0444 operation is also 0. For the fourth column, the difference is computed as follows.

4.62 equation

As a result, the difference of the state c4-math-0446 becomes as

4.63 equation

In the inverse c4-math-0448 operation, each byte in row j, where c4-math-0450, is rotated by j bytes to the right. This makes the difference of the state c4-math-0452 as

4.64 equation

From Lemma 4.2.9, for any nonzero output difference of the S-box, there exists one input difference that is achieved with probability c4-math-0454. Let c4-math-0455, and i be the input differences to the S-box such that

4.65 equation
4.66 equation
4.67 equation
4.68 equation

This makes the difference of the state c4-math-0461 as

4.69 equation

Finally, another c4-math-0463 operation is inverted, which does not affect the differential propagation. The plaintext difference c4-math-0464 is the same as c4-math-0465, that is,

4.70 equation

As explained in the previous section, the total probability of the three-round differential characteristic in Figure 4.14 is the multiplication of the probability of each round evaluated independently, which is

4.71 equation

 

4.2.8 Distinguishing Attack with Differential Characteristic

The three-round differential characteristic in Figure 4.14 can directly be used to attack the security notion of indistinguishability against AES reduced to three rounds. The attack is called a distinguishing attack. For simplicity, suppose that the attack model is the chosen plaintext attack, in which the attacker can query the plaintext of his choice to observe the corresponding ciphertext.

Recall Figure 4.2 that shows the indistinguishability framework. The attacker (observer) interacts with a 128-bit permutation that is either AES reduced to three rounds with an unknown key or a 128-bit random permutation. By observing plaintexts and ciphertexts, the attacker aims to distinguish which is implemented in the oracle. The output of the distinguisher is a single bit called a determining bit. If the attacker finds that AES reduced to three rounds is implemented, the distinguishing attack outputs a single bit 0 as the determining bit. If the attacker finds that a random permutation is implemented, the distinguishing attack outputs a single bit 1 as the determining bit.

In the attack procedure, the attacker queries c4-math-0470 plaintext pairs with a difference c4-math-0471 in Figure 4.14, and then checks whether or not one of the corresponding ciphertext pairs has a difference c4-math-0472 in Figure 4.14.

  • If the oracle implements AES reduced to three rounds, one of the pairs is expected to satisfy the differential characteristic with probability c4-math-0473.
  • If the oracle implements a random permutation, the probability that the ciphertext difference becomes c4-math-0474 is c4-math-0475 per pair. With a negligible probability, an event with probability c4-math-0476 is satisfied by examining c4-math-0477 pairs.

Therefore, if one of the ciphertext pairs has the difference c4-math-0478, the attack returns 0 as the determining bit. Otherwise, it returns 1 as the determining bit. In Algorithm 4.4, the attack procedure is given in an algorithmic format.

The attack complexity of the distinguishing attack is evaluated as follows.

  • The data complexity is c4-math-0492 chosen plaintexts.
  • The time complexity is c4-math-0493 XOR computational cost.
  • The attack does not need to store intermediate values during the attack but for 1 ciphertext c4-math-0494. Thus, the memory complexity is 1, or negligible.

Note that when the event with probability c4-math-0495 is examined by c4-math-0496 trials, the expectation number of the success is 1, but it does not ensure the success with probability 1. The success probability of the distinguishing attack can increase by spending more data and time complexities.

 

4.2.9 Key Recovery Attack after Differential Characteristic

Although the security of block cipher can be broken by the distinguishing attack, the attacker cannot recover the key value with the distinguishing attack. The differential cryptanalysis can also be used to recover the key. In general, compared to distinguishing attacks, key recovery attacks can attack more rounds while the attack complexity is higher.

The attacker appends a few more rounds to the end of the distinguisher, and the attacker aims to recover the last subkey value. The framework of the key recovery attack is illustrated in Figure 4.15. The key recovery attack starts from collecting several pairs of plaintexts satisfying the differential characteristic. Because a few more rounds are appended to the end of the distinguisher, the attacker cannot identify the pairs satisfying the differential characteristic. Hence, all the pairs are analyzed to recover the key. The pairs satisfying the differential characteristic are called right pairs, while the pairs not satisfying the differential characteristic are called wrong pairs. At the end of the differential characteristic, right pairs have the prespecified difference denoted by c4-math-0498. The attacker exhaustively guesses the last subkey value and performs the partial decryption until the output state of the differential characteristic. The attacker then checks whether or not the difference of the intermediate state values is c4-math-0499.

c4f015

Figure 4.15 Framework of the key recovery attack

Here, the analytic results behave differently for right pairs and wrong pairs. If the pair is the right one and the subkey guess is right, the results of the state difference are always c4-math-0500. In any other combination of right/wrong pair and right/wrong guess, such a deterministic event does not occur. The result of the partial decryption happens to be c4-math-0501 probabilistically, which is much lower probability than 1. Therefore, by analyzing many pairs including right pairs and wrong pairs, the right guess reaches c4-math-0502 more than any other wrong guess, which allows the attacker to detect the right subkey value. The analysis is summarized below.

  1. Right pair with c4-math-0503:
    • Right guess always reaches c4-math-0504.
    • Wrong guess reaches c4-math-0505 only probabilistically.
  2. Wrong pair:
    • Right guess reaches c4-math-0506 only probabilistically.
    • Wrong guess reaches c4-math-0507 only probabilistically.

As an exact procedure to recover the last subkey, the attacker draws the histogram describing how many times each key guess reaches c4-math-0508 after the partial decryption. The histogram is illustrated in Figure 4.16. Because the right guess reaches c4-math-0509 more than any other wrong guess, it makes the peak in the histogram, which shows the subkey value to the attacker.

c4f016

Figure 4.16 Histogram of subkey guess reaching c4-math-0510

Note that as shown in Figure 4.16, there might exist wrong key guesses that are close to the peak value. Moreover, the right guess might not be the peak value. However, this is not a big issue for the attack. The attacker can test several key candidates that are in a high position in the histogram. This method is called the ranking test. By using the ranking test, identifying several key candidates that are likely to be a correct key is sufficient.

From the recovered last subkey, the attacker recovers the original key K. AES uses the original key K as the first subkey c4-math-0513. Because the key schedule function, KSF, is easily invertible, the attacker can compute the corresponding value of c4-math-0514 from any subkey by computing the inverse of the key schedule function as illustrated in Figure 4.17. Note that in many block ciphers, the key schedule function is designed in order to avoid the loss of the computation efficiency. Thus, the key schedule function is usually invertible, and recovering a subkey is sufficient to recover the original key K in many block ciphers including AES.

c4f017

Figure 4.17 Converting subkey value to original key value

4.2.10 Basic Differential Cryptanalysis for Four-Round AES c4-math-0516

This section explains the key recovery attack against AES reduced to four rounds. One round is appended to the end of the three-round differential characteristic in Figure 4.14. The key recovery part of this attack is depicted in Figure 4.18. Note that to describe the subkey byte positions in detail, the figure of the round function changes from Figure 4.14. In addition, note that the last round function does not compute the c4-math-0517 operation.

c4f018

Figure 4.18 Key recovery attack against four-round AES

All bytes in the c4-math-0518 operation in round 4 are active. After the c4-math-0519 operation in round 4, the output difference is nonzero. The attacker does not know the exact difference but only knows that those bytes are active. In Figure 4.18, these type of bytes are filled in gray.

4.2.10.1 Filtering for Collecting Pairs

The first phase of the attack is collecting plaintext pairs that may follow the three-round differential characteristic in Figure 4.14. Because the probability of the three-round differential characteristic is c4-math-0520, making at least c4-math-0521 pairs of queries is necessary.

Here, the technique called filtering is introduced in order to maximize the attack efficiency. The purpose of filtering is to remove the pairs that cannot satisfy the differential characteristic with probability 1, which contributes to reducing the number of wrong pairs. To apply the filtering technique, more detailed properties of the S-box need to be considered.

Lemma 4.2.8 in Section 4.2.5 shows that for any fixed input difference, 129 output differences are never produced. In other words, only 127 output differences can be produced. As shown in Figure 4.18, the output difference of the c4-math-0522 operation in round 4, that is, c4-math-0523 can be obtained directly from the ciphertext difference. Then, with the property of the S-box, the attacker can check whether or not the ciphertext difference in each byte is included in the 127 possible output differences from the S-box. The probability that each byte difference is included in the 127 possible output differences is c4-math-0524. Thus, with 16 bytes, the probability is

4.72 equation

The probability that a randomly generated ciphertext pair is a candidate of the one satisfying the differential characteristic is called filtering power, which is often denoted by a variable c4-math-0526. As discussed earlier, the filtering power c4-math-0527 of this attack is

4.73 equation

4.2.10.2 Signal-to-Noise Ratio

The number of necessary right pairs to recover the key depends on the value called signal-to-noise ratio, which is often denoted by c4-math-0529.1 In the histogram of the key suggestion in Figure 4.16, regarding the correct key, the number of key suggestions consists of two contributions. One is suggestion from the right pairs, which is called signal, and the other is suggestion from the wrong pairs, which is called noise. When the ratio of the signal to noise is big enough, the key is recovered. The concept of the signal-to-noise ratio is depicted in Figure 4.19.

c4f019

Figure 4.19 Signal-to-noise ratio

Suppose that the attacker queries N chosen plaintext pairs, and the probability of the characteristic is p. In addition, suppose that the bit size of the subkey guess is k and the filtering power of the attack is c4-math-0534. In the following, the amount of signal and noise is evaluated and their ratio is calculated. Note that the numbers for the attack in Figure 4.18 are c4-math-0535, and c4-math-0536.

  1. Signal: Signal is the right key suggestion from right pairs. For each right pair, the partial decryption with the right guess is performed once. Hence, the amount of signal is equal to the amount of the right pair. Because N pairs are queried and the probability of the characteristic is p, the amount of signal is
    4.74 equation
  2. Noise: Noise is the right key suggestion from wrong pairs. (In the attack in Figure 4.18, the combination of the right pair and the wrong guess never suggests the right key.) The number of wrong pairs is
    4.75 equation

    for small p. After the filtering technique is applied,

    4.76 equation

    wrong pairs remain. Then, the number of key suggestions (including both right and wrong ones) from each remaining wrong pair is counted. By following the convention, let c4-math-0543 be this number. The total number of key suggestions from all wrong pairs can be evaluated as

    4.77 equation

    When it comes to the attack in Figure 4.18, the evaluation of c4-math-0545 is done in each byte. From Lemma 4.2.8 in Section 4.2.5, for 126 difference values, two key values are suggested, and for one difference value, four key values are suggested. Roughly speaking, two keys are suggested for each byte. In the attack in Figure 4.18, 8 subkey bytes are guessed. Thus, c4-math-0546 is the number of all the combinations of two suggestions for each of the 8 bytes, that is,

    4.78 equation

    Finally, the amount of the right key suggestions out of c4-math-0548 wrong suggestions is counted. It is assumed that wrong suggestions are generated according to the uniform distribution. Because the bit size of guessed subkeys is k, the probability that a randomly generated wrong suggestion is for the right key is c4-math-0550. All in all, the amount of noise is represented by

    4.79 equation
  3. c4-math-0552: By calculating the ratio of the signal to noise, c4-math-0553 is represented as follows:
    4.80 equation
    4.81 equation

    It is known that when c4-math-0556 is bigger than 1, collecting two right pairs is enough to identify the right key by using the ranking test.

4.2.10.3 Collecting Pairs

The signal-to-noise ratio of the attack in Figure 4.18 is as follows:

4.84 equation

Because c4-math-0560 is big enough, two right pairs are enough to recover the key. From the condition c4-math-0561, the number of queried messages is c4-math-0562 pairs, which is c4-math-0563 encryption oracle calls.

For the obtained ciphertext pairs, the filtering technique is applied, that is, the attacker confirms that the ciphertext difference in each byte can be produced from c4-math-0564. The pairs that do not satisfy the filtering are immediately discarded. The filtering power c4-math-0565 is c4-math-0566. After the filtering, the number of remaining pairs becomes

4.85 equation

4.2.10.4 Recovering the Last Subkey

Let c4-math-0568 for c4-math-0569 be the obtained ciphertext pairs. The attacker exhaustively guesses the left two columns of the last subkey value c4-math-0570, and partially decrypts each ciphertext pair up to state c4-math-0571. With the guessed value of 8 bytes of c4-math-0572, 8 bytes of c4-math-0573 can be computed by taking XOR with the ciphertext pair. The c4-math-0574 operation can be easily inverted because it only changes the byte positions. For the 8 computed bytes in c4-math-0575, the c4-math-0576 operation can be inverted by looking up the inverse S-box. As a result, 8 bytes of c4-math-0577 can be computed. The computed byte positions are stressed by bold line in Figure 4.18.

To generate a histogram of the key suggestion, the attacker prepares a memory to store counter values for all the c4-math-0578 8-byte values of c4-math-0579. All the counter values are initialized to 0 at the beginning. If the difference of the partially decrypted 8 bytes in c4-math-0580 matches the output difference from the differential characteristic, the attacker increases the counter for the corresponding 8-byte value of c4-math-0581. After the analysis for all the pairs and all the 8-byte guesses of c4-math-0582, the guess of c4-math-0583 with the highest counter value is the right value. Hence, 8 bytes of c4-math-0584 are successfully recovered.

4.2.10.5 Recovery of the Key

Independently, the attack applies the last subkey recovery procedure for the right two columns of c4-math-0585, that is, c4-math-0586. The correspondence of the guessed byte positions and the ones in c4-math-0587 is shown in Figure 4.20. The pair collection part can be shared with the analysis for the left half of c4-math-0588. Only the subkey recovery part is independently processed of the left half.

c4f020

Figure 4.20 Recovery of the right half of c4-math-0589

By combining the recovered values of the left half and the right half, c4-math-0590 is fully recovered. Then, by computing c4-math-0591 from c4-math-0592 with the inverse of the key schedule function as illustrated in Figure 4.17, the original key K is successfully recovered.

4.2.10.6 Attack Procedure

The entire attack procedure is described in Algorithm 4.5. Here, c4-math-0594 and c4-math-0595 are variables to denote 8-byte guesses for the left half of c4-math-0596 and the right half of c4-math-0597, respectively.

4.2.10.7 Complexity Evaluation

In Algorithm 4.5, queries are made only in step 4, which is c4-math-0653 pairs of c4-math-0654. Thus, the number of query is c4-math-0655 chosen plaintexts.

Regarding the pair collection phase, the computational cost is c4-math-0656 XOR computations. The memory requirement is storing c4-math-0657 pairs of c4-math-0658, which is c4-math-0659 AES state values. The computational cost and the memory requirement are negligibly small compared to the subkey recovery part.

Regarding the left half of the c4-math-0660 recovery phase, the computational cost is c4-math-0661 AES round function computations. The memory requirement is storing counter values for c4-math-0662 subkey candidates. The same computational cost is required for the recovery of the right half of c4-math-0663. No additional memory is required for the right half of c4-math-0664 because the memory used for the analysis on the left half can be overwritten.

Recovering K only requires a negligible cost compared to the other steps. In the end, the computational cost for the entire attack is c4-math-0666 AES round function computations for the left half of c4-math-0667 and c4-math-0668 AES roundfunction computations for the right half of c4-math-0669, which is c4-math-0670 AES round function computations. The computational cost is often measured by how many times the entire encryption algorithm is computed. Because the entire structure consists of four rounds, the cost of one round is c4-math-0671 of the entire structure. The attack complexity is c4-math-0672 computations of AES reduced to four rounds.

In summary, the attack complexity is as follows.

This is significantly smaller than the generic attack complexity in Equation (4.6), that is, c4-math-0674. Therefore, AES reduced to four rounds are vulnerable against the differential cryptanalysis.

4.2.11 Advanced Differential Cryptanalysis for Four-Round AES c4-math-0675

The above simple differential cryptanalysis can be improved so that the attack requires a much smaller cost. The bottleneck of the attack complexity lies in recovering c4-math-0676. Two techniques to improve this part are introduced in this section.

4.2.11.1 Minimizing Guessed Subkey Size

To recover the key in the differential cryptanalysis, keeping the signal-to-noise ratio, c4-math-0677, high enough is important. The number of the guessed subkey bytes is heavily related to the derivation of c4-math-0678. Recall Equations (4.82) and (4.83). c4-math-0679 is enough to make the attack efficient, while the current c4-math-0680 ratio is too high. Hence, the number of the guessed subkey bytes can be reduced, which contributes to reducing the attack complexity. In Figure 4.18, 8 bytes of c4-math-0681 are guessed, that is, c4-math-0682. Here, the new attack guesses only 6 bytes of c4-math-0683. The guessed subkey byte positions and the partial decryption up to c4-math-0684 are shown in Figure 4.21.

c4f021

Figure 4.21 Key recovery with 6-byte guess of c4-math-0685

The new c4-math-0686 ratio becomes

4.87 equation
4.88 equation
4.89 equation

which is bigger than 1.

Another improvement is that after the 6 bytes of c4-math-0690 are recovered, the attack does not have to iterate the same procedure for the other 10 bytes. The recovered 6 bytes of c4-math-0691 can be used to filter out wrong pairs. Given the fixed subkey value c4-math-0692, the probability that c4-math-0693 becomes the target byte difference at c4-math-0694 is c4-math-0695. Thus, the number of wrong pairs after the filtering with recovered 6 subkey bytes is

4.90 equation

which indicates that only two right pairs will survive after the filtering. Therefore, once 6 bytes of c4-math-0697 are recovered, the other 10 bytes of c4-math-0698 can be recovered trivially, and its complexity can be ignored.

4.2.11.2 Deriving Key Suggestions without Guess

In the basic attack, 8 bytes of c4-math-0699 are exhaustively guessed, and then the corresponding differences at c4-math-0700 are computed. If the computed differences at c4-math-0701 do not match the target, no key suggestion can be obtained. In other words, this is a waste of the computation power.

This procedure can be modified so that only computations contributing to the key suggestion are performed.

The procedure is the same until c4-math-0702 wrong pairs are obtained after the filtering technique. Recall the procedure of applying the filtering technique. For each ciphertext pair, the attacker computes the corresponding difference at state c4-math-0703 and checks if all byte differences can be produced by c4-math-0704 specified by the differential characteristic. An important fact here is that both of the input and output difference for S-boxes in round 4 are determined without determining the subkey values c4-math-0705.

Recall Lemmas 4.2.8 and 4.2.9, which specify the property of the AES S-box. When an input difference c4-math-0706 and an output difference c4-math-0707 for the S-box with nonzero probability are given, they have two solutions (values satisfying the differential propagation of the S-box) with probability c4-math-0708 and four solutions with probability c4-math-0709. Here, the new strategy is preparing the look-up table c4-math-0710 that takes a pair of c4-math-0711 as input and returns all values x such that c4-math-0713 as shown in Figure 4.22.

c4f022

Figure 4.22 Look-up table returning all solutions for S-box

The procedure to obtain key suggestions for a pair of ciphertexts c4-math-0714 is explained below.

  1. The difference is computed from c4-math-0715 to c4-math-0716, and the filtering technique is applied to eliminate wrong pairs.
  2. With the look-up table c4-math-0717, obtain all combinations of solutions for each S-box. Because each byte has about two solutions, the attacker obtains about c4-math-0718 combinations of the solutions for each byte.
  3. For each of the c4-math-0719 combined solutions, the values of the 6 bytes of c4-math-0720 are fixed. The key suggestions for 6 bytes of c4-math-0721 are obtained by computing
    4.91 equation

    Note that c4-math-0723 suggests the same key value, thus does not have to be computed.

The procedure is illustrated in Figure 4.23.

c4f023

Figure 4.23 Efficient key suggestions derivation

4.2.11.3 Attack Procedure

The updated attack procedure is described in Algorithm 4.6. The pair collection phase is not included in Algorithm 4.6. Instead, the attacker derives the suggestions as soon as each pair satisfying the filtering condition is obtained. This is another optimization of the attack. Unfortunately, because the pair collection phase is not the bottleneck of the attack complexity, this optimization does not contribute to reducing the entire attack complexity. However, the technique is useful when the fault analysis is improved with theoretical cryptanalytic techniques in Chapter 6.

4.2.11.4 Complexity Evaluation

In Algorithm 4.6, queries are made in the same manner as Algorithm 4.5. Thus, the number of queries is the same as Algorithm 4.5, which is c4-math-0772 chosen plaintexts.

Regarding the procedure for recovering the first 6 bytes of c4-math-0773, the computational cost is c4-math-0774 XOR computations in step 5. After the filtering technique is applied in step 6, only c4-math-0775 pairs are examined. Therefore, step 10 requires c4-math-0776 AES one-round computation. The memory requirement is for storing c4-math-0777 counter values and c4-math-0778 pairs of c4-math-0779.

The procedure after recovering c4-math-0780 is at most c4-math-0781, which is much smaller than the other part. Thus, the computational cost for the entire attack is c4-math-0782 XOR computations.

In summary, the attack complexity is as follows.

4.92 equation

Compared to the attack complexity for the basic attack in Equation (4.86), the complexity of the advanced attack is improved significantly.

4.2.12 Preventing Differential Cryptanalysis c4-math-0784

The essence of the differential cryptanalysis is a differential characteristic satisfied with a high probability. In other words, by avoiding a high probability differential characteristic, the differential cryptanalysis can be prevented. As explained so far, the probability of the differential characteristic decreases only when a difference goes through the S-box. Let c4-math-0785 be the maximum probability of the differential propagation in a single S-box. Let c4-math-0786 be the total number of active S-boxes in a characteristic. Then, the maximum probability of the differential characteristic is bounded by

4.93 equation

In AES, from Lemma 4.2.8, the maximum probability of the differential propagation in a single S-box is c4-math-0788. Thus, the entire probability of the differential characteristic is bounded by

4.94 equation

On the one hand, the differential cryptanalysis needs to collect at least one pair of plaintext to satisfy the differential characteristic. Thus, the attack on AES needs to query at least c4-math-0790 pairs. On the other hand, the number of texts that the attack can query is upper-bounded by c4-math-0791, where b is the bit-length of the block size. For AES, b is 128. Therefore, satisfying the differential characteristic of AES becomes impossible if the number of active S-boxes, c4-math-0794, satisfies the following condition:

4.95 equation
4.96 equation

AES was designed so that

4.97 equation

is guaranteed for four rounds. Therefore, the full-round (10-round) AES is expected to resist the differential cryptanalysis even if a few rounds are appended for the key recovery part around the differential characteristic. The strategy of proving the number of minimum active S-boxes in AES is called a wide trail strategy.

4.2.12.1 Wide Trail Strategy for Four-Round AES

The rough sketch of the wide trail strategy is introduced below. A differential propagation for four rounds, from round i to round c4-math-0799, is considered. Those four rounds are illustrated in Figure 4.24. As long as two different plaintexts are encrypted under the same key, each internal state has nonzero difference in at least 1 byte.

c4f024

Figure 4.24 Proof of minimum number of active S-boxes for AES four rounds. Gray byte shows an example of the differential propagation for c4-math-0800 and c4-math-0801

The analysis starts from 1 active column for the c4-math-0802 operation in round c4-math-0803. To complete the proof, four cases starting from 1 to 4 active columns must be evaluated. In this book, only the case with one active column is explained. The analysis is irrespective of the position of the one active column. In Figure 4.24, the second column is chosen as an example.

From the property of the MDS matrix in the c4-math-0804 operation, the sum of the number of active bytes before and after the c4-math-0805 operation is at least 5. Let c4-math-0806 and c4-math-0807 be the number of active bytes before the c4-math-0808 operation, c4-math-0809, and after the c4-math-0810 operation, c4-math-0811, respectively. Then, the following condition is obtained.

Those derive c4-math-0813 active S-boxes for the c4-math-0814 operation in round c4-math-0815 and c4-math-0816 active S-boxes for the c4-math-0817 operation in round c4-math-0818. At this stage, together with Equation (4.98),

4.99 equation

is proven for AES reduced to two rounds.

Consider propagating the difference at c4-math-0820 in the forward direction. c4-math-0821 active bytes in c4-math-0822 are located in one column. Those move to different columns by the next c4-math-0823 operation in round c4-math-0824. In other words, the probability that several active bytes move to the same column is ensured to be 0. Therefore, at state c4-math-0825, there are c4-math-0826 active columns with 1 active byte. After the subsequent c4-math-0827 operation, those make 4 bytes active in c4-math-0828 columns. Finally, c4-math-0829 active bytes are ensured for the c4-math-0830 operation in round c4-math-0831.

Consider propagating the difference at c4-math-0832 in the backward direction. c4-math-0833 active bytes in c4-math-0834 are located in one column. Those move to different columns by the next inverse c4-math-0835 operation in round c4-math-0836. Therefore, at state c4-math-0837, there are c4-math-0838 active columns with 1 active byte. After the next inverse c4-math-0839 operation, those make 4 bytes active in c4-math-0840 columns. Finally, c4-math-0841 active columns are ensured for the c4-math-0842 operation in round i.

As a result, the number of active S-boxes, c4-math-0844, for AES reduced to four rounds is at least

4.100 equation

From Equation (4.98), the following result is obtained.

4.101 equation

As explained before, it ensures that the maximum number of rounds of the differential characteristic for AES that can be used for the attack is 3. The differential characteristic in Figure 4.14 is an example of this case. It also indicates that breaking full-round AES with the differential cryptanalysis is almost impossible.

4.2.12.2 Recent Design Trend and Role of Differential Cryptanalysis

Most of the recent block cipher designs have some security proof so that the cipher can resist the basic differential cryptanalysis. Hence, the theoretical attack with the differential cryptanalysis is impossible for those designs.

The differential cryptanalysis is a base of many other advanced cryptanalytic techniques. Thus, learning its mechanism is useful to learn other attacks. Moreover, when the attacker can exploit the fault injections, the differential cryptanalysis becomes one of the most powerful approaches owing to its simplicity. Differential cryptanalysis combined with fault analysis will be explained in Chapter 6.

4.3 Impossible Differential Cryptanalysis

4.3.1 Basic Concept and Definition

There are several cryptanalyses using an impossible event of the encryption or decryption algorithm. Cryptanalysis with impossible differential propagation was independently found by Knudsen and Biham and Shamir. It exploits a differential propagation that is never satisfied.

An example of impossible differential characteristic is zero input difference and nonzero output difference, that is,

4.103 equation

Similarly, when F is a bijective function, the differential propagation from nonzero input difference to zero output difference is impossible, that is,

4.104 equation

The basic idea to utilize an impossible differential characteristic in order to recover the key is as follows, which is also illustrated in Figure 4.25. Suppose that there is a plaintext pair c4-math-0860 and the corresponding ciphertext pair c4-math-0861. In addition, suppose that c4-math-0862, that is, c4-math-0863 is an impossible differential characteristic with respect to F. To recover the key, the attacker exhaustively guesses the last subkey value and partially decrypts C and c4-math-0866 until the output state of F. If the difference of the partially decrypted results becomes c4-math-0868, the subkey guess is wrong, and it can be removed from subkey candidates. The attack recovers the right key by eliminating all wrong subkey guesses.

c4f025

Figure 4.25 Mechanism of impossible differential cryptanalysis

A comparison of the differential cryptanalysis and the cryptanalysis with impossible differential characteristic is given below.

  • In the differential cryptanalysis, the attacker aims to construct a differential characteristic that is satisfied with a high probability, and aims to detect the right key from the obtained key suggestions.
  • In the cryptanalysis with impossible differential propagation, the attacker aims to construct a differential characteristic that is satisfied with probability 0, and aims to discard all the wrong guesses from the obtained key suggestions.

The analysis is often termed impossible differential cryptanalysis. In this book, the term impossible differential cryptanalysis is used by following the convention of the cryptographic community.

As shown in Figure 4.25, the attack consists of two parts:

  • constructing impossible differential characteristic, and
  • appending several rounds for recovering subkey value.

4.3.2 Impossible Differential Characteristic for 3.5-round AES

Impossible differential characteristics can be constructed for 3.5 rounds of AES. Here, 0.5 round represents a composition of the c4-math-0869 and c4-math-0870 operations. 3.5 rounds cover from state c4-math-0871 to c4-math-0872 as shown in Figure 4.26.

c4f026

Figure 4.26 Impossible differential characteristic for 3.5-round AES. Gray bytes denote active bytes. During the differential trace in forwards, active bytes are colored in light gray. During the differential trace in backwards, active bytes are colored in dark gray

The input difference c4-math-0873 to 3.5 rounds has nonzero difference only in 1 byte. The active byte can be located in any position. In Figure 4.26, the byte position c4-math-0874 is chosen as an example. The input difference c4-math-0875 is described as follows:

4.105 equation

where c4-math-0877 represents a nonzero difference, that is, c4-math-0878. Similarly to the differential cryptanalysis, a byte with nonzero difference is called active.

The output difference c4-math-0879 from 3.5 rounds also has nonzero difference only in 1 byte. The active byte can be located in any position. In Figure 4.26, the byte position c4-math-0880 is chosen as an example. The output difference c4-math-0881 is described as follows.

4.106 equation

where c4-math-0883 represents a nonzero difference independent of c4-math-0884.

The impossible differential characteristic in Figure 4.26 can be formally summarized in the following lemma.

 

4.3.2.1 Another Impossible Differential Characteristic for 3.5-Round AES

The form of the output difference of the 3.5-round impossible differential characteristic c4-math-0928 can be chosen from many other choices. For example, the number of active bytes can be increased up to 12 bytes:

4.121 equation

The characteristic is described in Figure 4.27. Owing to the similarity to the previous 3.5-round impossible differential characteristic, the detailed proof is omitted. In short, the 1.5-round computation in the backward direction from c4-math-0930 always makes 4 bytes inactive, which contradicts to the result of the two-round computation in the forward direction from state c4-math-0931.

c4f027

Figure 4.27 Another impossible differential characteristic for 3.5-round AES

It is hard to conclude which of the 3.5-round impossible differential characteristics is stronger. The attacker needs to carefully choose which 3.5-round impossible differential characteristic is used to optimize the entire attack.

4.3.3 Key Recovery Attacks for Five-Round AES

To demonstrate how the key recovery part works, the simple attack for AES reduced to five rounds is explained. In this attack, one round is added as the key recovery part before the 3.5-round impossible differential characteristic in Figure 4.27. The attack supposes that the AES last round function is used in the last round of the reduced-round variant. The attack structure is described in Figure 4.28. The attack first aims to recover 4 bytes of the first subkey c4-math-0932.

c4f028

Figure 4.28 Key recovery attack for five-round AES

In Figure 4.28, the c4-math-0933 operation is added to the end of the 3.5-round distinguisher. Because the c4-math-0934 operation does not change the difference, the 3.5-round impossible differential characteristic can be extended to include the ciphertext difference of the form

4.122 equation

The input difference to the 3.5-round impossible differential characteristic is propagated in the backward direction by one round. It determines the active-byte positions of the plaintext, which are represented as

4.123 equation

The exact value of c4-math-0937 can be any nonzero value, and can be determined independently for 4 bytes. For simplicity, the following discussion assumes that c4-math-0938 is fixed to one choice of the above form, and the attack is later optimized by relaxing this assumption.

4.3.3.1 Collecting Pairs

The first phase of the attack is collecting many pairs of plaintexts whose corresponding ciphertext difference satisfies the form of c4-math-0939. For simplicity, the attack assumes the chosen plaintext attack model so that the attacker can always choose the pair of plaintexts with the specified difference c4-math-0940. Let c4-math-0941 be the number of plaintext pairs queried to the encryption oracle. The probability that a randomly chosen pair has the difference c4-math-0942 at the ciphertext is c4-math-0943 because inactive 4 bytes (32 bits) must have difference zero. Thus, the number of pairs satisfying c4-math-0944 is

4.124 equation

4.3.3.2 Recovery of Subkey c4-math-0946

The attacker aims to derive wrong key suggestions that generate c4-math-0947 at the input state to the 3.5-round impossible differential characteristic. Because the c4-math-0948 operation does not change the difference, computing c4-math-0949 is sufficient, which avoids guessing the subkey value c4-math-0950.

The simple method is guessing the 4 bytes of c4-math-0951, and applying the partial encryption from c4-math-0952 to c4-math-0953. However, as explained in the advanced differential cryptanalysis, wrong key suggestions can be derived more efficiently. Because the c4-math-0954 operation with c4-math-0955 does not change the difference, c4-math-0956. c4-math-0957 is chosen by the attacker, thus c4-math-0958 is known to the attacker for each pair.

The attacker then chooses the difference of the active byte at state c4-math-0959. It can be any value but for 0, thus chosen from 255 choices. For each of the 255 choices of c4-math-0960, the corresponding difference c4-math-0961 is uniquely computed by applying the inverse c4-math-0962 and the inverse c4-math-0963 operations. The 255 results of c4-math-0964 are stored in a look-up table c4-math-0965, where c4-math-0966. More precisely, c4-math-0967 contains a 4-byte difference of c4-math-0968, which is derived from c4-math-0969 with active-byte difference value i.

The values of the pair that maps the fixed c4-math-0971 to each of the 255 c4-math-0972 stored in c4-math-0973 can be easily obtained by exploiting the property of the AES S-box. From Lemmas 4.2.8 and 4.2.9, for a randomly fixed input difference and an output difference of the S-box, the number of paired values that can achieve this propagation is as follows.

  • two paired values with probability c4-math-0974,
  • four paired values with probability c4-math-0975, and
  • the propagation is impossible (0 paired value) with probability c4-math-0976.

For each plaintext pair with a fixed c4-math-0977, the match with c4-math-0978 is examined for c4-math-0979 with respect to four active S-boxes. The expected number of solutions for one pair is

4.125 equation

By examining 255 c4-math-0981, 255 paired values that map the fixed c4-math-0982 to the desired c4-math-0983 are expected.

With the plaintext pair c4-math-0984 and the state value pair c4-math-0985, the corresponding subkey value c4-math-0986 can be computed by simply XORing those values, that is,

4.126 equation
4.127 equation

Those two values lead to the impossible differential characteristic, and thus known to be wrong. The attacker can discard those two values from candidate values for c4-math-0989. Note that the above-mentioned procedure derives c4-math-0990 values of c4-math-0991. However, each value is counted twice. Thus, the number of distinct values of c4-math-0992 is 255. By using 255 paired values of the internal state c4-math-0993, 255 wrong key values are discarded. The idea of the efficient key derivation is summarized in Figure 4.29.

c4f029

Figure 4.29 Efficient derivation of wrong subkey suggestions

4.3.3.3 The Number of Plaintext Pairs

After the pair collection phase, the attacker obtains c4-math-0994 pairs that also satisfy the output difference c4-math-0995. Because each pair can derive 255 wrong key suggestions of c4-math-0996,

4.128 equation

wrong key suggestions are obtained in total.

What is the minimum value of N to identify the right value of 32-bit subkey c4-math-0999? Obtaining c4-math-1000 wrong key suggestions, that is, c4-math-1001, is not sufficient because the same wrong key can be suggested more than once. More detailed analysis is necessary.

In the impossible differential attack, the attacker first prepares a set of all candidate values for the target subkey. In this attack, the attacker prepares a memory c4-math-1002 of c4-math-1003 entries for 32-bit subkey c4-math-1004, which is used to record the correctness and incorrectness of each subkey value. c4-math-1005 is often called key space or subkey space depending on which is the target of the impossible differential attack. c4-math-1006 is first initialized so that all c4-math-1007 values of c4-math-1008 can be right values. If the attacker obtains wrong key suggestions, the corresponding values are removed from the key space c4-math-1009. The analysis is iterated until the size of the key space c4-math-1010 becomes 1.

The procedure of reducing the key space is illustrated in Figure 4.30. At first, all entries of c4-math-1011 are initialized to a single bit “1,” which represents that the value can be a right key. If the attacker obtains wrong key suggestions, the corresponding bit is replaced with “0,” which represents that the value is not a right key.

c4f030

Figure 4.30 Reducing key space

At the initial stage, the size of the remaining key space is c4-math-1012. By deriving one wrong key suggestion, the size of the remaining key space becomes

4.129 equation

This is a precise evaluation, however, using this metric (with subtraction) for counting the remaining subkey space is hard to deal with the event in which the same wrong key value is suggested more than once. To solve this issue, the impossible differential cryptanalysis often regards that obtaining one wrong key suggestion reduces the subkey space by a factor of

4.130 equation

With this metric, the size of the remaining key space after deriving 1 wrong key suggestion is represented as

4.131 equation

After discarding r wrong key suggestions, the size of the remaining key space becomes

4.132 equation

With c4-math-1018 wrong key suggestions, the size of the remaining key space is not sufficiently reduced as shown below:

4.133 equation

When the number of wrong key suggestions is c4-math-1020, the size of the remaining key space becomes

Equation (4.134) takes c4-math-1022 for c4-math-1023 and c4-math-1024 for c4-math-1025. Therefore, the size of the key space is reduced to 1 by obtaining c4-math-1026 wrong key suggestions. The suitable choice of the number of plaintexts pairs, N, can be obtained by the following inequation:

4.135 equation

which concludes that c4-math-1029 is sufficient, namely, that the number of plaintext pairs should be c4-math-1030.

 

4.3.3.4 Attack Procedure for Recovering c4-math-1033

The description of the attack in an algorithmic form is given in Algorithm 4.7.

4.3.3.5 Complexity Evaluation

In Algorithm 4.7, queries are made only in step 8, which makes queries of c4-math-1072 pairs of chosen plaintexts. The time complexity for the initialization part is at most c4-math-1073, for collecting pairs is c4-math-1074 XOR operations, and for recovery of c4-math-1075 is at most c4-math-1076. Hence, the entire time complexity is c4-math-1077 XOR computations, which is less than c4-math-1078 five-round AES computations. The memory complexity is c4-math-1079 32-bit values for c4-math-1080 32-bit values for c4-math-1081, and c4-math-1082 pairs of plaintexts for L. Therefore, the entire memory complexity is less than c4-math-1084 128-bit values. In summary, the attack complexity for recovering c4-math-1085 is as follows:

4.3.3.6 Recovering Other Bytes of c4-math-1087

After 4 bytes of c4-math-1088 are recovered, the attacker needs to recover the other 12 bytes, or 96 bits. The straightforward method is performing the exhaustive search on the unknown 96 bits. However, this requires c4-math-1089 computations, which is much higher than the complexity of the recovery of c4-math-1090. Although it is already faster than the original exhaustive search on 128 bits, the attack complexity can be further optimized.

The strategy is to change the 3.5-round impossible differential characteristic so that the other 4 bytes of subkey c4-math-1091 can be recovered. Recall Figure 4.26. For the input difference of the 3.5-round impossible differential characteristic, the attacker can choose any active-byte position. Then, the attacker chooses the byte position 4 as the active-byte position, that is,

4.137 equation

This modification impacts the five-round key recovery attack. In detail, the active-byte positions of the plaintext become c4-math-1093 as depicted in Figure 4.31.

c4f031

Figure 4.31 Key recovery attack for five-round AES with different active-byte positions

Consider applying the same attack as the subkey recovery for c4-math-1094 with slightly modifying the active-byte positions of the plaintext according to the 4 bytes in Figure 4.31. The attack procedure is almost the same as the one for c4-math-1095, and thus the details are omitted. However, in this time, 4 bytes of c4-math-1096 are recovered instead of c4-math-1097. The attack complexity to recover 4 bytes of c4-math-1098 is also the same as the one for c4-math-1099, which is c4-math-1100.

By applying the same discussion, using the following c4-math-1101, the other 4 bytes of c4-math-1102 can be recovered with the same complexity.

4.138 equation

After 12 bytes of c4-math-1104 are recovered, the remaining 4 bytes of c4-math-1105 can also be recovered by changing the active-byte position of c4-math-1106 to the first low of the last column. However, applying the exhaustive search on the remaining 4 bytes is faster than iterating the same analysis one more time. In the end, the last 4 bytes can be recovered only with c4-math-1107 computations without any additional data and memory complexities.

In summary, 12 bytes of c4-math-1108 are recovered by iterating the analysis on 4 bytes three times. This increases the data and time complexities three times compared to the 4-byte recovery. The required memory amount does not change because the memory used to recovery the first 4 bytes can be reused during the analysis on the other 4 bytes. After the 12 bytes are recovered, the cost of the exhaustive search on the remaining 4 bytes is negligibly smaller compared to the 12-byte recovery. The entire attack complexity becomes as follows:

4.139 equation

4.3.3.7 Structure Technique to Reduce the Number of Queries

Let us go back to the 4-byte subkey recovery of c4-math-1110 described in Figure 4.28. The attack was first explained under the assumption that the plaintext difference in the 4-byte positions c4-math-1111 was fixed to a single choice. Under this assumption, the attack requires to query c4-math-1112 chosen plaintext pairs.

There is a widely known technique called structure to reduce the data complexity by relaxing this assumption. Remember that the attack principally can work for any differences in the active 4-byte positions c4-math-1113, that is, the differential form is as follows:

The idea of the structure technique is using a set of plaintexts that is closed with respect to the XOR operation. More precisely, the following set c4-math-1115 consisting of c4-math-1116 plaintexts is considered:

4.141 equation

where 12 bytes, denoted by “C” (for constant), are fixed to a prespecified value, say 0, and 4 bytes, denoted by “A” (for active), take all the c4-math-1120 possibilities. Suppose that all the c4-math-1121 plaintexts included in the set c4-math-1122 are queried to the encryption oracle. Then, how many plaintext pairs following the differential form of Equation (4.140) are generated? The difference of any two plaintexts can satisfy the differential form of Equation (4.140) but for the small probability that the difference of at least 1 active byte happens to 0. Here, for the sake of simplicity, such a small probability event is ignored. The number of plaintext pairs generated from c4-math-1123 plaintexts is

4.142 equation

Hence, up to c4-math-1125 pairs can be generated only with c4-math-1126 queries. This is much better than the single difference case that requires c4-math-1127 queries to obtain c4-math-1128 pairs.

In the case of c4-math-1129 recovery attack, c4-math-1130 plaintext pairs are required. Taking c4-math-1131 plaintexts from the set c4-math-1132 and making c4-math-1133 queries is sufficient. This reduces the data complexity of the c4-math-1134 in Equation (4.136) from c4-math-1135 to c4-math-1136. Moreover, the time complexity of the collecting pair part becomes at most c4-math-1137, which is no longer a bottleneck of the attack. The bottleneck is c4-math-1138 complexity for obtaining the wrong key suggestions. In summary, the attack complexity in Equation (4.136) is updated as follows:

4.143 equation

Similarly, the attack complexity for recovering all the 16 bytes is improved as follows:

4.144 equation

4.3.4 Key Recovery Attacks for Seven-Round AES c4-math-1141

The impossible differential cryptanalysis can be extended to seven rounds. The essential difference from the five-round attack is that the 3.5-round impossible differential characteristic is carefully chosen so that the attack complexity can be below c4-math-1142. Compared to the five-round attack, more optimization techniques are introduced. In particular, several input and output differences are considered simultaneously to minimize the data complexity, and the round function for the key recovery is equivalently transformed into another representation to minimize the time complexity.

4.3.4.1 Base of Impossible Differential Characteristics

Several 3.5-round impossible differential characteristics are used for the seven-round attack. One of the choices is shown in Figure 4.32. This is useful to understand the concept of the multiple impossible differential characteristics that will be explained later. Hereafter, the impossible differential characteristic in Figure 4.32 is called basic impossible characteristic.

c4f032

Figure 4.32 3.5-Round basic impossible differential characteristic for seven-round attack

The input difference c4-math-1143 to the basic impossible characteristic is the same as the previously used ones, that is, it has nonzero difference only in 1 byte. In Figure 4.32, the byte position c4-math-1144 is chosen. The input difference c4-math-1145 is described as follows:

4.145 equation

The output difference c4-math-1147 from the basic impossible characteristic has nonzero difference in 3 bytes of a single column. The active column can be located in any column position, and 3 active bytes can be located in any byte position inside the selected column. In Figure 4.32, the rightmost column is selected and the first 3 bytes are active. The output difference c4-math-1148 is described as follows.

4.146 equation

where c4-math-1150 represents a nonzero difference independent of c4-math-1151.

The detailed proof of the impossibility of the differential propagation c4-math-1152 is omitted. In short, c4-math-1153 makes all bytes active in two rounds, while 4 bytes are ensured to be inactive after 1.5-round decryption from c4-math-1154.

4.3.4.2 Multiple Impossible Differential Characteristics

The concept of the multiple impossible differential characteristics considers a set of input difference c4-math-1155-set and a set of output difference c4-math-1156-set such that the differential propagation from any element in the c4-math-1157-set to any element in the c4-math-1158-set is impossible.

In the impossible differential cryptanalysis, key guesses generating input and output differences for the impossible differential characteristic are discarded. Hence, by considering multiple input and output differences, wrong key values can be discarded more quickly than the single difference case.

In the basic impossible differential characteristic, the active-byte position of c4-math-1159 is fixed to the byte position 0. Here, even if the active-byte position of c4-math-1160 is modified, the modified c4-math-1161 and c4-math-1162 are impossible differential transition. This property allows the attacker to consider the c4-math-1163-set consisting of the 16 differences. It does not mean that all of the 16 elements in the c4-math-1164-set can contribute to reducing the data complexity. Each element can reduce the data complexity only when they can speed up wrong key suggestions in the subkey recovery part. The seven-round attack uses the following c4-math-1165-set consisting of four input differences:

4.147 equation

The active-byte positions of c4-math-1167 can also be modified. As long as 1 byte is inactive in c4-math-1168, it forms the impossible differential propagation against any element in the c4-math-1169-set. The seven-round attack uses the following c4-math-1170-set consisting of four output differences:

4.148 equation

4.3.4.3 Appending Subkey Recovery Part

To attack seven rounds, one round and two rounds are added before and after the 3.5-round characteristic, respectively. This locates the 3.5-round characteristic from state c4-math-1174 to state c4-math-1175. The entire structure is shown in Figure 4.33. It assumes the basic impossible differential characteristic in the middle 3.5 rounds. The added rounds can be used for any choice of the input and output differences in the c4-math-1176-set and c4-math-1177-set.

c4f033

Figure 4.33 Key recovery attack for seven-round AES

The backward extension by one round is straightforward and the same as the one in the five-round attack shown in Figure 4.28. It derives 4 active bytes in the plaintext, and 4 bytes of subkey c4-math-1178 are related to the formulation of the impossible differential characteristic from the plaintext difference. The forward extension by two rounds is more complicated. Given the difference c4-math-1179, the difference c4-math-1180 after the next c4-math-1181 operation can take the following three possibilities.

  1. The number of active bytes in the active column of c4-math-1182 is 2.
  2. The number of active bytes in the active column of c4-math-1183 is 3.
  3. The number of active bytes in the active column of c4-math-1184 is 4.

The seven-round attack restricts the form of c4-math-1185 to the case 1 for minimizing the number of involved subkey bytes to be recovered. Indeed by allowing more than 2 active bytes for c4-math-1186, the attack complexity exceeds c4-math-1187, and thus cannot be faster than the exhaustive search for the original 128-bit key. In Figure 4.33, the active-byte positions are the first 2 bytes of the active column.

After c4-math-1188 is set to case 1, the remaining differential propagation until the ciphertext is straightforward. It derives two fully active columns after the c4-math-1189 operation in round 6 and then two fully active diagonals at the ciphertext. In the end, the byte positions c4-math-1190 of the ciphertext are active.

How many subkey bytes are related to the formulation of the multiple impossible differential characteristics from the ciphertext difference? To minimize the attack complexity, the number of related subkey bytes needs to be minimized as much as possible. The seven-round attack requires to introduce another technique for this purpose, which is an equivalent transformation of the subkey addition. Note that the seven-round structure in Figure 4.33 has already applied the technique in round 6.

4.3.4.4 Equivalent Transformation of Subkey Addition

This technique represents the computations of the AES round function in an alternative method. In particular, the order of the linear computations (ShiftRows, MixColumns, AddRoundKey) is exchanged.

To understand the motivation of introducing this technique, it is useful to check a simple extension of two rounds to the end of the 3.5-round distinguisher, and simulate how the subkey recovery part would work. The computation structure is depicted in Figure 4.34. To derive wrong key suggestions, the attacker guesses part of subkeys c4-math-1191 and c4-math-1192, and checks if the difference after the partial decryption up to c4-math-1193 satisfies any of the output difference in the c4-math-1194-set. If the number of guessed subkey bytes is large, the attack complexity is also large. Thus, keeping the number of guessed subkey bytes low is important for the attacker.

c4f034

Figure 4.34 Two-round simple extension after the distinguisher

Owing to the linearity of the c4-math-1195 and c4-math-1196 operations, c4-math-1197 can be computed by c4-math-1198, which implies that any value of c4-math-1199 is not related to the partial decryption up to c4-math-1200, thus the attacker does not have to guess the value of c4-math-1201. Here, how many subkey bytes need to be guessed to compute c4-math-1202 from the ciphertext difference c4-math-1203? In a simple method, 8 bytes of c4-math-1204 and 8 bytes of c4-math-1205, in total 16 bytes, need to be guessed as stressed in Figure 4.34. However, guessing 16 bytes requires c4-math-1206 trials, which is the same cost as the exhaustive search of the original 128-bit key. The motivation of the equivalent transformation is to avoid guessing 8 bytes of c4-math-1207. Indeed, the number of guessed subkey bytes can be reduced to 2 by guessing linearly converted value of c4-math-1208 as implied in Figure 4.33.

The idea to reduce the number of guessed subkey bytes is changing the place of the c4-math-1209 operation. More precisely, the attacker exchanges the order of the c4-math-1210 and c4-math-1211 operations so that the subkey addition is performed before the number of active bytes increases with the c4-math-1212 operation. Because both operations are linear, such a transformation is possible. In Figure 4.35, the transformation is detailed. The top figure describes that the c4-math-1213 operation is applied to state c4-math-1214, and then the subkey c4-math-1215 is XORed to the state. The bottom figure applies a slightly different operation, in which the inverse c4-math-1216 operation is applied to the subkey, and the transformed subkey is XORed to the state before the c4-math-1217 operation. Both computations result in the same state c4-math-1218.

c4f035

Figure 4.35 Equivalent transformation of subkey addition. The order of c4-math-1219 and c4-math-1220 is exchanged

To verify the equivalence of two computations, converting the bottom computation to the top one is easier. The bottom computation in Figure 4.35 is represented as follows:

4.149 equation

For any linear function c4-math-1222 and two input values c4-math-1223, the value of c4-math-1224 is equal to the value of c4-math-1225. Therefore,

4.150 equation
4.151 equation

which is equivalent to the top computation in Figure 4.35. As shown in Figure 4.35, hereafter the internal state after XOR of c4-math-1228 and before the c4-math-1229 operation is denoted by c4-math-1230.

Finally, the last 1.5 rounds of the seven-round attack become as shown in Figure 4.33. By guessing the 8 bytes of c4-math-1231 and 2 bytes of c4-math-1232, the corresponding difference at c4-math-1233 can be computed from each ciphertext pair.

4.3.4.5 Attack Procedure for Recovering Subkey

Collecting Plaintext Pairs

The attack first collects many pairs of plaintexts and the corresponding ciphertexts whose differences satisfy the form of c4-math-1234 and c4-math-1235 in Figure 4.33 by using the structure technique. As previously explained, a structure c4-math-1236 that consists of c4-math-1237 plaintexts is generated for a fixed 12-byte constant C:

4.152 equation

Then, c4-math-1240 plaintext pairs are generated per structure.

Up to c4-math-1241 structures can be constructed by changing the value of 12-byte constant C. Let c4-math-1243 be the number of generated structures. Then, c4-math-1244 plaintext pairs are generated with c4-math-1245 queries. The exact value of N is later determined so that the entire attack complexity is optimized.

The probability that a randomly chosen pair has the difference c4-math-1247 at the ciphertext is c4-math-1248 because inactive 8 bytes (64 bits) must have difference zero. Thus, the number of pairs satisfying c4-math-1249 is

4.153 equation
Deriving Wrong Key Suggestions by Constructing Look-Up Table

From each of the c4-math-1251 obtained pairs, the attacker derives wrong key suggestions about the following 14 subkey bytes c4-math-1252. Wrong key suggestions are efficiently derived by generating the look-up table T.

As explained in Figure 4.29, a wrong key suggestion for c4-math-1254 is obtained for each 1 active-byte difference of c4-math-1255 by checking the solutions of the differential propagation c4-math-1256. For each element in the c4-math-1257-set, there are 255 choices of c4-math-1258. Because the c4-math-1259-set includes 4 elements, there are c4-math-1260 choices of c4-math-1261 in this attack.

With the same reason, a wrong key suggestion for c4-math-1262 is obtained for each 2 active-byte difference of c4-math-1263. The attacker, without the knowledge of the key, can compute the difference c4-math-1264 from ciphertext difference for each pair. For each 2 active-byte difference of c4-math-1265, the corresponding c4-math-1266 is computed. By checking the solutions of the differential propagation c4-math-1267, the value of the 8 active bytes is fixed, and thus the corresponding 8-byte value of c4-math-1268 is obtained. After 8 bytes of c4-math-1269 are recovered, each ciphertext pair can be decrypted until 2 bytes of c4-math-1270.

Similarly, a wrong key suggestion for c4-math-1271 can be efficiently derived from the 2-byte difference c4-math-1272 and 2 byte values and their difference of c4-math-1273. Here, 2-byte difference c4-math-1274 cannot be chosen from all the c4-math-1275 possibilities. The 2-byte difference c4-math-1276 must be chosen so that c4-math-1277 is included in the c4-math-1278-set, that is, the result has zero difference in 1 byte position. The explanation for the basic impossible differential characteristic is given below, in which the inactive byte is located in c4-math-1279. By looking inside the inverse c4-math-1280 operation, the difference of c4-math-1281 is computed as follows:

4.154 equation

For each c4-math-1283 choice of c4-math-1284, there is only one choice of c4-math-1285 to satisfy c4-math-1286. Therefore, the number of 2-byte difference c4-math-1287 satisfying c4-math-1288 is only c4-math-1289. Because the c4-math-1290-set contains four elements, the same discussion can be applied to the other three elements. In the end, the number of valid choices of c4-math-1291 is c4-math-1292. Once c4-math-1293 is fixed from those c4-math-1294 choices, the corresponding difference c4-math-1295 is also fixed. By checking the solutions of the differential propagation c4-math-1296, the value of the 2 active bytes is fixed, and thus the corresponding 2-byte value of c4-math-1297 is obtained.

In summary, the attacker first prepares the look-up table T consisting of c4-math-1299 elements, which contains the information of 14-byte difference of c4-math-1300, c4-math-1301, and c4-math-1302 for c4-math-1303 choices of c4-math-1304 choices of c4-math-1305, and c4-math-1306 choices of c4-math-1307.

Evaluation of the Number of Structures

From each of the c4-math-1308 obtained pairs and each of the c4-math-1309 choices in the look-up table T, a wrong key suggestion for the target 14 bytes is obtained. Therefore, c4-math-1311 wrong key suggestions are obtained. If c4-math-1312 suggestions are enough to reduce the 14-byte (112-bit) subkey space, the target 14 subkey bytes are recovered.

The proper choice of N is now evaluated. From Equation (4.134), with c4-math-1314 wrong key suggestions, the size of the remaining key space for the 112-bit subkey bytes becomes

4.155 equation
4.156 equation

Equation (4.157) takes c4-math-1318 for c4-math-1319 and c4-math-1320 for c4-math-1321. Therefore, the 112-bit subkey space is reduced to 1 by obtaining all wrong key suggestions for c4-math-1322 structures.

4.3.4.6 Complexity Evaluation

The attack generates c4-math-1323 structures, in which each structure requires queries of c4-math-1324 chosen plaintexts. Therefore, the data complexity of the attack is c4-math-1325 chosen plaintexts.

Regarding the computational cost, the attack needs to deal with c4-math-1326 ciphertexts received by the encryption oracle for collecting pairs. The cost for generating look-up table T is around c4-math-1328 computations, which is negligibly small compared to the other part. The attack derives c4-math-1329 wrong key suggestions. The cost for deriving one suggestion is about one-round encryption and two round decryptions, which is about c4-math-1330 seven-round AES computations. Therefore, the cost for deriving c4-math-1331 wrong key suggestions is less than c4-math-1332 seven-round AES computations, which is the bottleneck of the computational cost.

The largest memory amount is for recording the validity/invalidity of each subkey value in the 112-bit subkey space, which is less than c4-math-1333 128-bit state values.

In summary, the attack complexity for recovering 112-bit subkey value is as follows:

4.158 equation

4.3.4.7 Recovering Original Secret Key

The procedure for recovering the original 128-bit key is very simple. After the above subkey recovery, 64 bits of c4-math-1335 are recovered. The number of remaining unknown key bits of c4-math-1336 is 64 bits. The attacker can perform the exhaustive search on those 64 bits of c4-math-1337. For each guess, the original 128-bit secret key c4-math-1338 can be computed with the inverse of the key schedule function, and the correctness of the guess can be confirmed with a pair of plaintext and ciphertext. The cost for the exhaustive search on the 64 bits of c4-math-1339 is around c4-math-1340 seven-round AES computations, which is negligibly small compared to the 112-bit subkey recovery attack.

4.4 Integral Cryptanalysis

The origin of the integral cryptanalysis was the one proposed by Daemen et al. against Square block cipher. The design of AES is similar to the one for the Square block cipher. In this section, the integral cryptanalysis against AES is explained.

4.4.1 Basic Concept

Remember that the differential cryptanalysis is motivated by the property that the difference of two values never changes by XORing an identical unknown secret value, and the propagation of the difference through the linear computations can be simulated with probability 1. Those properties allow a particular difference to appear with higher probability than other differences.

The motivation of the integral cryptanalysis is exploiting different properties that can hold with a high probability with respect to the frequently used computations in block ciphers.

AES is a byte-oriented cipher, which means that the computation inside the round function is defined bytewise. On the basis of this fact, the integral analysis considers processing a set of 256 plaintexts in which 1 byte takes all possibilities among 256 plaintexts, and all the other bytes are fixed to an identical value among 256 plaintexts. First of all, a set c4-math-1341 consisting of 256 plaintexts are defined as follows:

where each of c4-math-1343 is a constant value fixed before the analysis. The set c4-math-1344 is also depicted in Figure 4.36. The set c4-math-1345 is an unordered set, that is, the order of each element in the set is not distinguished. For example, the sets c4-math-1346 and c4-math-1347 are regarded to be the same. The only important point is that each of c4-math-1348 is included in the set c4-math-1349 exactly once.

c4f036

Figure 4.36 Basic set of plaintexts for integral cryptanalysis

In the integral cryptanalysis, the byte in which all values appear exactly once among all the texts in the set is called the all property, and is often denoted by c4-math-1350. Similarly, the byte in which all texts in the set have an identical value is called the constant property, and is often denoted by c4-math-1351. With those notations, the property of the set c4-math-1352 is written as c4-math-1353.

The set c4-math-1354 shows several interesting properties when it is processed by the computations adopted in AES under the same key, which will be detailed below.

4.4.2 Processing c4-math-1355 through Subkey XOR

Because the first operation of AES is an XOR of the plaintext and the first subkey, the status of the set c4-math-1356 after the subkey XOR is firstly analyzed. Namely, the subkey c4-math-1357 is XORed to each of the 256 plaintexts in the set c4-math-1358. Here, it is assumed that the key value does not change for encrypting 256 plaintexts in the set. This updates the set c4-math-1359 to c4-math-1360. c4-math-1361 is also described in Figure 4.37.

c4f037

Figure 4.37 Plaintexts set after XORing subkey c4-math-1362

Regarding the byte position j, where c4-math-1364, the 256 plaintexts originally have the same value c4-math-1365. Now the value is updated to c4-math-1366. The important property is that c4-math-1367 is a fixed value, although its value is unknown to the attacker because of c4-math-1368. For example, the value of c4-math-1369 can be represented by another constant c4-math-1370. Clearly, all the jth byte positions (c4-math-1372) in the updated state satisfy the constant property.

Regarding the byte position c4-math-1373, the 256 plaintexts originally vary to take all the 256 values (all property). By XORing an unknown constant c4-math-1374 to all of the 256 texts, the property that all the 256 values appear among 256 texts still holds with probability 1. Remember that the set considered in the integral analysis is an unordered set. Thus, changing the order of elements inside the set does not affect the analysis. It is concluded that the byte position 0 in the update state satisfies the all property.

4.4.3 Processing c4-math-1375 through c4-math-1376 Operation

The next operation of AES is the c4-math-1377 operation, which applies the 8-bit to 8-bit S-box to each byte of the state. Here, the status of the set c4-math-1378 after the c4-math-1379 operation is analyzed. This updates the set c4-math-1380 to c4-math-1381. c4-math-1382 is also described in Figure 4.38.

c4f038

Figure 4.38 Plaintexts set after the c4-math-1383 operation

Two properties of the S-box are related to the analysis.

  • S-box is a bijective mapping from c4-math-1384 to c4-math-1385.
  • S-box is a deterministic mapping. It always maps the same input value to the same output value.

Regarding the byte positions j, where c4-math-1387, the 256 plaintexts originally have the same value c4-math-1388. Now the value is updated to c4-math-1389. Because the S-box is a deterministic mapping, c4-math-1390 is a fixed value among all the 256 texts in the set. All the jth byte positions (c4-math-1392) in the updated state satisfy the constant property.

Regarding the byte position c4-math-1393, the 256 plaintexts originally vary to take all the 256 values (all property). Owing to the bijective property of the S-box, the output of the S-box also varies to take all the 256 values, although the order of the values is changed. It is concluded that the byte position 0 in the update state satisfies the all property.

4.4.4 Processing c4-math-1394 through c4-math-1395 Operation

The c4-math-1396 operation of AES only exchanges the byte positions. It does not operate the data inside each byte. Because the integral analysis only exploits the property inside each byte, the c4-math-1397 operation never affects the property used in the integral cryptanalysis.

4.4.5 Processing c4-math-1398 through c4-math-1399 Operation

Because the c4-math-1400 operations is not closed in each byte, that is, it mixes the values of 4 bytes, the analysis is not simple in general. If there is at most 1 byte with the all property in each column, the analysis is simple. Here, the status of the set c4-math-1401 after the c4-math-1402 operation is first analyzed. This updatesthe set c4-math-1403 to c4-math-1404. c4-math-1405 is also described in Figure 4.39.

c4f039

Figure 4.39 Plaintexts set c4-math-1406 after the c4-math-1407 operation

Regarding the second, third, and the fourth columns, the input value to the c4-math-1408 operation is a fixed value among all the 256 texts. Therefore, the output of the c4-math-1409 operation is also a fixed value among all the 256 texts. For all bytes in the second, third, and the fourth columns, the updated state satisfies the constant property.

Regarding the first column, according to the specification of the c4-math-1410 operation, the 4 output bytes are computed as follows:

The 4 output bytes are composed of the impact from i and the impact from the other three constant values c4-math-1413. Among the 256 texts, the impact from the constant values, which is the second term on the right-hand side of Equation (4.160), is a fixed value. As summarized in Lemma 4.4.2, XORing the constant does not change the all property and constant property. Hence, the property of the output value only depends on the impact from i (the first term on the right-hand side of Equation (4.160). In the input 256 texts, the value of i varies to take all the 256 values (all property). This makes the values of c4-math-1416, and c4-math-1417 vary to take all the 256 values, although the order of the values changes. It is concluded that the 4 output bytes from the first column will have the all property.

The analysis cannot be simple when the number of bytes with the all property is more than 1. The analysis will be explained later when the integral property of AES three rounds is explained.

4.4.6 Integral Property of AES Reduced to 2.5 Rounds

By using the earlier discussions, a certain property can be constructed until 2.5 rounds. The overall structure is given in Figure 4.40. In the following, the transition of the property is explained state by state.

c4f040

Figure 4.40 Integral property for 2.5-round AES

  1. Round 1
  2. Plaintexts: The analysis starts from the set of plaintexts c4-math-1418, which is defined in Equation (4.159).
  3. State c4-math-1419: From Lemma 4.4.1, the subkey XOR maintains the all and constant properties.
  4. State c4-math-1420: From Lemma 4.4.2, the c4-math-1421 operation maintains the all and constant properties.
  5. State c4-math-1422: The byte positions are moved according to the c4-math-1423 operation (no movement in the first row).
  6. State c4-math-1424: As shown in Figure 4.39, all bytes in the right three columns maintain the constant property and a single byte with the all property in the input state expands to 4 bytes in the first column.
  7. State c4-math-1425: From Lemma 4.4.1, the subkey XOR maintains the all and constant properties.
  8. Round 2
  9. State c4-math-1426: From Lemma 4.4.2, the c4-math-1427 operation maintains the all and constant properties.
  10. State c4-math-1428: The byte positions are moved according to the c4-math-1429 operation. All columns come to contain a byte with the all property.
  11. State c4-math-1430: As the same principle of the first column in Figure 4.39, for all columns, a single byte with the all property in the input state expands to 4 bytes in the first column. As a result, bytes with the constant property disappear and all bytes will show the all property.
  12. State c4-math-1431: From Lemma 4.4.1, the subkey XOR maintains the all property.
  13. Round 2.5
  14. State c4-math-1432: From Lemma 4.4.2, the c4-math-1433 operation maintains the all property.
  15. State c4-math-1434: The byte positions are moved according to the c4-math-1435 operation.

Finally, it was shown that the set of plaintexts c4-math-1436 will provide the all property in all 16 bytes after 2.5 rounds.

4.4.7 Balanced Property

In Figure 4.40, the following question naturally rises.

Does any property remain after the c4-math-1437 operation is applied to state c4-math-1438 in Figure 4.40?

Actually, the answer is “Yes.” However it is no longer the all property or the constant property. The computation from the state c4-math-1439 to c4-math-1440 is identical for all columns, thus analyzing that a single column is enough. Moreover, the analysis is almost the same among all the 4 output bytes of the column. Here, the property of the first output byte is analyzed in detail. According to the specification of the c4-math-1441 operation, c4-math-1442 is computed by the following equation:

4.161 equation

Remember that the analysis initially starts from a set of 256 plaintexts c4-math-1444, where c4-math-1445. Let c4-math-1446 be 4 input bytes to the c4-math-1447 operation corresponding to c4-math-1448. Owing to the 2.5-round integral property, it is ensured that all of the 4 bytes c4-math-1449 show the all property, that is, the value of c4-math-1450 takes all possibilities by collecting all c4-math-1451, and the same is applied to c4-math-1452, and c4-math-1453. The important fact here is that the all property for each of 4 bytes was derived independently from each other. In other words, no relation is guaranteed among the values of different byte positions in the same text.

There is some probability that 4 independent input bytes for different texts c4-math-1454 and c4-math-1455 will result in the same output value. Hence, the “all” property cannot be ensured for c4-math-1456. It is also easy to see that the constant property cannot be ensured for c4-math-1457.

The idea of the new property is computing the XOR sum of all the 256 texts, that is, c4-math-1458. The details of this computation are as follows:

4.162 equation
4.163 equation
4.164 equation

In the third equality of the above transformation, the fact that each byte satisfies the all property and the fact that c4-math-1462 are used.

In summary, c4-math-1463 satisfies the property that the XOR sum of all the 256 texts is 0, that is, c4-math-1464. This property is called balanced property, and often denoted by c4-math-1465. The same discussion can be applied to the other bytes of c4-math-1466. Thus, all the bytes of c4-math-1467 satisfy the balanced property.

4.4.8 Integral Property of AES Reduced to Three Rounds and Distinguishing Attack

By using the balanced property, the integral property for three-round AES can be constructed, which is shown in Figure 4.41.

c4f041

Figure 4.41 Integral property for three-round AES

From Figure 4.40, the c4-math-1468 operation is applied to c4-math-1469, making all the bytes of c4-math-1470 balanced. With the last c4-math-1471 operation for c4-math-1472, the XOR sum of each byte is further XORed by c4-math-1473 256 times. As long as the number of texts in the original set is an even number, the effect of XORing the same constant is canceled out. In the end, the last c4-math-1474 operation does not break the balanced property, making all bytes of the ciphertext balanced.

The distinguishing attack is now easily constructed for AES three rounds in the chosen plaintext model. The goal of the attacker is identifying which of the AES three rounds or a random permutation is implemented by the oracle. The attacker prepares the set of 256 plaintexts c4-math-1475, and queries all of the 256 plaintexts to the oracle. The attacker then computes the XOR sum of each byte of the received ciphertexts and checks whether the sum is 0 or not. If all the bytes satisfy the balanced property, the oracle implements the AES reduced to three rounds. Otherwise, it implements the random permutation.

Attack Procedure

The attack procedure in the algorithmic form is described in Algorithm 4.8.

Complexity Evaluation

The attack makes 256 queries. Thus, the data complexity of this attack is 256 chosen plaintexts. The computational cost is updating c4-math-1484 value 256 times, which is 256 XOR operations. The required memory is only for storing c4-math-1485 value, which is negligibly small. In summary, the complexity of this attack is c4-math-1486, where “c4-math-1487” stands for negligible.

Success Probability

As long as the oracle implements the AES three rounds, the attack successfully returns the determining bit 0 with probability 1.

When the oracle implements a random permutation, the XOR sum of each byte may happen to be 1 with a low probability. The probability that the XOR sum of randomly generated 256 byte values happens to be 0 is c4-math-1488. The probability that this event happens for all the 16 bytes at the same time is c4-math-1489, which is negligibly small.

Hence, the distinguishing attack successfully distinguishes the AES three rounds from a random permutation.

4.4.9 Key Recovery Attack with Integral Cryptanalysis for Five Rounds

On the basis of the three-round integral property, a key recovery attack can be mounted against AES reduced to five rounds. The attack appends two rounds after the three-round integral property, which makes the structure shown in Figure 4.42. The attacker guesses the part of the last two subkeys c4-math-1490 and c4-math-1491 and performs the partial decryption up to c4-math-1492. The correct guess always achieves the balanced property in all bytes of c4-math-1493, which enables the attacker to reduce the key space.

c4f042

Figure 4.42 Key recovery attack against five-round AES. Guessed 4 bytes of c4-math-1494 and 4 bytes of c4-math-1495 are stressed by bold lines. With those guesses, several bytes of the internal state marked by light gray color can be computed

Collecting Plaintexts

The attacker prepares sets of 256 plaintexts c4-math-1496. As explained later, the analysis guesses 64 bits of subkeys, and each set of 256 plaintexts c4-math-1497 can reduce the subkey space by a factor of c4-math-1498. In order to reduce the subkey space to 1, two sets of 256 plaintexts c4-math-1499 are required. Those c4-math-1500 plaintexts are passed to the encryption oracle, and the attacker obtains the corresponding two sets of c4-math-1501 ciphertexts.

Recovery of c4-math-1502 and c4-math-1503

With the obtained two sets of c4-math-1504 ciphertexts, the attacker recovers the values of c4-math-1505 and c4-math-1506. The 4 bytes of c4-math-1507 and the 4 bytes of c4-math-1508, in total 64-bit subkey space, are reduced to 32 bits with the analysis of the first set of c4-math-1509 plaintexts. Then, the subkey space is further reduced to 1 by using the second set of c4-math-1510 plaintexts. The guessed subkey bytes are marked by bold line in Figure 4.42.

With a guess of c4-math-1511 and c4-math-1512, the attacker can compute the corresponding 4 bytes of c4-math-1513 by taking XOR of the ciphertext and the guess of c4-math-1514 for all the 256 ciphertexts in the first set. The inverse of the c4-math-1515 operation moves the computed byte positions into c4-math-1516, and the corresponding 4 bytes of c4-math-1517 can be computed with the inverse of the S-box. The guessed c4-math-1518 allows the attacker to compute the corresponding 4 bytes of c4-math-1519. Because all values in a column are computed, the corresponding 4 bytes of c4-math-1520 are computed with the inverse of the c4-math-1521 operation. The next inverse of the c4-math-1522 operation moves the computed byte positions into c4-math-1523, and the corresponding 4 bytes of c4-math-1524 can be computed with the inverse of the S-box.

The value of c4-math-1525 is computed for all the c4-math-1526 texts in the first set. To check if the balanced property is satisfied, the XOR sum of all the c4-math-1527 texts is computed for 4 bytes of c4-math-1528. If the results are 0 in all bytes, that is,

the subkey guess of c4-math-1530 is a correct subkey candidate. For this case, the guess is stored in a list c4-math-1531. If at least 1 byte of c4-math-1532 does not satisfy the balanced property, the subkey guess is wrong. For this case, the subkey guess is not stored and is discarded immediately.

The correct guess always satisfies Equation (4.165). Besides the correct guess, several wrong guesses happen to satisfy Equation (4.165) probabilistically. The probability that randomly chosen 4 byte values become 0 is c4-math-1533. Therefore, with trying c4-math-1534 guesses, c4-math-1535 wrong guesses are stored in the correct subkey candidates list c4-math-1536, In other words, with the analysis of the first set, the subkey space is reduced from c4-math-1537 to c4-math-1538, by 32 bits.

The same analysis is iterated again by using the c4-math-1539 ciphertexts in the second set. This time, the subkey guess of c4-math-1540 is chosen from the list c4-math-1541, thus the number of guesses is c4-math-1542 rather than c4-math-1543 in the analysis for the first set. The subkey space is reduced by another 32 bits, which makes the number of subkey candidates about 1.

Recovery of Original Key

The same analysis can be performed to recover other subkey bytes of c4-math-1544 and c4-math-1545. With iterating the analysis twice,

  • 8 bytes of c4-math-1546 and
  • 8 bytes of c4-math-1547

are recovered. As explained in the previous section, the original key c4-math-1548 can be recovered with any other subkey. The remaining unknown bytes of c4-math-1549 are the 4 bytes of c4-math-1550. The attacker recovers those 4 bytes with the exhaustive search. Note that, if the subkey candidates for c4-math-1551, and c4-math-1552 were not reduced to 1, but several candidates are remaining, the correct candidates can be guessed together with the exhaustive search of c4-math-1553.

Attack Summary

The attack is a chosen plaintext attack. The data complexity of this attack is c4-math-1554 chosen plaintexts. The computational cost for constructing two sets of c4-math-1555 plaintexts is c4-math-1556 computations, which is negligible compared to the key recovery part. For recovering c4-math-1557, in the analysis of the first set, the two-round decryption is performed for each of the c4-math-1558 subkey guesses and c4-math-1559 ciphertexts in the set. Hence, the computational cost for analyzing the first set is c4-math-1560 round function computations, which corresponds to c4-math-1561 five-round AES computations. The computational cost for the second set is cheaper than the one for the first set by a factor of c4-math-1562 because only about c4-math-1563 candidates remain in c4-math-1564. The computational cost for the recovery of c4-math-1565 is two more iterations of the analysis for different columns and the exhaustive search on 32 bits and several remaining candidates. The exhaustive search on 32 bits is much cheaper than the cost for the other part. As a result, the time complexity of this attack is c4-math-1566 five-round AES computations.

The reduced subkey space c4-math-1567 requires to store c4-math-1568 8-byte information, which is equivalent to c4-math-1569 AES states. The other part is negligibly small. As a result, the memory complexity of this attack is c4-math-1570 AES states.

In summary, the complexity of this attack is c4-math-1571.

4.4.10 Higher-Order Integral Property c4-math-1572

The integral property for three rounds only uses 256 plaintexts. A natural approach to improve the attack is increasing the number of plaintexts to attack more rounds. The approach is called higher-order integral cryptanalysis.

Remember that the values of the 15 bytes with the constant property in the set of plaintexts c4-math-1573 in Figure 4.36 can be fixed to any value. The higher-order integral cryptanalysis generates several sets of plaintexts by chaining the values of bytes with the constant property. Suppose that two sets of 256 plaintexts c4-math-1574 and c4-math-1575 are generated. For the first set c4-math-1576, the byte position 1 is fixed to 0. For the second set c4-math-1577, the byte position 2 is fixed to 0. Then, those 512 plaintexts are queried to the oracle with AES reduced to three rounds, and the attacker obtains the corresponding 512 ciphertexts.

Suppose that the order of the 512 ciphertexts is mixed in an unknown manner to the attacker, that is, the attacker does not know which of the first or second set each ciphertext belongs to. What property can be ensured for 512 ciphertexts in this situation?

The higher-order integral property computes the XOR sum of those 512 ciphertexts. As discussed in the previous section, 256 ciphertexts belonging to the first set make the balanced property after AES three rounds that is, the XOR sum for those 256 ciphertexts is 0. Similarly, the XOR sum for the 256 ciphertexts belonging to the second set is 0. Thus, the XOR sum of the 512 ciphertexts always becomes 0 even without knowing which sets each ciphertext belongs to. The analysis is shown in Figure 4.43.

c4f043

Figure 4.43 Idea of the higher-order (second-order) integral property

4.4.10.1 Higher-Order Integral Property of AES Reduced to Four Rounds

To extend the number of attacked rounds by one round, c4-math-1578 sets of 256 plaintexts c4-math-1579 are generated by changing the values of c4-math-1580. To make it precise, for c4-math-1581, the values of c4-math-1582 are fixed to 0 and the byte position 0 takes all the 256 possibilities. For c4-math-1583, the values of c4-math-1584 are fixed to 1 and the byte position 0 takes all the 256 possibilities. For c4-math-1585, the values of c4-math-1586 are fixed to c4-math-1587 and the byte position 0 takes all the 256 possibilities. c4-math-1588 texts are required to construct c4-math-1589. Owing to the same discussion as the two sets case, all c4-math-1590 ciphertexts after three rounds satisfy the balanced property, that is, the XOR sum of all c4-math-1591 ciphertexts is always 0. Then, those c4-math-1592 texts are computed in the backward direction by one round. The analysis is shown in Figure 4.44.

c4f044

Figure 4.44 Higher-order integral property for four-round AES c4-math-1593 sets of 256 plaintexts are generated with c4-math-1594 values of c4-math-1595 at state c4-math-1596. This involves all the c4-math-1597 values for the first column at state c4-math-1598

The c4-math-1599 texts are involving all the c4-math-1600 values for the first column at the state c4-math-1601. In Figure 4.44, 4 gray bytes in the state represent that all c4-math-1602 possible values are included in the set of c4-math-1603 plaintexts. The same text structure is preserved at the state c4-math-1604 after the inverse of the c4-math-1605 operation. The c4-math-1606 operation is a bijective mapping from 32 bits to 32 bits. Hence, the state c4-math-1607 after the inverse of the c4-math-1608 operation has the same property, that is, all the c4-math-1609 values appear in the first column of c4-math-1610. The byte positions are moved at the state c4-math-1611 owing to the inverse of the c4-math-1612 operation. From Lemmas 4.4.1 and 4.4.2, the same property is preserved until the plaintext. In summary, the following property can be obtained for four-round AES.

4.4.11 Key Recovery Attack with Integral Cryptanalysis for Six Rounds c4-math-1618

On the basis of the four-round higher-order integral property, a key recovery attack can be mounted against AES reduced to six rounds. The attack appends two rounds after the four-round higher-order integral property, which makes the structure shown in Figure 4.45. As explained in Figure 4.44, c4-math-1619 plaintexts that take all c4-math-1620 possibilities of the byte position c4-math-1621 will make all bytes at state c4-math-1622 satisfy the balanced property after four rounds. The attacker guesses the part of the last two subkeys c4-math-1623 and c4-math-1624 and performs the partial decryption up to c4-math-1625. The correct guess always achieves the balanced property in all bytes of c4-math-1626, which enables the attacker to reduce the key space.

c4f045

Figure 4.45 Key recovery attack against six-round AES. Guessed 4 bytes of c4-math-1627 and 4 bytes of c4-math-1628 are stressed by bold lines. With those guesses, several bytes of the internal state marked by light gray color can be computed

Collecting Plaintexts

The attacker chooses fixed values for 12 bytes of the plaintext in the byte positions c4-math-1629. The attacker then chooses c4-math-1630 plaintexts in which the 4 bytes in c4-math-1631 take all possibilities, and the other bytes are fixed to the chosen values. Those c4-math-1632 plaintexts are passed to the encryption oracle and the attacker obtains the corresponding c4-math-1633 ciphertexts.

For the key recovery phase, the attacker prepares another set of c4-math-1634 plaintexts by choosing different fixed values of the plaintext in the byte positions c4-math-1635. Those c4-math-1636 plaintexts are also passed to the encryption oracle and the attacker obtains the corresponding c4-math-1637 ciphertexts. In total, the attacker has two sets of c4-math-1638 ciphertexts in the key recovery phase.

Recovery of c4-math-1639 and c4-math-1640

With the obtained two sets of c4-math-1641 ciphertexts, the attacker recovers the value of c4-math-1642 and c4-math-1643. The 4 bytes of c4-math-1644 and 4 bytes of c4-math-1645, in total 64-bit subkey space, are reduced to 32 bits with the analysis of the first set of c4-math-1646 plaintexts. Then, the subkey space is further reduced to 1 by using the second set of c4-math-1647 plaintexts. The guessed subkey bytes are marked by bold line in Figure 4.45.

With a guess of c4-math-1648 and c4-math-1649, the attacker can compute the corresponding 4 bytes of c4-math-1650 by taking XOR of the ciphertext and the guess of c4-math-1651 for all of c4-math-1652 ciphertexts in the first set. The inverse of the c4-math-1653 operation moves the computed byte positions into c4-math-1654, and the corresponding 4 bytes of c4-math-1655 can be computed with the inverse of the S-box. The guessed c4-math-1656 allows the attacker to compute the corresponding 4 bytes of c4-math-1657. Because all values in a column are computed, the corresponding 4 bytes of c4-math-1658 are computed with the inverse of the c4-math-1659 operation. The next inverse of the c4-math-1660 operation moves the computed byte positions into c4-math-1661, and the corresponding 4 bytes of c4-math-1662 can be computed with the inverse of the S-box.

The value of c4-math-1663 is computed for all the c4-math-1664 texts in the first set. To check if the balanced property is satisfied, the XOR sum of all the c4-math-1665 texts is computed for 4 bytes of c4-math-1666. If the results are 0 in all bytes, that is,

the subkey guess of c4-math-1668 can be correct. Then, the guess is stored in a list c4-math-1669. If at least 1 byte of c4-math-1670 does not satisfy the balanced property, the subkey guess is wrong. The subkey guess is not stored and discarded immediately.

The correct guess always satisfies Equation (167). Besides the correct guess, several wrong guesses happen to satisfy Equation (167) probabilistically. The probability that randomly chosen 4 byte values become 0 is c4-math-1671. Therefore, with trying c4-math-1672 guesses, c4-math-1673 wrong guesses are stored in the correct subkey candidates list c4-math-1674, In other words, with the analysis of the first set, the subkey space is reduced from c4-math-1675 to c4-math-1676, by 32 bits.

The same analysis is iterated again by using the c4-math-1677 ciphertexts in the second set. This time, the subkey guess of c4-math-1678 is chosen from the list c4-math-1679, thus the number of guesses is c4-math-1680 rather than c4-math-1681 in the analysis for the first set. The subkey space is reduced by another 32 bits, which makes the number of subkey candidates about 1.

Recovery of Original Key

The same analysis can be performed to recover other subkey bytes of c4-math-1682 and c4-math-1683. With iterating the analysis twice,

  • 8 bytes of c4-math-1684
  • 8 bytes of c4-math-1685

are recovered. As explained in the previous section, the original key c4-math-1686 can be recovered with any other subkey. The remaining unknown bytes of c4-math-1687 are the 4 bytes of c4-math-1688. The attacker recovers those 4 bytes with the exhaustive search. Note that, if the subkey candidates for c4-math-1689, and c4-math-1690 were not reduced to 1, but several candidates are remaining, the correct candidates can be guessed together with the exhaustive search of c4-math-1691.

Attack Procedure

The attack procedure is described in an algorithmic form in Algorithm 4.9.

Attack Evaluation

The attack is a chosen plaintext attack. Queries are made in steps 5 and 7, which requires c4-math-1735 queries for each. Hence, the data complexity of this attack is c4-math-1736 chosen plaintexts.

The computational cost for constructing two sets of c4-math-1737 plaintexts is c4-math-1738 computations, which is negligible compared to the key recovery part. For recovering c4-math-1739, in the analysis of the first set, the two-round decryption is performed for each of the c4-math-1740 subkey guesses and c4-math-1741 ciphertexts in the set. Hence, the computational cost for analyzing the first set (from step 9 to step 17) is c4-math-1742 round function computations, which is c4-math-1743 six-round AES computations. The computational cost for the second set is cheaper than the one for the first set by a factor of c4-math-1744 because only about c4-math-1745 candidates remain in c4-math-1746. The computational cost for the recovery of c4-math-1747 is two more iterations of the 8-byte subkey recovery in different byte positions and the exhaustive search on 32 bits and several remaining candidates in c4-math-1748.

The exhaustive search on 32 bits is much cheaper than the cost for the other part. As a result, the time complexity of this attack is c4-math-1749 six-round AES computations.

Both the sets, c4-math-1750 and c4-math-1751, require a memory to store c4-math-1752 AES states. The reduced subkey space c4-math-1753 also requires to store c4-math-1754 8-byte information, which is equivalent to c4-math-1755 AES states. The other parts are negligibly small. As a result, the memory complexity of this attack is c4-math-1756 AES states.

In summary, the complexity of this attack is c4-math-1757.

Further Reading

  1. Bahrak B and Aref MR 2008 Impossible differential attack on seven-round AES-128. IET Information Security 2(2), 28–32.
  2. Biham E, Biryukov A, Dunkelman O, Richardson E and Shamir A 1999 Initial observations on Skipjack: cryptanalysis of Skipjack-3XOR In Selected Areas in Cryptography 1998 (ed. Tavares S and Meijer H), vol. 1556 of Lecture Notes in Computer Science, pp. 362–375. Springer-Verlag.
  3. Biham E and Keller N 1999 Cryptanalysis of Reduced Variants of Rijndael. The Second AES (Advanced Encryption Standard) Conference.
  4. Biham E and Shamir A 1993 Differential Cryptanalysis of the Data Encryption Standard. Springer-Verlag.
  5. Daemen J, Knudsen LR and Rijmen V 1997 The block cipher Square In Fast Software Encryption 1997 (ed. Biham E), vol. 1267 of Lecture Notes in Computer Science, pp. 149–165. Springer-Verlag.
  6. Knudsen LR 1998 DEAL – A 128-bit cipher. Technical Report, Department of Informatics, University of Bergen, Norway.
  7. Knudsen LR and Wagner D 2002 Integral cryptanalysis In Fast Software Encryption 2002 (ed. Daemen J and Rijmen V), vol. 2365 of Lecture Notes in Computer Science, pp. 112–127. Springer-Verlag.
  8. Suzaki T, Minematsu K, Morioka S and Kobayashi E 2013 c4-math-1760: a lightweight block cipher for multiple platforms In Selected Areas in Cryptography, 19th International Conference, SAC 2012, Windsor, ON, Canada, August 15-16, 2012, Revised Selected Papers (ed. Knudsen LR and Wu H), vol. 7707 of Lecture Notes in Computer Science, pp. 339–354. Springer-Verlag.

 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.204.0