tags:

views:

52

answers:

3

Hi,

In the current project I would like to create my own hash function but so far haven't gained much theoretical background on hashing principle.

I would be very thankful if anyone of you could suggest any useful resource about the theory of hashing, cryptography and practical implementations of hash functions.

Thank you!

P.S. As hashing blocks of informations in this case is a part of larger research project I would like to create a hash function on my own and this way learn the principle rather than use the existing libraries. The informations I am working on will stay in house so there is no need to worry about the possible attacks.

A: 

Instead of writing your own hashing function have you considered using a standard hashing function from a library and then salting the data you're hashing? That is common practice and ensures that anyone with software that decrypts data with standard encryption functions doesn't intercept your data and decipher it.

jlafay
It says so right in the post (the 'P.S.' at the bottom)... :)
roe
Yes I did read that, I just thought that he might want to consider salting a hash instead of going through the trouble of writing your own hash function. They can get complex and most of the code examples he will find are going to be standard hashing functions like MD5 and SHA1 that are already in those libraries. Just my two cents :)
jlafay
+4  A: 
  1. Don't. Existing encryption and hashing algorithms (as pointed out in the comments above, they have little to do with each other) have been designed by experts and extensively peer-reviewed. Anything you write from scratch will suck in comparison. Guaranteed. Really. The only thing you'll gain is a false sense of security -- your algorithm won't be peer-reviewed, so you'll think it's more secure than it actually is.

  2. But if you do want to know more about the theory (and gain an appreciation for why you shouldn't do it yourself), read "Applied Cryptography" by Bruce Schneier. You won't find a better resource.

Brush up on your math first.

Joe White
+1  A: 

First of all, if you use the right terminology, you'll be better able to find helpful resources.

"Encryption" is performed with ciphers, not cryptographic hash functions. You'll never find a reliable reference that mentions a hash as an "encryption function". So, if you are trying to learn about hashes, leave "encryption" out.

Another term for "cryptographic hash" is "message digest," so keep that in mind as you search.

Many chapters of an excellent book, The Handbook of Applied Cryptography are available for free online. Especially check out Chapter 9, "Hash Functions and Data Integrity."

erickson