Symmetric encryption uses one secret key to both encrypt and decrypt, so everyone who can read the data must share that key; asymmetric encryption uses a key pair, where anything encrypted with the public key can only be decrypted with the matching private key. Symmetric ciphers such as AES are fast and encrypt the actual data, while asymmetric algorithms such as RSA and elliptic-curve Diffie-Hellman are slow and are used to exchange keys and prove identity, which is why HTTPS, SSH and messaging apps use both together.
Symmetric vs asymmetric encryption at a glance
| Symmetric | Asymmetric (public-key) | |
|---|---|---|
| Keys | One shared secret key | A public key (shareable) and a private key (kept secret) |
| Examples | AES (older: 3DES, disallowed by NIST for new encryption after 2023) | RSA, X25519 / ECDH, ECDSA, Ed25519 |
| Speed | Very fast; gigabytes per second on a modern CPU | Thousands of operations per second, each on a small input |
| Key size for 128-bit security (NIST) | 128 bits (AES-128) | RSA: 3072 bits; elliptic curve: 256 to 383 bits |
| Main problem it solves | Encrypting bulk data | Sharing keys with someone you have never met; digital signatures |
| Main weakness | Getting the key to the other side safely | Slow, larger keys, and public keys must be authentic |
How symmetric encryption works
With a symmetric cipher, the sender and receiver hold the same key. AES, the most widely used symmetric cipher, is a NIST standard (FIPS 197) that transforms data in 128-bit blocks using a 128-, 192- or 256-bit key. In practice it runs in a mode such as GCM, which also detects tampering. The AES explainer walks through how it works with a test vector you can reproduce.
The strength of symmetric encryption is speed. The weakness is the key itself. If you encrypt a file for a colleague with AES, you still have to get the key to them, and anyone who intercepts it can read everything. With many people the problem grows: 10 people who each need a private channel with every other person need 45 separate shared keys (10 × 9 / 2).
How asymmetric encryption works
Asymmetric cryptography splits the key in two. You publish the public key; anyone can use it to encrypt a message to you or to check your signature. Only your private key can decrypt those messages or create those signatures. Nobody has to share a secret in advance, which is exactly what two computers meeting on the internet need.
The same pair supports two jobs:
- Key exchange / encryption: agree on or wrap a secret so only the other party can recover it (Diffie-Hellman, RSA encryption).
- Signatures: prove a message came from the holder of the private key and was not changed (RSA signatures, ECDSA, Ed25519).
For a worked example with small numbers you can check by hand, see public-key cryptography explained.
How much faster is symmetric encryption?
You can measure the gap on your own machine with OpenSSL's built-in benchmark:
openssl speed -seconds 2 -evp aes-256-gcm
openssl speed -seconds 2 rsa2048
Example output, abridged (OpenSSL 3.2.1, one core of a desktop CPU; your numbers will differ):
type 1024 bytes 8192 bytes
AES-256-GCM 6855822.24k 6622036.32k
sign verify encrypt decrypt sign/s verify/s encr./s decr./s
rsa 2048 bits 0.000360s 0.000017s 0.000014s 0.000390s 2780.4 60308.1 71435.3 2566.0
AES-256-GCM processed about 6.6 billion bytes per second (the figures are in thousands of bytes per second). RSA-2048 managed about 2,566 private-key decryptions per second, and each operation handles at most 256 bytes. Even in the best case that is well under 1 MB per second, thousands of times slower than AES on the same core. Encrypting a video file with RSA directly would be absurdly slow, and the standard way to use RSA does not even allow inputs longer than the key.
Key sizes: why RSA keys are so much longer
Key lengths are not comparable across the two families. NIST SP 800-57 Part 1 (Table 2) lists which key sizes give the same security strength:
| Security strength | Symmetric | RSA (modulus) | Elliptic curve (key size) |
|---|---|---|---|
| 112 bits | 3TDEA (deprecated) | 2048 bits | 224 to 255 bits |
| 128 bits | AES-128 | 3072 bits | 256 to 383 bits |
| 192 bits | AES-192 | 7680 bits | 384 to 511 bits |
| 256 bits | AES-256 | 15360 bits | 512+ bits |
So a 2048-bit RSA key is not "16 times stronger" than AES-128. It is weaker: 112-bit strength, which the same NIST document (Table 4) marks as acceptable for protecting new data only through 2030, while 128 bits and above stay acceptable from 2031 onwards. RSA keys must be large because the best attacks on it (factoring) are much more efficient than trying every key. Elliptic-curve keys reach the same strength with far smaller numbers, which is one reason modern protocols prefer X25519 and Ed25519 over RSA. NIST also notes that its asymmetric estimates will be "significantly affected" once quantum computing becomes practical.
Why HTTPS and SSH use both (hybrid encryption)
Real protocols combine the two so each covers the other's weakness. TLS 1.3, the protocol behind HTTPS (RFC 9846), works roughly like this:
- Browser and server perform an asymmetric key exchange, typically elliptic-curve Diffie-Hellman, to agree on a shared secret over an open network.
- The server proves its identity with an asymmetric signature (RSA, ECDSA or EdDSA) that the browser checks against the server's certificate.
- Both sides derive symmetric keys from the shared secret, and every byte of the page after that is encrypted with an authenticated symmetric cipher. RFC 9846 states that all remaining record-protection algorithms in TLS 1.3 are AEAD ciphers, such as AES-GCM.
SSH follows the same pattern. RFC 4253 describes a Diffie-Hellman key exchange that produces a shared secret, a server signature over the exchange made with the server's private host key, and symmetric session keys derived from the shared secret that encrypt the rest of the connection. Asymmetric cryptography handles the small, rare, identity-sensitive step; symmetric cryptography handles the data.
Which one should you use?
- Encrypting a file or text for yourself, or for someone you can share a password with: symmetric. A password-based AES tool such as larely's AES-256-GCM text encryptor derives the key from the password, so the password is the shared secret. Send the password through a different channel from the ciphertext.
- Sending something to a person or server without a shared secret: asymmetric for the key, symmetric for the data. Use an established encryption tool that does this for you; don't wire it up by hand.
- Proving who sent something or that it wasn't modified: asymmetric signatures.
- Logging in to servers: SSH keys, which are asymmetric pairs; see how to generate an Ed25519 SSH key.
Whichever you use, the security rests on the secret part: the symmetric key, the password it is derived from, or the private key. Encryption with a leaked key protects nothing.
Frequently asked questions
- Is asymmetric encryption more secure than symmetric?
- Not inherently. Security depends on the algorithm and key size, not on the category. NIST rates AES-128 as roughly equivalent to RSA with a 3072-bit key and to elliptic-curve keys of 256 to 383 bits. Asymmetric encryption solves a different problem: sharing keys with strangers safely.
- Is AES symmetric or asymmetric?
- AES is symmetric. The same 128-, 192- or 256-bit key encrypts and decrypts. RSA, elliptic-curve Diffie-Hellman (such as X25519) and ECDSA are asymmetric.
- Why not just use asymmetric encryption for everything?
- It is far slower and can only process small inputs per operation: an RSA-2048 operation works on at most 256 bytes. So systems use asymmetric cryptography to agree on or protect a short symmetric key, then encrypt the actual data with a symmetric cipher such as AES-GCM.
- Which type do quantum computers threaten?
- The asymmetric side. NIST's key-management guidance (SP 800-57 Part 1) marks its strength estimates for RSA and elliptic-curve algorithms with a note that they will be significantly affected when quantum computing becomes practical. Protocols are preparing for this: the current TLS 1.3 specification (RFC 9846) generalises key exchange beyond Diffie-Hellman so that extensions can define other key-encapsulation mechanisms.
Sources
- NIST SP 800-57 Part 1 Rev. 5: Recommendation for Key Management (Table 2, comparable security strengths)
- RFC 9846: The Transport Layer Security (TLS) Protocol Version 1.3
- NIST FIPS 197: Advanced Encryption Standard (AES)
- RFC 4253: The Secure Shell (SSH) Transport Layer Protocol
- OpenSSL documentation: openssl-speed