Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top