![]() |
|
|
|||||||
![]() |
Computer Security - Does MD5 include the file name? |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
I am running XP.
I have a utility which calculates the MD5 hash for individual files. I find that it calculates the same MD5 value even if I change the file's name. (1) Is the name of the file not used in calculating the MD5 value? (2) Is this just a quirk of my utility? Zak |
|
|
|
|
#2 |
|
Posts: n/a
|
Zak <> writes:
> I am running XP. > > I have a utility which calculates the MD5 hash for individual files. > > I find that it calculates the same MD5 value even if I change the file's > name. > > (1) Is the name of the file not used in calculating the MD5 value? That is correct. The hash is computed from the data of hte file. The filename is stored in the FAT, or the NTFS equivalent thereof, not as part of the file data. > (2) Is this just a quirk of my utility? Nope. -- Todd H. http://www.toddh.net/ Todd H. |
|
|
|
#3 |
|
Posts: n/a
|
Zak <> writes:
>I am running XP. >I have a utility which calculates the MD5 hash for individual files. >I find that it calculates the same MD5 value even if I change the file's >name. Yes. >(1) Is the name of the file not used in calculating the MD5 value? It is not included. MD5 of a file is the hash of the contents of that file. >(2) Is this just a quirk of my utility? No. Unruh |
|
|
|
#4 |
|
Posts: n/a
|
> Zak <> writes:
>> I am running XP. >> >> I have a utility which calculates the MD5 hash for individual >> files. >> >> I find that it calculates the same MD5 value even if I change the >> file's name. >> >> (1) Is the name of the file not used in calculating the MD5 value? On 12 Sep 2006, Todd H. <> wrote: > > That is correct. The hash is computed from the data of hte file. > The filename is stored in the FAT, or the NTFS equivalent thereof, > not as part of the file data. >> (2) Is this just a quirk of my utility? > > Nope. Thanks fo the info. Are there other widely used hashes such as the SHA hashes that do include the name of the file in their calculation? Zak |
|
|
|
#5 |
|
Posts: n/a
|
Zak <> writes:
> Thanks fo the info. Are there other widely used hashes such as the SHA > hashes that do include the name of the file in their calculation? I doubt it. Think about it, when someone downloads a file, they like to rename it sometimes, and what path theyput it in varies, so the absolute file name would be different, dependent on platform, some file systems can handle mixed case file names, others can't, etc etc. What situation do you have where you're so concerned about the filename being included in the check? There may be others ways leveraging OS calls to do what you want. -- Todd H. http://www.toddh.net/ Todd H. |
|
|
|
#6 |
|
Posts: n/a
|
Zak <> writes:
>Thanks fo the info. Are there other widely used hashes such as the SHA >hashes that do include the name of the file in their calculation? A hash is just a hash of data. You need a higher level protocol to protect the filename. Say, a requirement of zip'ing the file up into a zip archive, and then running a hash over that zip file. You can verify your hash on the ZIP'd file, and be reasonably sure that the filename of the unzip file will be correct and the same. There's so many different systems out there that will most likely mangle the filename in new and strange ways that no typical hash function would handle a filename change, there'd be too many failures. Doug McIntyre |
|
|
|
#7 |
|
Posts: n/a
|
On 13 Sep 2006, Doug McIntyre <> wrote:
> Zak <> writes: >>Thanks fo the info. Are there other widely used hashes such as the >>SHA hashes that do include the name of the file in their >>calculation? > > A hash is just a hash of data. You need a higher level protocol to > protect the filename. > > Say, a requirement of zip'ing the file up into a zip archive, and > then running a hash over that zip file. You can verify your hash on > the ZIP'd file, and be reasonably sure that the filename of the > unzip file will be correct and the same. > > There's so many different systems out there that will most likely > mangle the filename in new and strange ways that no typical hash > function would handle a filename change, there'd be too many > failures. > I have some speech audio files. One or two may have been re-worked while tinkering with the audio editor. I would like to hash them to check if one file is identical to another. But some names have changes so I don't want to us a hash calculation which might also base itself on the name. Seems from what folks say that it is very nnlikely. Zak |
|
|
|
#8 |
|
Posts: n/a
|
Zak <> writes:
> I have some speech audio files. One or two may have been re-worked > while tinkering with the audio editor. > > I would like to hash them to check if one file is identical to another. > But some names have changes so I don't want to us a hash calculation > which might also base itself on the name. > > Seems from what folks say that it is very nnlikely. Then just use md5sum for the hashing, and call it a day. It ignores filenames. -- Todd H. http://www.toddh.net/ Todd H. |
|
|
|
#9 |
|
Posts: n/a
|
> Then just use md5sum for the hashing, and call it a day. It ignores > filenames. Now that we are at it, anyone can reccomend an easy freeware for Windows XP to compare file hashes? jiang |
|
|
|
#10 |
|
Posts: n/a
|
jiang <> writes:
> > Then just use md5sum for the hashing, and call it a day. It ignores > > filenames. > > > Now that we are at it, anyone can reccomend an easy freeware for Windows XP > to compare file hashes? cygwin.com framework includes md5sum by default i believe. md5sum both files, and eyeball the resulting fingerprint. -- Todd H. http://www.toddh.net/ Todd H. |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cannot open include file: 'ddraw.h': | Menon_D | General Help Related Topics | 2 | 05-18-2007 01:53 PM |
| SONY DVD RW DW-G120A SOMETIMES FAILS...... | atlantic965 | DVD Video | 0 | 06-18-2006 10:36 PM |
| problems backing up dvds | Lawrence Traub | DVD Video | 11 | 09-27-2005 07:34 PM |
| Re: Ripping DVDs. Please answer the attached question. - Question.txt | Stan Brown | DVD Video | 19 | 02-09-2005 11:19 PM |
| Burn process failed - help! Log file posted for help troubleshooting | Michael Mason | DVD Video | 1 | 08-16-2004 09:24 PM |