Note: this page is outdated, moin now uses passlib, which has far stronger hashes (e.g. sha512_crypt [this is what we use by default], pbkdf2, bcrypt) than described below.

Password storage

MoinMoin uses password hashing to store user passwords - this is to protect the passwords even for cases when someone gets directly access to the storage (like an admin or intruder).

General considerations about salting

"Salting" a password with random data is necessary to prevent a couple of different attacks. One should append at least 64 bits of random, secret data to a password before hashing it.

If each password is simply hashed, identical passwords will have the same hash. There are two drawbacks to this:

In order to solve these problems, a salt can be concatenated to the password before the digest operation. A salt is a random string of a fixed bit length. This salt must be different for each stored entry, and must be stored as clear text in the persistence layer. The salt should be kept secret and never be displayed to users.

Moin 1.x

In Moin 1.9 the minimum required Python version was Python 2.4 (in Moin 1.8 it was still at Python 2.3).

SSHA (salted SHA1) password hashing is the default hashing method in Moin 1.9/1.8, using a string of 20 random characters as salt. SHA1 comes from Python's standard library.

/!\ In 2005, security flaws were identified in SHA1, namely that a mathematical weakness might exist, indicating that a stronger hash function would be desirable. According to Hashing article at PythonSecurity.com SHA2 hashing function with salting is currently the best solution for password storage, but Python 2.4 (2.3) does not offer SHA2 hashing functions in its standard library, so Moin 1.9 (1.8) will continue using SHA1.

SHA1 is still good hash function but it's not recommended to use it for storing security critical data any more.

Moin 2.x

In Moin 2.0 the minimum required Python version is 2.6.

SSHA256 (salted SHA256) password hashing was chosen as default hashing method in Moin 2.x using a string of 32 random characters as salt. SHA256 comes from Python's standard library.

Password storage implementation

Password hashing is implemented in MoinMoin/user.py. Function encodePassword(pwd, salt=None) is designed to encode a cleartext user password into the internal representation.

This function encodes a password in 5 steps:

This encoded password is stored.

User password migration from other systems

Moin wiki supports password migration from other systems (for moin2, this includes migration from moin1 SSHA passwords).

Supported passwords hashes:

Moin can validate a user password against a hash in a supported format. On successful validation, moin2 automatically upgrades the stored password to SSHA256 (moin 1.9/1.8 upgrades to SSHA).

MoinMoin: MoinMoin2.0/SecurePasswordStorage (last edited 2013-06-24 21:15:03 by dslb-094-217-118-181)