Go Back   Velocity Reviews > Newsgroups > Computer Security
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

Computer Security - Does MD5 include the file name?

 
Thread Tools Search this Thread
Old 09-12-2006, 10:54 PM   #1
Default Does MD5 include the file name?


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
  Reply With Quote
Old 09-12-2006, 11:10 PM   #2
Todd H.
 
Posts: n/a
Default Re: Does MD5 include the file name?
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.
  Reply With Quote
Old 09-12-2006, 11:20 PM   #3
Unruh
 
Posts: n/a
Default Re: Does MD5 include the file name?
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
  Reply With Quote
Old 09-13-2006, 09:57 PM   #4
Zak
 
Posts: n/a
Default Re: Does MD5 include the file name?
> 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
  Reply With Quote
Old 09-13-2006, 10:44 PM   #5
Todd H.
 
Posts: n/a
Default Re: Does MD5 include the file name?
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.
  Reply With Quote
Old 09-13-2006, 11:51 PM   #6
Doug McIntyre
 
Posts: n/a
Default Re: Does MD5 include the file name?
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
  Reply With Quote
Old 09-14-2006, 05:36 AM   #7
Zak
 
Posts: n/a
Default Re: Does MD5 include the file name?
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
  Reply With Quote
Old 09-14-2006, 07:07 AM   #8
Todd H.
 
Posts: n/a
Default Re: Does MD5 include the file name?
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.
  Reply With Quote
Old 09-14-2006, 07:27 PM   #9
jiang
 
Posts: n/a
Default Re: Does MD5 include the file name?

> 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
  Reply With Quote
Old 09-14-2006, 07:44 PM   #10
Todd H.
 
Posts: n/a
Default Re: Does MD5 include the file name?
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.
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

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




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46