String_Manipulation / Crypt


1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:

<?php

$password 
crypt("My1sTpassword"); # let salt be generated

# You should pass the entire results of crypt() as the salt for comparing a
# password, to avoid problems when different hashing algorithms are used. (As
# it says above, standard DES-based password hashing uses a 2-character salt,
# but MD5-based hashing uses 12.)
if (crypt($user_input,$password) == $password) {
   echo 
"Password verified!";
}
?>

Description

  One-way string encryption (hashing)