Improved Davies-Murphy's Attack on DES Revisited
Total Page:16
File Type:pdf, Size:1020Kb
Improved Davies-Murphy’s Attack on DES Revisited Yi Lu1⋆ and Yvo Desmedt2⋆⋆ 1 National Engineering Research Center of Fundamental Software, Institute of Software, Chinese Academy of Sciences, Beijing, China 2 The University of Texas at Dallas, USA & University College London, UK Abstract. DES is a famous 64-bit block cipher with balanced Feistel structure. It consists of 16 rounds. The key has 56 bits and the round key has 48 bits. Two major cryptanalysis techniques (namely, linear crypt- analysis and differential cryptanalysis) were notably developed and suc- cessfully applied to the full 16-round DES in the early 1990’s. Davies- Murphy’s attack can be seen as a special linear attack, which was devel- oped before invention of linear cryptanalysis. It was improved by Biham and Biryukov and most recently by Jacques and Muller. In this paper, we revisit the recent improved Davies-Murphy’s attack by Jacques and Muller from an algorithmic point of view. Based on Matsui’s algorithm 2, we give an improved attack algorithm. Our improved attack algorithm works in time (241) with memory (233). In contrast, Jacques-Muller’s attack takes time (243) and memory (235). It seems that our results of the time and memory complexities are optimal, due to the use of Walsh transform. Meanwhile, we generalize and further improve the results of the improved Matsui’s algorithm 2 for the case that the subkeys are XORed into the round function. Keywords: DES, block cipher, Davies-Murphy’s attack, linear crypt- analysis, Matsui’s algorithm 2, Walsh transform 1 Introduction DES is one of the most famous block ciphers [13]. It has been studied for 30 years and is still undergoing the progress of advanced cryptanaly- sis research today. Of the two major cryptanalysis techniques are linear cryptanalysis and differential cryptanalysis. They both proved to be suc- cessful to the full 16-round DES ([2,12]). Besides, another new cryptanal- ysis technique (i.e. algebraic attacks) has emerged since the last decade, which works on 6 rounds of DES [5]. ⋆ Supported by the National Science and Technology Major Project under Grant No. 2012ZX01039-004, and the National Natural Science Foundation of China under Grant No. 61170072. Part of this work done while funded by British Telecommuni- cations under Grant No. ML858284/CT506918. ⋆⋆ Part of this work was done while funded by EPSRC EP/C538285/1 and by BT, as BT Chair of Information Security. Davies-Murphy’s attack [6] can be seen as a special linear attack, which was developed in the 1980’s before invention of linear cryptanalysis (cf. [4]). It was improved by Biham and Biryukov [1] and most recently by Jacques and Muller [9]. For review on Davies-Murphy’s attacks we refer to [9], and we refer to [4] for strengthening DES against Davies-Murphy’s attacks. In this paper, we revisit the improved Davies-Murphy’s attack [9] from an algorithmic point of view. Based on Matsui’s algorithm 2 [3, 7], we give an improved attack algorithm. In summary, our improved attack algorithm works in time (241) with memory (233). In contrast, the attack [9] takes time (243) and memory (235). Due to the use of Walsh transform3, it seems that our results of the time and memory complexities are optimal. Meanwhile, our results generalize and improve the results of the improved Matsui’s algorithm 2 in [3,7] for the case that the subkeys are XORed into the round function. 2 Related Works In Fig. 1, we let 32-bit L0,R0 be the left and right half of the plaintext. Let L16,R16 be the left and right half of the ciphertext. Similarly, Li,Ri denote the left and right half of DES output at Round i. As convention, the initial and final permutation of DES is ignored. The 48-bit subkey used for Round i is denoted by Ki (omitted in Fig. 1). Due to lack of space, we omit the detailed description on DES (cf. [13]). Let α = 0xa100c21 in hexadecimal representation 4. Let the 32-bit Ai be the output of DES round function f at Round i. Define the bias (also called imbalance [8]) of a binary random variable X by | Pr(X = 0)− Pr(X = 1)|. Recall due to Davies and Murphy [6], the bit α·A1 ⊕β ·K1 = −3.4 5 α · (L0 ⊕ L1) ⊕ β · K1 has bias 2 , with the subkey’s mask β = 0xf0. As DES consists of 16 rounds, this one-round characteristics is iterated 8 times in the original Davies-Murphy’s attack [6]. That makes a total bias 2−3.4×8 = 2−27.2 by Piling-up Lemma [12]. Later, Biham and Biryukov [1] proposed to use the technique of partial decryption to work with 15-round DES instead. Thus, the one-round characteristics is iterated 7 times. It makes an enlarged total bias of 2−3.4×7 = 2−23.8. Recently, with the trick 3 Note that Walsh transform and Fourier transform have been useful tools to aid linear cryptanalysis, e.g., [10, 11]. 4 Throughout the paper, we always let bit 0 be the least significant bit. 5 The subkey’s mask β corresponds to the highest 2 bits of the subkey’s 6-bit input to S-box S8 and the lowest 2 bits of the subkey’s 6-bit input to S-box S7. 2 of chosen-plaintext strategy, Jacques and Muller [9] showed that partial decryption actually allows to work with further reduced 13-round DES. It thus makes the increased bias of 2−3.4×6 = 2−20.4. L0 R0 A1 f A2 f f f . f f f A16 f L16 R16 Fig. 1. The untwisted view of DES 3 Our Improved Algorithm for Jacques-Muller’s Core Attack As α·Ai equals the XOR of the four output bits of S-box S7 and the output bit 0,2,3 of S-box S8, let the Boolean function g(ℓ16 ⊕k16) compute the bit α · A16. Here, the 12-bit ℓ16,k16 denote inputs to S-box S7,S8 at Round 16. And ℓ16 is obtained by bit expansion from 10 bits of L16. 3 On the other hand, we let the 24-bit r0,k1 denote inputs to S-boxes S5 − S8 at Round 1. And r0 is obtained by bit expansion from 18 bits of R0. Let the 12-bit ℓ0,k2 denote inputs to both S-boxes S7,S8 at Round 2. And ℓ0 is obtained by bit expansion from 10 bits of L0. We let the Boolean function ′ hk1,k2 (ℓ0,r0)= h(ℓ0 ⊕ k2 ⊕ h (r0 ⊕ k1)) (1) ′ compute the bit α · A2. Here, h (r0 ⊕ k1) maps 12 bits to 12 bits, 5 bits 6 of which can be determined from k1,r0 and we define this function by ′′ h (r0 ⊕ k1). Further, the trick of chosen-plaintext strategy [9] allows to ′ have that the remaining 7 bits of the 12-bit output of h (r0⊕k1) are always fixed, which was considered an intermediate variable of 7 bits (denoted by x herein7) in [9]. For our convenience, we let ′ ′′ h (r0 ⊕ k1)= P (h (r0 ⊕ k1)kx), (2) where k denotes string concatenation and P is the bit permutation func- tion. Given the plaintext and ciphertext pair (L0,R0,L16,R16) (and we use the superscript i to denote each sample), define8 the binary function x α·(R0⊕R16)⊕g(ℓ16⊕k16)⊕hk1,k2 (ℓ0,r0) Fk1,k2,k16 (L0,L16,R0,R16)=(−1) . (3) Clearly, with the correct x,k1,k2,k16, the right-hand side of (3) is equal to (−1)α·(A4⊕A6⊕A8⊕A10⊕A12⊕A14). Jacques-Muller’s core attack idea [9] is shown in Algorithm 1, which aims at partial key-recovery of x,k1,k2,k16. As direct computation of Algorithm 1 is impractical, [9] proposed tech- niques to decompose into several steps: at each step, by guessing a few key bits, some intermediate information can be derived which allows to get rid of the old precomputation table. The optimization techniques [9, Sect. 3.4] solves Algorithm 1 with total time O(243) and the table size 35 O(2 ). It is worth noting that if x,k1,k2,k16 (of 7+24+12+12 = 55 bits in total) were linearly independent, we can apply the improved Matsui’s algorithm 2 in [7, Sect. 4] to solve Algorithm 1 with time O(3 × 55 × 255) and memory O(255). Nonetheless, from the description of DES [13], x,k1,k2,k16 are not linearly independent and [7] is not applicable. Inspired by the improved 6 Because they are bit expansion from 4 bits of S5 − S8 outputs (i.e., output bit 1 of S5, output bit 2 of S6, output bit 3 of S7, output bit 2 of S8) at Round 1. 7 Note that the 7-bit x actually is bit expansion from 6 unknown bits. 8 Note that k1, k2, k16,ℓ0,r0,ℓ16 simply is the bit selection function of K1,K2,K16,L0,R0,L16 with reduced bit length respectively. 4 Algorithm 1 The core partial key-recovery idea of Jacques-Muller’s at- tack [9] for all x, k1, k2, k16 do x uk1,k2,k16 ← 0 x x i i i i compute uk1,k2,k16 = Pi Fk1,k2,k16 (L0,L16,R0,R16), with F defined in (3) end for x output the largest uk1,k2,k16 with x, k1, k2, k16 Matsui’s algorithm 2 [3,7], based on the use of Walsh transform, we now give another algorithm for Jacques-Muller’s core attack [9] in order to compute Algorithm 1 with reduced time and memory.