Since the chosen key can be small whereas the computed key normally is not, the RSA paper's algorithm optimizes decryption compared to encryption, while the modern algorithm optimizes encryption instead. Suppose that Bob wants to send information to Alice. If they decide to use RSA, Bob must know Alice's public key to encrypt the message and Alice must use her private key to decrypt the message. To enable Bob to send his encrypted messages, Alice transmits her public key to Bob via a reliable, but not necessarily secret, route. Alice's private key is never distributed. After Bob obtains Alice's public key, he can send a message to Alice. To do it, he first turns (strictly speaking, the un-padded plaintext) into an integer (strictly speaking, the padded plaintext), such that by using an agreed-upon reversible protocol known as a padding scheme. He then computes the ciphertext , using Alice's public key , corresponding to  This can be done reasonably quickly, even for very large numbers, using modular exponentiation. Bob then transmits to Alice. Alice can recover from by using her private key exponent by computing  Given , she can recover the original message by reversing the padding scheme. Here is an example of RSA encryption and decryption. The parameters used here are artificially small, but one can also . The public key is (, ). For a padded plaintext message "m", the encryption function is  The private key is (, ). 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". "e", also from the public key, is then inverted to get "d", thus acquiring the private key. Practical implementations use the Chinese remainder theorem to speed up the calculation using modulus of factors (mod "pq" using mod "p" and mod "q"). The values "d""p", "d""q" and "q"inv, which are part of the private key are computed as follows:  Here is how "d""p", "d""q" and "q"inv are used for efficient decryption.