Exercise 4 Solution

 

1. This problem provides a numerical example of encryption using a one-round version of DES. We start with the same bit pattern for the key and the plaintext, namely,

In hexadecimal notation: 0 1 2 3 4 5 6 7 8 9 A B C D E F

In binary notation: 0000 0001 0010 0011 0100 0101 0110 0111

                               1000 1001 1010 1011 0100 1101 1110 1111

 

a. Derive K1, the first-round subkey.

64-bit key è PC1 (64 à 56) è shift registers C&Dè PC2(56à 48)

10110000

11001100

10101010

00001010

10101100

11001111

00000000

 

è         L = 1011 0000 1100 1100 1010 1010 0000

             R = 1010 1010 1100 1100 1111 0000 0000

 

 

C1(L) = 0110 0001 1001 1001 0101 0100 0001

D1(R) = 0101 0101 1001 1001 1110 0000 0001

 

1-8            0110 0001

9-16          1001 1001

17-24        0101 0100

25-32        0001 0101

33-40        0101 1001

41-48        1110 0000

49-56        0000 0001

K1 = 00000011  00000010  01100111   10010011   00000001   10010101

 

b. Derive L0, R0.

(Initial permutation)

L0 = 11001100 00000000 11001100 11111111

R0 = 10110000 10101010 11110000 10101010

 

c. Expand R0 to get E[R0].

 

 

E[R0] = 010110100001 010101010101 011110100001 010101010101

 

d. Calculate A = E[R0]ÅK1.

 

E[R0] = 010110100001 010101010101 011110100001 010101010101

K1    = 000000110000 001001100111 100100110000 000110010101

           010110010001 011100110010 111010010001 010011000000

 

 

e. Group the 48-bit result of (d) into sets of 6 bits and evaluate the corresponding S-box substitutions.

S1(010110)= 1100

S2(010001)= 1100

S3(011100)=0100

S4(110010)= 0001

S5(111010)= 0011

S6(010001) = 0110

S7(010011) = 0011

S8(000000) = 1101

f. Concatenate the results of (e) to get a 32-bit result, B.

 

B = 1100 1100 0100 0001 0011 0110 0011 1101

 

g. Apply the permutation to get P(B).

P(B) = 10101010 10101001 10001100 10111000

 

h. Calculate R1 = P(B)ÅL0

 

R1 = P(B)Å L0

 

P(B) = 1010 1010 1010 1001 1000 1100 1011 1000

L0    = 1100 1100 0000 0000 1100 1100 1111 1111

        0110 0110 1010 1001 0100 0000 0100 0111

 

R1 =0110 0110 1010 1001 0100 0000 0100 0111

 

i. Write down the ciphertext.

L1 = R0 = 10110000 10101010 11110000 10101010

 

Ciphertext = IP-1(R1L1) = 0001 0001 0110 0011 0100 0001 0011 0010

                                        1000 1000 1111 1010 0100 1101 1011 1010

 

 

2. Show that in DES the first 24 bits of each subkey come from the same subset of 28 bits of the initial key and that the second 24 bits of each subkey come from a disjoint subset of 28 bits of the initial key.

 

 

For PC1:

 

C1 comes from the red half of the bits, and D1 comes from the blue half of the bits. For all subkeys Ki, the first 24 bits are come from Ci, and second 24 bits are come from Di, since PC2 takes Ci to generate the first 24 bits and Di to generate the second 24 bits. There for, first 24 bits of each subkey come from the same subset of 28 bits of the initial key (in red) and the second 24 bits of each subkey come from a disjoint subset of 28 bits of the initial key (in blue).