cryptography

Definition

Block Cipher

A block cipher is a symmetric cipher that encrypts plaintext in fixed-size blocks, producing ciphertext blocks of the same size under a secret key.

For a given key , encryption is a permutation

and decryption is its inverse .

Operation

A block cipher operates on one block at a time. To encrypt longer messages, it must be combined with a mode of operation.

  • Padding: if the last plaintext block is shorter than the block size, a padding algorithm fills it to the required length.
  • Mode of operation: determines how encryption is applied to each block.
  • Key reuse: the same key is used for the encryption of every block.

Different modes give different security properties. For example, ECB encrypts blocks independently, CTR turns a block cipher into a stream cipher, and GCM adds integrity protection.

Fixed block size

AES is a block cipher with block size bits. If a message is longer than one block, AES alone is not enough. One must also specify how the blocks are combined.