by artursapek · 10y ago · 0 comments
new_hashing_scheme(old_hashing_scheme(password))
Not as elegant, but the benefit is you can immediately move everyone to a new scheme if you need to for some reason.Once the user has logged in successfully, you can replace new_hash(old_hash(password)) with simply new_hash(password).
This is less useful for optimistic upgrades like bcrypt->argon2i, but is absolutely critical if you find yourself taking over responsibility for a database that has a password column full of, say, MD5s.
Waiting for each and every user to log in to upgrade those vulnerable hashes is suicidal.