Cybersecurity 101back-iconWhat is Galois/Counter Mode (GCM)?

What is Galois/Counter Mode (GCM)?

Galois counter mode (GCM) is an authenticated encryption mode that protects data confidentiality and verifies data integrity at the same time. It is most commonly used with AES, where it is called AES-GCM. In simple terms, GCM encrypts data and creates an authentication tag that proves the ciphertext, associated metadata, and encryption context were not changed.

How GCM works

GCM combines two ideas: counter mode encryption and Galois field authentication.

Counter mode turns a block cipher such as AES into a fast stream-like encryption method. Instead of encrypting one block in a fixed pattern, it encrypts a changing counter value and combines the result with plaintext to create ciphertext. This allows high performance and parallel processing.

The Galois authentication part calculates a tag using mathematical operations over a finite field. That tag is checked during decryption. If the tag does not match, the data is rejected because it may have been altered, corrupted, or decrypted with the wrong key or nonce.

Why galois counter mode (GCM) matters

Traditional encryption can hide data but may not prove that the data stayed unchanged. GCM solves this by providing authenticated encryption with associated data, often shortened to AEAD.

Associated data is information that is not encrypted but still needs integrity protection. For example, a protocol may encrypt the message body while authenticating headers, device identifiers, certificate metadata, or routing fields.

This makes GCM useful in areas such as:

  • TLS connections that secure web traffic
  • VPNs and secure network tunnels
  • Encrypted storage and database fields
  • API security and service-to-service communication
  • Secrets management workflows that protect keys, tokens, and credentials

For organizations managing certificates, keys, and device trust at scale, tools such as Hexnode can support stronger security operations by helping enforce encryption-related policies, certificate deployment, and endpoint compliance controls.

GCM vs CBC

GCM is often preferred over older modes such as Cipher Block Chaining (CBC) because it provides built-in integrity protection. CBC encryption usually needs a separate message authentication code to detect tampering safely.

Mode Key difference
GCM Encrypts data and authenticates it with a tag.
CBC Encrypts data but needs separate integrity protection.

Common GCM security mistakes

GCM is strong when implemented correctly, but it is sensitive to nonce misuse. A nonce is a unique value used with the encryption key. Reusing the same nonce with the same key can seriously weaken security and may expose plaintext or authentication details.

Security teams should ensure that cryptographic libraries generate nonces safely, keys are rotated according to policy, and authentication tag failures are treated as security-relevant events rather than routine errors.

FAQs

GCM is not a standalone encryption algorithm. It is a mode of operation used with a block cipher, most often AES, to provide authenticated encryption.

GCM commonly uses a 128-bit authentication tag, although some systems allow shorter tags. Shorter tags reduce the margin against forgery and should be chosen carefully.

Yes. GCM can authenticate associated data, which means metadata can remain visible while still being protected against unauthorized modification.