 For an encrypted ciphertext "c", the decryption function is

For instance, in order to encrypt , we calculate

To decrypt , we calculate

Both of these calculations can be computed efficiently using the square-and-multiply algorithm for modular exponentiation.In real-life situations the primes selected would be much larger; in our example it would be trivial to factor "n", 3233 (obtained from the freely available public key) back to the primes "p" and "q".