Skip to content
hashgen

About

hashgen was created and is maintained by the YouTube channel The Seasoned Programmer. Questions or suggestions? Email info@the-seasoned-programmer.com.

Every tool on this site runs in your browser. Your text, files and keys are never sent to a server. The hashes come from the audited, open-source noble-hashes library, because browsers' built-in Web Crypto API only offers SHA-1 and SHA-2.

What hashes are used for

Which algorithm should I use?

How HMAC works

A plain hash can be recomputed by anyone, so it can't prove who sent a message. HMAC (RFC 2104) mixes a secret key into the hash in two passes: H((K ⊕ opad) ‖ H((K ⊕ ipad) ‖ message)). Only someone who knows the key can make the right code, and the two-pass design avoids the length-extension attacks that a simple H(key ‖ message) suffers from. Webhooks from GitHub, Stripe, Slack and Shopify, AWS request signing and JWTs with HS256 all use HMAC.

When you check an HMAC in your own code, compare it with a constant-time comparison such as crypto.timingSafeEqual or hmac.compare_digest, not ==.

Hashes are not for passwords

Fast hashes like SHA-256 are the wrong tool for storing passwords: a graphics card can try billions of guesses a second. Use a password hash that is deliberately slow and salted, such as Argon2id, scrypt, bcrypt or PBKDF2 with a high iteration count.

Standards