A message authentication code (MAC) is a short value calculated from a message and a secret key shared by sender and receiver. The sender attaches the MAC to the message; the receiver recalculates it with the same key and accepts the message only if the two values match. A correct MAC shows that the message came from someone holding the key and was not altered in transit. Unlike a digital signature, a MAC uses symmetric keys, so it cannot prove to a third party which of the two parties created it.
Common constructions include HMAC, built on a cryptographic hash function, and CMAC, built on a block cipher such as AES. In payments, MACs protect card authorisation messages between terminals, acquirers and issuers, interbank instructions and key exchanges, with keys held in hardware security modules. In card dispute vocabulary, MAC can also mean a merchant advice code, an unrelated term.
Ref 1300000391