Skip to content
uencoder

Block Cipher

A block cipher is a symmetric cipher that encrypts and decrypts fixed-length blocks (e.g., 128 bits) and requires a mode of operation to handle arbitrary-length data.

Purpose

It provides a secure transformation on fixed blocks and serves as the building block of provably secure encryption.

Mechanism

The encryption function E(K, P) maps an n-bit plaintext block to an n-bit ciphertext block and is a bijection. A key schedule derives round keys, and multiple rounds alternate substitution and permutation (SPN or Feistel). Modes such as ECB/CBC/CTR/GCM are needed for variable-length data.

Use cases

  • AES-based encryption infrastructure
  • Disk encryption (block-aligned)
  • MAC constructions (e.g., CMAC)
  • Pseudorandom-function constructions

Examples

  • Input
    AES-128 block
    Output
    16-byte ciphertext block

    A mode is required for multiple blocks

Common errors

Encrypting multiple blocks directly with the raw block cipher (i.e., ECB mode)
Always use a secure mode (GCM, or CBC with an IV)

Related terms

Related tools

References