Skip to main content

What Is a Second-Preimage Attack and How Does It Differ from a First-Preimage Attack?

A first-preimage attack (or simply a preimage attack) involves finding the input 'x' that maps to a specific, pre-determined hash output 'h'. A second-preimage attack involves being given an input 'x1' and its hash 'h1', and then finding a different input 'x2' such that H(x2) = H(x1).

The key difference is that in a second-preimage attack, the attacker must match the hash of a specific existing message, whereas in a collision attack, any colliding pair is acceptable.

What Is the Impact of Semiconductor Shortages on the Profitability of Existing Mining Hardware?
What Is the ‘Dilution’ Effect for Existing Token Holders?
What Is the Difference between a Preimage Attack and a Collision Attack in Hashing?
Which Type of Preimage Attack Is More Critical for Blockchain Integrity?