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