Symmetric and asymmetric encryption, the foundation of all digital security
Listen to the audio version
The word "key" comes up constantly in this site's articles: for a crypto wallet, for an encrypted messaging app, for a padlock shown in a browser. These very different uses actually rest on just two broad families of encryption, whose combination accounts for practically all of today's digital security.
Symmetric encryption, a single key
Symmetric encryption uses one single key to encrypt a message and later decrypt it, a bit like a single physical key able to both lock and unlock the same door. It's a fast, efficient method, widely used to encrypt large amounts of data. It does, however, raise an obvious problem from the start: the two people communicating first need to hand each other this one key, securely, before they can even exchange a single protected message. If that key is intercepted during that very first exchange, all the encryption that follows becomes worthless.
Asymmetric encryption, the solution to the sharing problem
Asymmetric encryption solves this problem in an elegant way: instead of a single key, each person holds a pair of mathematically linked keys, from which it's practically impossible to derive one from the other. The public key can be shared freely with anyone, even published openly, since it can only be used to encrypt a message meant for its owner. Only the matching private key, never shared and kept strictly secret, can decrypt that message. The simplest image is an open padlock: anyone can take that padlock (the public key), lock a box with it, and send it, but only the owner of the matching physical key (the private key) can then open it. No secret needs to be exchanged beforehand anymore: the central problem of symmetric encryption disappears entirely.
Why both are actually used together in practice
Asymmetric encryption, while it solves the sharing problem, requires far more computation than symmetric encryption, which makes it impractical for encrypting large amounts of data continuously. The solution used almost everywhere combines the two: asymmetric encryption is only used to securely exchange a temporary symmetric key, generated for the occasion, which then takes over to quickly encrypt the rest of the communication. This is exactly the mechanism hiding behind the padlock a browser shows on an HTTPS site (see the article on phishing for what that padlock does and doesn't guarantee): an initial handshake in asymmetric encryption, followed by fast symmetric encryption for the rest of the visit.
Digital signatures, the other use for asymmetric keys
The same asymmetric keys also work the other way around, to prove a message's authenticity rather than to hide it. A digital signature is generated with its author's private key, and anyone can then verify it with the matching public key, without ever having had access to the private key itself. This is exactly the mechanism that authorizes spending from a cryptocurrency wallet (see the article on wallets): signing a transaction with your private key proves, in a way the entire network can verify, that its legitimate owner really is behind it, without ever needing to reveal that private key to anyone.
Where this shows up in things you already use
- A website's HTTPS padlock, which combines both types of encryption to secure the connection
- A crypto wallet's public and private keys, which allow receiving and spending
- The end-to-end encryption of a messaging app like Signal, which relies on the same key-pair principle to set up a protected conversation without ever exchanging a secret in plain text
- Signing a blockchain transaction, which proves its origin without revealing the private key that produced it
Understanding this distinction between the two families of encryption, and why they're almost always combined rather than used alone, helps place a mechanism that shows up, in one form or another, behind almost everything protecting digital communication today.