views:

44

answers:

2

Say I have 'n' number of files, for each of which I have CRC32, MD5 and SHA1 digests

Now these 'n' number of files are actually split files/archives of single large file.

When these smaller files are recombined/joined into the larger file, we can compute the digest of this larger file too.

My question is : Is there a way to verify whether the combination of the digests of these smaller files equal the digest of the large file?

For example, say I have a file split into 4 parts with digests 0xDE, 0xAD, 0xBE, 0xEF

Say, after joining, the larger file has digest 0xC0

Is there any way to verify that join(0xDE, 0xAD, 0xBE, 0xEF) == 0xC0, where 'join' is the magical operation/formula/algorthm I am looking for?

+1  A: 

Don't think so, sorry
It would make it rather easy to crack an MD5 if this was possible

edit. If you mean can I compute the MD5 of the sum from the MD5 of the parts = no.
But if you just want to confirm that the parts are correct you can always calculate the MD5 of each individual part and then the MD5 of the set of those MD5s.
Obviously to verify it you need to perform the same sequence, so someone who only has the complete file would have to split it to do the same check.

Martin Beckett
crack an MD5 .. how so?
PoorLuzer
it would allow you to build dictionaries of blocks with known MD5, then if you wished to generate a certain digest for a fake message you would have a library of arbitrary padding blocks to add.
Martin Beckett
MD5 shouldn't be used for secure hashes any more, it's been demonstrated as insecure for some years now.
skaffman
It's been demonstrated that it is easier to find collisions than you would like. If you don't accept arbitrary binary files it is still pretty good. Your chances of creating an email with legible text that collides with another text email are rather small.
Martin Beckett
A: 

If you won't to join the files, you can pass them one by one to hash algorithm using TransformBlock method. With calling TransformFinalBlock that gives you the result.

Yakeen