3. 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.
Solution
5. Using mixers and swappers, we can create the cipher and reverse
cipher, each having 16 rounds.
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.
Cipher and Reverse Cipher
12. Avalanche Effect
DES exhibits strong avalanche, where a change of one input or key
bit results in changing approx half output bits.
Two desired properties of a block cipher are the avalanche effect and
the completeness.
To check the avalanche effect in DES, let us encrypt two plaintext
blocks (with the same key) that differ only in one bit and observe the
differences in the number of bits in each round.
13. 6.3.1 Continued
Although the two plaintext blocks differ only in the rightmost bit, the
ciphertext blocks differ in 29 bits. This means that changing
approximately 1.5 percent of the plaintext creates a change of
approximately 45 percent in the ciphertext.
Avalanche Effect Contd.
Completeness Effect
Completeness effect means that each bit of the ciphertext needs to depend
on many bits on the plaintext. The Diffusion and Confusion produced
by P-boxes and S-boxes in DES shows a very strong completeness effect.
14. The design provides confusion and diffusion of bits from each round
to the next.
• The entries of each row are permutation of values are
between 0 and 15.
• If there is a single bit change in the input, two or more bits
will be changed in the output.
• If two inputs to an S-box differ only in the two middle bits
(bit 3 and bit 4), the output must differ in at least two bits.
Design Criteria of S-boxes
15. If two inputs to an S-box differ in the first two bits (bit 1 and bit
2) and are the same in the last two bits (5 and 6), the two outputs
must be different.
There are only 32 6-bit input word pairs(Xi and Xj ) in which
XiƟXj ≠ (000000)2. These 32 input pairs create 32 4-bit output
word pair. If we create the difference between the 32 output pair
d = YiƟ Yj , no more than 8 of these d should be the same.
Design Criteria of S-boxes Contd.
16. 6.16
Between two rounds of S-boxes, there are one straight P-box (32 bit to 32
bit) and one Expansion P-box (32 bit to 48 bit). These two P-boxes
together provide diffusion of bits.
• Each S-box input comes from the output of a different S-box (in
the previous round).
• The four outputs from each S-box go to six different S-boxes
(in the next round).
• No two output bits from an S-box go the same S-boxes (in
the next round).
• 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 the
middle bits of an S-box in the next round.
Design Criteria for P-boxes
17. 6.17
If we number the eight S-boxes, S1, S2, S3, …, S8
• An output of Sj-2 goes to one of the first two bits of Sj
(in the next round).
• An output bit from Sj-1 goes to one of the last two bits
of Sj (in the next round).
• An output of Sj+1 goes to one of the two middle bits of
Sj ( in the next round).
Design Criteria for P-boxes Contd.
18. During the last few years critics have found some weakness in DES
Weakness in S-Boxes
• At least three weaknesses are mentioned in the literature for
S-boxes.
• 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.
• Two specifically chosen inputs to an S-box array can create
the same output.
• It is possible to obtain the same output in a single round by
changing bits in only three neighboring S-boxes.
DES Weaknesses
19. 6.19
• It is not clear why the designer of DES used the initial and
final permutation; these have no security benefits.
• In the expansion permutation (inside the function), the first
and fourth bits of every 4-bit series are repeated.
Weakness in P-boxes
Number of Rounds
DES uses sixteen rounds of Feistel ciphers. the ciphertext is
thoroughly a random function of plaintext and ciphertext.
20. 6.20
Weakness in Keys
Let us try the first weak key in Table 6.18 to encrypt a block two
times. After two encryptions with the same key the original
plaintext block is created. Note that we have used the encryption
algorithm two times, not one encryption followed by another
decryption.
22. 6.22
Semi Weak Keys
There are six key pairs that are called semi weak keys and they
are shown in the below table. 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.
25. A pair of semi-weak keys in Encryption and Decryption
Semi Weak Keys
What is the probability of randomly selecting a weak, a semi-
weak, or a possible weak key?
26. 6.3.3 Continued
DES has a key domain of 256. 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.
Solution
28. 6.28
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).