MyBB's Password Encryption Method?
#5
/**
 * Generates a random salt
 *
 * @return string The salt.
 */
function generate_salt()
{
	return random_str(8);
}

/**
 * Salts a password based on a supplied salt.
 *
 * @param string The md5()'ed password.
 * @param string The salt.
 * @return string The password hash.
 */
function salt_password($password, $salt)
{
	return md5(md5($salt).$password);
}

$pass = $mybb->input['password'];

$md5pass = md5($pass);
$salt = generate_salt();

$salted_pass = salt_password($md5pass, $salt);

The value of $salted_pass is what you find in the database.
All my plugins are available for free at MyBB Extend and on my GitHub. MyBB-Plugins.com has been closed and none of my plugins are officially maintained or supported.


Messages In This Thread
MyBB's Password Encryption Method? - by Spencer - 2010-08-13, 04:40 AM
RE: MyBB's Password Encryption Method? - by KuJoe - 2010-08-13, 04:51 AM
RE: MyBB's Password Encryption Method? - by KuJoe - 2010-08-13, 05:25 AM
RE: MyBB's Password Encryption Method? - by Diogo Parrinha - 2010-08-13, 10:16 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)