Docsity

Data Encryption Standard, Lecture notes of Computer Science

Toggle sidebar
bg1
Objectives
In this chapter, we discuss the Data Encryption Standard (DES), the modern symmetric-key block
cipher. The following are our main objectives for this chapter:
+ To review a short history of DES
+ To defi ne the basic structure of DES
+ To describe the details of building elements of DES
+ To describe the round keys generation process
+ To analyze DES
The emphasis is on how DES uses a Feistel cipher to achieve confusion and diffusion of bits from the
plaintext to the ciphertext.
6.1 INTRODUCTION
The Data Encryption Standard (DES) is a symmetric-key block cipher published by the National
Institute of Standards and Technology (NIST).
6.1.1 History
In 1973, NIST published a request for proposals for a national symmetric-key cryptosystem. A proposal
from IBM, a modifi cation of a project called Lucifer, was accepted as DES. DES was published in the
Federal Register in March 1975 as a draft of the Federal Information Processing Standard (FIPS).
After the publication, the draft was criticized severely for two reasons. First, critics questioned the
small key length (only 56 bits), which could make the cipher vulnerable to brute-force attack. Second,
critics were concerned about some hidden design behind the internal structure of DES. They were
suspicious that some part of the structure (the S-boxes) may have some hidden trapdoor that would
allow the National Security Agency (NSA) to decrypt the messages without the need for the key. Later
IBM designers mentioned that the internal structure was designed to prevent differential cryptanalysis.
DES was fi nally published as FIPS 46 in the Federal Register in January 1977. NIST, however,
defi nes DES as the standard for use in unclassifi ed applications. DES has been the most widely used
Data Encryption
Standard (DES)
6
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20

Partial preview of the text

Download Data Encryption Standard and more Lecture notes Computer Science in PDF only on Docsity!

Objectives

In this chapter, we discuss the Data Encryption Standard (DES), the modern symmetric-key block

cipher. The following are our main objectives for this chapter:

  • To review a short history of DES
  • To define the basic structure of DES
  • To describe the details of building elements of DES
  • To describe the round keys generation process
  • To analyze DES

T

he emphasis is on how DES uses a Feistel cipher to achieve confusion and diffusion of bits from the

plaintext to the ciphertext.

6.1 INTRODUCTION

The Data Encryption Standard (DES) is a symmetric-key block cipher published by the National

Institute of Standards and Technology (NIST).

6.1.1 History

In 1973, NIST published a request for proposals for a national symmetric-key cryptosystem. A proposal

from IBM, a modification of a project called Lucifer, was accepted as DES. DES was published in the

Federal Register in March 1975 as a draft of the Federal Information Processing Standard (FIPS).

After the publication, the draft was criticized severely for two reasons. First, critics questioned the

small key length (only 56 bits), which could make the cipher vulnerable to brute-force attack. Second,

critics were concerned about some hidden design behind the internal structure of DES. They were

suspicious that some part of the structure (the S-boxes) may have some hidden trapdoor that would

allow the National Security Agency (NSA) to decrypt the messages without the need for the key. Later

IBM designers mentioned that the internal structure was designed to prevent differential cryptanalysis.

DES was finally published as FIPS 46 in the Federal Register in January 1977. NIST, however,

defines DES as the standard for use in unclassified applications. DES has been the most widely used

Data Encryption

Standard (DES)

144 Cryptography and Network Security

symmetric-key block cipher since its publication. NIST later issued a new standard (FIPS 46-3) that

recommends the use of triple DES (repeated DES cipher three times) for future applications. As we will

see in Chapter 7, AES, the recent standard, is supposed to replace DES in the long run.

6.1.2 Overview

DES is a block cipher, as shown in Fig. 6.1.

56-bit key Encryption Decryption

DES cipher

64-bit ciphertext

64-bit plaintext

DES reverse cipher

64-bit ciphertext

64-bit plaintext

Fig. 6.1 Encryption and decryption with DES

At the encryption site, DES takes a 64-bit plaintext and creates a 64-bit ciphertext; at the decryption

site, DES takes a 64-bit ciphertext and creates a 64-bit block of plaintext. The same 56-bit cipher key is

used for both encryption and decryption.

6.2 DES STRUCTURE

Let us concentrate on encryption; later we will discuss decryption. The encryption process is made of

two permutations (P-boxes), which we call initial and final permutations, and sixteen Feistel rounds.

Each round uses a different 48-bit round key generated from the cipher key according to a predefined

algorithm described later in the chapter. Figure 6.2 shows the elements of DES cipher at the encryption

site.

56-bit cipher key

48-bit

48-bit

48-bit

64-bit plaintext

DES

64-bit ciphertext

K 1

K

K

Initial permutation

Round 1

Final permutation

Round 2

Round 16 Round-key generator

Fig. 6.2 General structure of DES

146 Cryptography and Network Security

Example 6.1 Find the output of the initial permutation box when the input is given in hexadecimal

as: 0x0002 0000 0000 0001

Solution The input has only two 1s (bit 15 and bit 64); the output must also have only two 1s (the

nature of straight permutation). Using Table 6.1, we can find the output related to these two bits. Bit 15

in the input becomes bit 63 in the output. Bit 64 in the input becomes bit 25 in the output. So the output

has only two 1s, bit 25 and bit 63. The result in hexadecimal is

Example 6.2 Prove that the initial and final permutations are the inverse of each other by finding

the output of the final permutation if the input is 0x0000 0080 0000 0002

Solution Only bit 25 and bit 64 are 1s; the other bits are 0s. In the final permutation, bit 25 becomes

bit 64 and bit 63 becomes bit 15. The result

The initial and fi nal permutations are straight D-boxes that are inverses of each other and

hence are permutations. They have no cryptography signifi cance in DES.

6.2.2 Rounds

DES uses 16 rounds. Each round of DES is a Feistel cipher, as shown in Fig. 6.4.

Swapper

Mixer

Round

KI

L (^) I–

LI

RI–

RI

32 bits

32 bits (^) 32 bits

32 bits

f ( RI–1 , K (^) I )

Fig. 6.4 A round in DES (encryption site)

The round takes L I− 1 and R I− 1 from previous round (or the initial permutation box) and creates L I and

RI , which go to the next round (or final permutation box). As we discussed in Chapter 5, we can assume

that each round has two cipher elements (mixer and swapper). Each of these elements is invertible.

The swapper is obviously invertible. It swaps the left half of the text with the right half. The mixer is

invertible because of the XOR operation. All noninvertible elements are collected inside the function

f (R I− 1 , K I ).

Data Encryption Standard (DES) 147

DES Function

KI (48 bits) f ( RI–1, KI )

Out

S S S S S S S S

Straight D-box

Expansion D-box

S-Boxes

XOR

32 bits

In

48 bits

48 bits

32 bits

32 bits

Fig. 6.5 DES function

The heart of DES is the DES function. The DES

function applies a 48-bit key to the rightmost 32 bits

(RI− 1 ) to produce a 32-bit output. This function is

made up of four sections: an expansion D-box, a

whitener (that adds key), a group of S-boxes, and a

straight D-box as shown in Fig. 6.5.

Expansion D-box Since R I− 1 is a 32-bit input and

K I is a 48-bit key, we first need to expand R I− 1 to

48 bits. RI− 1 is divided into 8 4-bit sections. Each 4-bit

section is then expanded to 6 bits. This expansion

permutation follows a predetermined rule. For each

section, input bits 1, 2, 3, and 4 are copied to output

bits 2, 3, 4, and 5, respectively. Output bit 1 comes

from bit 4 of the previous section; output bit 6 comes

from bit 1 of the next section. If sections 1 and 8 can be considered adjacent sections, the same rule ap-

plies to bits 1 and 32. Fig. 6.6 shows the input and output in the expansion permutation.

32-bit input

48-bit output

From bit 32 From bit 1

Fig. 6.6 Expansion permutation

Although the relationship between the input and output can be defined mathematically, DES uses

Table 6.2 to define this D-box. Note that the number of output ports is 48, but the value range is only

1 to 32. Some of the inputs go to more than one output. For example, the value of input bit 5 becomes

the value of output bits 6 and 8.

Table 6.2 Expansion D-box table

32 01 02 03 04 05 04 05 06 07 08 09 08 09 10 11 12 13 12 13 14 15 16 17 16 17 18 19 20 21 20 21 22 23 24 25 24 25 26 27 28 29 28 29 31 31 32 01

Whitener (XOR) After the expansion permutation, DES uses the XOR operation on the expanded

right section and the round key. Note that both the right section and the key are 48-bits in length. Also

note that the round key is used only in this operation.

Data Encryption Standard (DES) 149

Table 6.5 S-box 3

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 10 00 09 14 06 03 15 05 01 13 12 07 11 04 02 08 1 13 07 00 09 03 04 06 10 02 08 05 14 12 11 15 01 2 13 06 04 09 08 15 03 00 11 01 02 12 05 10 14 07 3 01 10 13 00 06 09 08 07 04 15 14 03 11 05 02 12

Table 6.6 S-box 4

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 07 13 14 03 00 6 09 10 1 02 08 05 11 12 04 15 1 13 08 11 05 06 15 00 03 04 07 02 12 01 10 14 09 2 10 06 09 00 12 11 07 13 15 01 03 14 05 02 08 04 3 03 15 00 06 10 01 13 08 09 04 05 11 12 07 02 14

Table 6.7 S-box 5

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 02 12 04 01 07 10 11 06 08 05 03 15 13 00 14 09 1 14 11 02 12 04 07 13 01 05 00 15 10 03 09 08 06 2 04 02 01 11 10 13 07 08 15 09 12 05 06 03 00 14 3 11 08 12 07 01 14 02 13 06 15 00 09 10 04 05 03

Table 6.8 S-box 6

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 12 01 10 15 09 02 06 08 00 13 03 04 14 07 05 11 1 10 15 04 02 07 12 09 05 06 01 13 14 00 11 03 08 2 09 14 15 05 02 08 12 03 07 00 04 10 01 13 11 06 3 04 03 02 12 09 05 15 10 11 14 01 07 10 00 08 13

Table 6.9 S-box 7

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 4 11 2 14 15 00 08 13 03 12 09 07 05 10 06 01 1 13 00 11 07 04 09 01 10 14 03 05 12 02 15 08 06 2 01 04 11 13 12 03 07 14 10 15 06 08 00 05 09 02 3 06 11 13 08 01 04 10 07 09 05 00 15 14 02 03 12

Table 6.10 S-box 8

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 13 02 08 04 06 15 11 01 10 09 03 14 05 00 12 07 1 01 15 13 08 10 03 07 04 12 05 06 11 10 14 09 02 2 07 11 04 01 09 12 14 02 00 06 10 10 15 03 05 08 3 02 01 14 07 04 10 8 13 15 12 09 09 03 05 06 11

150 Cryptography and Network Security

Example 6.3 The input to S-box 1 is 1 0001 1. What is the output?

Solution If we write the first and the sixth bits together, we get 11 in binary, which is 3 in decimal.

The remaining bits are 0001 in binary, which is 1 in decimal. We look for the value in row 3, column 1,

in Table 6.3 (S-box 1). The result is 12 in decimal, which in binary is 1100. So the input 100011 yields

the output 1100.

Example 6.4 The input to S-box 8 is 0 0000 0. What is the output?

Solution If we write the first and the sixth bits together, we get 00 in binary, which is 0 in decimal.

The remaining bits are 0000 in binary, which is 0 in decimal. We look for the value in row 0, column 0,

in Table 6.10 (S-box 8). The result is 13 in decimal, which is 1101 in binary. So the input 000000 yields

the output 1101.

Final Permutation The last operation in the DES function is a permutation with a 32-bit input and

a 32-bit output. The input/output relationship for this operation is shown in Table 6.11 and follows the

same general rule as previous tables. For example, the seventh bit of the input becomes the second bit

of the output.

Table 6.11 Straight permutation table

16 07 20 21 29 12 28 17 01 15 23 26 05 18 31 10 02 08 24 14 32 27 03 09 19 13 30 06 22 11 04 25

6.2.3 Cipher and Reverse Cipher

Using mixers and swappers, we can create the cipher and reverse cipher, each having 16 rounds. The

cipher is used at the encryption site; the reverse cipher is used at the decryption site. The whole idea is

to make the cipher and the reverse cipher algorithms similar.

First Approach To achieve this goal, one approach is to make the last round (round 16) different

from the others; it has only a mixer and no swapper. This is done in Figure 6.9.

Although the rounds are not aligned, the elements (mixer or swapper) are aligned. We proved in

Chapter 5 that a mixer is a self-inverse; so is a swapper. The final and initial permutations are also

inverses of each other. The left section of the plaintext at the encryption site, L 0 , is enciphered as L 16 at

the encryption site; L 16 at the decryption is deciphered as L 0 at the decryption site. The situation is the

same with R 0 and R 16.

A very important point we need to remember about the ciphers is that the round keys (K 1 to K 16 )

should be applied in the reverse order. At the encryption site, round 1 uses K 1 and round 16 uses K 16 ; at

the decryption site, round 1 uses K 16 and round 16 uses K 1.

In the first approach, there is no swapper in the last round.

152 Cryptography and Network Security

Algorithm 6.1 Pseudocode for DES cipher

Cipher (plainBlock[64], RoundKeys[ 1 6, 48], cipherBlock[64]) { permute (64, 64, plainBlock, inBlock, InitialPermutationTable ) split (64, 32, inBlock, leftBlock, rightBlock) for (round = 1 to 1 6) { mixer (leftBlock, rightBlock, RoundKeys[round]) if (round!= 1 6) swapper (leftBlock, rightBlock) } combine (32, 64, leftBlock, rightBlock, outBlock) permute (64, 64, outBlock, cipherBlock, FinalPermutationTable ) } mixer (leftBlock[48], rightBlock[48], RoundKey[48]) { copy (32, rightBlock, T 1 ) function (T 1 , RoundKey, T2) exclusiveOr (32, leftBlock, T2, T3) copy (32, T3, rightBlock) } swapper (leftBlock[32], rigthBlock[32]) { copy (32, leftBlock, T) copy (32, rightBlock, leftBlock) copy (32, T, rightBlock) } function (inBlock[32], RoundKey[48] , outBlock[32]) { permute (32, 48, inBlock, T 1 , ExpansionPermutationTable ) exclusiveOr (48, T 1 , RoundKey, T2) substitute (T2, T3, SubstituteTables ) permute (32, 32, T3, outBlock, StraightPermutationTable ) } substitute (inBlock[32], outBlock[48], SubstitutionTables [8, 4, 1 6]) { for (i = 1 to 8) { row ¨ 2 ¥ inBlock[i ¥ 6 + 1 ] + inBlock [i ¥ 6 + 6] col ¨ 8 ¥ inBlock[i ¥ 6 + 2] + 4 ¥ inBlock[i ¥ 6 + 3] + 2 ¥ inBlock[i ¥ 6 + 4] + inBlock[i ¥ 6 + 5]

value = SubstitutionTables [i][row][col]

outBlock[[i ¥ 4 + 1 ] ¨ value / 8; value ¨ value mod 8 outBlock[[i ¥ 4 + 2] ¨ value / 4; value ¨ value mod 4 outBlock[[i ¥ 4 + 3] ¨ value / 2; value ¨ value mod 2 outBlock[[i ¥ 4 + 4] ¨ value } }

Data Encryption Standard (DES) 153

Alternative Approach In the first approach, round 16 is different from other rounds; there is no

swapper in this round. This is needed to make the last mixer in the cipher and the first mixer in the re-

verse cipher aligned. We can make all 16 rounds the same by including one swapper to the 16th round

and add an extra swapper after that (two swappers cancel the effect of each other). We leave the design

for this approach as an exercise.

Key Generation The round-key generator creates sixteen 48-bit keys out of a 56-bit cipher key.

However, the cipher key is normally given as a 64-bit key in which 8 extra bits are the parity bits, which

are dropped before the actual key-generation process, as shown in Fig. 6.10.

28 bits 28 bits

Key with parity bits

Round key 2

Round key 16

Cipher key (56 bits)

(64 bits)

Round-Key Generator

Shifting

Parity drop

28 bits 28 bits

Round key 148 bits

Compression D-box

Shift left Shift left

28 bits 28 bits

48 bits

Compression D-box

Shift left Shift left

28 bits 28 bits

48 bits

Compression D-box

Shift left Shift left

1, 2, 9, 16 one bit Others two bits

Rounds Shift

Fig. 6.10 Key generation

Parity Drop The preprocess before key expansion is a compression transposition step that we call

parity bit drop. It drops the parity bits (bits 8, 16, 24, 32, …, 64) from the 64-bit key and permutes the

rest of the bits according to Table 6.12. The remaining 56-bit value is the actual cipher key which is used

to generate round keys. The parity drop step (a compression D-box) is shown in Table 6.12.

Data Encryption Standard (DES) 155

combine (28, 56, leftKey, rightKey, preRoundKey) permute (56, 48, preRoundKey, RoundKeys[round], KeyCompressionTable ) } } shiftLeft (block[28], numOfShifts) { for (i = 1 to numOfShifts) { T ¨ block[ 1 ] for (j = 2 to 28) { block [j− 1 ] ¨ block [j] } block[28] ¨ T } }

6.2.4 Examples

Before analyzing DES, let us look at some examples to see the how encryption and decryption change

the value of bits in each round.

Example 6.5 We choose a random plaintext block and a random key, and determine what the

ciphertext block would be (all in hexadecimal): Plaintext: 123456ABCD132536 Key: AABB09182736CCDD CipherText: C0B7A8D05F3A829C Let us show the result of each round and the text created before and after the rounds. Table 6.15 first shows the result of steps before starting the round.

Table 6.15 Trace of data for Example 6.

Plaintext: 123456ABCD After initial permutation: 14A7D67818CA18AD After splitting: L 0 =14A7D678 R 0 =18CA18AD Round Left Right Round Key Round 1 (^) 1 8CA 1 8AD 5A78E394 (^1) 94CD072DE8C Round 2 5A78E394 4A 121 0F6 4568581 ABCCE Round 3 4A 121 0F6 B808959 1 06EDA4ACF5B Round 4 (^) B808959 1 236779C2 DA2D032B6EE Round 5 236779C2 A 1 5A4B87 69A629FEC9 13 Round 6 A 1 5A4B87 2E8F9C65 C 1 948E87475E Round 7 2E8F9C65 A9FC20A3 708AD2DDB3C Round 8 A9FC20A3 308BEE97 34F822F0C66D Round 9 308BEE97 1 0AF9D37 84BB4473DCCC

Algorithm 6.2 (Contd.)

156 Cryptography and Network Security

Round 10 (^) 1 0AF9D37 6CA6CB20 02765708B5BF Round 11 6CA6CB20 FF3C485F 6D5560AF7CA Round 12 FF3C485F 22A5963B (^) C2C 1 E96A4BF Round 13 22A5963B 387CCDAA 99C3 1 397C9 1 F Round 14 387CCDAA BD2DD2AB 251 B8BC7 1 7D Round 15 BD2DD2AB CF26B472 3330C5D9A36D Round 16 1 9BA92 12 CF26B472 181 C5D75C66D After combination: 19BA9212CF26B Ciphertext: C0B7A8D05F3A829C (after fi nal permutation)

The plaintext goes through the initial permutation to create completely different 64 bits ( hexadecimal digit). After this step, the text is split into two halves, which we call L 0 and R 0. The table shows the result of 16 rounds that involve mixing and swapping (except for the last round). The results of the last rounds (L 16 and R 16 ) are combined. Finally the text goes through final permutation to create the ciphertext.

Some points are worth mentioning here. First, the right section out of each round is the same as the left

section out of the next round. The reason is that the right section goes through the mixer without change,

but the swapper moves it to the left section. For example, R 1 passes through the mixer of the second round

without change, but then it becomes L 2 because of the swapper. The interesting point is that we do not have

a swapper at the last round. That is why R 15 becomes R 16 instead of becoming L 16.

Example 6.6 Let us see how Bob, at the destination, can decipher the ciphertext received from

Alice using the same key. We have shown only a few rounds to save space. Table 6.16 shows some interesting points. First, the round keys should be used in the reverse order. Compare Table 6.15 and Table 6.16. The round key for round 1 is the same as the round key for round 16. The values of L 0 and R 0 during decryption are the same as the values of L 16 and R 16 during encryption. This is the same with other rounds. This proves not only that the cipher and the reverse cipher are inverses of each other in the whole, but also that each round in the cipher has a corresponding reverse round in the reverse cipher. The result proves that the initial and final permutation steps are also inverses of each other. Table 6.16 Trace of data for Example 6.

Ciphertext: C0B7A8D05F3A829C After initial permutation: 19BA9212CF26B After splitting: L 0 =19BA9212 R 0 =CF26B

Round Left Right Round Key

Round 1 CF26B472 BD2DD2AB 181 C5D75C66D Round 2 BD2DD2AB 387CCDAA 3330C5D9A36D

............ Round 15 5A78E394 1 8CA 1 8AD 4568581 ABCCE Round 16 (^) 1 4A7D678 1 8CA 1 8AD 1 94CD072DE8C After combination: 14A7D67818CA18AD Plaintext:123456ABCD132536 (after final permutation)

Table 6.15 (Contd.)

158 Cryptography and Network Security

4. If two inputs to an S-box differ only in two middle bits (bits 3 and 4), the output must differ in

at least two bits. In other words, S(x) and S( x ⊕ 001100) must differ in at least two bits where

x is the input and S( x ) is the output.

5. If two inputs to an S-box differ in the first two bits (bits 1 and 2) and are the same in the last two

bits (5 and 6), the two outputs must be different. In other words, we need to have the following

relation S( x ) ≠ S( x ⊕ 11bc00), in which b and c are arbitrary bits.

6. There are only 32 6-bit input-word pairs ( x i and x j ), in which xi ⊕ x j ≠ (000000) 2. These 32 input

pairs create 32 4-bit output-word pairs. If we create the difference between the 32 output pairs,

d = yi ⊕ yj , no more than 8 of these d ’s should be the same.

7. A criterion similar to # 6 is applied to three S-boxes.

8. In any S-box, if a single input bit is held constant (0 or 1) and the other bits are changed

randomly, the differences between the number of 0s and 1s are minimized.

D-Boxes

Between two rows of S-boxes (in two subsequent rounds), there are one straight D-box (32 to 32)

and one expansion D-box (32 to 48). These two D-boxes together provide diffusion of bits. We have

discussed the general design principle of D-boxes in Chapter 5. Here we discuss only the ones applied

to the D-boxes used inside the DES function. The following criteria were implemented in the design of

D-boxes to achieve this goal:

1. Each S-box input comes from the output of a different S-box (in the previous round).

2. No input to a given S-box comes from the output from the same box (in the previous round).

3. The four outputs from each S-box go to six different S-boxes (in the next round).

4. No two output bits from an S-box go to the same S-box (in the next round).

5. If we number the eight S-boxes, S 1 , S 2 , …, S 8 ,

a. An output of S j − 2 goes to one of the first two bits of S j (in the next round).

b. An output bit from S j − 1 goes to one of the last two bits of S j (in the next round).

c. An output of S j +1 goes to one of the two middle bits of S j (in the next round).

6. For each S-box, the two output bits go to the first or last two bits of an S-box in the next round.

The other two output bits go to the middle bits of an S-box in the next round.

7. If an output bit from S j goes to one of the middle bits in S k (in the next round), then an output

bit from S k cannot go to the middle bit of S j. If we let j = k , this implies that none of the middle

bits of an S-box can go to one of the middle bits of the same S-box in the next round.

Number of Rounds DES uses sixteen rounds of Feistel ciphers. It has been proved that after eight

rounds, each ciphertext is a function of every plaintext bit and every key bit; the ciphertext is thoroughly

a random function of plaintext and ciphertext. Therefore, it looks like eight rounds should be enough.

However, experiments have found that DES versions with less than sixteen rounds are even more vul-

nerable to known-plaintext attacks than brute-force attack, which justifies the use of sixteen rounds by

the designers of DES.

6.3.3 DES Weaknesses

During the last few years critics have found some weaknesses in DES.

Weaknesses in Cipher Design

We will briefly mention some weaknesses that have been found in the design of the cipher.

Data Encryption Standard (DES) 159

S-boxes At least three weaknesses are mentioned in the literature for S-boxes.

1. In S-box 4, the last three output bits can be derived in the same way as the first output bit by

complementing some of the input bits.

2. Two specifically chosen inputs to an S-box array can create the same output.

3. It is possible to obtain the same output in a single round by changing bits in only three neighboring

S-boxes.

D-boxes One mystery and one weakness were found in the design of D-boxes:

1. It is not clear why the designers of DES used the initial and final permutations; these have no

security benefits.

2. In the expansion permutation (inside the function), the first and fourth bits of every 4-bit series

are repeated.

Weakness in the Cipher Key

Several weaknesses have been found in the cipher key.

Key Size Critics believe that the most serious weakness of DES is in its key size (56 bits). To do a

brute-force attack on a given ciphertext block, the adversary needs to check 2 56 keys.

a. With available technology, it is possible to check one million keys per second. This means that

we need more than two thousand years to do brute-force attacks on DES using only a computer

with one processor.

b. If we can make a computer with one million chips (parallel processing), then we can test the

whole key domain in approximately 20 hours. When DES was introduced, the cost of such a

computer was over several million dollars, but the cost has dropped rapidly. A special computer

was built in 1998 that found the key in 112 hours.

c. Computer networks can simulate parallel processing. In 1977 a team of researchers used 3500

computers attached to the Internet to find a key challenged by RSA Laboratories in 120 days.

The key domain was divided among all of these computers, and each computer was responsible

to check the part of the domain.

d. If 3500 networked computers can find the key in 120 days, a secret society with 42,000 members

can find the key in 10 days.

The above discussion shows that DES with a cipher key of 56 bits is not safe enough to be used

comfortably. We will see later in the chapter that one solution is to use triple DES (3DES) with two keys

(112 bits) or triple DES with three keys (168 bits).

Weak Keys Four out of 2 56 possible keys are called weak keys. A weak key is the one that, after par-

ity drop operation (using Table 6.12), consists either of all 0s, all 1s, or half 0s and half 1s. These keys

are shown in Table 6.18.

Table 6.18 Weak keys

Keys before parities drop (64 bits) Actual key (56 bits)

1 F 1 F 1 F 1 F 0E0E 0E0E 0000000 FFFFFFF
E0E0 E0E0 F 1 F 1 F 1 F 1 FFFFFFF^0000000
FEFE FEFE FEFE FEFE FFFFFFF FFFFFFF

Data Encryption Standard (DES) 161

A semi-weak key creates only two different round keys and each of them is repeated eight times. In

addition, the round keys created from each pair are the same with different orders. To show the idea, we

have created the round keys from the first pairs as shown below:

Round key 1^91 53E543^1 9BD^ 6EAC^1 ABCE

Round key 2 6EAC^1 ABCE642^91 53E543^1 9BD

Round key 3 6EAC^1 ABCE642^91 53E543^1 9BD

Round key 4 6EAC 1 ABCE642 91 53E543 1 9BD

Round key 5 6EAC^1 ABCE642^91 53E543^1 9BD

Round key 6 6EAC^1 ABCE642^91 53E543^1 9BD

Round key 7 6EAC 1 ABCE642 91 53E543 1 9BD

Round key 8 6EAC^1 ABCE642^91 53E543^1 9BD

Round key 9^91 53E543^1 9BD^ 6EAC^1 ABCE

Round key 10 91 53E543 1 9BD 6EAC 1 ABCE

Round key 11 91 53E543 1 9BD 6EAC 1 ABCE

Round key 12^91 53E543^1 9BD^ 6EAC^1 ABCE

Round key 13^91 53E543^1 9BD^ 6EAC^1 ABCE

Round key 14 91 53E543 1 9BD 6EAC 1 ABCE

Round key 15^91 53E543^1 9BD^ 6EAC^1 ABCE

Round key 16 6EAC^1 ABCE642^91 53E543^1 9BD

As the list shows, there are eight equal round keys in each semi-weak key. In addition, round key 1

in the first set is the same as round key 16 in the second; round key 2 in the first is the same as round

key 15 in the second; and so on. This means that the keys are inverses of each other E k 2 (Ek 1 (P)) = P, as

shown in Fig. 6.12.

DES cipher A pair of semi-weak keys DES cipher

64-bit text

64-bit text

P

P

k 1

k

Fig. 6.12 A pair of semi-weak keys in encryption and decryption

Possible Weak Keys There are also 48 keys that are called possible weak keys. A possible weak key

is a key that creates only four distinct round keys; in other words, the sixteen round keys are divided into

four groups and each group is made of four equal round keys.

162 Cryptography and Network Security

Example 6.9 What is the probability of randomly selecting a weak, a semi-weak, or a possible weak

key?

Solution DES has a key domain of 2^56. The total number of the above keys are 64 (4 + 12 + 48). The

probability of choosing one of these keys is 8.8 ¥ 10 −^16 , almost impossible.

Key Complement In the key domain (2 56 ), definitely half of the keys are complement of the other

half. A key complement can be made by inverting (changing 0 to 1 or 1 to 0) each bit in the key. Does

a key complement simplify the job of the cryptanalysis? It happens that it does. Eve can use only half of

the possible keys (2 55 ) to perform brute-force attack. This is because

C = E (K, P) → C

—

= E (K

—

, P

—

In other words, if we encrypt the complement of plaintext with the complement of the key, we get the

complement of the ciphertext. Eve does not have to test all 2 56 possible keys, she can test only half of

them and then complement the result.

Example 6.10 Let us test the claim about the complement keys. We have used an arbitrary key and

plaintext to find the corresponding ciphertext. If we have the key complement and the plaintext, we can obtain the complement of the previous ciphertext (Table 6.20).

Table 6.20 Results for Example 6.

Original Complement

Key 1234123412341234 EDCBEDCBEDCBEDCB Plaintext 1 2345678ABCDEF 12 EDCBA9875432 1 0ED Ciphertext (^) E 11 2BE 1 DEFC7A367 1 EED4 1 E2 1 0385C

Key Clustering Key clustering refers to the situation in which two or more different keys can create

the same ciphertext from the same plaintext. Obviously, each pair of the semi-weak keys is a key cluster.

However, no more clusters have been found for the DES. Future research may reveal some more.

6.4 SECURITY OF DES

DES, as the first important block cipher, has gone through much scrutiny. Among the attempted attacks,

three are of interest: brute-force, differential cryptanalysis, and linear cryptanalysis.

6.4.1 Brute-Force Attack

We have discussed the weakness of short cipher key in DES. Combining this weakness with the key

complement weakness, it is clear that DES can be broken using 2 55 encryptions. However, today most

applications use either 3DES with two keys (key size of 112) or 3DES with three keys (key size of 168).

These two multiple-DES versions make DES resistant to brute-force attacks.