I looked it up on the nets.
RSA functions around:
(m**e)**d congruent m mod n
(m**d)**e congruent m mod n
0 <= m <= n
I think "a congruent b mod n" means that a - b is an integer multiple of n.
The public key is e and the private key is d. So, m is the message and m**d is the encrypted data.
Code for this is in libcrypto.