Safekipedia
Block ciphersCryptographic primitives

Block cipher

Adapted from Wikipedia · Adventurer experience

A diagram illustrating concepts in cryptography.

In cryptography, a block cipher is a special tool that helps keep information safe. It works by taking small groups of bits, called blocks, and changing them so only someone with the right key can read them. This helps protect secrets when we save or send data.

Block ciphers are important pieces for many security systems. Even though a block cipher can only change one block of data at a time, there are smart ways to use it again and again to keep all our information private and safe. These ways of using the cipher are called modes of operation.

Because block ciphers are so useful, they are also used in other important security tools, like universal hash functions and pseudorandom number generators. They play a big role in keeping our digital world secure.

Definition

A block cipher uses two paired parts: one for hiding data and the other for showing it again. Both parts need two things: a piece of data and a secret key. The hiding part changes the data into a coded form. The showing part uses the same key to turn the coded data back to its original form.

For example, a block cipher might take a 128-bit piece of data and, using a secret key, change it into another 128-bit piece of coded data. Each different key picks a unique way to change the data, so only someone with the correct key can change it back.

History

The modern design of block ciphers began with ideas from Claude Shannon in 1949. He suggested using simple steps like substitutions and permutations to make things more secure. One common way to do this is called a Feistel network, used in the DES cipher.

An important development was the Atalla Key Block (AKB), created in 1972 by Mohamed M. Atalla. It helped keep communication safe in the banking industry, especially for ATM networks. Sharing important secrets like symmetric keys or PINs depends on this design. The DES cipher, published in 1977, helped people learn how block ciphers work and led to new ways to check their safety.

Design

Most block ciphers are called "iterated block ciphers." They take a piece of data, called plaintext, and turn it into another piece of data, called ciphertext. They do this by repeating a special process many times, called "rounds." Each round uses a secret key to mix up the data.

There are different ways to build these ciphers. One common way is called a "substitution-permutation network." In this method, the data goes through steps where parts of it are swapped out and then rearranged. Another method is called a "Feistel cipher," where the data is split in half and each half is processed before being recombined. These designs help keep information safe.

Main article: Substitution–permutation network

Main article: Feistel cipher

Main article: Lai–Massey scheme

Modes of operation

A block cipher can only encrypt one block of data at a time. To encrypt longer messages, the data is split into blocks. In the simplest way, called electronic codebook (ECB) mode, each block is encrypted separately. But this can be unsafe because the same blocks of text will look the same after encryption.

To make encryption safer, special methods called block cipher modes of operation have been created. These methods add extra steps to mix the data more thoroughly. For example, in cipher block chaining (CBC) mode, each block is mixed with the next one before encryption. Other methods like cipher feedback (CFB) and output feedback (OFB) also use these extra steps to keep the encrypted message safe. These methods help ensure that even if someone sees the encrypted message, they cannot easily figure out the original text.

Padding

Main article: Padding (cryptography)

When we encrypt data, sometimes we need the information to come in fixed sizes, called blocks. If the last piece of information is too small, we add extra bits, called padding, to make it the right size. We can't just add zeros, because that might let someone trick the system. Instead, we add one extra bit and then fill the rest with zeros, which helps keep the information safe.

Cryptanalysis

Main article: Cryptanalysis

The development of the boomerang attack enabled differential cryptanalysis techniques to be applied to many ciphers that had previously been deemed secure against differential attacks

Cryptanalysis is a way to find out how to unlock secret messages without using the secret key. There are different kinds of ways someone might try to break a code, depending on what information they have. For example, they might only have the locked messages, or they might also know some of the original messages.

There are special ways to try to break codes, like searching for patterns in how the messages look. These ways help experts see how strong a code is. New codes need to show they can handle these tests before people trust them.

Provable security

When we use a block cipher in a certain way, called a "mode of operation", we want the whole system to be as safe as the block cipher itself. Some ways are not safe, but others can be shown to be safe if the block cipher is safe too. To understand this, we need math rules about what "safe" means for a block cipher.

This way of proving that a system is safe by showing it depends on the safety of its parts is called provable security.

Standard model

A block cipher is considered safe in the standard model if an attacker cannot tell it apart from a completely random way of changing data. We can imagine a game where someone flips a coin: if it lands heads, they use the block cipher; if tails, they use a random change. The attacker tries many times to guess which one it is. If the attacker cannot do much better than guessing randomly, the block cipher is very safe, called a pseudo-random permutation.

Ideal cipher model

Main article: Ciphertext indistinguishability

Practical evaluation

Block ciphers can be judged by several important factors. One key factor is the size of its key and the block it works with. This helps decide how secure the cipher can be. We also look at how well the cipher has held up against attempts to break it over time. This gives us confidence in its design.

We consider how difficult it is to build the cipher in computers or special machines, and how much energy or space it needs. Performance matters too. We want to know how fast it can work and how much memory it uses. Finally, we look at things like cost and flexibility, such as whether the cipher can work with different sizes of keys and data.

Main article: Block cipher modes of operation

Notable block ciphers

Main articles: Lucifer (cipher) and Data Encryption Standard

Lucifer was the first civilian block cipher, created at IBM in the 1970s. A revised version became the U.S. government’s Data Encryption Standard (DES), released in 1976. DES uses 64-bit blocks and a 56-bit key. Over time, its short key length caused problems. An improvement called Triple DES was developed and is still secure today.

The International Data Encryption Algorithm (IDEA) was designed in 1991 to replace DES. It uses 64-bit blocks and a 128-bit key, combining different steps to boost security. Another notable cipher is RC5, designed by Ronald Rivest in 1994. RC5 is flexible, allowing different block sizes, key lengths, and rounds.

The Advanced Encryption Standard (AES), based on the Rijndael cipher, was adopted in 2001. AES uses a fixed block size of 128 bits and keys of 128, 192, or 256 bits. Finally, Blowfish, created by Bruce Schneier in 1993, offers a variable key length and was made free of patents and restrictions.

Generalizations

Block ciphers can be changed to work with different kinds of information. One type is called a "tweakable" block cipher. It uses an extra piece of data called a tweak with the normal data and key. This tweak changes how the cipher works, helping to protect information, especially when saving data on computers.

Another type is called format-preserving encryption. Usually, block ciphers work with binary code—strings of zeros and ones. But sometimes, we need to encrypt numbers and keep them looking like numbers. For example, we might want a credit card number to still look like a number after it’s encrypted. This kind of encryption changes the rules so the encrypted data looks the same as the original, like staying a number or a letter code.

Main article: Format-preserving encryption

Relation to other cryptographic primitives

Block ciphers are important for creating other security tools. They help make stream ciphers, which protect data one bit at a time. They can also be used to build special codes called cryptographic hash functions. These codes help check if data has been changed.

Block ciphers can also help make random number generators and safe ways to check messages. All these tools work together to keep information safe when it is sent or stored.

This article is a child-friendly adaptation of the Wikipedia article on Block cipher, available under CC BY-SA 4.0.

Images from Wikimedia Commons. Tap any image to view credits and license.