Initialization Vector (IV) and Algorithm Block Size
In many symmetric encryption modes (e.g., CBC, CFB, GCM), the Initialization Vector (IV) must be the same length as the block size of the cipher algorithm. This ensures that the IV fits properly into the cipher's block processing structure.
The block size is not the same as the key size — it's the size of the fixed input blocks the algorithm processes internally.
Common Symmetric Ciphers and Their Block Sizes
Algorithm | Block Size (in bits) | Block Size (in bytes) |
---|---|---|
AES | 128 bits | 16 bytes |
DES | 64 bits | 8 bytes |
3DES | 64 bits | 8 bytes |
Blowfish | 64 bits | 8 bytes |
RC2 | 64 bits | 8 bytes |
Note:
- For AES, regardless of key size (128, 192, or 256 bits), the block size is always 128 bits (16 bytes).
- Modes like GCM (for AES-GCM) typically use a 12-byte IV, which is standardized for performance and security, even though AES has a 16-byte block size — the algorithm handles this internally.