Block Cipher Reference Guide
General reference for block cipher design, modes of operation, and security properties.
Core Concepts
A block cipher encrypts fixed-size blocks of plaintext into ciphertext blocks under a key. The two dominant structures are Feistel networks (used by DES, Twofish) and substitution-permutation networks (used by AES, Serpent). The block size determines the maximum data length before mode-related issues arise. Key size determines resistance to brute-force attacks.
- block size
- Fixed input/output length
- key size
- Security parameter
- structure
- Feistel or SPN
128 bits for AES 128/192/256 bits tradeoffs differ Modes of Operation
Block ciphers require modes of operation to handle variable-length messages. ECB is insecure for most data as it preserves patterns. CBC and CTR provide confidentiality, while GCM and CCM add authentication. The choice of mode affects security, performance, and error propagation characteristics. Modern protocols prefer AEAD modes like AES-GCM.
- ECB
- Insecure, preserves patterns
- CBC
- Sequential, needs IV
- GCM
- Parallelizable AEAD
never use common legacy modern default