Cryptanalysis is the practice of finding weaknesses in cryptographic systems so that encrypted information can be read without the key. It is, in essence, the science of code-breaking. The field ranges from centuries-old pen-and-paper techniques used to crack substitution ciphers all the way to modern attacks that exploit subtle timing differences in computer hardware or harness machine learning to recover secret keys. While cryptography builds the locks, cryptanalysis tests whether those locks actually hold.
From Pen and Paper to Bletchley Park
The oldest cryptanalytic methods work by exploiting patterns in language. A simple substitution cipher, for example, replaces each letter with a different one, but it preserves the frequency with which letters appear. An analyst who counts letter frequencies in the ciphertext can make educated guesses about which substitutions were used. More sophisticated classical ciphers tried to flatten those frequency patterns. The autokey cipher, for instance, uses a keyword that feeds into the plaintext itself, making each encryption dependent on the message. Even so, researchers have shown that statistical tools like the index of coincidence can still crack these ciphers by testing random keys of various lengths and identifying when the decrypted text starts to look like real language rather than gibberish.1ResearchGate. A cryptanalysis of the autokey cipher using the index of coincidence
The most famous episode in classical cryptanalysis is the breaking of Germany’s Enigma machine during World War II. The Enigma was an electromechanical device that scrambled messages through rotating wheels and a plugboard, producing ciphertext that changed with every keystroke. It had an astronomical number of possible settings, which made brute-force guessing impractical. But the machine had two structural flaws that gave the codebreakers at Bletchley Park a way in. The plugboard’s wiring was reciprocal: if the letter A was connected to N, then N was also connected to A. And the machine’s reflector meant a letter could never encrypt to itself. That second property was especially useful. If analysts suspected a particular word appeared somewhere in a message (a “crib”), they could rule out any position where a plaintext letter and its corresponding ciphertext letter matched. Alan Turing’s bombe machine automated this search, and a further improvement proposed by mathematician Gordon Welchman exploited the reciprocal plugboard wiring to eliminate even more incorrect settings.2ResearchGate. Understanding the Enigma Machine: Mechanism, History, and Cryptanalysis
The Enigma story illustrates a principle that holds throughout the history of cryptanalysis: the weakness is rarely in the sheer number of possible keys. It is in structural properties of the system that reduce the space an attacker actually has to search.
How Modern Block Ciphers Get Attacked
The ciphers that protect your web traffic and hard drives today are called block ciphers. They take fixed-size chunks of data and scramble them through many rounds of substitution and rearrangement operations, all controlled by a secret key. Breaking these ciphers head-on by trying every possible key is computationally infeasible for well-designed algorithms. Cryptanalysts instead look for shortcuts, and the two most influential shortcut strategies are differential cryptanalysis and linear cryptanalysis.
Differential cryptanalysis works by feeding pairs of plaintexts with known differences into the cipher and watching how those differences propagate through each round. If the cipher were perfectly random, output differences would be unpredictable. In practice, certain input differences lead to certain output differences more often than chance would predict. An analyst identifies these high-probability “differentials” by studying each component of the cipher, then stitches them together across rounds to build a pattern that leaks information about the key.3Technische Universität Graz. Automatic Cryptanalysis of Block Ciphers: Finding Efficient Key-Recovery Attacks Linear cryptanalysis takes a complementary angle, looking for approximate linear relationships between bits of the plaintext, the ciphertext, and the key. Both techniques require large amounts of data, and modern ciphers like AES are specifically designed to resist them. But these attacks remain the standard yardstick against which new cipher designs are measured.
A third family of attacks frames the entire encryption process as a giant system of equations. In algebraic cryptanalysis, the analyst describes each operation of the cipher as polynomial equations, then tries to solve the system to recover the key.4Springer Books. Block Ciphers: Algebraic Cryptanalysis and Gröbner Bases This approach sounds elegant, but the systems involved are enormous. For full-strength AES, solving them remains out of reach. Nevertheless, algebraic techniques have proven useful against reduced-round versions of ciphers and simpler designs, and they often combine with differential or linear methods to squeeze out marginal improvements.
Attacking Public-Key Systems
Public-key cryptography relies on mathematical problems that are easy to compute in one direction but very hard to reverse. RSA’s security, for example, comes from the difficulty of factoring the product of two large prime numbers. Elliptic curve cryptography depends on the difficulty of the discrete logarithm problem on an elliptic curve. Cryptanalysis of these systems means finding faster ways to solve those underlying hard problems.
For elliptic curves, one avenue of attack is the index calculus method, which has been effective against discrete logarithm problems in other settings. Researchers have proposed index calculus algorithms that work on elliptic curves defined over small-degree extension fields, achieving running times that beat generic methods for certain curve configurations.5Journal of Symbolic Computation. Index calculus for abelian varieties of small dimension and the elliptic curve discrete logarithm problem More recent work has explored using SAT solvers, a type of automated reasoning tool, to speed up one of the critical steps in index calculus.6PubMed Central. A SAT-Based Approach for Index Calculus on Binary Elliptic Curves Researchers have even experimented with quantum annealing hardware to tackle the elliptic curve discrete logarithm problem, combining it with classical index calculus methods.7Tatra Mountains Mathematical Publications. Solving Elliptic Curve Discrete Logarithm Problem on Twisted Edwards Curves Using Quantum Annealing and Index Calculus Method None of these approaches currently threaten the elliptic curves used in mainstream cryptography at standard key sizes, but they highlight how the boundary of what’s attackable keeps shifting.
Lattice-based cryptography is a newer family of systems, with NTRU being one of the oldest and most studied examples. NTRU’s security depends on the difficulty of finding short vectors in high-dimensional mathematical lattices. Cryptanalysts have attacked NTRU by applying lattice reduction techniques, which shrink the lattice basis until the secret key (or a functionally equivalent alternative key) becomes visible.8Advances in Cryptology — EUROCRYPT 1997. Lattice attacks on NTRU Later refinements showed that guessing a small number of coefficients in the private key first and then searching a reduced-dimension lattice can cut the breaking time substantially.9Information Processing Letters. Revisiting lower dimension lattice attacks on NTRU These lattice-based attacks matter well beyond NTRU, because many of the algorithms being proposed as replacements for RSA and elliptic curves in a post-quantum world are also built on lattice problems.
Side-Channel Attacks and Why the Math Is Not Enough
Some of the most practical cryptanalytic attacks ignore the mathematics of the cipher entirely and instead target the physical implementation. A computer running AES, for example, does not operate in an abstract mathematical universe. It uses a real processor with a cache, draws measurable amounts of power, and takes different amounts of time depending on what operations it performs. These observable byproducts are called side channels, and they can leak enough information to reconstruct the key.
Cache-timing attacks are a particularly well-studied category. When a program performs encryption, it accesses a lookup table in memory. Whether a particular table entry is already in the processor’s fast cache or has to be fetched from slower main memory changes how long the operation takes. An attacker who can measure those timing differences, either by sharing the same processor or by interacting with the system remotely, can work backward from timing statistics to infer which table entries were accessed, and from there, deduce the encryption key.10Research Online. Cache-timing attack against aes crypto system – countermeasures review Recent work has formalized this approach further, proposing models for how cache access patterns leak information and demonstrating multiple efficient methods that can extract AES keys from software implementations.11Computers & Security. Extending the classical side-channel analysis framework to access-driven cache attacks
The defenses against side-channel attacks are fundamentally different from those against mathematical cryptanalysis. You cannot fix a timing leak by choosing a longer key. Instead, implementations have to be rewritten so that every operation takes the same amount of time regardless of the data being processed, or so that the cache access pattern reveals nothing useful. This is notoriously difficult to get right, and new variants of side-channel attacks keep emerging.
Deep Learning Enters the Picture
In classical side-channel analysis, a human analyst has to understand the leakage model, choose appropriate statistical tests, and carefully align collected measurements. Deep learning has started to automate much of this. By training neural networks on power traces or electromagnetic measurements from a device running known operations, researchers can build models that learn to extract key information from noisy real-world data without the analyst needing to specify exactly where the leakage comes from.12ACM Computing Surveys. SoK: Deep Learning-based Physical Side-channel Analysis
One concrete demonstration applied deep learning to attack a software implementation of the SPECK cipher, a lightweight block cipher designed for resource-constrained devices. Using an ensemble of neural network models in a divide-and-conquer strategy, the researchers recovered the full 8-byte secret key from fewer than 250 power traces.13Scientific Reports. Deep learning-based profiling side-channel attacks in SPECK cipher For context, 250 traces is a very small number; older statistical methods often needed tens of thousands. The concern is not that deep learning creates an entirely new class of attack, but that it makes existing side-channel attacks far more efficient, lowering the bar for practical exploitation.
Machine learning is also showing up in attacks against the mathematical foundations of cryptography itself, not just physical implementations. Researchers have used improved machine-learning techniques to attack the “learning with errors” problem, which underpins several post-quantum encryption proposals. One system called VERDE demonstrated attacks on problem dimensions as large as 512, which edges closer to the parameter sizes proposed for real-world use.14NeurIPS Proceedings. VERDE: Improved Machine Learning Attacks on Learning with Errors These attacks are still far from breaking the standards being deployed, but they provide pressure on parameter selection: cryptographers have to choose key sizes large enough to resist not only today’s attacks but plausible improvements in the near future.
When the System Around the Cipher Breaks
Sometimes the cryptographic algorithm is perfectly fine, but the surrounding system has a flaw that undermines everything. One striking example is the analysis of the random number generator used by the Windows operating system. Random numbers are the lifeblood of cryptography: every time your computer generates an encryption key, a session token, or a nonce, it draws from a random number generator. If an attacker can predict the output of that generator, they can predict your keys.
Researchers who reverse-engineered the Windows random number generator found that given its internal state at any point, they could compute the previous state in a manageable number of steps. Worse, the generator ran in user mode rather than in the more protected kernel mode, making its state accessible to any attacker who could exploit a buffer overflow or similar vulnerability. And the system only refreshed the generator’s state with new randomness after it had already produced 128 kilobytes of output. The practical consequence: an attacker who learned a single snapshot of the generator’s state could potentially reconstruct all past and future random values used by that process, including SSL keys and authentication tokens.15ACM Transactions on Information and System Security. Cryptanalysis of the random number generator of the Windows operating system Microsoft acknowledged the vulnerability after the research was published. This kind of finding is a reminder that cryptanalysis in the real world is not just about the algorithm on paper; the whole stack has to be secure.
The Quantum Horizon
Much of the current urgency in cryptanalysis research comes from the prospect of large-scale quantum computers. Shor’s algorithm, first described in the 1990s, can in principle factor large numbers and solve discrete logarithm problems exponentially faster than any known classical algorithm. If a sufficiently powerful quantum computer were built, RSA and elliptic curve cryptography would be broken.
That “if” is doing a lot of work. Current quantum computers are far too small and error-prone to run Shor’s algorithm at the scale needed to threaten real cryptographic keys. Estimates of the number of logical qubits required vary widely, but all of them are orders of magnitude beyond what today’s hardware can deliver. Still, the threat is taken seriously because encrypted data captured today could be stored and decrypted later once quantum machines improve, a scenario sometimes called “harvest now, decrypt later.” This is why governments and standards bodies are pushing for a transition to post-quantum cryptographic algorithms, most of which are based on lattice problems, hash functions, or error-correcting codes rather than factoring or discrete logarithms.
The lattice attacks described earlier become especially relevant here. Because so many post-quantum proposals rely on the hardness of lattice problems, any improvement in lattice cryptanalysis directly affects confidence in the next generation of cryptography. The VERDE results on learning-with-errors and the ongoing refinements in lattice reduction for NTRU-like schemes are part of the same broad effort to understand exactly how much security margin these new systems provide.
How Cryptographic Strength Gets Evaluated
Before a cryptographic algorithm is adopted as a standard, it goes through extensive public evaluation. The process used by the U.S. National Institute of Standards and Technology (NIST) for selecting the SHA-3 hash function standard is illustrative. Multiple candidate algorithms were submitted and subjected to years of public scrutiny, including cryptanalysis attempts by researchers worldwide. One analysis of the SHA-3 finalists using the NIST SP 800-22 statistical test suite found that not all finalists fully met the requirements for statistical randomness; only two of the five finalists, Blake and Grøstl, passed every test without statistically significant deviations.16Територія безпеки. СТАТИСТИЧНИЙ АНАЛІЗ КРИПТОГРАФІЧНОЇ СТІЙКОСТІ ФІНАЛІСТІВ КОНКУРСУ SHA-3 ЗА МЕТОДОЛОГІЄЮ NIST SP 800-22 The algorithm ultimately selected as SHA-3, Keccak, was chosen based on a broader set of criteria including performance, security margin, and design diversity, but statistical testing of this kind is one of many layers of evaluation that help expose subtle weaknesses.
This kind of competitive, open evaluation process is one of the main reasons modern standardized ciphers are as strong as they are. The philosophy is adversarial by design: invite the world’s best cryptanalysts to attack your algorithm for years before you trust it. Algorithms that survive are not proven unbreakable in any mathematical sense, but they have withstood sustained, expert attack. When a new cryptanalytic technique does manage to shave rounds off a cipher’s security margin or reduce the effective key length by a few bits, it rarely translates to a practical break, but it does inform whether the algorithm’s safety cushion is large enough.
Cryptanalysis and the Politics of Encryption
Cryptanalysis does not exist in a vacuum. The ability (or inability) to break encryption has policy consequences that have been debated for decades. Intelligence and law enforcement agencies in the Five Eyes countries have argued that end-to-end encryption creates a “going dark” problem, making it impossible to access digital evidence even with legal authority. This has led to legislation in several jurisdictions that restricts or seeks to regulate the use of strong encryption.17SpringerLink (Ethics and Information Technology). Specifying a principle of cryptographic justice as a response to the problem of going dark
The tension is real and not easily resolved. Weakening encryption to allow government access necessarily creates a vulnerability that could be exploited by other actors. Cryptanalysts understand this tradeoff viscerally: every backdoor is a bug waiting to be found. The Windows random number generator vulnerability discussed earlier is a case in point. It was not a deliberate backdoor, just a design flaw, but the effect was the same: an attacker who found the weakness could compromise all the cryptography built on top of it. The history of cryptanalysis suggests that any intentional weakness inserted into a system will eventually be discovered and exploited by parties beyond those for whom it was intended.

