471,071 Members | 978 Online

# Calculating RSA Decryption Key

How would I write a function to calculate RSA Decryption key. I'm
trying to write an RSA encryption program, and I'm stuck on calculating
the decryption key. How do you check for coprimality? Thanks!!!!! I'm
using C++.

Aug 2 '06 #1
9 3640
DarkProtoman wrote:
How would I write a function to calculate RSA Decryption key. I'm
trying to write an RSA encryption program, and I'm stuck on
calculating the decryption key. How do you check for coprimality?
nothing to do with the topic of c.l.c++. Thanks!
Aug 2 '06 #2
DarkProtoman wrote:
How would I write a function to calculate RSA Decryption key. I'm
trying to write an RSA encryption program, and I'm stuck on calculating
the decryption key. How do you check for coprimality?
Best

Kai-Uwe Bux
Aug 2 '06 #3

Kai-Uwe Bux wrote:
DarkProtoman wrote:
How would I write a function to calculate RSA Decryption key. I'm
trying to write an RSA encryption program, and I'm stuck on calculating
the decryption key. How do you check for coprimality?

Best

Kai-Uwe Bux
I have. But I can only find psuedocode for the Euclidean algorithm, not
the EXTENDED Euclidean algorithm which I need. Can any one here produce
the Extended Euclidean algorithm in psuedocode? Thanks!!!!!

Aug 2 '06 #4
"DarkProtoman" <Pr**********@gmail.comwrote in message
>
Kai-Uwe Bux wrote:
>DarkProtoman wrote:
How would I write a function to calculate RSA Decryption key. I'm
trying to write an RSA encryption program, and I'm stuck on calculating
the decryption key. How do you check for coprimality?
Looking back a few days, reading the thread "Finding 'd' for RSA, why bother
with Extended Euclidian GCD ?" will probably be all you need.
Joe
Aug 2 '06 #5

Kai-Uwe Bux wrote:
DarkProtoman wrote:

Kai-Uwe Bux wrote:
DarkProtoman wrote:

How would I write a function to calculate RSA Decryption key. I'm
trying to write an RSA encryption program, and I'm stuck on calculating
the decryption key. How do you check for coprimality?

Best

Kai-Uwe Bux
I have. But I can only find psuedocode for the Euclidean algorithm, not
the EXTENDED Euclidean algorithm which I need. Can any one here produce
the Extended Euclidean algorithm in psuedocode? Thanks!!!!!

Well, if you need the extended version, google for that. First hit looks
good:

http://en.wikipedia.org/wiki/Extende...dean_algorithm

It has pseudo code.
Best

Kai-Uwe bux
I can't translate that into C++? Could you make it a little clearer?

Aug 2 '06 #6
DarkProtoman wrote:
> http://en.wikipedia.org/wiki/Extende...dean_algorithm

It has pseudo code.
Best

Kai-Uwe bux

I can't translate that into C++?
Then you should freshen up your knowledge.
Could you make it a little clearer?
I guess he could, and I guess he won't. You should try doing your
Aug 2 '06 #7

DarkProtoman wrote:
How would I write a function to calculate RSA Decryption key. I'm
trying to write an RSA encryption program, and I'm stuck on calculating
the decryption key. How do you check for coprimality? Thanks!!!!! I'm
using C++.
Anyone who wants to implement algorithms should have a copy of
Knuth, TAOCP. The answer to your question can be found in volume 2.

Co-primality
of what? The primes are always generated so that (p-1, e) = (q-1, e)
= 1.

Aug 2 '06 #8
DarkProtoman wrote:
I can't translate that into C++? Could you make it a little clearer?
Just use a crypto library.

Mon dieu, c'est pour cette raison les projets existes!

I mean... um...

Seriously, if you can't sort out the math on your own you shouldn't be
implementing the math in something you plan on using beyond your own
lab.

That said, there are books on bignum math [hint hint] that cover the
requisit algorithms...

Tom

Aug 2 '06 #9

Sebastian Gottschalk wrote:
Why?!! I'm trying to cast a wider net. Anything wrong with looking in
more than one place?!

Aug 2 '06 #10

### This discussion thread is closed

Replies have been disabled for this discussion.