Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MD5 purpose or uses

If we can't decode the MD5 hash string, then what is the purpose of MD5 where can we use MD5.

like image 912
Siddiqui Avatar asked Dec 02 '22 05:12

Siddiqui


2 Answers

To store data save in a database for example.

If you save your password using md5 and you compare it with the password you enter in a form and hash it, it is still the same password but you can't see it in clear text in the database.

For example:

password = 123  
md5(123) === "202cb962ac59075b964b07152d234b70"

if you try to log in and you enter 123 as your password, the md5 of it will still be the same and you can compare those. But if your database is hacked the hacker cannot read the password in clear text, only the hashed value

like image 120
Robert Avatar answered Dec 18 '22 13:12

Robert


An decryptable file has the property that its always at least as big as the original file, a hash is much, much smaller.

This allows us the create a hash from a file that can prove the integrity of the file, without storing it.

There are many reasons not to store the file in encrypted or plain text:

  • As soon as an encrypted file falls in the wrong hands, they could try to decrypt it. There's no chance that's going to happen with a hash.

  • You simply don't need the file yourself, but maybe you're sending it to someone, and that person can proof it's integrity using the hash.

like image 22
Georg Schölly Avatar answered Dec 18 '22 14:12

Georg Schölly