{
  "slug": "message-authentication-code",
  "term": "Message authentication code (MAC)",
  "aliases": [
    "MAC",
    "Authentication tag"
  ],
  "definition": "A message authentication code (MAC) is a keyed cryptographic tag used to check the integrity and authenticity of covered data.",
  "note": "The verifier checks a received tag using the required key and algorithm. MAC also names the mechanism that produces the tag; HMAC is one hash-based construction. Unlike an unkeyed checksum, verification depends on a secret shared with authorized tag producers. [nist-mac] [rfc2104]\n\nAuthentication applies to the selected input bytes, not every claim surrounding them. A storage protocol must bind the relevant record identity and decide which version it accepts. Hesela's examples distinguish altered bytes, unbound fields, old records and ambiguous field boundaries. They are synthetic demonstrations, not storage-device measurements. [hesela-context]",
  "status": "shipping",
  "advantages": [],
  "limitations": [
    {
      "text": "A MAC does not encrypt data, recover damaged bytes or by itself prove that a returned record is the latest committed version.",
      "citationIds": [
        "rfc2104",
        "hesela-context"
      ]
    },
    {
      "text": "Shared-key authentication does not distinguish which holder of the key generated a valid tag and does not provide non-repudiation.",
      "citationIds": [
        "nist-mac"
      ]
    }
  ],
  "related": [
    "hmac",
    "checksum",
    "cryptographic-hash",
    "authenticated-encryption",
    "hash-domain-separation",
    "replay-attack"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "citations": [
    {
      "id": "nist-mac",
      "title": "NIST CSRC glossary: message authentication code, tag/mechanism definitions and non-repudiation boundary",
      "url": "https://csrc.nist.gov/glossary/term/message_authentication_code",
      "accessed": "2026-10-22"
    },
    {
      "id": "rfc2104",
      "title": "RFC 2104: shared-key message authentication and HMAC construction, sections 1-2",
      "url": "https://www.rfc-editor.org/rfc/rfc2104.html",
      "accessed": "2026-10-22"
    },
    {
      "id": "hesela-context",
      "title": "Hesela: HMAC context, freshness and field-encoding examples",
      "url": "https://hesela.com/analyses/checksums-identity-and-lost-writes/#hmac-context",
      "accessed": "2026-10-22"
    }
  ],
  "updated": "2026-10-22",
  "provenance": [
    "MAC is used in the cryptographic sense, not Media Access Control or mandatory access control. No algorithm approval or key-management claim is made."
  ]
}
