The RSA Encryption Algorithm is a mathematical method of generating two encryption keys. You then encrypt a message with one key, and decrypt it using the other key.
This allows you to keep one key private, and publish the other key to the entire world.
Then there are two ways you can use these keys:
- You
look up the public key of your friend, and encrypt a message using
their public
key. You have guaranteed that no-one can read the message except
your friend.
- You encrypt a message using your private key. Everyone can read it, but no-one else but you could have sent it.