What you are describing is the RSA problem. When you generate a key you generate two public numbers called e and n. The encrypter will calculate P^(e) mod n where P is the plaintext. Finding the plaintext given this number is very hard. That is, unless you know something secret about the number n. In modular arithmatic you often make sure the modulus is prime, but in this case n is the product of two primes p and q. Using the totient function and some knowledge about relative primes you can then find the inverse of e allowing you to reverse the encryption operation.
Latest Answers