A block cipher encrypts fixed-size chunks of data, transforming each block into ciphertext with a secret key. AES is a symmetric block cipher: the same key encrypts and decrypts, and each AES block is 128 bits (16 bytes). section 5.1
Longer messages must be divided into blocks, with padding added when the final block is short. A mode of operation specifies how the cipher handles data larger than one block. section 5.1 section 5.2
Treat the block cipher and its configuration as separate security decisions:
- Avoid ECB mode: independently encrypted identical blocks produce identical ciphertext, exposing repeating plaintext patterns. section 5.2
- Prefer authenticated encryption such as AES-GCM, which provides confidentiality, integrity, and authenticity together. section 5.7
- Use a random, unique IV for every encryption with the same key; AES-GCM also produces an authentication tag that detects tampering. section 5.7
Why ECB leaks structure
If an HTTP response repeatedly begins with the same 16-byte block, ECB produces the same ciphertext block each time. An observer can recognize the pattern and potentially substitute ciphertext without recovering the key. section 5.2
Figure 5.2 AES is a block cipher because it requires its input to be a fixed size: 128 bits. AES is a symmetric cipher because the key used for encryption is the same one used for decryption.
Use the diagram to distinguish AES’s fixed 128-bit block requirement from its symmetric use of one key for encryption and decryption. section 5.1


