# DES (Data Encryption Standard)

The symmetric-key block cipher encryption method known as DES, or Data Encryption Standard, was created by IBM in the 1970s and approved as a standard by the US government in 1977. It can be used for both data encryption and decryption. In numerous applications, such as secure communication and financial transactions, DES is frequently employed for data encryption.

## General Working

• Using a 56-bit key, DES encrypts data in 64-bit blocks.
• The algorithm transforms the plaintext into ciphertext via a sequence of mathematical operations, including as substitution, permutation, and XOR.
• The encryption process repeats these mathematical procedures 16 times, creating a different subkey from the original key for each round.

## Example

Suppose we have a 64-bit plaintext message that we want to encrypt using DES. Let’s say our plaintext message is “Hello123” (in ASCII representation) and our 56-bit encryption key is “SecretKe”.

### Step 1:

Key generation, During key generation, the algorithm expands and transforms the 56-bit encryption key into sixteen 48-bit subkeys, generating one for each encryption round. The derivation of each subkey from the original key is accomplished through a process known as key scheduling.

### Step 2:

Initial Permutation (IP) The 64-bit plaintext message undergoes an initial permutation (IP) stage, which rearranges the bits according to a fixed permutation table.

### Step 3:

Encryption Rounds The encryption process consists of 16 rounds, where each round performs a series of mathematical operations on the 64-bit data block using a different 48-bit subkey.

In each encryption round, the algorithm performs the following steps:

1. Expand the 32-bit right half of the previous round’s data block to 48 bits using an expansion permutation table.
2. XOR the expanded 48-bit data with the 48-bit subkey specific to the current round.
3. Divide the XOR result into eight 6-bit blocks and substitute each block using eight S-Boxes, performing nonlinear substitutions based on their 6-bit inputs.
4. Permute the results from the S-Boxes using a fixed permutation table.
5. XOR the permuted 32-bit data with the left half of the previous round’s data block.
6. Swap the results of the XOR operation, making the previous right half the new left half. Repeat this process for the specified number of rounds.

### Step 4:

Final Permutation (FP) After completing the 16 encryption rounds, the resulting data undergoes a final permutation (FP) stage, which is the inverse of the initial permutation.

### Step 5:

Ciphertext The final permutation generates the 64-bit ciphertext, which is the encrypted form of the original plaintext message.

In our case, the DES algorithm would represent the encrypted message as a 64-bit ciphertext. It’s important to note that this example provides a simplified explanation of the DES algorithm, intended for easy understanding.