Let’s consider a symmetric-key encryption scheme like AES—the Advanced Encryption Standard. We use it everywhere, from encrypting hard drives to keeping our traffic safe via TLS. AES, like all symmetric-key algorithms, uses a single key for both encryption and decryption. This works really well in a few situations:
- If a single person wishes to keep data confidential to themselves. They can just generate the key, encrypt the data with it, securely store the key and then access the key whenever they wish to decrypt the data.
- If two parties wish to communicate confidentially, and they have a preexisting secure channel through which they can share the key. As an example, if you and your best friend wish to communicate via AES, you could invite them over and whisper the key to them, and then encrypt all of your future conversations with the key.
However, symmetric-key encryption falls short if you wish to communicate confidentially and you don’t have a preexisting secure channel. Let’s say that your best friend is on the other side of the world—you could just email them the key, but any adversary who may be monitoring your emails would also have access to the key. Email isn’t not a secure channel. Normal phone lines aren’t safe either. Letters could be checked by the authorities. You could perhaps send a courier, but that’s expensive, and you would have to trust a third party.
One of the maddening things about symmetric-key encryption is that if you wish to use it to securely set up a secure communication channel, you already need to have a secure channel in place. This is the core of the key distribution problem that has hounded cryptographers for generations. This placed strong limitations on which situations were appropriate for safely using symmetric-key encryption.
Solving the key distribution problem
The key distribution problem wasn’t publicly solved until the 70s, when Whitfield Diffie and Martin Hellman published New Directions in Cryptography. In their landmark paper, they outlined what we now call the Diffie-Hellman key exchange, which is an algorithm for securely exchanging a key over a public channel, even if an adversary is able to intercept the communications.
With the Diffie-Hellman key exchange, the key distribution problem was finally solved. People who had never met before were finally able to communicate confidentially, even if they didn’t have a preexisting secure communications channel. This radically changed what was possible in the world of encryption. These days, we have a variety of public-key encryption algorithms to choose from, such as RSA (Rivest-Shamir-Adleman) and elliptic-curve cryptography (ECC). You may not have ever even thought about the key distribution problem before. That’s because it gets solved for us, under the hood and in fractions of a second, all thanks to these algorithms.