I am trying to figure out how to create the best solution for my project. I made this simple picture in Photoshop to try to illustrate the problem and how I want it (if possible).
Illustrative image
I will also try to explain this based on the figure. Firstly, we have a couple of objects on the left, these objects are all encrypted using our own encryption key (EKey in the picture), and then they are stored in the database. On the other hand, we have different users placed in roles (one user can have many roles), and roles are associated with different objects. Thus, one person has access to the objects that the role provides. So, for example, Role A can have access to objects A and B. Role B has access only to object C, and Role C has access to all objects. Nothing strange about that, right? Different roles have different objects that they can access.
Now to the problem.
Each user must log in with his username / password, and then he gets access to the objects that provide his roles. All objects are encrypted, so she needs to somehow get the decryption key. I do not want to store the encryption key as a text string on the server. If possible, it should be decrypted using the user's password (along with the role) or the like. Thus, you must be a user on the server to decrypt the object and work with it.
I was thinking about creating a public / private key encryption system, but I am a little fixated on how to provide decryption keys for objects to various users. Since I need to be able to move users to and from roles, add new users, add new roles and create / delete objects.
, , .
, , .
:
-Encrypted objects.
- .
- .
- .