DEV Community

Forge
Forge

Posted on

Hash Generator Guide: SHA, MD5, and Cryptographic Hashing

Hash Generator Guide: SHA, MD5, and Cryptographic Hashing

What Is a Hash Function?

A hash function takes arbitrary input and produces a fixed-size output (the hash or digest). Cryptographic hash functions are one-way — you cannot reverse a hash to get the original input. The same input always produces the same hash, but even a tiny change in the input produces a completely different hash (the avalanche effect).

Common Hash Algorithms

  • MD5 — 128-bit hash. Fast but cryptographically broken. Do not use for security.
  • SHA-1 — 160-bit hash. Also broken for security. Deprecated since 2017.
  • SHA-256 — 256-bit hash from the SHA-2 family. Industry standard, used in TLS, Bitcoin, and Git.
  • SHA-512 — 512-bit hash. Stronger but slower. Used in high-security applications.
  • SHA-3 — newest NIST standard. Different internal structure than SHA-2, resistant to length extension attacks.

When to Use Hashing

Hashing is essential for password storage (use bcrypt or Argon2, not plain SHA), file integrity verification (checksums), deduplication, commit identifiers (Git), data structures (hash tables, Bloom filters), and digital signatures. Never use a broken algorithm like MD5 or SHA-1 for security-critical applications.

Hashing vs Encryption

Encryption is two-way — you can decrypt encrypted data with the right key. Hashing is one-way — you cannot recover the original input from a hash. Use encryption when you need to retrieve the original data; use hashing when you only need to verify data integrity or compare values without storing the original.

Try Our Hash Generator

Generate MD5, SHA-1, SHA-256, and SHA-512 hashes instantly with our Hash Generator. All hashing runs in your browser using the Web Crypto API — your input never leaves your device.


Originally published at devtools.systems

Top comments (0)