Question: string some_hash(const string& input) { string retval = x0fxffx00; for (size_t i = 0; i < input.length(); ++i) { retval[0] ^= input[i]; retval[1] &= input[i];

string some_hash(const string& input) { string retval = "\x0f\xff\x00"; for (size_t i = 0; i < input.length(); ++i) { retval[0] ^= input[i]; retval[1] &= input[i]; retval[2] |= input[i]; } return retval; } Show that some hash is not suitable as a cryptographic hash function, by giving an example collision and a method to generate second-preimages for any arbitary value.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!