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)

IP58504234261810260524436282012462544638302214664564840322416857494133251791595143352719113615345372921135635547393123157 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)

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

Expansion function (E)

E3212345456789891011121312131415161716171819202120212223242524252627282928293031321 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)

P1672021291228171152326518311028241432273919133062211425

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

Permuted choice 1 (PC-1)

PC-1+ Left5749413325179158504234261810259514335271911360524436+ Right6355473931231576254463830221466153453729211352820124 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)

PC-21417112415328156211023191242681672720132415231374755304051453348444939563453464250362932 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-boxesS1 x0000x x0001x x0010x x0011x x0100x x0101x x0110x x0111x x1000x x1001x x1010x x1011x x1100x x1101x x1110x x1111x 0yyyy01441312151183106125907 0yyyy10157414213110612119538 1yyyy04114813621115129731050 1yyyy11512824917511314100613S2 x0000x x0001x x0010x x0011x x0100x x0101x x0110x x0111x x1000x x1001x x1010x x1011x x1100x x1101x x1110x x1111x 0yyyy01518146113497213120510 0yyyy13134715281412011069115 1yyyy00147111041315812693215 1yyyy11381013154211671205149S3 x0000x x0001x x0010x x0011x x0100x x0101x x0110x x0111x x1000x x1001x x1010x x1011x x1100x x1101x x1110x x1111x 0yyyy01009146315511312711428 0yyyy11370934610285141211151 1yyyy01364981530111212510147 1yyyy11101306987415143115212S4 x0000x x0001x x0010x x0011x x0100x x0101x x0110x x0111x x1000x x1001x x1010x x1011x x1100x x1101x x1110x x1111x 0yyyy07131430691012851112415 0yyyy11381156150347212110149 1yyyy01069012117131513145284 1yyyy13150610113894511127214S5 x0000x x0001x x0010x x0011x x0100x x0101x x0110x x0111x x1000x x1001x x1010x x1011x x1100x x1101x x1110x x1111x 0yyyy02124171011685315130149 0yyyy11411212471315015103986 1yyyy04211110137815912563014 1yyyy11181271142136150910453S6 x0000x x0001x x0010x x0011x x0100x x0101x x0110x x0111x x1000x x1001x x1010x x1011x x1100x x1101x x1110x x1111x 0yyyy01211015926801334147511 0yyyy11015427129561131401138 1yyyy09141552812370410113116 1yyyy14321295151011141760813S7 x0000x x0001x x0010x x0011x x0100x x0101x x0110x x0111x x1000x x1001x x1010x x1011x x1100x x1101x x1110x x1111x 0yyyy04112141508133129751061 0yyyy11301174911014351221586 1yyyy01411131237141015680592 1yyyy16111381410795015142312S8 x0000x x0001x x0010x x0011x x0100x x0101x x0110x x0111x x1000x x1001x x1010x x1011x x1100x x1101x x1110x x1111x 0yyyy01328461511110931450127 0yyyy11151381037412561101492 1yyyy07114191214206101315358 1yyyy12114741081315129035611 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 Table12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 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 Table12345678057494133251791158504234261810225951433527191133605244366355473943123157625446385302214661534537629211352820124

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 TableNumber of Round12345678910111213141516Number of Left rotations1122222212222221

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 Table12345678114171124010503282150621102319120432608160727201302441523137475530405514533484449395663453464250362932 After this return the Round-Key of 48 bits to the called function, i.e. the Round.

References

External links The DES Algorithm Illustrated