





















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






















Michael J. Fischer
Lecture 5 January 25, 2010
(^2) Using block ciphers
DES is based on a Feistel network. This is a general method for building an invertible function from any function f that scrambles bits. It consists of some number of stages. Each stage i maps a pair of n-bit words (Li , Ri ) to a new pair (Li+1, Ri+1). (n = 32 in case of DES.) By applying the stages in sequence, a t-stage network maps (L 0 , R 0 ) to (Lt , Rt ). (L 0 , R 0 ) is the plaintext, and (Lt , Rt ) is the corresponding ciphertext.
The security of a Feistel-based code lies in the construction of the function f and in the method for producing the subkeys Ki. The invertibility follows just from properties of ⊕ (exclusive-or). DES uses a 16 stage Feistel network. The pair L 0 R 0 is constructed from a 64-bit message by a fixed initial permutation IP. The ciphertext output is obtained by applying IP−^1 to R 16 L 16. The scrambling function f (Ri , Ki ) operates on a 32-bit data block and a 48-bit key block. Thus, 48 × 16 = 768 key bits are used. They are all derived in a systematic way from the 56-bit primary key and are far from independent of each other.
The scrambling function f (Ri , Ki ) is the heart of DES. It operates on a 32-bit data block and a 48-bit key block (called a subkey. The 56-bit master key k is split into two 28-bit pieces C and D. At each stage, C and D are rotated by one or two bit positions. Subkey Ki is then obtained by applying a fixed permutation (transposition) to CD.
The S-boxes together have a total of 48 input lines. Each of these lines is the output of a corresponding ⊕-gate. One input of each of these ⊕-gates is connected to a corresponding bit of the 48-bit subkey Ki. (This is the only place that the key enters into DES.) The other input of each ⊕-gate is connected to one of the 32 bits of the first argument of f. Since there are 48 ⊕-gates and only 32 bits in the first argument to f , some of those bits get used more than once. The mapping of input bits to ⊕-gates is called the expansion permutation E.
The 32 bits of output from the S-boxes are passed through a fixed permutation P (transposition) that spreads out the output bits. The outputs of a single S-box at one stage of DES become inputs to several different S-boxes at the next stage. This helps provide the desirable “avalanche” effect, where a change in one input bit spreads out through the network and causes many output bits to change.
DES is vulnerable to a brute force attack because of its small key size. However, it has turned out to be remarkably resistant to recently-discovered (in the open world) sophisticated attacks. Differential cryptanalysis: Can break DES using “only” 2^47 chosen ciphertext pairs. Linear cryptanalysis: Can break DES using 2^43 chosen plaintext pairs. Neither attack is feasible in practice.
Start with a known plaintext-ciphertext pair (m, c). Encrypt m and decrypt c using all possible DES keys. We are guaranteed of finding at least one match, since if (k 1 , k 2 ) is the real key pair, then Ek 1 (m) = Dk 2 (c). A matching pair is good if it defines the same encryption function as the real key pair. Otherwise it is bad. We expect roughly ∼ 248 bad pairs. Try each matching pair on a second plaintext-ciphertext pair. Now we expect roughly 2−^16 bad key pairs, so with high probability, any of the remaining pairs are good. Effective key length is then just 2^57 , not hoped-for 2^112. (See Trapp & Washington, §4.7, and Katz & Lindell, pp. 182–184.)
Why do we believe the number of bad pairs is so small? For each key k, Ek maps m and Dk maps c to elements of M = C. (Recall |M| = |C| = 2^64 .) For a key pair (k 1 ′, k 2 ′) the probability that Ek 1 ′ (m) = Dk 2 ′ (c) would be 2−^64 , assuming Ek 1 ′ (m) and Dk′ 2 (c) are uniformly and independently distributed over M. There are 2^112 key pairs, so the expected number of matching pairs would be 2^112 · 2 −^64 = 2^48. Each matching key pair has probability 2−^64 of working with a second plaintext-ciphertext pair (again assuming randomness). The expected number of key pairs that work for both plaintext-ciphertext pairs is 2^48 · 2 −^64 = 2−^16.
Here’s an extreme example to show why one can’t simply assume the birthday attack will succeed. Assume a cryptosystem like DES except that the encryption function is as follows:
Ek (m) =
m if k is even ∼m if k is odd (where ∼ means bitwise complement)
Now, when one tries the birthday attack, exactly half of all key pairs (k 1 , k 2 ) match. Repetitions with a new plaintext-ciphertext pair encoded by the same real key pair do not reduce the number of matches further.
Three key triple DES (3TDES) uses three DES encryptions, i.e., Ek 3 (Ek 2 (Ek 1 (m))), giving it an actual key length of 168 bits. 3TDES can be broken (in principle) by a known plaintext attack using about 2^90 single DES encryptions and 2^113 steps. While this attack is still not practical, the effective security thus lies in the range between 90 and 113, which is much smaller than the apparent 168 bits.^1
(^1) The effective security is the base-2 logarithm of the amount of work to break a cryptosystem. This is the same as the amount of work to carry out a brute force attack on a cryptosystem with keys of that length. Thus, a cryptosystem that can be broken in time 2^90 is said to have 90-bit effective security.