I assume that when you say that encryption keys should not be stored on the device, you really mean this :-) Because, if this restriction was not there, you can use KeyStore . However, this will mean that the keys are stored on the device, which does not seem to be the way you want.
So, assuming that the encryption keys are external to the device, this is somewhat straightforward, since there is no choice: the client application asks the user to enter the encryption key in some way (up to you), which he uses to encrypt the data, and then immediately forgets encryption key.
Then it sends the encrypted data to the server where it is stored. The server does not know the encryption keys, so the server is just an opaque data block.
When a user wants to receive data, they must provide a decryption key in place, since it is not stored on the device.
source share