I just think that starting out planning for password hash function migration, when it's easy to retrofit later, is a bad case of premature optimization.
I just think that starting out planning for password hash function migration, when it's easy to retrofit later, is a bad case of premature optimization.
"when it's easy to retrofit later" - I think this is the key part of your statement. When is it easy to retrofit later? You then have to pick your poison:
1. Switch entire system over to new hashing function - reset all user's passwords 2. Add in interoperability of hashing functions - what I'm suggesting you do from the beginning, making it much easier to do.
Number 1 is a horrible user experience, number 2 is much easier to do from the onset.
There is a third way that is not poison:
No need to reset the passwords at one fell swoop.
When you decide to do a new password storage function:
New users get the new hash right away.
Calculate the new hash and the old hash when the user next logs in.
If the old hash matches, the user has logged in, and now calculate the new hash and store it over the old hash in the table. Perhaps make a note in a separate column that the hash has been converted.
Eventually, when all users have refreshed their passwords, quietly remove the old way.
Zero user involvement.
I like the method that link provided, but there are some drawbacks, needing to update every user record with a new hash (offline process) - this is almost guaranteed to require taking the site down, which most people do not like to do. This is because you can't have some users with the old hashing process ,and some with the new.