Given the following assumptions:
- A server's availability is implicitly trusted, but it is not trusted to keep data private (for reasons such as having questionable security or being suspect to government warrants).
- The client software is implicitly trusted (for instance, due to being open source software, possibly developed by a third party).
- The communication between the client and server is trusted to be private (for instance, due to being encrypted by TLS).
Are there any security primitives that allow a client to supply a password instead of an encryption key in order to appropriately secure encrypted data that's stored on a remote server? Is it secure for the client software to XOR a data encryption key with a hash of the user's password for the server, then to store the result on the server in order to later regenerate the original encryption key? If this (either in general or though the outlined process) is inherently insecure, what makes it insecure?