How can we encrypt password using PHP?

crypt () function is used to create one way encryption. It takes one input string and one optional parameter. The function is defined as: crypt (input_string, salt), where input_string consists of the string that has to be encrypted and salt is an optional parameter. PHP uses DES for encryption. The format is as follows:

<?php

$password= crypt("tutorialswebsite");

echo $password." is the encrypted version of tutorialswebsite";
?>

 

Related posts