Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

Why Are MD5 and SHA-1 Insecure?

MD5 and SHA-1 are broken because attackers can construct two different inputs with the same hash. That collapses the guarantee signatures and certificates depend on.

Illustration for the cybersecurity term MD5 and SHA-1
Home / Blog / Cybersecurity Terms / Why Are MD5 and SHA-1 Insecure?
17 November 2026

Why Are MD5 and SHA-1 Insecure?

Why Are MD5 and SHA-1 Insecure?

A cryptographic hash function is supposed to make it infeasible to find two inputs producing the same output. MD5 lost that property in 2004 and SHA-1 lost it in 2017. Everything built on the assumption — certificate signatures, code signing, document integrity, file identity — stopped being sound at those points, and the long tail of systems still using them is what makes this more than a historical note.

Preimage resistance is a separate matter. Nobody can take an MD5 digest and recover the input that produced it, which is why some people still argue the algorithms are fine. That argument misunderstands the threat: collisions are enough.

What a Collision Buys an Attacker

A plain collision gives two meaningless blobs with the same digest, which sounds academic. A chosen-prefix collision is the dangerous version: the attacker picks two different meaningful beginnings and computes trailing blocks that make the full inputs hash identically. That turns into a forgery whenever something is signed by hashing it first.

Three incidents show exactly what that means in practice:

The cost curve only moves one way. What took a research cluster in 2017 is a cloud budget line today.

The Timeline of Withdrawal

DateEvent
2004Wang and Yu publish practical MD5 collisions
2008Rogue CA certificate demonstrated; CAs stop signing with MD5
2011NIST deprecates SHA-1 for digital signatures
2017SHAttered published; browsers stop trusting SHA-1 TLS certificates
2020Chosen-prefix SHA-1 collisions become affordable
2022NIST announces full SHA-1 phase-out across federal use by 31 December 2030

Where They Still Turn Up

Deprecation notices do not remove code. On internal assessments we regularly find MD5 or SHA-1 in places that matter:

What to Use Instead, and When the Old Ones Are Tolerable

For anything where an adversary benefits from two inputs matching — signatures, certificates, software distribution, integrity verification of untrusted content — use SHA-256, SHA-3, or BLAKE2. For password storage, neither is relevant: use a key derivation function such as Argon2id.

There are narrow cases where the older algorithms are not a vulnerability. HMAC-SHA1 is not broken by collision attacks, which is why TOTP codes still use it. Deduplication, cache keys, and change detection against non-adversarial data are fine. Digital forensics tools often record both MD5 and SHA-256 for compatibility with older case records.

Even in those cases, the practical argument for migration is auditability. Explaining to an assessor, an insurer, or a client why MD5 appears in your codebase costs more effort than replacing the call. Reviewing where deprecated algorithms persist is part of the cryptographic discovery we perform in our infrastructure and architecture review services, and it is also the groundwork for crypto agility.

FAQ – Frequently Asked Questions

Can MD5 Be Reversed?

No. MD5 discards information and has no key, so there is no mathematical way back. What attackers do instead is guess inputs, hash them, and compare, which works very well against short or common values such as passwords. The break in MD5 is about collisions, not reversal, and collisions are what undermine signatures.

Is It Safe to Use MD5 for File Checksums?

Only when nobody has an incentive to forge a match. Verifying that a backup copied correctly, or detecting accidental corruption, is fine. Verifying a download from the internet, validating firmware, or confirming evidence integrity is not, because an attacker who controls the file can construct a different one with the same digest.

Why Is HMAC-SHA1 Still Acceptable?

HMAC’s security does not rest on collision resistance in the same way signatures do, and no practical forgery against HMAC-SHA1 exists. Protocols such as TOTP continue to use it safely. It remains a legacy choice, so new designs should use HMAC-SHA256, and existing uses should be recorded rather than left undocumented.

How Do I Find Deprecated Hashes in My Estate?

Scan TLS endpoints and certificate stores for SHA-1 signatures, search source control for calls to MD5 and SHA-1 APIs, review internal CA templates and issued certificate inventories, and ask suppliers what their products use. Firmware, embedded devices, and partner integrations are where the remaining instances usually hide.

Related Terms

You May Be Interested In These

What Is LDAP Injection?

Cybersecurity Terms

17 November 2026

What Is LDAP Injection?

Read More
What Is E-Commerce API Security?

Cybersecurity Terms

17 November 2026

What Is E-Commerce API Security?

Read More
What Is Key Management and Key Rotation?

Cybersecurity Terms

17 November 2026

What Is Key Management and Key Rotation?

Read More