Android Tutorial , Programming Tutorial, Php Tutorial, Learn Android, HTML Tutorial, Coding , Java Tutorial, GTU Programs, Learning Programming

Tuesday, 25 October 2016

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


 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 :



Like us on Facebook

Site Visitor

Powered by Blogger.