Use this when using AES-GCM and nonce uniqueness and tag checks are critical.
GCM
GCM (Galois/Counter Mode) provides encryption and authentication together (AEAD) with AES. It is fast and standard in TLS and IPsec, but a nonce must never be reused with the same key.
1. GCM: AEAD with CTR encryption and GHASH authentication.
2. Fast with hardware.
3. Never reuse a nonce with the same key.
4. Respect data limits (rekey).
5. Verify the tag before using plaintext.
key + nonce → CTR + GHASH → ciphertext + tag
Context & applicabilityCommon mistakes · platform/version boundaries
- Reusing a nonce with the same key — exposes the authentication key and allows forgery.
- Truncating the tag below 128 bits.
- Using decrypted data before the tag is verified.
- Encrypting more than ~2³² messages with random nonces under one key — rotate keys.
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 Nonce limits Narrow the fault
With random 96-bit nonces, NIST recommends at most 2³² messages per key to keep collision risk negligible. With counter nonces you can encrypt more, but each counter value must be used only once per key. AES-GCM-SIV tolerates nonce reuse better when uniqueness cannot be guaranteed.
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.
- Encryption plus authentication.
- Nonce reuse is catastrophic.
- Check tag on decrypt.
openssl s_client -connect <host>:443 -cipher ECDHE-RSA-AES128-GCM-SHA256 </dev/null— GCM in TLS 1.2- Nonce strategy (96-bit unique) — safety
- Data limits per key — rekeying
ReferenceWhy it matters1 section · depth on demand
Key points
- 96-bit nonce must be unique per key; a repeat lets an attacker forge messages and recover data.
- The authentication tag (usually 128 bits) must be checked before using the plaintext.
- Limit data per key (rekey long sessions); TLS and IPsec do this automatically.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
GCM (Galois/Counter Mode) combines counter-mode encryption with a Galois-field authentication tag, providing authenticated encryption with associated data (AEAD). AES-GCM is the default cipher in TLS 1.3, IPsec, SSH and many storage systems because it is fast with hardware support and protects both confidentiality and integrity.
| Parameter | Guidance |
|---|---|
| Nonce/IV | 96 bits, unique per key — never reuse |
| Tag length | 128 bits |
| Messages per key | Limit with random nonces (rekey well before ~2^32 messages) |
| Associated data | Authenticated but not encrypted (headers) |
Nonce reuse with the same key destroys GCM's security (reveals plaintext relations and enables forgeries). Protocols handle nonces automatically; when using GCM directly, use library defaults or misuse-resistant AES-GCM-SIV.
Where GCM is used
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 Symmetric Cryptography → GCM. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://csrc.nist.gov/pubs/fips/197/final · confidence 94%