Graph
CBC Mode

🔗CBC Mode

NEW

A confidentiality mode that chains each plaintext block with the previous ciphertext via XOR, obscuring patterns in block cipher encryption.

DESCRIPTION

Cipher Block Chaining is a classic block cipher mode for confidentiality. Each block is XORed with the previous ciphertext and encrypted, requiring a random IV. It prevents visible patterns found in ECB. Incorrect padding handling can cause vulnerabilities, notably padding oracle attacks. CBC lacks built-in authentication; pair with MACs or use AEAD modes instead. It remains relevant in legacy systems and certain standards.

ALTERNATIVE DEFINITIONS

NIST

The Cipher Block Chaining (CBC) mode is a confidentiality mode of operation for block ciphers.

Defines CBC strictly as a confidentiality-only mode.

Source

Wikipedia

In CBC mode, each block of plaintext is XORed with the previous ciphertext block before being encrypted.

Concise operational description of chaining behavior.

Source

Rijndael Padding Initialization Vector Authenticated Encryption SP 800-38A Padding Oracle IV Randomization TLS Confidentiality Symmetric Block Cipher Algorithms

COMPETING TERMS

GCM Mode CTR Mode

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#Cipher Block Chaining (CBC)
  • NIST - CBC mode specification
  • IETF - AES-CBC usage in protocols
  • OpenSSL - Command-line CBC examples

TOP QUESTIONS

When should CBC Mode be avoided?

Avoid CBC in new designs lacking authentication or where padding oracle risks exist; prefer AEAD modes like GCM.

Category: Risks

Why does CBC Mode require a random IV?

A random IV ensures identical plaintexts yield different ciphertexts, preventing pattern leakage.

Category: Requirements

What causes padding oracle vulnerabilities in CBC?

Improper error handling during decryption reveals padding validity, enabling attackers to learn plaintexts.

Category: Mistakes

Can CBC provide integrity and authenticity?

Not inherently; combine with a MAC (e.g., HMAC) or use AEAD modes.

Category: Misunderstanding

Is CBC still relevant today?

It persists in legacy systems and standards, but new deployments should prefer AEAD.

Category: Relevancy

How does CBC compare to CTR Mode?

CBC is sequential and needs padding; CTR is parallelizable, padding-free, and often paired with authentication.

Category: Comparison

What are performance characteristics of CBC?

CBC is not easily parallelizable for encryption; decryption can be parallelized. Padding adds overhead.

Category: Performance

How should CBC be implemented safely?

Use random IVs, constant-time padding checks, and authenticated wrappers like Encrypt-then-MAC.

Category: BestPractice

Where to learn more about CBC Mode?

Read NIST SP 800-38A, IETF RFCs, and crypto library documentation with secure examples.

Category: Learning