devtools.codes

Is MD5 still secure to use?

Your tool input is processed locally in your browser and is not intentionally uploaded to our servers. Advertising and analytics providers may still process normal page, device, cookie and network information.

MD5 is cryptographically broken, and has been for a long time: practical collision attacks, where two different inputs produce the same hash, have been demonstrated since 2004 and have only gotten cheaper since. That single fact rules it out for anything where an attacker could benefit from crafting a second input with a matching hash — password storage, digital signatures, certificate fingerprints, or any check meant to prove a file has not been tampered with by someone motivated to tamper with it.

The reason this keeps being confusing is that MD5 is not broken for every property a hash function has, only for collision resistance. It is still extremely fast, it still produces a consistent fixed-length output, and it is still perfectly good at detecting *accidental* corruption — a file that got truncated in transfer, a download that didn't complete, two versions of a document that differ by a single character. None of those scenarios involve an adversary deliberately constructing a matching input, so the broken property never comes into play.

That distinction is why MD5 checksums still appear on download pages for software and why some tools still use it internally for non-adversarial deduplication or cache keys. It is a reasonable choice there precisely because nobody is trying to defeat it. It is a dangerous choice anywhere a malicious party could supply or influence the input.

For anything security-relevant, SHA-256 is the practical default today: fast enough for almost any purpose, with no known practical collision attack, and supported everywhere MD5 is. For password storage specifically, neither MD5 nor plain SHA-256 is the right tool regardless of collision resistance, because both are designed to be fast, and fast is the wrong property for hashing something an attacker will try to brute-force — a dedicated password hashing function that is deliberately slow is what that case actually needs.

The short version: ask whether anyone has a reason to want a specific collision, not just whether the file matches. If the answer is no, MD5 for accidental-corruption checks is fine. If the answer is yes, or if the use is anything security-adjacent, move to SHA-256 or a purpose-built function rather than defaulting to whatever hash a tutorial happened to use.

More on is MD5 still secure to use?

Can MD5 still be used to check a downloaded file hasn't been corrupted?

Yes, for accidental corruption — a truncated download, a transfer error, a byte flipped by a faulty connection. MD5's collision weakness only matters when someone deliberately crafts a second file to produce the same hash, which is irrelevant to detecting random transmission errors. It remains fast and reliable for that specific, non-adversarial purpose.

Why is MD5 unsafe for passwords even though collisions seem unrelated to password cracking?

Password hashing has a different requirement entirely: it needs to be slow, so that guessing many candidate passwords is expensive for an attacker. MD5 is deliberately fast, which is exactly wrong for this purpose, independent of its collision weakness. A dedicated slow hashing function designed for passwords is the correct tool, not a faster general-purpose hash like SHA-256 either.

What should I replace MD5 with for general security purposes?

SHA-256 for most cases — file integrity against a motivated adversary, fingerprinting, general hashing where speed is wanted but security still matters. It has no known practical collision attack at this scale and is supported by essentially every language and platform that already supports MD5, so the substitution is usually a one-line change.

Is SHA-1 a safe alternative to MD5?

No. SHA-1 is also broken for collision resistance — a practical collision was demonstrated in 2017 — and is being phased out of the same uses MD5 already lost. Move to SHA-256 or SHA-3 rather than treating SHA-1 as a safe intermediate step; it inherited the same category of weakness, just discovered later.

The tool behind this, and related guides