Score:3

Will XORing two bad hashes lead to a collision resistant hash?

st flag

I'm reading the fourth edition of "Cryptography: Theory and Practice" by D.R. Stinson and M.B. Paterson. In the book, they have mentioned the concept of "collision-resistant hash" and I've stumbled upon the following question from another source:

Is there a collision resistant hash function $h(x)=h_1(x)\oplus h_2(x)$ so that $h_1$ and $h_2$ are not collision resistant?

It seems interesting to think about it, but I couldn't find any relevant answers for this topic…

Daniel S avatar
ru flag
HINT: Consider a 256-bit hash function where the last 128-bits of output are all set to zero.
Dniel BV avatar
st flag
Nice solution :) Thank you!
JAAAY avatar
us flag
@DnielBV Considering answering the question yourself using the hint.
Maarten Bodewes avatar
in flag
@JAAAY This is considered a homework question, so we only provide hints in comments, see [our current homework policy](https://crypto.meta.stackexchange.com/q/1115/1172)
JAAAY avatar
us flag
@MaartenBodewes This is the reason I tagged OP in order to answer the question if he managed to figure out the solution and I didn't tag Daniel that provided the hint.
Maarten Bodewes avatar
in flag
@JAAAY Oh, OK, but that would kind of defeat the purpose of only providing hints. That's not so much for the OP's purpose, but more for not answering exercises. A lot of these questions are only useful as part of an exercise.
Polytropos avatar
pl flag
It is worth noting that the current hint gives a quite inefficient example, in terms of the work factor to produce new collisions for the component hashes. One can construct examples where generating collisions for the components is essentially free (hint: think about preimages of zero).
Score:2
in flag

Let $g$ be a collision-resistant hash. We build $h_1$ to be $g$ with the first half replaced with all zeros, and $h_2$ to be $g$ with the second half replaced with all zeros. Neither are collision-resistant as both have effectively half the bit strength they should. Yet their XOR is exactly $g$ we assumed to be collision resistant.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.