RSA private exponent determination

对着背影说爱祢 提交于 2019-12-24 05:11:49

问题


My question is about RSA signing.

In case of RSA signing:

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

  • x -> original message
  • y -> encrypted message
  • n -> modulus (1024 bit)
  • e -> public exponent
  • d -> private exponent

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


回答1:


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.




回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/6316453/rsa-private-exponent-determination

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!