Graph
Cipher Block Chaining

🔗Cipher Block Chaining

NEW

Also known as: CBC

A block cipher mode where each plaintext block is XORed with the previous ciphertext block before encryption, using a random IV for the first block.

DESCRIPTION

Cipher-Block Chaining (CBC) mitigates ECB’s pattern leakage by chaining blocks: each plaintext block is combined with the previous ciphertext block before encryption. A random, unpredictable IV is required for the first block to ensure semantic security. CBC is widely supported and secure when used correctly with proper IV generation and authenticated integrity (e.g., encrypt-then-MAC). However, CBC is vulnerable to padding oracle attacks if integrity is not enforced and decryption errors are exposed. Modern practice increasingly favors AEAD modes like GCM, but CBC remains important for compatibility.

ALTERNATIVE DEFINITIONS

NIST

In the CBC mode, the previous ciphertext block is XORed with the current plaintext block before encryption; an IV is used for the first block.

Captures chaining and IV requirements per NIST.

Source

Wikipedia

Cipher block chaining (CBC) uses an initialization vector (IV) and chains each plaintext block with the previous ciphertext block before encryption.

Emphasizes IV usage and chaining mechanism.

Source

Electronic Codebook Cipher Feedback Mode Output Feedback Mode Initialization Vector Padding MAC Authenticated Encryption Symmetric Block Cipher Algorithms Padding Oracle Attack

COMPETING TERMS

Counter AES-GCM

RELATIONS

KNOWLEDGE AREAS

Data Security Software Engineering

TARGET AUDIENCE

Security Architect Cybersecurity Engineer Software Developer DevOps Engineer

EXTERNAL SOURCES

  • Wikipedia - Block cipher mode of operation
  • NIST - Definition and security considerations for CBC
  • Stanford University - Course notes on CBC and padding oracles

TOP QUESTIONS

CBC is widely implemented and avoids ECB’s pattern leaks. When combined with a MAC, it yields strong confidentiality and integrity.

Category: Relevancy

What are the main risks of Cipher-Block Chaining?

Padding oracle attacks arise if integrity is not enforced and error messages leak; poor IVs also weaken security.

Category: Risks

How should CBC be used safely?

Use random IVs and pair with a MAC in encrypt-then-MAC construction or prefer AEAD modes.

Category: BestPractices

Is CBC parallelizable?

Encryption is sequential due to chaining, but decryption is parallelizable by block.

Category: Performance

When should I choose CBC over GCM?

Generally choose GCM unless compatibility constraints require CBC; ensure proper MAC if CBC is used.

Category: Alternatives

Does CBC prevent bit-flipping attacks?

CBC is malleable without authentication; use a MAC or AEAD to prevent tampering.

Category: Misunderstanding

What IV requirements apply to CBC?

IVs must be unpredictable and unique; random IVs are recommended to ensure semantic security.

Category: Requirements

How does CBC compare to CTR mode?

CBC is chaining-based and not fully parallel for encryption; CTR is a stream-like mode supporting parallelism and random access.

Category: Comparison

Is CBC compliant with modern standards?

Yes, but guidance increasingly recommends AEAD; CBC remains acceptable with proper integrity protection.

Category: Compliance