liveBook · Manning

Message authentication code

A message authentication code is a keyed cryptographic value generated from a message to verify its integrity and authenticity.

How 4 Manning books explain it

Hacking Cryptography

An authentication tag is a value generated from a message and authentication key that enables verification of message integrity and key-based authenticity.

How it is used
Authenticates API requests and recovery links by letting shared-secret holders verify message integrity and origin.
How deep it goes
Works through secret-prefix API implementation and a SHA-256 length-extension exploit, then contrasts suffix MACs and HMAC.
Examples
Uses password-reset URLs, a shared-secret bank transaction API, and a forged SHA-256 request with amount 424242.
What you can do after
Evaluate/understand unsafe hash-based MAC constructions and choose HMAC or authenticated encryption instead.

Read how Hacking Cryptography explains message authentication code →

Software Security for Developers

A message authentication code is a keyed value that enables verification of a message's integrity and origin.

How it is used
Protects messages and encrypted payloads against tampering while authenticating a party that holds the shared secret.
How deep it goes
Explains keyed verification, exchange steps, hash contrast, and unsafe key concatenation, but avoids mathematical proofs and protocol internals.
Examples
Uses warehouse refunds, modified files, TLS tampering, and authenticated headers with encrypted bodies as concrete examples.
What you can do after
Diagnose tampering and apply keyed integrity checks when designing service-to-service messages or protected payloads.

Read how Software Security for Developers explains message authentication code →

Real-World Cryptography

An authentication tag is the deterministic output of a keyed authentication function used to verify a message's integrity and authenticity.

How it is used
Protects message integrity and authenticity between parties sharing a secret key, including cookies and cleartext or encrypted communications.
How deep it goes
Explains keyed tags, forgery, tag length, replay, timing attacks, HMAC, and KMAC, while deferring formal proof details.
Examples
Uses stateless cookies, two-party messages, Rust HMAC code, replay counters, and constant-time comparison code.
What you can do after
Apply HMAC to authenticate messages and verify tags safely while accounting for replay, serialization, length, and timing risks.

Read how Real-World Cryptography explains message authentication code →

Secure APIs

An authentication tag is cryptographic output used to verify the integrity and authenticity of authenticated-encrypted data.

How it is used
Uses the authentication tag to validate encrypted data and protected additional data.
How deep it goes
Defines the tag and identifies protected JWE components, without deriving its cryptographic construction.
Examples
Uses JWE field layouts and a protected JOSE header to illustrate where the authentication tag appears.
What you can do after
Evaluate whether encrypted data and associated protected data retain their integrity.

Read how Secure APIs explains message authentication code →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.