I'm giving a lecture to novice developers on security and would like to explain ssl and the basics of certificates. For this I would like to convey a vague intuitive understanding of asymmetric key encryption.

As far as I can think, there is nothing in nature or society to liken public keys to without giving up a ton to the metaphor, so I'd like to just show a simple case. What's the absolutely simplest example of a public key encryption scheme I can give that still retains the fundamental core? Ideally something I can describe or show in code in under a minute, convey a basic understanding, and move on to other things

  • Have you considered asking this on the cryptography stack exchange site instead? While not off topic here (it does feel like it borders on too broad as you can easily get a dozen different examples - all of which being right), the Crypto.SE site would likely either have this question already, or be able to provide it with people who have a deep familiarity of the material. – user40980 Mar 7 '16 at 16:09
  • @MichaelT hmm...I think this has more to do with teaching and having a good mental model than crypto specifics (and those folks are so into it I take the risk of this descending into complete bikeshedding) but I see your point. My feeling is here is more appropriate but if people vote to move I won't be offended – George Mauer Mar 7 '16 at 16:10
  • 2
    I think that (textbook) RSA is already very easy to explain. But if you are looking for a non-mathematical example, I found the example given on the Wikipedia article about “Diffie–Hellman key exchange” using color mixing very enlightening. – 5gon12eder Mar 7 '16 at 16:11
  • We can't vote to move it - there is no path to there from here. We can flag it, but it isn't exactly off topic here and the mods would likely decline such a flag. It is up to you to decide if you want it here, or there (or for that matter, on Security.SE - also a non-default path). It is more a matter of that the communities around those other sites have a deeper familiarity with the information and are much less likely to give you unchecked wrong answers. – user40980 Mar 7 '16 at 16:13
  • 1
    May be helpful: What is a simple example of a trap door function?. Trap door functions are the basis of public key cryptography. – John Wu Jun 6 '18 at 2:49

Here is a simple explanation:

SSL uses asymmetric-key encryption. The better metaphor for that is a lock that anyone can lock, but only one person can unlock.

and a more complex example using DNA:

Nang’s idea is that Alice encodes her message in the original DNA sequence and allows this to be transcribed and translated. The resulting protein is then like a public key which can be sent to Bob through a public channel. Meanwhile, Alice sends Bob the secret key which consists of the information he needs to reassemble the DNA such as the location of the noncoding regions that need to be reinserted.


  • I like the Reddit lockbox analogy, reminds me of an old riddle about a farmer needing to cross a river with his grain,chicken, and dog, but he can never leave the chicken alone with the dog nor the grain and can only take one of them at a time. – Paul Jul 5 '18 at 21:49
  • 1
    The DNA example really doesn't seem to explain the concept any better than just describing public key cryptography itself. In fact it requires additional knowledge of how DNA works that makes it less simple (i.e. I have no idea what a "noncoding region" is, and I don't expect novice software developers would do either...) – Sean Burton Jul 6 '18 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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