~/tools/hash-generator
Hash Generator
Generate MD5, SHA-1, SHA-256, SHA-384, SHA-512 hashes from text or any file. HMAC support included. Runs entirely in your browser, zero server calls.
What is a Cryptographic Hash Function?
A cryptographic hash function is a deterministic algorithm that maps input data of any size to a fixed-size output called a hash, digest, or checksum. The same input always produces the same output, but even a single-character change produces a completely different hash — a property known as the avalanche effect.
A good hash function is practically irreversible (preimage resistant), collision resistant (it is computationally infeasible to find two different inputs that produce the same hash), and fast to compute. These properties make hash functions the foundation of data integrity verification, digital signatures, password storage, and many cryptographic protocols.
Algorithm Reference
All five algorithms are computed simultaneously so you can compare outputs side by side. MD5 and SHA-1 are considered cryptographically broken for security purposes but remain widely used for non-security checksums and legacy compatibility.
What is HMAC?
HMAC (Hash-based Message Authentication Code) combines a cryptographic hash function with a secret key to produce a message authentication code. Unlike a plain hash, an HMAC can only be verified by someone who knows the secret key — making it tamper-evident and authenticated.
// HMAC construction
HMAC(K, m) = H((K' XOR opad) || H((K' XOR ipad) || m))K' = key padded or hashed to the block size. ipad = 0x36 repeated. opad = 0x5c repeated. All five algorithms including HMAC-MD5 are fully supported in this tool.
Common Use Cases
File Integrity Verification
Generate a checksum for a file before distribution so recipients can confirm the file was not corrupted or tampered with during download.
API Request Signing
Sign API requests with HMAC-SHA-256 using a shared secret so the server can verify the request originated from an authorised client.
Password Storage
Modern systems combine hashing with salting and iteration (bcrypt, Argon2). SHA-256/512 is used as the internal primitive inside these schemes.
Digital Signatures
RSA, ECDSA, and EdDSA sign the hash of a document rather than the document itself, making signatures compact regardless of input size.
Data Deduplication
Content-addressable storage systems (Git, IPFS, Docker layers) use hashes as unique identifiers to detect duplicate data and avoid redundant storage.
Cache & ETag Headers
HTTP ETags often contain a hash of the response body so browsers and CDNs can reuse cached responses without re-downloading unchanged content.