Public Key Cryptography for 3 Year Olds (Part 2 of 3)

Or: the knight of Esprenevestos and the magic keys, part 2. Continued from part 1.

So the kingdoms of Esprenevestos and Ios happily sent the “packets” (hollowed-out logs probably created by mermaids) to each other across the great ocean. Whenever someone from Esprenevestos locked the packet using Ios’ green key, they were sure that no one in the world could unlock it, except someone using the Ios red key. And likewise the people of Ios happily sent packets in the same manner, but using the Esprenevestos green key to lock them, so Esprenevestos could unlock them using their own red key.

One particular day, Sir Comilujo was opening a packet from his friend Ipho. He was quite excited to receive this particular packet, hoping it would be a fancy new chainmail shirt or an enchanted ring or something. However, after unlocking the packet using the Esprenevestos green key, he felt something pinch down on his finger fiercely. He pulled his hand out, and there, dangling from his hand was yet another crab!

He managed to remove the crab, but was quite confused. He knew only pirates played mean tricks like this, not his friends from Ios. But how did the pirates open up the packet? He thought that when someone from Ios locked the packet using an Esprenevestos green key, pirates would never be able to open it.

So, the leaders of Esprenevestos summoned the magician Elgamas at once and demanded an explanation for how the pirates opened the packet and put crabs inside it. Some even said Elgamas was a fraud, and that his magic keys didn’t really work.

Elgamas listened to their complaints undeterred, and when they were done, began “I can assure you most noble Lords, that when a packet is locked by the green key, only its corresponding red key can one it. However, I have a question for you: how do you know the packet was originally sent by Ios in the first place?”

The leaders of Esprenevestos thought about it and remembered that not only did Ios have a copy of their green key, but they had also sent them to Androidia, Windozia, and a number of other places… in fact, they had completely lost track of who had them.

“Do not the pirates themselves have one of your green keys?” Elgamas continued. “And if they do, could not the pirates have placed the crab in an unlocked packet, used your green key to lock it, and sent it to you?”

The Esprenvestonians were shocked to realize that although the magic keys ensured no one could intercept their message after it was sent, they did not ensure the sender was who they thought it was! In order words, they had no idea who any of the packets were from, even though only they could open them using their red key.

But Elgamas had a solution “There is another magic property of the keys I have given you. If you take your red key, and engrave something on the inside of the packet, it will make an invisible writing. This writing can only be revealed by waving your green key. No key will make it glow except one of you green keys. In this way, recipients of your packets can always be sure you sent them.”

So, inside his next packet sent to Ios, Sir Comilujo first took the Esprenevestos red key, and wrote the words “From Esprenevestos”. After he had done this, it briefly glowed red, but promptly disappeared entirely. When he was satisfied the writing was invisible, he then also placed some dried fruit in the packet, and locked it with Ios’ green key, and sent it adrift on the ocean towards Ios.

A few weeks later, the packet floated ashore in Ios. Sir Comilujo’s friend, Ipho, retrieved it, used the Ios red key to unlock it, and saw the dried fruit. But before he ate any of it, he first took their copy of the Esprenevestos green key, and waved it inside the packet. Sure enough, the writing began to glow again “From Esprenevestos”. Then he enjoyed the dried fruit, and told the rest of the kingdom of the magic writing.

Later, Sir Comilujo received a packet that said it was from Ios on the outside (there was a paper note attached to it on the outside, written quite illegibly). He unlocked the packet using the Esprenevestos red key, and discovered it was full all kinds of candy. Sir Comilujo really, really liked candy, so he was very tempted to eat it all. But, his faithful friend, Briny the Elven bowman, reminded him to “check the magical signature”. So they waved the Ios green key inside the box, but nothing happened: there was no magical writing from Ios. “The signature cannot be verified, I don’t think we should eat this candy”, said Briny. They agreed that it was probably from pirates trying to trick them, and might make them sick, so they decided to throw it out.

Just as they were throwing the candies back into the ocean, Sir Comilujo sneakily grabbed a handful and swallowed it down while Briny wasn’t watching. He initially enjoyed being sneaky, and felt happy he had gotten away with it. But within a minute, his stomach started to churn, and he felt very ill. He was sent to Enzo the druid who said he had contracted candy purposefully infected with a virus, probably put there by pirates. After several weeks of being very, very sick, Sir Comilujo recovered.

Aside from Sir Comilujo’s mistake to eat the candy which was actually from pirates, the people of Esprenevestos and Ios again enjoyed sending packets securely back and forth between their two kingdoms. When they locked a packet using the other country’s green key, they knew no one could open it except the country for whom it was intended. And using their red key to write on the inside, they could add a magical signature which let their recipient know with certainty who sent the packet. Now they were safe from pirates… or so they thought…




  • Magical Signatures: this is the role of a digital signature. It’s created using a private key and the message, and it can only be decoded properly using the corresponding public key.
  • …And a bunch of repeats from the previous episode

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s