Sign in to follow this  

Effecient hashing function for identifying files

This topic is 4867 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need a hashing function to identify certain dll files and I was wondering if anyone in here knows an effecient one which they can recommend. Note: Speed is not of great importance - as long as it will get the job done.

Share this post


Link to post
Share on other sites
There are 3 major hashing algorithms in common use - CRC32, MD5, and SHA. I listed them in order of 'goodness': an MD5 hash is much less likely to be the same for 2 random files than a CRC32 hash, just as an SHA is more likely to be different than an MD5 hash.

You should be able to find tons of information (including source for whichever language you're using) on each of the algorithms because they are very popular. Googling with each name should get you there.

The function OrthoDiablo would be a horrible hash function because the 'hash * 37' gets rid of the top bits of the hash each time. This means the hash is only really a hash of the last few bytes of data so the first bytes could be anything without the hash changing.

Share this post


Link to post
Share on other sites
OrthoDiablo << Woudln't be very secure to base your security on a filename now would it? :)

Extrarius << Thanks. I'll have a look at the SHA algorithm for C++ then :)

Share this post


Link to post
Share on other sites

This topic is 4867 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this