posted on Jun, 8 2004 @ 01:25 PM
You chose two primes, p and q. You multiply them, and u get N (N=p*q).
then you chose another number: e
e has to be coprime to the number (q-1)*(p-1). (coprime means that the only devisor that they both share is 1)
N and e are now your Public Key, There is no risk in making it available to the public, and it's is the only thing that people must have access to in
order to sent you encrypted messages.
To encrypt you turn letters (of the message you want to encrypt) to numbers (using ascii for example) and the whole message is now a number. We'll
call it M.
Now you need another number, we'll call it C.
You calculate C=(M^e)*(mod N) (^ = in the power of...)
so now C=the encrypted message.
No one - besides the one who knows p and q (the primes we used at the beginning) - can decrypt it now.
The one who knows p and q recieves the message, and calculates another number (we'll call it d) by using the formula:
e*d=1(mod(p-1)*(q-1)
N and d are the Private Key, and you are supposed to keep them secret.
To decrypt an encrypted message (C) you do M=(c^d)*(mod N).
And you get M, which is the decrypted message.
Large primes are needed so it will be almost impossible to find out the values of q and p (if the N that is small, it's is easy to find out the
values of p and q, because they are probably small primes and it is easy to find which).
This is called RSA, and it's good because of:
1. It's basically unbreakable when using huge primes.
2. Most important: it's public key cryptography, meaning you don't need to pass secretly the key to the people who will send you messages (which is
very risky, because some one might intercept the key and decode all your messages)
Hope it helped.
[edit on 8/6/04 by Transc3ndent]
[edit on 8/6/04 by Transc3ndent]