Encrypt a file with nsIFile
I'm writing a firefox addon where a somewhat sensitive file needs to be encrypted and sent to the server. I'm trying to figure out the best way to do this in an addon, most likely using the nsIFile object. I haven't seen any documentation on this.
NOTE: I'm looking for solutions not using SSL. The reason for this is that I'm sending a file behind the scenes through the addon. I don't want to get a signed certificate, and the addon chokes behind the scenes when sending the 开发者_开发技巧file, needing users to approve the self-signed certificate.
Can't you just use HTTPS? This will encrypt the network traffic for you without you having to do it explicitly. Any out-of-band encryption you use to encrypt the file before sending are likely to use basically the same techniques (i.e. PKI) that underlies SSL anyway.
No documentation? https://developer.mozilla.org/en/nsIFile
精彩评论