AES-CBC
Cipher Block Chaining with AES: confidentiality only; needs a random IV and a separate MAC
Overview
CBC (Cipher Block Chaining) is a classic block cipher mode defined in NIST SP 800-38A. Each plaintext block is XORed with the previous ciphertext block before encryption, so identical blocks encrypt differently. It provides confidentiality but no integrity.
The first block is XORed with an initialisation vector (IV), and each later block with the preceding ciphertext block, before AES encryption. Decryption reverses the process and can run in parallel, but encryption is inherently sequential. Messages must be padded to a multiple of 16 bytes, usually with PKCS #7 padding.
NextSSL includes AES-128-CBC, AES-192-CBC and AES-256-CBC. CBC was the dominant mode in TLS up to 1.2 and remains common in file formats and legacy protocols. Ciphertext length always grows by at least one block of padding. In TLS 1.3, CBC cipher suites were removed entirely in favour of AEAD modes, and new protocols should follow the same approach.
History
1980–2001ECB, CBC, CFB and OFB defined for DES in FIPS 81
Carried over to AES in NIST SP 800-38A
How it works
- Generate a random 16-byte IV
- Pad the plaintext to a multiple of 16 bytes
- XOR each block with the previous ciphertext (or IV) and encrypt
- Send IV and ciphertext, and authenticate both separately
Security notes
CBC requires an unpredictable IV; predictable IVs enabled the BEAST attack on TLS 1.0. Without authentication, CBC with padding is vulnerable to padding-oracle attacks such as Lucky Thirteen and POODLE, which can decrypt traffic. Always combine CBC with a MAC in encrypt-then-MAC order, or prefer an AEAD mode such as AES-GCM.
Typical uses
Variants in NextSSL
3| Algorithm | Tier | Sizes (bytes) | Standards | API |
|---|---|---|---|---|
| AES-128-CBC aes-128-cbc |
standard FIPS | key 16 · nonce 16 · block 16 | NIST SP 800-38A | safe |
| AES-192-CBC aes-192-cbc |
standard FIPS | key 24 · nonce 16 · block 16 | NIST SP 800-38A | safe |
| AES-256-CBC aes-256-cbc |
standard FIPS | key 32 · nonce 16 · block 16 | NIST SP 800-38A | safe |
Frequently asked questions
Which AES-CBC variants does NextSSL include?
NextSSL registers 3 AES-CBC variants: aes-128-cbc, aes-192-cbc, aes-256-cbc.
Families with similar names
Other block cipher modes
All 20Related
Counter-mode AES with a GHASH polynomial MAC; the default AEAD of TLS and IPsec
AESThe Advanced Encryption Standard: the world's default 128-bit block cipher
HMAC_DRBGNIST SP 800-90A deterministic random bit generator built on HMAC
HMACThe standard way to build a MAC from a cryptographic hash (RFC 2104, FIPS 198-1)
AES-CTRCounter mode: turns AES into a fast, parallel stream cipher