# MD5 of a file is different on different computers?



## matt99b

Is this possible? It is the same file.

I have a few .rar files, and I want to distribute it online. I want to check that the MD5 is indeed the same on every computer (as people claim), so that I can provide it on my website as a means of checking the integrity of the files. Each file is very large (1GB). I have copied them to 5 different computers, and 2 of the computers are giving a different MD5 result to the other 3 computers. 

On Macbok Pro, OS X:
MD5 (test.part1.rar) = 84cc656767f52708a7d491e80b9153a7
MD5 (test.part2.rar) = ecc5f0f3939112d533321679329d35c0

On PC Laptop, Windows XP:
test.part1.rar = 84CC656767F52708A7D491E80B9153A7
test.part2.rar = ECC5F0F3939112D533321679329D35C0

On Mac Pro, OS X:
test.part1.rar = 84CC656767F52708A7D491E80B9153A7
test.part2.rar = ECC5F0F3939112D533321679329D35C0

----

Desktop PC, Windows XP:
test.part1.rar = 527C6E130835387DA8DE7F343CC5CE54
test.part2.rar = A38857B949E390CEC7AE096B7B7B42CA

On 2nd Laptop, OS X:
test.part1.rar = 527C6E130835387DA8DE7F343CC5CE54
test.part2.rar = A38857B949E390CEC7AE096B7B7B42CA

----

So, why would the MD5 be different? I thought it was meant to be the same on all machines?

I've copied the files many many times, via network, and DVD, to check that it is copied correctly. Indeed it is the same result every time. It does unrar correctly without errors on all machines. Indeed the above MD5 results are consistent and remain unchanged.

Can anyone shed any light on this? Is the MD5 check not quite what we believe it to be?


----------



## jamiemac2005

Did you modify the file at some point whilst transferrig the files? because it's simply not possible for an MD5 hash to be different for identical files. What is it you're using to generate the MD5 hash? and have you tried generating the hash directly from the DVD? (basically because some modding of the file could be done at some point from A to B)...

Cheers,
Jamey


----------



## matt99b

Hi Jamey,

No modding of the file - I have tried downloading from my website and DVD and CD.. several times.. the results are consistently the same. If there was a random mod in place, it would be different every time. If there was a consistent mod in place, that .rar files wouldn't open without errors. Could this be something to do with 64-bit vs. 32bit operating systems or processors?

Would the split .rar files open if there was any modding? it seems unlikely as there is no error correction included with the rar files.

Am not a basic user, so things like caching are not an issue..

stumped by this one.

Advice appreciated.


----------



## jamiemac2005

Okay, different approaches are the way to go then:
- If it was split then it would have (probably) modified the file's headers, and depending on what joining function/software you're using it could change it in different ways.
- What file systems are the OSes using(FAT/NTFS) that could also modify the header(modding the file)... Best thing to try to start with is check the times and dates/other info in the "properties" of the files(right click->props, or similar)... If they differ then that could be the problem. But it shouldn't be the OSes themselves (64/32bit) that change the md5... unless that's correspondand with the ones that were different....(actually that's something to check, if the 64 bit vs 32 bit are different but both the same then that's probably it, but i don't [as of yet] know the technical reason for this).

Cheers,
Jamey


----------



## matt99b

jamiemac2005 said:


> Okay, different approaches are the way to go then:
> - If it was split then it would have (probably) modified the file's headers, and depending on what joining function/software you're using it could change it in different ways.


No joining function/software was used before checking the MD5, so it rules that out.


jamiemac2005 said:


> - What file systems are the OSes using(FAT/NTFS) that could also modify the header(modding the file)...


Some computers are running NTFS, some are Mac OS Extended



jamiemac2005 said:


> Best thing to try to start with is check the times and dates/other info in the "properties" of the files(right click->props, or similar)... If they differ then that could be the problem.


All the dates/times are showing as the same.



jamiemac2005 said:


> But it shouldn't be the OSes themselves (64/32bit) that change the md5... unless that's correspondand with the ones that were different....(actually that's something to check, if the 64 bit vs 32 bit are different but both the same then that's probably it, but i don't [as of yet] know the technical reason for this).


How do I check 32bit vs 64bit?



jamiemac2005 said:


> Cheers,
> Jamey


Thanks for trying to help.. I'm surprised by the lack of replies on this thread, I would have thought that discovering that a tried and tested proven technology is in fact seriously flawed, might be interesting to a lot of people!


----------



## jamiemac2005

Nope, MD5 isn't flawed(yet)... MD4 and other pre-decessors were flawed. But MD5 is just the algorithm used to create the hash...

Apparently 64-bit checksums do calculate differently to 32-bit... The only thing to do is calculate both and distrobute them with the file.

Cheers,
Jamey


----------



## sudarshanmj

This is a problem which even I faced. Its not just different on different computers, it seems like its implementation in different scripting languages (in my case javascript and perl MD5) also provide different outputs. Wierd eh? 

Maybe a problem with the tool you are using to compute the checksum?


----------

