Let's say that I have a website that allows users to upload files (much like Dropbox), and I need to encrypt those files so that only the users that have access to them can view the file data. Users need to be able to view the file names/sizes via a web interface (but nobody else should be able to), and download the unencrypted version when they want to. What would the most secure encryption setup be?
It seems to me that you could encrypt a decryption key with the users password (and associate that key with that user only/use it to encrypt his/her data), but then in order to access the file information or allow them to download the file data the server would have to have access to the decryption key past the login point. This would require persisting the user password in some capacity (or saving the decryption key) with the session, both of which seem very insecure. It has also occurred to me that we could (somewhat?) securely store a master key, but then the user data is at risk if that key is stolen.
How is this done in practice? Also, if anyone out there has any good articles/posts on this topic I'd be extremely interested to read them.