0
$\begingroup$

This question already has an answer here:

Say that I have good, collision resistant hash function H. Given a message M, the typical usage is h=H(M) to get it's hash.

Now, I want to propose two alternative methods of using this hash function, and compare them to the original function. First, I split my message M into equally sized chunks M1, M2, ..., Mn.

First method: the hash would be h=H(M1)⊕h(M2)⊕...⊕h(Mn) ( is XOR).

Second method: the hash would be h=H(M1,1)⊕h(M2,2)⊕...⊕h(Mn,n), where comma means concatenation.

Now, it's obvious that the first hashing method is poor - I can shuffle the chunks around, and add two equal chunks without changing the resulting hash. But what about the second method? Are there any attack vectors? How does it compare to the original hash function?

$\endgroup$

marked as duplicate by CodesInChaos Jun 5 '17 at 8:11

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.

migrated from security.stackexchange.com Jun 5 '17 at 6:29

This question came from our site for information security professionals.

-1
$\begingroup$

Isn't the second method reducing the hash's target space because it is only 2 x 'chunk size' (which is less than the original size if number of chunks > 2)? If the target hash space is smaller then collisions are likely to be higher and the resulting hash use is therefore weaker on that basis (although this isn't the most important factor with reasonable size target spaces).

Obviously this is a simplistic analysis comment and not a full crypto analysis - for that you need to have a solid grounding in cryptography mathematics.

$\endgroup$