Jump to content

md5 and files

- - - - -

  • Please log in to reply
4 replies to this topic

#1
baldgrapeape

baldgrapeape

    Newbie

  • Members
  • Pip
  • 5 posts
Hi,

If someone were writing a program to calculate an md5 hash of a file, (for this purpose let's say language doesn't matter) I wonder a few things which maybe you can help me with please.

If you have an audio file 2 minutes in length and have hashed it, would adding :05 of dead air (no noise, no hiss, nothing but dead air) would that change the hash value?

If you change the ID tag of the file would that change the hash?

What would the code be taking into account in order to render a change to a different md5.

Thanks a lot.

Ape.

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Yes.
Yes.
The file is different.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
A single binary bit changed will significantly modify the resulting MD5 hash, you can follow the source of the MD5 algorithm and see the significant steps it takes to do so.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#4
baldgrapeape

baldgrapeape

    Newbie

  • Members
  • Pip
  • 5 posts
Thanks for the replies.

I guess that makes sense that the ID is part of the actual file so the MD5 would change then.

#5
zoranh

zoranh

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 207 posts
But if you are implementing hash algorithm on your own, then you can decide to skip part of the file, knowing the file format. For example, if you want ID tag to be modifiable without affecting hash value, then skip bytes containing ID when calculating hash.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users