Every time you shop online, or pay with your bank card or phone, on even send a message over WhatsApp, RSA is what secures it. Your phone’s TLS handshake with the bank’s server or the digital signature of your messages - all of it rests on a single maths idea: it’s easy to multiply two primes, but extremely hard to factor their product.
RSA public-key cryptography is one of the most widely used methods for secure data transmission built upon this P ≠ NP idea.
With AI solving one Millenium Prize Problem after another (latest being the 167-year old Riemann Hypothesis), how long is the math behind banking transactions and online shopping safe?
The lock and the key
Every modern digital transaction is protected by cryptography like the RSA algorithm. Almost 50 years ago, in 1977, computer scientists Ron Rivest, Adi Shamir and Len Adleman produced this algorithm, named after their initials, and which serves as an invisible lock on every transaction. Rivest, Shamir and Adleman developed their work based on the 1976 public-key cryptography concept published by Whitfield Diffie and Martin Hellman. RSA cryptography is also built upon Euler’s Theorem and totient function from 1763.
To understand how RSA works, let’s look at an public key encryption example to see how it works.
Suppose Sam wants to send a message to Dario:
- Dario generates an RSA key pair: public key
(e,n)and private key(d, n) - Dario shares his public key (e,n) openly but keeps his private key
(d, n)secret. - Sam encrypts his message
musing Dario’s public key and sends the ciphertextc = me >}}mod nto Dario over an open channel. - Donald is an eavesdropper who knows Dario’s public key
(e,n)and gains access toc. However, without the private key, Donald can only apply brute force but not break the encryption to access the messagem. - Dario receives c and decrypts it using his private key
m = cd mod n, and is able to read the original messagemtoy key that actually works to open this lock.
Using the RSA process here ensures only Dario can decrypt the message and not Donald. The names used are fictitious examples.
Let’s revisit our RSA example with a toy key.
- Pick two primes:
p= 17,q= 11 - Multiply them:
n= 187 also called the public modulus. - For our public-key cryptography, we need a public key that we’ll publish freely and a private key that we’ll keep secret.
Let’s choose a public exponentewhich is part of the public key, and a private exponentdwhich is part of the private key.
These should be such thate x d ≡ 1 (mod φ(n))
i.e.,etimesdleaves a remainder of 1 when divided byφ(n),
whereφ(n)is Euler’s totient, which counts how many positive integers from 1 tonshare no common factor withn, i.e. relatively prime ton.
Two numbers are said to be relatively prime if their greatest common divisor(gcd)is 1.
An important property of Euler’s totient is its multiplicative property:
Ifpandqare two relatively prime numbers, thenφ(pq) = φ(p)φ(q)
φ(pq)= φ(p)φ(q) = (p-1)(q-1) if gcd(p,q)=1
This property helps calculatingφ(n)for large values ofn, helping break down the calculation into smaller sub-problems.
In our case, φ(n)= (17-1)(11-1) = 160
4. We now pick a public exponent e, with two rules:
1 < e < φ(n)which ensureseis in a valid rangegcd(e, φ(n)) = 1which ensures a modular inversedexists
So valid choices include 3,7,9,11,….till 159
Let’s choose e=7
5. Now we need to compute the private exponent d.
Since e x d ≡ 1 (mod φ(n)) we have
7 x d ≡ 1 (mod 160)
or in other words 1 = d x 7 + (-1) x 160
Since 23 x 7 = 161 = 1 x 160 + 1 we get 7 x 23 ≡ 1 (mod 160)
So d = 23
c = 887 mod 187 = 11, Dario being the only private key holder can decrypt m = 1123 mod 187 = 88The eavesdropper Donald who intercepts
c=11 and knows (7,187) is stuck, since recovering d requires factoring 187 into 17 and 11.For our toy key’s 5 bit private exponent
d=23, this factoring is trivial, but factoring a 2048-bit key is estimated to take billions of years.
Euler’s Theorem and P ≠ NP
Why does RSA work? It works because Euler’s Theorem provides the math guarantee:
If e x d ≡ 1 (mod φ(n))
Then (me)d ≡ m (mod n)
i.e. decryption cancels out the encryption so we can recover the original message m.
However, RSA’s security also rests on the difficulty of factoring large integers n = pq where p and q are large primes. This difficulty is a conjecture and not proven.
This is the famous P versus NP problem:
P = problems solvable in polynomial time (quick) NP = problems whose solutions can be verified in polynomial time. P ≠ NP = the conjecture that there exist problems you can verify quickly but cannot solve quickly
In the case of RSA, factoring is in NP, but there’s no polynomial-time algorithm discovered yet for it. If P = NP is proven, that would kill RSA.
Threats to RSA
Mathematican Peter Shor developed the Shor’s algorithm in 1994 which showed that a quantum computer can factor n in polynomial time. Using quantum Fourier transforms which are exponentially faster than any classical methods, RSA-2048 would fall in hours on a ~4000-logical-qubit machine.
The less-discussed threat is AI. If a sufficiently advanced AI discovers a classical polynomial-time factoring algorithm, RSA is broken without a single qubit. Since we have no proof that P ≠ NP, such an algorithm might exist.
The quickest known classical method for general-pupose factoring of numbers > 100 digits is the General Number Field Sieve (GNFS). In September 2026, Eric Lu at Cognition factored RSA-260 (862 bits) using a GPU-accelerated GNFS prepared and run using AI agents (Cognition’s AI agent Devin) at a cost of ~4900 GPU-days.
This isn’t a new algorithm but implementation gains with AI agents, which can only improve with agent swarms and better orchestration.
This month (November 2026), Levent Alpöge, a mathematician at Anthropic announced a Lean proof of the Riemann Hypothesis - the most famous open problem in maths, unsolved for 167 years since Bernhard Riemann posed it in 1859. The proof was developed over six weeks with Claude/Anthropic models, and was accepted by the Lean FRO and Mathlib Initiative. AI is now capable of solving Millenium Prize problems, and others like the P ≠ NP may just be a matter of compute and time.
The Riemann Hypothesis proof is in 17 million lines of Lean code, with no human having an end-to-end comprehension of it. This is a new epistemic situation: we have a certified result whose reasoning we don’t yet comprehend. If AI later produces a factoring algorithm in the same form: verified but not understood; do we trust AI and abandon RSA or wait for a human-readable natural language explanation? Also with cyber-capable frontier AI models like Mythos, the current absence of AI governance and standards and the fractured geopolitics, what would be the impact on our existing transaction systems worldwide ?
Ref:
- Euler’s totient function
- RSA cryptosystem
- P versus NP problem
- Shor’s algorithm
- RSA Cryptography
- Riemann hypothesis
- Nature: If we can solve Riemann…
- Factoring RSA-260