The Guide
Explain It Like I'm 5Information SecurityIntegrity

Hashing

What's hashing and how is it useful?

What Is It?

Hashing is a one way mathematical function that receives an input (can be anything really) and outputs a value with a predetermined character length (This allows us to hide how long the input really was because no matter the length of the input, the output will always be the same length)

Purpose

Hashing has 2 main purposes:

  1. Verifying our data has not been tempered with in any way (Integrity)
  2. Prevent saving users clear text passwords in our databases (Confidentiality)

Example 1:

A user wants to download a movie but it's inside a zip file that his friend made for him to save space

Q: How can he verify that the file he's downloading is safe and untempered with?

A: His friend can send him the hash he got after zipping the movie and the user can then download the file and verify the hash matches his friend's

Example 2:

A developer wants to make a new platform that hopefully will replace Facebook

Q: How should he store user passwords in his database?

A: He should get an hash from the user actual password and store the hash in the database (In the real world the developer should also use salt and pepper, more on that later)

On this page