Why Hash Your Passwords

For security reason, you should always hash your passwords. In the event of if your system gets hacked. Hackers can easily access your user's info like credit card and other personal data.

Standard Hash

Most web developers just hash their passwords like this:

$data = "codewithmark";

//Method 1

md5($data);

//Method 2

hash('md5',$data);

//Output will be

72b55f9842f425f4b141725367d211da

More Password Hashing Options

Below is a table that contains all the different hash options in php

Hash NameCharacters In Length
md232
md432
md532
sha140
sha22456
sha25664
sha38496
sha512128
ripemd12832
ripemd16040
ripemd25664
ripemd32080
whirlpool128
tiger128,332
tiger160,340
tiger192,348
tiger128,432
tiger160,440
tiger192,448
snefru64
snefru25664
gost64
gost-crypto64
adler328
crc328
crc32b8
fnv1328
fnv1a328
fnv16416
fnv1a6416
joaat8
haval128,332
haval160,340
haval192,348
haval224,356
haval256,364
haval128,432
haval160,440
haval192,448
haval224,456
haval256,464
haval128,532
haval160,540
haval192,548
haval224,556
haval256,564

How To Hash

You can easily hash your password from the above table like this

//Syntax

hash(HashName, $data);

$data = 'codewithmark';

//Option 1

hash('sha512',$data);

//Option 2

hash('tiger128,3',$data);

//Option 3

hash('haval128,3',$data);





Name

Email

Website

Comment

Post Comment