2 ms·
Modular inverses are used in the RSA crypto-system. Here's how that works. I choose large primes P and Q (with some other properties) and compute N=PxQ. I se
by ColinWright 15y ago
Modular inverses are used in the RSA crypto-system. Here's how that works.
I choose large primes P and Q (with some other properties) and compute N=PxQ. I select a small number E that is co-prime with Phi=(P-1)(Q-1).
I publish N and E.
I keep secret P, Q and Phi.
I then compute D, the multiplicative inverse of E modulo Phi. In other words, D * E = 1 + k * Phi for some k.
I keep D secret.
If you have a message M to send to me, you compute X=M^E and send me the result. I compute
X^D = (X^E)^D (mod N)
= X^(D * E) (mod N)
= X^(1+k(P-1)(Q-1)) (mod N)
= X^1 * [ X^((P-1)(Q-1)) ]^k (mod N)
= X * 1^k (mod N)
= X
We use here that A^Phi(N) = 1 (mod N) provided A is co-prime to N.
We used to computation of a multiplicative inverse modulo something when we computed our secret key. Very important.
In practice there are lots of possible attacks on a naive implementation. Just for one - if the primes are such that P-1 or Q-1 have lots of small factors then N can be factored fairly easily. You can find out about the method here:
http://en.wikipedia.org/wiki/RSA#Operation http://en.wikipedia.org/wiki/RSA#Operation
Various possible weaknesses and attackes are described here:
http://en.wikipedia.org/wiki/RSA#Security_and_practical_considerations http://en.wikipedia.org/wiki/RSA#Security_and_practical_cons...