Public key and private key - In public key encryption, a pair of keys is used (public key and private key). The public key can be made available publicly, while the private key is only known by the owner. The public key is used to encrypt the message, while the private key is used to decrypt the message.