Skip to content

Glossary

Preimage attack

A preimage attack finds an input that produces a specific target hash digest — the exact problem password cracking solves, and the property a hash function must resist.

A preimage attack finds an input that hashes to one specific, already-known digest. This is precisely what password cracking does: the attacker has a stolen hash and wants the plaintext that produced it, as opposed to a collision attack, which only needs any two inputs that happen to match each other and does not care what either one is.

Preimage resistance is a core design goal of any cryptographic hash function, and it is a much harder property to break than collision resistance — the birthday paradox makes collisions easier to find than a specific preimage, which is why MD5 and SHA-1 are considered broken for collisions years before anyone found a practical way to reverse a specific digest of either into its input.

For password storage, preimage resistance alone is not protection: nothing here promises that finding a preimage is slow, only that it requires search rather than a shortcut. A fast hash with no theoretical preimage weakness still falls instantly to a GPU brute-forcing the keyspace, which is exactly the argument in why fast hashes are dangerous — preimage resistance is a property of the algorithm, cracking speed is a property of how expensive each guess is.