Cryptographic hash algorithm reference
A cryptographic hash function maps an arbitrary-length input to a fixed-length digest. A good hash is deterministic, fast to compute, and resistant to preimage, second-preimage and collision attacks. This reference lists the common families — MD5, SHA-1, SHA-2, SHA-3, BLAKE2 and BLAKE3 — with digest size, internal block size, and current security status so you can pick the right one.
How it works
Each algorithm processes the input in fixed-size blocks through a compression function or sponge. The output column shows the digest length in bits. “Security status” reflects the state of public cryptanalysis:
- Secure — no practical attacks; safe for signatures, integrity and commitments.
- Weak — theoretical or borderline-practical attacks; avoid for new designs.
- Broken — practical collisions demonstrated; never use for security.
A digest of n bits gives roughly n/2 bits of collision resistance because of the birthday bound, so SHA-256 offers about 128 bits of collision security.
Tips and notes
- For general integrity and signatures, default to SHA-256 or SHA-3-256.
- For high-throughput hashing, BLAKE3 is typically faster than SHA-2.
- Never use MD5 or SHA-1 where an adversary can choose inputs — both have demonstrated collisions (SHA-1 broken publicly in the 2017 SHAttered attack).
- Hash length alone does not equal security: a truncated secure hash can still be safe, while a long broken hash is not.