message-authentication-code-pattern

Installation
SKILL.md

Message Authentication Code (MAC) Security Pattern

This pattern encapsulates common considerations for using Message Authentication Codes (MAC) to ensure the integrity of messages and authenticate the identity of the provider.

What is a MAC?

A Message Authentication Code (MAC) is a tag computed from a message using a special hash function whose output depends on a secret cryptographic key. Generating a MAC requires:

  1. The message itself
  2. Possession of a secret key

Only parties possessing the agreed-upon secret key can generate and verify valid MACs.

Properties Provided

Appending a MAC to a message provides two properties:

  1. Data Integrity: Assurance that the received message is identical to the one used to calculate the MAC
  2. Data Origin Authentication: Assurance of the identity of the party that originated the message (i.e., they possess the secret key)
Related skills
Installs
6
GitHub Stars
4
First Seen
Feb 19, 2026