I\'ve been asked to implement some changes/updates to an intranet-site; make it \'future proof\' as they call it.
We found that the passwords are hashed using the MD5
You should change your password database to store 3 items:
Of course these could just be stored together in one text field with a delimiter:
"SHA256:this-is-salt:this-is-hash-value"
Now convert you existing entries to a value with empty salt and the old algorithm
"MD5::this-is-the-old-md5-hash-without-salt"
Now you have enough information to verify all you existing password entries, but you can also verify new entries (since you know which hash function was used). You can convert the old entries to the new algorithm the next time the existing users login since you will have their password available during this process:
Eventually, after this system has been running for a suitable time, you can disable accounts that haven't been converted (if desired).
The addition of a random salt string unique to each entry makes this scheme much more resistent to dictionary attacks using rainbow tables.