Hash Function Overview: Part 1
These questions often come up: What is hashing, why should I care about it, and how does SendThisFile use it? I’d like to take a brief moment to answer each of those questions as succinctly as possible. If you are already familiar with hash algorithms, then you might be more interested in our Secure Hash Algorithm Update announcement.
What is hashing?
Hashing is a math technique that allows you to transform information into a bunch of characters called a hash. The hash algorithm works such that every time you put the exact same information into the algorithm, you generate the exact same hash. The algorithm is also irreversible, meaning that you cannot take a hash, and run it through any algorithm to restore the original information.
Why should I care about hashing?
So what purpose could storing a bunch of characters that cannot be reversed into something useful possibly serve? Arguably the most important use case for a hash is: password storage!
Instead of storing a password in a database, you could store the hash of the password in the database. Then, when someone wants to authenticate themselves by submitting a password; you can take the password, run it through the algorithm to get its hash, then compare the hash that you just calculated with the hash that is stored in the database.
Since only the hash is stored in the database, if someone were to break into the system they would not have your entire set of users’ passwords — only their hash values. And because the hash algorithm is designed such that someone cannot take a hash string and reverse it into the original information, their original password would be safe!
There are also other important uses for the hashing algorithm.