HMAC Generator
Generate Hash-based Message Authentication Codes (HMAC) using various algorithms.
HMAC Generation
SHA256
Understanding HMAC
A Hash-based Message Authentication Code (HMAC) is a specific type of message authentication code (MAC) involving a cryptographic hash function and a secret cryptographic key. As with any MAC, it may be used to simultaneously verify both the data integrity and the authenticity of a message.
HMAC can be used with any iterative cryptographic hash function, such as MD5, SHA-1, or SHA-2. The cryptographic strength of the HMAC depends upon the cryptographic strength of the underlying hash function, the size of the hash output, and the size and quality of the key.
How HMAC Works
HMAC works by combining a secret key with the message data, then hashing the result. This process is typically done in two passes:
- The secret key is padded to the block size of the hash function and XORed with an inner padding. The result is concatenated with the message and hashed.
- The secret key is padded to the block size of the hash function and XORed with an outer padding. The result is concatenated with the first hash output and hashed again.