I'm building a intranet solution for a company using PHP.
One of their desired functionalities is storing payrolls, absence and personal information. They need this to be accessible for the employee himself/herself and to the management, but this is a tech company - with tech savvy people - so they need it to be impossible to recover from the database without the private key, even with root access to the server
What i'm thinking is using RSA to generate a key pair and store the public key for each person in the database, and then when information is added by a employee they share the data with the desired people using their public key (duplicating the db rows for each person with access). The private key could then be encrypted with AES and stored in the db.
- Is this a good solution?
- Is it possible to pair this with a hashing function so they can use a password and not the entire key to decrypt?
- Any PHP Classes (with examples?) that i can work out from?
Any suggestions and tips are most welcome.