Public-Key Encryption Explained
The motivation behind public-key encryption is that two parties who wish to communicate securely don't first need to secretly agree on a shared encryption algorithm. Publicly known keys encrypt messages and only their privately known counterparts can decrypt them.
-
The Public Key
-
You want other people to send you messages only you can read. Towards this, you publicly publish a "public key"--an algorithm anyone can use to encrypt messages intended only for you. It's like passing out an unlocked combination lock. You can attach your public key to an email, publish it on a website, or give it to someone on a thumb drive.
The Private Key
-
Your private key is the combination to that combination lock that only you know. A friend or colleague may send you a message encrypted--locked up--with your public key. You can then use your private key--that only you know--to decrypt it and read the message.
-
Example
-
Bert and Ernie want to communicate securely, but can't meet to safely discuss a shared encryption scheme. Instead, they both publicly publish their public keys online. Bert sends Ernie a message encrypted with Ernie's public key. Ernie decrypts it with his private key, and sends a reply encrypted with Bert's public key. Only Bert can decrypt and read that message, because only he knows his private key.
-
References
- Photo Credit lock image by Alison Bowden from Fotolia.com