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
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 = 1
⇔ 17s + 60t = 1
.
At the end of the Sidudozo's answer we obtain s = -7
. Thus d = s + φ(n)
⇔ d = -7 + 60
⇒ d = 53
.
Let's verify the results. The condition was ed mod φ(n) = 1
.
Look 17 * 53 mod 60 = 1. Correct!