RSA decryption exponent d (c++)
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


sci.crypt archive

RSA decryption exponent d (c++)

From: TJakobsen <TJakobsenDK@gmail.com>
Date: Fri Mar 31 2006 - 09:37:07 CEST

Hello all...

I am working on a small RSA encryption/decryption program in a school
project (using c++) and I'm kind of stuck because i can't figure out
how to calculate the decryption exponent d.
Keep in mind that my program doesn't use very large primes - it's sort
of a bit simplified in this respect.
My main problem revolves around how to implement a calculation of d in
my program. I can't figure out how to code this. According to various
sources i've used, d is calculated like this:

d = e^-1 (mod phi(n))

As far as I have been able to find out this means that

d mod phi(n) = e^-1 mod phi(n)

But as im not that experienced in advanced mathematics i don't really
know if this is true.

Anyway can anyone explain to me how i calculate d using c++ code or
just in plain easy-to-understand mathematics?

I have used the following numbers:

p = 37
q = 89
n = p*q = 37*89 = 3293
phi(n) = (p-1)(q-1) =3168
e = 25

thx in advance :)

TJakobsen
Received on Mon May 1 01:54:06 2006