RSA (Rivest Shamir Adleman) Algorithm: History: Based on the Diffie-Hellman problem. Asymmetric encryption scheme. Security stems from difficulty of the log problem and the factorization of large two-prime composite numbers. Notation: 5 (3) == 5 mod(3) == 5%3 == 2 Setup: Choose two distinct, large prime numbers, p & q. Calculate the modulus of reduction, m = p * q; Calculate the Euler-Phi of m, n = (p-1) * (q-1) Choose a large, prime encryption exponent, e. Determine the decryption exponent, d, by taking the inverse of e (n). Encryption: The modulus of reduction, m, and encryption exponent, e, are made public. The message, MSG, is encrypted as follows: ENC_MSG = MSG^e (m) For instance, 2^4 (5) = 16 (5) = 1 [please note that the '=' sign is actually three lines for congruency] Decryption: The encrypted message attained using the procedure above is then exponentiated again: MSG = ENC_MSG^d (m) Deployment: Best bet it to take a look at the code, but Java pretty much handles all of the intensive mathematics in its BigInteger class. You can use this class to create "probable primes," determine the exponentiation and moduli of large numbers, and perform other mathematical operations such as inversion. by John D'Ambrosio