Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I submitted a Show HN yesterday what I believe a potential legitimate use case for javascript crypto (or more specifically, in-browser client-side crypto):

Bring Your Own Filesystem (https://github.com/diafygi/byoFS)

Example chat demo: https://diafygi.github.io/byoFS/examples/chat/

It seems like an unhosted-style app (unhosted.org) can mitigate all of the OP's concerns.

> Secure delivery of Javascript to browsers is a chicken-egg problem.

I address some this in the byoFS README[1] and again in an /r/crypto discussion[2].

Since the webapp is unhosted, the webapp is built to work when being served from anywhere, including your local filesystem. This means that you could download the webapp anonymously, inspect/audit/checksum it, then run it from your local filesystem in the browser (try it! just right click and Save As...). Alternatively, you could load it from a server that you would trust to kill itself rather than comply with a secret court-ordered compromise (e.g. Lavabit, Internet Archive, etc.).

Additionally, since the webapp is just static files, all the webapp server sees is anonymous requests (over https to prevent MITM). It doesn't know who is requesting the static files, so it would be difficult to perform a targeted malicious injection. You would have to broadcast the injection, which is generally ill-advised since it might be spotted by a vigilant third party. Most of the surveillance injection attacks that have been leaked have been targeted, so this basically cuts off that attack vector.

So, in order to compromise this webapp through injection, you'd have to hack into the trusted static server and blindly serve the injection to everyone who requests the webapp (hopefully including your target). This is basically the same attack vector you'd have to do if you were trying to inject something into a download-and-install local application.

I don't think javascript crypto is universally a good idea, but for this unhosted use case, it can limit attack vectors to the same as download-and-install local applications.

> Browser Javascript is hostile to cryptography.

True, which is why WebCryptoAPI should be prioritized, and I can stop using SJCL in byoFS. Once APIs for crypto primitives are baked into browsers, this argument disappears.

> The "view-source" transparency of Javascript is illusory.

It's certainly much better than inspecting desktop apps. Also, if your webapp is unhosted, you can certainly publish a signed hash of the static files, which can be verified after you download the app and before you run it.

One infrastructure improvement that might be very helpful would be to be able to buy an SSL certificate from a CA that is limited to a particular file hash, which the browser checks before showing the connection as "validated" (maybe a checkmark beside the https lock?).

[1] - https://github.com/diafygi/byoFS#security-and-philosophy

[2] - https://pay.reddit.com/r/crypto/comments/289w7x/bring_your_o...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: