Re: RSA decryption exponent d (c++)
- From: Mike Amling <nospam@xxxxxxxxxx>
- Date: Fri, 31 Mar 2006 20:37:50 GMT
TJakobsen wrote:
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.
Perhaps you can translate this Java into your C++.
long inverse(long ee, long mm) {
if (ee<=1) {
if (ee==1) {
return 1;
}
throw new IllegalArgumentException(
"ee must be >=1, not "+ee);
}
// If we can find ss and tt such that
// ss*ee+tt*mm=1
// then ss would be the inverse of ee modulo mm. We
// could return ss=(1-tt*mm)/ee or, even better,
// (1-tt*mm)/ee+mm, which is >=1.
// When we take the equation ss*ee+tt*mm=1 modulo
// ee, it becomes
// tt*mm==1 mod ee,
// so one value that would work for tt is the inverse
// of mm modulo ee.
return (1-inverse(mm%ee, ee)*mm)/ee+mm;
}
--Mike Amling
.
- References:
- RSA decryption exponent d (c++)
- From: TJakobsen
- Re: RSA decryption exponent d (c++)
- From: Kristian Gjøsteen
- Re: RSA decryption exponent d (c++)
- From: TJakobsen
- RSA decryption exponent d (c++)
- Prev by Date: Re: Factoring large composite numbers
- Next by Date: Re: RSA decryption exponent d (c++)
- Previous by thread: Re: RSA decryption exponent d (c++)
- Next by thread: Re: RSA decryption exponent d (c++)
- Index(es):
Relevant Pages
|