Skip to content
CryptographyInternals

How Long Would It Take to Crack AES-256? The Real Math

At 10^21 guesses per second, brute-forcing AES-256 takes about 1.8 × 10^48 years. See the math, AES-128 vs AES-256, quantum, and what really breaks AES.

Published on 9 min read

Brute-forcing a single AES-256 key would take, on average, about 1.8 × 10⁴⁸ years, even at 10²¹ guesses per second, which is roughly the hash rate of the entire Bitcoin network. The universe is 13.8 billion years old, so that search lasts about 1.3 × 10³⁸ times the age of the universe. For comparison, AES-128 under the same attack takes about 5.4 billion years on average: already 39% of the age of the universe, for a key half as long.

So the honest answer to "can AES-256 be cracked?" is: not by trying keys, and not by any shortcut anyone has published. When AES-encrypted data does get read by someone who shouldn't, the cipher is almost never the part that failed. The rest of this post shows where those numbers come from, what actually breaks AES in the real world, and what changes with quantum computers.

The short answer, in one table

Here is the average time to find a key by exhaustive search at two rates: 10¹² keys per second (a large GPU cluster) and 10²¹ keys per second (about the whole Bitcoin network, used as an upper bound for "everything humanity can throw at it").

Key sizeNumber of keysAverage at 10¹² keys/sAverage at 10²¹ keys/s
56 bits (DES)7.2 × 10¹⁶about 10 hoursabout 36 microseconds
64 bits1.8 × 10¹⁹about 107 daysabout 9 milliseconds
80 bits1.2 × 10²⁴about 19,000 yearsabout 10 minutes
128 bits (AES-128)3.4 × 10³⁸5.4 × 10¹⁸ years5.4 × 10⁹ years
192 bits (AES-192)6.3 × 10⁵⁷9.9 × 10³⁷ years9.9 × 10²⁸ years
256 bits (AES-256)1.2 × 10⁷⁷1.8 × 10⁵⁷ years1.8 × 10⁴⁸ years

Notice the jump between rows. Going from 80 to 128 bits moves the Bitcoin-scale attacker from "ten minutes" to "a good fraction of the universe's lifetime". That cliff is the whole design idea behind modern key sizes, and it is much easier to feel than to read: on our brute force page, your own browser cracks an 8, 16 or 24-bit AES key live, then a slider lets you push the key size to 128 and 256 bits and watch the time ladder climb past the age of the universe.

Counting the keys

An AES key is just a string of random bits. A key of n bits can take 2ⁿ values, and nothing about AES lets you rule any of them out in advance. An attacker who knows one plaintext and its ciphertext can test a guess by encrypting and comparing, but each test eliminates exactly one key.

On average, the right key turns up after half the key space has been searched, so the expected work is 2ⁿ⁻¹ trials:

  • AES-128: 2¹²⁷ ≈ 1.7 × 10³⁸ trials
  • AES-256: 2²⁵⁵ ≈ 5.8 × 10⁷⁶ trials

The important property is that every extra bit doubles the work. Ten extra bits multiply it by 1,024. Going from 128 to 256 bits does not double the difficulty: it multiplies it by 2¹²⁸, about 3.4 × 10³⁸. AES-256 is AES-128's entire key space, squared.

Guesses per second, and the age of the universe

To turn trials into time you divide by a rate. The 10²¹ figure is deliberately generous: it is in the range of the total SHA-256 hash rate of the Bitcoin network, a planet-scale industrial effort whose machines can only compute Bitcoin hashes. No such machine exists for AES, so treat it as a ceiling rather than a real attacker.

Here is the calculation, done with exact integers so nothing gets rounded away:

const SECONDS_PER_YEAR = 31_557_600n;       // 365.25 days
const rate = 10n ** 21n;                     // guesses per second

const aes128 = (2n ** 127n) / rate / SECONDS_PER_YEAR;
// 5_391_448_762 years, about 39% of 13.8 billion

const aes256 = (2n ** 255n) / rate / SECONDS_PER_YEAR;
// about 1.8 × 10^48 years

Faster hardware barely moves the result. A machine a thousand times faster saves you about 10 bits (2¹⁰ = 1,024). A billion times faster saves about 30. Against AES-256, that would still leave a search of more than 2²²⁰ trials. Brute force does not lose because computers are slow today; it loses because exponential growth outruns any plausible improvement.

Is there a shortcut through AES itself?

Brute force only matters if no smarter attack exists. AES has been the most studied block cipher in the world since NIST selected it in 2001, and the public results are reassuring:

  • The best known key-recovery attack on full AES-128 is the biclique attack, at about 2¹²⁶·¹ operations instead of 2¹²⁸. That is roughly a 3.7× speedup, not enough to change anything: at 10²¹ operations per second it still needs about 2.9 billion years.
  • The same technique against full AES-256 costs about 2²⁵⁴·⁴ operations, which is still on the order of 10⁴⁸ years at that rate.
  • Reduced versions of AES with fewer rounds are broken, up to 7 rounds for AES-128. The real cipher uses 10, 12 or 14 rounds depending on key size, which is its safety margin.
  • There are related-key attacks on AES-256 that look better on paper. They assume the attacker can get data encrypted under several keys with relationships the attacker picks. Properly generated random keys never have such relationships, so these results matter to cryptographers but not to your encrypted disk.

Why does AES hold up so well? Each round mixes the 16-byte state with SubBytes, ShiftRows, MixColumns and AddRoundKey, and after two rounds every output bit depends on every input bit. You can scroll through all ten rounds of AES-128 on our interactive AES page and watch a single flipped input bit spread to about half the ciphertext.

What actually breaks AES in practice

If nobody brute-forces AES, how does encrypted data get exposed? Through everything around the cipher.

Weak passwords. Many systems derive the AES key from a password. The key is then 256 bits long, but the attacker only has to guess the password. Eight random lowercase letters give 26⁸ ≈ 2.1 × 10¹¹ possibilities, about 37.6 bits. That is 90 bits short of AES-128, and it fits in the "seconds to hours" rows of the table, not the "universe" ones. Slow key-derivation functions such as Argon2, scrypt or PBKDF2 help, but they cannot rescue a short password. A random six-word passphrase from a 7,776-word list gives about 77.5 bits, which is a very different story.

Key theft. Keys stored in source code, configuration files, logs, backups or a compromised server are simply copied. An attacker who has the key does not need to break anything.

Implementation and mode mistakes. AES encrypts 16-byte blocks; how blocks are chained matters. ECB mode encrypts identical blocks to identical ciphertext and leaks patterns. Reusing a nonce with AES-GCM is catastrophic: it can expose the XOR of plaintexts and let an attacker forge messages.

Side channels. Older table-based software implementations leak timing through the CPU cache, and physical access opens power and electromagnetic analysis. Modern processors offer AES-NI instructions that run in constant time, which closes the classic cache-timing attacks.

History has one genuine brute-force story, and it is about key size. DES used 56-bit keys, and in 1998 the EFF's purpose-built DES Cracker recovered a key in 56 hours. Look at the first row of the table: at 10¹² keys per second, the average for a 56-bit key is about 10 hours. AES was designed with that lesson in mind.

What quantum computers change

There are two quantum algorithms worth knowing.

Shor's algorithm breaks RSA and Diffie-Hellman outright, which is why public-key cryptography is migrating to post-quantum algorithms. It does not apply to AES.

Grover's algorithm speeds up unstructured search: it finds a key among 2ⁿ in about 2ⁿ/² quantum steps. That halves the effective key length:

  • AES-128 drops to about 2⁶⁴ ≈ 1.8 × 10¹⁹ quantum steps.
  • AES-256 drops to about 2¹²⁸ ≈ 3.4 × 10³⁸ quantum steps, the same order of magnitude as a classical brute force of AES-128.

Even 2⁶⁴ is not a casual number for Grover. The steps are sequential runs of AES as a quantum circuit, and Grover parallelizes badly: splitting the search across M quantum machines only cuts the time by a factor of √M, not M. That is why AES-128 is not considered broken by quantum computing either. But the margin shrinks, and margin is exactly what long-lived secrets need. This is the reason long-term guidance, including the NSA's CNSA 2.0 suite, settles on AES-256.

AES-128 or AES-256: which one should you choose?

Both are unbreakable by brute force with any technology we know how to build. The choice is about margin, not about today's attackers.

  • AES-128 is fine for most traffic and short-lived data. It is a little faster, and its 5.4 billion years at Bitcoin scale is not going to shrink to something practical through ordinary hardware progress.
  • AES-256 is the better default when data must stay confidential for decades, when you follow post-quantum guidance, or when a policy requires it. The performance cost on CPUs with AES-NI is small for most applications, since AES-256 uses 14 rounds instead of 10.

What matters far more than 128 versus 256 is the rest of the system: keys from a secure random generator (never directly from a password), an authenticated mode like AES-GCM with unique nonces, keys kept out of code and logs, and a well-reviewed library instead of a hand-rolled implementation.

See the numbers for yourself

Numbers like 10⁴⁸ are hard to picture, so the site turns them into something you can watch:

  • Brute force and key size: watch your browser brute-force a 16-bit AES key in real time, measure its own guesses per second, then drag the slider to 128 and 256 bits and compare a laptop, a GPU cluster and the Bitcoin network against the age of the universe.
  • AES, round by round: scroll through SubBytes, ShiftRows, MixColumns and AddRoundKey on a real AES-128 state.
  • All modern cryptography topics: SHA-256, Diffie-Hellman and RSA, each with the same hands-on approach.

Related articles

How AES encryption works, step by step: we follow one real 16-byte block through key expansion and all 10 rounds of AES-128, with every hex value shown.