I'm making a cloud-based service. So, basically, my users will be able to upload files (any type of files) and they will be uploaded to a server. I am aware that I have two options:
- Upload the files first and let the back-end handle the encryption
- Encrypt the files first and upload then to the back-end
I want to use the second one. I think the first one is the more standard and better method. But in my instance, I think the second one would be better. That means the encryption would be done right on the user's device, therefore I need the algorithm to be fast and efficient. So, what encryption algorithm should I use to encrypt any kind of file, in a reasonable amount of time? I have no issue with the encrypted file being bigger than the original, just need it to be fast.
I know the question is vague since it might have more to do with programming, but any pointing in the right direction will be helpful.
Νote: I should add that a third-party service provides me with the user authentication and a back-end server that allows me to store files. So, the server itself and the communication between the user's phone and the server is secure, because those are implemented by the third-party service, who I trust. The only thing I need is to able to encrypt the files that are uploaded.