Skip to main content

How Is a Second-Preimage Attack Different from a First-Preimage Attack?

In a first-preimage attack, the attacker is given a hash output and must find any input that maps to it. In a second-preimage attack, the attacker is given an original input, M1, and its corresponding hash, H(M1), and must find a different input, M2, such that H(M2) = H(M1).

The second-preimage resistance property is crucial for integrity checks, as it prevents an attacker from replacing an original document with a fraudulent one that has the same hash.

What Is a “Preimage Attack” and How Does It Differ from a Collision Attack?
Which Type of Preimage Attack Is More Critical for Blockchain Integrity?
What Is the Difference between a Preimage Attack and a Collision Attack?
What Is the Typical Unit Used to Measure Bitcoin’s Hash Rate (E.g. Terahash, Petahash)?