What is message authentication code (MAC)? | Definition from TechTarget (2024)

What is message authentication code (MAC)? | Definition from TechTarget (1)

By

  • Robert Sheldon

What is a message authentication code (MAC)?

A message authentication code (MAC) is a cryptographic checksum applied to a message in network communication to guarantee its integrity and authenticity. A MAC ensures the transmitted message originated with the stated sender and was not modified during transmission, either accidentally or intentionally. A MAC is sometimes referred to as a tag because of the way it is added to the message it is verifying.

Using a MAC for message verification

Symmetric key cryptographic techniques are used to generate MACs for individual messages. The process requires a standard MAC algorithm that takes two inputs: the original message and a secret key known only to the message originator and its intended recipient. The following figure provides an overview of how a sender generates a MAC and how it is verified by the receiver.

What is message authentication code (MAC)? | Definition from TechTarget (2)

MAC-based message verification requires both the sender and receiver to follow specific steps to ensure the message's credibility:

  1. The sender and receiver share a secret symmetric key.
  2. The sender runs a standard algorithm to create the MAC. As input, the algorithm takes the original message and the secret key.
  3. The algorithm combines the message and secret key and, from this content, generates a fixed-length checksum that is used to create the MAC.
  4. The sender appends the MAC to the message and transmits them both to the sender.
  5. When the sender receives the message and MAC, it runs the MAC algorithm using the transmitted message and shared secret key as input.
  6. The algorithm combines the message and secret key and, from this content, generates a fixed-length checksum that is used to create its own MAC.
  7. The receiver compares the sender's MAC against its own MAC. If they match, the receiver accepts the message. If the two MACs do not match, the receiver rejects the message.

When the two MACs match, the receiver knows the message came from the legitimate sender and was not altered when transmitted between the sender and the receiver. If the sender and receiver are not using the same secret key or if the message content is different between the sender and receiver, the MAC values will not match and the receiver rejects the message.

Although a MAC ensures authenticity and integrity, it does not protect the message data itself. That is not the purpose of a MAC. For data protection, the message needs to be encrypted in a separate process. In addition, a MAC does not offer nonrepudiation capabilities like a digital signature, which provides a record of a document's origin. With a MAC, there is no way to prove who created the original message.

What is message authentication code (MAC)? | Definition from TechTarget (3)

MAC algorithms

MAC generation requires a general-purpose algorithm that can securely generate the cryptographic checksum needed to create the MAC. There are multiple algorithms available for MAC creation; however, the National Institute of Standards and Technology (NIST) has approved only the following three algorithms:

  • Keyed-Hash-based Message Authentication Code. HMAC is a cryptographic authentication technique that uses a secret key in conjunction with a hash function approved by the Federal Information Processing Standards (FIPS). Because different hash functions can be used, there are multiple implementations of HMAC, such as HMAC-SHA256 and HMAC-SHA3-256. Multiple communication and transfer protocols use HMAC, including Hypertext Transfer Protocol Secure (HTTPS), File Transfer Protocol Secure (FTPS) and Secure File Transfer Protocol (SFTP).
  • Keccak Message Authentication Code. A keyed hash function based on Keccak, KMAC is a cryptographic hash function that can also be used for authentication, encryption and pseudo-random number generation. There are two variants of Keccak, KMAC128 and KMAC256. Keccak is specified in the FIPS 202, SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions.
  • CMAC Mode for Authentication. The cipher-based message authentication code (CMAC) standard defines a block cipher-based MAC algorithm for ensuring authenticity and integrity. According to NIST, CMAC can be considered a mode of operation of the block cipher, providing an "algorithm for the cryptographic transformation of data that features a symmetric key block cipher."

NIST documentation also states that an approved MAC algorithm is expected to support the following property: "It must be computationally infeasible to determine the (as yet unseen) MAC of a message without knowledge of the key, even if one has already seen the results of using that key to compute the MAC's of other (different) messages."

NIST also provides testing requirements and validation lists for the approved algorithms through its Cryptographic Algorithm Validation Program.

Explore how MAC and HMAC use hash function encryption to authenticate messages and the differences between symmetric vs. asymmetric encryption algorithms.

This was last updated in August 2023

Continue Reading About message authentication code (MAC)

  • Fundamental strategies for REST API authentication
  • Cryptography basics: Symmetric key encryption algorithms
  • State of data privacy laws in 2023
  • How AI might change the data protection space
  • Top IT security frameworks and standards explained

Related Terms

What is cloud detection and response (CDR)?
Cloud computing requires a security approach that is different than traditional protections. Where does cloud detection and ...Seecompletedefinition
What is dynamic application security testing (DAST)?
Dynamic application security testing (DAST) is the process of analyzing a web application in runtime to identify security ...Seecompletedefinition
What is static application security testing (SAST)?
Static application security testing (SAST) is the process of analyzing and testing application source code for security ...Seecompletedefinition

Dig Deeper on Application and platform security

  • What is cryptography?By: KathleenRichards
  • asymmetric cryptographyBy: KateBrush
  • one-time passwordBy: KathleenRichards
  • Hash-based Message Authentication Code (HMAC)By: RahulAwati
What is message authentication code (MAC)? | Definition from TechTarget (2024)
Top Articles
ICICI Bank
cryptographic erasure, cryptographic erasure on SSD, SSD cryptographic erasure
Obituary Times Herald Record
Yanina Molina Tv
We at yo momma house train Full video
Naviance Hpisd
Select Truck Greensboro
Kbj66.com - kbj66.com|Asian *** |... ▷ Traffic, Ranking, Analytics [2023] | HypeStat
Book a Cruise | Search Cruise Holidays | P&O Cruises
Flanagan-Watts Funeral Home Obituaries
Nexus 5Gang praktische Erfahrungen
Do You Need Planning Permission to Change a Staircase?
Kwik Kar Guymon Ok
Devotion Showtimes Near Gtc Gateway Cinemas
Carbs in Nalley Tartar Sauce
Ltlv Las Vegas
Craigslist Farm Livestock For Sale
Senioren-Zentrum Trier - Hildegard von Bingen
Ups Drop Off Newton Ks
Regal Movie Listings
Devil May Cry 3: Dante's Awakening walkthrough/SM04
Psat Scores Hillsborough County
Insidekp.kp.org Myhr Portal
Vip Market Vetsource
Who Is The Blonde In The Cable Dahmer Commercial
Brake Masters 228
Philip Markoff - Parents, Death & Facts
Ezstub Cross Country
Shiftselect Carolinas
Tokyo Spa Memphis Reviews
Bbc Numberblocks
Txfb-Ins.com Online Payments
Pennsylvania Apartments For Rent Craigslist
Dirtyone 2006
How do i get all ark skins on PS4?
Chicagoland Bodyrub
Uhsbhlearn.com
Le guide de l'usage des accents en français
Mangmirror
Odawa Hypixel
Yellow Sun Of Ecuador by The Classics
Saberhealth Time Track
Mythical Horses (Tier 10) - BDFoundry
Ups Saturday Pickup Near Me
Facebook Levels Fyi
Mangadex.oeg
Chipotle Digital Kitchen Briggs Chaney
High Temp Yesterday Near Me
Craigslist Arlington Tx Pets
2021 GMC Sierra 2500HD AT4 4x4Crew diesel for sale - Kernersville, NC - craigslist
Latest Posts
Article information

Author: Laurine Ryan

Last Updated:

Views: 6062

Rating: 4.7 / 5 (57 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Laurine Ryan

Birthday: 1994-12-23

Address: Suite 751 871 Lissette Throughway, West Kittie, NH 41603

Phone: +2366831109631

Job: Sales Producer

Hobby: Creative writing, Motor sports, Do it yourself, Skateboarding, Coffee roasting, Calligraphy, Stand-up comedy

Introduction: My name is Laurine Ryan, I am a adorable, fair, graceful, spotless, gorgeous, homely, cooperative person who loves writing and wants to share my knowledge and understanding with you.