The question is in the title, but here are more details:
I want my server to have an upload endpoint (single POST for small data or multipart for larger data) where clients can upload data.
- Clients can upload only encrypted data that I can't possibly decrypt (only the clients know the encryption key).
- I want to be able to verify that the data I receive is in fact encrypted like that.
- Ideally (if possible) the proof-of-encryption is part of the authentication process so any significant uploading (e.g. of megabytes) can't even begin without such proof. Alternatively, I'm okay with just checking the data afterwards and deleting it from the server if the proof-of-encryption fails (not ideal as I temporarily store unencrypted data, but acceptable).
Solution idea (disregard if I'm on the wrong track)
I think the first step is to require the client to grab a nonce from the server, but then I got stuck. Is it somehow possible to
- Combine the client's passphrase with the nonce client side, and
- Verify server-side that the data I receive was encrypted with the nonce combined with the (unknown to me) passphrase?