I realize this is often described as a bad idea. So first of all I'll state motivation - feel free to critique this.
Creating a product for an industry which tends to be overly concerned with security. The product needs to store and return user files but they do not need to be readable server side.
I feel that by encrypting client side would reduce the trust required from clients. Their confidential data would only be touched by JavaScript which they could inspect and monitor. It also mean any security issues server side which would allow access to stored data do not result in client documents being available (exception being if they can modify served JS).
My ideal solution would be -
- Key generated and injected to all clients users by clients IT team.
- JavaScript uses key to encrypt documents client side. These are then sent to the server and stored.
- On retrieval documents are decrypted again client side.
There seem to be several libraries to support client side crypto. But Currently I see no way to persistently store a key for the user. Ideally this would be in a similar fashion to adding certificates to the browsers store - i.e. they can be injected once.
Does anyone have any suggestions?