I've been reading about it. This article helped me a lot. But the more I read the more complicated it seems. For example:
Is it better to use bcrypt, or PBKDF2, sha2 or something else for the salt? How do I add HMAC encryption passwords?
Suppose I have to store passwords (all information, hashes, salt .... ) in a single file.
I plan to do it this way:
- Obtain password from the end user.
- Create a salt.
- Create hash = SHA256(salt + password) and store salt together with hash in the file.
But I am not sure how to improve it. I do not understand how to use HMAC
Well the question is: What is the safest way to store a password in a single file? no matter the cost of the algorithm
PD: I am using JAVA.