HASHING ALGORITHM

 hashing algorithm’s goal is to generate a safe hash; but what is a hash?

A hash is a value computed from a base input number using a hashing function.

Shortly, the hash value is a summary of the original data. For instance, think of a paper document that you keep crumpling to a point where you aren’t even able to read its content anymore. It’s almost (in theory) impossible to restore the original input without knowing what the starting data was.

Let’s look at an example of a hashing algorithm:

Algorithm

We could discuss if it’s a secure algorithm (spoiler alert — it isn’t). Of course, every input number is individual (we’ll talk more about this in the further sections), but it’s easy to guess how it works. This is a very simple example but it gives us an idea about what a hashing algorithm can look like.

To learn more about hashes, check its very thorough

Hashing Algorithm

A hashing algorithm is a cryptographic hash function. It is a mathematical algorithm that maps data of arbitrary size to a hash of a fixed size. It’s designed to be a one-way function, infeasible to invert. However, in recent years several hashing algorithms have been compromised. This happened to MD5, for example — a widely known hash function designed to be a cryptographic hash function, which is now so easy to reverse — that we could only use for verifying data against unintentional corruption.

It’s easy to figure out what the ideal cryptographic hash function should be like:

  1. It should be fast to compute the hash value for any kind of data;
  2. It should be impossible to regenerate a message from its hash value (brute force attack as the only option);
  3. It should avoid hash collisions, each message has its own hash;
  4. Every change to a message, even the smallest one, should change the hash value. It should be completely different. It’s called the avalanche effect
Posted on by