Message Authentication Code
1 min read
Pronunciation
[mes-ij aw-then-ti-key-shuhn kohd]
Analogy
Imagine you and a friend share a secret code word. When you send a message, you also write down a special number derived by mixing the message content with your secret code word. Your friend, knowing the same secret code word, can perform the same calculation on the received message. If their calculated number matches the one you sent, they know the message is genuinely from you and hasn't been changed.
Definition
A short piece of information (a tag) used to authenticate a message and ensure both its data integrity and authenticity. MACs are generated using a secret key shared between the sender and receiver.
Key Points Intro
MACs provide assurance that a message is authentic and unaltered.
Key Points
Verifies message integrity (that the message hasn't been tampered with).
Verifies message authenticity (that the message originated from a party possessing the shared secret key).
Requires a pre-shared secret key between communicating parties.
Different from digital signatures as it uses symmetric keys.
Example
In many secure communication protocols, after encrypting a message, a MAC is calculated for the ciphertext using a shared secret key. The recipient first verifies the MAC; if valid, they proceed to decrypt the message. This ensures that any tampering with the encrypted message during transit is detected.
Technical Deep Dive
A MAC algorithm takes two inputs: the message and a secret key, and produces a fixed-size tag. Common MAC algorithms include HMAC (Hash-based MAC) and CMAC (Cipher-based MAC). To verify a MAC, the receiver computes the MAC on the received message using the same secret key and algorithm, then compares this computed MAC with the received MAC tag. If they match, the message is considered authentic and its integrity is verified. MACs do not provide non-repudiation, as either party with the secret key could have generated the MAC.
Message Authentication Code - Related Articles
No related articles for this term.