Re: RSA decryption exponent d (c++)



mm wrote:
TJakobsen a écrit :

hehe sorry but i dont really understand how to use this in my program
as im only a high school student (last year though). We don't have
advanced mathematics yet and we haven't really worked with any of the
mathematics related to RSA such as modulo etc.

could someone be so kind as to go through this Extended Euclidian
algorithn using the numbers i've used in my program please?
so we can calculate d.

thanks in advance.


All those who answered you are right, you _should_ use the Euclidean
algorithm, but, since the numbers you are using are very small, you
also can find the needed inverse with an exhaustive search, i.e.,

for i := 1 to PhiN-1 do
if ((i * e) mod PhiN) = 1 then
begin
d := i;
Break;
end;

I was going to suggest that -- the reason is that I wonder if, being
someone in high school level, if it is a homework, then I estimate
that maybe *this* is precisely what is expected -- find the inverse
by trying all the possible numbers in the range.

Also, if he's doing it for fun, it does make sense to begin with
this simplified version of the problem -- then, for further fun, he
could go with the implementation of the extended Euclidean to find
the inverse.

Carlos
--
.