The Data Encryption Standard (DES) is a symmetric-key algorithm for the encryption of digital
data. It uses a 56-bit key to encrypt a 64-bit plaintext block into a 64-bit ciphertext block. The
general structure of DES involves several stages, including initial permutation, multiple rounds
of a round function, and a final permutation.
General Structure of DES:
1. Initial Permutation (IP): The 64-bit plaintext is rearranged according to a fixed
permutation table. This step does not provide security but facilitates the processing of
the data.
2. Key Transformation: The 56-bit key is permuted and reduced from 64 bits using
Permuted Choice 1 (PC-1). The key is then split into two 28-bit halves.
3. Rounds: DES consists of 16 rounds of identical operations. In each round:
o The 56-bit key is subjected to a left circular shift and then permuted using
Permuted Choice 2 (PC-2) to produce a 48-bit subkey.
o The 64-bit data block is split into two 32-bit halves, left (L) and right (R).
o The right half (R) is expanded to 48 bits using an expansion permutation.
o The expanded R is XORed with the 48-bit subkey.
o The result is passed through 8 S-boxes, each producing a 4-bit output, resulting in
a 32-bit output.
o This 32-bit output is permuted using a fixed permutation (P-box).
o The permuted output is XORed with the left half (L) to produce the new right half
(R').
o The original right half (R) becomes the new left half (L').
4. 32-bit Swap: After the 16 rounds, the two 32-bit halves are swapped.
5. Inverse Initial Permutation (IP⁻¹): The final 64-bit block is permuted using the inverse of
the initial permutation to produce the ciphertext.
Single Round Function:
The single round function in DES is the core of the encryption process and involves the following
steps:
1. Expansion: The 32-bit right half (R) is expanded to 48 bits using an expansion
permutation (E-table). This step increases the size of R to match the 48-bit subkey.
2. Key Mixing: The expanded 48-bit R is XORed with the 48-bit subkey generated from the
key schedule.
3. Substitution: The 48-bit result is divided into 8 groups of 6 bits each. Each group is
processed by a different S-box, which reduces the 6 bits to 4 bits. The S-boxes provide
the non-linear transformation crucial for the security of DES.
4. Permutation: The 32-bit output from the S-boxes is permuted using a fixed permutation
(P-box). This step disperses the bits to provide diffusion.
5. XOR with Left Half: The permuted 32-bit output is XORed with the left half (L) of the
data block to produce the new right half (R').
6. Swap: The original right half (R) becomes the new left half (L') for the next round.
This round function is repeated 16 times, with different subkeys in each round, to ensure the
security and complexity of the encryption process. The combination of substitution and
permutation in each round provides both confusion and diffusion, which are essential
properties of a secure cipher.