I'm trying to understand the relationship between preimage resistance and second preimage resistance. Consider the following example.

Suppose there exists a hash function H(x). The function produces k-bit hash codes, and is collision resistant, preimage resistance, and second preimage resistance.

Then suppose there exists a hash function H'(x). The function produces (k+1) bit hash codes. When x is k bit long, the output is 0||x. When x is not k bit long the output is 1||H(x).

What resistances does H'(x) have and nor have, and why?

  • 4
    $\begingroup$ This is indistinguishable from homework; what have you tried? $\endgroup$ – fkraiem Nov 20 '16 at 6:37

Well, it's obvious that H' is not preimage resistant for k bit values. If you have a hash that starts with 0, you will know that it's of the form 0||x and you got your x such as H'(x)=0||x.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.