How public key cryptography really works, using only simple math

The security system that underlies the internet makes use of a curious fact: You can broadcast part of your encryption to make your information much more secure.

an illustration of a person decoding invisible ink
(Image credit: Kristina Armitage/Quanta Magazine)

For thousands of years, if you wanted to send a secret message, there was basically one way to do it. You'd scramble the message using a special rule, known only to you and your intended audience. This rule acted like the key to a lock. If you had the key, you could unscramble the message; otherwise, you'd need to pick the lock. Some locks are so effective they can never be picked, even with infinite time and resources. But even those schemes suffer from the same Achilles' heel that plagues all such encryption systems: How do you get that key into the right hands, while keeping it out of the wrong ones?

The counterintuitive solution, known as public key cryptography, relies not on keeping a key secret, but rather on making it widely available. The trick is to also use a second key that you never share with anyone, even the person you're communicating with. It's only by using this combination of two keys — one public, one private — that someone can both scramble and unscramble a message.

John Pavlus
Science Writer

John Pavlus is a nonfiction writer and filmmaker based in Portland, OR. He focuses on science, tech, business and design.

You must confirm your public display name before commenting

Please logout and then login again, you will then be prompted to enter your display name.