com.mohiva.play.silhouette.password
The log2 of the number of rounds of hashing to apply.
Hashes a password.
Hashes a password.
This implementation does not return the salt separately because it is embedded in the hashed password. Other implementations might need to return it so it gets saved in the backing store.
The password to hash.
A PasswordInfo containing the hashed password.
Gets the ID of the hasher.
Gets the ID of the hasher.
The ID of the hasher.
Indicates if a password info hashed with this hasher is deprecated.
Indicates if a password info hashed with this hasher is deprecated.
In case of the BCrypt password hasher, a password is deprecated if the log rounds have changed.
The password info to check the deprecation status for.
True if the given password info is deprecated, false otherwise. If a hasher isn't suitable for the given password, this method should return None.
Checks if a password matches the hashed version.
Checks if a password matches the hashed version.
The password retrieved from the backing store.
The password supplied by the user trying to log in.
True if the password matches, false otherwise.
Implementation of the password hasher based on BCrypt.
The designers of bcrypt truncate all passwords at 72 characters which means that
bcrypt(password_with_100_chars) == bcrypt(password_with_100_chars[:72]). The originalBCryptPasswordHasherdoes not have any special handling and thus is also subject to this hidden password length limit.BCryptSha256PasswordHasherfixes this by first hashing the password using sha256. This prevents the password truncation and so should be preferred over theBCryptPasswordHasher. The practical ramification of this truncation is pretty marginal as the average user does not have a password greater than 72 characters in length and even being truncated at 72 the compute powered required to brute force bcrypt in any useful amount of time is still astronomical. Nonetheless, we recommend you useBCryptSha256PasswordHasheranyway on the principle of "better safe than sorry".https://crypto.stackexchange.com/questions/24993/is-there-a-way-to-use-bcrypt-with-passwords-longer-than-72-bytes-securely
https://docs.djangoproject.com/en/1.10/topics/auth/passwords/#using-bcrypt-with-django
gensalt