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)
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)
The final permutation is the inverse of the initial permutation; the table is interpreted similarly.

Expansion function (E)
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)


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

Permuted choice 1 (PC-1)
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)
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)
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. 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.

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

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.

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