Ask HN: Which technology should I use for client-side web encryption?
All encryption will take place on the browser, using Open PGP standards. The server will see only encrypted data.
I can't decide between using Javascript/HTML5 and a hidden Java applet to do the bulk of the work.
Advantages of Java:
* Much faster for bitwise crypto operations (a significant concern).
* With the right permissions, it can load files directly from the hard drive and encrypt them in memory. As far as I know, this isn't possible with Javascript - the only way to upload a file is to submit it directly to the server though a form. This could be a dealbreaker for Javascript - though alternatively, I could use Java for only this specific task and everything else could be in JS.
* I can use direct socket communication to reduce latency (the page is likely to be very chatty).
* More crypto libraries already exist.
Advantages of JS/HTML5:
* Not Java
* Will work on the iPhone/iPad immediately (otherwise, if I went commercial, I'd have to develop an app).
* More transparent, giving technical users a greater sense of security.
Thoughts?
10 comments
[ 2.6 ms ] story [ 31.1 ms ] threadIt's not tremendously secure from a client-side perspective: if the client machine is compromised, so is your data. But that's not the goal. This is not a tool for spies, this is a tool for everyday people so they can have an unimpaired communication tool while having complete peace of mind that nobody is mining, selling or distributing their data.
What you end up with is a slow, unintelligent website, with fewer features and untargeted advertising that can't recommend friends. It can't do anything useful that social networking butterflies are interested in, and it's one that people who use secure services because it's fun to be paranoid aren't interested in either, because it's not actually secure, and it's a site that's more expensive to run and more complicated.
Don't do it.
You've already lost. If someone can compromise your server, they can serve up a web page containing modified code.
However, the client-side code will be open source and digitally signed.
It's not perfect, and you shouldn't use it for state secrets, but it's a damn sight better than anything out there right now.