Could you choose the number of PBKDF2 iterations based upon the system time?
I've heard a few people recommend that the number of iterations for PBKDF2 should be doubled every two years (starting with the recommended 1000 iterations in the year 2000 when PKCS #5 was released).
Theoretically at least, you could determine the ideal iterations through an equation based upon the current time. Perhaps something like:
year = <current time in years>
exponent = (year - 2000) / 2
iterations = 1000 x (2 ^ exponent)
Which would give a value of about 115,196 iterations at the time of writing.
Assuming that:
- The system clock can be trusted.
- The number of iterations is stored with the hash, so that hash verification is still possible.
- Safeguards are in place to stop the system attempting to hash with a ludicrous number of iterations.
- You continue to monitor the actual time taken to hash passwords on your specific hardware.
- You regularly upgrade hardware to keep up with the increasing performance requirements.
- You choose an appropriate underlying hash algorithm.
Would such a system be safe and practical?