Public-key encryption is a crytographic system that allows users to communicate securely without haveing prior access to a shared secret key. It uses two keys: a public key known to everyone and a private or secret key known only to the recipient of the message. These two keys are related mathematically.