Data Encryption Standard - DES Algorithm
Symmetric Key Algorithm:
- In DES, the same key is used for both encryption and decryption. This key must be shared between the sender and receiver securely.
Block Cipher:
- DES operates on fixed-length groups of bits, called blocks. The block size for DES is 64 bits.
- The input data is divided into 64-bit blocks, which are encrypted one block at a time.
Key Length:
- DES uses a 56-bit key (though 64 bits are supplied, 8 bits are for parity checks). The strength of DES relies on the secrecy of this key.
The DES algorithm encrypts data using a series of permutations and substitutions over 16 rounds, transforming a 64-bit input block of plaintext into a 64-bit ciphertext block. Let's break down the steps involved:
Encryption and Decryption in DESEncryption: As described, the plaintext is processed in 16 rounds of substitution, permutation, and key mixing, eventually producing the ciphertext.
Decryption: Decrypting a ciphertext is essentially the reverse of encryption. Since DES is a Feistel cipher, the same process is used for both encryption and decryption—except the round keys are applied in reverse order (starting with the last subkey and working backward).
1. Initial Permutation (IP)
- The first step of DES is to rearrange (permute) the 64-bit plaintext using a fixed permutation table. This is called the Initial Permutation (IP).
- The result is two 32-bit halves, which we'll call the left half (L0) and the right half (R0).
2. 16 Rounds of Encryption
After the initial permutation, DES performs 16 rounds of encryption, each involving key-dependent operations like substitution and permutation. Each round takes the current left and right halves as inputs and produces new left and right halves as outputs.
Each round consists of the following operations:
Round Function (F): The core of DES is the F function, which operates on the right half and the round key.
Key Scheduling: For each round, a 48-bit subkey is derived from the original 56-bit key using a process known as key scheduling. These subkeys are different for each round.
Expansion (E-box): The right half (32 bits) is expanded to 48 bits using a fixed expansion permutation, which allows it to be XORed with the 48-bit subkey.
XOR with Subkey: The expanded right half is XORed with the 48-bit subkey derived for the current round.
Substitution (S-boxes): The result of the XOR is passed through 8 S-boxes. These S-boxes (Substitution boxes) compress the 48-bit output back into 32 bits. The S-boxes perform non-linear substitution, adding complexity to the algorithm.
Permutation (P-box): The 32-bit output from the S-boxes is permuted again using a fixed table to further mix the bits.
Combining Left and Right Halves:
- The left half (L) for the next round is simply the current right half (R).
- The right half (R) for the next round is the result of XORing the current left half (L) with the output of the round function (F). Mathematically:
$R_{i+1}=L_i⊕F(R_i,K_i)$
This process is repeated for 16 rounds, with different subkeys and transformations in each round.
3. Final Permutation (FP)/ Inverse Initial Permutation($IP^{-1}$)
- After the 16 rounds of transformation, the left and right halves are concatenated (combined back together) into a 64-bit block.
- This block is then subjected to the Final Permutation (FP), which is the inverse of the initial permutation (IP). The output is the 64-bit ciphertext.
Comments
Post a Comment