Public and private keys are a mathematically related pair used in asymmetric encryption. The public key may be shared openly, whereas the private key must remain secret; data encrypted with the recipient’s public key can be decrypted only with the corresponding private key.
How the key pair works
Suppose Alice wants to send confidential data to Bob:
- Bob generates a public-private key pair.
- Bob distributes his public key but protects his private key.
- Alice encrypts the data using Bob’s public key.
- Bob decrypts the ciphertext using his private key.
With a secure algorithm and key length, deriving the private key from the public key is computationally infeasible. This provides confidentiality because only Bob possesses the private key.
The keys also support digital signatures, but their roles differ:
| Purpose | Key operation | Security outcome |
|---|---|---|
| Confidential message to Bob | Encrypt using Bob’s public key; decrypt using Bob’s private key | Confidentiality |
| Digital signature from Alice | Alice signs a message hash using her private key; others verify it using her public key | Authentication and integrity |
A valid signature supports authentication and integrity, but users must trust that the public key belongs to Alice. Digital certificates and certificate authorities establish this association.
A common misconception is that a public key makes the communication public. It does not: the key is public, but the private key required to recover the protected data remains secret.
Because asymmetric encryption is computationally expensive, real systems commonly use hybrid encryption. Asymmetric cryptography authenticates participants or protects the exchange of a symmetric session key, while faster symmetric encryption protects the main data.
IB exam technique
For an explain question, identify each key’s owner, state the operation and security outcome. Avoid saying only “one key encrypts and one decrypts”; specify whose key is used and distinguish encryption from digital signing.