Note that this is not widely believed to be likely, because usually if a problem is in P, then usually further work can improve constants considerably, but it is a possibility that there is a certain class of problems in P that are “galacticly” polynomial.
(Well my qualification is this – I took a semester of Theory of Computation class about a decade ago and barely managed to pass without screwing up my scholarship in the foreign country I was studying in. Today I write PHP during my day job..)
One way to try to get the private key is to try all possibilities. For an RSA key with 4096 bits, there are 2^4096 possible keys, which I’m told is greater than the number of atoms in the universe.
So you see, this is a O(2^n) operation. ie., the algorithm is “exponential”.
You’ll never finish checking all those combinations before the universe ends, or at least not before the Sun explodes and the Earth ceases to exist as we know it.
Unless you’re really really lucky and a key you try during your lifetime happens to be the actual private key. But the likelihood of that happening is practically zero because of the sheer number of possibilities.
The point is, you have to exhaustively check all possible keys. Exponential.
P=NP means there exists a polynomial time (O(n^k)) algorithm to find the private key. ie., it can be found relatively quickly.
This is all I know. I skipped a lot of details. Experts can chime in.
I think it's more about growth: if we ever build a supercomputer that can break RSA in a reasonal time, we will bump that 4096 a bit to still be safe. In the case of exponential algorithm like 2^n, if you increase n by 1, you double the breaking time. In the other case you have to double n to get the same effect.
So, it's not about how hard it is to break it, it's about how fast can we make it harder.
Assuming k is manageable. If k=4096, you're still in for a bad time with even the next 50 years of computers (more quantum breakthroughs notwithstanding)
Suppose the proof of P=NP were not constructive, then Levin's universal search algorithm automatically gives us an algorithm that finds the factors in polynomial time. This would satisfy some definition of "easily" from above. However, if you take a look at Levin's universal search, it quickly becomes apparent the constants involved are truly galactic and not worth even thinking about in a practical sense.
If the proof of P=NP were constructive but gave some incredibly high degree polynomial or something with incredibly high constants, then we might be more wary. We would be able to get factors in polynomial time but it would still be "hard" in a practical sense to get the private key but it becomes exceedingly difficult to guarantee that there isn't some practically efficient algorithm. Proving fine grained lower bounds like this has been difficult to say the least.
If the proof of P=NP were constructive and efficient, then we would easily be able to get the private key. There is some additional detail here about what NP complete problem was actually solved (and thus how much the polynomial reduction cost but this is typically small) but this is a bit detailed and unclear. We would also probably begin searching for a directly efficient factoring algorithm.
Edit: also, slightly more contrived, O(n^k) algorithms aren't all that unusual. For example, a naive algorithm for finding k-cliques in graphs. That looks exponential, but by the rules of big-O, if you fix k to a constant, then it just becomes a large constant exponent polynomial-time algorithm.
1. Consider an RSA public key (n, e). Keep in mind that by the RSA standard, n=p*q where p,q are prime (for the mathematics behind RSA, this condition can be relaxed, but for simplicity, let's assume that this is the case).
2. Formulate "n=p*q AND p prime AND q prime" as a Boolean circuit where the inputs are bits encoding candidates for p and q.
3. Since P=NP, you can in polynomial time decide whether for a Boolean circuit there exist variable assignment such that the circuit evaluates to 1.
4. We know that our original circuit has such an assignment. To find p,q, set some Boolean variable to 0 or 1 and check whether under this additional condition, the circuit still has an assignment for which it evaluates to 1. If this is the case, do this with another input variable, until you have found p, q.
5. To construct a private key that is able to decrypt the messages encrypted with the public key (n, e), use (n, d) where d*e ≡ 1 mod λ(n). λ(n) is the Carmichael function of n (https://en.wikipedia.org/wiki/Carmichael_function ). If n=p*q where p, q are odd primes, we have λ(n)=lcm(p-1, q-1).
Note that (n, d) is not necessarily equal to the original private key (for example, the original creator could instead have used the formula de ≡ 1 mod φ(n) where φ is Euler's totient function; for n=pq where p,q prime, we have φ(n)=(p-1)*(q-1) , even though this way of creating private keys is prohibited in FIPS 186-4. See https://en.wikipedia.org/w/index.php?title=RSA_cryptosystem&... for a discussion of this topic).*
In NP: given a factor, check it.
In coNP: give prime factorization.
Nor is it known whether it's NP-complete, which is usually what people intend when they informally speculate whether something "is NP" or "is in NP" (yes I know that's wrong and nearly backwards, but it's still common).
It's conjectured to be NPI (NP intermediate), but that's only a conjecture.
So basically being able to reverse all crypto algorithms without having to try all possible combinations.
Also brute forcing isn't inherently polynomial - checking every item in a list of size n takes O(n) time which is linear.
This won't work if the solution is "only technically in P" like O(n^10¹⁰⁰⁰), or if the proof is nonconstructive (e.g. proof by contradiction) and doesn't give an algorithm.
If the proof is constructive, it'll say "here's an algorithm you can use"
If the proof is non-constructive, it'll say "It's not possible for there not to be an algorithm you can use" and... that doesn't really help you find the algorithm
Or is there already such an astronomically large incentive (stealing the world’s data, btc, etc.) that reasonably not much would change?
It could be that determining the actual algorithm itself is uncomputable.
There's a couple more steps, but since we have AI, I wouldn't say it would be easy per se, but it goes from being actually impossible to "okay, maybe with a lot of effort". Right now, it's impossible for anybody to snoop or alter the TLS connection to my bank that's encrypted with a 4k RSA key. To go from impossible to "maybe the CIA/NSA if they really cared" would be world changing. Nevermind that me talking to my bank is not that interesting to them, the mere possibility upends a lot of assumptions about the world that computer people have.
It wouldn't be automatic, but a CIA agent with access to Claude and enough tokens could then do it.
This is not true. Only algorithms that solve NP-hard problems can be used to solve any other NP problem.
For example factorization is in NP but it is not NP-complete (unless that has been proven now, who knows).
How hard could a P crypto be? If not 10bn years, could it be 1000 years? 100? 10?
A crypto algorithm that we believe would last 50 years when accounting for Moore’s law growth of compute seems pretty alright for many things. Not everything and maybe not even most things. But many things.