RSA public key encryption relies on 3 numbers- 2 exponents and a modulus. A number encrypted with one of the exponents can be decrypted by the other.
The demo below will take you through the steps of generating the keys and encrypting and decrypting a simple message.