Skip to content
cosmodev ~/tools/hmac-generator

HMAC 생성기

Encoders & Crypto

메시지와 시크릿으로 키 기반 해시 HMAC(SHA-1/256/384/512)을 생성합니다. Web Crypto를 통해 브라우저에서 완전히 동작하며, 정확한 입력을 담은 공유 링크를 제공합니다.

HMAC (SHA-256)
메시지와 시크릿을 입력하면 HMAC이 표시됩니다.

SubtleCrypto로 로컬에서 계산해요 - 메시지와 시크릿은 기기를 절대 떠나지 않아요. 보안 컨텍스트(https 또는 localhost)가 필요해요.

Send to AI
Write a Python `hmac.compare_digest` verifier for HMAC-SHA-256. Read the secret from an environment variable - never hardcode it. Test vector - message: ``, expected MAC (hex): ``.

(문서는 영어)

What it does

The HMACHMACA construction that combines a hash function with a secret key to prove a message is intact and came from someone holding the key. Generator computes a keyed-hash message authentication code (HMAC) for a message and a secret, using SHA-1, SHA-256, SHA-384, or SHA-512. HMAC is how services like Stripe and GitHub sign webhooks so you can verify a payload genuinely came from them. All hashinghashingA one-way function that maps data of any size to a fixed-length digest. Same input, same digest; any change, different digest; not reversible. uses the browser’s Web Crypto API - your message and secret never leave your device.

How to use it

  1. Enter the Message (the payload you want to sign).
  2. Enter the Secret (the shared signing key).
  3. Pick the Algorithm (SHA-256 is the modern default).
  4. Copy the resulting hex digest.

Examples

  • Verify a webhook: compute HMACHMACA construction that combines a hash function with a secret key to prove a message is intact and came from someone holding the key.-SHA-256 of the raw request body with your webhook secret, then compare (constant-time) to the X-Signature header.
  • Test vector (RFC 4231): key = 20 bytes of 0x0b, message = "Hi There", SHA-256 → b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7.

Good to know

  • Use SHA-256 or stronger for new systems; SHA-1 HMACHMACA construction that combines a hash function with a secret key to prove a message is intact and came from someone holding the key. is included for legacy compatibility only.
  • Compare digests in constant time server-side to avoid timing attacks.
  • Private: computation is 100% client-side via crypto.subtle - safe for real secrets.
  • Related tools: HashHashA one-way function that maps data of any size to a fixed-length digest. Same input, same digest; any change, different digest; not reversible. (SHA), JWTJWTA compact, URL-safe token that carries claims (like identity or expiry) between two parties, signed to prevent tampering.Learn more Decoder, Base64Base64An encoding representing binary data as 64 safe ASCII characters, so it survives transport through text-only channels. It encodes — it does not encrypt..
소스 코드14개 언어

100% 클라이언트 측 · 데이터는 브라우저 밖으로 나가지 않습니다. 도움이 되었나요? 팀원에게 공유해 보세요.