What it is
FIPS 198-1 specifies HMAC, a keyed-hash message authentication code. The sender and the receiver share a secret key. The sender mixes that key into the message with two fixed pad patterns, runs the hash twice, and appends the tag. The receiver repeats the calculation and accepts the message only when the tags match. A match tells you the bytes were not changed and that the sender knows the key.
HMAC is a pattern you fill in with a hash, such as SHA-256 or SHA-384. HMAC gives integrity and origin authentication for parties who share the key. It leaves the message readable. Every key holder can produce a valid tag, so the tag cannot show an outsider which holder sent it.
Who it applies to
Cybersecurity engineers choose HMAC or another authenticator, such as a block-cipher MAC or a signature, and record that choice in the cybersecurity concept. Basic-software engineers map the construction onto key slots and onto MAC-generate and MAC-verify jobs in the crypto stack. Application code calls those jobs and rejects the payload when the tag does not match.
Hardware engineers implement the two hash passes in an HSM or secure element so the key stays out of application RAM. Network engineers meet HMAC as the record authenticator in non-AEAD TLS 1.2 cipher suites and inside HKDF, which TLS 1.3 uses to derive keys. Update engineers meet it when a manifest is authenticated with a shared key.
What it covers
The standard defines the key block and the two hash passes. A key longer than the hash block is hashed, then padded with zeros out to one block. A shorter key is padded with zeros. The block is exclusive-ored with an inner pad (the byte 0x36 repeated) and with an outer pad (the byte 0x5c repeated). The outer hash output is the MAC, shortened from the left when the protocol uses a short tag.
| Choice | What you decide |
|---|---|
| Secret key | Who may create or check tags. Generate it with an approved random source and store it in a key store. |
| Hash | An approved SHA-2 or SHA-3 hash. FIPS 198-1 keys the hash; the hash standards define it. |
| Tag length | Full hash output, or a prefix long enough for how exposed the message is. |
| Accept rule | Recompute the tag and accept the payload only on a match. |
Key length, which hashes are fit for new work, and the effect of truncation are set with SP 800-107 and the hash standards.
How it fits with other documents
RFC 2104 describes the same pad-and-double-hash construction for Internet protocols. FIPS 198-1 is the federal form of that construction and points to approved hashes: SHA-2 in the FIPS 180 series and SHA-3 in FIPS 202.
SP 800-38B defines AES-CMAC, a block-cipher MAC that many secure-onboard-communication profiles use in place of HMAC. FIPS 186 signatures use a sender-only private key when an outsider must see who sent the data. AUTOSAR Classic and Adaptive crypto stacks offer HMAC as a MAC primitive next to those other mechanisms. TLS 1.2 uses HMAC on records in its non-AEAD cipher suites, and TLS 1.3 uses HMAC inside HKDF. ISO/SAE 21434 requires the cybersecurity concept to justify the authenticator.
In practice
Use SHA-256 or a longer SHA-2 or SHA-3 hash for new designs. Limit HMAC-SHA-1 to peers that still require it. Keep the key in an HSM or other secure key store that can run the hash. A key embedded in an ECU image is readable by anyone who has the image. Use separate keys for the MAC and for encryption.
Compare tags in constant time so timing does not leak how many leading bytes matched. On rollover, accept the old key only during the documented overlap, then delete it. A failed MAC is an authentication failure: drop the payload and log it. Where the channel also needs confidentiality, use an authenticated-encryption mode, or an encrypt-then-MAC order the concept defines key by key.