|
|
|
you use one that you make up. maybe like this:
$salt = substr(0, 2, md5(Date());
$encrypted = crypt($string, $salt);
The salt merely ensures that if 2 people have the same password, their
"crypted" representations are not the same (unless they use the same
salt). When you want to compare a password, you first find the already
encrypted one, grab the salt (the first 2 chars), and then encrypt the
password and compare it. |
|
| PHP Function to Encrypt/Decrypt a string without a known key. The string itself has his own different key for every character. Categories : PHP, Algorithms, Security, Authentication, Encryption | | | Using $PHP_AUTH_USER and $PHP_AUTH_PW to authenticate. Categories : Authentication, PHP | | | Function to remember password Categories : PHP, Authentication, Personalization and Membership | | | Boolean Keyword Interpreter Categories : PHP, Algorithms, Search Engines | | | Prime number finder (Sieve of Erastothenes) Categories : PHP, Algorithms, Math. | | | Dollar Serial Number Validator Categories : PHP, Security, Algorithms | | | Using Postgres and PHP3 Authentication from a Web application Categories : PostgreSQL, HTML and PHP, Authentication, PHP | | | PHP4 MYSQL Authentication Script with cookie. Short & Sweet
Categories : Authentication, Apache, Cookies, PHP, MySQL | | | Validation function for LUHNMod10 and variant. Can discriminate credit card numbers of varying lengths. Uses [Double >> Sum-of-Digits] transform. Categories : Credit Cards, Authentication, Ecommerce, PHP | | | The Porter Word Stemming Algorithm in PHP
Reduces words to their base stem for search engines and indexing Categories : Algorithms, PHP, Strings | | | Mail-lib provides a simple interface to the sendmail program. Note: you must actually have sendmail on your machine (sorry windows NT users). Categories : Algorithms, Email, PHP | | | A recursive function to traverse a multi-dimensional array where the
dimensions are not known Categories : Arrays, PHP, Algorithms | | | Full membership authentication system. Categories : Authentication, MySQL, PHP, Databases | | | Kasskooye($path) tell you the complete size of a folder
Categories : PHP, Algorithms, Utilities, Filesystem | | | Authenticator for Exchange Server LDAP Categories : PHP, Authentication, LDAP, Security, Sessions | |
| | | | Teeranai Thamshutiporn wrote : 199
I try to use your salt but It said :
Warning: Wrong parameter count for date()
in /home/internet/public_html/admin/passwd.php3
What`s wrong ?
I wanna To Check and Change Password on Linux vai PHP3
code [My Server use MD5]. Do you have same code ?
Regards,
Teeranai Thamshutiporn
| | | | Matt Szubrycht wrote :392
Hi,
You need to provide the format of the date ...
I would use the number of seconds since the epoch,
therefore, it should looks somewhat like this:
$salt = substr(0, 2, md5(Date("U")));
$encrypted = crypt($string, $salt);
That should do the trick, at least it works on my Cobalt
RAQ3 running Linux.
Regards,
Matt
| |
|
|