wire / wire-format / aes-gcm
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.
aka: AES-GCM (Galois/Counter Mode)
spec: NIST SP 800-38D
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.
| field | size | meaning |
|---|---|---|
| Nonce | 96 bits (recommended) | Initialization vector. Must be unique per key (nonce reuse is catastrophic). |
| Counter (CTR) | 32 bits | Counter for AES-CTR. Starts at 1 (0 reserved for GHASH). Increments for each block. |
| Ciphertext | variable | Plaintext XOR keystream (AES-CTR). Each block: AES(key, nonce || counter). |
| GHASH | 128 bits | Galois field (GF(2^128)) multiplication. Authenticates ciphertext + AAD. Polynomial: x^128 + x^7 + x^2 + x + 1. |
| Tag | 128 bits (or 96/104/112/120) | Authentication tag = GHASH(AAD, ciphertext, lengths) XOR AES(key, nonce || 0). Truncated to tag length. |
| AAD | variable | Additional Authenticated Data. Authenticated but not encrypted (e.g., packet headers). |
example:
00 00 00 00
AES-GCM (placeholder)
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/aes-gcm
or /wire-format/aes-gcm.json