Public-Key Encryption: A File for the Intended Reader
Suppose you need to send a private file to a colleague. You want to protect it before sending it, but you don't want your colleague to hand over a secret first. Public-key encryption lets you work with a key that is safe to share.
The colleague has a key pair: two mathematically related pieces of data. The public key can be given to senders. The private key stays protected and is needed to open information encrypted for that pair.
Public-key encryption, also called asymmetric encryption, uses this separation to protect information for a recipient. The readable information is called plaintext; its encrypted form is ciphertext. A sound scheme is designed to prevent someone with the public key alone from recovering the plaintext.
Two Keys: One You Share, One You Guard
A separate key protects the file
Practical systems can combine public-key methods with symmetric encryption, which uses shared secret key material to encrypt and decrypt the content. This combination is called hybrid encryption.
In one traditional arrangement, the sending software creates a secret key for the file and encrypts the file with that key. It then protects the content key using the recipient's public key. The recipient uses the private key to recover the content key, then uses that to decrypt the file.
Other hybrid schemes establish the secret key differently rather than encrypting a previously chosen key. The purpose is the same: combine public-key methods for setting up the secret with symmetric methods for protecting the content.
The Hybrid Public Key Encryption specification explains this combination. It uses the convenient public/private separation for key setup and the performance advantages of symmetric encryption for the data itself.
This is why “encrypted with the recipient's public key” can describe a package whose bulk content was encrypted with a separate secret key. The public key's role is to help make that content readable by the intended private-key holder.
Choosing the colleague's actual key
Before sending the file, you need confidence that the public key actually belongs to your colleague. A name next to a string of data is not enough on its own.
Suppose someone substitutes their own public key. Your software might produce valid ciphertext without reporting any error. But it would have protected the file for the person holding the substituted key's private partner.
A digital certificate is one way to connect a public key to a name through a trusted authority. The certificate-validation process described in the internet certificate standard checks such connections. Other systems can use different trusted ways of exchanging keys.
This is a key-selection problem, not an encryption failure. The software needs the right recipient's public key before its mathematical protection can serve the intended purpose.
- Make a stolen password useless without the key in your hand.
- Sign in with a tap instead of typing a code.
- Protect Google, Microsoft, Apple and more than 1,000 other accounts.
Privacy doesn't identify the sender
Anyone who obtains the public key may be able to encrypt a message for its holder. Successfully decrypting that message therefore doesn't, by itself, prove who sent it.
Some schemes add sender authentication, a way to verify the source. Others use a separate mechanism, such as a digital signature checked with the sender's public key. Encryption is one part of the broader field of public-key cryptography, whose different operations should not be treated as interchangeable.
Keeping access to the encrypted file
The required private key needs protection after delivery, too. In some schemes, someone who steals it may be able to decrypt previously captured material.
Losing the required key creates a different problem: the intended reader may be locked out. Access can still be possible through another authorized key or a usable backup of the required private key.
Digital Envelopes: How an Encrypted Message Carries Its Own Key

Hybrid Encryption: Two Kinds of Keys, One Protected Message

Private Keys: The Secret Half Has Different Jobs

QUOTE:
"Amateurs hack systems, professionals hack people."
