hmm
this look like one of thounsends stupid algoritms for salts ...but i
don't need this....
here is what i ask for:
1.user want to changs his password , created with vpopmail - vadduser...
2. i want to check is this user knows his old password, so i ask him to
enter his old password and crypt it the same way as vpopmail, compare it
with current password stored in mysql.
3. if new crypted password match stored password i get new entered
password and crypt it and update mysql table....
4. other ...
sorry for bad english...
thanks
Bozhan
Sean C Truman wrote:
> This shoud beable to start you out on the correct path.
>
> Sean
> <?
> //**************************************************************************
> ***************************
> //* Creates Encrypted Password
> //**************************************************************************
> ***************************
> // Usage $encrypt_password = mkpasswd("this is a test");
>
> function randltr() {
> srand ((double) microtime() * 1000000);
> $retval = ord("a");
> $rand = rand()%64;
> if ($rand < 26) $retval = $rand+ord("a");
> if ($rand > 25) $retval = $rand-26+ord("A");
> if ($rand > 51) $retval = $rand-52+ord("0");
> if ($rand == 62) $retval = ord(";");
> if ($rand == 63) $retval = ord(".");
> return chr($retval);
> }
>
> function mkpasswd($newpasswd) {
> $salt = randltr().randltr();
> $password = crypt($newpasswd,$salt);
> return $password;
> }
> ?>
>
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, May 28, 2001 9:34 PM
> Subject: passwords?
>
>
>
>>hi
>>does anyone can tell me how to write php funchtion to check passrods
>>cratetd with vpopmail and stored in mysql.
>>i found that mkpass3 creates passwords whit some salts..
>>i think i can crypt new password with curren crypterd passowrd but i have
>>to get it from myswl tables and so on...
>>can i make some function which to crypt gived from user password and to
>>compare with curent in mysql
>>
>>
>>thnkas
>>-------------------
>>Email sent using AnyEmail (http://netbula.com/anyemail/)
>>Netbula LLC is not responsible for the content of this email
>>
>>
>>
>
>