← Blog

How Password Hash Cracking Works (and How to Defend Against It)

When a database leaks, attackers do not get plaintext passwords. They get hashes — and a free hash cracker can reverse many of them in seconds. Password hash cracking is the reason “correct horse battery staple” survives leaks while “P@ssw0rd!” does not. This post explains how the attacks actually work, why MD5, NTLM and SHA-1 are the weakest links, and what genuinely defends a password.

What Password Hashing Is For

Hashing is a one-way function. You feed in a password and get a fixed-length digest, but you cannot meaningfully reverse the digest back into the password. Systems store the digest, not the plaintext, and verify a login by hashing the submitted password and comparing. That design keeps plaintext out of the database, but it only helps if the hash is expensive to invert. A fast hash with no salt is little better than plaintext, because the math of the attack below is trivially parallel.

How Dictionary Attacks Work

The dominant attack is not a search over every possible string; it is a dictionary attack. The attacker takes a wordlist of common passwords and breach dumps, hashes each candidate, and compares against the target. With fast hashes and modern hardware, that comparison runs billions of times per second.

import hashlib

target = "5f4dcc3b5aa765d61d8327deb882cf99"  # md5("password")

with open("rockyou-10k.txt") as f:
    for word in f:
        candidate = word.strip()
        if hashlib.md5(candidate.encode()).hexdigest() == target:
            print("found:", candidate)
            break

Rules and mutations extend the dictionary: password becomes Password1, p@ssw0rd, password2024, each generated from one seed entry. Rainbow tables push the tradeoff further by precomputing huge chains of hash-to-plaintext mappings, so lookups become near-instant for any hash in the table. Salting defeats rainbow tables, but a salt does nothing against a plain dictionary run on one target.

Beyond dictionaries sits brute force and mask attacks. A brute-force run tries every combination up to a length, which is why an eight-character password taken from a wordlist falls instantly while a random fifteen-character one is effectively safe. Mask attacks split the difference: the attacker knows most human passwords follow a shape, so ?l?l?l?l?l?l?d — six lowercase letters and a digit — covers mydog1 and millions like it. Modern cracking tools script these shapes, so a hash that looks random in your head often sits one mutation away from a dictionary word.

Why MD5, NTLM and SHA-1 Are Weak

These hashes were never designed for passwords. MD5 and SHA-1 are message-digest algorithms built for speed and integrity, and NTLM is an unsalted Windows challenge-response hash. That speed is exactly what makes them crackable.

Hash Purpose Effective strength for passwords
MD5 Message digest Broken; sub-second on consumer GPUs
NTLM Windows auth Unsalted; trivially dictionary-attacked
SHA-1 Message digest Fast; only marginally better than MD5
bcrypt Password hashing Built-in cost factor; slow by design
Argon2 Password hashing Memory-hard; resistant to GPU cracking

A single modern GPU sustains billions of MD5 hashes per second. Even a strong-looking eight-character password falls in minutes when it appears in the wordlist. The weakness is not the algorithm’s collision resistance; it is that the hashes are far too cheap to compute at scale.

What Actually Defends a Password

Defense works at four layers. First, salt every hash uniquely so identical passwords never share a digest and rainbow tables become useless. Second, use a deliberately slow, memory-hard algorithm — bcrypt, Argon2 or scrypt — with a real cost factor, so each guess costs milliseconds instead of nanoseconds. Third, choose unique, long passphrases generated by a password manager, because no hash speed helps an attacker who cannot guess. Fourth, check for credential stuffing by monitoring breach feeds for your domains.

On the defensive side of the fence, the hash cracker and the hash identifier are useful testing tools: verify that a sample from your own database resists a dictionary run, and confirm every entry is salted and using a modern algorithm before you claim your hashes are secure.

Next step: take a sample hash from your own system, run it through the free hash cracker, and if it cracks in under a second, migrate to a slow salted hash like Argon2 before your next breach does it for you.

Try it now: open the hash cracker tool — free, runs entirely in your browser, nothing is uploaded.