Symmetric encryption uses one shared secret key to both encrypt and decrypt, while asymmetric encryption uses a key pair: a public key anyone may hold and a private key only the owner keeps. Symmetric ciphers such as AES are fast and protect almost all bulk data, but they leave you with the problem of getting the same key to both sides safely. Asymmetric algorithms such as RSA, elliptic curve Diffie-Hellman and now ML-KEM solve that distribution problem, at a much higher computational cost. Real systems therefore combine them: asymmetric cryptography agrees or wraps a key, and symmetric cryptography does the heavy lifting. This guide is for engineers, architects and security teams who need to choose algorithms, modes and key sizes, design key handling, and plan for post-quantum change. It builds on the Cryptography Basics Guide and does not repeat its coverage of hashing or TLS cipher suites.
Key takeaways
- Symmetric for data, asymmetric for keys. AES-GCM or ChaCha20-Poly1305 encrypts the payload; RSA-OAEP, ECDH or ML-KEM establishes or wraps the key that encrypts it.
- The mode matters as much as the cipher. Use an authenticated mode (AEAD) and never reuse a nonce with the same key: one repeat in GCM destroys its integrity guarantee.
- Key sizes are set by NIST, not taste. AES-128 or AES-256, RSA of at least 2048 bits (3072 for new long-lived keys) and P-256 or X25519 meet current NIST guidance in SP 800-57 and SP 800-131A.
- Quantum risk falls on the asymmetric side. RSA and elliptic curve key exchange need replacing with ML-KEM (FIPS 203); AES at 128 bits and above is not expected to need replacement.
- Encryption is only as strong as key custody. Most real failures are keys stored beside the data, hard-coded, or held by service accounts with no owner, not broken algorithms.
How symmetric and asymmetric encryption differ
In plain terms, symmetric encryption is a lockbox where sender and receiver hold copies of the same key. Asymmetric encryption is a letterbox: anyone can post a message through the slot using the public key, but only the holder of the private key can open the box. The maths behind each is different, and so are their costs and the problems they leave behind.
| Property | Symmetric (AES, ChaCha20) | Asymmetric (RSA, ECC, ML-KEM) |
|---|---|---|
| Keys | One secret key shared by all parties | Key pair: public key shared, private key kept |
| Speed | Very fast, often hardware accelerated (AES-NI, ARMv8 crypto extensions) | Orders of magnitude slower per byte; used on small values |
| Typical key size for about 128-bit strength | 128 bits | RSA 3072 bits; P-256 or X25519 256 bits; ML-KEM-768 (NIST category 3) |
| Main job | Bulk data at rest and in transit | Key exchange, key wrapping, signatures (see the Digital Signatures Guide) |
| Hard problem it leaves | Distributing and rotating the shared key | Trusting that a public key really belongs to the right party (PKI) |
| Quantum exposure | Low: NIST does not expect to transition away from AES at 128 bits or more | High: Shor's algorithm breaks RSA and ECC; replace with ML-KEM |
The public key problem is solved by certificates and a public key infrastructure, which binds a public key to a name. See the PKI Basics Guide.
Symmetric encryption in practice: AES, ChaCha20 and modes
AES is specified in FIPS 197, first published in 2001 and updated editorially in May 2023 with no technical change. It is a block cipher with a 128-bit block and three key lengths: AES-128, AES-192 and AES-256. A block cipher on its own only encrypts 16 bytes, so a mode of operation defines how it handles real messages, and that choice decides whether the result is safe.
| Mode or cipher | Standard | Integrity built in | Nonce or IV rule | Use |
|---|---|---|---|---|
| AES-GCM | NIST SP 800-38D | Yes (AEAD, 128-bit tag recommended) | 96-bit IV, unique per key; with random IVs no more than 2^32 messages per key | Default for TLS, cloud storage, application data |
| ChaCha20-Poly1305 | RFC 8439 | Yes (AEAD, 128-bit tag) | 96-bit nonce that MUST not repeat for the same key | Devices without AES hardware; TLS 1.3, WireGuard, SSH |
| AES-CCM | NIST SP 800-38C | Yes (AEAD) | Unique nonce | Constrained and IoT protocols |
| AES-XTS | NIST SP 800-38E | No (tweakable, no tag) | Sector number as tweak | Full disk encryption only |
| AES-CBC | NIST SP 800-38A | No; needs separate MAC (encrypt then MAC) | Unpredictable IV | Legacy only; padding oracle risk |
| AES-ECB | NIST SP 800-38A | No | None | Never for data: identical blocks give identical ciphertext |
- Nonce reuse is the classic AEAD failure: NIST SP 800-38D warns that a single repeated IV in GCM allows forgeries and recovery of the authentication subkey. RFC 8439 calls nonce uniqueness "the most important security consideration" for ChaCha20-Poly1305, because a repeat exposes the XOR of two plaintexts. Use a counter per key, or rotate keys well before the random IV limit.
- Associated data: AEAD modes authenticate additional data that is not encrypted, such as a record header, tenant ID or object path. Binding context this way stops an attacker moving a valid ciphertext to another record.
- Key wrapping: for encrypting keys with keys, use AES Key Wrap (NIST SP 800-38F) or an AEAD, not a general mode.
- AES-128 or AES-256: both are approved. AES-256 adds margin for long-lived data and is required by some national schemes such as CNSA 2.0; AES-128 is fine for most commercial use.
For storage-level encryption choices, see the Disk Encryption Guide: BitLocker and FileVault and the wider Encryption Guide.
Asymmetric encryption and key exchange: RSA, ECC and ML-KEM
Asymmetric algorithms rarely encrypt data directly. They do one of two jobs: key transport (encrypt a random symmetric key to the recipient's public key) or key agreement (both sides combine their own private key with the other's public key to derive the same secret).
- RSA key transport: RFC 8017 says RSAES-OAEP is required for new applications and keeps RSAES-PKCS1-v1_5 only for compatibility, warning it is open to chosen-ciphertext attacks. NIST SP 800-131A Rev. 2 disallows RSA key transport below 2048 bits and PKCS#1 v1.5 padding for key transport after 2023.
- Diffie-Hellman and ECDH: key agreement over finite fields (ffdhe groups) or elliptic curves (P-256, P-384, X25519). Ephemeral keys (ECDHE) give forward secrecy: stealing the server's long-term key later does not decrypt recorded sessions. TLS 1.3 removed static RSA key exchange for exactly this reason. See the How TLS Works Guide.
- ML-KEM: FIPS 203, published 13 August 2024, standardises the Module-Lattice-Based Key-Encapsulation Mechanism in three parameter sets, ML-KEM-512, ML-KEM-768 and ML-KEM-1024. A KEM does not encrypt a chosen value: it generates a shared secret and a ciphertext ("encapsulation") that only the private key holder can open. NIST SP 800-227 (final, September 2025) gives recommendations for using KEMs securely.
- Hybrid key exchange: during migration, protocols combine a classical exchange (X25519) with ML-KEM so the session stays safe if either holds. Deployment status in TLS, SSH and VPNs is covered in the Post-Quantum Cryptography Migration Guide.
Hybrid encryption: how real systems combine both
"Hybrid encryption" here means the standard pattern, not post-quantum hybrids: generate a fresh random symmetric key, encrypt the data with it, and protect that key with asymmetric cryptography. Almost everything you use works this way.
| System | Asymmetric part | Symmetric part |
|---|---|---|
| TLS 1.3 | ECDHE (X25519, P-256) or hybrid X25519 plus ML-KEM; certificate signature authenticates the server | AES-GCM or ChaCha20-Poly1305 record protection |
| HPKE (RFC 9180) | KEM such as DHKEM(X25519, HKDF-SHA256) | AEAD, keys derived with a KDF |
| S/MIME and OpenPGP email | Recipient's RSA or ECC key wraps a session key | AES content encryption |
| Cloud KMS envelope encryption | Often none: a symmetric key encryption key (KEK) in the KMS or HSM wraps a data encryption key (DEK) | DEK encrypts each object locally |
| SSH | Curve25519 or hybrid ML-KEM key exchange; host and user keys authenticate | AES-GCM, AES-CTR with MAC, or ChaCha20-Poly1305 |
RFC 9180 HPKE is the modern, reviewed way to encrypt a message to a public key, and the OWASP Cryptographic Storage Cheat Sheet points to it for public key encryption. Note its stated limit: HPKE gives no forward secrecy if the recipient's private key is later compromised, so long-lived recipient keys need rotation. Envelope encryption shows that "asymmetric" is not required for hybrid designs: what matters is that the DEK changes often and the KEK never leaves protected hardware.
Key sizes and NIST status
Security strength is expressed in bits: the work an attacker needs is about 2 to that power. NIST SP 800-57 Part 1 Rev. 5 states that 80-bit strength is no longer sufficient, and 112 bits is the current floor. Values below follow SP 800-57 Part 1 and SP 800-131A Rev. 2; post-quantum dates come from the NIST IR 8547 initial public draft (November 2024), which is still a draft and may change.
| Strength | Symmetric | RSA / finite field DH | Elliptic curve | Status |
|---|---|---|---|---|
| 112 bits | (3TDEA, now disallowed for encryption) | 2048 bits | P-224 | Acceptable today; IR 8547 draft proposes deprecation after 2030 |
| 128 bits | AES-128 | 3072 bits | P-256, X25519 | Recommended baseline; RSA and ECC proposed for disallowance after 2035 |
| 192 bits | AES-192 | 7680 bits | P-384 | Acceptable |
| 256 bits | AES-256 | 15360 bits | P-521 | Acceptable |
| Post-quantum | AES-128 and above unaffected in practice | ML-KEM-512 / 768 / 1024 (NIST categories 1 / 3 / 5) | Approved in FIPS 203 | |
The urgency on the asymmetric side comes from "harvest now, decrypt later": traffic recorded today with ECDHE or RSA could be decrypted once a capable quantum computer exists. Prioritise key exchange for data with a long confidentiality life. For inventory and roadmap, see the Cryptographic Inventory and CBOM Guide and the Crypto-Agility Guide.
Choosing between them: decision guidance
- Both parties are the same system or share a trust domain (database field, backup, object store): symmetric AEAD with keys in a KMS. No asymmetric step needed.
- Parties have never met (browser to server, partner to partner): asymmetric key agreement authenticated by certificates, then symmetric AEAD. Use the protocol (TLS 1.3, SSH), never a home-made exchange.
- Encrypting to a recipient who is offline (file drop, email, escrow): HPKE, CMS (S/MIME) or OpenPGP with RSA-OAEP or ECDH; plan recipient key rotation.
- High-volume, low-latency services: AES-GCM on hardware with AES instructions; ChaCha20-Poly1305 on mobile and embedded CPUs without them.
- Data that must stay secret for 10 years or more: AES-256 for storage, and hybrid post-quantum key exchange in transit as soon as your stack supports it.
- Small organisations: rely on platform defaults (cloud KMS envelope encryption, managed TLS, BitLocker or FileVault) and spend effort on key access policy, not algorithm selection. Large organisations: publish an approved algorithm list, require FIPS 140-3 validated modules where regulation demands it, and run a cryptographic inventory.
Key management, KMS and HSM
Whatever the algorithm, the key is the asset. NIST SP 800-57 Part 1 sets the rule that a single key should be used for only one purpose, and defines cryptoperiods: how long a key may be used before rotation.
| Option | Where the key lives | Strength | Watch out for |
|---|---|---|---|
| Cloud KMS (software or HSM backed) | Provider-managed boundary; key never exported by default | IAM policy per key, audit log per use, automatic rotation of KEKs | Over-broad decrypt permissions granted to roles and service accounts |
| Dedicated or cloud HSM | FIPS 140-3 validated hardware you control | Non-exportable keys, quorum admin, strongest regulatory fit | Cost, capacity planning, backup of HSM key material |
| Secrets manager or vault transit engine | Software service; can do encryption as a service | Central policy, short-lived access, good developer workflow | Root and unseal keys become the crown jewels |
| Application config or code | Files, environment variables, repositories | None worth having | Leaks through repos, images, logs and backups |
The OWASP Cryptographic Storage Cheat Sheet adds two practical rules: never hard-code keys, and make the key encryption key at least as strong as the data encryption key. See the Cryptographic Key Management Guide and the HashiCorp Vault Guide.
Where identity fits
Every decrypt call is made by an identity, and it is usually a non-human one: a service account, workload role, CI pipeline or backup agent. A KMS key with a strong algorithm and a policy granting kms:Decrypt to a wildcard role is effectively plaintext for anyone who steals that role's credentials. Give each workload its own key or key policy, scope decrypt to the specific key and encryption context, and review these grants as privileged access. See the Secrets Management Guide.
How to implement an encryption baseline
- Inventory: list where data is encrypted, with what algorithm, mode and key store, using code scanning, TLS scans and KMS key listings. Flag ECB, CBC without MAC, RSA below 2048 bits, PKCS#1 v1.5 key transport and 3DES.
- Publish an approved list: AES-GCM, ChaCha20-Poly1305, AES-XTS for disks, RSA-OAEP 3072, ECDH P-256/X25519, ML-KEM-768, with approved libraries (platform crypto, not custom code).
- Centralise keys: move keys into KMS or HSM, enable rotation, and switch applications to envelope encryption.
- Pilot: change one service at a time. Run old and new decryption side by side (decrypt with either key, encrypt only with the new one) so a rollback is a configuration change, not a data recovery.
- Re-encrypt: rewrap DEKs under the new KEK; re-encrypt data where the DEK or algorithm itself was weak.
- Retire: disable old keys (schedule deletion only after confirming nothing still decrypts with them) and remove weak algorithms from configuration.
- Prepare post-quantum: enable hybrid key exchange where the platform supports it, test with middleboxes, and record algorithm choices so they can change again.
Detection and measurement
- Log: KMS and HSM audit events (key use, policy change, disable, schedule deletion), decrypt calls by principal, TLS negotiated versions and key exchange groups, and failed AEAD tag verifications in application logs.
- Alert on: decrypt volume spikes by one principal, key policy changes granting new principals, key deletion requests, and any negotiation of disallowed suites.
- Metric 1: percentage of data stores encrypted with keys held in KMS or HSM rather than application config.
- Metric 2: number of disallowed algorithm uses found (ECB, 3DES, RSA below 2048, PKCS#1 v1.5 key transport), trending to zero.
- Metric 3: percentage of keys rotated within their defined cryptoperiod.
- Metric 4: number of principals with decrypt rights per key, and the share with a named owner.
- Metric 5: share of external TLS sessions using hybrid post-quantum key exchange.
Common failure patterns
- Key stored with the data: encryption only helps if the attacker cannot reach the key. In the GoTo breach, attackers took encrypted backups and, for a portion of them, the key as well, which left that portion effectively unprotected.
- Nonce or IV reuse: fixed IVs in configuration, counters reset on restart, or random 96-bit IVs used far past 2^32 messages with one key.
- Unauthenticated modes: CBC or CTR without a MAC, allowing padding oracle and bit-flipping attacks; ECB used because a library default chose it.
- Using RSA to encrypt data directly: large payloads chunked into RSA blocks with PKCS#1 v1.5 padding instead of hybrid encryption.
- Over-permissive decrypt: one KMS key shared across environments with decrypt granted to many roles, so a single stolen workload credential decrypts everything.
- Home-grown crypto: custom ciphers, custom key exchange or "encryption" that is encoding. The OWASP guidance is blunt: do not create custom algorithms.
Framework mapping
| Framework | Reference | What it asks for |
|---|---|---|
| NIST SP 800-53 Rev. 5 | SC-12, SC-12(1) | Cryptographic key establishment and management; key availability |
| NIST SP 800-53 Rev. 5 | SC-13, SC-8, SC-28 | Approved cryptography; protection in transit and at rest |
| NIST CSF 2.0 | PR.DS-01, PR.DS-02 | Data at rest and in transit protected |
| CIS Controls v8.1 | 3.10, 3.11 | Encrypt sensitive data in transit; encrypt sensitive data at rest |
| ISO/IEC 27001:2022 | Annex A 8.24 | Use of cryptography, including key management rules |
| MITRE ATT&CK | T1552.004, T1557, T1689 | Private key theft, adversary in the middle, downgrade attacks that encryption design must resist |
Practitioner checklist
- Use only AEAD modes (AES-GCM, ChaCha20-Poly1305) for new data encryption; ban ECB and unauthenticated CBC in code review rules.
- Guarantee nonce uniqueness per key by design, and rotate GCM keys before 2^32 random-IV messages.
- Use hybrid encryption (TLS, HPKE, CMS) whenever asymmetric keys are involved; never encrypt bulk data with RSA.
- Set minimums: AES-128, RSA 2048 (3072 for new long-lived keys) with OAEP, P-256 or X25519; track the NIST IR 8547 draft dates.
- Hold KEKs in a KMS or FIPS 140-3 validated HSM; keep keys separate from the data and the backups they protect.
- Scope decrypt permissions per workload identity and review them like privileged access.
- Enable and alert on KMS audit events, especially policy changes and deletion requests.
- Maintain a cryptographic inventory and a tested path to ML-KEM hybrid key exchange.
Standards and references
- NIST: FIPS 197, Advanced Encryption Standard (AES)
- NIST: SP 800-38D, Galois/Counter Mode (GCM) and GMAC
- IETF: RFC 8439, ChaCha20 and Poly1305 for IETF Protocols
- NIST: FIPS 203, Module-Lattice-Based Key-Encapsulation Mechanism Standard
- NIST: SP 800-57 Part 1 Rev. 5, Recommendation for Key Management
- NIST: SP 800-131A Rev. 2, Transitioning the Use of Cryptographic Algorithms and Key Lengths
- NIST: IR 8547 (Initial Public Draft), Transition to Post-Quantum Cryptography Standards
- IETF: RFC 9180, Hybrid Public Key Encryption
Related NHI Mgmt Group resources: Cryptography Basics Guide · Digital Signatures Guide · Cryptographic Key Management Guide · Post-Quantum Cryptography Migration Guide · Hashing Guide