Pcornel
Browse topics
Options
Recent
Favorites
Security · Technical reference

CBC

Direct answer

CBC (Cipher Block Chaining) XORs each plaintext block with the previous ciphertext block. It needs a random IV and separate integrity protection and has been hit by padding-oracle attacks, so GCM is preferred.

When to use this

Use this when CBC mode is used and you need to check IVs, MACs and padding-oracle risk.

First 30 seconds

1. CBC needs a random IV and separate MAC (encrypt-then-MAC).

2. Padding oracles (POODLE, Lucky13) have broken implementations.

3. Prefer GCM/ChaCha20.

4. Remove CBC TLS suites where clients allow.

5. Uniform error handling.

Operational verification

IV + plaintext blocks chained → ciphertext (+ MAC)

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Cryptography, PKI and secrets
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformCryptography, PKI and secrets
Scope / prerequisiteUse this when CBC mode is used and you need to check IVs, MACs and padding-oracle risk.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Padding oracle Narrow the fault

CBC uses padding (PKCS#7). If a server reveals whether padding was valid — through different errors or timing — an attacker can decrypt ciphertext byte by byte without the key. POODLE (SSL 3.0) and Lucky13 (TLS) were variants. Verifying a MAC over the ciphertext before decrypting (encrypt-then-MAC) prevents it.

Step 2 Common mistakes Narrow the fault
  • CBC without integrity (padding oracle risk).
Evidence references

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.

observation · 1
Key points
  • CBC needs a random, unpredictable IV.
  • It needs a separate MAC (encrypt-then-MAC).
  • Padding oracle attacks have broken many CBC uses.
Key checks
  • nmap --script ssl-enum-ciphers -p 443 <host> | grep CBC — CBC suites
  • Encrypt-then-MAC/HMAC present — integrity
  • Padding oracle error handling — uniform errors
ReferenceWhy it matters1 section · depth on demand

Risks

  • Without a MAC, attackers can flip bits in the next block.
  • Padding oracle attacks (POODLE, Lucky13) recover plaintext when errors leak whether padding was valid.
  • A predictable IV allowed BEAST in TLS 1.0.

Use CBC only with encrypt-then-MAC, or replace it with GCM.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

CBC (Cipher Block Chaining) mode XORs each plaintext block with the previous ciphertext block before encryption, using a random IV for the first block. It hides patterns that ECB reveals, but it provides no integrity on its own and requires padding, which led to practical attacks (padding oracles such as POODLE and Lucky Thirteen).

Safe use requires a random, unpredictable IV per message and a separate MAC applied after encryption (encrypt-then-MAC). In practice, prefer AEAD modes (GCM, ChaCha20-Poly1305); TLS 1.3 removed CBC suites entirely. Remove CBC suites from TLS 1.2 configurations where clients allow it.

Correct use

  • Random, unpredictable IV per message (not a counter, not reused).
  • Encrypt-then-MAC with HMAC over IV and ciphertext.
  • Constant-time padding and MAC checks to avoid padding oracles (POODLE, Lucky13).
  • Prefer GCM or ChaCha20-Poly1305 for new designs; TLS 1.3 removed CBC suites.
Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docCryptography, PKI and secrets current

Authoritative/upstream documentation reviewed for bounded claims in Symmetric Cryptography → CBC. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://csrc.nist.gov/pubs/fips/197/final · confidence 94%
Confirmation

Confirm action

Continue?