DES supplementary material

This article details the various tables referenced in the Data Encryption Standard (DES) block cipher.

All bits and bytes are arranged in big endian order in this document. That is, bit number 1 is always the most significant bit.

Initial permutation (IP)

Final permutation
Final permutation
IP
585042342618102
605244362820124
625446383022146
645648403224168
57494133251791
595143352719113
615345372921135
635547393123157

This table specifies the input permutation on a 64-bit block. The meaning is as follows: the first bit of the output is taken from the 58th bit of the input; the second bit from the 50th bit, and so on, with the last bit of the output taken from the 7th bit of the input.

This information is presented as a table for ease of presentation; it is a vector, not a matrix.

Final permutation (IP−1)

Final permuta
IP−1
408481656246432
397471555236331
386461454226230
375451353216129
364441252206028
353431151195927
342421050185826
33141949175725

The final permutation is the inverse of the initial permutation; the table is interpreted similarly.

Expansion function (E)

Expansion function
Expansion function
E
3212345
456789
8910111213
121314151617
161718192021
202122232425
242526272829
28293031321

The expansion function is interpreted as for the initial and final permutations. Note that some bits from the input are duplicated at the output; e.g. the fifth bit of the input is duplicated in both the sixth and eighth bit of the output. Thus, the 32-bit half-block is expanded to 48 bits.

Permutation (P)

P permutation
P permutation
P
167202129122817
11523265183110
282414322739
19133062211425

The P permutation shuffles the bits of a 32-bit half-block.

Permuted choice 1 (PC-1)

Permuted choice 1
Permuted choice 1
PC-1
Left
5749413325179
1585042342618
1025951433527
1911360524436
Right
63554739312315
7625446383022
1466153453729
211352820124

The "Left" and "Right" halves of the table show which bits from the input key form the left and right sections of the key schedule state. Note that only 56 bits of the 64 bits of the input are selected; the remaining eight (8, 16, 24, 32, 40, 48, 56, 64) were specified for use as parity bits.

Permuted choice 2 (PC-2)

Permuted choice 2
Permuted choice 2
PC-2
1417112415
3281562110
2319124268
1672720132
415231374755
304051453348
444939563453
464250362932

This permutation selects the 48-bit subkey for each round from the 56-bit key-schedule state. This permutation will ignore 8 bits below:

Permuted Choice 2 "PC-2" Ignored bits 9, 18, 22, 25, 35, 38, 43, 54.

Substitution boxes (S-boxes)

S-boxes
S1 x0000xx0001xx0010xx0011xx0100xx0101xx0110xx0111x x1000xx1001xx1010xx1011xx1100xx1101xx1110xx1111x
0yyyy0 1441312151183106125907
0yyyy1 0157414213110612119538
1yyyy0 4114813621115129731050
1yyyy1 1512824917511314100613
S2 x0000xx0001xx0010xx0011xx0100xx0101xx0110xx0111x x1000xx1001xx1010xx1011xx1100xx1101xx1110xx1111x
0yyyy0 1518146113497213120510
0yyyy1 3134715281412011069115
1yyyy0 0147111041315812693215
1yyyy1 1381013154211671205149
S3 x0000xx0001xx0010xx0011xx0100xx0101xx0110xx0111x x1000xx1001xx1010xx1011xx1100xx1101xx1110xx1111x
0yyyy0 1009146315511312711428
0yyyy1 1370934610285141211151
1yyyy0 1364981530111212510147
1yyyy1 1101306987415143115212
S4 x0000xx0001xx0010xx0011xx0100xx0101xx0110xx0111x x1000xx1001xx1010xx1011xx1100xx1101xx1110xx1111x
0yyyy0 7131430691012851112415
0yyyy1 1381156150347212110149
1yyyy0 1069012117131513145284
1yyyy1 3150610113894511127214
S5 x0000xx0001xx0010xx0011xx0100xx0101xx0110xx0111x x1000xx1001xx1010xx1011xx1100xx1101xx1110xx1111x
0yyyy0 2124171011685315130149
0yyyy1 1411212471315015103986
1yyyy0 4211110137815912563014
1yyyy1 1181271142136150910453
S6 x0000xx0001xx0010xx0011xx0100xx0101xx0110xx0111x x1000xx1001xx1010xx1011xx1100xx1101xx1110xx1111x
0yyyy0 1211015926801334147511
0yyyy1 1015427129561131401138
1yyyy0 9141552812370410113116
1yyyy1 4321295151011141760813
S7 x0000xx0001xx0010xx0011xx0100xx0101xx0110xx0111x x1000xx1001xx1010xx1011xx1100xx1101xx1110xx1111x
0yyyy0 4112141508133129751061
0yyyy1 1301174911014351221586
1yyyy0 1411131237141015680592
1yyyy1 6111381410795015142312
S8 x0000xx0001xx0010xx0011xx0100xx0101xx0110xx0111x x1000xx1001xx1010xx1011xx1100xx1101xx1110xx1111x
0yyyy0 1328461511110931450127
0yyyy1 1151381037412561101492
1yyyy0 7114191214206101315358
1yyyy1 2114741081315129035611

This table lists the eight S-boxes used in DES. Each S-box replaces a 6-bit input with a 4-bit output. Given a 6-bit input, the 4-bit output is found by selecting the row using the outer two bits, and the column using the inner four bits. For example, an input "011011" has outer bits "01" and inner bits "1101"; noting that the first row is "00" and the first column is "0000", the corresponding output for S-box S5 would be "1001" (=9), the value in the second row, 14th column. (See S-box).

Key Generation

The main key supplied from user is of 64 bits. The following operations are performed with it.

Drop Parity bits

Drop the bits of the grey positions (8x) to make 56 bit space for further operation for each round.

Parity Drop Table
1 2 3 4 5 6 7 8
9 10 11 12 13 14 15 16
17 18 19 20 21 22 23 24
25 26 27 28 29 30 31 32
33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48
49 50 51 52 53 54 55 56
57 58 59 60 61 62 63 64

After that bits are permuted according to the following table,

The table is row major way, means,

Actual Bit position = Substitute with the bit of row * 8 + column.

Permutation Table
1 2 3 4 5 6 7 8
0 57 49 41 33 25 17 9 1
1 58 50 42 34 26 18 10 2
2 59 51 43 35 27 19 11 3
3 60 52 44 36 63 55 47 39
4 31 23 15 7 62 54 46 38
5 30 22 14 6 61 53 45 37
6 29 21 13 5 28 20 12 4

Bits Rotation

Before the round sub-key is selected, each half of the key schedule state is rotated left by a number of places. This table specifies the number of places rotated.

• The key is divided into two 28-bit parts

• Each part is shifted left (circular) one or two bits

• After shifting, two parts are then combined to form a 56 bit temp-key again

Bits Rotation Table
Number of Round 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Number of Left rotations 1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 1

Key Compression

• The compression P-box changes the 56 bits key to 48 bits key, which is used as a key for the corresponding round.

The table is row major way, means,

Actual Bit position = Substitute with the bit of row * 8 + column.

Key Compression Table
1 2 3 4 5 6 7 8
1 14 17 11 24 01 05 03 28
2 15 06 21 10 23 19 12 04
3 26 08 16 07 27 20 13 02
4 41 52 31 37 47 55 30 40
5 51 45 33 48 44 49 39 56
6 34 53 46 42 50 36 29 32

After this return the Round-Key of 48 bits to the called function, i.e. the Round.

References

  • Data Encryption Standard (DES) (PDF). National Institute of Standards and Technology (NIST). 1999-10-25. FIPS PUB 46-3.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.