Embarrassingly, picking a hash function (say, for hashing strings, or sets of integers, etc.) is still magic to me: take some prime numbers here, magic constants there, do some bit shifting, modulo something, and done.
Is there a nice, gentle and approachable tutorial about creating hash functions?
The easiest example of a cryptographic hash function is the Rabin function, modular squaring. It works like this: Take your input as a number (any digital data can easily be interpreted as a binary number).
There are four main characteristics of a good hash function: 1) The hash value is fully determined by the data being hashed. 2) The hash function uses all the input data. 3) The hash function "uniformly" distributes the data across the entire set of possible hash values.
Hashing refers to the concept of taking any arbitrary amount of input data (any data – word document, audio file, video file, executable file, etc.) and applying the hashing algorithm to it. The algorithm generates a gibberish output data called the 'hash' or 'hash value'.
It is curious how hard it is to find a basic explanation of hash algorithms. Maybe the topic is so difficult that it's not easy to make a basic tutorial. I was looking for one myself and ran into the same problem.
But you can try this page. What is cool about it is that after you read through the page, at the bottom there's a text box. If you add text to that box and submit the form, the result is a step-by-step listing of how it hashes the input text.
http://www.metamorphosite.com/one-way-hash-encryption-sha1-data-software
Good luck. If you find anything better, it would be really helpful if you posted it here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With