← ELI5 中文
EXPLAINED SIMPLY

What are public
and private keys?

Your phone is hiding a key
For anyone who pays with a phone
No. 341Inside Computers & the InternetPart 35 of 35Fact-checked Oct 21, 2026
Video2:39 · English voice (AI) · English subtitles

Can't play sound? The illustrated version is right below.

Read the transcript

The full narration of the video.

A public key isn't really a key at all. It's a lock. And your phone is hiding the key that matches it. Start with a puzzle. When you pay on your phone, the message passes through lots of strangers' machines before it reaches the bank.

Anyone along the way could take a peek. So agree on a password with the bank first? But you've never met, and the message setting up the password could be seen too. How do you whisper a secret in front of everyone?

Here's the trick. The bank makes lots of identical padlocks, all left open, and hands one to anyone who asks. This lock has an odd rule: anyone can snap it shut, but once it's shut, only one key in the world can open it. The bank keeps that key to itself and never gives it out.

To send a secret, you take one of those open locks, put your message in a box, snap it shut, and send it off. People along the way can grab the box, but even holding the very same lock, they can't open it. Only the bank's key can.

That open lock handed out everywhere has a real name: the public key. The key kept to yourself is the private key. Real ones don't look like locks. They're two long strings of numbers that look like gibberish.

Every time you open a website or pay, your phone uses a pair like this: first it checks the site is real, then it quietly agrees on a password with it. But if the public key goes out to the whole world, why can't anyone work out the private key? Because they're made with multiplication. Pick two huge prime numbers and multiply them.

Multiplying is easy. Sixty-one times fifty-three is three thousand two hundred thirty-three. A minute by hand. Now go backwards. Given only three thousand two hundred thirty-three, which two numbers made it? You have to try them one by one. Real keys use numbers over six hundred digits long. In 2020, researchers cracked one with two hundred fifty digits. On a single computer core, that would have taken twenty-seven hundred years.

The pair also works in reverse. The private key stamps a file, and anyone with the public key can check who really sent it. Before your phone installs an update, it checks that stamp. These locks won't be safe forever. If quantum computers get built, they could break them much faster, so companies are already switching to new locks.

Want to see a real public key? Open a website in a computer browser, click the little icon at the far left of the address bar, and find the certificate. That long jumble is it. Where did you first come across the word "key" used like this?

1

In one line

Want to see a public key? In a computer browser, click the little icon left of the web address and find the certificate.

A public key isn't really a key. It's an open padlock anyone can take and snap shut. The private key is the only key that opens it, and only its owner has it.

2

What you think
vs. what it is

YOU THINK
A public key is a key
you must hide
It has "key" in its name, so it sounds secret.
ACTUALLY
It's a lock
safe to give the world
Anyone can snap it shut, but once shut, only the private key opens it.

Put simply: the public key goes to everyone; the private key stays with you and is never shared.

3

How to whisper
in front of everyone

When you pay on your phone, the message passes through lots of strangers' machines before it reaches the bank, and anyone along the way could peek. Agreeing on a password first doesn't work, because that message could be seen too. Here's the trick:

① Hand out locksThe bank makes lots of identical open padlocks and gives one to anyone who asks.
② Snap it shutPut your message in a box, lock it with an open padlock, and send it.
③ UnlockPeople along the way have the same lock but still can't open it. Only the bank's key can.

The open lock handed out everywhere is the public key. The key kept to yourself is the private key. Real ones are two long strings of numbers that look like gibberish.

4

You use it
every day

Opening a websiteFirst it checks the site is real, then quietly agrees on a password.
Paying by phoneThe payment stays locked the whole way, so machines on the route can't read it.
Stamping a fileThe private key stamps it; anyone with the public key can check who sent it.
Phone updatesYour phone checks that stamp first, and won't install if it's wrong.
5

The lock is public
so why not the key?

61 × 533233 Easy to multiply
hard to undo
The pair is made by multiplying two huge prime numbers. 61 × 53 = 3233 takes a minute by hand. Given only 3233, finding which two numbers made it means trying them one by one.

Real keys use numbers over 600 digits long. In 2020, researchers cracked a 250-digit one. On a single computer core, that would have taken 2,700 years.

These locks won't be safe forever: if quantum computers get built, they could break them much faster. In August 2024, the US National Institute of Standards and Technology (NIST) published new encryption standards, and companies are already switching.

Where did you
first come across
the word "key" like this?
Want to see a real public key?
Open a site in a computer browser,
click the icon at the far left of the address bar,
and find the certificate. That jumble is it.
UP NEXT

How a Web Page Gets Made

Using a sign-up page for a seafood dinner: walls, paint, switches, a shared notebook and a street address, no code required.

No. 1 · 5 minKeep going →
← Back to ELI5