As I am fairly new to cryptography, I would like to understand how to, in a simple way, implement a system that would achieve the following: the user would have to setup a password, which would then be used to:
1.) encrypt the data provided by the user and save it in an encrypted form and 2.) to authenticate the user when using the system the next time and decrypt his data.
When searching for viable solutions I found the following two approaches:
a.) The password is hashed and the hash is later used to authenticate the user. The combination of the plain text password and its hash is used to generate a key for the encryption and decryption.
b.) The password is hashed and a key is derived from its hash to encrypt the data. The authentication is solved by comparing some know plain text to a part of the decrypted data. If there is a match, the user entered the correct password.
I would be grateful for a simple and clear explanation.
I would be also thankful for any references on this specific topic.