What are the attacks against cryptographic hash functions ?
Many attacks exist to try to break cryptographic hash functions. Some of them can successfully break a hash function, others are currently technically impossible to accomplish.
Hash functions have many security application, they are used to make digital signature and many other forms of authentication. Meaning it is important to check if the functions are secured and to check if new attacks are realeased. There are many attacks on cryptographic systems and it would be probably impossible to list them all, however some of them are quite famous.
I . The types of attacks on hash Algorithm
There are 3 types of attacks on hash functions:
- The collisions attack
- The pre-image attacks
- The second pre-image attacks
- Length extension attack
Each of these attacks are usually specific to one type of hash function.
The collision attack tries to find two messages that have the same hash value. A cryptographic hash function should resist collision attacks. It is not the hardest to execute but it is pretty hard to prevent.
Collision resistance: It should be hard to find different messages m1, m2 such that H(m1) =Learn more
The pre-image attack tries to find the original message from it’s hash. A cryptographic hash function should resist attacks on its pre-image.
Pre-image resistance: Given a hash value h it should be hard to find any message m such that h = H(m).Learn more
The second pre-image attack tries to find a messages that has the same hash value as an initial message. A cryptographic hash function should resist attacks on its second pre-image.
Second pre-image resistance: Given a message m1 it should be hard to find another messageLearn more
m2 6= m1 such that H(m1) = H(m2).
Length Extension Attack
A case of hash algorithm usage is to check the authenticity of the expeditor. A way to do that is to hash a secret with the data we want to share. Then our hash function will do H(secret || data), that way we can check if it is sent by the good person since a malicious user would have the date but not the secret the hash will not fit.
The main goal of a length extension attack is to be able to create a legit hash without knowing the secret. It is an attack possible on hash algorithm based on the Merkle-Damgard construction, algorithms like blake2 are immune to length extension.Learn more
Brute force and birthday attack
The principle of brute forcing is to try all the possible outputs. For example in order to get a collision you would set a script which tries lots of possible input into the hash function in order to get the same output (a collision).Learn more
The boomerang Attack
The boomerang attack belong to the differential cryptanalysis field. Differential cryptanalysis is the study of how a specific modification of the input will affect the output.Learn more
The Dictionary attack
Hashes are used to store passwords. If the goal of an attacker is to find a password he can use a dictionnary attack. Since he only got the hashes it is very hard (maybe impossible) to go back through the hash function in order to get the password. However the same input will always give the same output (hash). So instead of blindly bruteforce the hash and try all the possible input a strategy which can be used is the dictionary attack.Learn more
The goal of the rainbow table is to make a compromise between time (a brute force attack takes quite a long time) and memory (a dictionary attack is way faster but needs much more memory).Learn more