Skip to content
PithLab

↑↓ to move · Enter to open · Esc to close

HMAC Generator API

Compute an HMAC (SHA-1, SHA-256, SHA-384 or SHA-512) of a message with a secret key, e.g. to sign or check webhook payloads.

POST /api/v1/tools/hmac-generatorMCP hmac_generatorSecurity & Privacy

Generate HMAC-SHA256, HMAC-SHA512, HMAC-SHA384 or HMAC-SHA1 signatures with a text, hex or Base64 key. Output as hex or Base64, computed in your browser.

Input

Send these as a JSON object. Unknown fields are rejected.

message
The message to authenticate, e.g. a webhook body. (string, required)
key
The secret key. (string, up to 10000 characters, required)
algorithm
Hash function. (string, one of SHA-1, SHA-256, SHA-384, SHA-512, default "SHA-256")
keyFormat
How the key is written: text (UTF-8), hex or base64. (string, one of text, hex, base64, default "text")
messageFormat
How the message is written: text (UTF-8), hex or base64. (string, one of text, hex, base64, default "text")
outputFormat
Encoding of the result. (string, one of hex, base64, default "hex")
curl https://pithlab.com/api/v1/tools/hmac-generator \n  -H "Authorization: Bearer $PITHLAB_KEY" \n  -H "Content-Type: application/json" \n  -d '{"message":"{\"event\":\"payment.succeeded\",\"id\":\"evt_123\"}","key":"whsec_test_secret","algorithm":"SHA-256"}'
Example response
{
  "ok": true,
  "result": {
    "hmac": "ca5a82e97850f2e4aaee54a1ff855afba6539309d597b6e94e8784ba789bb07a",
    "algorithm": "SHA-256"
  }
}