Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Putting this into another answer because it's just too much to type for a comment.</p> <p>The definition of 2nd-preimage-resistant is you have h(x) and x, and can't create x'. </p> <p>The definition of preimage-resistant (without second!) means you have only h(x), and can't create x.</p> <p>And the definition of collision resistant is you have nothing, and may choose any h(x), x and x'.</p> <p>If you use the hash to sign a plaintext message, you need 2nd-preimage-resistancy, but not collision resistancy. It doesn't matter to you if someone can find two colliding messages that produce a hash that is different from yours, but you want to make sure noone is able to craft a <em>different</em> message that has the your hash, even if they know your plaintext. </p> <p>If you use the hash to store hashed passwords, you don't care about collision resistance, and you don't care about 2nd-preimage-resistance, preimage-resistance is all you need. If an attacker knows one password, you don't really care if he can use that password to find a different one.</p> <p>So these were two examples where collision resistance is not required, but preimage-resistance or 2nd-preimage-resistance is.</p> <p>As to "Not collision resistant not necessarily means Not 2nd-preimage resistant", why is that? , consider the hash function <code>if x has less then 24 bits, then h(x)=0, else h(x)=sha256(x)</code>. This is very obviously not collision resistant (choose any 2 words that have less than 4 letters), but, as long as your text is longer, this function is preimage-resistant and 2nd-preimage-resistant (assuming sha256 hasn't been broken yet).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COEm... Two points:1, again, this is a very good answer and examples but not quite related to the last question I asked in the comment. To answer my question, please suggest a way to prove a hash is "NOT 2nd-preimage resistant" with minimum effort. My answer to this is: We know there exists a certain input x in this hash which allows me to easily get its 2nd preimage(a x' where h(x) = h(x')). We don't necessarily to know which x is. Do you agree with me? If yes, I can ask my follow-up questions.
      singulars
    2. COAnd point 2: The last example hash function you gave, is actually not 2nd-preimage resistant. This property should not related to the input length. As long as we know there is some x which will lead to its 2nd-preimage, then we say this hash is Not-preimage resistant. (in this case, we know that for input "0", we can find one of its 2nd-preimage "00").
      singulars
    3. COIf you can find some kind of transformation on x, resulting in x', so that h(x)=h(x'), *for all possible values of x*, then the function isn't 2nd-preimage resistant, and of course not collision resistant. So, in your point 2, the hash function is 2nd-preimage-resistant, because the transformation only works on a very small subset of all possible x. As an example, h(x)="clear the 3rd bit on the 2nd byte of x, then calculate MD5". This isn't 2nd-preimage-resistant, with the transformation "toggle the 3rd bit on the 2nd byte".
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload