Interactive guide to block cipher modes of operation
Triple DES applies the DES algorithm three times to each data block, using either two or three different keys. This significantly increases security compared to single DES.
Three independent keys
Encrypt → Decrypt → Encrypt
Two keys (K1 = K3)
More common variant
112-bit effective key length
Much stronger than DES
ECB is the simplest mode where each block is encrypted independently using the same key. Identical plaintext blocks produce identical ciphertext blocks.
CBC mode chains blocks together by XORing each plaintext block with the previous ciphertext block before encryption. The first block uses an Initialization Vector (IV).
CFB mode turns a block cipher into a stream cipher. The cipher encrypts the previous ciphertext block (or IV), and the result is XORed with the plaintext.
Processes data bit by bit or byte by byte
Errors don't propagate indefinitely
Suitable for real-time applications
OFB mode creates a keystream by repeatedly encrypting the IV and previous outputs. This keystream is XORed with the plaintext to produce ciphertext.
Independent of plaintext
Bit errors don't spread
Requires synchronized encryption/decryption
CTR mode encrypts a counter value to generate a keystream. The counter is incremented for each block, and the resulting keystream is XORed with the plaintext.
Blocks can be processed independently
Can decrypt any block without previous blocks
Works with any data length
Provides stream cipher properties
Security: ⭐⭐
Performance: ⭐⭐⭐⭐⭐
Parallelization: ⭐⭐⭐⭐⭐
Error Propagation: None
Use Case: Random data only
Security: ⭐⭐⭐⭐
Performance: ⭐⭐⭐
Parallelization: ⭐⭐
Error Propagation: Limited
Use Case: File encryption
Security: ⭐⭐⭐⭐
Performance: ⭐⭐⭐
Parallelization: ⭐⭐
Error Propagation: Limited
Use Case: Real-time data
Security: ⭐⭐⭐⭐
Performance: ⭐⭐⭐
Parallelization: ⭐⭐
Error Propagation: None
Use Case: Noisy channels
Security: ⭐⭐⭐⭐
Performance: ⭐⭐⭐⭐⭐
Parallelization: ⭐⭐⭐⭐⭐
Error Propagation: None
Use Case: High-speed encryption
| Mode | Padding Required | IV/Nonce | Parallel Decrypt | Random Access |
|---|---|---|---|---|
| ECB | ✅ | ❌ | ✅ | ✅ |
| CBC | ✅ | ✅ | ✅ | ❌ |
| CFB | ❌ | ✅ | ❌ | ❌ |
| OFB | ❌ | ✅ | ❌ | ❌ |
| CTR | ❌ | ✅ | ✅ | ✅ |
For any real data - patterns will be visible
Traditional choice for file encryption and Message Authentication
Real-time data, network protocols
Satellite communications, error-prone channels
High-speed encryption, disk encryption