Dev.to Security πŸ” Cybersecurity πŸ‘ 2 πŸ“– 7 min read

Q-Day, Explained in Three Acts: Watch Quantum Break Encryption, Then Find It in Your Own Code

On 2 December 2026, the NSA, CISA and the Office of the National Cyber Director issued a joint statement on recent advances in cryptanalysis. They said those advances pose no immediate, widespread threat to today's encry

Q-Day, Explained in Three Acts: Watch Quantum Break Encryption, Then Find It in Your Own Code

Q-Day, explained in three acts

On 2 December 2026, the NSA, CISA and the Office of the National Cyber Director issued a joint statement on recent advances in cryptanalysis. They said those advances pose no immediate, widespread threat to today's encryption. On the same day, the NSA urged owners of national security systems to speed up their move to post-quantum cryptography, warning that adversaries are already collecting encrypted data to decrypt later. Amazon, Anthropic, Apple, Cloudflare, Google, Microsoft, OpenAI and Oracle backed the call in a joint statement and asked organisations to move to NIST's post-quantum standards as soon as possible.

For most engineers, that raises three questions. Why would a quantum computer break today's encryption? Why does it matter now, before such a computer exists? And where is the vulnerable crypto in my code?

I built a single page that answers each of these, one act per question. It runs entirely in the browser, with no server, no sign-in and no model download:

πŸ‘‰ Try it live (part of Quantum Studio)

The problem in plain words

Almost every secure connection on the internet starts with public-key cryptography: RSA or elliptic-curve crypto such as ECDH, X25519 and ECDSA. It protects HTTPS, VPNs, software updates, logins and digital signatures. It is secure because some maths problems, such as factoring a 2048-bit number or solving an elliptic-curve discrete log, would take ordinary computers longer than the age of the universe.

A large enough quantum computer running Shor's algorithm solves both problems efficiently. No such machine exists yet, but that doesn't make the problem a future one. Anyone can record encrypted traffic today and keep it until the machine arrives. This is called harvest now, decrypt later. Medical records, financial data and private messages sent today may still need to be secret in 2040.

The fix exists. In 2024 NIST standardised ML-KEM (FIPS 203) for key exchange and ML-DSA and SLH-DSA (FIPS 204 and 205) for signatures. Moving to them takes years, though, because crypto is buried in every service, library, certificate and config file. Most organisations don't even have a list of where they use it.

Act 1: RSA is safe only because factoring is slow

Shor's algorithm factoring 15, next to classical factoring of toy RSA keys

On the left, the page runs Shor's period-finding circuit for N = 15, 21, 33 or 35. It walks through each stage: the counting and work registers, superposition, modular exponentiation and the quantum Fourier transform. The histogram shows the measurement probabilities, which peak at multiples of Q/r, where r is the hidden period. One measurement, a continued-fraction expansion and two greatest-common-divisor steps later, the page prints 15 = 3 Γ— 5.

This is an exact classical simulation of the circuit's output, so it uses the same maths a quantum computer would. Simulating it takes memory that grows exponentially with the number of qubits, which is why only tiny numbers fit in a browser. That cost is exactly why real quantum hardware matters.

On the right, your browser plays the classical attacker. It generates RSA keys from 16 to 80 bits and factors each one with Pollard's rho. Small keys fall instantly, and even the 80-bit key takes well under a second. Below that, a table puts real key sizes in perspective. Classical factoring of RSA-2048 is far out of reach. For Shor's algorithm, published estimates put RSA-2048 at a few thousand logical qubits, or under a million noisy physical qubits running for under a week (Gidney, 2025). The classical cost grows faster than any polynomial, while Shor's grows only polynomially, and that difference is the whole problem.

Act 2: Harvest now, decrypt later

Classical handshake: at Q-Day, the recorded message is decrypted

Alice sends Bob a secret: "Patient 4471: biopsy positive. Records retained until 2051." They agree a key with Diffie-Hellman, encrypt with AES-256-GCM, and Bob reads the message. Eve, the recorder, stores every byte. Today she can't read any of them.

Then you press Jump to Q-Day. Eve solves the discrete log of Alice's public share, rebuilds the session key, and the patient record appears in red: recorded in 2026, read in 2033.

To make the break real rather than a cartoon, the classical half uses a small 34-bit Diffie-Hellman group as a stand-in for X25519. Eve's laptop-scale attack solves it in milliseconds, the same way Shor's algorithm would solve the real 255-bit curve.

Now switch to Hybrid (DH + ML-KEM-768) and run it again:

Hybrid handshake: at Q-Day, Eve breaks the DH half and still cannot decrypt

Alice also sends an ML-KEM-768 public key, which is the real FIPS 203 algorithm from @noble/post-quantum. Bob replies with an ML-KEM ciphertext, and the session key is derived from both shared secrets. At Q-Day Eve breaks the DH half exactly as before, but decryption fails with an AES-GCM authentication error, because she would also need the ML-KEM secret.

This is how Chrome, Firefox and Cloudflare already protect much of today's web traffic: the hybrid X25519MLKEM768 key exchange. The hybrid design matters even more after this month's news. Days before the government statement, Anthropic published research describing theoretical quantum attacks on lattice cryptography, the maths behind ML-KEM. Anthropic says the work has no practical consequences, and the agencies still point everyone to the NIST standards. A hybrid key stays safe as long as either half holds, so you don't have to bet everything on one family of maths.

The third panel is the Q-Day clock. It uses Mosca's rule: if the years your data must stay secret plus the years migration takes exceed the years until Q-Day, you are already too late. With a 10-year shelf life, 5 years of migration and Q-Day assumed in 2033, the verdict is too late by 8 years. That means traffic recorded today is already exposed. Move the sliders to see your own case.

Switching isn't free, and the page shows why with real keys:

Key and signature sizes, classical vs post-quantum

An X25519 public key is 32 bytes, while an ML-KEM-768 public key is 1,184. An Ed25519 signature is 64 bytes, while an ML-DSA-65 signature is 3,309. The 30–60Γ— growth affects packet sizes, certificate chains, smart cards and embedded devices, and that is a big part of why migration takes years.

Act 3: QuantumSafe Scout finds it in your code

The first step of any migration is an inventory. QuantumSafe Scout builds one. Paste a public GitHub URL, or use the built-in sample repo, a fictional clinic platform with eight services. Scout reads the source in your browser and flags:

  • Key exchange and encryption that harvest-now attacks expose: RSA encryption, RSA keys, ECDH/X25519 and finite-field DH
  • Signatures that become forgeable after Q-Day: RSA, ECDSA, EdDSA, DSA, and JWT RS256/ES256
  • Weaknesses that matter already: TLS 1.0/1.1, SHA-1/MD5 and 128-bit symmetric keys
  • Crypto that is already post-quantum: ML-KEM, ML-DSA and SLH-DSA, so you can see progress

It then draws a crypto exposure graph that links each service to the cryptography it uses and to the data that cryptography protects:

Crypto exposure graph: service β†’ cryptography β†’ data

The data column is what turns a list of findings into a priority order. ECDH in a records service that protects health records for 25 years is urgent today, because the traffic can be harvested now. An ECDSA signature on a 15-minute login token is not urgent today, because a signature can't be forged retroactively. Scout ranks every finding with the Q-Day clock from Act 2, so changing your assumptions immediately re-orders the list.

You can then ask the graph questions in plain language:

Ask the graph, and suggested patches

Ask "What breaks first if Q-Day is 2030?" and Scout moves the clock to 2030, re-ranks everything, and lists what to fix in order, with the file, the line, why it's exposed and how to fix it. Each answer quotes the matching guidance, such as NIST FIPS 203/204/205, NIST IR 8547's deprecation timeline, CNSA 2.0, Mosca's rule or the December 2026 statement. Answers are built from the graph and that guidance text, with no language model involved, so the tool can't invent a fact.

For every finding, Scout writes a suggested patch as a unified diff:

  • Java: ML-KEM and ML-DSA, built into JDK 24 (JEP 496 and 497)
  • Go: hybrid key exchange with crypto/mlkem (Go 1.24)
  • JavaScript: ML-KEM/ML-DSA via @noble/post-quantum
  • Python: liboqs
  • nginx: ssl_protocols TLSv1.3; plus ssl_ecdh_curve X25519MLKEM768:X25519;

Accept a patch and its node turns green. You can also download every patch as one .patch file to review.

Why this is useful

  • For engineers: a two-minute way to understand why post-quantum migration matters, using real algorithms instead of diagrams.
  • For security teams: a starting inventory of crypto in a codebase, ranked by what harvest-now attacks expose today rather than by alphabetical rule ID.
  • For leaders: the Q-Day clock turns "the 2030s" into a concrete question: does our data outlive our migration?
  • For teaching: every act runs locally and shows its working, from the circuit probabilities and handshake bytes to the risk arithmetic.

Scout is a read-only inventory tool. Its pattern rules find likely uses of crypto, and a person should review every finding and patch before changing production code. The quantum part stays on textbook-sized circuits, which are enough to understand the threat and nowhere near enough to break a real key.

Try it

The agencies' advice comes down to finding where you use RSA and elliptic-curve crypto, moving to hybrid and post-quantum algorithms, and making your systems crypto-agile so the next change is a config change. This page shows why that advice matters and gives you a first look at your own code.

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.