IdeaFragmentsIdeaFragments
Field notes/Security/Two Computers, One Secret: How Quantum Computing Is Changing HTTPS
Dec 05, 2026 · 14 min read
SecurityDec 05, 2026· 14 min read

Two Computers, One Secret: How Quantum Computing Is Changing HTTPS

◆ Thesis

Your browser and your bank agree on a secret without ever sending it across the network. A future quantum computer could break the math that keeps that secret safe, so the internet is changing how it’s done now, before those computers exist.

S
SamEngineer · IdeaFragments
Dec · 2026
TL;DR
  • Encrypted traffic recorded today could be decrypted later. A future quantum computer running Shor’s algorithm could break ECDHE, the key exchange HTTPS connections have mostly relied on.
  • That makes it a risk now for anything that must stay private for years, and even everyday browsing data has buyers.
  • The fix is post-quantum key exchange. ML-KEM, standardized by NIST in 2024, rests on math no known quantum algorithm breaks efficiently.
  • TLS 1.3 adopts it in hybrid form (X25519MLKEM768), so the connection stays safe if either algorithm holds.
  • If you build software: providers are rolling this out, but your endpoints are yours. Check what your servers actually negotiate, and keep your libraries up to date.

Harvest now, decrypt later

Imagine connecting to what looks like legitimate airport Wi-Fi and opening your bank’s website. You can’t really know the network belongs to the airport; anyone around you can create a Wi-Fi network and name it practically anything. Still, the padlock is there and the connection is encrypted, which means what you send over the wire is encrypted too. Someone controlling that network can’t read it today. However, they can record all of it. Now imagine that, years from now, a sufficiently powerful quantum computer can recover the secrets that protected that recording.

That scenario is called “harvest now, decrypt later.” For a while now, I’ve been interested in understanding what the future might look like when AI and quantum computing meet, and how that could affect things like bank security and the crypto markets. Along the way, I’ve been following publications from major infrastructure organizations like DigitalOcean[1], which recently described the changes it’s making to its own cryptography to prepare for this shift. Organizations are preparing before cryptographically relevant quantum computers exist, because an attacker doesn’t need one today. They only need to capture the traffic, including the key exchange messages at the start of each connection, and keep it.

So why should anyone care, five years from now, about encrypted data someone picked up today? On the surface, it seems like most of the things we send online lose their value quickly. The obvious ones that don’t are medical records, financial history, legal documents and trade secrets. Anything that still needs to be private years from now is exposed to this kind of attack today.

It isn’t only the obvious secrets, though. Whoever is recording a network sees everyone’s traffic passing through it. Once decrypted, everyday browsing and purchases are exactly the kind of data companies already buy and sell to decide what to show you next. Traffic that seems worthless to you could still be worth something to a data broker.

To see how that’s possible, it helps to first look at how two computers communicate in secret.

How your browser reaches a server

When you visit a website, your browser first looks up the site’s name in DNS to find an IP address. Then your request travels as packets through a chain of networks you don’t control.

Your browser
Local router, airport or other public Wi-Fi
Whoever runs this can record traffic
Internet service provider
Backbone and transit networks
Cloud provider or load balancer
TLS often ends here
Application server
Every hop can see the packets go by
Text version
Your browser
     │
     ▼
Local router, airport or other public Wi-Fi   ◀── whoever runs this can record traffic
     │
     ▼
Internet service provider
     │
     ▼
Backbone and transit networks
     │
     ▼
Cloud provider or load balancer               ◀── TLS often ends here
     │
     ▼
Application server

Any hop along that path can see the packets go by. That’s why HTTPS matters even when you trust the website: you can’t trust every network in between. It’s also worth knowing that the encrypted connection often doesn’t reach the application server itself. It usually ends at a CDN or load balancer, and the connections behind it may have their own, separate encryption, or none.

What TLS does

HTTPS is HTTP running inside TLS. SSL is TLS’s predecessor, and people still use the old name. TLS gives a connection three properties:

Every connection starts with a handshake, where both sides negotiate which cryptographic algorithms to use, establish shared keys, and authenticate the server. This post focuses on one part of that handshake: establishing the keys.

Protocol
Status
SSL 2.0 / 3.0
Obsolete
TLS 1.0 / 1.1
Deprecated
TLS 1.2
Still supported in many environments
TLS 1.3
Modern protocol

One easy misconception: TLS 1.3 doesn’t automatically mean post-quantum protection. What matters is which algorithms the two sides actually negotiate.

How two computers agree on a secret

TLS 1.3 relies on a shared secret: a value that only the two ends of the connection know. The side starting the conversation and the side receiving it both need to arrive at that same secret before anything sensitive is sent, because TLS derives the keys that encrypt the traffic from it. The catch is that they have to establish it over a network anyone can watch, so they can’t simply send it. The process they use is called key exchange.

The classic method is Diffie-Hellman. Historically, the predominant version in TLS 1.3 has been elliptic-curve Diffie-Hellman ephemeral, or ECDHE, particularly through X25519, which Cloudflare identifies as the most commonly used key agreement algorithm in TLS 1.3[2]. Before getting to the real math, here’s a version with numbers you can do in your head.

A simplified example

Say you open your bank’s website to send a payment. Two parties are involved: your browser, which starts the conversation, and the bank’s server, which answers it. Before any payment details are sent, they need a secret only the two of them know.

First, they agree on a public starting point. In real TLS, that’s an agreed method and its settings; here, let’s represent it with a single number: 2. Because it’s public, anyone watching can see it. Next, each side picks a private number and keeps it to itself: the browser picks 6, and the bank picks 17. Each side multiplies the public number by its private one and sends the result to the other. Finally, each side multiplies the value it received by its own private number.

Agreed public number2
Browser
Network
Bank
Private6
not visible
Private17
Public2 × 6 = 12
Public2 × 17 = 34
12 · visible
34 · visible
Computes34 × 6 = 204
204 never appears here
Computes12 × 17 = 204
Shared secret, never sent204
Not secure: anyone can divide 12 by 2
Text version
              Agreed public number: 2

   BROWSER              NETWORK              BANK
   private: 6           (not visible)        private: 17
   public: 2 × 6 = 12                        public: 2 × 17 = 34

          ── 12, visible to anyone ─────────▶
          ◀───────── 34, visible to anyone ──

   34 × 6 = 204         (204 never           12 × 17 = 204
                         appears here)

          Shared secret: 204  (never sent)
Step
Browser
Bank
Private number
6
17
Public value
2 × 6 = 12
2 × 17 = 34
Sends
12
34
Receives
34
12
Computes
34 × 6
12 × 17
Shared secret
204
204

Neither side ever sends 204. Each one computes it independently. The starting number 2 and the two public values, 12 and 34, are visible to anyone watching the network. The private numbers, 6 and 17, never leave their sides, and the shared secret, 204, never crosses the network at all.

From a number to Rule A

In real TLS, the “starting number” is an agreed algorithm and its parameters. I’ll call it Rule A. Both sides usually support several algorithms and negotiate which to use; they send identifiers for the algorithms, not the math itself. Swapping the arithmetic for functions gives a more accurate picture:

Rule ATraditional key exchange
Browser
Network
Bank
Private keya
not visible
Private keyb
Public keyX = public_key(a)
Public keyY = public_key(b)
X · visible
Y · visible
Computesderive_secret(a, Y)
S never appears here
Computesderive_secret(b, X)
Shared secret, never sentS
Same shape as the simplified example, with real functions
Text version
           Rule A: traditional key exchange

   BROWSER              NETWORK              BANK
   private key: a       (not visible)        private key: b
   X = public_key(a)                         Y = public_key(b)

          ── X, visible to anyone ──────────▶
          ◀────────── Y, visible to anyone ──

   derive_secret(a, Y)  (S never             derive_secret(b, X)
                         appears here)

          Shared secret: S  (never sent)
rule_a.py
# Illustrative pseudocode, not a cryptographic implementation
browser_private = generate_private_key()
browser_public = generate_public_key(browser_private)
bank_private = generate_private_key()
bank_public = generate_public_key(bank_private)

# Exchange public keys
browser_secret = derive_secret(browser_private, bank_public)
bank_secret = derive_secret(bank_private, browser_public)
assert browser_secret == bank_secret
The real math, with tiny numbers

Real Diffie-Hellman uses modular exponentiation: raise a number to a power, then keep only the remainder after dividing by a prime. Keeping the remainder is called the modulo operation, written “mod.” So 5^6 mod 23 means: raise 5 to the 6th power (15,625), divide by 23, and keep the remainder (8). Take the public parameters p = 23 and g = 5, and keep the same private numbers, 6 and 17.

Step
Browser
Bank
Private number
6
17
Public value
5^6 mod 23 = 8
5^17 mod 23 = 15
Computes
15^6 mod 23
8^17 mod 23
Shared secret
13
13

Both sides land on 13, because both calculations equal g^(6 × 17) mod p. Unlike the multiplication example, going backwards from 8 to 6 means solving a discrete logarithm, which is impractical with large enough numbers. These parameters are deliberately tiny and insecure. Real finite-field Diffie-Hellman uses much larger ones, and modern ECDHE uses elliptic-curve operations instead. TLS also doesn’t use the shared secret directly; it derives the traffic encryption keys from it.

Why quantum computing breaks Rule A

Back to the recorded airport Wi-Fi connection. Its safety rests on one assumption: that nobody can work out a private key from a public value. With today’s computers and properly sized parameters, that’s the discrete logarithm problem, and it’s impractical to solve.

Shor’s algorithm changes that. It’s a method for quantum computers that mathematician Peter Shor published in 1994[3], before any quantum computer existed to run it. Given a sufficiently capable quantum computer, it solves discrete logarithm problems efficiently, including the elliptic-curve version ECDHE relies on. Making traditional keys bigger doesn’t fix this; it only buys a little time. For a recorded connection, the chain looks like this:

Recorded handshake and encrypted traffic
Captured today
Sufficiently powerful quantum computer
Future
Shor’s algorithm recovers the key exchange secret
TLS traffic keys are rebuilt
Recorded traffic can be decrypted
Dashed steps haven’t happened yet
Text version
Recorded handshake and encrypted traffic      (captured today)
     │
     ▼
Sufficiently powerful quantum computer        (future)
     │
     ▼
Shor's algorithm recovers the key exchange secret
     │
     ▼
TLS traffic keys are rebuilt
     │
     ▼
Recorded traffic can be decrypted

That chain applies to a conventional ECDHE handshake with no other uncompromised secret mixed in, such as a separately protected pre-shared key. It’s also a future threat, not a demonstrated one: no quantum computer today can do this to real-world key sizes. The point is that today’s recordings would still be useful to whoever has one later.

Post-quantum key exchange: ML-KEM

ML-KEM stands for Module-Lattice-Based Key-Encapsulation Mechanism. The U.S. National Institute of Standards and Technology (NIST)[4], the federal agency that publishes the cryptography standards much of the industry follows, standardized it in FIPS 203[5] in August 2024. Instead of both sides computing the secret, it works in three operations:

Operation
Purpose
Key generation
Create a public/private key pair
Encapsulation
Create a shared secret and a ciphertext that carries it
Decapsulation
Recover the shared secret using the private key and the ciphertext

Call the post-quantum algorithm Rule B. The browser and bank still negotiate which rule to use, but how they arrive at the shared secret changes:

Rule BML-KEM
Browser
Network
Bank
RunsKeyGen()
not visible
Fresh randomnesskept
Private keykept
Public keysent
public key · visible
RunsEncapsulate(public key)
Shared secretS, kept
Ciphertextsent
ciphertext · visible
RunsDecapsulate(private key, ciphertext)
S never appears here
Shared secret, never sentS
Only the bank has S until the browser decapsulates
Text version
                 Rule B: ML-KEM

   BROWSER              NETWORK              BANK
   KeyGen()             (not visible)        fresh private randomness
     → private key (kept)
     → public key

          ── public key, visible to anyone ─▶
                                             Encapsulate(public key)
                                               → shared secret S (kept)
                                               → ciphertext
          ◀─ ciphertext, visible to anyone ──

   Decapsulate(private key,
               ciphertext) → S
                        (S never appears here)

          Shared secret: S  (never sent)

The browser generates its keys

browser.py
public_key, private_key = RuleB.keygen()

The browser keeps its private key and sends its public key. Unlike the simple examples, ML-KEM creates the two keys together in one key generation step.

The bank encapsulates

bank.py
randomness = secure_random_bytes(32)
shared_secret, ciphertext = RuleB.encapsulate(
    browser_public_key, randomness
)

The bank combines the browser’s public key with fresh private randomness. It gets two things back: a shared secret it keeps, and a ciphertext it sends to the browser. At this point, only the bank has the secret. The randomness is private, unlike a password salt, which isn’t secret.

The browser decapsulates

browser.py
shared_secret = RuleB.decapsulate(browser_private_key, ciphertext)

The browser uses its private key to recover the same secret from the ciphertext. Again, the secret itself never crosses the network. These snippets are pseudocode; real libraries usually handle the randomness for you.

This is the big difference from Rule A. With Diffie-Hellman, both sides contribute to the secret and each one computes it independently. With ML-KEM, the bank has the final say. The secret comes out of encapsulation, which mixes in randomness only the bank has. The browser doesn’t help create the secret; it recovers the one the bank made by decapsulating the ciphertext.

So the only things that cross the network are the name of the chosen algorithm, the browser’s public key, and the ciphertext. The bank’s randomness, the browser’s private key, and the shared secret itself never leave their sides.

Rule A and Rule B side by side

Diffie-Hellman (Rule A)
ML-KEM (Rule B)
Browser generates a key pair
Yes
Yes
Bank generates a key pair for this exchange
Yes
No
Bank sends a public key
Yes
No
Bank sends an encapsulation ciphertext
No
Yes
Shared secret is transmitted
No
No
Mathematical foundation
Discrete logarithms
Module Learning With Errors
Against quantum computers
Vulnerable to Shor’s algorithm
Designed to resist known quantum attacks

The different message flow isn’t what makes ML-KEM quantum-resistant. The underlying math problem is.

Why ML-KEM resists quantum computers

ML-KEM is built on lattices: regular grids of points in many dimensions. Its security rests on a problem called Learning With Errors. You’re given a set of equations that would be easy to solve, except each one has a small amount of noise deliberately added. Recovering the secret means undoing that noise, and in hundreds of dimensions, nobody knows an efficient way to do it.

Crucially, nobody has found a quantum algorithm that does to this problem what Shor’s algorithm does to discrete logarithms. That’s different from saying it’s proven unbreakable. “Quantum-resistant” means no known attack, classical or quantum, breaks it efficiently. The lattice math deserves its own post, so I’ll save it for a later one.

How TLS 1.3 adopts it: hybrid key exchange

Rather than switching to ML-KEM alone, TLS 1.3 runs both rules at once. The hybrid group X25519MLKEM768, specified in RFC 10024[6], pairs X25519 (traditional elliptic-curve Diffie-Hellman) with ML-KEM-768 (post-quantum):

TLS 1.3 hybrid groupX25519MLKEM768
Rule AX25519
Traditionalsecret
Rule BML-KEM-768
Post-quantumsecret
Combined secretML-KEM first, then X25519
TLS key derivationHKDF
ResultSymmetric traffic encryption keys
If either rule holds, the secret stays safe
Text version
        TLS 1.3 hybrid group: X25519MLKEM768
                       │
            ┌──────────┴───────────┐
            ▼                      ▼
     Rule A: X25519         Rule B: ML-KEM-768
     traditional secret     post-quantum secret
            │                      │
            └──────────┬───────────┘
                       ▼
     Combined: ML-KEM secret, then X25519 secret
                       │
                       ▼
            TLS key derivation (HKDF)
                       │
                       ▼
       Symmetric traffic encryption keys

The idea is belt and braces. X25519 has years of scrutiny behind it; ML-KEM is newer. If either one holds, the connection’s secret stays safe. The cost is size. These are the key exchange payloads alone, not the whole handshake:

Data
X25519
ML-KEM-768
Hybrid total
Client share
32 bytes
1,184 bytes
1,216 bytes
Server share
32 bytes
1,088 bytes
1,120 bytes
Shared secret
32 bytes
32 bytes
64 bytes

The client share is 38 times the size of X25519 alone. That sounds dramatic, but it isn’t a 38-fold increase in the handshake or in the traffic that follows. Two more distinctions matter. Key exchange is separate from certificate authentication, which still proves you’re talking to the real bank. And all of this only helps when both ends support the hybrid group and actually negotiate it.

What this means if you build software

It’s worth keeping up with what infrastructure providers like DigitalOcean, Cloudflare and AWS are doing here, both for the services you use directly and for the services your own software depends on. Many of these changes arrive as new defaults, or as settings you have to turn on.

Like most security, though, this is a shared responsibility. Providers cover their side; your application’s endpoints and servers are yours to protect. A new option from a provider only helps once you’ve reviewed your configuration and updated your settings to use it.

The cryptography itself mostly happens inside libraries you already use, which is how it should be. Here’s a checklist to work through:

The internet is changing before quantum computers arrive

Back at the airport one last time. Post-quantum cryptography doesn’t stop anyone from recording your packets. It makes sure that what they record stays unreadable, even to a computer that doesn’t exist yet.

That’s the shift I find most interesting: this work protects today’s information against tomorrow’s capabilities. Waiting for quantum computers to arrive would be too late for anything recorded in the meantime. (For the protocol itself, the current TLS 1.3 specification is RFC 9846[7].)

Next, I want to dig into the other half of the handshake: how your browser knows it’s talking to the right server, and what post-quantum signatures like ML-DSA[8] change about certificates.

References

  1. DigitalOcean, Post-Quantum Cryptography at DigitalOcean, updated December 3, 2026
  2. Cloudflare, Post-quantum cryptography, Cloudflare SSL/TLS documentation
  3. Peter W. Shor, Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer, SIAM Journal on Computing, 26(5), 1484–1509, 1997
  4. National Institute of Standards and Technology (NIST)
  5. NIST, FIPS 203: Module-Lattice-Based Key-Encapsulation Mechanism Standard (ML-KEM), August 2024
  6. IETF, RFC 10024: Hybrid key agreement in TLS 1.3
  7. IETF, RFC 9846: TLS 1.3, July 2026 (supersedes RFC 8446)
  8. NIST, FIPS 204: Module-Lattice-Based Digital Signature Standard (ML-DSA), August 2024
Security
S
— Written by

Sam

I’m drawn to projects that start with a good question, not just a feature request. Most of the people I enjoy working with have ideas they care deeply about, but also the clarity to stay grounded in why those ideas matter in the first place.

◆ Subscribe

One essay, when there’s something worth saying.

Roughly twice a month. No tracking. Unsubscribe in one click.