Skip to content
CoreSource checked

AES-GCM

AES-GCM encrypts data with a defined symmetric construction.

Quick Facts

Compact metadata for implementation and discovery.

Category
Cryptography
Difficulty
Intermediate
Family
Authenticated Encryption
Tier
Core
Status
Verified
Review
Source Checked
Sources
2
Formulas
1
Relationships
1
Code example
Ready
Visualization
Ready
Aliases
GCM, Galois/Counter Mode

Overview

AES-GCM is a cryptographic method that protects confidentiality, authenticity, or integrity with a defined primitive or protocol step. It should be used only as part of a well-defined protocol with correct parameters and key handling.

Core Concepts

key materialsecurity parameterverification ruleverificationmisuse resistanceparameter validation

Quick facts

Complexity

Runtime and memory behavior at a glance.

Best

O(n)

Average

O(n)

Worst

O(n)

Space

O(1)

When to Use

  • Use AES-GCM only when the protocol calls for this specific primitive or construction.
  • Use it when a vetted implementation is available and parameter handling can be enforced.

When Not to Use

  • Avoid custom protocol combinations around this primitive.
  • Avoid when nonce, key, padding, or parameter requirements cannot be enforced.

What It Does

  • Computes authenticated encryption within Authenticated Encryption workloads (O(n) time, O(1) space).
  • Works by It should be used only as part of a well-defined protocol with correct parameters and key handling.
  • Maintains key invariants across key material, security parameter, verification rule.

Use Cases

  • Secure communication
  • Authentication
  • Key management

Inputs

  • Message or secret
  • Key material
  • Nonce, salt, or public parameters

Outputs

  • Ciphertext, tag, key, signature, or proof
  • Verification result

Key Formulas (1)

Authenticated encryption output

ciphertext, tag = GCMencrypt(key, nonce, plaintext, aad)
ciphertext, tag = GCM_encrypt(key, nonce, plaintext, aad)

Combines counter-mode encryption with a polynomial authentication tag.

Pseudocode

  1. 1.Validate keys, nonces, and required parameters
  2. 2.Apply the primitive's block, group, hash, or verification operation
  3. 3.Combine intermediate values according to the construction
  4. 4.Return the ciphertext, tag, key, signature, proof, or verification result

Canonical Example

Input
message = 'pay 10', key material = provided, nonce or public parameters = provided
Output
protected value or verification result
Explanation
AES-GCM applies its defined cryptographic operation without inventing extra protocol steps.

Implementation Notes

  • Use vetted implementations for low-level primitives.
  • Validate parameter lengths, nonce handling, and authentication failure behavior explicitly.
  • Use reviewed libraries and protocol specifications for production security-sensitive code.

Common Pitfalls

  • Reusing nonces, salts, or ephemeral values can break security assumptions.
  • Treating a primitive as a full protocol invites key-management and authentication mistakes.
  • Treating educational pseudocode as production crypto can hide nonce, parameter, and side-channel requirements.

Interactive Mechanism Walkthrough

Graph Frontier & Edge Relaxation

Show messages, keys, nonces, and verification values moving through the cryptographic construction.

AES-GCM mechanism walkthrough step 1 of 4suvwxt
Step 1 of 4: Validate keys, nonces, and required parameters
crypto

Notes

AES-GCM operates in O(n) time and O(1) space within the Authenticated Encryption family. Key governing relation: ciphertext, tag = GCM_encrypt(key, nonce, plaintext, aad). Often compared with AES and HMAC.

Sources (2)

What each reference supports for this entry.

NIST SP 800-38D

Documentation

Specifies GCM and GMAC authenticated encryption modes, supporting AES-GCM.

Open source

NIST FIPS 197

Documentation

Standard reference for the AES block cipher used by AES-GCM.

Open source

Explore Next

Good next jumps from the relationship graph, ranked for useful discovery.

UsesAES

AES-GCM uses AES as a component or subroutine in its construction.

Related Algorithms

Tags

CryptographySecuritySymmetric KeyMessage Authentication