Articles & BlogBy Trapper W. Brown10 min read
There are two families of encryption, and the difference between them is how many keys are involved. Symmetric encryption uses one key that both sides share. Asymmetric encryption uses a matched pair: one key you give to the world and one you guard. Every secure thing you do online, from loading a web page to installing an update, uses both families in the same breath.
It is worth understanding why, because the split explains most of what can go wrong. When a breach report says "the private key was exposed" or a setup screen asks you to "verify the fingerprint," it is talking about the ideas on this page. Encryption and Hashing in Plain Terms introduces both families in a few paragraphs. This guide picks up where it stops: how the key exchange works with real numbers, why the two families are always combined, how signatures fit in, and how long keys need to be.
One lock, two keys. The question behind this whole subject is who gets to hold which one. Photo by Rijksmuseum, CC0, via Wikimedia Commons.
One key: what is the catch with symmetric encryption?
A symmetric cipher such as AES takes a key and a message and produces scrambled output. The same key reverses it. It is fast, it is well studied, and with a 128-bit or 256-bit key nobody is going to guess their way in.
The catch is not the math. It is logistics. Both sides need the same key before they can talk, and it cannot travel over the channel it is meant to protect.
The problem also grows quickly. If every pair of people in a group needs a private key of their own, the number of keys is the number of pairs. For example:
- A family of 4 needs 6 keys.
- A team of 10 needs 45.
- A company of 1,000 needs 499,500.
Each of those has to be created, delivered secretly, stored safely and replaced when someone leaves. Before the 1970s this was simply how it was done. The paper that changed it opens by describing keys being sent ahead "over some secure channel such as private courier or registered mail." That works for an embassy. It does not work for a shopper and a website that met two seconds ago.
Two keys: what did asymmetric encryption change?
In November 1976 Whitfield Diffie and Martin Hellman published "New Directions in Cryptography." It proposed that two people could create a shared secret over a public channel, and that a key could be split into a part safe to publish and a part kept private. The next year Ron Rivest, Adi Shamir and Leonard Adleman submitted the paper describing the system now called RSA after their initials. Its abstract states the idea in one line: "publicly revealing an encryption key does not thereby reveal the corresponding decryption key."
Here is what that means in practice. You generate two keys together.
- The public key can be posted anywhere. Anyone may use it to lock a message to you, or to check your signature.
- The private key stays with you and is never sent to anyone. It unlocks what the public key locked, and it creates signatures.
What makes this possible is a kind of math problem that is easy in one direction and hard in the other. Multiplying two prime numbers is easy: 61 times 53 is 3,233, and a child with a pencil can do it. Going backward, from 3,233 to the two primes, means trial and error. With numbers hundreds of digits long, the forward direction still takes a computer a blink and the backward direction takes longer than anyone has. RSA rests on that gap. The elliptic curve methods that many newer systems use rest on a different one way problem and get the same protection from much shorter keys.
Now the key count from the last section collapses. Each of those 1,000 employees needs one key pair, not 999 shared secrets. That is 1,000 pairs in place of 499,500 keys, and no courier.
How do two strangers agree on a key while someone listens?
This is the part that sounds impossible, so here it is with numbers small enough to check on a calculator. The method is called Diffie-Hellman key exchange. "Mod 23" means "divide by 23 and keep the remainder," the same arithmetic a clock does with 12.
Alice and Bob first agree, in public, on two numbers: 23 and 5. An eavesdropper hears both.
- Alice picks a secret number, 6. She computes 5 to the 6th power, mod 23, and gets 8. She sends 8.
- Bob picks a secret number, 15. He computes 5 to the 15th power, mod 23, and gets 19. He sends 19.
- Alice takes Bob's 19 and raises it to her secret: 19 to the 6th power, mod 23, is 2.
- Bob takes Alice's 8 and raises it to his secret: 8 to the 15th power, mod 23, is 2.
Both hold the number 2. Neither one ever sent it.
The eavesdropper hears everything that crosses the wire and still cannot compute the shared secret.
The eavesdropper saw 23, 5, 8 and 19. To get the shared secret they need one of the private numbers, which means solving "5 to what power, mod 23, gives 8?" With numbers this small you could try all the possibilities over coffee. Real systems use numbers so large that trying them all is out of reach. The most common method on the web today, X25519, does the same dance on an elliptic curve, and each side's public value is only 32 bytes long.
One refinement matters a great deal. Modern protocols throw away the secret numbers after each session and pick new ones next time. That property is called forward secrecy. If a server's long-term key is stolen next year, recordings of today's sessions stay locked, because the numbers that protected them no longer exist. TLS 1.3, the protocol behind HTTPS, requires it: its specification says that all of its public-key exchange methods "now provide forward secrecy."
Why do real systems use both together?
If asymmetric encryption solves the key problem, why not use it for everything? Because it is slow and clumsy for bulk data. The operations involve very large numbers, and the methods are built to handle small inputs such as a key, not a four-gigabyte video.
So engineers settled on a division of labor, and it has a name: hybrid encryption.
- Use asymmetric math once, briefly, to agree on a fresh symmetric key.
- Use that symmetric key with a fast cipher for all the actual data.
- Throw the symmetric key away when the session ends.
| Symmetric | Asymmetric | |
|---|---|---|
| Keys | One, shared by both sides | A pair: public and private |
| Speed | Fast enough for video and disk drives | Slow, used for small items |
| Hard part | Getting the key to the other side | Knowing a public key is really theirs |
| Typical job | Protecting the data itself | Agreeing on keys, signing |
| Examples | AES, ChaCha20 | RSA, X25519, ECDSA, Ed25519 |
The pattern is so standard that the internet's engineers wrote it down as a reusable recipe, RFC 9180, published in February 2022 under the title "Hybrid Public Key Encryption." Web traffic, encrypted email, secure messaging and VPNs all follow the same shape.
(You will also see "hybrid" used in a second sense: running an older key exchange and a newer post-quantum one side by side. That is covered in Quantum Computing and the Risk to Encryption.)
The symmetric half has its own design choices, which are the subject of Block Ciphers and Stream Ciphers: Two Ways to Scramble Data.
What does a digital signature prove?
Turn the key pair around and you get a second tool. With encryption, anyone locks using the public key and only the owner unlocks. With a signature, only the owner can create it, using the private key, and anyone can check it with the public key.
A valid signature on a file proves two things. The file was signed by whoever holds that private key, and it has not changed by a single bit since. It does not hide the file. Signing and encrypting are separate jobs, and plenty of signed things are public.
The US government's Digital Signature Standard, FIPS 186-5 from February 2023, approves three families: RSA, ECDSA and EdDSA. The last one includes Ed25519, defined in RFC 8032, which many newer systems prefer.
You rely on signatures constantly without seeing them. For example, when a family's phone installs a system update overnight, the phone checks the maker's signature first and refuses anything that fails. A company uses the same mechanism in the other direction: it signs the software it ships, which makes its signing key one of the most valuable secrets in the building. If that private key leaks, an attacker can produce updates that every customer's device will trust.
Signatures also close the hole in the key exchange. Diffie-Hellman lets you agree on a secret with whoever is on the other end. It does not tell you who that is. A signature, checked against a certificate, does. HTTPS and Certificates: What the Padlock Means covers how your browser decides which public keys to believe.
How long should the keys be?
Key lengths are not comparable across the two families, because the attacks are different. Guessing a symmetric key means trying every possibility. Attacking an asymmetric key means solving its math problem, and there are shortcuts that are much faster than blind guessing. So asymmetric keys must be longer to offer the same protection.
NIST, the US standards agency, publishes a table of equivalents in its key management guide, SP 800-57 Part 1, Revision 5.
| Security strength | Symmetric | RSA key | Elliptic curve key |
|---|---|---|---|
| 112 bits | (none current) | 2,048 bits | 224 to 255 bits |
| 128 bits | AES-128 | 3,072 bits | 256 to 383 bits |
| 192 bits | AES-192 | 7,680 bits | 384 to 511 bits |
| 256 bits | AES-256 | 15,360 bits | 512 bits or more |
Read across the 128-bit row. A 256-bit elliptic curve key does the work of a 3,072-bit RSA key, which is why new systems favor curves: smaller keys, less data to send, faster handshakes.
The same table carries a footnote that these estimates "will be significantly affected when quantum computing becomes a practical consideration." It applies to the two right-hand columns. The symmetric column holds up far better.
As a rule of thumb, if you are choosing settings today, pick a 256-bit curve or RSA of at least 3,072 bits, and let the software choose the symmetric cipher.
What to remember
- Symmetric encryption uses one shared key. It is fast, and its weak point is delivering the key.
- Asymmetric encryption uses a public key anyone may have and a private key that never leaves its owner.
- A key exchange lets two strangers build a shared secret in the open. An eavesdropper who hears every message still cannot compute it.
- Real systems are hybrid: asymmetric math to agree on a key, then a symmetric cipher for the data.
- A signature is made with the private key and checked with the public one. It proves who signed and that nothing changed. It hides nothing.
- A 256-bit elliptic curve key, a 3,072-bit RSA key and a 128-bit AES key offer about the same strength.
For the wider picture of where each of these tools shows up in daily life, read Modern Encryption: A Map of What Protects You Today. To see what happens to the data once the shared key exists, Galois/Counter Mode: Encryption That Notices Tampering follows one message through the cipher most of the web uses.


