Support for a "pepper"
Created originally on Bitbucket by Anonymous
(Imported from Google Code)
Some password hashing systems make use of a so-called "pepper". Like a salt, but there is a single one, stored externally from the password database, and hopefully in a manner which is as difficult for an attacker to access as possible.
Typical scheme seems to be to create a wrapper hash format, which calculated orighash(hmac(password, pepper), salt)
.
Some systems also store multiple peppers, allowing migration if one is considered compromised.
Will have to study this some more, not currently sure if this provides any useful security protections (e.g. in the case of a database compromise). Also need to decide where to insert this - as an extension, as a feature of CryptContext, or as a separate hash algorithm?