Skip to main content
โ† Back to Cryptography samples
๐Ÿ”Cryptographyยท15 minยทSample Lesson

The Mailbox Trick: How Two Different Keys Keep Secrets Safe

Imagine you want to mail a secret note to your best friend across town, but you're worried the mail carrier might peek inside. What if there was a mailbox that anyone could lock, but only your friend had the key to unlock it? That is exactly the trick computers use to keep your messages safe on the internet, and it is called public key cryptography. It protects millions of messages every single day, including the ones sent from phones and computers all over the world.

What You'll Learn

- Why sending secret messages needs more than just one key - How a public key and a private key work together like a two-part lock - The step-by-step journey a locked message takes from sender to receiver - Real places you already use this trick, even if you never noticed it

Two Keys Are Better Than One

Picture a special padlock that works backwards from normal locks. Anyone in the world can snap it shut, that is the easy part, called the public key, and your friend can hand out copies of it to anyone. But only ONE key opens that padlock back up, and your friend keeps that key locked away and never shares it. That is the private key. So if you want to send your friend a secret note, you do not need a secret key of your own at all. You just use the padlock your friend already gave you.

Spot It in Real Life

Next time you visit a website, look at the address bar. If you see a little padlock icon next to 'https://', that website is using public key cryptography right now to protect what you type there.

How It Works: Step by Step

Let's follow a secret note from Alice to Bob. 1. Bob creates two keys: a public key, which is the padlock he gives to everyone, and a private key, which he never shares. 2. Alice writes her note and puts it in a box. 3. Alice locks the box using Bob's public padlock. Anyone could do this step, even a stranger. 4. Alice mails the locked box. Even if someone steals it along the way, they cannot open it without Bob's private key. 5. Bob receives the box and opens it with his private key, the only key in the world that fits.

Where You See This Every Day

You use this trick more than you think. When you buy something online, your card number gets locked with the store's public key before it travels across the internet. When you send a message on a chat app that says it is encrypted, your phone is using this same two-key trick so only the other person can read it.

Match each cryptography word to what it really means.

Terms

Public key
Private key
Encryption
HTTPS padlock icon

Definitions

The padlock anyone can use to lock a message
Turning a message into a locked secret
A sign a website is using key protection
The one key that opens the padlock

Drag terms onto their definitions, or click a term then click a definition to match.

โ“

Why can Alice safely use Bob's public key even if a stranger might see it?

โ“

What would happen if Bob accidentally shared his private key with everyone?

๐ŸŽฏ

Build a Two-Key Demo

Find two small boxes or envelopes and two different locks or ribbons at home. Label one 'Public Key' (anyone can close it) and one 'Private Key' (only you can open it). Write a short secret note, seal it using your 'public key' method, and challenge a family member to figure out why they cannot open it without your 'private key.' Draw a 4-step comic strip showing the note's journey from you to them, then explain each step out loud.

Fun Fact

The numbers real computers use for public and private keys are so enormous, often over 300 digits long, that even the fastest supercomputers on Earth would take longer than the age of the universe to guess the private key by trying every possibility.

Want to keep learning?

Sign up for free to access the full curriculum โ€” all subjects, all ages.

Start Learning Free