Generatore HMAC

Esempi
—Algoritmo
—Bit di output
—Byte della chiave
—Tempo

Generatore HMAC

Questo è un generatore HMAC: mescola una chiave segreta con un hash così il tag prova integrità e autenticità. HMAC (RFC 2104) mixes a secret key with a hash. Identifiers HMAC, HMAC-SHA256, SHA-1, SHA-384, SHA-512, MD5, SHA-3, JWT, HS256, UTF-8, Hex, Base64 stay untranslated. Show Example: message The quick brown fox jumps over the lazy dog, key key. HMAC-SHA256 hex f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8, Base64 97yD9DBThCSxMpjmqm+xQ+9NWaFJRhdZl0edvC0aPNg=. HMAC-SHA1 de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9. Chip message / secret-key → 287a3bd8a4fc7731a94c722079055323644d8798bd291bf9878abc9b8fd4b1d0.

Come usarlo

  1. Paste the message or drop a file (max 10 MB). Empty keys are rejected.
  2. Key encoding UTF-8 / Hex / Base64. Message charset matches the Base64 tool.
  3. Default SHA-256. Panes always show Hex and Base64. Verify accepts both.
  4. SHA-384 / SHA-512 need https or localhost.

Algoritmi e dimensioni

HMAC-SHA256 (256 bits) is the usual choice for APIs, webhooks and JWT HS256. HMAC-SHA1 remains in TOTP. A plain hash is not HMAC.

Codice (come Mostra esempio)

Node.js: crypto.createHmac('sha256', 'key').update('The quick brown fox jumps over the lazy dog').digest('hex') → f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8.

Python: hmac.new(b'key', b'The quick brown fox jumps over the lazy dog', hashlib.sha256).hexdigest().

PHP: hash_hmac('sha256', 'The quick brown fox jumps over the lazy dog', 'key'). Chip message / secret-key: 287a3bd8a4fc7731a94c722079055323644d8798bd291bf9878abc9b8fd4b1d0.

Cosa significa l output

HMAC is not encryption. SHA-256 Hex is 64 digits. Base64 is the same bytes.

Domande frequenti

  • Hash vs HMAC? A hash checks integrity; HMAC also authenticates the key holder.
  • JWT? HS256 is HMAC-SHA256 over header and payload.
  • Hash tool? That page allows an empty key. This page requires a key and accepts files.

Strumenti correlati

Hash: MD5 & SHA Hash. JWT: JWT Decoder. CRC: CRC32.

Digest senza chiave? Hash Generator →