regula.tools
100% Client-SideGenerators

Cryptographic Hash & HMAC Generator

Compute SHA-256, SHA-512, SHA-384, SHA-1, and MD5 digests simultaneously in your browser using hardware-accelerated Web Crypto (`crypto.subtle.digest`) and pure TypeScript MD5. Toggle Hex (lowercase/uppercase) or Base64 encoding, sign payloads with an optional HMAC secret key, and verify expected checksums with zero server uploads.

Loading workspace...

#How to Use This Tool

1Type or paste any UTF-8 text into the input editor; all five digests update instantaneously.
2Choose your preferred output encoding: Hex (lowercase), Hex (UPPERCASE), or Base64.
3Optionally enter an HMAC Secret Key to compute keyed-hash message authentication codes (RFC 2104 / FIPS 198).
4Paste an expected checksum into the Hash Verifier field to automatically highlight matching algorithms.

#Mathematical Formula & Standards

A cryptographic hash function $H: \{0,1\}^* \to \{0,1\}^n$ deterministically maps arbitrary-length UTF-8 byte sequences to a fixed-size digest ($n = 128$ bits for MD5, $160$ for SHA-1, $256$ for SHA-256, $384$ for SHA-384, $512$ for SHA-512). Unlike reversible encoding (Base64) or symmetric encryption (AES), cryptographic hashing is strictly one-way: pre-image resistance makes recovering the input infeasible, and the avalanche effect flips roughly 50% of output bits from a single-bit input change. NIST FIPS 180-4 recommends SHA-256 or SHA-512 for integrity and collision resistance, while MD5 and SHA-1 are deprecated for security-critical signatures due to practical collision attacks.

#Edge Cases & Technical Considerations

Hashing vs. Encryption vs. Encoding

Encoding (Base64, URL percent-encoding) is reversible without a key. Encryption (AES, RSA) is reversible with a decryption key. Cryptographic hashing (SHA-256, SHA-512) is one-way by design—there is no "decrypt" operation for a SHA-256 digest.

MD5 & SHA-1 Collision Deprecation

Both MD5 (128-bit) and SHA-1 (160-bit) have documented collision vulnerabilities and must never be used for TLS certificates, code signing, or password storage. Keep them strictly for legacy checksum verification and use SHA-256 or SHA-512 for modern integrity checks.

UTF-8 Byte Normalization

Hashes are computed over exact UTF-8 byte sequences (`TextEncoder`). A trailing newline (`\n`) or different Unicode normalization form produces a completely different digest due to the avalanche effect.

#Frequently Asked Questions

Q:Can a SHA-256 or MD5 hash be reversed or decrypted?

No. Cryptographic hash functions are mathematically one-way. You cannot decrypt a digest back into the original text; verification works by hashing a candidate input and comparing digests.

Q:Why are MD5 and SHA-1 labeled as Legacy?

Practical collision attacks exist against both MD5 and SHA-1, meaning two different inputs can produce the same hash. Use SHA-256 or SHA-512 for security-sensitive integrity checks.

Q:Are my input strings or HMAC secret keys sent to a server?

Never. SHA-1, SHA-256, SHA-384, and SHA-512 run natively via your browser Web Crypto API (crypto.subtle), MD5 runs in local TypeScript, and HMAC secret keys are excluded from shared URLs.

Q:Should I use SHA-256 directly to store user passwords?

No. Fast digests like SHA-256 are vulnerable to GPU brute-force attacks on passwords. Production password storage requires slow, salted memory-hard key derivation functions such as Argon2id, bcrypt, or scrypt.

Have feedback or feature requests?

Help us improve this utility. Share suggestions, report edge cases, or request new features directly.

Send Feedback