Trusted answers to developer questions

Aqsa Amir

Grokking Modern System Design Interview for Engineers & Managers

**Feistel cipher** is a design model that derives different symmetric block ciphers, such as

Feistel cipher structure encrypts plain text in several rounds, where it applies

Feistel cipher structure converts plain text to cipher text using the following steps:

The Feistel cipher structure above follows the steps below:

- Convert plain text into binary using ASCII codes of each character.
- Divide the data into blocks, processed one at a time.
- The encryption process takes two inputs, one block of data and a master key.
- When the block is ready for the encryption process, divide it into two halves of equal length. The left half is denoted by
$L_{0}$ and the right half is characterized by$R_{0}$ . - Data is passed through
$n$ rounds of execution, where the$n$ is specified by the design of the algorithm. - Each round uses the same encryption function and a different sub key generated from the master key.
- To generate the left half of the next round,
$L_{i+1}$ , the current right half,$R_{i}$ is assigned to it. - To generate the right half of the next round,
$R_{i+1}$ , the current right half,$R_{i}$ undergoes the following steps: $R_{i}$ and the$subkey_{i}$ is passed through an encryption function.- The result from step I is XORed with the left half of the current round,
$L_{i}$ . - The result from step II is assigned to the right half of the next round,
$R_{i+1}$ . - The left and right half of data obtained after n rounds of execution is swapped again before concluding the Feistel cipher.

The decryption process uses a similar procedure: cipher text is fed to the algorithm and the exact steps are followed. The only difference is that the keys used in the decryption process follow a reverse order of that used in the encryption process.

Note:Ensure that the same key is used for encryption and decryption process for the same rounds.

Feistel cipher structure has the following five components:

**Number of rounds:**The greater the number of rounds,$n$ , used for the encryption/decryption process, the higher the complexity; hence, the security of the block cipher.**Sub key generation algorithm:**Complex algorithms make it difficult for intruders to crack the key.**Encryption function:**Complex functions enhance the security of the block cipher, making them difficult to crack.**Block size:**The larger the size of the block, the more secure and complex the block cipher is. However, a larger block size reduces the execution speed of the encryption and decryption process.**Key size:**A large size key increases the security of the block cipher. However, it also makes the encryption and decryption process slow.

RELATED TAGS

CONTRIBUTOR

Aqsa Amir

Copyright ©2022 Educative, Inc. All rights reserved

Grokking Modern System Design Interview for Engineers & Managers

Keep Exploring

Related Courses