Supposed knowledge
Hash, Salting, PBKDF [1-2]
Problem
I store passwords in my database using a scaled hash / salting algorithm such as PBKDF2. I thought, βHey, if I use my passwords 20,000 times, should it be safe enough to brute force attack?β and it is true. until next year, when the best computers appear.
Possible Solution
Leaving aside the question about the length of the encryption key and the length of the salt (which can also be included in this solution), I thought that if every N days, I intercepted all the passwords in the database. Thus, they are hashed 20,000 times, then after a week, I have them even more than 500 times, which makes them a total of 20,500 times. Store the number of times it hashed in the database. The idea is to increase the number of hashes as technology advances.
Existing Similar Implementations
BCrypt introduces a work factor to increase the hash password time:
PBKDF2 uses several iterations to accomplish the same thing. It is used by Mac OS-X, windows and linux for file-level encryption. Wi-Fi networks also use its implementation.
Can anyone see a problem with this? Have you tried this already? Is there an algorithm that accepts a pre-hashed password and re-hashes it βNβ times?
Edit
The question is not that multiple hashing is safe (this has been verified and verified). The question is re-hashing to increase security without requiring users to reset their passwords
Solution: courtesy of a discussion with JVestry
Thus, re-hashing all passwords every "N" days is a waste of time, since a hacker can simply crack it using an old copy of the database. However , if you combine the concept of increasing the amount of hash memory over time before the password update policy, the concept will be sound.
Implementation
All passwords expire every 30 days. When they are updated, their hash counter increases. Therefore, resetting the password yesterday will be harder to crack than one set 20 days ago. The hash counter can be stored or retrieved from the algorithm using the last modified date.
Thanks!
TTD