Spotlight on: Public key cryptography

Wednesday 15 June 2016

Some powerful maths underpins bitcoin. Here’s a quick introduction.

You might have heard of public key cryptography in various contexts. Encryption protocols like PGP, often used with email, employ public key or asymmetric cryptography, for example. It’s also foundational to the way bitcoin works.

Symmetric key encryption uses the same key or password both to encrypt and decrypt messages. This raises a problem: suppose you want to encrypt an email and send it to your recipient. How do you also communicate the password securely? Short of meeting in person to hand it over, it’s risky - if the password is intercepted, all your communications are compromised.

Big numbers

Public key encryption gets around this by means of some fancy maths. The same person has two keys: a public key, and a private key. (You may already be familiar with these terms from bitcoin - your private key, for example, is what gives you or anyone else control of your bitcoins). Whilst it is very easy to derive the public key from the private key, it is effectively impossible to do the reverse. That means you can distribute the public key far and wide, without worrying that anyone will be able to recreate the private key from it. The upshot of this is that anyone can encrypt a message using your public key, but only you can decrypt it, using your private key.

Lock

Public key encryption is a little like a padlock anyone can snap shut, but only the keyholder can open

Why it’s important to bitcoin

In bitcoin, this is used in a similar way. Anyone can send you coins if they know your address (which is derived from your public key). But only the one who holds a private key can do the sending. This makes bitcoin transactions irreversible, and very secure, so long as your private key is not compromised in some way.

There is another interesting feature of public key cryptography. Rather than encrypt a message with a public key and have it decrypted by the private key, you can encrypt or ‘sign’ a message using the private key and have anyone decrypt or verify it with the public key. Recently, this feature came to the fore when Craig Wright claimed to have signed a message with the keys to an early bitcoin block (in fact, it was misdirection and he had done no such thing). The community responded by demanding that he sign a message with the keys to the Genesis block, which only Satoshi Nakamoto could reasonably possess. He declined to do so. The nature of public key cryptography is that such a proof is incredibly easy for the genuine keyholder, and impossible for anyone else. Hence the community drew their own conclusions.

 


comments powered by Disqus