I am currently developing a piece of software where files need to be uploaded and then shared with other people that are not on the platform itself.
Here is my approach on encryption:
- A user has a master password, of which only the hash is stored (used for login)
- When a file is uploaded by the user, a random password will be
generated and the file will be encrypted with it (all client-side) - The password will be encrypted with the master password, and then
stored alongside the file
When a file is shared with an outside user, the following steps are taken:
- The logged in user shares the file. The file key is retrieved and decrypted with the users password on the client side
- The user may now share the password and the file, or use a link to the file with the password in the location hash. The file will always be decrypted on the client side
Is this approach safe? Also, are there any better options?