Is AES-128 still secure? Key size vs key handling

Yes, with caveats that have nothing to do with key length: the brute-force maths, what quantum computing changes, GCM and CBC pitfalls, and AES-128 in HLS video.

6 min read
On this page 11 sections
  1. Why the answer is yes
  2. How long brute force would take
  3. Does quantum computing change it?
  4. Where AES-128 actually fails
  5. Is AES-128-GCM or AES-128-CBC secure?
  6. AES-128-GCM
  7. AES-128-CBC
  8. AES-128 in HLS video
  9. When to choose AES-256 anyway
  10. Key takeaways
  11. Frequently asked questions

Yes. AES-128 has no known practical attack: guessing a 128-bit key would take billions of years even with absurdly powerful hardware, and NIST expects it to stay secure for decades even against quantum computers. When systems built on AES-128 fail, it's almost always because of how keys are stored, delivered or reused, not because the key is 128 bits long.

Why the answer is yes

AES has been the global standard since 2001 and has faced a quarter of a century of public attack by cryptographers. Its 128-bit version is still what much of the internet's security is built on:

  • The TLS 1.3 specification makes TLS_AES_128_GCM_SHA256 the one cipher suite every implementation must support (RFC 8446, section 9.1).

  • HLS video encryption uses AES with a 128-bit key.

  • Apple's FairPlay Streaming delivers 128-bit AES content keys; its strength comes from how those keys are delivered and held on the device.

  • NIST uses key search on AES-128 as the yardstick for the lowest security category of its post-quantum standards.

Our explainer on AES-256 covers how the cipher works inside. This article is about whether the 128-bit version is enough.

How long brute force would take

A 128-bit key has 2^128 (2 to the power 128) possible values, about 3.4 × 10^38. Picture, generously, an attacker with a billion machines, each testing a trillion keys every second: 10^21 guesses a second, far beyond any real hardware. On average they would find the key after searching half the possibilities, which takes about 1.7 × 10^17 seconds, or roughly 5.4 billion years. Trying every key would take about 11 billion years, not far short of the age of the universe. These figures are illustrative, but the conclusion isn't: nobody attacks AES-128 by guessing keys.

Cryptanalysis hasn't found a meaningful shortcut either. The best published attack on the full cipher, the 2011 biclique attack, needs about 2^126.1 operations. That's roughly four times faster than brute force, which would still leave our imaginary attacker searching for more than a billion years. It remains a theoretical result.

Does quantum computing change it?

In theory, Grover's algorithm lets a quantum computer search keys much faster, roughly halving the effective key length, so AES-128 would behave like a 64-bit key. In practice, NIST's post-quantum FAQ explains why that's far less alarming than it sounds. Grover's algorithm must run as a long sequence of steps that parallelises poorly, and quantum operations are expected to be much slower and costlier than classical ones. NIST concludes that Grover's algorithm is likely to give little or no advantage against AES, and that AES-128 "will remain secure for decades to come".

The quantum threat is real, but it's aimed at public-key cryptography such as RSA and elliptic curves, which protect how keys are exchanged. That's where the migration effort is going; see our guide to post-quantum cryptography.

Where AES-128 actually fails

FailureWhat it looks likeWhat to ask
Leaked keysKeys hard-coded in apps, committed to code repositories or written to logsWhere are keys stored, and who and what can reach them?
Keys handed out too freelyA video key server that gives a key to any logged-in userWhat is checked before a key is released?
Weak key derivationA key made from a password such as "institute@123"Are keys random, rather than derived from something guessable?
The wrong modeECB, which lets patterns in the data show throughWhich mode is used, and does it detect tampering?
Nonce reuseThe same key and nonce used twice in GCMHow are nonces generated, and are usage limits respected?
Padding oraclesA server that reveals whether decrypted CBC padding was validIs ciphertext authenticated before it's decrypted?
Side channelsTiming leaks in home-made software implementationsIs the code a well-reviewed library rather than a home-made one?

None of these gets better with a 256-bit key. Our guides to encryption key management and key rotation explain why keys, not ciphers, are where encryption fails.

Is AES-128-GCM or AES-128-CBC secure?

AES-128-GCM

Yes, with one strict rule: never reuse a nonce with the same key. GCM both encrypts and detects tampering, which is why TLS uses it. It also has usage limits. When nonces are generated randomly, NIST's SP 800-38D caps a single key at 2^32 encryptions, one reason well-designed systems rotate keys and TLS derives fresh keys for each connection.

AES-128-CBC

For keeping data secret, yes, provided IVs are unpredictable. CBC doesn't detect tampering, and its best-known weakness, the padding oracle, needs a system that decrypts data an attacker sends and reveals whether the padding was valid. That's a real risk for web APIs and old TLS configurations, where the fix is to authenticate ciphertext or use GCM. A video player decrypting segments it downloaded itself, over HTTPS, is a different setting. Our comparison of AES-GCM vs AES-CBC goes deeper.

AES-128 in HLS video

The AES-128 method in HLS encrypts each segment with AES-128 in CBC mode. When HLS videos get copied, the cipher isn't the reason; the key is handed to every player that asks, and anyone who captures it once can decrypt every segment. The latest draft of the HLS specification adds an optional AES-256-GCM method, but a longer key delivered the same way protects no better. Our guide to HLS AES-128 encryption explains why key delivery, not the cipher, is where video protection is won or lost.

When to choose AES-256 anyway

  • A rule requires it. Some regulations, customer security questionnaires and government standards specify 256-bit keys.

  • Data must stay secret for decades. Long-lived archives benefit from the extra margin, including against future quantum attacks.

  • It costs almost nothing. AES-256 runs 14 rounds instead of 10, about 40 per cent more work, which modern processors with AES instructions absorb easily.

Choosing AES-256 is sensible for new systems. Just don't expect it to fix weaknesses in how keys are stored, delivered or rotated.

Key takeaways

  • AES-128 is secure: brute force is out of reach and the best attack saves only about two bits.

  • NIST expects AES-128 to remain secure for decades, even with quantum computers.

  • Real failures come from leaked or freely served keys, weak derivation, wrong modes and nonce reuse.

  • GCM needs unique nonces and has usage limits; CBC needs unpredictable IVs and separate tamper protection.

  • In HLS video, protect the key URL; a bigger key delivered the same way doesn't help.

Frequently asked questions

Is AES 128 safe?

Yes. AES-128 is safe for protecting data today and, according to NIST, for decades to come. No practical attack on the cipher exists, and guessing a 128-bit key is physically out of reach. What makes a system unsafe is poor key handling: keys hard-coded in apps, served to anyone who asks, derived from weak passwords or reused with the same nonce.

Is AES encryption secure?

Yes. AES, in its 128, 192 and 256-bit versions, is one of the most heavily studied ciphers in use and has no practical attack after more than two decades of public cryptanalysis. Its security in a real product depends on the mode of operation, such as GCM, and on how keys are generated, stored, delivered and rotated.

Is AES 128 quantum safe?

For practical purposes, yes. Grover's algorithm could in theory halve AES-128's effective strength, but it parallelises poorly and quantum operations are slow and expensive. NIST expects AES-128 to remain secure for decades. The bigger quantum risk is to RSA and elliptic-curve key exchange, which is why browsers are moving to post-quantum key exchange first.

Share this article

Looking for something else?

Talk to Us