===========================================================================
Packet: PROGUILD
Date: 08-04-94 (04:23)             Number: 601
From: BOB MORRIS                   Refer#: NONE
  To: ALL                           Recvd: NO
Subj: How RSA works                  Conf: (222) L-ENCRYPT
---------------------------------------------------------------------------
< found on the net >
The Mathematical Guts of RSA Encryption

Here's the math behind RSA encryption.  It is the height of irony that
it is not illegal to transport this mathematical description out of the
U.S. and Canada, but it is illegal to export an implementation of this
cipher from the U.S. or Canada.  Any competant programmer could use this
knowledge to implement a strong crypto product beyond the borders of the
U.S. and Canada.

Find P, a 256-bit prime number, and Q, a 258-bit prime number.

Choose E such that E and (P-1)(Q-1) are relatively prime, which means
they have no prime factors in common.  E does not have to be  prime.

Compute D such that (DE - 1) is evenly divisible by (P-1)(Q-1).
Mathematicians write this as DE = 1 mod (P-1)(Q-1).

The encryption function is encrypt(T) = (T^E) mod PQ, where T is the
plaintext (expressed as an integer of up to 512 bits).

The decryption function is decrypt(C) = (C^D) mod PQ, where C is the
ciphertext (expressed as a positive integer).

Your public key is the pair (PQ, E).  Your secret key is the number D.
The product PQ is the modulus.  E is the public exponent. D is the
secret exponent.

You can publish your public key freely, because there are no known easy
methods of calculating D, P, or Q from given only your public key.

---
  RM 1.4 B0037 
  RNET 2.00q: ILink  Camelot Message/File BBS  (310) 204-6158 
