A Comprehensive Guide To The Data Encryption Standard (DES) Algorithm in Cryptography.

Data Encryption Standard(DES)…

Ritesh Sahu
5 min readFeb 13, 2023

Introduction...

DES is a widely-used symmetric-key encryption algorithm that has played an important role in the history of cryptography. DES operates on 64-bit blocks of plaintext data and uses a key to encrypt the data into 64-bit ciphertext blocks. Although the initial key for DES consists of 64 bits, every 8th bit of the key is discarded before the encryption process begins, resulting in a 56-bit key. The encryption process involves several substitutions, transposition, and key mixing operations using the Feistel cipher structure, which is divided into 16 rounds. DES has been deemed vulnerable to attacks due to its small key size. Today DES has been largely replaced by more secure encryption algorithms that offer longer key lengths and increased security against brute-force attacks.

How it Work.

It works by dividing the plaintext data into 64-bit blocks and encrypting them using a key, resulting in 64-bit ciphertext blocks. The original key used in DES consists of 64 bits, but 8 bits are discarded before the encryption process, resulting in a 56-bit key. This 56-bit key is then further divided into a 48-bit subkey, which is used in the substitution, transposition, and key mixing operations that make up the Feistel cipher structure. it has been deemed vulnerable to attacks due to its small key size. Today, it has been largely replaced by more secure encryption algorithms that offer longer key lengths and greater protection against brute-force attacks. The Feistel cipher structure consists of 16 rounds and each round uses a different subkey, generated from the 56-bit key by the key schedule algorithm. However, in DES, the same subkey is used in rounds 2 to 16. The encryption process involves a combination of substitution and transposition operations, and key mixing operations, which are carried out using the Feistel cipher structure.

Step1:-

Key Generation:- The initial 64-bit key input undergoes a process known as the Permuted Choice 1 (PC-1) to generate a 56-bit key, which is then used in the key schedule generation process. The PC-1 step is a permutation that reduces the size of the key and ensures that key bits are well distributed throughout the key schedule. The output of the PC-1 step is a 56-bit key, which is then divided into two 28-bit halves. These two halves are then shifted and combined to generate 16 48-bit round keys, which are used in each round of the DES encryption process.

Step2:-

Initial Permutation (IP):- The plaintext is first subjected to an initial permutation (IP) to rearrange the bits into a different order.

Step3:-

16 Feistel Rounds:- The Feistel round is a cryptographic technique used in symmetric encryption algorithms to scramble plaintext into ciphertext. The Feistel structure is made up of multiple rounds, typically 16 rounds, each round consisting of the following steps:

  1. Dividing the plaintext into two 32-bit halves: The plaintext is divided into two halves, each consisting of 32 bits. These two halves, L0 and R0, serve as the inputs for each round of the Feistel structure.
  2. Expansion of R0: The 32-bit R0 is passed through an expansion function, which expands it into a 48-bit value. This expansion increases the complexity of the encryption and makes it more secure by using more bits in the encryption process.
  3. Key mixing: The expanded R0 is XORed with a unique 48-bit subkey generated from the encryption key. This step obscures the relationship between the plaintext and ciphertext by incorporating a unique key into the encryption process.
  4. Substitution: The result of the XOR operation in step 3 is then passed through 8 substitution boxes (S-boxes), which perform non-linear substitutions on the data. These S-boxes increase the security of the encryption by making it more difficult for attackers to determine the plaintext from the ciphertext.
  5. Permutation: The output of the S-boxes is then subjected to a permutation operation, which rearranges the bits in the output. This permutation further obscures the relationship between the plaintext and ciphertext by rearranging the bits in the output.
  6. XOR with L0: The permuted output is XORed with L0. This XOR operation combines the two 32-bit halves of the plaintext, adding complexity to the encryption process.
  7. Updating L0 and R0: After the XOR operation in step 6, L0 becomes R1 and R0 becomes L1 XORed with the output from the XOR operation in step 6. These updated values of L1 and R1 are then used as inputs for the next round of the Feistel structure.
  8. Repeat: Steps 2 to 7 are repeated for each of the remaining 16 rounds, using the updated values of L0 and R0 from the previous round. This repetition increases the complexity of the encryption process, making it more secure.
  9. Concatenation: After all rounds are completed, the final values of L0 and R0 are concatenated to form the ciphertext. This ciphertext can then be transmitted or stored securely, protected by encryption.
1 Round

Step4:-

Swap: After 16 rounds, the final result is the concatenation of R16 and L16, but with the two halves swapped.

Step5:-

Final Permutation/ Inverse Initial Permutation (IP^-1): Finally, the result is subjected to the inverse of the initial permutation, which is the final permutation (IP^-1).

Step6:-

Ciphertext: The output of the final permutation is the ciphertext, which can be transmitted securely over an insecure channel and then decrypted using the same key to obtain the original plaintext.

--

--