I want to make a web service where we can Login in this system with username and password. After the user select a file from his computer and send this file on server. I want encrypt this file to a group of users (I want use ABE cryptography). Now what are the steps to make them ?
My idea is: Login to the system with basic username and password. I store the username and password to my database in a table.
After with ABE cryptography where can I save the Master Private Key and the Master Public Key ? In my database ?
After login, the system make a secret key of the user. I save my secret key in my database. After I use the Master Public Key to encrypt the file (I recovery it from a SQL query) and upload it on my server and when I recover the file, I decrypt it with my secret key (I recover it with SQL query).
Is this approch correct ? Is there an approch more correctly ?