1
$\begingroup$

This question already has an answer here:

Definitions here:

  • Pre-image resistance

    Given a hash value h it should be difficult to find any message m such that h = hash(m).

  • Second pre-image resistance

    Given an input m1 it should be difficult to find different input m2 such that hash(m1) = hash(m2).

Wikipedia says:

These properties form a hierarchy, in that collision resistance implies second pre-image resistance, which in turns implies pre-image resistance, while the converse is not true in general.

Assuming pre-image resistance is broken, we have a function pre(h) which can easily find m such that h = hash(m). How is it helpful in finding a different m2 such that hash(m1) = hash(m2)? What if pre(m1) always returns m1?

Edit. The definition on Wikipedia is not quite formal. A better explanation is here.

$\endgroup$

marked as duplicate by Gilles 'SO- stop being evil', Maarten Bodewes, Community Dec 12 '16 at 3:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ One importance of finding different m2 is faking. Note that pre(m1) cannot always returns m1, because the length of hash input is infinite while the outputs length is finite. $\endgroup$ – Meysam Ghahramani Dec 11 '16 at 21:27
  • $\begingroup$ @MeysamGhahramani Assuming the hash value is k bits, then pre can have2^k different answers. In reality enumerating all 2^k values is not practical if you consider k is usually 128 or larger, therefore pre has a lot of leeway. $\endgroup$ – Cyker Dec 12 '16 at 3:15