13 IT352 Class 14
13 IT352 Class 14
• In 1973, NBS (NIST) issues a public request for proposals for a national
cipher standard, which must be
– Secure
– Public
– Completely specified
– Easy to understand
– Available to all users
– Economic and efficient in hardware
– Able to be validated
– Exportable
• IBM submitted LUCIFER (Feistel) (which was redesigned to become
the DES)
• In 1977, adopted by NBS (NIST) as DES (Data Encryption Standard,
Federal Information Processing Standard 46 (FIPS PUB 46))
DES History
• Chronolgy
• 1973: NBS publishes a first request for a standard encryption algorithm
• 1974: NBS publishes a second request for encryption algorithms
• 1975: DES is published in the Federal Register for comment
• 1976: First and second workshop on DES
• 1976: DES is approved as a standard
• 1977: DES is published as a FIPS standard FIPS PUB 46
• 1983: DES reaffirmed for the first time
• 1986: Videocipher II, a TV satellite scrambling system based upon DES
begins use by HBO
• 1988: DES is reaffirmed for the second time as FIPS 46-1, superseding
FIPS PUB 46
• 1992: Biham and Shamir publish the first theoretical attack with less
complexity than brute force: differential cryptanalysis. However, it requires
an unrealistic 247 chosen plaintexts
• 1993: DES is reaffirmed for the third time as FIPS 46-2
DES History
• 1994: The first experimental cryptanalysis of DES is performed using
linear cryptanalysis (Matsui, 1994)
• 1997: The DESCHALL Project breaks a message encrypted with DES for
the first time in public
• 1998: The Electronic Frontier Foundation (EFF)’s DES cracker (Deep Crack)
breaks a DES key in 56 hours
• 1999: Together, Deep Crack and distributed.net break a DES key in 22 hours
and 15 minutes
• 1999: DES is reaffirmed for for the fourth time as FIPS 46-3, which
specifies the preferred use of Triple DES, with single DES permitted only in
legacy systems
• 2001: The Advanced Encryption Standard is published in FIPS 197
• 2002: The AES standard becomes effective
• 2004: The withdrawal of FIPS 46-3 (and a couple of related standards) is
proposed in the Federal Register
• 2005: NIST withdraws FIPS 46-3
Encryption and Decryption with DES
K1
Iteration 1 Permuted Choice 2 Left Circular Shift
K2
Iteration 2 Permuted Choice 2 Left Circular Shift
K16
Iteration 16 Permuted Choice 2 Left Circular Shift
32-bit Swap
Inverse Initial
Permutation
…
64-bit Ciphertext
DES Encryption Overview
Initial and Final Permutation Steps in DES
Initial and Final Permutation tables
Problem No. 1
Find the output of the initial permutation box when the input is given in
hexadecimal as:
Input has only two 1s (Bit 15 and bit 64): the output must also have only two
1s(the nature straight permutation).
The 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.
6.2.1 Continued
Problem No. 2
Problem No. 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
Solution: The bit 25 in the input becomes bit 64 in the output. Bit 63 in the input
becomes bit 15 in the output. So the output has only two 1s, bit 15 and bit 64.
A round in DES (encryption site)
Li-1 Ri-1
32 bits Li 32 bits Ri
DES - Swapping of Left and Right Halves
Li-1 Ri-1
32 bits Li 32 bits Ri
Details of Each Iteration
XOR
32 bits
Li Ri Ci Di
6.2.2 Continued
DES Function
The heart of DES is the DES function. The DES function applies a 48-bit key to the
rightmost 32 bits to produce a 32-bit output.
6.2.2 Continue
Expansion P-box
Since RI−1 is a 32-bit input and KI is a 48-bit key, we first need to expand RI−1 to 48
bits.
Expansion Permutation Table
32 1 2 3 4 5
4 5 6 7 8 9
8 9 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 30 31 32 1
6.2.2 Continue
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.
S-Boxes
The S-boxes do the real mixing (confusion). DES uses 8 S-boxes, each with a 6-bit
input and a 4-bit output.
6.20
S-Box 1
Table shows the permutation for S-box 1. For the rest of the boxes see the textbook.
Problem No. 3
The input to S-box 1 is 100011.
What is the output?
S-Box Structure
S1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
00(1) 14 4 13 1 2 15 11 8 3 10 6 12 5 9 0 7
01(2) 0 15 7 4 14 2 13 1 10 6 12 11 9 5 3 8
10(3) 4 1 14 8 13 6 2 11 15 12 9 7 3 10 5 0
11(4) 15 12 8 2 4 9 1 7 5 11 3 14 10 0 6 13
For example, for input 011011 the row is 01, that is row 1, and
the column is determined by 1101, that is column 13. In row 1
column 13 appears 5 so that the output is 0101.
S-Box Structure
S-Box Structure
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.
Straight Permutation
Cipher and Reverse Cipher
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.
6.2.3 Continued
DES Cipher and Reverse Cipher
Key Generation
Permutation 1
PC-1
57 49 41 33 25 17 9
1 58 50 42 34 26 18
10 2 59 51 43 35 27
19 11 3 60 52 44 36
63 55 47 39 31 23 15
7 62 54 46 38 30 22
14 6 61 53 45 37 29
21 13 5 28 20 12 4
PC-1
IP 58 50 42 34 26 18 10 2 57 49 41 33 25 17 9
60 52 44 36 28 20 12 4 1 58 50 42 34 26 18
62 54 46 38 30 22 14 6 10 2 59 51 43 35 27
64 56 48 40 32 24 16 8 19 11 3 60 52 44 36
57 49 41 33 25 17 9 1 63 55 47 39 31 23 15
59 51 43 35 27 19 11 3 7 62 54 46 38 30 22
61 53 45 37 29 21 13 5 14 6 61 53 45 37 29
63 55 47 39 31 23 15 7 21 13 5 28 20 12 4
Permutation Choice 2
PC-2
14 17 11 24 1 5
3 28 15 6 21 10
23 19 12 4 26 8
16 7 27 20 13 2
41 52 31 37 47 55
30 40 51 45 33 48
44 49 39 56 34 53
46 42 50 36 29 32
Key Rotation Schedule
Round 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Number
Number of 1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 1
Left Shifts
Total Number 1 2 4 6 8 10 12 14 15 17 19 21 23 25 27 28
of Shifts
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 1
Avalanche Effect
Two desired properties of a block cipher are the avalanche effect and
the completeness.
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.
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.
Design Criteria of S-boxes
The design provides confusion and diffusion of bits from each round
to the next.
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.
• Each S-box input comes from the output of a different S-box (in
the previous 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
6.38 bits of an S-box in the next round.
Design Criteria for P-boxes Contd.
• An output bit from Sj-1 goes to one of the last two bits
of Sj (in the next round).
6.39
DES Weaknesses
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.
• It is not clear why the designer of DES used the initial and
final permutation; these have no security benefits.
Number of Rounds
DES uses sixteen rounds of Feistel ciphers. the ciphertext is
thoroughly a random function of plaintext and ciphertext.
6.41
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.
6.42
Double Encryption and Decryption with a Weak Key
6.43
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.
6.44
6.3.3 Continued
Semi Weak Keys
6.45
Semi Weak Keys
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.