Use FreeProKit’s HMAC Generator to calculate HMAC-SHA-256, HMAC-SHA-384, or HMAC-SHA-512 from a secret and message locally in your browser. It is useful for reproducing API signatures, debugging webhook authentication, checking test vectors, or learning how keyed message authentication differs from an ordinary hash. HMAC authenticates data but does not encrypt it, and a matching value depends on using the exact same secret, message bytes, algorithm, and output representation as the system you are testing.
What Is HMAC?
HMAC stands for Hash-based Message Authentication Code. It combines a cryptographic hash function with a secret key to produce an authentication tag for a message.
Unlike a plain hash, HMAC is keyed. Two parties that share the same secret can calculate the expected tag for the same message and detect whether the authenticated data changed.
Supported HMAC Algorithms
FreeProKit explicitly supports:
- HMAC-SHA-256
- HMAC-SHA-384
- HMAC-SHA-512
The public page confirms that the tool uses a secret and message locally in the browser. It does not publish exact key/text encoding options, output encoding, or tag-truncation controls in the crawlable page, so use the live result panel as the authority for those details.
How to Generate an HMAC
- Enter or paste the secret requested by the live tool.
- Enter the exact message that should be authenticated.
- Choose HMAC-SHA-256, HMAC-SHA-384, or HMAC-SHA-512.
- Run the generator and review the result.
- Before comparing it with another system, confirm that both sides use the same secret, message bytes, algorithm, character encoding, and output representation.
HMAC vs. SHA-256 Hash
A normal SHA-256 hash uses only the message. Anyone who has the same message can calculate the same digest.
SHA-256(message)
HMAC-SHA-256 uses a secret key as part of the standardized HMAC construction.
HMAC-SHA-256(secret, message)
If you only need an ordinary digest without a secret, use the SHA-256 Hash Generator.
HMAC Does Not Encrypt the Message
HMAC provides authentication and integrity, not confidentiality. The original message can remain readable while the HMAC value is transmitted beside it.
If you need to hide data, use an appropriate encryption or authenticated-encryption design. HMAC is not reversible encryption and does not conceal sensitive content.
Which HMAC Algorithm Should You Use?
Follow the protocol you are integrating with. If a webhook specification says HMAC-SHA-256, use HMAC-SHA-256. SHA-384 and SHA-512 produce different values and cannot be substituted just because they are in the same SHA-2 family.
For new cryptographic applications, SHA-2 algorithms remain widely supported, and NIST encourages SHA-256 at a minimum for new hash-function applications requiring interoperability.
HMAC Output Sizes
HMAC-SHA-256: 256 bits / 32 bytes for the full authentication tag.
HMAC-SHA-384: 384 bits / 48 bytes for the full authentication tag.
HMAC-SHA-512: 512 bits / 64 bytes for the full authentication tag.
Some protocols use a truncated tag, but that must follow the protocol’s rules. FreeProKit’s public page does not claim a tag-truncation option.
Why Your HMAC May Not Match
An HMAC mismatch usually means the two systems authenticated different bytes or represented the result differently.
- Extra or missing spaces
- A final newline
- LF vs. CRLF line endings
- Changed JSON whitespace or property order
- A different timestamp, path, HTTP method, or query string
- Wrong secret or wrong HMAC algorithm
- Different character encoding
- Hexadecimal on one side and Base64 on the other
Preserve the Exact Message Bytes
If a service signs the raw webhook body, verify the raw body. Parsing JSON and serializing it again can change the bytes even when the data means the same thing.
The same rule applies to canonical API-signing strings: method, path, timestamp, query parameters, separators, and line breaks must match the protocol exactly.
Hex vs. Base64 HMAC Values
The HMAC operation produces bytes. Applications commonly turn those bytes into hexadecimal or Base64 text for transport.
A hex string and Base64 string can therefore represent the same underlying HMAC bytes while looking completely different. Check the encoding required by the API or webhook provider before deciding that two results disagree.
How to Verify HMAC Securely in Production
Production code should recompute the expected HMAC from the trusted secret and exact message, then compare the expected and received tags using the timing-safe comparison facility provided by the language, framework, or cryptographic library.
Also enforce the rest of the protocol: timestamps, replay windows, key identifiers, canonicalization rules, and any other authenticated fields.
Protect the HMAC Secret
Use a high-entropy secret generated for the application or protocol. Keep it out of source control, logs, screenshots, and public documentation. Store production secrets with your platform’s secret-management or key-management facilities and rotate them according to the system’s policy.
Human passwords and cryptographic keys have different design goals. Do not assume that a memorable password is automatically a good production HMAC key.
HMAC vs. Digital Signatures
HMAC uses a shared secret. A party that can verify the HMAC also has the secret needed to create valid HMAC tags.
Public-key digital signatures work differently: a private key signs and a separate public key verifies. Use the mechanism specified by your protocol.
HMAC Is Not Password Hashing
HMAC is designed for authenticating messages with a shared key. Password storage normally uses a dedicated password-hashing or password-based key-derivation function with a salt and work factor.
Related Security and Developer Tools
For an unkeyed SHA-256 digest, use SHA-256 Hash Generator.
For SHA-384 or SHA-512 text hashing without an HMAC secret, use SHA-1 / SHA-512 Hash Generator.
For authentication-token inspection, use JWT Decoder, which decodes the header and payload without claiming to verify the token signature.
Privacy and Processing
FreeProKit states that HMAC-SHA-256, HMAC-SHA-384, and HMAC-SHA-512 values are generated from the secret and message locally. The tool requires JavaScript and follows FreeProKit’s browser-processing model.
Even with local processing, prefer test credentials when possible. Production secrets should not be copied into screenshots, support tickets, public examples, or shared environments.
Limitations
- The public page does not publish exact text/key encoding controls.
- The crawlable page does not state whether the result is hex, Base64, or another text representation.
- The tool does not claim tag truncation or production-grade HMAC verification.
- HMAC does not encrypt or hide the message.
- A generated tag cannot confirm that your API canonicalization, replay protection, or key management is correct.
- Use established cryptographic libraries for production verification.
Frequently Asked Questions
What does FreeProKit’s HMAC Generator do?
It generates HMAC-SHA-256, HMAC-SHA-384, or HMAC-SHA-512 from a secret and message locally in the browser. The tool is useful for testing, webhook or API troubleshooting, and learning how keyed message authentication works. The public page does not publish exact output encoding or tag-truncation options, so the live result panel is the authority for those details.
What is the difference between HMAC and SHA-256?
SHA-256 by itself is an unkeyed hash: the same message always produces the same digest for anyone. HMAC-SHA-256 combines SHA-256 with a secret key using the standardized HMAC construction. The secret lets parties that share it authenticate the message rather than merely calculate a public checksum.
Does HMAC encrypt or hide my message?
No. HMAC provides message authentication and integrity; it does not provide confidentiality. The message can remain readable while the HMAC is sent alongside it. If you need to hide data, use an appropriate encryption or authenticated-encryption scheme in addition to whatever authentication the protocol requires.
Why does my HMAC not match the webhook or API signature?
Check the exact bytes first. Common causes include an extra newline, different line endings, changed JSON whitespace, a reserialized body, the wrong timestamp or request path, a different secret, the wrong HMAC algorithm, or comparing hex with Base64. Follow the provider’s canonicalization and encoding rules exactly.
Which should I use: HMAC-SHA-256, SHA-384, or SHA-512?
Use the algorithm required by the protocol you are integrating with. Different HMAC algorithms are not interchangeable. For a new design, choose an established SHA-2-based construction that matches your interoperability and security requirements; FreeProKit supports SHA-256, SHA-384, and SHA-512.
How should I verify an HMAC in production code?
Recompute the expected HMAC from the trusted secret and exact authenticated message, then compare it with the received tag using the timing-safe comparison mechanism provided by your platform or crypto library. Also enforce protocol-specific timestamp, replay, key-ID, and canonicalization rules rather than checking only the MAC string.
Is an HMAC the same as a digital signature?
No. HMAC uses a shared secret, so any party that can verify the HMAC can generally generate one too. Public-key digital signatures use a private signing key and a separate public verification key. Choose the mechanism specified by the protocol instead of treating them as interchangeable.
Is it safe to paste a real API secret into a browser HMAC tool?
FreeProKit states that this tool generates HMAC values locally in the browser, which avoids a normal server-processing step. Even so, production secrets should be handled conservatively. Prefer test credentials for debugging and avoid exposing live secrets through screenshots, copied examples, shared computers, browser extensions, or support channels.
