Nov 18, 2018 07:30 UTC
Nov 18, 2018 at 07:30 UTC
What Is Cryptographic Hash Function?
A cryptographic hash function is defined as an algorithm which runs on data to produce a value. The value is known as checksum, and the data can be a password or an individual file. These functions are used for the purpose of the verification of the authenticity of the data. If the checksums generated through two files using the same hash functions are the same, then those two files are assumed to be identical.
MD5 and SHA-1 are some of the common cryptographic hash functions used for the purpose of data validation. Even though a lot of the times cryptographic functions are called as ‘hash functions’, yet this term is incorrect to use as a hash function is a generic term that is used to include many algorithms such a cyclic redundancy checks along with cryptographic hash functions.
You may also read: Widely Used Cryptographic Algorithms
Are Cryptographic Hash Functions Reversible?
The Cryptographic hash functions are designed such that it not possible to reverse the generated checksums to the original data that they were created from. Even though they are practically impossible to reverse, however the security of data contained cannot be guaranteed.
Hackers often use rainbow table to ascertain the data of the checksum. These tables list various, often billions, checksums with their data value. Hence, it can often be very simple to reverse a cryptographic hash function, however since not all rainbow tables can list the plain text for every possible checksum, hence they can be used for weak passwords.
You may also read: What Is a Merkle Tree in Blockchain and How Does It Work?
How to Secure Passwords?
In order to hack the data, the hacker must know which cryptographic hash algorithm was used to process and generate the checksums. After the generation of value, websites that save users’ passwords often perform a number of functions on the cryptographic hash algorithms, but this is done before the generated value is stored. Through this process a new value is generated that can only be understood by the web server and at the same time it does not match the original checksum.
Another way to secure data is to separate the checksum into different parts and rearrange them before the password is stored into the database. When the user signs on, the server will reverse the additional functions and hence the original checksum is arrived at which will verify whether a user’s password is valid or not. The above processes prohibit a possible hack where all checksums can be stolen. The idea behind the above process is to perform an unknown function. Hence if even if the hacker is aware of the cryptographic hash function then knowing the password checksums will not be helpful.
You may also read: Consensus Algorithms in Blockchain