Here is your content neatly aligned, cleanly formatted, and structured — suitable for
assignment, exam notes, or PDF creation.
(If you want it center-aligned, table format, or PDF, tell me — I will generate.)
Block Cipher Modes of Operation – Overview (Aligned &
Clean Format)
A block cipher processes input one block at a time and produces a corresponding output
block. Typical block sizes are 64 bits or 128 bits. When plaintext exceeds the block size, it is
divided into equal-sized blocks.
To use block ciphers effectively, NIST defines five standard modes, each adapting the cipher
to different applications.
Below are the three requested modes:
1. Electronic Codebook (ECB) Mode
Description & Operation
Plaintext is divided into b-bit blocks. Last block is padded if needed.
Each block is encrypted independently using the same key.
Encryption:
Cᱼ = E(K, Pᱼ) for j = 1…N
Decryption:
Pᱼ = D(K, Cᱼ) for j = 1…N
Every plaintext block always maps to the same ciphertext block for the same key →
“Codebook”.
Characteristics & Security
Repetition weakness: identical plaintext blocks → identical ciphertext blocks.
Not secure for long, structured messages.
Recommended only for small data (e.g., encrypting keys).
Error in one block affects only that block.
Neat Sketch (Aligned Text Form)
Encryption
Plaintext Block Pᱼ → Encrypt(K) → Ciphertext Block Cᱼ
Decryption
Ciphertext Block Cᱼ → Decrypt(K) → Plaintext Block Pᱼ
1/4
2. Cipher Block Chaining (CBC) Mode
Description & Operation
Each plaintext block is XORed with previous ciphertext block before encryption.
First block uses Initialization Vector (IV):
C₁ = E(K, P₁ ⊕ IV)
For j ≥ 2:
Cᱼ = E(K, Pᱼ ⊕ Cⱼ₋₁)
Decryption:
Pᱼ = D(K, Cᱼ) ⊕ Cⱼ₋₁
For the first block:
P₁ = D(K, C₁) ⊕ IV
IV must be unpredictable.
Characteristics & Security
Eliminates the pattern-leakage issue of ECB.
Error propagation:
Error in Cᱼ corrupts Pᱼ and Pⱼ₊₁ only.
If plaintext Pᱼ has a bit error before encryption, all following ciphertext blocks are also
affected.
Neat Sketch (Aligned Text Form)
Encryption
Pᱼ → XOR with Cⱼ₋₁/IV → Encrypt(K) → Cᱼ
Decryption
Cᱼ → Decrypt(K) → XOR with Cⱼ₋₁/IV → Pᱼ
3. Counter (CTR) Mode
Description & Operation
Uses a counter value for each block: T₁, T₂, …, Tₙ
Counter must be unique for each block.
Encryption:
Cᱼ = Pᱼ ⊕ E(K, Tᱼ)
Decryption:
Pᱼ = Cᱼ ⊕ E(K, Tᱼ)
Counter is initialized with a nonce and incremented.
2/4
No chaining → high parallelism.
No padding needed.
Characteristics & Security
Behaves like a stream cipher.
Parallel processing possible → high efficiency.
Keystream can be precomputed.
Supports random access to any block.
Only encryption algorithm required.
Neat Sketch (Aligned Text Form)
Encryption
Tᱼ → Encrypt(K) → Output E(K, Tᱼ) → XOR with Pᱼ → Cᱼ
Decryption
Tᱼ → Encrypt(K) → Output E(K, Tᱼ) → XOR with Cᱼ → Pᱼ
CBC vs CTR – Easy Understanding
Feature CBC Mode CTR Mode
Processing Sequential Parallel
Error Effect Affects 2 blocks Only the corrupted block
Padding Required Not required
Random Access No Yes
Speed Slower Faster
Dependency Depends on previous ciphertext Independent blocks
Analogy
CBC = Assembly line
Each block depends on the previous block’s output.
CTR = Pre-prepared line
Keystream is generated independently; blocks are processed anytime.
If you want this content in:
✅ PDF
3/4
✅ Center alignment
✅ Two-column layout
✅ Exam-ready short notes
Just tell me — I will generate it.
4/4