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
>
>

Reply via email to