Home  >  Article  >  Backend Development  >  MediaWiki user password encryption method

MediaWiki user password encryption method

巴扎黑
巴扎黑Original
2016-11-29 11:46:561115browse

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.


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn