Asymmetric encryption - public and private keys
Encryption is of little use if unauthorised users know the key. They can use it to decrypt any message that is encrypted with that key.
One way around this issue is to use an algorithm that generates two keys - a public key and a private key.
A public key can be given to anyone. Anyone can then use this key to encrypt a message. However, the public key cannot decrypt a message - only the second, private key can do that. So long as the private key is never given out, messages will stay safely encrypted.
An encryption method that uses public and private keys in this way is known as asymmetric encryption. There are a number of different asymmetric encryption algorithms that are in use.
Encryption methods that use the same key for encryption and decryption are known as symmetric encryption methods.