Is using Argon2 for both password storage and key derivation secure? I'm planning on using different salt values, of course.
The basic concept is something like this:
Alice has some secret data ($data_e$) on her account. It's encrypted with an Argon2 derived key from her password, using a random salt.
$$ k = \operatorname{Argon2}(\text{password}, \text{salt}_1, \text{iteration})$$ $$ \text{data}_e = \operatorname{E}_k(\text{data})$$
Alice's password is stored as an Argon2 derived key from her password, using a random salt. When Alice (or an adversary) wants to log in, a key is derived from the input using Alice's password salt and checked for a match.
$$\text{storedPWD} = \operatorname{Argon2}(\text{password}, \text{salt}_2, \text{iteration})$$
- Should the secret data be encrypted with Alice's raw password?
- Should her data to be encrypted with a random key encrypted with her raw password? With a key derived from her password?
You should assume that Alice is a trained system administrator who understands the risk of having a weak password. The password will have at least 12 characters, will include capital and small letters and have numbers.
Also assume that the login system is bruteforce-resistant, but think about the possibility of a database breach.
Thanks in advance.