Hashing is the process or technique of converting any data into certain codes or form beyond recognition. It is an irreversible process. In order to hash any data, the input or the data is passed through a hash function, which uses some algorithms to calculate the corresponding hash value. Some of the most popular hashing algorithms are MD4, MD5, SHA, etc.Real-world implementation of hashing:
Now you must be wondering why and how hashing are used in the real world. Hashing of any data is done for the purpose of protecting it from the understanding of any other people.For example:
Now, most of the websites use hashing of the password to store in their database.If by any chance the server of any website gets hacked or some sort of data breach happened from their server, then their user's passwords can be known by the attackers. And even though no any such things happen, still the passwords can be seen by any people of administration of the website, now which creates the risk of privacy. So now here is where the hashing of the password plays the role. When the user sign up into the website, the website hashed the plain password and store into the database.Now even though the server gets affected by hackers or not even the website administration can known the original plain password. They will just get the hashed password. And since hashing is an irreversible process, so none can convert the hash back into the original password. But what if many people keep the same password? If many people keep the same password, then obviously the hashed password will be also the same. And if now the hacker somehow using social engineering and bruteforce gets the password of one user then he/she can easily crack all hash passwords (of the people having the same password).So for the protection from this a new method was introduced named "Salting".Salting: Salting is a simple technique of adding an extra layer of security in hashing the passwords by adding a different unique value at the end of the passwords to generate a different hash password for every user.