- Introduced by
- Mitsuru Matsui
- Year
- 1993
- Type
- linear approximation attack
- Family
- Cryptanalytic technique
What does it do?
Linear cryptanalysis is a known-plaintext attack that exploits linear approximations of a cipher's non-linear components to recover secret key bits.
Mitsuru Matsui introduced it in 1993 and applied it to DES, where it needed fewer operations than exhaustive key search. The technique measures how far the XOR of certain plaintext, ciphertext and key bits deviates from random behaviour, and uses that bias to narrow down the key.
The intuition behind the method
Linear cryptanalysis looks for linear equations that relate plaintext bits, ciphertext bits and key bits. Because the rounds of a cipher mix bits only imperfectly, some of these equations hold with a probability slightly away from one half. Given many known plaintext-ciphertext pairs, the attacker checks each candidate value of a small group of key bits and keeps the candidate for which the equation's bias is largest in absolute value. The correct key is the most likely to show that bias.
History
Matsui introduced linear cryptanalysis in 1993 as a known-plaintext attack on DES. In 1994 he reported the first experimental cryptanalysis of DES using the method, which recovered a key from 2^43 known plaintexts. These results showed that a deployed standard could be attacked with this technique.
When to use it
Use linear cryptanalysis to evaluate the resistance of a block cipher during design or standardisation, for example by searching for the best linear approximations of its S-boxes and round functions. It is also the relevant tool when assessing a legacy cipher with known-plaintext data available. Do not use it as a practical attack on a modern cipher whose designers have bounded the linear bias across rounds, since the required data and computation are then generally infeasible. It is also not appropriate when only ciphertext is available, because the method depends on known plaintext-ciphertext pairs.
Limitations and considerations
- Its effectiveness depends on finding approximations with large bias. Modern ciphers such as AES are designed so that the best linear approximations over several rounds have bounded bias, which makes the attack infeasible.
- Requires known plaintext-ciphertext pairs; the attack does not apply when only ciphertext can be observed.
- The data and computation needed grow as the bias shrinks, so an approximation that looks promising on paper may need more pairs than are available in practice.
- Finding strong linear approximations for a multi-round cipher is a hard search problem, and failing to find one does not prove the cipher is secure.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Practical against DES: Matsui's experimental attack recovered a key from 2^43 known plaintexts.
- The piling-up lemma gives a formal way to combine round-level biases into the bias of a multi-round approximation, which makes the analysis systematic.
- Targets statistical linear structure, so it can reveal weaknesses that are not visible from difference-based analysis alone.
- Gives cipher designers a concrete measure, the maximum linear bias of S-boxes and rounds, to guide component selection.
Applications
- Evaluating the linear resistance of block cipher designs during research and standardisation.
- Selecting S-boxes and round transformations that keep the maximum linear approximation bias low.
- Assessing legacy ciphers to decide whether they should be retired or replaced.
- Comparing the security margins of candidate ciphers by the bias bounds of their components.
How it works
How it works
Find linear approximations, that is, linear relationships between plaintext bits, ciphertext bits and key bits, that hold with a probability clearly different from one half.
Estimate the bias (the deviation of the approximation's probability from one half) of each approximation, using the cipher's round structure. The piling-up lemma combines the biases of individual rounds into an overall bias, under an assumption that the component approximations are independent.
For each candidate value of the targeted key bits, count how often the approximation holds over the known plaintext-ciphertext pairs and compute the resulting bias. The correct key is expected to give the bias with the largest absolute value, which may be negative, so the sign is not used as the criterion.
Verify recovered key bits by decrypting ciphertext and checking correctness. Because the bias estimate for each candidate is itself statistical, confirm the top-ranked candidate on known pairs that were not used to rank the candidates.
Common pitfalls
- Treating every linear approximation as exploitable. Approximations with small bias give little advantage and need correspondingly more data.
- Underestimating the practical difficulty of an attack because the stated data requirement looks reasonable on paper. The estimate must be checked against the bias actually achieved.
- Applying the piling-up lemma to approximations that are not independent, which can give a bias estimate that is wrong.
- Analysing linear and differential properties in isolation, when a cipher's resistance depends on both.
Frequently asked questions
What is the piling-up lemma?
The piling-up lemma gives a way to estimate the bias of a linear approximation that spans several rounds by combining the biases of the individual round approximations. It assumes the component approximations are independent, and it is the basis for computing multi-round biases in linear cryptanalysis.
How does AES resist linear cryptanalysis?
AES uses S-boxes chosen to keep the maximum linear approximation bias low, together with a diffusion layer that spreads linear biases across rounds. These design features are intended to bound the bias of the best multi-round approximations, which makes a practical linear attack infeasible.
What is the difference between linear and differential cryptanalysis?
Differential analysis studies how differences in inputs propagate to differences in outputs, while linear analysis studies linear approximations, that is, XOR relations between plaintext, ciphertext and key bits. Both exploit structural weaknesses in ciphers, and both are used when evaluating cipher designs.
Can linear cryptanalysis break modern ciphers?
Not generally. The method was shown to be practical against DES, but modern ciphers such as AES are designed so that the bias of their best linear approximations is bounded, which makes known-plaintext attacks of this kind computationally infeasible.
How do I evaluate linear resistance in my cipher design?
Analyse the linear approximation tables of the S-boxes, then use the piling-up lemma to estimate the maximum bias of approximations across the intended number of rounds. Check that this maximum bias is small enough for the data available to an attacker, keeping in mind that the independence assumption must be justified for the approximations considered.
Related methods
Sources
Matsui, M. (1993). Linear cryptanalysis method for DES cipher. In Advances in Cryptology - EUROCRYPT 1993, LNCS 765, pp. 386-397.
Open DOI referenceMatsui, M. (1994). The first experimental cryptanalysis of the Data Encryption Standard. In Advances in Cryptology - CRYPTO 1994, LNCS 839, pp. 1-11.
Open DOI reference