# What is an extremely basic asymmetric cipher that I can present at the pub?

I'm trying to explain the basics of Bitcoin to my parents.

One of the core components of bitcoin, is signing transactions to make sure your identity can't be impersonated, and thus the need to explain a simplified asymmetric cipher.

What's an extremely simple asymmetric cipher I can use as an example?

How can this simplified cipher be used for signing?

• Why would you need to go into cryptography to have a pub talk about bitcoin? To my understanding, the bitcoin solves the problem of maintaining a distributed ledger, specifically avoiding the double spending problem. The motivation is to avoid having a central authority, and this can be achieved by allowing each participant to approve a transaction (instead of giving this authority to the bank). To avoid adversarial participants approving their own invalid transactions, the concept of proof of work is introduced. No need to talk about public key cryptography. – Ariel Dec 30 '17 at 12:38
• @Ariel Public key cryptography, or at least digital signatures, comes in when you want to know that the person saying to send 3 BTC from Ariel to Ryan is actually Ariel. – Derek Elkins Dec 30 '17 at 12:57
• Right, but this isn't bitcoin specific so his parents will only find it confusing. – Ariel Dec 30 '17 at 12:58
• You can explain asymmetric crypto, block chain, or Bitcoin. Pick one. – Raphael Dec 31 '17 at 9:35
• This question may be better suited for Cryptography. – Raphael Dec 31 '17 at 9:36

If you want to present public key cryptography to your parents or friends, then I suggest you follow some guidelines. First, don't talk about specific functions, nobody cares about SHAxxx, keep your talk conceptual. The problem solved by public key cryptography is allowing two parties who never met before to securely exchange information in a public channel. Do not confuse this with other applications that are achieved by public key encryption, such as digital signatures or authentication.

An illuminating simple illustration of this that I have seen is the following. Suppose that two parties have a bucket and a number of colors, and they want to agree on a specific secret compound. They are allowed to send each other a bucket with a certain compound, but anything sent is exposed to an evil adversary. The underline assumption is that mixing colors is easy, but decomposing a mixture to its ingredients is hard. This assumption (which is easily connected to the formal side of things) allows you to achieve their goal. Pick a public color $P$, and allow both parties to pick a secret color, let us denote them by $S_1,S_2$. The first party then sends a bucket of a mixture of $P,S_1$. Similarly, the second party sends a bucket containing a mixture of $P,S_2$. Finally, each side adds his private color to the mixture he received, and now both parties have a mixture of $P,S_1,S_2$, which (by our assumption) remains secret from any eavesdroppers. A formal version of this is the Diffie-Hellman key exchange protocol, which relies on the hardness of discrete log.

Now, my understanding of the bitcoin protocol is limited, but when talking to your parents about it, I see no reason to go into cryptography. Most of the popular explanations I have seen unnecessarily delve into implementation details, and start talking about finding a preimage of a hash such that the result would have $x$ number of zeros, loosing sight of the actual problem. As before, I suggest to keep the talk conceptual. What problem is the bitcoin trying to solve, and why isn't this trivial? To my understanding, the bitcoin solves the problem of maintaining a distributed ledger, specifically avoiding the double spending problem. The motivation is to avoid having a central authority, and this can be achieved by allowing each participant to approve a transaction (instead of giving this authority to the bank). To avoid adversarial participants approving their own invalid transactions, the concept of proof of work is introduced. POW uses the hash as a black box, so you can avoid mentioning specific candidates.

• Bitcoin solves both the double spending problem (which it does via the blockchain, for which the "proof of work" algorithm you describe is essential) and distributed authentication of transfer requests (which is less often discussed, because it just comes down to an already-solved problem, i.e. message authentication via asymmetric keys). – Jules Dec 30 '17 at 18:39

A common metaphor I hear used is manufacturing a bunch of padlocks, keeping all the keys, and sending out open padlocks to anyone who wants one. Then anyone with such a padlock can send you secret messages by putting them in a box and then using one of your padlocks to lock it before sending it to you. No-one but you has the keys, so even the sender can't unlock the box after it's locked – in particular, the postal service can't snoop on your message at all. They might even have a padlock from you too, but that doesn't help them unlock the box.

(I provide this example to answer your question as stated, without any particular opinion on whether it's actually useful for the bitcoin explanation.)

• This is a useful explanation of asymmetric encryption, but for explaining how bitcoin works what you really need is signature verification, which is the opposite: you have a batch of padlocks that break when you open them, and send out keys to anyone who might need them. Then when you send a message you put it in a box and put a padlock on it, so that anyone with the key can tell you sent it. – Jules Dec 30 '17 at 18:32
• @Jules I really like this explanation, making it analogous to a tamper seal. – Ryan The Leach Jan 2 '18 at 23:31

The problem with explaining asymmetric cyphers (and the reason why most pop explanations actually fail to explain anything) is that they are entwined with the idea that there exist problems that are (supposedly) intractable, which is one of the ideas behind computational complexity.

Once you get that point across, an asymmetric cypher is "just" a function that is easy to compute but thought to be hard to invert. You could even make your own, see the Diffie-Hellman key exchange original implementation as a reference.

• That's not the whole story. It has to be hard to invert unless you have the private key. – Ben Millwood Dec 30 '17 at 15:12
• +1 for Diffie-Hellman. It is a simple enough protocol to explain, which corresponds to the colors example. – Ariel Dec 30 '17 at 15:19

I don't think there is an easily demonstrable asymmetric encryption system. Instead, describe what it does, not how it does it. In fact, I've had to do this recently, to describe how PGP works. For BitCoin, concentrate on the second part, signing messages.

I can create two related numbers. One is called the private key, the other the public key. I keep the first secret, and tell everyone the second. Anyone who wants to send me a message takes my public key, and encrypts their message with it. Once that is done, no one can decrypt the message, not even the sender. When I receive the message, I can decrypt it with my private key.

Or, I can encrypt a message with my private key, and send both the encrypted and non-encrypted message to a second person. If they have my public key, then they can decrypt the encrypted part of the message, and it will be the same as the non-encrypted part. This shows that I was the person who encrypted the message.

If they ask how the keys are generated, then say

I think of two very large prime numbers, and then transform them through a mathematical function. It spits out the private and public keys.

This is of course, glossing over the fact the asymmetrical encryption normally doesn't work on the message itself, instead on a session key (for encryption), or on a hash (signature verification). It also ignores the very important requirement that you must keep your private key private - anyone with access it to can pretend to be you.