Security

Two Linux services share a secret key. The receiving service must confirm that each webhook payload was not altered in transit and was produced by the holder of the key. Which approach meets this requirement?

Show the answer

Correct answerD. Compute HMAC-SHA256 over the payload with the shared key and compare it to the received tag

HMAC-SHA256 mixes the secret key into the hash in a keyed construction, so only a key holder can produce a valid tag. A plain SHA-256 digest needs no key, so an attacker can alter the payload and recompute it. Simple key-plus-message hashing is not a proper HMAC.