Message Authentication Codes
MAC; Message integrity codes
A message authentication code (MAC) is a short fixed-length value which is used to authenticate a message. A MAC algorithm can roughly be viewed as a hash function that takes as input two functionally distinct values: a secret key and a message. The output of a MAC algorithm is a short string computed in such a way that it is infeasible to produce the correct output on a message without the knowledge of the key. Thus, the MAC value protects both the integrity and authenticity of a message by allowing the entity in possession of the secret key to detect any changes to the message content.
While MAC functions have conceptual similarities to keyed cryptographic hash functions, they have specific security requirements for authentication purposes that make them a distinct security tool. More precisely, an attacker who does not have access to the secret key and has not seen the MAC value for a specific message before should not be...