I would like to encrypt some user data with the zero-knowledge architecture. I reference the implementation of the bitwarden and don't understand some parts.
First, I would like to use the the argon2 to derive the key instead of pbkdf2, since it seems like argon2 is more secure since it resists parallel brute force.
Second, what is the purpose of HKDF to stretch the master key(256bit) to 512bit, why cannot use the master key to encrypt the generated symmetric key directly?
Third, can I use the master key to encrypt the user data directly instead of generating a new symmetric key and use it to encrypt the user data?
Fourth, why the master password hash is created by just 1 iteration, instead of 100,000?
Based on my understanding, here are my answers:
I am not fully sure about their reasons but I believe that these could be some possibilities.