To protect user's sensitive data, I am considering the following 2 approaches:
- Create 1 data encrypting key (DEK) for each user, use it to encrypt (using AES CBC mode with a random IV for each encryption operation) all data of the same user. DEK is protected and stored separately from data.
- Use multiple DEKs, 1 each time a new piece of user data needs to be encrypted (using AES/CBC with IVs like above). The DEK is then ecrypted using a KEK corresponding to that user, and stored side by side (e.g. same row in database) with the data that is ecrypted with it. The KEK is stored securely, separatedly from the data and DEK.
Is there known vulnerabilities in AES/CBC with good random IVs? What is the benefit of the 2nd approach, other than minimizing the amount of data encrypted with the same key, thus reduce the risk of being cryptanalyzed?