MAC
Message authentication code
A short tag computed from a message and a secret key, which the receiver recomputes to detect any change and to confirm that a holder of the key sent it; HMAC, CMAC and the tags of AEAD modes are MACs. Compare tags in constant time, and add a counter or timestamp, because a MAC alone does not stop replay.
Covered in
Choose cryptographic algorithms and parameters by job
A sourced quick reference for October 2026: which algorithm and parameters to use for encryption, hashing, passwords, MACs, signatures, key agreement, key derivation, randomness and TLS, the matching APIs in Node.js, Python, Java, Go and .NET, and where post-quantum migration stands.
Padding oracle attacks
Use a byte-level CBC example to see how a tiny validity signal becomes plaintext information, then design verification that checks more than the error message.
Practice: Insecure randomness lab: Generate unguessable API keys