Lably
Skip to content

Block cipher

Type of cipher

  • 22 min read
  • 11 chapters

Related on Lably

Through Algorithm, Inverse function and Permutation

A block cipher uses blocks as an unvarying transformation. Even a secure block cipher is suitable for the encryption of only a single block of data at a time, using a fixed key. A multitude of modes of operation have been designed to allow their repeated use in a secure way to achieve the other security goals of confidentiality and authenticity. However, block ciphers may also feature as building blocks in other cryptographic protocols, such as universal hash functions and pseudorandom number generators.

Definition

A block cipher consists of two paired algorithms, one for encryption, E, and the other for decryption, D. Both algorithms accept two inputs: an input block of size n bits and a key of size k bits; and both yield an n-bit output block. The decryption algorithm D is defined to be the inverse function of encryption, i.e., D = E−1. More formally, a block cipher is specified by an encryption function

EK(P):=E(K,P):{0,1}k×{0,1}n→{0,1}n,

which takes as input a key K, of bit length k (called the key size), and a bit string P, of length n (called the block size), and returns a string C of n bits. P is called the plaintext, and C is termed the ciphertext. For each K, the function EK(P) is required to be an invertible mapping on {0,1}n. The inverse for E is defined as a function

EK−1(C):=DK(C)=D(K,C):{0,1}k×{0,1}n→{0,1}n,

taking a key K and a ciphertext C to return a plaintext value P, such that

∀P:DK(EK(P))=P.

For example, a block cipher encryption algorithm might take a 128-bit block of plaintext as input, and output a corresponding 128-bit block of ciphertext. The exact transformation is controlled using a second input – the secret key. Decryption is similar: the decryption algorithm takes, in this example, a 128-bit block of ciphertext together with the secret key, and yields the original 128-bit block of plain text.

For each key K, EK is a permutation (a bijective mapping) over the set of input blocks. Each key selects one permutation from the set of (2n)! possible permutations.

Sign in to keep reading

10 more chapters are free with a Lably account.

More in Computing and communication