我知道我需要使用扩展欧几里得算法 http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm,但我不确定我需要做什么计算。我有大量的数字。谢谢
Well, d
选择使得d * e == 1 modulo (p-1)(q-1)
,所以你可以使用欧几里得算法 http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm为了那个原因 (求模乘逆 http://en.wikipedia.org/wiki/Modular_multiplicative_inverse).
如果你对理解算法不感兴趣,你可以直接调用BigInteger#modInverse http://docs.oracle.com/javase/6/docs/api/java/math/BigInteger.html#modInverse%28java.math.BigInteger%29直接地。
d = e.modInverse(p_1.multiply(q_1))
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)