{
  "id": "wire-format/aes-gcm",
  "family": "wire-format",
  "slug": "aes-gcm",
  "title": "AES-GCM (Galois/Counter Mode)",
  "summary": "AES-GCM is an authenticated encryption mode. It combines AES-CTR (counter mode for encryption) with GHASH (Galois field multiplication for authentication). Output: ciphertext + authentication tag (128 bits). Used in TLS 1.3, IPsec, and most modern protocols. Nonce: 96 bits (recommended) or 128 bits. AAD (Additional Authenticated Data) is authenticated but not encrypted.",
  "kind": "wire-format",
  "aliases": [
    "AES-GCM (Galois/Counter Mode)"
  ],
  "status": "standard",
  "verification": "verified",
  "tier": "B",
  "source_url": "https://en.wikipedia.org/wiki/Galois/Counter_Mode",
  "source_version": "retrieved 2026-05-29",
  "retrieved_date": "2026-05-29",
  "ext_type": "wire-format@1",
  "ext": {
    "spec": "NIST SP 800-38D",
    "summary": "AES-GCM is an authenticated encryption mode. It combines AES-CTR (counter mode for encryption) with GHASH (Galois field multiplication for authentication). Output: ciphertext + authentication tag (128 bits). Used in TLS 1.3, IPsec, and most modern protocols. Nonce: 96 bits (recommended) or 128 bits. AAD (Additional Authenticated Data) is authenticated but not encrypted.",
    "structure": [
      {
        "field": "Nonce",
        "size": "96 bits (recommended)",
        "meaning": "Initialization vector. Must be unique per key (nonce reuse is catastrophic)."
      },
      {
        "field": "Counter (CTR)",
        "size": "32 bits",
        "meaning": "Counter for AES-CTR. Starts at 1 (0 reserved for GHASH). Increments for each block."
      },
      {
        "field": "Ciphertext",
        "size": "variable",
        "meaning": "Plaintext XOR keystream (AES-CTR). Each block: AES(key, nonce || counter)."
      },
      {
        "field": "GHASH",
        "size": "128 bits",
        "meaning": "Galois field (GF(2^128)) multiplication. Authenticates ciphertext + AAD. Polynomial: x^128 + x^7 + x^2 + x + 1."
      },
      {
        "field": "Tag",
        "size": "128 bits (or 96/104/112/120)",
        "meaning": "Authentication tag = GHASH(AAD, ciphertext, lengths) XOR AES(key, nonce || 0). Truncated to tag length."
      },
      {
        "field": "AAD",
        "size": "variable",
        "meaning": "Additional Authenticated Data. Authenticated but not encrypted (e.g., packet headers)."
      }
    ],
    "example_hex": "00 00 00 00",
    "example_decoded": "AES-GCM (placeholder)",
    "notes": [
      "AES-GCM is the most common AEAD mode (TLS 1.3, IPsec, SSH).",
      "Nonce reuse is catastrophic: reveals XOR of plaintexts and allows forgery.",
      "GHASH uses GF(2^128) multiplication (carryless multiply, available on modern CPUs).",
      "AES-GCM is fast: ~1-2 GB/s on modern hardware (AES-NI + CLMUL).",
      "Tag length: 128 bits (recommended), 96 bits (minimum for security)."
    ]
  },
  "updated": "2026-05-29"
}
