This question already has an answer here:
- How to securely hash passwords? 13 answers
I'm using the Haskell Codec.Crypto.SimpleAES package to create a crude password manager. The password manager seems secure but it's unable to warn the user when the decryption key is invalid. If a user supplies a bad decryption key, the program just sends back garbage instead of an "Invalid Decryption Key" error.
I want to give the user an error when a bad decryption key is supplied. The easiest way I can think of doing this is to hash the decryption key and save it in a local file when the password manager is initialized. From then on, whenever a user requests a password, the program would then check the supplied decryption key against the hashed value before invoking the decryption algorithm. If the key didn't match the hash, the program would send back an error, but if the key did match, the program would decrypt the requested password and send it back to the user.
If the password manager stores a hashed instance of the decryption key in a local file, would that significantly lower security?