Explainer 4 min read

Hash Generator: What Are MD5, SHA-1, and SHA-256?

Understand cryptographic hash functions — what they do, the difference between MD5 and SHA-256, and practical uses.

hash generatormd5 sha256what is a hashcryptographic hash function

What Is a Cryptographic Hash?

A cryptographic hash function takes input of any length and produces a fixed-length output (the hash or digest). The same input always produces the same output. Any change to the input — even one character — produces a completely different output. It is computationally infeasible to reverse the hash back to the input.

Hash functions are one-way — you can hash a document to get its fingerprint, but cannot un-hash the fingerprint to get the document.

Hash Algorithm Comparison

AlgorithmOutput LengthStatusUse Case

|---|---|---|---|

MD5128 bits (32 hex chars)Broken for securityChecksums, non-security
SHA-1160 bits (40 hex chars)DeprecatedLegacy systems
SHA-256256 bits (64 hex chars)SecureCertificates, blockchain
SHA-512512 bits (128 hex chars)Very secureHigh-security applications
bcryptVariableSecure, slowPassword hashing

Why MD5 Is No Longer Secure

MD5 was broken in 2004 — researchers demonstrated collision attacks (two different inputs producing the same hash). For security purposes, MD5 should not be used. For non-security uses (checksums, caching, deduplication), MD5 is still acceptable.

Practical Uses of Hash Functions

File integrity verification: Software providers publish SHA-256 hashes of download files. You hash the downloaded file and compare — if it matches, the file was not tampered with.

Password storage: Databases never store plain passwords. They store hashes. When you log in, your entered password is hashed and compared to the stored hash.

Digital signatures: Documents are hashed, and the hash is signed. Verifying the signature confirms the document has not been altered.

Blockchain: Each block contains the hash of the previous block. Changing any block would change its hash and break the chain.

Deduplication: Cloud storage services hash files to detect duplicates without reading content.

Frequently asked questions

What is the difference between MD5 and SHA-256?

MD5 produces a 128-bit hash and has known cryptographic vulnerabilities — do not use it for security. SHA-256 produces a 256-bit hash and is cryptographically secure and widely used for digital signatures, certificates, and blockchain.

Can you reverse a hash to get the original data?

No — hash functions are designed to be one-way. There is no mathematical way to reverse a hash to get the input. What is possible is a brute-force dictionary attack for weak inputs like common passwords.

Try this tool on Lazyblink

Put this guide into practice with our free online tool — no signup required.

Open tool