Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
A block cipher mode defines how a cipher such as AES is applied to messages longer than one block. The mode, not the algorithm, usually decides whether an encryption scheme is actually secure.

What Are Block Cipher Modes?
AES encrypts 16 bytes. Your database row, your HTTP response, and your backup file are all considerably longer than 16 bytes. The mode of operation is the rule that closes that gap, and picking the wrong one has caused far more breaches than any weakness in AES itself.
Every mode answers three questions: how successive blocks relate to one another, whether a unique value such as an initialisation vector is required, and whether tampering is detected. The third question is the one teams most often forget to ask.
| Mode | Needs | Integrity | Use it for |
|---|---|---|---|
| ECB | Nothing | No | Nothing |
| CBC | Unpredictable IV | No | Legacy interoperability only |
| CTR | Unique nonce | No | A building block, never alone |
| GCM | Unique 96-bit nonce | Yes | TLS, APIs, message payloads |
| CCM | Unique nonce | Yes | Constrained and wireless devices |
| XTS | Sector number as tweak | No, by design | Disk and volume encryption |
| SIV / GCM-SIV | Nonce preferred, not critical | Yes | Key wrapping and nonce-risky systems |
Electronic Codebook encrypts each block independently with the same key, so identical plaintext blocks produce identical ciphertext blocks. The famous demonstration encrypts a bitmap of a penguin and leaves the penguin perfectly visible. In commercial systems the leak is less photogenic but just as real: repeated field values, padding patterns, and record boundaries are all exposed, and an attacker can cut and paste blocks between messages.
Cipher Block Chaining XORs each plaintext block with the previous ciphertext block before encryption, starting from a random IV. It hides repetition, but it says nothing about whether the ciphertext arrived intact. Two consequences follow. Flipping a bit in one ciphertext block flips the same bit in the next plaintext block, which is enough to change an amount or a role name. And if the application reports padding errors differently from other errors, a padding oracle lets an attacker decrypt data byte by byte without the key — the attack Serge Vaudenay described in 2002, and the mechanism behind POODLE in 2014 and the long tail of Lucky 13 variants.
Counter mode encrypts a nonce plus a counter and XORs the result with the plaintext, turning AES into a stream cipher. It parallelises beautifully and needs no padding. It also fails catastrophically if a nonce repeats under one key, because the same keystream protects two different messages.
Galois/Counter Mode is CTR plus a fast authenticator built on multiplication in a finite field. Decryption fails outright if a single bit changed, and additional data such as headers can be authenticated without being encrypted. It is the dominant mode in TLS 1.2 and TLS 1.3, IPsec, and most cloud encryption APIs.
Its weakness is nonce management. With random 96-bit nonces, collisions become a real risk after roughly 2^32 messages under one key; with a counter that resets when a container restarts, the collision arrives immediately. Nonce reuse in GCM leaks the authentication subkey, which lets an attacker forge messages rather than merely read one. If your architecture cannot guarantee unique nonces, AES-GCM-SIV from RFC 8452 degrades gracefully instead.
Disk encryption cannot expand data — a 512-byte sector must still occupy 512 bytes — so there is no room for an authentication tag. XTS uses the sector number as a tweak so that identical sectors encrypt differently, and accepts that modification cannot be detected. BitLocker, FileVault, LUKS, and VeraCrypt all use it, which is why full disk encryption protects a stolen laptop but not a running one.
Three rules cover almost every case. Use an authenticated mode unless something physically prevents it. Let a reviewed library generate and track nonces rather than writing that logic yourself. And treat any encryption code that produces ciphertext the same length as the plaintext, with no tag and no IV, as a finding rather than a feature.
Mode misuse is quiet. Nothing crashes, the data decrypts, and the test suite passes, so it survives until someone looks specifically for it. Our web application security services include reviewing how applications call their crypto libraries, which is usually where the defect lives rather than in the library itself.
AES-GCM for anything travelling over a network or stored as a discrete record, and ChaCha20-Poly1305 where the hardware lacks AES acceleration. Use XTS only for raw block devices. If your platform offers a high-level interface such as libsodium’s secretbox or a cloud key management service, prefer it: it chooses the mode and manages nonces for you.
CBC provides confidentiality when the IV is unpredictable and unique, but it offers no integrity, so applications must add a separate MAC and verify it before decrypting. Getting that order wrong reintroduces padding oracles. Because an authenticated mode does the same job with fewer ways to fail, new designs should not use CBC at all.
Two things, and the second is worse. The XOR of the two ciphertexts reveals the XOR of the plaintexts, which often recovers both. More seriously, the repeated nonce lets an attacker solve for the authentication subkey, after which they can forge valid tags for messages you never sent. Treat nonce uniqueness as a hard requirement, not best practice.
Because an authentication tag needs extra bytes and a sector has none to spare. XTS makes each sector encrypt differently using its position, which prevents copying sectors around, but an attacker with physical write access can still corrupt data. Combine full disk encryption with Secure Boot and integrity measurement if that threat is in scope.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.