Use it when choosing IPsec ciphers, or when peers fail to agree on encryption.
IPsec Encryption
IPsec encryption protects confidentiality with symmetric ciphers such as AES-GCM or AES-CBC, using keys negotiated by IKE.
1. Use AES-GCM or AES-CBC with SHA-2.
2. Avoid DES/3DES/MD5.
3. Proposals must match peers.
4. Higher strength costs CPU.
5. Review against policy.
proposal negotiated → keys → encryption
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification and what it shows Verify boundary
Read the active SA and record the negotiated encryption algorithm/key size, then generate matching traffic and confirm encaps/decaps counters move on both peers. Configuration allowing AES does not show AES was selected; the live SA is the effective-state evidence. Encryption does not by itself show integrity, identity or end-to-end application health.
Step 2 Observation → implication → next check Narrow the fault
Observation → implication → next check: negotiation rejection moves to algorithm/key-length compatibility and policy order. A live SA using an unexpected algorithm points to proposal preference or peer policy. Encrypted counters without application success move to selectors, routing, integrity/replay or remote service rather than changing the cipher blindly.
Step 3 Common mistakes Narrow the fault
- Still allowing DES/3DES or DH groups 1, 2 or 5.
- Choosing AES-CBC without an integrity algorithm.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- IKE SA and IPsec child SA are separate evidence boundaries
- Proxy identities/selectors must agree at both peers
- ESP commonly carries protected data; NAT traversal can encapsulate it in UDP 4500
- Encaps and decaps counters must be interpreted with generated interesting traffic and the return path.
show crypto ipsec sa detail— transform set (AES-GCM)show crypto ikev2 sa detailed— IKE encryption
ReferenceWhy it matters1 section · depth on demand
How it works in operation
IPsec encryption protects payload confidentiality using the algorithm and key material negotiated for the active SA. Configured proposals are desired state; the effective algorithm is the one negotiated in the live SA. Encryption strength is separate from peer authentication, integrity/replay handling and whether the intended traffic is selected for IPsec.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Encryption in IPsec: keeping the payload confidential
ESP provides confidentiality by encrypting the payload, padding, pad length and next-header fields. RFC 4303 allows separate encryption and integrity algorithms, or combined-mode algorithms that provide both in one operation. The keys come from IKE: the IKE_SA_INIT Diffie-Hellman exchange creates shared secrets from which keys for the IKE SA and the Child SAs are derived (RFC 7296).
Algorithm choices
| Algorithm | Type | Status |
|---|---|---|
| AES-GCM 128/256 | Combined (encryption + integrity) | Recommended |
| AES-CBC 128/256 with HMAC-SHA-256/384 | Separate | Acceptable |
| ChaCha20-Poly1305 | Combined | Good on devices without AES hardware |
| 3DES, DES | Separate | Deprecated; don't use |
Diffie-Hellman groups
| Group | Type | Status |
|---|---|---|
| 1, 2, 5 | 768–1536-bit MODP | Too weak |
| 14 | 2048-bit MODP | Minimum acceptable |
| 19, 20, 21 | ECP 256/384/521-bit | Recommended |
R1(config)# crypto ikev2 proposal PROP
R1(config-ikev2-proposal)# encryption aes-gcm-256
R1(config-ikev2-proposal)# prf sha384
R1(config-ikev2-proposal)# group 20
R1(config)# crypto ipsec transform-set TS esp-gcm 256
R1(cfg-crypto-trans)# mode tunnel
R1(config)# crypto ipsec profile VTI-PROF
R1(ipsec-profile)# set pfs group20
R1# show crypto ipsec sa | include transform
transform: esp-gcm 256 ,
Perfect forward secrecy
With PFS (set pfs group<n>), every Child SA rekey includes a new Diffie-Hellman exchange (RFC 7296 allows one in CREATE_CHILD_SA). If a long-term key is ever compromised, previously recorded traffic still can't be decrypted.
Padding and traffic-flow confidentiality
RFC 4303 allows 0–255 bytes of padding. Besides block alignment, padding can hide the real payload length, which is part of ESP's limited traffic-flow confidentiality.
Performance
Encryption is usually handled by crypto hardware on routers and firewalls. Throughput numbers in data sheets are often measured with large packets; with small packets (VoIP), real throughput is much lower.
Documented example, not captured output.
Quick reference
The encryption algorithm decides how well the tunnel's contents are protected and how much processing it costs. Modern deployments use AES, preferably in GCM mode, which encrypts and authenticates in one step. Old algorithms like DES and 3DES are breakable or deprecated and should be removed from proposals, along with weak Diffie-Hellman groups.
IPsec encryption choices:
| Algorithm | Status |
|---|---|
| AES-GCM 128/256 | Recommended (AEAD: encryption + integrity) |
| AES-CBC 128/256 + HMAC-SHA256+ | Acceptable |
| 3DES, DES | Deprecated — remove |
Diffie-Hellman groups 19/20 (ECP 256/384) or 21; avoid groups 1, 2 and 5. Hardware crypto support matters: on routers, throughput limits often come from the crypto engine or licensing (throughput tiers), not the interface speed.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Virtualization & Overlays → IPsec → Encryption. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc4301.html · confidence 94%