View Single Post
  #14  
Old 8th December 2011, 12:18
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,075
Thanks: 826
Thanked 5,396 Times in 4,240 Posts
Default

Quote:
$password = crypt($_POST['password']);
Thats not crypt-md5 encryption. Crypt can create many different algorithms, see php manual. Take a look here on how to create a crypt-md5 password.

Code:
function crypt_password($cleartext_password) {
		$salt="$1$";
		$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
		for ($n=0;$n<8;$n++) {
			$salt.=$base64_alphabet[mt_rand(0,63)];
		}
		$salt.="$";
		return crypt($cleartext_password,$salt);
	}
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote