How HMAC works
HMAC folds the shared secret into a cryptographic hash of the message in a specific two-pass construction. The result is a fixed-length hex digest that changes completely if even one byte of the message or the key changes. Crucially, you cannot forge a valid digest without knowing the secret, which is what makes it an authentication code rather than a plain checksum.