Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or http:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Message Authentication Codes MAC

Overview

The message authentication code (MAC) is generated from an associated message as a method for assuring the integrity of the message and the authenticity of the source of the message.  A secret key to the generation algorithm must be established between the originator of the message and its intended receiver(s).

Approved Algorithms

Currently, there are three approved* general-purpose MAC algorithms:  HMAC, KMAC, and CMAC.

  1. Keyed-Hash Message Authentication Code (HMAC)

  1. KECCAK Message Authentication Code (KMAC)

  1. CMAC Mode for Authentication

Notes

  • The CCM and GCM algorithms for authenticated encryption—each constructed from an approved block cipher—can be specialized to MAC algorithms if no data is to be encrypted. In the case of GCM, this specialization has a separate name, GMAC.
  • An earlier FIPS—FIPS 113, Computer Data Authentication—specified a Message Authentication Code; it was withdrawn in September 2008.
 

Testing HMAC, CMAC and GMAC Implementations

Testing requirements and validation lists are available from the Cryptographic Algorithm Validation Program (CAVP).

Implementation-related References

 

*Note: FIPS-approved and/or NIST-recommended. An algorithm or technique that is either 1) specified in a FIPS or NIST recommendation, 2) adopted in a FIPS or NIST recommendation, or 3) specified in a list of NIST-approved security functions.

Contacts

Quynh Dang
[email protected]

Topics

Security and Privacy: message authentication

Created January 04, 2017, Updated June 23, 2025