在RSA中给定p,q和e的情况下,如何找到d? [英] How to find d, given p, q, and e in RSA?

查看:92
本文介绍了在RSA中给定p,q和e的情况下,如何找到d?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我需要使用扩展的欧几里得算法,但是我不确定我需要做些什么计算.我人数很多.谢谢

I know I need to use the extended euclidean algorithm, but I'm not sure exactly what calculations I need to do. I have huge numbers. Thanks

推荐答案

好,选择 d 使得 d * e == 1模(p-1)(q-1),因此您可以为此使用欧几里得算法(

Well, d is chosen such that d * e == 1 modulo (p-1)(q-1), so you could use the Euclidean algorithm for that (finding the modular multiplicative inverse).

如果您对理解算法不感兴趣,可以只调用

If you are not interested in understanding the algorithm, you can just call BigInteger#modInverse directly.

 d = e.modInverse(p_1.multiply(q_1))

这篇关于在RSA中给定p,q和e的情况下,如何找到d?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆