Block cipher

On this page 7

A block cipher is a symmetric-key algorithm that encrypts data in fixed-size blocks, such as 128 bits, by applying a keyed, reversible transformation to each block. In cryptography, a block cipher is modeled as a pseudorandom permutation: for every key, it maps each possible input block to a unique output block, and without the key the result should be indistinguishable from a random permutation.

On its own, a block cipher processes exactly one block. To encrypt messages of arbitrary length securely, it is combined with a mode of operation such as CTR or GCM, which defines how blocks are chained, how an initialization vector or nonce is used and, in authenticated modes, how integrity is verified. AES is by far the most widely deployed block cipher today.

How a block cipher transforms data

Most modern block ciphers are iterated ciphers: they apply a simple round function many times, each round using a different round key derived from the main key by a key schedule. A single round is weak, but repeated rounds create confusion, hiding the relationship between key and ciphertext, and diffusion, spreading the influence of each input bit across the whole block.

Two classic structures dominate. A Feistel network, used by DES and Blowfish, splits the block into halves and mixes one half into the other each round, so decryption reuses the same structure with round keys in reverse order. A substitution-permutation network, used by AES, applies nonlinear S-boxes and linear mixing layers to the entire block in every round.

The table below summarizes the main parameters that define a block cipher and what each one affects.

ParameterTypical valuesWhat it affects
Block size64 or 128 bitsData limits per key and mode safety
Key size128, 192 or 256 bitsResistance to brute-force search
Number of rounds10 to 32Security margin against cryptanalysis
Round structureFeistel or SPNDesign, speed and decryption logic
Key scheduleAlgorithm-specificResistance to related-key attacks
Core block cipher parameters

Important block ciphers and their status

Block cipher history shows a steady move toward larger blocks and longer keys. The 56-bit key of DES became searchable by dedicated hardware in the late 1990s, and 64-bit block ciphers later proved vulnerable to birthday-bound attacks such as Sweet32 when large volumes of data are encrypted under one key.

CipherBlock sizeKey sizesCurrent status
AES128 bits128, 192, 256 bitsRecommended worldwide standard
DES64 bits56 bitsBroken by brute force, obsolete
Triple DES64 bits112 or 168 bitsDeprecated and disallowed by NIST
Camellia128 bits128, 192, 256 bitsSecure, used in Japan and the EU
Blowfish64 bits32 to 448 bitsLegacy, small block size
SM4128 bits128 bitsChinese national standard
Well-known block ciphers compared

AES, standardized by NIST in FIPS 197 in 2001, benefits from hardware acceleration through instruction sets such as AES-NI on x86 and the cryptography extensions on ARM. With hardware support, AES-GCM typically reaches several gigabytes per second on a single core.

Modes of operation

A mode of operation turns a block cipher into a practical encryption scheme for long messages, and the choice of mode matters as much as the cipher itself. Encrypting each block independently, the ECB mode, reveals patterns because identical plaintext blocks produce identical ciphertext blocks.

ModeTypeAuthenticatedTypical use
ECBBlock-by-blockNoNever for general data
CBCChained blocks with IVNoLegacy protocols and file formats
CTRTurns cipher into a keystreamNoBuilding block for other modes
GCMCTR plus polynomial MACYesTLS, IPsec, storage encryption
XTSTweakable per sectorNoFull-disk encryption
CCMCTR plus CBC-MACYesWireless and constrained devices
Common modes of operation

Modern protocols favor authenticated encryption with associated data, usually AES-GCM, because unauthenticated modes allow attackers to modify ciphertext undetected. Without authentication, CBC mode has enabled padding oracle attacks that recover plaintext one byte at a time.

Block ciphers compared with stream ciphers

Block ciphers and stream ciphers are both symmetric encryption primitives, but they process data differently. A stream cipher such as ChaCha20 generates a keystream and combines it with plaintext bit by bit, while a block cipher transforms whole blocks and needs a mode to handle longer data.

In practice the distinction has blurred, because counter mode turns a block cipher into a stream cipher. The real engineering choice is between constructions: AES-GCM excels where hardware AES instructions exist, whereas ChaCha20-Poly1305 is often faster and easier to implement in constant time on devices without them.

Limitations and common implementation mistakes

Well-studied block ciphers such as AES have no practical cryptanalytic breaks, so real-world failures almost always come from misuse rather than the algorithm. The following list covers the most frequent errors.

  • Using ECB mode, which leaks the structure of the plaintext.
  • Reusing a nonce in GCM or CTR under the same key, which exposes plaintext and, in GCM, enables forgery of authentication tags.
  • Predictable CBC initialization vectors, which enabled attacks such as BEAST against older TLS versions.
  • Table-based software implementations that leak key bits through cache-timing side channels.
  • Exceeding data limits per key, especially with 64-bit blocks, where collisions appear after about 32 GiB.

Regarding quantum computing, Grover’s algorithm offers at most a quadratic speedup for key search, so the common guidance is to prefer 256-bit keys for long-term protection. Block ciphers are therefore far less affected than RSA or elliptic curve cryptography, which are the main concern of post-quantum cryptography.

A plain-language summary

A block cipher is like a locked mixing machine for fixed-size chunks of data. You feed in a chunk of exactly the right size together with a secret key, and out comes a scrambled chunk of the same size. Anyone with the same key can run the machine backward and recover the original.

Because real messages are longer than one chunk, the machine is used with a set of rules called a mode, which decides how chunks are linked. Good modes also detect tampering, so a changed message is rejected instead of silently accepted.

An example from practice

A logistics company stores shipment records and customer addresses in a cloud database. Its security team decides to encrypt sensitive fields at the application level using AES-256 in GCM mode, with keys held in a managed key management service rather than in the application code.

Each record receives a fresh random 96-bit nonce, stored next to the ciphertext, and the record identifier is passed as associated data so an attacker cannot swap encrypted fields between records. The team also limits each data key to a defined number of encryptions and rotates keys automatically every 90 days.

During a later penetration test, testers obtained a copy of a database backup. Because the fields were encrypted and the keys were stored separately, the backup revealed no customer data, and attempts to alter ciphertext were rejected by the authentication tag check.