RSA: Private key calculation with Extended Euclidean Algorithm

為{幸葍}努か 提交于 2019-12-03 09:50:57

You're so close you're going to kick yourself.

3168-887=2281.

Specifically, If you have a mod x, then A must satisfy 0<=a<x. If it doesn't, add or subtract x as many times as necessary until you are in this range. This is called modular arithmetic.

You might want to read up on linear congruences and number theory. These topics are degree level mathematics in the UK (what you'd call college I guess) so don't worry if it seems a bit odd. A linear congruence simply says that -887 mod 3168 and 2281 mod 3168 are actually the same thing because they are part of the same class, the class that turns out as 2281 mod 3168 in the required range. 2281+3168 mod 3168 would also be in that class.

Have fun!

P.S. PARI/GP is a utility number theorists use for calculations. Might be worth a look.

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