Recent from talks
Nothing was collected or created yet.
Block cipher
View on WikipediaThis article needs additional citations for verification. (April 2012) |
In cryptography, a block cipher is a deterministic algorithm that operates on fixed-length groups of bits, called blocks. Block ciphers are the elementary building blocks of many cryptographic protocols. They are ubiquitous in the storage and exchange of data, where such data is secured and authenticated via encryption.
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 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
[edit]
A block cipher consists of two paired algorithms, one for encryption, E, and the other for decryption, D.[1] 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,[2][3] a block cipher is specified by an encryption function
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
taking a key K and a ciphertext C to return a plaintext value P, such that
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.[4]
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 possible permutations.[5]
History
[edit]The modern design of block ciphers is based on the concept of an iterated product cipher. In his seminal 1949 publication, Communication Theory of Secrecy Systems, Claude Shannon analyzed product ciphers and suggested them as a means of effectively improving security by combining simple operations such as substitutions and permutations.[6] Iterated product ciphers carry out encryption in multiple rounds, each of which uses a different subkey derived from the original key. One widespread implementation of such ciphers named a Feistel network after Horst Feistel is notably implemented in the DES cipher.[7] Many other realizations of block ciphers, such as the AES, are classified as substitution–permutation networks.[8]
The root of all cryptographic block formats used within the Payment Card Industry Data Security Standard (PCI DSS) and American National Standards Institute (ANSI) standards lies with the Atalla Key Block (AKB), which was a key innovation of the Atalla Box, the first hardware security module (HSM). It was developed in 1972 by Mohamed M. Atalla, founder of Atalla Corporation (now Utimaco Atalla), and released in 1973. The AKB was a key block, which is required to securely interchange symmetric keys or PINs with other actors in the banking industry. This secure interchange is performed using the AKB format.[9] The Atalla Box protected over 90% of all ATM networks in operation as of 1998,[10] and Atalla products still secure the majority of the world's ATM transactions as of 2014.[11]
The publication of the DES cipher by the United States National Bureau of Standards (subsequently the U.S. National Institute of Standards and Technology, NIST) in 1977 was fundamental in the public understanding of modern block cipher design. It also influenced the academic development of cryptanalytic attacks. Both differential and linear cryptanalysis arose out of studies on DES design. As of 2016[update], there is a palette of attack techniques against which a block cipher must be secure, in addition to being robust against brute-force attacks.
Design
[edit]Iterated block ciphers
[edit]Most block cipher algorithms are classified as iterated block ciphers which means that they transform fixed-size blocks of plaintext into identically sized blocks of ciphertext, via the repeated application of an invertible transformation known as the round function, with each iteration referred to as a round.[12]
Usually, the round function R takes different round keys Ki as a second input, which is derived from the original key:[13]
where is the plaintext and the ciphertext, with r being the number of rounds.
Frequently, key whitening is used in addition to this. At the beginning and the end, the data is modified with key material (often with XOR):
Given one of the standard iterated block cipher design schemes, it is fairly easy to construct a block cipher that is cryptographically secure, simply by using a large number of rounds. However, this will make the cipher inefficient. Thus, efficiency is the most important additional design criterion for professional ciphers. Further, a good block cipher is designed to avoid side-channel attacks, such as branch prediction and input-dependent memory accesses that might leak secret data via the cache state or the execution time. In addition, the cipher should be concise, for small hardware and software implementations.
Substitution–permutation networks
[edit]
One important type of iterated block cipher known as a substitution–permutation network (SPN) takes a block of the plaintext and the key as inputs and applies several alternating rounds consisting of a substitution stage followed by a permutation stage—to produce each block of ciphertext output.[14] The non-linear substitution stage mixes the key bits with those of the plaintext, creating Shannon's confusion. The linear permutation stage then dissipates redundancies, creating diffusion.[15][16]
A substitution box (S-box) substitutes a small block of input bits with another block of output bits. This substitution must be one-to-one, to ensure invertibility (hence decryption). A secure S-box will have the property that changing one input bit will change about half of the output bits on average, exhibiting what is known as the avalanche effect—i.e. it has the property that each output bit will depend on every input bit.[17]
A permutation box (P-box) is a permutation of all the bits: it takes the outputs of all the S-boxes of one round, permutes the bits, and feeds them into the S-boxes of the next round. A good P-box has the property that the output bits of any S-box are distributed to as many S-box inputs as possible.[18]
At each round, the round key (obtained from the key with some simple operations, for instance, using S-boxes and P-boxes) is combined using some group operation, typically XOR.[citation needed]
Decryption is done by simply reversing the process (using the inverses of the S-boxes and P-boxes and applying the round keys in reversed order).[19]
Feistel ciphers
[edit]
In a Feistel cipher, the block of plain text to be encrypted is split into two equal-sized halves. The round function is applied to one half, using a subkey, and then the output is XORed with the other half. The two halves are then swapped.[20]
Let be the round function and let be the sub-keys for the rounds respectively.
Then the basic operation is as follows:[20]
Split the plaintext block into two equal pieces, (, )
For each round , compute
- .
Then the ciphertext is .
The decryption of a ciphertext is accomplished by computing for
- .
Then is the plaintext again.
One advantage of the Feistel model compared to a substitution–permutation network is that the round function does not have to be invertible.[21]
Lai–Massey ciphers
[edit]
The Lai–Massey scheme offers security properties similar to those of the Feistel structure. It also shares the advantage that the round function does not have to be invertible. Another similarity is that it also splits the input block into two equal pieces. However, the round function is applied to the difference between the two, and the result is then added to both half blocks.
Let be the round function and a half-round function and let be the sub-keys for the rounds respectively.
Then the basic operation is as follows:
Split the plaintext block into two equal pieces, (, )
For each round , compute
where and
Then the ciphertext is .
The decryption of a ciphertext is accomplished by computing for
where and
Then is the plaintext again.
Operations
[edit]ARX (add–rotate–XOR)
[edit]Many modern block ciphers and hashes are ARX algorithms—their round function involves only three operations: (A) modular addition, (R) rotation with fixed rotation amounts, and (X) XOR. Examples include ChaCha20, Speck, XXTEA, and BLAKE. Many authors draw an ARX network, a kind of data flow diagram, to illustrate such a round function.[22]
These ARX operations are popular because they are relatively fast and cheap in hardware and software, their implementation can be made extremely simple, and also because they run in constant time, and therefore are immune to timing attacks. The rotational cryptanalysis technique attempts to attack such round functions.
Other operations
[edit]Other operations often used in block ciphers include data-dependent rotations as in RC5 and RC6, a substitution box implemented as a lookup table as in Data Encryption Standard and Advanced Encryption Standard, a permutation box, and multiplication as in IDEA.
Modes of operation
[edit]
A block cipher by itself allows encryption only of a single data block of the cipher's block length. For a variable-length message, the data must first be partitioned into separate cipher blocks. In the simplest case, known as electronic codebook (ECB) mode, a message is first split into separate blocks of the cipher's block size (possibly extending the last block with padding bits), and then each block is encrypted and decrypted independently. However, such a naive method is generally insecure because equal plaintext blocks will always generate equal ciphertext blocks (for the same key), so patterns in the plaintext message become evident in the ciphertext output.[23]
To overcome this limitation, several so-called block cipher modes of operation have been designed[24][25] and specified in national recommendations such as NIST 800-38A[26] and BSI TR-02102[27] and international standards such as ISO/IEC 10116.[28] The general concept is to use randomization of the plaintext data based on an additional input value, frequently called an initialization vector, to create what is termed probabilistic encryption.[29] In the popular cipher block chaining (CBC) mode, for encryption to be secure the initialization vector passed along with the plaintext message must be a random or pseudo-random value, which is added in an exclusive-or manner to the first plaintext block before it is encrypted. The resultant ciphertext block is then used as the new initialization vector for the next plaintext block. In the cipher feedback (CFB) mode, which emulates a self-synchronizing stream cipher, the initialization vector is first encrypted and then added to the plaintext block. The output feedback (OFB) mode repeatedly encrypts the initialization vector to create a key stream for the emulation of a synchronous stream cipher. The newer counter (CTR) mode similarly creates a key stream, but has the advantage of only needing unique and not (pseudo-)random values as initialization vectors; the needed randomness is derived internally by using the initialization vector as a block counter and encrypting this counter for each block.[26]
From a security-theoretic point of view, modes of operation must provide what is known as semantic security.[30] Informally, it means that given some ciphertext under an unknown key one cannot practically derive any information from the ciphertext (other than the length of the message) over what one would have known without seeing the ciphertext. It has been shown that all of the modes discussed above, with the exception of the ECB mode, provide this property under so-called chosen plaintext attacks.
Padding
[edit]Some modes such as the CBC mode only operate on complete plaintext blocks. Simply extending the last block of a message with zero bits is insufficient since it does not allow a receiver to easily distinguish messages that differ only in the number of padding bits. More importantly, such a simple solution gives rise to very efficient padding oracle attacks.[31] A suitable padding scheme is therefore needed to extend the last plaintext block to the cipher's block size. While many popular schemes described in standards and in the literature have been shown to be vulnerable to padding oracle attacks,[31][32] a solution that adds a one-bit and then extends the last block with zero-bits, standardized as "padding method 2" in ISO/IEC 9797-1,[33] has been proven secure against these attacks.[32]
Cryptanalysis
[edit]Cryptanalysis is the technique in which ciphers are decrypted without knowledge of the used key. Different attacks can be employed based on the information available to the cryptanalyst, these Attack models are:
- Ciphertext-only: the cryptanalyst has access only to a collection of ciphertexts or codetexts.
- Known-plaintext: the attacker has a set of ciphertexts to which they know the corresponding plaintext.
- Chosen-plaintext (chosen-ciphertext): the attacker can obtain the ciphertexts (plaintexts) corresponding to an arbitrary set of plaintexts (ciphertexts) of their own choosing.
- Adaptive chosen-plaintext: like a chosen-plaintext attack, except the attacker can choose subsequent plaintexts based on information learned from previous encryptions, similarly to the Adaptive chosen ciphertext attack.
- Related-key attack: Like a chosen-plaintext attack, except the attacker can obtain ciphertexts encrypted under two different keys. The keys are unknown, but the relationship between them is known; for example, two keys that differ in the one bit.
Brute-force attacks
[edit]This section needs expansion with: Impact of key size and block size, discuss time–m to the birthday attack.. You can help by adding to it. (January 2019) |
This property results in the cipher's security degrading quadratically, and needs to be taken into account when selecting a block size. There is a trade-off though as large block sizes can result in the algorithm becoming inefficient to operate.[34] Earlier block ciphers such as the DES have typically selected a 64-bit block size, while newer designs such as the AES support block sizes of 128 bits or more, with some ciphers supporting a range of different block sizes.[35]
Differential cryptanalysis
[edit]This section needs expansion. You can help by adding to it. (April 2012) |
Linear cryptanalysis
[edit]A linear cryptanalysis is a form of cryptanalysis based on finding affine approximations to the action of a cipher. Linear cryptanalysis is one of the two most widely used attacks on block ciphers; the other being differential cryptanalysis.[36]
The discovery is attributed to Mitsuru Matsui, who first applied the technique to the FEAL cipher (Matsui and Yamagishi, 1992).[37]
Integral cryptanalysis
[edit]Integral cryptanalysis is a cryptanalytic attack that is particularly applicable to block ciphers based on substitution–permutation networks. Unlike differential cryptanalysis, which uses pairs of chosen plaintexts with a fixed XOR difference, integral cryptanalysis uses sets or even multisets of chosen plaintexts of which part is held constant and another part varies through all possibilities. For example, an attack might use 256 chosen plaintexts that have all but 8 of their bits the same, but all differ in those 8 bits. Such a set necessarily has an XOR sum of 0, and the XOR sums of the corresponding sets of ciphertexts provide information about the cipher's operation. This contrast between the differences between pairs of texts and the sums of larger sets of texts inspired the name "integral cryptanalysis", borrowing the terminology of calculus.[citation needed]
Other techniques
[edit]
In addition to linear and differential cryptanalysis, there is a growing catalog of attacks: truncated differential cryptanalysis, partial differential cryptanalysis, integral cryptanalysis, which encompasses square and integral attacks, slide attacks, boomerang attacks, the XSL attack, impossible differential cryptanalysis, and algebraic attacks. For a new block cipher design to have any credibility, it must demonstrate evidence of security against known attacks.[38]
Provable security
[edit]When a block cipher is used in a given mode of operation, the resulting algorithm should ideally be about as secure as the block cipher itself. ECB (discussed above) emphatically lacks this property: regardless of how secure the underlying block cipher is, ECB mode can easily be attacked. On the other hand, CBC mode can be proven to be secure under the assumption that the underlying block cipher is likewise secure. Note, however, that making statements like this requires formal mathematical definitions for what it means for an encryption algorithm or a block cipher to "be secure". This section describes two common notions for what properties a block cipher should have. Each corresponds to a mathematical model that can be used to prove properties of higher-level algorithms, such as CBC.
This general approach to cryptography – proving higher-level algorithms (such as CBC) are secure under explicitly stated assumptions regarding their components (such as a block cipher) – is known as provable security.
Standard model
[edit]Informally, a block cipher is secure in the standard model if an attacker cannot tell the difference between the block cipher (equipped with a random key) and a random permutation.
To be a bit more precise, let E be an n-bit block cipher. We imagine the following game:
- The person running the game flips a coin.
- If the coin lands on heads, he chooses a random key K and defines the function f = EK.
- If the coin lands on tails, he chooses a random permutation π on the set of n-bit strings and defines the function f = π.
- The attacker chooses an n-bit string X, and the person running the game tells him the value of f(X).
- Step 2 is repeated a total of q times. (Each of these q interactions is a query.)
- The attacker guesses how the coin landed. He wins if his guess is correct.
The attacker, which we can model as an algorithm, is called an adversary. The function f (which the adversary was able to query) is called an oracle.
Note that an adversary can trivially ensure a 50% chance of winning simply by guessing at random (or even by, for example, always guessing "heads"). Therefore, let PE(A) denote the probability that adversary A wins this game against E, and define the advantage of A as 2(PE(A) − 1/2). It follows that if A guesses randomly, its advantage will be 0; on the other hand, if A always wins, then its advantage is 1. The block cipher E is a pseudo-random permutation (PRP) if no adversary has an advantage significantly greater than 0, given specified restrictions on q and the adversary's running time. If in Step 2 above adversaries have the option of learning f−1(X) instead of f(X) (but still have only small advantages) then E is a strong PRP (SPRP). An adversary is non-adaptive if it chooses all q values for X before the game begins (that is, it does not use any information gleaned from previous queries to choose each X as it goes).
These definitions have proven useful for analyzing various modes of operation. For example, one can define a similar game for measuring the security of a block cipher-based encryption algorithm, and then try to show (through a reduction argument) that the probability of an adversary winning this new game is not much more than PE(A) for some A. (The reduction typically provides limits on q and the running time of A.) Equivalently, if PE(A) is small for all relevant A, then no attacker has a significant probability of winning the new game. This formalizes the idea that the higher-level algorithm inherits the block cipher's security.
Ideal cipher model
[edit]This section needs expansion. You can help by adding to it. (April 2012) |
Practical evaluation
[edit]Block ciphers may be evaluated according to multiple criteria in practice. Common factors include:[39][40]
- Key parameters, such as its key size and block size, both of which provide an upper bound on the security of the cipher.
- The estimated security level, which is based on the confidence gained in the block cipher design after it has largely withstood major efforts in cryptanalysis over time, the design's mathematical soundness, and the existence of practical or certificational[41] attacks.
- The cipher's complexity and its suitability for implementation in hardware or software. Hardware implementations may measure the complexity in terms of gate count or energy consumption, which are important parameters for resource-constrained devices.
- The cipher's performance in terms of processing throughput on various platforms, including its memory requirements.
- The cost of the cipher refers to licensing requirements that may apply due to intellectual property rights.
- The flexibility of the cipher includes its ability to support multiple key sizes and block lengths.
Notable block ciphers
[edit]Lucifer / DES
[edit]Lucifer is generally considered to be the first civilian block cipher, developed at IBM in the 1970s based on work done by Horst Feistel. A revised version of the algorithm was adopted as a U.S. government Federal Information Processing Standard: FIPS PUB 46 Data Encryption Standard (DES).[42] It was chosen by the U.S. National Bureau of Standards (NBS) after a public invitation for submissions and some internal changes by NBS (and, potentially, the NSA). DES was publicly released in 1976 and has been widely used.[citation needed]
DES was designed to, among other things, resist a certain cryptanalytic attack known to the NSA and rediscovered by IBM, though unknown publicly until rediscovered again and published by Eli Biham and Adi Shamir in the late 1980s. The technique is called differential cryptanalysis and remains one of the few general attacks against block ciphers; linear cryptanalysis is another but may have been unknown even to the NSA, prior to its publication by Mitsuru Matsui. DES prompted a large amount of other work and publications in cryptography and cryptanalysis in the open community and it inspired many new cipher designs.[citation needed]
DES has a block size of 64 bits and a key size of 56 bits. 64-bit blocks became common in block cipher designs after DES. Key length depended on several factors, including government regulation. Many observers[who?] in the 1970s commented that the 56-bit key length used for DES was too short. As time went on, its inadequacy became apparent, especially after a special-purpose machine designed to break DES was demonstrated in 1998 by the Electronic Frontier Foundation. An extension to DES, Triple DES, triple-encrypts each block with either two independent keys (112-bit key and 80-bit security) or three independent keys (168-bit key and 112-bit security). It was widely adopted as a replacement. As of 2011, the three-key version is still considered secure, though the National Institute of Standards and Technology (NIST) standards no longer permit the use of the two-key version in new applications, due to its 80-bit security level.[43]
IDEA
[edit]The International Data Encryption Algorithm (IDEA) is a block cipher designed by James Massey of ETH Zurich and Xuejia Lai; it was first described in 1991, as an intended replacement for DES.
IDEA operates on 64-bit blocks using a 128-bit key and consists of a series of eight identical transformations (a round) and an output transformation (the half-round). The processes for encryption and decryption are similar. IDEA derives much of its security by interleaving operations from different groups – modular addition and multiplication, and bitwise exclusive or (XOR) – which are algebraically "incompatible" in some sense.
The designers analysed IDEA to measure its strength against differential cryptanalysis and concluded that it is immune under certain assumptions. No successful linear or algebraic weaknesses have been reported. As of 2012[update], the best attack which applies to all keys can break a full 8.5-round IDEA using a narrow-bicliques attack about four times faster than brute force.
RC5
[edit]
RC5 is a block cipher designed by Ronald Rivest in 1994 which, unlike many other ciphers, has a variable block size (32, 64, or 128 bits), key size (0 to 2040 bits), and a number of rounds (0 to 255). The original suggested choice of parameters was a block size of 64 bits, a 128-bit key, and 12 rounds.
A key feature of RC5 is the use of data-dependent rotations; one of the goals of RC5 was to prompt the study and evaluation of such operations as a cryptographic primitive. RC5 also consists of a number of modular additions and XORs. The general structure of the algorithm is a Feistel-like a network. The encryption and decryption routines can be specified in a few lines of code. The key schedule, however, is more complex, expanding the key using an essentially one-way function with the binary expansions of both e and the golden ratio as sources of "nothing up my sleeve numbers". The tantalizing simplicity of the algorithm together with the novelty of the data-dependent rotations has made RC5 an attractive object of study for cryptanalysts.
12-round RC5 (with 64-bit blocks) is susceptible to a differential attack using 244 chosen plaintexts.[44] 18–20 rounds are suggested as sufficient protection.
Rijndael / AES
[edit]The Rijndael cipher developed by Belgian cryptographers, Joan Daemen and Vincent Rijmen was one of the competing designs to replace DES. It won the 5-year public competition to become the AES (Advanced Encryption Standard).
Adopted by NIST in 2001, AES has a fixed block size of 128 bits and a key size of 128, 192, or 256 bits, whereas Rijndael can be specified with block and key sizes in any multiple of 32 bits, with a minimum of 128 bits. The block size has a maximum of 256 bits, but the key size has no theoretical maximum. AES operates on a 4×4 column-major order matrix of bytes, termed the state (versions of Rijndael with a larger block size have additional columns in the state).
Blowfish
[edit]Blowfish is a block cipher, designed in 1993 by Bruce Schneier and included in a large number of cipher suites and encryption products. Blowfish has a 64-bit block size and a variable key length from 1 bit up to 448 bits.[45] It is a 16-round Feistel cipher and uses large key-dependent S-boxes. Notable features of the design include the key-dependent S-boxes and a highly complex key schedule.
It was designed as a general-purpose algorithm, intended as an alternative to the aging DES and free of the problems and constraints associated with other algorithms. At the time Blowfish was released, many other designs were proprietary, encumbered by patents, or were commercial/government secrets. Schneier has stated that "Blowfish is unpatented, and will remain so in all countries. The algorithm is hereby placed in the public domain, and can be freely used by anyone." The same applies to Twofish, a successor algorithm from Schneier.
Generalizations
[edit]Tweakable block ciphers
[edit]This section needs expansion. You can help by adding to it. (June 2008) |
M. Liskov, R. Rivest, and D. Wagner have described a generalized version of block ciphers called "tweakable" block ciphers.[46] A tweakable block cipher accepts a second input called the tweak along with its usual plaintext or ciphertext input. The tweak, along with the key, selects the permutation computed by the cipher. If changing tweaks is sufficiently lightweight (compared with a usually fairly expensive key setup operation), then some interesting new operation modes become possible. The disk encryption theory article describes some of these modes.
Format-preserving encryption
[edit]Block ciphers traditionally work over a binary alphabet. That is, both the input and the output are binary strings, consisting of n zeroes and ones. In some situations, however, one may wish to have a block cipher that works over some other alphabet; for example, encrypting 16-digit credit card numbers in such a way that the ciphertext is also a 16-digit number might facilitate adding an encryption layer to legacy software. This is an example of format-preserving encryption. More generally, format-preserving encryption requires a keyed permutation on some finite language. This makes format-preserving encryption schemes a natural generalization of (tweakable) block ciphers. In contrast, traditional encryption schemes, such as CBC, are not permutations because the same plaintext can encrypt multiple different ciphertexts, even when using a fixed key.
Relation to other cryptographic primitives
[edit]Block ciphers can be used to build other cryptographic primitives, such as those below. For these other primitives to be cryptographically secure, care has to be taken to build them the right way.
- Stream ciphers can be built using block ciphers. OFB mode and CTR mode are block modes that turn a block cipher into a stream cipher.
- Cryptographic hash functions can be built using block ciphers.[47][48] See the one-way compression function for descriptions of several such methods. The methods resemble the block cipher modes of operation usually used for encryption.
- Cryptographically secure pseudorandom number generators (CSPRNGs) can be built using block ciphers.[49][50]
- Secure pseudorandom permutations of arbitrarily sized finite sets can be constructed with block ciphers; see Format-Preserving Encryption.
- A publicly known unpredictable permutation combined with key whitening is enough to construct a block cipher -- such as the single-key Even–Mansour cipher, perhaps the simplest possible provably secure block cipher.[51]
- Message authentication codes (MACs) are often built from block ciphers. CBC-MAC, OMAC, and PMAC are such MACs.
- Authenticated encryption is also built from block ciphers. It means to both encrypt and MAC at the same time. That is to both provide confidentiality and authentication. CCM, EAX, GCM, and OCB are such authenticated encryption modes.
Just as block ciphers can be used to build hash functions, like SHA-1 and SHA-2 are based on block ciphers which are also used independently as SHACAL, hash functions can be used to build block ciphers. Examples of such block ciphers are BEAR and LION.
See also
[edit]References
[edit]- ^ Cusick, Thomas W.; Stanica, Pantelimon (2009). Cryptographic Boolean functions and applications. Academic Press. pp. 158–159. ISBN 9780123748904.
- ^ Menezes, Alfred J.; van Oorschot, Paul C.; Vanstone, Scott A. (1996). "Chapter 7: Block Ciphers". Handbook of Applied Cryptography. CRC Press. ISBN 0-8493-8523-7. Archived from the original on 2021-02-03. Retrieved 2012-07-15.
- ^ Bellare, Mihir; Rogaway, Phillip (11 May 2005), Introduction to Modern Cryptography (Lecture notes), archived (PDF) from the original on 2022-10-09, chapter 3.
- ^ Chakraborty, D.; Rodriguez-Henriquez, F. (2008). "Block Cipher Modes of Operation from a Hardware Implementation Perspective". In Koç, Çetin K. (ed.). Cryptographic Engineering. Springer. p. 321. ISBN 9780387718163.
- ^ Menezes, van Oorschot & Vanstone 1996, section 7.2.
- ^ Shannon, Claude (1949). "Communication Theory of Secrecy Systems" (PDF). Bell System Technical Journal. 28 (4): 656–715. doi:10.1002/j.1538-7305.1949.tb00928.x. Archived from the original (PDF) on 2007-06-05. Retrieved 2012-04-09.
- ^ van Tilborg, Henk C. A.; Jajodia, Sushil, eds. (2011). Encyclopedia of Cryptography and Security. Springer. ISBN 978-1-4419-5905-8., p. 455.
- ^ van Tilborg & Jajodia 2011, p. 1268.
- ^ Rupp, Martin (16 August 2019). "The Benefits of the Atalla Key Block". Utimaco. Archived from the original on 17 October 2020. Retrieved 10 September 2019.
- ^ Hamscher, Walter (1998). "Electronic Business without Fear: The Tristrata Security Architecture" (PDF). CiteSeerX 10.1.1.123.2371. Archived from the original (PDF) on 29 May 2005.[self-published source?]
- ^ Stiennon, Richard (17 June 2014). "Key Management a Fast Growing Space". SecurityCurrent. IT-Harvest. Retrieved 21 August 2019.
- ^ Junod, Pascal & Canteaut, Anne (2011). Advanced Linear Cryptanalysis of Block and Stream Ciphers. IOS Press. p. 2. ISBN 9781607508441.
- ^ Aumasson, Jean-Philippe (6 November 2017). Serious Cryptography: A Practical Introduction to Modern Encryption. No Starch Press. p. 56. ISBN 978-1-59327-826-7. OCLC 1012843116.
- ^ Keliher, Liam; et al. (2000). "Modeling Linear Characteristics of Substitution–Permutation Networks". In Hays, Howard; Carlisle, Adam (eds.). Selected areas in cryptography: 6th annual international workshop, SAC'99, Kingston, Ontario, Canada, August 9–10, 1999 : proceedings. Springer. p. 79. ISBN 9783540671855.
- ^ Baigneres, Thomas; Finiasz, Matthieu (2007). "Dial 'C' for Cipher". In Biham, Eli; Yousseff, Amr (eds.). Selected areas in cryptography: 13th international workshop, SAC 2006, Montreal, Canada, August 17–18, 2006 : revised selected papers. Springer. p. 77. ISBN 9783540744610.
- ^ Cusick, Thomas W.; Stanica, Pantelimon (2009). Cryptographic Boolean functions and applications. Academic Press. p. 164. ISBN 9780123748904.
- ^ Katz, Jonathan; Lindell, Yehuda (2008). Introduction to modern cryptography. CRC Press. p. 166. ISBN 9781584885511., pages 166–167.
- ^ Nayaka, Raja Jitendra; Biradar, R. C. (2013). "Key based S-box selection and key expansion algorithm for substitution-permutation network cryptography". 2013 Annual International Conference on Emerging Research Areas and 2013 International Conference on Microelectronics, Communications and Renewable Energy. pp. 1–6. doi:10.1109/AICERA-ICMiCR.2013.6575944. ISBN 978-1-4673-5149-2.
- ^ Subhabrata Samajder (2017). Block Cipher Cryptanalysis: An Overview. Kolkata: Indian Statistical Institute. pp. 5/52.
- ^ a b Katz & Lindell 2008, pp. 170–172.
- ^ Katz & Lindell 2008, p. 171.
- ^ Aumasson, Jean-Philippe; Bernstein, Daniel J. (2012). "SipHash: a fast short-input PRF" (PDF). In Galbraith, Steven; Nandi, Mridul (eds.). Progress in cryptology-- INDOCRYPT 2012 : 13th International Conference on Cryptology in India, Kolkata, India, December 9-12, 2012, proceedings. Berlin: Springer. p. 494. doi:10.1007/978-3-642-34931-7_28. ISBN 978-3-642-34931-7. Archived from the original (PDF) on 2020-03-12.
- ^ Menezes, van Oorschot & Vanstone 1996, pp. 228–230, Chapter 7.
- ^ "Block Cipher Modes". NIST Computer Security Resource Center. 4 January 2017.
- ^ Menezes, van Oorschot & Vanstone 1996, pp. 228–233.
- ^ a b Morris Dworkin (December 2001), "Recommendation for Block Cipher Modes of Operation – Methods and Techniques" (PDF), Special Publication 800-38A, National Institute of Standards and Technology (NIST), doi:10.6028/NIST.SP.800-38A, archived (PDF) from the original on 2022-10-09
- ^ "Kryptographische Verfahren: Empfehlungen und Schlüssellängen", Bsi Tr-02102 (Technische Richtlinie) (Version 1.0), June 20, 2008
- ^ "ISO/IEC 10116:2006 Information technology — Security techniques — Modes of operation for an n-bit block cipher".
- ^ Bellare & Rogaway 2005, p. 101, section 5.3.
- ^ Bellare & Rogaway 2005, section 5.6.
- ^ a b Serge Vaudenay (2002). "Security Flaws Induced by CBC Padding — Applications to SSL, IPSEC, WTLS". Advances in Cryptology — EUROCRYPT 2002. Lecture Notes in Computer Science. Vol. 2332. Springer Verlag. pp. 534–545. doi:10.1007/3-540-46035-7_35. ISBN 978-3-540-43553-2.
- ^ a b Kenneth G. Paterson; Gaven J. Watson (2008). "Immunising CBC Mode Against Padding Oracle Attacks: A Formal Security Treatment". Security and Cryptography for Networks. Lecture Notes in Computer Science. Vol. 5229. Springer Verlag. pp. 340–357. doi:10.1007/978-3-540-85855-3_23. ISBN 978-3-540-85854-6.
- ^ ISO/IEC 9797-1: Information technology – Security techniques – Message Authentication Codes (MACs) – Part 1: Mechanisms using a block cipher, ISO/IEC, 2011
- ^ Martin, Keith M. (2012). Everyday Cryptography: Fundamental Principles and Applications. Oxford University Press. p. 114. ISBN 9780199695591.
- ^ Paar, Christof; et al. (2010). Understanding Cryptography: A Textbook for Students and Practitioners. Springer. p. 30. ISBN 9783642041006.
- ^ Matsui, Mitsuru. "Linear Cryptanalysis of DES Cipher". Mitsubishi Electric Corporation. 1 (3): 43 – via Computer & Information Systems Laboratory.
- ^ Matsui, M. & Yamagishi, A. "A new method for known plaintext attack of FEAL cipher". Advances in Cryptology – EUROCRYPT 1992.
- ^ Wu, Shengbao; Wang, Mingsheng (2011), Security Evaluation against Differential Cryptanalysis for Block Cipher Structures, retrieved 2025-01-01
- ^ Menezes, van Oorschot & Vanstone 1996, p. 227.
- ^ James Nechvatal; Elaine Barker; Lawrence Bassham; William Burr; Morris Dworkin; James Foti; Edward Roback (October 2000), Report on the Development of the Advanced Encryption Standard (AES) (PDF), National Institute of Standards and Technology (NIST), archived (PDF) from the original on 2022-10-09
- ^ Attacks that show that the cipher does not perform as advertised (i.e., the level of difficulty involved in breaking it is lower than claimed), which are nevertheless of high enough complexity so that they are not practically achievable.
- ^ FIPS PUB 46-3 Data Encryption Standard (DES) (This is the third edition, 1999, but includes historical information in the preliminary section 12.)
- ^ NIST Special Publication 800-57 Recommendation for Key Management — Part 1: General (Revised), March, 2007 Archived June 6, 2014, at the Wayback Machine.
- ^ Biryukov A. and Kushilevitz E. (1998). Improved Cryptanalysis of RC5. EUROCRYPT 1998.
- ^ Bruce Schneier (1994). "Description of a New Variable-Length Key, 64-Bit Block Cipher (Blowfish)". Dr. Dobb's Journal. 19 (4): 38–40.
- ^ Liskov, M.; Rivest, R.; Wagner, D. "Tweakable Block Ciphers" (PDF). Crypto 2002. Archived (PDF) from the original on 2022-10-09.
- ^ "ISO/IEC 10118-2:2010 Information technology — Security techniques — Hash-functions — Part 2: Hash-functions using an n-bit block cipher".
- ^ Menezes, van Oorschot & Vanstone 1996, Chapter 9: Hash Functions and Data Integrity.
- ^ Barker, E. B.; Kelsey, J. M. (2012). "NIST Special Publication 800-90A Recommendation for Random Number Generation Using Deterministic Random Bit Generators" (PDF). doi:10.6028/NIST.SP.800-90A.
{{cite journal}}: Cite journal requires|journal=(help) - ^ Menezes, van Oorschot & Vanstone 1996, Chapter 5: Pseudorandom Bits and Sequences.
- ^ Orr Dunkelman, Nathan Keller, and Adi Shamir. "Minimalism in Cryptography: The Even–Mansour Scheme Revisited".
Further reading
[edit]- Knudsen, Lars R.; Robshaw, Matthew (2011). The Block Cipher Companion. Springer. ISBN 9783642173417.
External links
[edit]Block cipher
View on GrokipediaFundamentals
Definition and Properties
A block cipher is a symmetric-key algorithm that encrypts fixed-size blocks of plaintext into ciphertext blocks of the same size, using a secret key for both encryption and decryption.[9][10] Fundamental properties of block ciphers include bijectivity, where the encryption function for each fixed key induces a permutation on the set of all possible plaintext blocks, ensuring a one-to-one correspondence; invertibility, such that decryption precisely reverses the encryption process when the same key is applied; and determinism, meaning identical plaintext and key inputs always yield identical ciphertext outputs.[11][12][9] Mathematically, encryption is modeled as a function , where denotes the block length in bits and is the key, with decryption given by the inverse such that for any block .[11][13] In contrast to stream ciphers, which generate a keystream to encrypt data bit-by-bit or byte-by-byte, block ciphers process entire fixed-length blocks simultaneously.[14] Block ciphers are commonly used in conjunction with modes of operation to handle messages exceeding the block size while providing security services like confidentiality.[15]Block and Key Parameters
Block ciphers process fixed-length blocks of data, with typical block sizes of 64 bits or 128 bits. The block size, denoted as bits, fundamentally affects the cipher's security and operational efficiency; smaller values like 64 bits were common in early designs but offer limited protection against statistical analyses due to the reduced data granularity, while 128-bit blocks provide stronger safeguards by expanding the state space and complicating pattern recognition in ciphertext. Larger block sizes demand enhanced diffusion mechanisms to ensure that changes in a single input bit propagate across the entire block, increasing design complexity but improving overall resilience.[16] A key trade-off with block size involves padding overhead in modes of operation that require input to be a multiple of the block length, such as CBC or ECB. For messages shorter than a full block or not aligning perfectly, padding adds extraneous data, and larger blocks minimize this relative expansion—for instance, a 1-byte message incurs up to 15 bytes of padding with a 128-bit block versus 7 bytes with a 64-bit block—thus enhancing efficiency for variable-length data without compromising security. However, this benefit comes at the cost of higher per-block processing demands, particularly in resource-constrained environments.[7] Key sizes in block ciphers commonly range from 128 to 256 bits, directly dictating resistance to exhaustive search attacks, where the adversary tests all possible keys. The brute-force complexity is operations, with representing the key length in bits, making longer keys exponentially harder to crack—e.g., 256 bits yields a search space vastly larger than 128 bits. Most designs fix the block size for simplicity and standardization but permit variable key lengths to balance security needs against performance, allowing users to select higher for greater protection at the expense of increased key management and computation time. In provable security frameworks, larger key sizes strengthen the ideal cipher model assumptions, such as pseudorandomness.[17][16]Historical Development
Early Concepts and Lucifer
The theoretical foundations of block ciphers trace back to Claude Shannon's seminal 1949 paper, "Communication Theory of Secrecy Systems," where he introduced the principles of confusion** and **diffusion as core requirements for secure cryptographic systems. Confusion refers to making the relationship between the key and the ciphertext as complex as possible to thwart statistical analysis, while diffusion ensures that changes in a single bit of the plaintext or key propagate to affect many bits in the ciphertext, thereby resisting differential attacks.[18] These concepts provided the blueprint for product ciphers, which combine substitution (for confusion) and permutation (for diffusion) operations in iterated rounds, influencing all subsequent block cipher designs.[18] Building on Shannon's ideas, IBM cryptographer Horst Feistel and his team developed Lucifer in the early 1970s as one of the earliest practical block ciphers, marking a shift from theoretical cryptography to implementable systems for data protection in computing environments. Lucifer encompassed several variants to address different implementation needs. An early 1971 version described by Feistel used 48-bit blocks and a 48-bit key with a substitution-permutation network structure. A later variant from 1973 featured 128-bit blocks and a 128-bit key, employing a balanced Feistel network with 16 rounds to achieve security through repeated substitution and permutation steps. Another early variant featured 48-bit blocks with a 128-bit key, balancing security and efficiency. These adaptations highlighted the flexibility of the evolving designs in Lucifer, which allowed decryption by reversing the round keys in Feistel-based versions. Lucifer served as a direct prototype for the Data Encryption Standard (DES), demonstrating the feasibility of symmetric block encryption for civilian use, such as in early electronic banking systems. A key milestone occurred in May 1973 when the National Bureau of Standards (NBS), now NIST, issued a public solicitation for encryption algorithm proposals to establish a federal standard for protecting unclassified computer data.[19] In response, IBM submitted a refined 64-bit block version of Lucifer in 1974, which underwent evaluation and modifications by the National Security Agency (NSA). The initial public disclosure of Lucifer's details came in 1975 through publications in the Federal Register, enabling broader scrutiny and refinement. Early challenges in block cipher development stemmed from 1970s hardware constraints, such as limited memory and processing power in computers and chips, which favored smaller block sizes for practical deployment. This led to the adoption of 64-bit blocks in subsequent designs like DES, reducing from the 128-bit variant of Lucifer to improve efficiency without fully compromising diffusion properties, while still aligning with Shannon's principles.Standardization and AES Adoption
In 1977, the National Bureau of Standards (NBS), predecessor to the National Institute of Standards and Technology (NIST), adopted the Data Encryption Standard (DES) as a federal standard under FIPS Publication 46, based on IBM's earlier Lucifer cipher with modifications including a reduced 56-bit key length.[20] By the 1990s, DES's 56-bit key faced widespread criticism for vulnerability to brute-force attacks as computing power grew, culminating in the Electronic Frontier Foundation's (EFF) DES cracker machine demonstrating a full key search in under three days in July 1998 for less than $250,000.[21][22] As an interim measure, NIST reaffirmed DES in FIPS 46-3 on October 25, 1999, while specifying the Triple Data Encryption Algorithm (TDEA), or Triple DES, as the preferred method; TDEA applies DES in encrypt-decrypt-encrypt (EDE) mode with three 56-bit keys, yielding an effective 168-bit key length to enhance security against brute-force attacks.[23] To address DES's limitations, NIST initiated the Advanced Encryption Standard (AES) development process in 1997 through a public competition under the Information Technology Management Reform Act; after evaluating 15 candidates, NIST selected the Rijndael algorithm on October 2, 2000, and published it as FIPS 197 on November 26, 2001, specifying a 128-bit block size and key lengths of 128, 192, or 256 bits.[24] Following AES adoption, NIST withdrew DES (FIPS 46-3) on May 19, 2005, citing its inadequate security for federal information protection.[25] AES has since become integral to protocols like TLS for web security and IPsec for VPNs, with AES-256 remaining the recommended standard as of 2025 despite concerns over potential quantum computing threats via Grover's algorithm, which would reduce its effective strength but still deem it sufficiently secure for the foreseeable future.[26]Design Principles
Confusion and Diffusion
In cryptography, confusion refers to the property of a block cipher that obscures the relationship between the plaintext, the key, and the ciphertext by making the output highly dependent on the key in a complex, nonlinear manner.[18] This principle, introduced by Claude Shannon, aims to frustrate statistical attacks by ensuring that even small changes in the key result in unpredictable alterations to the ciphertext, thereby complicating efforts to deduce the key from observed plaintext-ciphertext pairs.[18] Nonlinear components, such as substitution boxes (S-boxes), are commonly employed to achieve confusion by mapping input bits to output bits in a way that defies linear approximations. Diffusion, another foundational concept from Shannon, ensures that the influence of each plaintext bit and key bit spreads throughout the entire ciphertext block, dissipating any local statistical patterns in the input.[18] Ideally, a single bit change in the plaintext or key should affect approximately half of the output bits, promoting uniformity and resistance to differential analysis.[18] The avalanche effect serves as a key metric for evaluating diffusion, where changing one input bit causes about 50% of the output bits to flip, achieving a balanced distribution over multiple rounds to ensure full diffusion across the block. Shannon's criteria of confusion and diffusion, outlined in his 1949 paper, form the basis for secure block cipher design by countering known-plaintext and statistical attacks through iterative application in round-based structures.[18] The strict avalanche criterion formalizes this balance, requiring that for any single input bit complemented, each output bit changes with probability exactly 0.5, independent of the input values: where denotes a change in the -th input bit and a change in the -th output bit. This criterion ensures complete and unbiased diffusion, enhancing the cipher's robustness.Round-Based Iteration
Block ciphers predominantly employ an iterated round structure, wherein the encryption process applies a round function sequentially multiple times to the input plaintext block, with each application incorporating a unique subkey generated from the master key. This model defines the cipher as a composition of round functions: where denotes the number of rounds and each processes the intermediate state using the -th subkey.[27] The round function generally consists of key mixing (typically an XOR operation with the subkey), nonlinear substitution to introduce confusion, and linear or permutation operations to promote diffusion across the block. For instance, in the Advanced Encryption Standard (AES), each round applies SubBytes for substitution, ShiftRows and MixColumns for diffusion, and AddRoundKey for mixing. Similarly, the Data Encryption Standard (DES) uses 16 rounds featuring key XOR, S-box substitutions, and permutations within its round computation.[28][29] The choice of round count strikes a balance between cryptographic strength and computational efficiency, commonly ranging from 8 to 16 rounds in established designs; AES uses 10 rounds for 128-bit keys, 12 for 192-bit, and 14 for 256-bit keys, while DES employs 16. Increasing the number of rounds enhances resistance to cryptanalytic attacks, such as differential and linear cryptanalysis, by iteratively propagating small changes throughout the block to achieve full diffusion after sufficient iterations.[28][29][30] Decryption mirrors the encryption structure but applies the round functions in reverse with subkeys in reversed order, ensuring the algorithm is self-invertible and permitting a single implementation for both directions. In DES, this involves using subkeys from the 16th to the 1st; AES achieves invertibility through inverse transformations like InvSubBytes and InvMixColumns, also with reversed keys.[29][28] Many iterated ciphers incorporate whitening via pre-round and post-round key XORs to bolster security against exhaustive search and related-key attacks; AES's initial and final AddRoundKey steps serve this purpose, while the DESX variant explicitly adds 64-bit XORs before and after the 16 DES rounds to effectively extend the key length. The subkeys are produced by a dedicated key scheduling mechanism.[28][31]Key Scheduling Mechanisms
In block ciphers, the key schedule is an algorithm that derives a set of round subkeys from a master key, enabling the application of distinct transformations across multiple rounds.[13] This process expands a relatively short master key of length k bits into a larger set of r subkeys, each typically of length n bits to match the block size, ensuring efficient and varied encryption operations.[32] The key schedule algorithm commonly employs operations such as permutations, bit rotations, and substitutions via S-boxes to generate the subkeys, promoting diversity and resistance to analysis.[13] Its primary goals include avoiding the production of weak or predictable subkeys and introducing nonlinearity to thwart linear or differential attacks on the derived keys; for instance, some designs incorporate linear feedback shift registers (LFSRs) for pseudorandom expansion or hash-like functions to enhance key dependence.[33] From a security perspective, a robust key schedule prevents attacks such as slide attacks, which exploit periodic or similar subkeys to reduce the effective security margin by aligning plaintext-ciphertext pairs across rounds.[34] Mathematically, the expansion can be modeled as generating the i-th subkey via a pseudorandom function G, such that: where G ensures that subkeys are indistinguishable from random without knowledge of the master key.[13] Variations in key schedules often accommodate decryption by reversing the order of subkeys from the encryption process, allowing the inverse round function to be computed efficiently while maintaining structural symmetry.[13] These subkeys are then applied sequentially in the round-based iteration of the cipher to transform the data.[13]Architectural Variants
Feistel Ciphers
A Feistel cipher, also known as a Feistel network, divides the input block into two equal halves, denoted as the left half and the right half . Each round of the cipher applies a round function to one half combined with a subkey, while the other half remains unchanged except for an XOR operation. Formally, for round , the updated halves are computed as: where is the subkey for round derived from the master key, and is a nonlinear function that typically operates on a fixed-size input. After rounds, the output is , often followed by a swap of the halves or an initial/final permutation for the final ciphertext block. Decryption in a Feistel cipher is performed using the same round structure but with the subkeys applied in reverse order, making the process symmetric and inherently invertible without needing to compute the inverse of the round function . This balanced design ensures that the overall transformation is a permutation of the input space, preserving the block size. The full round transformation can be expressed compactly as . One key advantage of the Feistel structure is its computational efficiency in software implementations, as it avoids the need for modular inverses or other potentially expensive operations required in some alternative designs. Furthermore, the Luby-Rackoff theorem proves that a four-round Feistel network, when instantiated with independent pseudorandom functions for , constructs a strong pseudorandom permutation indistinguishable from a random permutation by any efficient adversary. With three rounds, it achieves a weaker pseudorandom permutation property. The Data Encryption Standard (DES) exemplifies a Feistel cipher with 16 rounds, where the block size is 64 bits and each half is 32 bits. In DES and similar ciphers, the round function is typically composed of a nonlinear substitution layer using S-boxes to provide confusion, followed by a linear permutation layer to aid diffusion. This combination in implements key principles of confusion through the S-boxes' resistance to linear analysis. Despite these strengths, Feistel ciphers exhibit slower diffusion per round, as changes in one half propagate only to the other half via the XOR, limiting mixing to half the block size until subsequent rounds. Achieving full diffusion across the entire block thus requires multiple rounds, potentially increasing the overall computational cost compared to designs with broader per-round mixing.Substitution-Permutation Networks
Substitution-permutation networks (SPNs) represent a fundamental architectural variant in block cipher design, where the entire plaintext block undergoes a series of alternating nonlinear substitution and linear permutation operations to achieve both confusion and diffusion across the state. This structure processes fixed-size blocks, typically 128 bits, by applying multiple rounds of transformations that mix the data uniformly with round-specific subkeys derived from the master key. Unlike unbalanced structures, standard SPNs apply substitutions and permutations uniformly to the full block, ensuring balanced propagation of changes throughout the encryption process.[13] The core structure of an SPN consists of repeated rounds featuring an initial key addition via XOR, followed by a nonlinear substitution layer using S-boxes, and then a linear mixing layer via permutations or matrix multiplications. Each round key is XORed with the current state before substitution, promoting dependency on the key material. The substitution layer employs multiple parallel S-boxes to replace small blocks of bits (e.g., 8 bits) with nonlinear outputs, while the linear layer rearranges and mixes these outputs to spread influences across the entire state. This alternation can be formalized as the state update equation for round : where denotes the substitution function (composed of S-boxes), the linear permutation or mixing transformation, the state after round , and function composition. Occasionally, arithmetic operations like modular additions may appear in the linear layers for enhanced mixing, though XOR and bit permutations remain predominant.[35] From a security perspective, the nonlinear S-boxes provide confusion by complicating the statistical relationship between the key, plaintext, and ciphertext, as originally conceptualized in Shannon's framework for secrecy systems. Meanwhile, the linear layers ensure diffusion by propagating any single-bit change in the input to affect approximately half the output bits per round, ideally achieving full avalanche after a few iterations. SPNs are often designed with byte-oriented S-boxes to facilitate efficient implementation on byte-addressable processors, enhancing practicality without compromising the core principles. Typically, 10 to 14 rounds are employed to balance security margins against known cryptanalytic attacks, with the exact number scaled by block and key sizes to resist differential and linear cryptanalysis.[36][13][35] Decryption in an SPN mirrors encryption but proceeds in reverse: starting from the final round key, it applies the inverse linear layer, followed by inverse S-box lookups (which require bijective S-boxes), and concludes with XOR of the round key. The linear layers must be invertible, often via matrix inversion over finite fields, ensuring the process is computationally equivalent in complexity to encryption. This symmetric design simplifies implementation while maintaining the diffusion properties in reverse.[35]Lai-Massey and Other Structures
The Lai-Massey scheme is an alternative block cipher structure that processes two parallel branches of the input block, balancing linear and nonlinear operations to achieve security properties distinct from Feistel or substitution-permutation networks.[37] In each round, the state is represented as a pair . Let . The update proceeds as follows: Here, is a key-dependent nonlinear round function, denotes bitwise XOR (or group operation), and is the round subkey. This design ensures invertibility because the difference is preserved, allowing decryption by computing from the output difference and subtracting it from both halves, without requiring the inverse of the nonlinear part of . To incorporate key dependency while maintaining security, can be constructed using orthomorphisms—bijective mappings that preserve linearity—combined with nonlinear components.[38] The scheme was first introduced in the design of the PES cipher and later refined for the International Data Encryption Algorithm (IDEA), which uses specific operations like modular addition, XOR, and multiplication within .[37] Other structures extend or modify Feistel-like iterations to handle varying branch sizes or multiple partitions. Unbalanced Feistel networks divide the block into two unequal parts, say of sizes and with , where one part is updated using a round function applied to the smaller part, enabling flexible diffusion tailored to specific hardware constraints.[39] For instance, RC5 employs an unbalanced variant incorporating data-dependent rotations, where the rotation amount for one word derives from the other, promoting avalanche effects with fewer rounds. Generalized Feistel networks further generalize this by partitioning the block into multiple branches (more than two), applying cyclic shifts or permutations across branches with round functions on subsets, as seen in multi-branch designs like those in CLEFIA. These structures offer advantages such as enhanced resistance to linear cryptanalysis, owing to the balanced mixing of operations that disrupts linear approximations more effectively than balanced Feistel ciphers in certain configurations.[38] Additionally, their ability to achieve broader diffusion per round can reduce the total number of rounds needed for security, making them suitable for resource-constrained environments.[40] However, Lai-Massey and similar schemes remain less extensively studied than mainstream architectures, potentially exposing them to undiscovered vulnerabilities in long-term analysis.[41]Core Operations
Substitution and Permutation Primitives
Substitution and permutation primitives form the foundational building blocks for introducing nonlinearity and diffusion in block ciphers, particularly within substitution-permutation network (SPN) architectures. S-boxes, or substitution boxes, are nonlinear bijective mappings that transform fixed-size input blocks into output blocks of the same size, typically implemented as lookup tables for efficiency. Common dimensions include 8×8 tables operating on bytes, as seen in the Advanced Encryption Standard (AES), where each entry maps an 8-bit input to an 8-bit output to obscure the relationship between plaintext and ciphertext. The output of an S-box is denoted as , where is the input vector and is the substitution function.[24] Key design criteria for S-boxes emphasize cryptographic strength against common attacks, including high nonlinearity and low differential uniformity. Nonlinearity measures the minimum distance from the S-box to the set of all affine functions, ideally approaching for an -bit S-box to resist linear cryptanalysis, with the AES S-box achieving the optimal value of 112 for . Differential uniformity, defined as the maximum number of outputs for any nonzero input difference, should be minimized to thwart differential cryptanalysis; the AES S-box attains the optimal value of 4 for 8 bits, ensuring no input difference produces more than four output differences. Additionally, S-boxes must satisfy the strict avalanche criterion (SAC), where flipping a single input bit changes approximately 50% of the output bits on average, promoting rapid diffusion of changes. S-boxes are constructed using algebraic methods to meet these criteria, such as composing a multiplicative inverse in a finite field like with an affine transformation, as in the AES design, or by leveraging bent functions—which achieve perfect nonlinearity—for component-wise construction to maximize resistance to linear approximations with bias below . These approaches ensure the S-box provides robust confusion without linear dependencies.[24] Permutation primitives, in contrast, are linear operations that rearrange or mix bits to achieve diffusion, spreading the influence of each input bit across the output. These can involve simple bit shuffling, such as fixed permutations that transpose bit positions, or more sophisticated linear transformations like matrix multiplication over , which ensure that changes in a single bit propagate to multiple output bits. In standard block ciphers, permutations are typically fixed and independent of the key to simplify analysis and implementation, though key-dependent variants exist in some designs for added variability.ARX Operations
ARX operations form a foundational paradigm in the design of certain block ciphers, relying on three elementary bitwise and arithmetic instructions: modular addition, rotation, and XOR. These operations enable efficient mixing of data without the need for precomputed tables, making ARX particularly suitable for software implementations on resource-constrained devices.[42] Modular addition operates on n-bit words modulo , introducing nonlinearity through carry propagation that diffuses bits across the operand; for instance, the carry into position depends on the majority function of the previous bits and carry. Rotation performs fixed-bit circular shifts, either left () or right (), which rearrange bits to enhance diffusion without data loss. XOR provides linear mixing by bitwise exclusive-or, combining inputs over the field . Together, these components form a functionally complete set when constants are available, allowing complex transformations with minimal instruction overhead.[43] The primary advantages of ARX lie in its simplicity and performance: it avoids lookup tables, reducing memory footprint and vulnerability to cache-timing attacks, while executing rapidly on general-purpose CPUs due to native support for these instructions. For example, the SPECK family of lightweight block ciphers employs ARX exclusively in its round function for block sizes from 32 to 128 bits. Security in ARX designs stems from the nonlinearity of modular addition, which prevents straightforward linear approximations and supports resistance to differential and linear cryptanalysis when sufficient rounds are used; the SIMON family similarly leverages ARX for hardware-optimized block encryption. A representative ARX round can be expressed as: where denotes modular addition, is left rotation by bits, and is XOR. BLAKE2, a hash function adaptable to block-like processing, applies multiple such ARX rounds for compression. ARX techniques also appear briefly in key scheduling for expansion in ciphers like SPECK.[42][43]Modular Arithmetic Techniques
Modular multiplication in finite fields GF(2^n) serves as a fundamental technique in block ciphers to achieve enhanced nonlinearity and diffusion through polynomial arithmetic. In this operation, elements are represented as polynomials over GF(2), and multiplication involves the product of two such polynomials followed by reduction modulo an irreducible polynomial of degree n. This process ensures that a single bit change in the input can affect multiple output bits, promoting avalanche effects essential for security.[44] For instance, in GF(2^8), the multiplication of two elements and is computed as: where is an irreducible polynomial, such as . This technique, employed in diffusion layers of ciphers like AES, leverages the algebraic structure of finite fields to mix data effectively across the block.[45] Beyond GF(2^n) multiplications, other modular arithmetic techniques include inversion and exponentiation modulo a prime. Modular inversion computes the multiplicative inverse of an element modulo a prime p, satisfying , often using algorithms like the extended Euclidean method. Exponentiation, such as , introduces strong nonlinearity suitable for S-box generation. These were utilized in NESSIE project candidates, for example, SAFER++ derives its S-boxes from exponentiation and discrete logarithms modulo the prime 257, enhancing confusion properties.[46] Such techniques bolster resistance to algebraic attacks, including interpolation and Gröbner basis methods, by creating high-degree multivariate equations over the field that are computationally infeasible to solve for the key. The nonlinear nature of field multiplications and inversions increases the algebraic complexity, making it harder for attackers to linearize the cipher's equations compared to simpler operations.[47][48] Despite their security benefits, modular arithmetic operations incur higher hardware costs, requiring dedicated circuitry for polynomial reductions and multiplications, which can demand 20-50% more gates than bitwise XOR in resource-constrained implementations. This trade-off is particularly relevant in 2025 for lightweight block ciphers targeting IoT devices, where ongoing research optimizes GF(2^n) routines—such as using composite fields or lookup tables—to balance diffusion strength with low area (e.g., under 2000 GE) and power consumption.[45][49] These field-based methods complement ARX operations by providing superior nonlinearity for diffusion layers in hybrid designs.Modes of Operation
Block-Oriented Modes
Block-oriented modes of operation for block ciphers process plaintext data in fixed-size blocks, typically matching the cipher's block length, such as 128 bits for AES. These modes enable the encryption of messages longer than a single block by applying the underlying block cipher to each block, often with mechanisms to link blocks for enhanced security. They generally support parallel processing during encryption or decryption, depending on the mode, but differ in how they handle error propagation: a bit error in a ciphertext block may corrupt the corresponding plaintext block and potentially affect subsequent blocks. Padding is required when the message length is not a multiple of the block size to ensure complete blocks for processing.[7] The Electronic Codebook (ECB) mode is the simplest block-oriented approach, encrypting each plaintext block independently using the block cipher under the same key. In ECB, identical plaintext blocks produce identical ciphertext blocks, which can reveal patterns in the data, such as in images or structured text, making it unsuitable for most applications. ECB supports full parallelization for both encryption and decryption since blocks are processed independently, but it lacks diffusion between blocks. ECB is malleable, allowing an adversary to modify ciphertext blocks without detection, as changes to one block do not affect others.[7][50] Cipher Block Chaining (CBC) mode improves security by chaining blocks: the first plaintext block is XORed with an initialization vector (IV) before encryption, and each subsequent block is XORed with the previous ciphertext block. This hides patterns from identical plaintext blocks and provides diffusion across the message. The encryption equation is: where is the IV, is the block cipher encryption under key , is the -th plaintext block, and is the -th ciphertext block. Decryption reverses the process using the block cipher's decryption function . CBC requires a unique, unpredictable IV per message to maintain security and allows parallel decryption but not parallel encryption due to the dependency on prior blocks. A single-bit error in a ciphertext block corrupts the corresponding plaintext block entirely and flips one bit in the next, limiting propagation to one block. CBC is chosen-plaintext secure (IND-CPA) when used with a random IV, providing semantic security against passive adversaries.[7] Cipher Feedback (CFB) mode uses the block cipher to generate a keystream by encrypting the previous ciphertext (or IV for the first block), then XORing it with the plaintext to produce the next ciphertext segment; for full-block operation (segment size equal to block size), this mimics a stream but relies on block encryptions. The decryption equation for full-block CFB is: where is the block cipher encryption under key . CFB is self-synchronizing, recovering from errors after one block, but a bit error affects the current and several subsequent segments depending on the feedback shift. It requires a unique IV and supports parallel decryption after serial input reconstruction, though encryption is serial.[7] Output Feedback (OFB) mode generates a keystream by iteratively encrypting the output of the previous encryption step, starting from an IV, and XORing it with the plaintext to form ciphertext; this avoids feeding ciphertext back, preventing error propagation into the keystream. OFB treats the block cipher as a pseudorandom generator, allowing precomputation of the keystream for parallel encryption and decryption. However, reusing the same IV with the same key compromises the entire keystream, severely weakening security, so IVs must be unique nonces. Like CFB, OFB provides stream-like behavior but is fundamentally block-based in its cipher invocations.[7]Stream-Like Modes
Stream-like modes of operation for block ciphers generate a keystream by repeatedly applying the cipher to structured inputs, such as counters or tweaked values, which is then XORed with the plaintext to produce ciphertext of arbitrary length. This approach transforms the block cipher into a synchronous stream cipher, enabling efficient processing of data streams without the need for block chaining. These modes prioritize flexibility and performance, particularly in scenarios requiring high throughput or parallel computation. The Counter (CTR) mode constructs the keystream by encrypting successive counter blocks, typically formed by concatenating a nonce or initialization vector (IV) with an incrementing counter value to ensure uniqueness across messages under the same key. The encryption process for each block is defined as , where denotes the block cipher encryption function under key , is the -th plaintext block, and indicates concatenation. CTR mode supports full parallelization during both encryption and decryption, as each block's keystream can be computed independently, and it exhibits no error propagation, with bit errors in a ciphertext block affecting only the corresponding plaintext block. This mode was proposed for standardization in AES modes by Black and Rogaway, emphasizing its simplicity and efficiency. Galois/Counter Mode (GCM) extends CTR by integrating authentication, using CTR for confidentiality while employing the GHASH function—a universal hash over the Galois field GF(2^{128})—to compute an authentication tag over the ciphertext and any associated data. In GCM, the CTR variant (GCTR) generates the keystream from an initial counter block derived from the IV, and GHASH uses a hash subkey derived from the block cipher to produce the tag, ensuring both privacy and integrity. As an authenticated encryption with associated data (AEAD) scheme, GCM is approved by NIST in Special Publication 800-38D for protecting sensitive data in communications and storage. Its design balances computational efficiency with strong security guarantees, making it widely adopted in protocols like TLS. XTS-AES mode is tailored for encrypting data on block-oriented storage devices, functioning as a tweakable block cipher where the tweak value—typically the sector address—customizes the encryption for each data unit, preventing attacks that exploit identical plaintext patterns across sectors. It employs two keys: one for deriving the tweak via exponentiation in GF(2^{128}), and another for the core AES encryption, allowing the mode to handle data units of 128 bits or more without padding through a ciphertext-stealing technique for the final partial block. Standardized in IEEE 1619-2007 and approved by NIST for disk encryption applications, XTS ensures length-preserving encryption suitable for fixed-size storage blocks. Tweakable variants extending XTS principles have been developed for more general-purpose confidentiality in storage systems. Regarding security, CTR mode achieves indistinguishability under chosen-plaintext attack (IND-CPA) security, provided the underlying block cipher behaves as a pseudorandom permutation and all counter blocks remain unique across encryptions under the same key. However, nonce reuse in CTR is catastrophic, as it results in identical keystreams for multiple messages, enabling attackers to recover plaintext by XORing corresponding ciphertext blocks and compromising overall confidentiality. Similar uniqueness requirements apply to tweaks in modes like XTS to maintain security against chosen-plaintext adversaries.Padding and Formatting
Standard Padding Schemes
Block ciphers require input data to be a multiple of the block size, typically achieved by appending padding to the plaintext before encryption. Standard padding schemes ensure that this extension is reversible upon decryption, allowing the original message length to be recovered. These methods are commonly applied in modes of operation such as CBC, where the padded plaintext is divided into blocks for processing.[51] PKCS#7 padding, also known as PKCS#5 for 8-byte blocks, appends a sequence of bytes to the plaintext, where each padding byte equals the number of bytes added, ranging from 1 to the full block size. For example, if 3 bytes are needed to reach the block boundary, three bytes each with value 3 (0x03) are appended. This scheme is defined in the Cryptographic Message Syntax (CMS) standard and is removable on decryption by checking the value of the last byte to strip the corresponding number of trailing bytes.[51] ANSI X.923 padding, specified in the withdrawn ANSI X9.23 standard, similarly extends the plaintext but fills the padding area with zero bytes except for the final byte, which indicates the total number of padding bytes added. For instance, to add 3 bytes, it appends two zero bytes followed by a byte with value 3 (0x03). This method ensures unambiguous removal during decryption by reading the last byte and discarding the preceding zeros up to that count, maintaining compatibility with legacy systems despite the standard's withdrawal.[52] The length of padding required in these schemes is calculated as , where is the block size and is the plaintext length; if , a full block of padding is added. However, deterministic padding like PKCS#7 and ANSI X.923 can introduce vulnerabilities, such as padding oracle attacks, where an attacker exploits decryption feedback to recover plaintext byte-by-byte. These attacks were first demonstrated by Serge Vaudenay in 2002 against CBC mode with padding oracles.[51][53] To mitigate such issues, ISO 10126 padding introduces randomness by filling the padding area with arbitrary bytes, followed by a final byte specifying the padding length. This scheme, defined in ISO/IEC 10126-2 (withdrawn in 2007), enhances security against certain side-channel attacks while remaining removable on decryption, though it requires a reliable random number generator.[54]Format Considerations
In block cipher encryption, format considerations extend beyond basic padding to ensure the integrity and unambiguous recovery of the original message structure. A critical aspect involves incorporating explicit length fields, which can be prepended or appended to the plaintext before encryption in some protocols. These fields specify the exact byte length of the message, allowing the decryptor to precisely delineate the payload from any padding without relying on padding validation alone. This approach mitigates padding removal attacks, such as those exploiting ambiguous padding boundaries in modes like CBC, where an adversary might manipulate ciphertexts to infer plaintext information through error responses. For instance, in the TLS protocol, each record includes a 16-bit length field in its unencrypted header, which defines the size of the following encrypted fragment and facilitates proper decryption.[55] To further safeguard against malleability—where minor ciphertext alterations could yield valid but altered plaintext—careful encoding of structured data is essential. For binary or hierarchical data, ASN.1 with Distinguished Encoding Rules (DER) provides a non-malleable format, ensuring that any deviation from the canonical encoding results in parsing failure rather than subtle semantic changes. This is particularly valuable in cryptographic contexts like certificate handling, where DER's strict rules prevent adversaries from forging valid structures through bit flips. Similarly, for textual or internationalized data, UTF-8 encoding is recommended due to its canonical representation, which avoids overlong or invalid sequences that could introduce exploitable ambiguities when decrypted. Strict UTF-8 validation during encoding and decoding ensures that the format resists malleability while maintaining compatibility.[56][57] Best practices emphasize integrating these elements within established protocols, such as TLS, where explicit lengths are combined with padding schemes to achieve robust format preservation. Symmetric block ciphers like AES remain quantum-resistant when using sufficiently large key sizes (e.g., AES-256 providing at least 128 bits of post-quantum security), as noted in NIST's post-quantum cryptography guidance.[58]Cryptanalytic Methods
Brute-Force Attacks
A brute-force attack, also known as an exhaustive key search, on a block cipher involves systematically trying every possible key in the key space until the correct key is found that, when used to decrypt a known ciphertext, produces the expected corresponding plaintext.[17] This approach requires no knowledge of the cipher's internal structure and relies solely on computational power to enumerate the possible keys, where is the key length in bits.[17] The time complexity of this attack is , making it infeasible for sufficiently large due to the exponential growth in required operations.[17] For block ciphers using multiple encryptions, such as double encryption with two independent keys, the meet-in-the-middle attack reduces the effective complexity. Introduced by Diffie and Hellman in their analysis of the Data Encryption Standard (DES), this technique involves encrypting the plaintext with all possible first keys and storing the intermediate results, then decrypting the ciphertext with all possible second keys to find a match in the middle, requiring time and space for a total key length of .[59] This provides a square-root speedup over pure brute force for such constructions but does not affect single-encryption ciphers. In practice, the DES with its 56-bit key was vulnerable to brute-force attacks, as the full key space of equates to approximately 72 quadrillion operations in the worst case.[60] This was demonstrated in 1998 when the Electronic Frontier Foundation (EFF) built a specialized hardware device, known as the DES Cracker, that exhaustively searched the key space in 56 hours using custom ASICs.[21] In contrast, the Advanced Encryption Standard (AES)-128, with a 128-bit key, provides security against brute-force attacks equivalent to operations, which remains computationally infeasible with current and foreseeable classical hardware.[61] To mitigate brute-force attacks, block ciphers employ longer key lengths, such as 128 bits or more, to exponentially increase the search space.[61] However, the advent of quantum computing introduces Grover's algorithm, which offers a quadratic speedup for unstructured search problems, reducing the effective complexity of key search to approximately quantum operations for a -bit key.[62] This implies that AES-128 would offer only 64 bits of quantum security, prompting recommendations for larger keys like AES-256 in post-quantum contexts.[62]Differential and Linear Cryptanalysis
Differential cryptanalysis is a chosen-plaintext attack on block ciphers that exploits the propagation of differences between pairs of plaintexts through the cipher's rounds to predict differences in the corresponding ciphertexts with a probability greater than random.[63] The core idea involves selecting plaintext pairs with a specific input difference ΔP and observing the output difference ΔC, aiming to find high-probability paths where the difference evolves predictably.[63] A differential characteristic is a trail of differences across rounds that achieves this high probability, often focusing on active S-boxes where differences are introduced or amplified.[63] The differential probability δ for a characteristic is defined as the probability that a given input difference Δin leads to a specific output difference Δout through the round function f:δ = Pr[Δ_out = f(Δ_in)]
δ = Pr[Δ_out = f(Δ_in)]
ε = |Pr[equation holds] - 1/2|
ε = |Pr[equation holds] - 1/2|
