Block Cipher, Feistel Cipher & DES – Complete Notes
📘 1. Block Cipher Principles
🔹 What is a Block Cipher?
A block cipher is a symmetric key cipher that encrypts fixed-size blocks of plaintext
(e.g., 64 or 128 bits) into ciphertext using a shared secret key.
📙 2. Block Cipher Design Principles
When designing a secure block cipher, the following principles are considered:
🔐 1. Confusion
Make the relationship between the key and ciphertext as complex as
possible.
Typically achieved using substitution techniques.
Definition: Confusion hides the relationship between the ciphertext and the
key.
Purpose: Even if someone sees the ciphertext, they should not be able to
guess the key.
How it is achieved?: Using substitution operations like S-boxes.
Example: Replacing each letter with a different one based on a rule (e.g.,
Caesar Cipher, or S-box in DES).
🔐 2. Diffusion
Definition: Diffusion spreads the influence of a single plaintext bit over many
ciphertext bits.
Purpose: So that even a small change in plaintext or key changes the
ciphertext drastically.
How it is achieved?: Using permutations, mixing, or transposition techniques.
Example: If you change one letter in the plaintext, the whole ciphertext
becomes different (Avalanche effect).
Spread the influence of a single plaintext bit over many ciphertext bits.
Typically achieved using permutation.
🔐 3. Number of Rounds
Multiple rounds are used to improve security.
Each round introduces more confusion and diffusion.
One round of confusion & diffusion is not enough.
Multiple rounds increase security and complexity.
Common ciphers use 10 to 16 rounds (DES uses 16).
Each round applies:
o Subkey (from the main key)
o Confusion (e.g., S-box)
o Diffusion (e.g., permutation or mixing)
🔁 More rounds = more strength = harder to break.
🔐 4. Key Size and Block Size
Larger key size = harder to brute-force.
Larger block size = better security against pattern analysis.
Block Size: Number of bits encrypted at once (e.g., 64 bits in DES, 128 bits in
AES)
Key Size: Length of the encryption key (e.g., 56 bits in DES, 128/192/256 in
AES)
🔐 5. Round Function
Each round uses a function that processes part of the data with a round key.
Should be non-linear and provide good confusion/diffusion.
Core part of each encryption round.
Takes input and subkey and applies operations:
o Expansion
o XOR with subkey
o Substitution (S-box)
o Permutation
🎯 The goal is to introduce both confusion and diffusion in each round.
🔐 6. Subkey Generation (Key Scheduling)
Subkeys for each round are derived from the main key using a secure
algorithm.
🔐 7. S-Boxes and P-Boxes
S-Boxes (Substitution boxes) introduce non-linearity.
S-boxes are used to substitute a set of bits with another set using a predefined
lookup table.
They introduce non-linearity to make the cipher unpredictable.
DES uses 8 S-boxes, each replacing 6 bits with 4 bits.
P-Boxes (Permutation boxes) help in diffusion.
P-boxes shuffle the bits of input data to spread them across the block.
They help achieve diffusion.
DES uses a fixed P-box after S-box substitution.
🔄 Like rearranging the letters of a word to confuse the attacker.
Example to Demonstrate Confusion & Diffusion:
Let’s say:
Plaintext: 10101010
Ciphertext (after encryption): 11011100
If you change just one bit in plaintext: 10101011,
The new ciphertext becomes: 00100110
➡️This shows diffusion (a small change in input affects the entire output).
Also, from ciphertext alone, you can’t guess the key, showing confusion.
📘 3. Feistel Cipher Structure (Core Design)
The Feistel Cipher is a block cipher structure that allows easy encryption and
decryption using the same algorithm with reversed subkeys.
🔹 Feistel Round Structure:
For a block of plaintext P, split into:
P = (L₀, R₀) → Left and Right halves
For each round i (from 1 to n):
Lᵢ = Rᵢ₋₁
Rᵢ = Lᵢ₋₁ ⊕ f(Rᵢ₋₁, Kᵢ)
Where:
f() is the round function
Kᵢ is the subkey for round i
After the last round, combine (Rₙ, Lₙ) to get the ciphertext.
🔹 Decryption Process:
Same as encryption, but apply subkeys in reverse order:
Kₙ, Kₙ₋₁, ..., K₁
🔹 Advantages:
Easy to implement
Invertible with same algorithm
Foundation for many real ciphers like DES
📘 4. Data Encryption Standard (DES)
DES is a block cipher based on the Feistel structure and was one of the earliest
encryption standards.
🔹 DES Parameters:
Block size: 64 bits
Key size: 56 bits (actual: 64 bits, with 8 parity bits)
Rounds: 16 rounds
🔹 DES Encryption Process:
1. Initial Permutation (IP)
2. Split 64-bit block into L₀ and R₀
3. Repeat 16 Feistel rounds:
o Expand Rᵢ₋₁ from 32 → 48 bits (E-box)
o XOR with subkey (48-bit round key)
o Apply S-boxes (8 S-boxes, 6→4 bits each → total 32 bits)
o Apply P-box (Permutation)
o Combine with Lᵢ₋₁
4. Swap L and R
5. Final Permutation (IP⁻¹)
🔹 DES Decryption:
Same process, reverse order of subkeys.
🔹 DES Weaknesses:
56-bit key is now considered too short (vulnerable to brute-force)
Replaced by AES (Advanced Encryption Standard)
✅ Visual Summary Flow:
1. Block Cipher Concepts
↓
2. Block Cipher Design Principles
↓
3. Feistel Cipher Structure
↓
4. DES – A real-world Feistel Cipher
Absolutely! Here's the updated notes with a worked example of DES encryption
using simplified values (since full DES is very complex for manual calculation). This is
a teaching-friendly example that demonstrates the Feistel logic inside DES without
overwhelming students.
🧾 Block Cipher, Feistel Cipher & DES – Complete Notes with DES Example
🧪 5. DES Example (Simplified)
🔔 Note for Teachers:
Real DES involves complex steps: 64-bit blocks, 16 rounds, bit-level permutations (IP,
E, P), and 8 S-boxes. For classroom purposes, we use a simplified 2-round DES-like
Feistel cipher to explain the logic.
🧩 Simplified DES-like Example (2 rounds)
Plaintext: 10101010 11001100 (16 bits)
Split into:
L0 = 10101010
R0 = 11001100
Key: Let’s use 2 simple subkeys:
K1 = 11110000
K2 = 00001111
🔁 Round 1:
L1 = R0 = 11001100
R1 = L0 ⊕ f(R0, K1)
Let’s define f(R, K) as a simple XOR:
f(R0, K1) = R0 ⊕ K1 = 11001100 ⊕ 11110000 = 00111100
Now compute:
R1 = 10101010 ⊕ 00111100 = 10010110
➡️After Round 1:
L1 = 11001100
R1 = 10010110
🔁 Round 2:
L2 = R1 = 10010110
R2 = L1 ⊕ f(R1, K2)
Compute f(R1, K2) = 10010110 ⊕ 00001111 = 10011001
Then:
R2 = 11001100 ⊕ 10011001 = 01010101
➡️After Round 2:
L2 = 10010110
R2 = 01010101
✅ Final Ciphertext = L2 || R2
= 10010110 01010101
📚 Summary Table:
Round L R f(R, K) New R (L ⊕ f)
0 10101010 11001100
1 11001100 10010110 00111100 10010110
2 10010110 01010101 10011001 01010101
🧠 Learning Outcome:
This example shows:
How DES uses Feistel rounds
How the same structure enables encryption and decryption
The role of subkeys and the f function