Full lesson
Explore the full explanation, examples, and visuals at your own pace.
Anyone can encrypt for Bob; only Bob can decrypt.
Anyone can encrypt with Bob’s shareable public key; only his private key decrypts Alice’s message.
Bob shares one key and keeps the other.
Bob has a matching public and private key. He gives Alice the public key, which lets her lock a message for him. He keeps the private key secret because it’s the key he needs to decrypt that message.
Alice encrypts: Meet at noon
Alice combines “Meet at noon” with Bob’s public key in the encryption step. The result is ciphertext, not readable text, so the message is transformed before it’s sent. Bob’s public key lets Alice encrypt specifically for him.
The ciphertext travels; the private key does not.
Bob first shares his public key with Alice. She sends ciphertext back to him, not the readable message. His private key stays with Bob throughout; it never travels to Alice, and Bob keeps it for decrypting what she sent.
Bob recovers: Meet at noon
Bob feeds the ciphertext and his matching private key into decryption. The result is Alice’s original message, “Meet at noon.” The public key helped create the ciphertext, but it can’t perform this reverse step.
Alice has sent ciphertext to Bob. Which key does Bob need to recover her message?
Let's think this through. Alice has sent ciphertext to Bob. Which key does Bob need to recover her message? A: Bob’s public key. B: Bob’s private key. C: Alice’s public key. Choose an answer, or just think it through. I'll explain in a moment.
- Bob’s public key
- Bob’s private key
- Alice’s public key
Alice has sent ciphertext to Bob. Which key does Bob need to recover her message?
The answer is B: Bob’s private key. Alice encrypted for Bob using his public key. The matching private key, which Bob kept secret, is needed to decrypt. Sharing the public key does not give others that ability.
- Bob’s public key
- Bob’s private key
- Alice’s public key
Why public sharing is safe
Bob’s public key encrypts, and his private key decrypts. A secure scheme makes it infeasible to derive the private key from the public one, but Alice must verify the key truly belongs to Bob.
- Public key encrypts for Bob
- Private key decrypts for Bob
- Verify the public key belongs to Bob
Only Bob’s private key opens the message.
A recipient’s public key enables encryption; the matching private key enables decryption. Alice encrypts “Meet at noon” with Bob’s public key, and Bob uses his private key to recover it.



