Home > Backend Development > PHP Tutorial > MediaWiki user password encryption method

MediaWiki user password encryption method

巴扎黑
Release: 2016-11-29 11:46:56
Original
1199 people have browsed it

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.


source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template