Salting and Hashing Explained

Siteindex
6 min readDec 8, 2020

--

User information and data are highly sensitive information that must be secure. Therefore, it is highly necessary that robust measures are taken to protect it at all costs. Furthermore, passwords should never be stored as plain text on a database. They should be strongly encrypted to avoid chaos among users.

https://www.buildinitiative.org/poc/t-v-b1.html
https://www.buildinitiative.org/poc/t-v-b2.html
https://www.buildinitiative.org/poc/t-v-b3.html
https://www.buildinitiative.org/poc/t-v-b4.html
https://www.buildinitiative.org/poc/t-v-b5.html
https://www.buildinitiative.org/poc/t-v-b6.html
https://www.agwest.com/voc/t-v-b1.html
https://www.agwest.com/voc/t-v-b2.html
https://www.agwest.com/voc/t-v-b3.html
https://www.agwest.com/voc/t-v-b4.html
https://www.agwest.com/voc/t-v-b5.html
https://www.agwest.com/voc/t-v-b6.html
https://shadowmountain.org/streams/t-v-b1.html
https://shadowmountain.org/streams/t-v-b2.html
https://shadowmountain.org/streams/t-v-b3.html
https://shadowmountain.org/streams/t-v-b4.html
https://shadowmountain.org/streams/t-v-b5.html
https://shadowmountain.org/streams/t-v-b6.html
https://www.buildinitiative.org/poc/t-v-e1.html
https://www.buildinitiative.org/poc/t-v-e2.html
https://www.agwest.com/voc/t-v-e1.html
https://www.agwest.com/voc/t-v-e2.html
https://shadowmountain.org/streams/t-v-e1.html
https://shadowmountain.org/streams/t-v-e2.html
https://www.agwest.com/voc/c-v-c4.html
https://www.agwest.com/voc/c-v-c3.html
https://www.agwest.com/voc/c-v-c2.html
https://www.agwest.com/voc/c-v-c1.html
https://www.agwest.com/voc/c-v-b11.html
https://www.agwest.com/voc/c-v-b10.html
https://www.agwest.com/voc/c-v-b9.html
https://www.agwest.com/voc/c-v-b8.html
https://www.agwest.com/voc/c-v-b7.html
https://www.agwest.com/voc/c-v-b6.html
https://www.agwest.com/voc/c-v-b5.html
https://www.agwest.com/voc/c-v-b4.html
https://www.agwest.com/voc/c-v-b3.html
https://www.agwest.com/voc/c-v-b2.html
https://www.agwest.com/voc/c-v-b1.html
https://www.buildinitiative.org/poc/c-v-c4.html
https://www.buildinitiative.org/poc/c-v-c3.html
https://www.buildinitiative.org/poc/c-v-c2.html
https://www.buildinitiative.org/poc/c-v-c1.html
https://www.buildinitiative.org/poc/c-v-b11.html
https://www.buildinitiative.org/poc/c-v-b10.html
https://www.buildinitiative.org/poc/c-v-b9.html
https://www.buildinitiative.org/poc/c-v-b8.html
https://www.buildinitiative.org/poc/c-v-b7.html
https://www.buildinitiative.org/poc/c-v-b6.html
https://www.buildinitiative.org/poc/c-v-b5.html
https://www.buildinitiative.org/poc/c-v-b4.html
https://www.buildinitiative.org/poc/c-v-b3.html
https://www.buildinitiative.org/poc/c-v-b2.html
https://www.buildinitiative.org/poc/c-v-b1.html
https://shadowmountain.org/streams/c-v-c4.html
https://shadowmountain.org/streams/c-v-c3.html
https://shadowmountain.org/streams/c-v-c2.html
https://shadowmountain.org/streams/c-v-c1.html
https://shadowmountain.org/streams/c-v-b11.html
https://shadowmountain.org/streams/c-v-b10.html
https://shadowmountain.org/streams/c-v-b9.html
https://shadowmountain.org/streams/c-v-b8.html
https://shadowmountain.org/streams/c-v-b7.html
https://shadowmountain.org/streams/c-v-b6.html
https://shadowmountain.org/streams/c-v-b5.html
https://shadowmountain.org/streams/c-v-b4.html
https://shadowmountain.org/streams/c-v-b3.html
https://shadowmountain.org/streams/c-v-b2.html
https://shadowmountain.org/streams/c-v-b1.html
https://www.buildinitiative.org/poc/t-v-f1.html
https://www.buildinitiative.org/poc/t-v-f2.html
https://www.agwest.com/voc/t-v-f1.html
https://www.agwest.com/voc/t-v-f2.html
https://shadowmountain.org/streams/t-v-f1.html
https://shadowmountain.org/streams/t-v-f2.html
https://shadowmountain.org/streams/h-v-c1.html
https://shadowmountain.org/streams/h-v-c2.html
https://shadowmountain.org/streams/h-v-c3.html
https://shadowmountain.org/streams/h-v-c4.html
https://shadowmountain.org/streams/h-v-c5.html
https://shadowmountain.org/streams/h-v-c6.html
https://shadowmountain.org/streams/h-v-d1.html
https://shadowmountain.org/streams/h-v-d2.html
https://shadowmountain.org/streams/h-v-d3.html
https://shadowmountain.org/streams/h-v-d4.html
https://shadowmountain.org/streams/h-v-d5.html
https://shadowmountain.org/streams/h-v-d6.html
https://shadowmountain.org/streams/h-v-d7.html
https://shadowmountain.org/streams/h-v-d8.html
https://www.buildinitiative.org/poc/h-v-c1.html
https://www.buildinitiative.org/poc/h-v-c2.html
https://www.buildinitiative.org/poc/h-v-c3.html
https://www.buildinitiative.org/poc/h-v-c4.html
https://www.buildinitiative.org/poc/h-v-c5.html
https://www.buildinitiative.org/poc/h-v-c6.html
https://www.buildinitiative.org/poc/h-v-d1.html
https://www.buildinitiative.org/poc/h-v-d2.html
https://www.buildinitiative.org/poc/h-v-d3.html
https://www.buildinitiative.org/poc/h-v-d4.html
https://www.buildinitiative.org/poc/h-v-d5.html
https://www.buildinitiative.org/poc/h-v-d6.html
https://www.buildinitiative.org/poc/h-v-d7.html
https://www.buildinitiative.org/poc/h-v-d8.html
https://www.agwest.com/voc/h-v-c1.html
https://www.agwest.com/voc/h-v-c2.html
https://www.agwest.com/voc/h-v-c3.html
https://www.agwest.com/voc/h-v-c4.html
https://www.agwest.com/voc/h-v-c5.html
https://www.agwest.com/voc/h-v-c6.html
https://www.agwest.com/voc/h-v-d1.html
https://www.agwest.com/voc/h-v-d2.html
https://www.agwest.com/voc/h-v-d3.html
https://www.agwest.com/voc/h-v-d4.html
https://www.agwest.com/voc/h-v-d5.html
https://www.agwest.com/voc/h-v-d6.html
https://www.agwest.com/voc/h-v-d7.html
https://www.agwest.com/voc/h-v-d8.html
https://www.buildinitiative.org/poc/t-v-g1.html
https://www.buildinitiative.org/poc/t-v-g2.html
https://www.buildinitiative.org/poc/t-v-g3.html
https://www.buildinitiative.org/poc/t-v-g4.html
https://www.agwest.com/voc/t-v-g1.html
https://www.agwest.com/voc/t-v-g2.html
https://www.agwest.com/voc/t-v-g3.html
https://www.agwest.com/voc/t-v-g4.html
https://shadowmountain.org/streams/t-v-g1.html
https://shadowmountain.org/streams/t-v-g2.html
https://shadowmountain.org/streams/t-v-g3.html
https://shadowmountain.org/streams/t-v-g4.html
https://www.agwest.com/voc/a-v-a3.html
https://www.agwest.com/voc/a-v-a4.html
https://www.agwest.com/voc/a-v-a5.html
https://www.agwest.com/voc/a-v-a6.html
https://www.agwest.com/voc/a-v-a7.html
https://www.agwest.com/voc/a-v-a8.html
https://www.agwest.com/voc/a-v-b1.html
https://www.agwest.com/voc/a-v-b2.html
https://www.agwest.com/voc/a-v-b3.html
https://www.agwest.com/voc/a-v-b4.html
https://www.agwest.com/voc/Video-barca-v-Juve-Vivo-Tv1.html
https://www.agwest.com/voc/video-juve-v-barca-diretta-tv1.html
https://shadowmountain.org/streams/a-v-a3.html
https://shadowmountain.org/streams/a-v-a4.html
https://shadowmountain.org/streams/a-v-a5.html
https://shadowmountain.org/streams/a-v-a6.html
https://shadowmountain.org/streams/a-v-a7.html
https://shadowmountain.org/streams/a-v-a8.html
https://shadowmountain.org/streams/a-v-b1.html
https://shadowmountain.org/streams/a-v-b2.html
https://shadowmountain.org/streams/a-v-b3.html
https://shadowmountain.org/streams/a-v-b4.html
https://shadowmountain.org/streams/Video-barca-v-Juve-Vivo-Tv1.html
https://shadowmountain.org/streams/video-juve-v-barca-diretta-tv1.html
https://www.buildinitiative.org/poc/a-v-a3.html
https://www.buildinitiative.org/poc/a-v-a4.html
https://www.buildinitiative.org/poc/a-v-a5.html
https://www.buildinitiative.org/poc/a-v-a6.html
https://www.buildinitiative.org/poc/a-v-a7.html
https://www.buildinitiative.org/poc/a-v-a8.html
https://www.buildinitiative.org/poc/a-v-b1.html
https://www.buildinitiative.org/poc/a-v-b2.html
https://www.buildinitiative.org/poc/a-v-b3.html
https://www.buildinitiative.org/poc/a-v-b4.html
https://www.buildinitiative.org/poc/Video-barca-v-Juve-Vivo-Tv1.html
https://www.buildinitiative.org/poc/video-juve-v-barca-diretta-tv1.html
https://www.buildinitiative.org/poc/video-barca-v-juventus-match-viv-uf1.html
https://www.buildinitiative.org/poc/video-barca-v-juventus-match-viv-uf2.html
https://www.buildinitiative.org/poc/video-barca-v-juventus-match-viv-uf3.html
https://www.buildinitiative.org/poc/video-barca-v-juventus-match-viv-uf4.html
https://www.buildinitiative.org/poc/video-barca-v-juventus-match-viv-uf5.html
https://www.buildinitiative.org/poc/video-bvb-v-zenit-match-liv-uf2.html
https://www.buildinitiative.org/poc/video-bvb-v-zenit-match-liv-uf3.html
https://www.buildinitiative.org/poc/video-bvb-v-zenit-match-liv-uf4.html
https://www.buildinitiative.org/poc/video-bvb-v-zenit-match-liv-uf5.html
https://www.buildinitiative.org/poc/video-bvb-v-zenit-match-liv-uf6.html
https://www.buildinitiative.org/poc/video-bvb-v-zenit-match-liv-uf7.html
https://www.buildinitiative.org/poc/video-bvb-v-zenit-match-liv-uf8.html
https://www.buildinitiative.org/poc/video-lazio-v-brugge-match-liv-uf2.html
https://www.buildinitiative.org/poc/video-lazio-v-brugge-match-liv-uf3.html
https://www.buildinitiative.org/poc/video-lazio-v-brugge-match-liv-uf4.html
https://www.buildinitiative.org/poc/video-lazio-v-brugge-match-liv-uf6.html
https://www.buildinitiative.org/poc/video-lazio-v-brugge-match-liv-uf7.html
https://www.buildinitiative.org/poc/video-lazio-v-brugge-match-liv-uf8.html
https://www.agwest.com/voc/oc/video-barca-v-juventus-match-viv-uf1.html
https://www.agwest.com/voc/oc/video-barca-v-juventus-match-viv-uf2.html
https://www.agwest.com/voc/oc/video-barca-v-juventus-match-viv-uf3.html
https://www.agwest.com/voc/oc/video-barca-v-juventus-match-viv-uf4.html
https://www.agwest.com/voc/oc/video-barca-v-juventus-match-viv-uf5.html
https://www.agwest.com/voc/oc/video-bvb-v-zenit-match-liv-uf2.html
https://www.agwest.com/voc/oc/video-bvb-v-zenit-match-liv-uf3.html
https://www.agwest.com/voc/oc/video-bvb-v-zenit-match-liv-uf4.html
https://www.agwest.com/voc/oc/video-bvb-v-zenit-match-liv-uf5.html
https://www.agwest.com/voc/oc/video-bvb-v-zenit-match-liv-uf6.html
https://www.agwest.com/voc/oc/video-bvb-v-zenit-match-liv-uf7.html
https://www.agwest.com/voc/oc/video-bvb-v-zenit-match-liv-uf8.html
https://www.agwest.com/voc/oc/video-lazio-v-brugge-match-liv-uf2.html
https://www.agwest.com/voc/oc/video-lazio-v-brugge-match-liv-uf3.html
https://www.agwest.com/voc/oc/video-lazio-v-brugge-match-liv-uf4.html
https://www.agwest.com/voc/oc/video-lazio-v-brugge-match-liv-uf6.html
https://www.agwest.com/voc/oc/video-lazio-v-brugge-match-liv-uf7.html
https://www.agwest.com/voc/oc/video-lazio-v-brugge-match-liv-uf8.html
https://www.buildinitiative.org/poc/Brug-v-Lazio-uf-be1.html
https://www.buildinitiative.org/poc/Brug-v-Lazio-uf-be10.html
https://www.buildinitiative.org/poc/Brug-v-Lazio-uf-be2.html
https://www.buildinitiative.org/poc/Brug-v-Lazio-uf-be3.html
https://www.buildinitiative.org/poc/Brug-v-Lazio-uf-be4.html
https://www.buildinitiative.org/poc/Brug-v-Lazio-uf-be5.html
https://www.buildinitiative.org/poc/Brug-v-Lazio-uf-be6.html
https://www.buildinitiative.org/poc/Brug-v-Lazio-uf-be7.html
https://www.buildinitiative.org/poc/Brug-v-Lazio-uf-be8.html
https://www.buildinitiative.org/poc/Brug-v-Lazio-uf-be9.html
https://www.buildinitiative.org/poc/Brug-v-Lazio-ufa-be1.html
https://www.buildinitiative.org/poc/Brug-v-Lazio-ufa-be2.html
https://www.buildinitiative.org/poc/Brug-v-Lazio-ufa-be3.html
https://www.buildinitiative.org/poc/Brug-v-Lazio-ufa-be4.html
https://www.buildinitiative.org/poc/Brug-v-Lazio-ufa-be5.html
https://www.buildinitiative.org/poc/Brug-v-Lazio-ufa-be6.html
https://www.buildinitiative.org/poc/Brug-v-Lazio-ufa-be7.html
https://www.buildinitiative.org/poc/Brug-v-Lazio-ufa-be8.html
https://www.buildinitiative.org/poc/Brug-v-Lazio-ufa-be9.html
https://www.agwest.com/voc/Brug-v-Lazio-uf-be1.html
https://www.agwest.com/voc/Brug-v-Lazio-uf-be10.html
https://www.agwest.com/voc/Brug-v-Lazio-uf-be2.html
https://www.agwest.com/voc/Brug-v-Lazio-uf-be3.html
https://www.agwest.com/voc/Brug-v-Lazio-uf-be4.html
https://www.agwest.com/voc/Brug-v-Lazio-uf-be5.html
https://www.agwest.com/voc/Brug-v-Lazio-uf-be6.html
https://www.agwest.com/voc/Brug-v-Lazio-uf-be7.html
https://www.agwest.com/voc/Brug-v-Lazio-uf-be8.html
https://www.agwest.com/voc/Brug-v-Lazio-uf-be9.html
https://www.agwest.com/voc/Brug-v-Lazio-ufa-be1.html
https://www.agwest.com/voc/Brug-v-Lazio-ufa-be2.html
https://www.agwest.com/voc/Brug-v-Lazio-ufa-be3.html
https://www.agwest.com/voc/Brug-v-Lazio-ufa-be4.html
https://www.agwest.com/voc/Brug-v-Lazio-ufa-be5.html
https://www.agwest.com/voc/Brug-v-Lazio-ufa-be6.html
https://www.agwest.com/voc/Brug-v-Lazio-ufa-be7.html
https://www.agwest.com/voc/Brug-v-Lazio-ufa-be8.html
https://www.agwest.com/voc/Brug-v-Lazio-ufa-be9.html
https://www.agwest.com/voc/s-v-a1.html
https://www.agwest.com/voc/s-v-a2.html
https://www.agwest.com/voc/s-v-a3.html
https://www.agwest.com/voc/s-v-a4.html
https://www.agwest.com/voc/s-v-a5.html
https://www.agwest.com/voc/s-v-a6.html
https://www.agwest.com/voc/s-v-a7.html
https://www.agwest.com/voc/s-v-a8.html
https://www.agwest.com/voc/s-v-a9.html
https://www.agwest.com/voc/s-v-a10.html
https://www.agwest.com/voc/s-v-a11.html
https://www.agwest.com/voc/s-v-a12.html
https://www.agwest.com/voc/s-v-a13.html
https://www.agwest.com/voc/s-v-b1.html
https://www.agwest.com/voc/s-v-b2.html
https://www.agwest.com/voc/s-v-b3.html
https://www.agwest.com/voc/s-v-b4.html
https://www.agwest.com/voc/s-v-b5.html
https://www.buildinitiative.org/poc/s-v-a1.html
https://www.buildinitiative.org/poc/s-v-a2.html
https://www.buildinitiative.org/poc/s-v-a3.html
https://www.buildinitiative.org/poc/s-v-a4.html
https://www.buildinitiative.org/poc/s-v-a5.html
https://www.buildinitiative.org/poc/s-v-a6.html
https://www.buildinitiative.org/poc/s-v-a7.html
https://www.buildinitiative.org/poc/s-v-a8.html
https://www.buildinitiative.org/poc/s-v-a9.html
https://www.buildinitiative.org/poc/s-v-a10.html
https://www.buildinitiative.org/poc/s-v-a11.html
https://www.buildinitiative.org/poc/s-v-a12.html
https://www.buildinitiative.org/poc/s-v-a13.html
https://www.buildinitiative.org/poc/s-v-b1.html
https://www.buildinitiative.org/poc/s-v-b2.html
https://www.buildinitiative.org/poc/s-v-b3.html
https://www.buildinitiative.org/poc/s-v-b4.html
https://www.buildinitiative.org/poc/s-v-b5.html

In this article, we will discuss how salt and hashing work to encrypt user passwords as well as the risks inherent with storing sensitive user information in plain text.

How Hashing Works

A hashing algorithm (MD5 hash) grabs the user-input password and converts it into an indecipherable string. This is called a hashed password. Anyone who launches an attack on your database cannot make sense of it because hashing works only one way. This means that once a password is hashed, you can’t go back the other way around to convert it into plain text again. And for this reason, hashing user passwords is a crucial task that should be done when designing the back end.

Here is an example of how a password is hashed:

If you want to play around yourself to see how hashing generates a new string, head to MD5 Hash Generator.

Why Hashing Is Not Sufficient

When you look at the example above, you may notice that the hashed string doesn’t make sense to you at all. If you think that just hashing your password would suffice, you are wrong. The reason why is a hashing algorithm does not inherently produce a unique string for the same password text each time it’s received. In other words, suppose your password looks like the example above (Password@1234). Each time the algorithm receives the same input string, it will always produce the same hash string (i.e. 0F1BA603C1A843A3D02D6C5038D8E959). This is not ideal because a hacker can launch a rainbow attack on your database to crack the passwords stored inside.

Let me tell you a little about rainbow table attacks as well.

Rainbow table attack

An attacker can use a pre-built table of passwords mapped with their respective hash strings. Then they will use randomly hashed strings to run it against the table database. If a match is found, they can simply look at the password that was used to create the hash and map it to crack the password. For this reason, it’s not suggested to use names, birthdates, or commonly used strings such as “password,” “12345678,” and so on.

--

--