Home > Article > Backend Development > MediaWiki user password encryption method
I studied Mediawiki two days ago.
Involves user password encryption. The encryption method is found in the source code as follows:
In GlobalFunctions.php:
/**
* Encrypt a username/password.
*
* @param string $userid ID of the user
* @param string $password Password of the user
* @return string Hashed password
*/
function wfEncryptPassword( $userid, $password ) {
global $wgPasswordSalt;
$p = md5( $password);
//$wgPasswordSalt is defined as true in defaultSettings.php.
if($wgPasswordSalt)
return md5( "{$userid}-{$p }" );
else
return $p;
}
However, I didn’t try this because I use other user verification systems, but this is the truth.