ProtonMail now the maintainer of OpenPGPjs email encryption library
protonmail.com
protonmail.com
(Second reaction was "Crypto in the browser in Javascript _again?_ Didn't was already point out this is 'doing it wrong'?")
Btw for example https://blockchain.info/wallet/#/ (in-browser bitcoin wallet) I think has never been hacked - you might say it's a huge outlier but it is possible to do well.
You could have an extension which checks the hash of the js/html payload against a publicly known and signed hash prior to running and rejects it otherwise. It's still browser crypto but potentially you do better than 'everything is broken if the ssl session is hijacked'.
This will thwart your nosy flatmate/little-brother.
This is reasonably likely to keep curious or nosy corporate IT or HR staff at bay if you use it at work. It's not going to keep a properly authorised and resourced corporate IT investigation/surveillance out - at least not for any hardware that's got corporate ssl roots installed (or device management that allows installation of those).
It'll likely keep local cops out. It's less likely to keep feds out if they're determined. It 100% will not help against people who've got browser trusted ssl signing roots and the ability to run QUANTUM on exploited backbone routers to deliver their own versions of the javascript appropriately ssl encrypted to you before the actual site has a chance to respond.
Lastly, I'm planning on implementing all of the best protections we have against man in the middle attacks currently like subresource integrity and HSTS. If the browser committees give me something better (maybe some sort of resource signing that can be verified on a secondary secure channel?) I'll implement it. So it may protect against more in the future.
If you piss off important enough people - law enforcement won't just go away when you say "the system isn't capable of doing that", they'll say "so re-write the system so it is, and if you tell anybody we'll put you in jail forever".
The FBI have seized and continued to run a child porn website before to gather evidence - do you _really_ think they'd hesitate before taking over your encrypted chat servers if they thought it'd get them a career-advancing prosecution? Do you think you'd fight as hard as Ladar did when the guys with guns come knocking at your door? (I have no doubt I'd cave pretty quickly - I've got a lot of respect for Ladar's resistance to selling out his users...)
It's not like I trust my browser and https any less than I trust my phone's baseband processor and it's NSL-able telco-end backdoorability...
I load https://webmail.example.com.
I see my email.
My ISP doesn't see my email.
The NSA (or anyone else who can MITM https, such as my workplace, college, etc.) can effectively turn it into http, and see the content.
We need to fix that.
So I write an encryption library in JS, loaded from https://webmail.example.com . It loads the email through an AJAX call from https://webmail.example.com, decrypts it, and displays it.
The only issue is that whoever can MITMed the connection can also modify the JS file to send the key to a C&C server.
So:
"Dumb" ISP can't read #1 mail
"MITM" ISP can read #2 mail
So what's the gain?
The only concern is that it's an active attack vs a passive attack, so no plausible deniability.
But in most MITM scenarios, you don't need plausible deniability.
1. Your workplace computer and the connection is owned by them, so they can do what they want with it.
2. Dictatorships give themselves whatever powers they want
3. The NSA has enough side-channel attacks to exploit.
So in which situation will a "JS" encryption help?
To be clear, unless NSA has some massive capabilities we haven't dreamed off, properly implemented HTTPS cannot be MITM'ed (via SSL stripping, or other means) by anyone who lacks access to your local machine. Specifically, by properly-implemented SSL, I mean:
1. Serving https only, no http
2. HSTS
3. Certificate pinning
The situation you mention regarding workplace computers is a little different from the NSA, since they have the explicit authority and ability to install root certificates on your local work computer. Without those root certs (like if you use a personal computer at work), they lack the ability to MITM your connection, assuming the above.
But yeah - short of nation-state or very high level LEO (who're just piggybacking on their local NSA equivalent), HSTS with pinned certs is as close to "secure" as we have right now.
It can in fact be "impossible" to steal ones crypto keys.
Or maybe I'm just in a way too "the whole world is fucked" mood today...
https://developer.mozilla.org/en-US/docs/Web/Security/Subres...
Also Javascript based client applications installed locally are becoming more common (think about Atom etc). Maybe we will soon also see Javascript based desktop IMAP client.
Nylas N1 is an example of this (and excellent, might I add)!
Here's a blog post with more details about Nylas N1 and PGP: https://nylas.com/blog/pgp