The difference in one paragraph
Symmetric encryption uses one secret key: the same key encrypts and decrypts, so sender and receiver must both have it. Asymmetric encryption, also called public key encryption, uses a pair of keys: a public key that anyone may have, and a private key that only its owner keeps. What one key of the pair encrypts, only the other can decrypt. Symmetric encryption is fast; asymmetric encryption solves the problem of getting a key to someone you have never met. Real systems, HTTPS included, use both.
Symmetric encryption
Alice Bob plain text + shared key → ciphertext → ciphertext + shared key → plain text
Every classical cipher is symmetric. In the Caesar cipher the key is the shift, and in the Vigenère cipher it is the keyword. Modern symmetric ciphers work on bits instead of letters:
- AES with 128, 192 or 256-bit keys, the standard choice. See AES encryption explained.
- ChaCha20, a stream cipher that is fast on devices without AES hardware.
- Older ciphers such as DES, 3DES and Blowfish, which are no longer recommended.
Strengths
Symmetric ciphers are very fast, especially with the AES instructions built into modern processors, which encrypt more than a gigabyte per second per core. The keys are short, 128 or 256 bits. The ciphertext is the same size as the plain text plus a few bytes for the nonce and authentication tag.
The key distribution problem
Both sides need the same secret key before they can talk privately, and sending it over the same channel defeats the purpose. Every pair of people also needs their own key. For n people that is n × (n − 1) ÷ 2 keys, so 100 people need 4,950 of them, and every one must be shared securely and kept secret at both ends. For most of history this was handled with couriers and code books.
Asymmetric encryption
Whitfield Diffie and Martin Hellman published the idea of public key cryptography in 1976, building on work by Ralph Merkle. In 1977 Ron Rivest, Adi Shamir and Leonard Adleman published RSA, the first widely used public key system. It later came out that James Ellis, Clifford Cocks and Malcolm Williamson at the British intelligence agency GCHQ had found the same ideas a few years earlier, but their work stayed secret until 1997.
Bob publishes his public key. Alice: plain text + Bob's public key → ciphertext Bob: ciphertext + Bob's private key → plain text
Anyone can encrypt a message for Bob, but only Bob can read it. Turned the other way round, the key pair gives digital signatures: Bob signs with his private key, and anyone can check the signature with his public key. Public key cryptography explained shows the mathematics with a small RSA example.
The main algorithms are:
- RSA, based on the difficulty of factoring large numbers, with keys of 2048 bits or more.
- Elliptic curve cryptography (ECDH for key exchange, ECDSA and Ed25519 for signatures), which reaches the same security with much smaller keys. A 256-bit elliptic curve key is about as strong as a 3072-bit RSA key.
- Diffie-Hellman key exchange, which lets two parties agree on a shared secret without either one sending it.
Strengths
No shared secret is needed in advance. Each person needs only one key pair, however many people they talk to, and the public half can be published freely. Key pairs also make signatures possible, which symmetric keys can't provide, because anyone who can check a symmetric MAC can also create one.
Weaknesses
Asymmetric operations are roughly a hundred to a thousand times slower than symmetric encryption, and RSA in particular can only encrypt a message shorter than its key. Keys are much longer for the same security: a 2048-bit RSA key gives about 112 bits of security, which is less than AES-128. You also need a way to know that a public key really belongs to the person you think it does, which is what certificates and certificate authorities are for.
Side by side
| Symmetric | Asymmetric | |
|---|---|---|
| Keys | One shared secret key | A public and a private key |
| Speed | Very fast | Roughly 100 to 1,000 times slower |
| Key size for ~128-bit security | 128 bits | 3072 bits (RSA) or 256 bits (elliptic curve) |
| Keys for n people | n × (n − 1) ÷ 2 | n key pairs |
| Key distribution | Needs a secure channel | Public key can be published |
| Signatures | No | Yes |
| Typical use | Encrypting the actual data | Key exchange, signatures, certificates |
| Examples | AES, ChaCha20 | RSA, ECDH, ECDSA, Ed25519 |
Hybrid encryption: using both
Almost every real system combines the two so each does what it is good at:
- Generate a random symmetric key for this message or session.
- Encrypt the data with that key, using AES or ChaCha20.
- Use asymmetric cryptography to get the symmetric key to the other side, either by encrypting it with their public key or, more often today, by agreeing on it with a Diffie-Hellman exchange.
- Sign the exchange with a private key so the other side knows who it is talking to.
- The receiver recovers the symmetric key and decrypts the data quickly.
HTTPS works this way. During the TLS handshake the browser and server run an elliptic curve Diffie-Hellman exchange, and the server proves its identity by signing with the private key that matches its certificate. After a few milliseconds of public key work, the rest of the connection is encrypted with AES-GCM or ChaCha20-Poly1305. How HTTPS works goes through the handshake step by step. PGP email encryption and messaging apps such as Signal follow the same pattern.
Which to use when
Symmetric encryption alone is the right choice when the same party encrypts and decrypts, or when the key can be shared in advance: full-disk encryption such as BitLocker, FileVault or VeraCrypt, encrypted backups, database fields, and password manager vaults, where the key comes from your master password.
Asymmetric encryption comes in when strangers need to communicate, when you need to prove who wrote something, or when many people must be able to send to one recipient: setting up HTTPS connections, encrypting email with PGP, signing software updates and code, SSH logins with keys, and cryptocurrency transactions.
Getting it right
- Use AES-128 or AES-256 in GCM mode, or ChaCha20-Poly1305. Never use ECB mode, and never reuse a nonce with the same key.
- For RSA, use at least 2048-bit keys, and 3072 bits for anything meant to last beyond 2030. For elliptic curves, use 256-bit curves such as X25519, P-256 or Ed25519.
- Protect private keys like passwords; for important ones use a hardware security module or the secure storage built into the operating system.
- Don't implement any of this yourself. Use a maintained library such as libsodium or OpenSSL.
Quantum computers
The two families face very different risks from quantum computers. Shor's algorithm, run on a large enough quantum computer, would break RSA, Diffie-Hellman and elliptic curve cryptography outright. Grover's algorithm only speeds up brute force on symmetric keys, effectively halving their length, so AES-256 stays safe.
In 2024 NIST published its first post-quantum standards: ML-KEM for key exchange (from CRYSTALS-Kyber), and ML-DSA and SLH-DSA for signatures (from CRYSTALS-Dilithium and SPHINCS+), with a FALCON-based signature still to come. They are asymmetric algorithms built on different mathematical problems, and browsers have already started using ML-KEM alongside X25519 in TLS. The hybrid design stays the same: public key methods to agree on a key, and a fast symmetric cipher for the data.
Further reading
- AES Encryption Explained: The Standard Behind the Web The block cipher inside HTTPS, disk encryption and Wi-Fi.
- Public Key Cryptography: The Math, Explained Simply How two strangers agree on a secret over a public line.
- How HTTPS Works: TLS, Certificates and Encryption What the padlock in the address bar actually checks.