I am going to store secrets from users. The secrets need to be stored confidentially. For this question, I am concerned only with confidentiality (not integrity).
Here is how my encryption scheme is:
- We start with a 20-character randomly generated alphanumeric password.
- A new 128-bit salt is generated randomly for each user secret to be stored.
- The 20-character password and the 128-bit salt is passed through a HMAC-SHA256-based PBKDF2 function to derive a new 256-bit encryption key for each user secret to be saved.
- A new 128-bit initialization vector is generated for each user secret to be saved.
- The 256-bit encryption key and the 128-bit initialization vector is used to perform AES-256-CBC encryption of the secret and arrive at the ciphertext.
- The salt, initialization vector, and the resulting ciphertext are all saved together.
I want to know if in steps 2 and 3, is it necessary to run the password through PBKDF2 every time for every new secret to be protected?
Or can we just run the password through PBKDF2 only once and use that key for all secrets to be protected?
Is there any provable benefit of generating a different key (with PBKDF2) for each user secret even if we start with the same alphanumeric password every time?