Máy phát điện HMAC
Tạo mã xác thực tin nhắn có khóa băm
Use these tools directly in Chrome
Install the DailyDevTools extension — access all tools from your browser toolbar
What is HMAC Generator?
HMAC (Hash-based Message Authentication Code) provides message integrity and authenticity by combining a cryptographic hash function with a secret key. HMACs are used to sign API requests (AWS Signature, Stripe webhooks), verify webhook payloads, and authenticate JWT tokens. DailyDevTools' HMAC Generator computes HMAC-SHA256, HMAC-SHA512, HMAC-SHA1, and HMAC-MD5 using the Web Crypto API.
How to use HMAC Generator
- 1Enter the message you want to authenticate in the Message field
- 2Enter your secret key in the Key field — this is the shared secret between sender and receiver
- 3Select the hash algorithm: HMAC-SHA256 (recommended), SHA512, SHA1, or MD5
- 4The HMAC signature is generated instantly and displayed in both hex and Base64 formats
Frequently asked questions
What makes HMAC more secure than a plain hash?
A plain hash can be forged — anyone can compute the hash of any message. An HMAC requires knowing the secret key to produce a valid authentication code. Without the key, you cannot compute or verify the HMAC.
Which algorithm should I use for HMAC?
Use HMAC-SHA256 as the default — it is the industry standard used by AWS, Stripe, GitHub webhooks, and most modern APIs. HMAC-SHA512 provides stronger security at a small performance cost. Avoid HMAC-MD5 and HMAC-SHA1 for new systems.
How do I verify an incoming webhook signature with HMAC?
Compute the HMAC of the raw request body using your shared secret. Compare it byte-by-byte (using a timing-safe comparison) against the signature provided in the webhook header. If they match, the payload is authentic.
Comments
Bạn cũng có thể thích
Khám phá các công cụ dành cho nhà phát triển phổ biến khác