How to encrypt and decrypt password in php
In this example , we are learning how to encrypt and decrypt password in php.
Php Provide md5() function to encrypt password. Using md5() function we can store data in encrypted format and can secure password using md5().
Let's see the Example :-
File Name : index.php
Output :
Php Provide md5() function to encrypt password. Using md5() function we can store data in encrypted format and can secure password using md5().
Let's see the Example :-
File Name : index.php
1 2 3 4 5 6 7 8 9 10 | <?php $password = "Hello"; $encrypt = md5($password); echo "Your password before encrypted is : ".$password."<br/>"; echo "Encrypted password [HELLO] : ".$encrypt."<br>"; if($encrypt == md5($password)) { echo "Your Decrypt password : ".$password; } ?> |
Output :
Encrypt password in php, How to encrypt and decrypt password in php, md5() function in php, Php Tutorial