BM
Bashar ModallalSOFTWARE · AI · SYSTEMS
← All field notes

Software Architecture

RSA Encryption Explained: Why It Works and What Comes After Quantum

Follow RSA from a worked numerical example to the quantum threat, the December 2026 industry warning, and a migration plan for real systems.

Brass lock connected to a teal lattice, a visual metaphor for moving from RSA to post-quantum cryptography.

اقرأ النسخة العربية

Sources checked December 5, 2026.

The problem: a secure session today may carry a ten-year secret

Imagine a document portal that sends identity records over HTTPS. The browser connection lasts seconds, but those records need to stay private for a decade. If someone records the encrypted traffic today, moving to a stronger handshake next year will protect new sessions, not the old recording. That gap is why cryptographic migration needs to begin before a machine capable of breaking today's public-key algorithms exists publicly.

The December 2026 industry statement is a call to accelerate that migration, not an announcement that RSA-2048 has been broken. Understanding the difference starts with three separate jobs: establishing a secret, authenticating the other party, and encrypting the actual data.

How RSA works, in numbers you can verify

RSA gives the recipient a public key that others can use for encryption and a private key that reverses it. Both keys refer to the same modulus, the number used when taking a remainder. In the common two-prime form, start with distinct primes p and q and multiply them to get n. The public key is (n, e). Choose the private exponent d so that e × d ≡ 1 mod λ(n), where λ(n) is the least common multiple of p − 1 and q − 1. The private key also commonly stores the primes for efficient computation. PKCS #1 / RFC 8017.

Use deliberately tiny primes, 61 and 53:

  • n = 61 × 53 = 3233; λ(n) = lcm(60, 52) = 780.
  • With e = 17, choose d = 413: 17 × 413 = 7021 = 9 × 780 + 1.
  • Encrypt the message representative 65: 65^17 mod 3233 = 2790.
  • Decrypt with the private exponent: 2790^413 mod 3233 = 65.

The RSA public key encrypts 65 to 2790; the private key recovers 65.

The exponents undo one another because their product is one more than a multiple of the relevant period. For values coprime to n, that follows from the modular exponent cycle. The full argument checks the result modulo each prime, including the zero case, then combines the results via the Chinese remainder theorem. The period is easy to compute if you know the original primes.

That is the raw mathematical primitive, not a safe encryption scheme. It is deterministic, so the same input produces the same output, and it has algebraic structure that a secure protocol must not expose directly. In an existing application that must use RSA encryption, a vetted implementation of RSA-OAEP adds standardized randomized encoding for short inputs, such as a randomly generated data key. A 2048-bit RSA modulus with OAEP and SHA-256 can carry at most 190 bytes: 256 − 2 × 32 − 2. Use authenticated symmetric encryption for the document itself. RSA-PSS is for signatures, not encryption. It signs a differently encoded representation; verification uses the public key and checks the signature, not a purportedly “decrypted message.” RFC 8017, Sections 7–8.

Why RSA is secure in practice, and where that stops

Multiplying two primes is easy even when they are large. Recovering two well-generated secret primes from their public product at modern key sizes is computationally expensive on classical computers. Factoring n lets someone reconstruct a valid private exponent. That is a known way to defeat RSA, not a proof that every possible attack must factor n. Nor does “2048-bit RSA” mean 2048 bits of symmetric security: the number describes the size of the modulus.

The mathematics also assumes competent engineering. Weak key generation, private-key exposure, bad padding, and timing or error leakage can invalidate the protection without any breakthrough in factoring. Use a maintained library, keep private keys in approved protected storage, keep encryption and signing roles separate where the design allows, and avoid exposing distinct errors that reveal details about failed decryption. Larger keys can raise the cost of classical factoring. They do not make RSA resistant to Shor's algorithm.

What changes with quantum computing?

Peter Shor showed that a sufficiently capable quantum computer can factor integers and solve discrete logarithms in polynomial time. This threatens RSA and elliptic-curve public-key systems, for different mathematical reasons: RSA uses factoring-related hardness; elliptic-curve key agreement and signatures rely on the hardness of the elliptic-curve discrete logarithm. A lab result on a tiny number is not evidence that a realistic RSA key can be broken. The relevant machine must sustain enough reliable quantum computation, usually modeled with fault-tolerant error correction. Shor's paper.

A useful engineering reference is Craig Gidney's 2025 resource estimate: less than one million noisy physical qubits and less than one week for a 2048-bit RSA integer under the paper's assumptions. That is a model of a hypothetical machine, not a demonstration, a purchase specification, or a date when RSA will fail. Physical qubits are not the same as reliable logical qubits. Faster estimates change how much lead time organizations should assume, not what was demonstrated. Google Quantum AI research.

Harvest now, decrypt later makes the threat relevant today. In older TLS configured for static RSA key transport, a future recovery of the server private key can expose recorded premaster secrets. In TLS 1.3 with ephemeral classical X25519, stealing just the server's long-term RSA signing key later does not, by itself, decrypt earlier sessions. But a sufficiently capable quantum computer threatens the recorded classical ephemeral exchange itself. Forward secrecy against later theft of the signing key is valuable; it is not quantum resistance. Current TLS 1.3 specification, RFC 9846.

What the companies actually said in December 2026

  • December 2: Amazon, Anthropic, Apple, Cloudflare, Google, Microsoft, OpenAI and Oracle backed US guidance to move to NIST's PQC algorithms and accelerate migration. Their joint statement does not claim that RSA-2048 was broken. A separate public US assessment said recent advances did not pose an immediate, widespread threat to deployed cryptography. Industry statement, US assessment.
  • December 3: Cloudflare updated its published target for full post-quantum migration from 2029 to 2027. In the same update it maintained that the recent theoretical lattice research did not establish a practical break of deployed PQC. A vendor-wide target is not a guarantee that every customer's connection or origin is protected today. Cloudflare update.
  • December 4: Google Cloud reiterated its 2029 migration timeline and described its deployment and enterprise guidance. Microsoft's published roadmap targets early adoption by 2029 and product and service transition by 2033. Those are implementation goals, not predictions of when a cryptographically relevant quantum computer will arrive. Google Cloud, Microsoft.

For standards planning, the final NIST IR 8547, published October 2026, describes deprecating quantum-vulnerable cryptography after 2030 and disallowing it under NIST standards and guidance after 2035, with earlier transitions for some uses and high-risk systems. That is a standards transition timetable, not a universal legal deadline or permission to wait until 2035. NIST IR 8547.

What replaces RSA? It depends on what RSA was doing

Security job Useful direction
Establish a secret for encryption ML-KEM (FIPS 203); choose the parameter set and integration defined by the applicable protocol.
Sign or authenticate ML-DSA (FIPS 204) or SLH-DSA (FIPS 205), where your ecosystem supports the relevant format, trust chain and policy.
Encrypt the file or network records Keep the protocol's authenticated symmetric encryption, such as AES-GCM. This is a separate layer with a different threat model.

ML-KEM, standardized from the Kyber submission, runs on ordinary hardware. One side generates an encapsulation key and a private decapsulation key. The other side uses the encapsulation key to produce an encapsulation ciphertext and a shared secret. The first side processes that ciphertext with its private key to derive the same secret. The KEM's ciphertext is not the encrypted PDF or API response. An authenticated protocol derives traffic keys from the shared secret, then uses those keys to protect content. The underlying assumption concerns structured linear equations with small hidden errors, not integer factorization; resistance to known attacks is not a promise of immunity to future discoveries. A KEM by itself does not establish identity.

In TLS 1.3, the IETF's RFC 10024 defines the hybrid group X25519MLKEM768. It combines classical ephemeral X25519 with ML-KEM-768 in the protocol, designed to preserve key-agreement security if one component remains secure. Use the specified integration rather than inventing a combiner. A connection can negotiate this hybrid group and still authenticate with a classical certificate and signature. Post-quantum authentication is a separate migration involving client support, issuers, chains, signers and verifiers. RFC 10024.

Hybrid TLS derives traffic keys from classical and post-quantum contributions, while certificates and signatures authenticate a peer separately.

A practical plan for a team shipping software

  1. Inventory the job at every boundary. Record the algorithm, component, owner, dependencies and data lifetime for browser-to-edge and edge-to-origin TLS, mTLS, VPN/SSH, KMS key wrapping, backups and software signing. A public certificate alone cannot tell you the negotiated group. Ask the platform and device vendors what is available in the specific versions and plans you run.
  2. Prioritize data that stays sensitive. If files must remain secret for ten years and migration will take two, you are managing up to twelve years of exposure horizon for data sent just before cutover. Prioritize eligible long-lived confidential traffic and archived keys. Separately prioritize hard-to-replace signing roots and firmware update paths: the risk there is future forgery and long device lifetimes, not retrospective decryption.
  3. Pilot a standardized hybrid on real paths. In an approved test environment, check representative clients and both sides of any proxy or CDN. Track the negotiated group, unintended classical-only negotiations, failed handshakes, and p95 connection time. Bigger handshake messages can expose interoperability or network limits. Define exactly which traffic may fall back and for how long; a high-risk route may need an explicit block instead.
  4. Plan signatures independently. Check certificate and chain sizes, HSM or KMS support, trust-store deployment, package verifiers and long-lived signed artifacts. Stage trust before switching signers. Practice rotation and rollback without silently lowering the policy for protected traffic.
  5. Treat existing ciphertext as a separate project. If a stored document's symmetric key is wrapped under RSA, verify that it can be rewrapped safely under your approved replacement and that backup restores still work. If historical wrapped keys or traffic have already been copied, changing today's wrapper cannot recall those copies. Where appropriate, rotate data keys and re-encrypt controlled copies, but record what remains outside your control.

Acceptance example: For the fictional portal, the security dashboard shows supported browsers negotiated X25519MLKEM768 at the edge and the staging edge-to-origin connection negotiated it. A legacy client is denied on the sensitive upload route according to policy; it is not counted as protected. The restore job can read the rewrapped sample under the new key policy. The status report still labels certificate authentication as classical until the signing and trust-chain pilot passes. That is a measurable migration rather than a “PQC enabled” checkbox. NIST migration project.

Bottom line: Do not read the industry warning as proof that RSA was broken. Read it as a lead-time warning. Protect long-lived secrets with approved post-quantum key establishment as it becomes available, and give authentication and old ciphertext their own workstreams.

YOUR TAKE

What did you think?

Choose one reaction for this article.

Was this useful?

A cookie helps limit repeat responses. Your feedback is private.

Share this noteLinkedIn ↗X ↗Email ↗

Keep exploring.

Software Architecture9 min read

Migrate a Busy Table Online

Move a live parcel table from a Boolean to a service code. Backfill in batches, find stale values, and prove when label readers can switch.