Comparison Algorithm choice

Hash Algorithm Comparison Table

Pick algorithms by task, not by name recognition. Fast checksums, cryptographic hashes, MACs, and password KDFs solve different problems.

Algorithm Output Status and Caveat Password File Integrity Authentication Common Uses Alternative
MD5128 bitsBroken for collision resistanceNoLegacy onlyNoLegacy checksumsSHA-256
SHA-1160 bitsBroken for collision resistanceNoLegacy onlyNoLegacy identifiersSHA-256
SHA-256256 bitsStrong general-purpose hash when used correctlyNoYesWith HMACFile integrity and signaturesSHA-512 or BLAKE3 when useful
SHA-512512 bitsStrong general-purpose hash when used correctlyNoYesWith HMACHigh-security integritySHA-256 for smaller output
SHA3-256256 bitsStrong SHA-3 hash when used correctlyNoYesWith KMAC/HMACSHA-3 ecosystemsSHA-256 for compatibility
Keccak-256256 bitsStrong hash, but not interchangeable with SHA3-256NoEthereum-specificNoEthereum and Solidity workflowsSHA3-256 outside Ethereum
BLAKE3256 bits defaultModern hash with strong public analysisNoYesKeyed mode availableFast file hashingSHA-256 for broad compatibility
CRC3232 bitsNon-cryptographicNoAccidental errors onlyNoZIP and protocol checksumsSHA-256 for tamper resistance
HMAC-SHA256256 bitsStrong MAC when the key is secret and randomNoYesYesAPI and message authenticationKMAC in SHA-3 systems
bcryptEncoded stringPassword KDFYesNoNoPassword storageArgon2id for new systems
scryptVariablePassword KDFYesNoNoMemory-hard password hashingArgon2id
Argon2idVariablePassword KDFYesNoNoModern password storagebcrypt for compatibility