Use this when using block ciphers and choosing modes.
Block Cipher
A block cipher encrypts fixed-size blocks, such as AES's 128 bits, and needs a mode of operation like GCM, CBC or CTR to encrypt longer data securely.
1. Block ciphers encrypt fixed-size blocks; modes make them usable for data streams.
2. Never ECB (patterns leak).
3. Prefer AEAD (GCM).
4. XTS for disks.
5. 64-bit block ciphers are obsolete.
block cipher + mode → ciphertext
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Common mistakes Narrow the fault
- Using ECB mode.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Block ciphers encrypt fixed-size blocks.
- A mode of operation is needed for longer data.
- Prefer AEAD modes like GCM.
- Mode of operation in use — GCM/CTR/CBC/XTS
- Padding handling (CBC) — oracle risk
- Block size (128-bit) — birthday bounds
ReferenceWhy it matters1 section · depth on demand
Modes of operation
| Mode | Properties | Use |
|---|---|---|
| ECB | Same plaintext → same ciphertext; leaks patterns | Never for data |
| CBC | Needs random IV and separate MAC | Legacy TLS/IPsec |
| CTR | Turns a block cipher into a stream cipher | Building block |
| GCM | CTR + authentication (AEAD) | TLS, IPsec, storage |
| XTS | Designed for disk sectors | Full-disk encryption |
ReferenceHow it works1 section · depth on demand
In depth
A block cipher encrypts fixed-size blocks of data (128 bits for AES) with a key. To encrypt messages longer than one block, a mode of operation defines how blocks are chained or combined, and the mode determines much of the real-world security.
| Mode | Type | Notes |
|---|---|---|
| ECB | Each block independent | Leaks patterns — never use |
| CBC | Chained, needs IV and padding | Legacy; padding oracle risks |
| CTR | Turns block cipher into stream cipher | Needs unique nonce |
| GCM | CTR + authentication | Standard AEAD |
| XTS | Tweakable, for storage | Disk encryption |
Use authenticated (AEAD) modes for data in transit and generally wherever possible.
ReferenceImportant terms & boundaries2 sections · depth on demand
Modes compared
| Mode | Authenticated | Parallel | Notes |
|---|---|---|---|
| ECB | No | Yes | Never use — reveals patterns |
| CBC | No | Decrypt only | Needs HMAC; padding oracle risk |
| CTR | No | Yes | Never reuse a nonce |
| GCM | Yes | Yes | Standard choice |
| XTS | No | Yes | Disk encryption only |
Block sizes
| Cipher | Block size | Safe data per key (birthday bound) |
|---|---|---|
| AES | 128 bits | Very large (~2⁶⁴ blocks; practical limits are lower for GCM) |
| 3DES, Blowfish | 64 bits | ~32 GB (Sweet32) |
Small block sizes are a reason by themselves to retire old ciphers.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Symmetric Cryptography → Block Cipher. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://csrc.nist.gov/pubs/fips/197/final · confidence 94%