RSA decryption exponent d (c++)



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

.



Relevant Pages

  • Re: Forts in Chatham Area?
    ... ratios and that's all then what they know is superficial. ... used pre the days of calculators to aid quick calculation. ... it's purpose from anyone under 30 no matter what school they came from. ... Come the recession they will ...
    (uk.local.kent)
  • Re: Set up....
    ... As stated in your post from yesterday, you should not store the calculated ... the number each time you need it than it is to store the calculation. ... > related to this school. ... > selects from combo box either 1,2,3,4,5) this gives possible no meals. ...
    (microsoft.public.access.forms)
  • Re: Engineering Mathematics
    ... I was at school doing just that sort of calculation in the late 40's when I was about 9 years old. ... mathematics), perhaps even the mathematics that we learnt at school in ...
    (uk.rec.models.engineering)
  • Re: Totalling a field that lives on a report only
    ... I missed the part about the total per school. ... difficult to do without having the calculation in a query. ... txtCalcPts comes from: ...
    (microsoft.public.access.reports)
  • Re: do thing with the inputs
    ... Edo wrote: ... > ant the code reads the line and do the calculation, it gets stuck and ...
    (alt.comp.lang.learn.c-cpp)