How to find d, given p, q, and e in RSA?

前端 未结 5 885
滥情空心
滥情空心 2021-02-07 07:05

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

5条回答
  •  旧时难觅i
    2021-02-07 07:20

    I just want to augment the Sidudozo's answer and clarify some important points.

    First of all, what should we pass to Extended Euclidean Algorthim to compute d ?

    Remember that ed mod φ(n) = 1 and cgd(e, φ(n)) = 1.

    Knowing that the Extended Euclidean Algorthim is based on the formula cgd(a,b) = as + bt, hence cgd(e, φ(n)) = es + φ(n)t = 1, where d should be equal to s + φ(n) in order to satisfy the

    ed mod φ(n) = 1 condition.

    So, given the e=17 and φ(n)=60 (borrowed from the Sidudozo's answer), we substitute the corresponding values in the formula mentioned above: cgd(e, φ(n)) = es + φ(n)t = 117s + 60t = 1.

    At the end of the Sidudozo's answer we obtain s = -7. Thus d = s + φ(n)d = -7 + 60d = 53.

    Let's verify the results. The condition was ed mod φ(n) = 1.

    Look 17 * 53 mod 60 = 1. Correct!

提交回复
热议问题