Password Hashes in PHP

Posted by Unknown On Sunday, 20 January 2013 2 comments

Password Hashes in PHP

Hello friends now we are discussing about some simple security tricks in php, mainly on handling passwords using php. This section explains why password hashing and how can we use hashing.


Every god programmer’s know storing password in form of clear text is bad method of programing .this make user and programmer at risk. This is the main reason why password hashing is used .password hashing are working on the basics of cryptography.
In cryptography, a cryptographic hash function is a transformation that takes an input and   returns a fixed-size string, which is called the hash value.”
By applying hashing algorithm’s they make user’s password’s make difficult to Attackers. PHP offers so simple inbuilt methods to create hashes, such as md5 (), sh1 (), ssha () etc.


How hashing in PHP

There are different algorithm’s for creating a hash of a test most popular are md5() and sha()now we disusing about those two first.
                $str = "Hello";
                echo md5($str);
 The output of the code above will be:


                $str = 'Hello';
                 echo sha1($str);
 The output of the code above will be:


In the above example md5 can create a 128 bit of hash from given text, and second one is sha1. It can make 160 bit hash from given password text. But md5 and sha algorithms can decrypt easly with help of rainbow we need to use next level algorithms.



Anonymous said...

This info is worth everyone's attention. Where can I find out more?

My web blog ... anteporticos

Gomoo said...

Nice :)

visit us.

Post a Comment