Log in

View Full Version : RSA/DSA problem calculating X^(-1)


DakienDX
February 7th, 2001, 08:44
Hello everybody !

Can someone please help me. Both RSA and DSA use an calculation in the form of X^(-1), where X is an integer and the result is an integer too.

But as far as I know, X^(-1) is the same as 1/(X^1) and the result is a real and not an integer.

ex. 2^(-2) = 1/(2^2) = 0.25
ex. 10^(-1) = 1/(10^1) = 0.1

Thank you for any help.

goatass
February 7th, 2001, 13:06
Hi there, from what I learned on RSA, they do not use integers they use BIG number which is a data type especially for the use of large number.
I don't know what calculations you are talking about exactly, there are millions of things you can do with RSA/DSA.

I guess what I'm asking is for you to give some more info on what calculation you are trying to achieve and for what.

goatass

DakienDX
February 7th, 2001, 13:24
Hello goatass !

To be more specified, in RSA, the private exponent D is calculated D=E^(-1) mod ((P-1)*(Q-1)).

In DSA it's S=(K^(-1)*(SHA(M)+X*R) mod Q and W=S^(-1) mod Q.

I know that a "BigNum" is a kind of integer, at least it is no real data type.

The D from RSA can be calculated by using some tools (like RSA-Tool 2 by tE!), but in DSA you have to do those calculations everytime you want to sign a message or verify it.

Spath.
February 7th, 2001, 19:40
Read again the definitions, RSA and DSA are
based on *modular* arithmetics, therefore
modular inverses are always integers. In short,
r is the inverse of m modulo n if there exist a
integer k such that k.n + 1 = m.r, which you
can solve (when possible) with for instance
the extended euclidean algorithm.

AdamA
February 8th, 2001, 04:45
Hi,
look at http://indigo.ie/~mscott/
There are some DSA/RSA examples in this lib.

Bye,
AdamA

DakienDX
February 12th, 2001, 12:06
Hello everybody !

Thank you all for your help!