The method used in PHP to generate the MD5 encrypted password:
$salt = genSalt();
$password1 = crypt($password, $salt)
--------------------------------------
function genSalt () {
$random = 0;
$rand64 = "";
$salt = "";
$random=rand(); // Seeded via initialize()
// Crypt(3) can only handle A-Z a-z
$rand64= "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
$salt=substr($rand64,$random % 64,1).substr($rand64,($random/64) % 64,1);
$salt=substr($salt,0,2); // Just in case
return($salt);
}
©
Iain Begg