I just figure it out, looking around a bit and drawing a space. I would like to see if this is possible until I see a way to do this.
I want to encrypt a file locally (in a browser using existing libraries) before downloading it. Then I will need to restore and decrypt it before presenting the file to the user. In particular, I cannot send the file to the server for encryption before storage. Encryption / decryption must be done on the client side.
Here is a rough flow of what I need to do:
- Present the file widget to the user.
- Read the client side script file (i.e. upload it locally)
- Encrypt it on the client.
- Download the encrypted version, clear the client part and save the data.
And vice versa:
- Download the saved, encrypted version of the file.
- Decrypt it on the client.
- Present the decrypted file back to the user as a download.
I was looking for some kind of MIME encoding on the client (similar to how email attachments are encoded MIME before sending in plain text). I'm particularly interested in the jQuery method, like what the rest of my application uses, but plain old javascript will be fine.
Any thoughts or pointers are greatly appreciated. This is the one I reflect on the holidays. So, well in advance for any comments.
javascript jquery mime file-upload
Mark
source share