I'm going to be teaching a lesson about asymmetric cryptography to US high school students who have no background in Computer Science, specifically the way that public key cryptography is used while browsing the web. The typical example that you'd see when reading a book about public key crypto is a padlock. In this classic example, one person has a lock and gives out keys to the lock. Then, anyone with a key can unlock/verify it, but only the person who has the locks can lock/sign document.

However, this doesn't work for a hands-on example, because someone can use the key to close the lock again, and lock/sign different information. Is there some similar tool I can use for a hands-on, physical (not on a computer) example of public key/asymmetric encryption?

  • $\begingroup$ Get snap lock locks (that do not need a key to lock them). $\endgroup$ May 25, 2018 at 11:20
  • $\begingroup$ Have you done symmetrical encryption first? $\endgroup$ May 25, 2018 at 11:21

3 Answers 3


Since cryptography is a bit elaborate, this will be too.

Basic encryption is like the following:

Take the "information" you want to transmit and put it into a locked room. A guard sits at the room with an actual key.

Take a piece of paper and rip it in half, the more jagged the rip the better. Give half to the guard and the other half to the person you want to "communicate" with.

To access the information, the person presents his/her half of the paper and the guard matches it with the guard's own half. If they match up the guard will unlock the door and give access to the "information".

Depending on the protocol the guard might re-lock the door or destroy the "information".

Locking the "information" in the room is encryption. The receiver and sender "keys" are the two halves of the piece of paper. Presenting a torn piece of paper to the guard is the attempt to decrypt.

Note that neither half of the "key" is shared with anyone but the sender and receiver of the message, so duplication isn't an issue. This is fine for a one time message or even repeated messages between the same to entities.

But this isn't sufficient for the public-private asymmetry that you seek. In that scheme you want to publish one half of the "key". So modify the scheme as follows.

If someone wants to communicate with you, you control the "keys" and the room. As before, you rip a piece of paper and keep one part, though it shouldn't be a standardized size of paper. The piece torn off, which will be made public, shouldn't be enough to reveal the overall shape of the paper, perhaps a hole torn out of it or a corner torn off. One piece (the public key) is duplicated and published. Anyone who gets a copy of the public key can communicate with the you, key owner. You keep the other "private piece" without revealing the true overall shape of the original paper.

Anyone with a copy of the (other person's) public key can put something in the key owner's room, guarded by the key owner's guard. Only the key owner can remove things from the room as controlled by the guard.

To communicate with you, the key owner, the person presents their information and a copy of the public key (piece of paper) that you published, to the guard who locks up the information and keeps the key (public key half) that you presented. The room is re-locked. When you, the key owner, wants access to the information you present the private key to the guard who will then unlock the room for you after matching the two pieces of paper and verifying that the overall shape is correct.

Only the key owner can remove things from the room, since the overall shape of the "key" is unknown and "can't" (we hope) be duplicated. Anyone can put things in the room but it will be readable only if the public key held by the guard matches the overall key.

Sample Public Private Key Pair

A related key pair can be created by taking a private drawing (that you produce yourself) and using a part of it as the public key. This might be easier to reproduce than the torn paper. However, it must not be easy to deduce the entire drawing from the fragment. Infeasible, if not impossible.

  • $\begingroup$ That is an utterly brilliant example. $\endgroup$
    – Ben I.
    May 24, 2018 at 18:19
  • $\begingroup$ But from one of the halves, it would be easy to deduct the shape of the other half. This would make it easy for someone to think that the private key can be derived from the public key, which is not possible. $\endgroup$
    – thesecretmaster
    May 24, 2018 at 19:04
  • 1
    $\begingroup$ That is why the overall shape has to be secret. The public half only shows the "tear". It can't be a standard sheet to start with. It might even be just a torn out "hole" in the original sheet. $\endgroup$
    – Buffy
    May 24, 2018 at 19:19

I used to know a guy who used to explain public-key encryption while showing off a small box that was fitted with a mechanical door lock. The lock had a single keyway, and it came with two different brass keys; One key would only turn to the left (or was it, to the right?) It could only be used to lock the box, not to open it. The other key would only turn to the right (or was it the left?). That key could be used to open the box, but not to lock it.

He said, that the lock was sold under the name "shopkeeper." The idea was, the proprietor of a small business could install it on the front door, keep one key to him/herself for opening the shop in the morning, and give the other to an employee who was responsible for locking up at night.

Unfortunately, he also said that he did not know where to get another one because the manufacturer had gone out of business.

  • $\begingroup$ That sounds more like two complementary private keys than a private key and a public key. The second key, non-shop owner, would have to be hung up somewhere for anyone to use, not just the selected employee. $\endgroup$ May 25, 2018 at 5:12

High school students seem to have one thing in common in any country with even moderate technology: cell phones. So, use that to explain the concept in a manner that fits with what they know.

The how and why of cryptography is buried in the math that's outside the bounds of what they are likely to know. If, however, the math is accepted as valid, and the computer does it all anyway, the rest is really very simple. The part of "asymmetric cryptography" that you seem to want to explain is the asymmetric part, not the cryptography part.

Asymmetric cryptography, as just said, has the cryptography part, which is the cell phone itself. Exactly how it works (on the inside) is not something we think about, or need to understand. The same applies to the cryptography for most of us - the computer does the math, checks signatures, encrypts and decrypts the messages, etc. The asymmetric nature is from there being two keys that work in different ways. The public key, which can be made public and the private key which must be kept private. In connection with the cell phones the public key is the phone number and the private key is the voice mail PIN. Anyone that has the public key (phone number) can leave a voice mail. Once they save it, not even the sender can hear it, or cancel it. To hear the message, from any other phone they have to have the PIN.

If they have their own phone set up so that they can get voice mail from their own phone without entering the PIN it's the same as having their computer setup so that there is no passphrase on the private key. Someone finds their phone and they can listen to all the voice mails. Someone gets access to their computer and they can read all the "private" messages.

If and when the "signature" usage comes into discussion, then the phone comes back into use. When one person calls another on the phone, the receiving phone will show the phone number (public key) of the person calling. If the person receiving the call already has that public key (number) saved in their contacts, then the phone will "verify" the number and show the caller's name instead of their phone number.

Eventually, when the discussion gets technical enough, the parallels between PK and cell phones will break. By then, hopefully, the asymmetric nature of it all has been grasped, and the parallels will no longer matter.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.