DevToolBox免费
博客

HMAC 生成器

使用 SHA-256 或 SHA-1 生成 HMAC 签名。免费使用,无需注册。

𝕏 Twitterin LinkedIn

评价此工具

4.4 / 5 · 212 人评价

保持更新

获取每周开发技巧和新工具通知。

无垃圾邮件,随时退订。

Enjoy these free tools?

Buy Me a Coffee

How to Use

  1. Enter or paste the message to sign
  2. Enter the secret key
  3. Select the hash algorithm (SHA-256, SHA-1, or SHA-512)
  4. Copy the generated HMAC signature in hex or Base64

Common Use Cases

  • Verifying webhook signatures from payment providers
  • Signing API requests for authentication
  • Generating message authentication codes for secure communication
  • Testing HMAC implementations during development

Frequently Asked Questions

What is the difference between HMAC and a regular hash?
A regular hash (like SHA-256) only takes a message as input. HMAC also requires a secret key, so only parties who know the key can generate or verify the signature. This prevents tampering.
Which HMAC algorithm should I use?
HMAC-SHA256 is the most common and recommended choice. It offers strong security and is required by most modern APIs. Use SHA-1 only for legacy compatibility.
How do I verify a webhook signature with HMAC?
Compute the HMAC of the webhook payload using your secret key, then compare it to the signature in the webhook header. If they match, the webhook is authentic and untampered.