Let me explain my dilemma. I'm a software developer and I'm writing a Windows application that should provide encryption of user's data. There could be multiple users in the database, each having their own username and password.
I currently encrypt data as such:
When a user logs in, I use PBKDF2 to authenticate their user name & password.
If login succeeds I keep the hash part from PBKDF2 in RAM & use it later as a
keyto encrypt and decrypt that user's data using AES-256 algorithm.
This seems to work, except that I now have a new set of requirements that don't work with my scheme above:
- There are two types of users:
- Employees can access only their own accounts.
- Administrators can access accounts of any other non-admin users.
- When new administrators are added, they too should be able to access data of existing non-admin users.
So I was trying to devise a plan for encryption but I can't seem to figure it out.