upvote
It wouldn’t. If P=NP then many problems we think are hard (ie currently require exponential time) would in fact be solvable in polynomial time. But such a polynomial time algorithm might be “galactic” in the sense that the constants are so astronomically large that in practice the algorithm would not be faster than current methods.

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.

reply
I’m not qualified to answer this.

(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.

reply
I like your explanation, but you merely said that a high number of possibilities means it takes a long high time to break it. This is true independently of whether such high number is obtained as an exponential (2^n) or a polynomial (k*n, with k very big).

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.

reply
> P=NP means there exists a polynomial time (O(n^k)) algorithm to find the private key. ie., it can be found relatively quickly.

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)

reply
RSA can be broken much faster than brute force because it's a matter of factorizing a number. That's why the key is so long. 4096 bits is quite excessive when only 256 are needed for quantum brute force prevention.
reply
I'm confused,RSA-896 has already been factored without Quantum. 256 is way too small.
reply
Yes, because RSA requires much longer keys for the same security level.
reply
Not claiming to be an expert, but you can game this by saying you can find a 4096-bit RSA key in O(1) time, because O(2^4096) is O(1). :P
reply
O notation only makes sense with the presence of some other variable “n”. It is not meaningful to talk about O complexity without an “n”. So what is n if you have fixed the key size?
reply
Sure it is, there are plenty of constant-time algorithms, and most of them involve some assumptions about the magnitude of secondary quantities involved. Consider integer multiplication. Clearly in the general case it’s O(n*m) for two numbers with n and m digits (unless you wanna get fancy), but we typically consider it to be constant time because we typically assume a fixed bit width.
reply
Right, we assume it doesn’t depend on the size of the input. But that makes it “boring” or degenerate in the context of complexity. Or to put it another way: O(1) is the least interesting complexity class.
reply
Depending on the proof of P=NP and what you mean by "easily". In TCS, anything polynomial is considered "easily" so it could easily be the case that some ridiculous polynomial is implied with some ridiculous constants.

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.

reply
This is a total laymans perspective, but: I've never figured how we could get an algorithm that's O(n^1000) or whatever other constant exponent for general problems like NP. n^2 algorithms are a dime a dozen, n^3 isn't super uncommon either, but what magic trick would confine the exponent to anything constant for a class of algorithms where n is unbounded and there's otherwise no other number in it to derive that from?
reply
I've been chewing on the same question and found this at least: https://arxiv.org/abs/2207.07613v1 with O(n^31) and O(n^23) for specific problems!

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.

reply
I guess a constant factor like "TSP routes of length k" could introduce a constant that the algorithm is itself some power of, though I'm not sure that could apply to every NP-complete algorithm.
reply
> Like if we have a public key, just by using the proof of P=NP, can we easily get the private key from it?

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).*

reply
Is it even known that factorization is NP? Maybe some new efficient algorithm (like manually calculating a square root) pops up that just yields the largest prime factor of a number? Is that ruled out? That would break RSA without touching all the other P=NP stuff.
reply
It's "trivial" to show that Integer Factorization is in NP and also in co-NP.

In NP: given a factor, check it.

In coNP: give prime factorization.

reply
It's not known whether factoring is in P.

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).

reply
I don't understand what you're trying to say, but yes, IF could be in P, and it could be NP-complete, but in the latter case, it would mean that NP=coNP, which we don't believe.

It's conjectured to be NPI (NP intermediate), but that's only a conjecture.

reply
We can already break RSA to varying degrees. Here's the most recent (also with Anthropic btw):

https://saweis.net/posts/rsa-896.html

reply
It means that there’s a simple algorithm so solve every problem, rather than having to brute force it.

So basically being able to reverse all crypto algorithms without having to try all possible combinations.

reply
It says nothing about the simplicity of the algorithm, only the ability to solve something in less than polynomial time.

Also brute forcing isn't inherently polynomial - checking every item in a list of size n takes O(n) time which is linear.

reply
If the proof gives a P algorithm to solve NP problems, we can apply it to many NP problems to find out their solutions.

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.

reply
Depends on if the proof is constructive or non-constructive.

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

reply
If the proof is non-constructive, but still a verified proof, would that change the attention on and investment into breaking these algorithms?

Or is there already such an astronomically large incentive (stealing the world’s data, btc, etc.) that reasonably not much would change?

reply
Incentive isn't necessarily relevant. We could have a non-constructive proof that implicates some tiny fraction of possible algorithms with a particular bit length, with no pattern available to find them and the algorithms may be indistinguishable from noise to us.

It could be that determining the actual algorithm itself is uncomputable.

reply
> if we have a public key, just by using the proof of P=NP, can we easily get the private key from it?

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.

reply
To me, it always looked like an invalid question and prolly false, because you can't represent "every problem" to work on the proof. I believe RSA prime factoring problem itself is much more "workable" than this.
reply
Majority of respected professors of theoretical conputer science kind of know and assumes that p is not np. it's possible because not proven but it's extremely unlikely
reply
Proving P=NP is theoretical, for starters. It would be an important finding, but it wouldn't immediately break RSA encryption.
reply
Unless someone presents a constructive proof, an actual algorithm.
reply
One NP problem can be transformed into another... if you can solve an NP problem, you can solve all NP problems. It's generally trivial to prove that a particular problem is NP, and many classes of problems have been proven to be NP. P problems can be solved in non-exponential time. That is, if you're cracking some crypto and the crypto were P instead of NP, it wouldn't take you 10 billion years or a Matrioshka brain to do it. Crypto is NP by design. Because, for now, we think NP != P. And if we were wrong about that...
reply
> One NP problem can be transformed into another... if you can solve an NP problem, you can solve all NP problems.

This is not true. Only algorithms that solve NP-hard problems can be used to solve any other NP problem.

reply
Substitute "NP" with "NP-complete" and then you are correct.

For example factorization is in NP but it is not NP-complete (unless that has been proven now, who knows).

reply
> That is, if you're cracking some crypto and the crypto were P instead of NP, it wouldn't take you 10 billion years or a Matrioshka brain to do it.

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.

reply
I remember vaguely my cs professor using the age of the universe as a fraction of time it will take to solve it, or something
reply
If P = NP, we can reduce all NP problems to SAT and use a SAT solver. Isn’t that so?
reply