Skip to main content

IT security

What is MD5?

MD5 was for years the world's most used hash algorithm, but has been broken since 2004. See what it may still be used for, and what should replace it.

In short

MD5 is a cryptographic hash algorithm from 1992 that computes a 128-bit fingerprint of arbitrary data, and for many years it was the most widely used in the world.

Today MD5 is broken: since 2004 researchers have been able to construct collisions, that is, two different files with the same MD5 hash, and the attack is so cheap it can be carried out on ordinary hardware. The consequence is that MD5 must not be used for anything security-bearing, neither digital signatures, certificates nor password storage, which the Flame malware's forged Microsoft certificate demonstrated in practice in 2012.

For pure error-checking purposes with no attacker in the threat picture, such as detecting transmission errors in a download, MD5 is still harmless, but modern alternatives like SHA-256 cost nothing extra. Finding MD5 in certificates or systems today is a finding that must be remediated. MI Support IT catches this sort of thing in security reviews for Danish businesses.

Back to the glossary

What is MD5?

MD5 (Message Digest 5) is a hash algorithm designed by the cryptographer Ron Rivest in 1992. It takes arbitrary data and computes a 128-bit fingerprint: the familiar 32 hexadecimal characters you still see next to download links. In the 1990s and 2000s, MD5 was everywhere: in certificates, signatures, password databases and integrity checks.

That era is over, and it is important to understand why, because MD5 still turns up in legacy systems, home-grown integrations and old habits.

Why is MD5 insecure?

A secure hash algorithm must be collision resistant: It must be practically impossible to find two different inputs with the same hash. That is exactly the property that is broken in MD5. In 2004, the Chinese researcher Xiaoyun Wang and colleagues demonstrated the first practical collisions, and the attacks have since been refined, so collisions can today be constructed in seconds on ordinary hardware.

The consequence is serious wherever the hash carries trust: If an attacker can create two files with the same hash (one innocent and one malicious), a digital signature on one can be reused on the other. This is not theory: The Flame malware from 2012 exploited an MD5 collision to forge a Microsoft certificate and pose as a legitimate Windows update. The certificate world therefore banned MD5 (and later SHA-1) years ago; NIST and every relevant standard today point to the SHA-2/SHA-3 family.

What may MD5 still be used for?

Only tasks with no attacker in the threat picture: detecting random transmission errors, deduplicating files internally or distributing data in hash tables. Here collision attacks are irrelevant and MD5 is harmless, but since SHA-256 is just as fast in practice, there is rarely any reason to choose the broken one in new designs.

Two places, on the other hand, MD5 is a red flag: passwords (MD5 is lightning fast and therefore perfect for password crackers: use Argon2 or bcrypt) and anything certificate- or signature-bearing. If a vulnerability scan or penetration test finds MD5 in your certificates, VPN configurations or applications, it must be remediated. It typically also signals that the system has not been maintained for a long time.

How MI Support IT can help

Our security reviews catch outdated cryptography such as MD5 and SHA-1 in certificates, systems and configurations, and we handle the replacement via PKI management and ongoing hardening as part of your IT security. Contact us if your environment has not had a cryptographic check-up in a few years.

Shall we talk about your business and your needs?

Real people talking to real people. We get back to you the same day.