Valacska
Valacska

Reputation: 33

RSA private exponent determination

My question is about RSA signing.

In case of RSA signing:

encryption -> y = x^d mod n, decryption -> x = y^e mod n

I know x, y, n and e. Knowing these can I determine d?

Upvotes: 3

Views: 6987

Answers (3)

Jason S
Jason S

Reputation: 189836

If you can factor n = p*q, then d*e ≡ 1 (mod m) where m = φ(n) = (p-1)*(q-1), (φ(m) is Euler's totient function) in which case you can use the extended Euclidean algorithm to determine d from e. (d*e - k*m = 1 for some k)

All these are very easy to compute, except for the factoring, which is designed to be intractably difficult so that public-key encryption is a useful technique that cannot be decrypted unless you know the private key.

So, to answer your question in a practical sense, no, you can't derive the private key from the public key unless you can wait the hundreds or thousands of CPU-years to factor n.


Public-key encryption and decryption are inverse operations:

x = ye mod n = (xd)e mod n = xde mod n = xkφ(n)+1 mod n = x * (xφ(n))k mod n = x mod n

where (xφ(n))k = 1 mod n because of Euler's theorem.

Upvotes: 5

Omnifarious
Omnifarious

Reputation: 56078

The answer is yes under two conditions. One, somebody factors n. Two, someone slips the algorithm a mickey and convinces the signer to use one of several possible special values for x.

Applied Cryptography pages 472 and 473 describe two such schemes. I don't fully understand exactly how they would work in practice. But the solution is to use an x that cannot be fully controlled by someone who wants to determine d (aka the attacker).

There are several ways to do this, and they all involve hashing x, fiddling the value of the hash in predictable ways to remove some undesirable properties, and then signing that value. The recommended techniques for doing this are called 'padding', though there is one very excellent technique that does not count as a padding method that can be found in Practical Cryptography.

Upvotes: 3

JoshuaRogers
JoshuaRogers

Reputation: 405

No. Otherwise a private key would be of no use.

Upvotes: 1

Related Questions