Manual:$wgPasswordDefault

Revision as of 02:56, 17 May 2024 by Svartava (talk | contribs) (Reverted edits by 2400:C600:3448:F8BF:1:0:6D6A:3BE7; if you disagree with this rollback, please leave a message on my talk-page.)
Authentication: $wgPasswordDefault
Default password type to use when hashing user passwords.
Introduced in version:1.24.0 (Gerrit change 77645; git #95a8974c)
Removed in version:Still in use
Allowed values:(string)
Default value:'pbkdf2'

Details

Default password type to use when hashing user passwords. A and B are considered insecure by modern standards. PBKDF2 and bcrypt are considered to be of moderate security level and Argon2 is the most secure value of currently supported options. After changing this setting, users will have their password updated to the new format on next login.

Changing the default

  1. Check the "DefaultSettings.php" file in the ../includes directory for the available and preset password encryption types.
    (As of MW 1.33: A, B, pbkdf2-legacyA, pbkdf2-legacyB, bcrypt, pbkdf2, argon2)
  2. Add $wgPasswordDefault with the parameter to the "LocalSettings.php" file in case you want to change the encryption, e.g. to restore the old MD5 hashing:
    $wgPasswordDefault = 'B';
    
  3. In order for the password to be saved in a new format, one login from each user has to be done. This way the database is updated.
    Alternatively you can use the wrapOldPasswords.php maintenance script to convert the hashing algorithm of all passwords without waiting for users to log in. Note that this script only works for pbkdf2-legacyA, pbkdf2-legacyB.
  4. Check in the MySQL-database whether the new format has been applied to the fields.
    Select user_password from wikidbname.user where user_password like ':B:%';
    

See also