|
|
|
|
|
by Stefan_H
5098 days ago
|
|
I do not see this as premature optimization. Do you store timezone information with your dates even if you are not operating in a different time zone? Do you store measurement information with a unit even if you love inches? I would say that it is certainly planning ahead, but it is not a premature optimization. It is planning for the all-to-likely event that you will need to start hashing your passwords in a different way. "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.