I need to develop a system where a user can upload a file via browser which encrypts the file and stores it on my server. After the file is uploaded other user can download the file with an iOS or android app and decrypt it to view it. The problem is I shouldn't be able to decrypt the file on my server, because the files are potentially very sensitive. Now, I don't have any real knowledge about encryption and don't know where to start. Do you have any hint what is best practice for this kind of end to end encryption?
I have come up with an idea of how my security scheme should look like.
- The CMS client logs in and his password is used from now on as upload key (later used)
- On the CMS side, later app user (potential file receiver) are created, with a login password (for the app) and a download key (later used) to decrypt the downloaded files.
- The CMS client sends the app users their login password and download key in separate mail (no email)
- The CMS client uploads a file which gets encrypted with a random key (later used) in the browser and stored on server 1. The random key and the reference to the file are getting encrypted with the upload key and stored on server 2.
- The CMS client selects app user (one ore more) to view the uploaded files. In this moment, the random key and the file reference (from the 3. step) are getting decrypted with the upload key. This decrypted package gets duplicated and encrypted with the download key of the selected app user (this step is done for every selected app user, therefor we will have multiple packages for every app user)
Is this approach close or am I heading in the wrong direction?