I've got everything else (e, p, q, phi(n), n), but cannot see a way to figure out what d should be. P and q are both 300 digits, so phi(n) and n are about 600 digits, but e is only 5 digits. I do already understand that ed is congruent to 1 mod phi(n). Thanks for any suggestions.
Asked
Active
Viewed 5,445 times
2 Answers
2
Usually you can calculate D with
$ D = (phi(N)*K + 1) / e$
Where
$K =$ Any small value, try 2
This video will help you, a lot: https://www.youtube.com/watch?v=e_auEoqetec
AppIns
- 103
- 1
- 8
1
Well, $d$ is just the inverse of $d$ modulo $\phi(n)$, as you state. So (if you don't want to write a program) go to a site like Wolfram and type the query (with the correct numbers, not 3 and 35 as I did as an example).
Some googling will give you simple python programs that will do it (python has built-in bignums so it's easy to do in that language).
Henno Brandsma
- 3,862
- 17
- 20