Live data from Hacker News

Tanker: End-to-End Encryption SDK for JavaScript

github.com

81–90 of 100 posts

Re: Tanker: End-to-End Encryption SDK for JavaScript

#81
https://docs.tanker.io/latest/guide/device-unlocking/#end-to...

> If you want your app to be fully end-to-end, you can use the lower level > unlock mechanisms, which are all end-to-end compliant

So if I want to use the SDK in a "fully" end-to-end secure way, I first need to implement by myself a secure way to transmit the user root secret (the unlock key) between the user's devices, and make sure this key is always accessible so that users don't loose access to their data. This doesn't seem like an easy task...

Re: Tanker: End-to-End Encryption SDK for JavaScript

#82
post #21
post #13

Earlier quoted context omitted.

Subresource integrity can help a bit. You still need to bootstrap from a trusted source though (eg a minimal index.html stored locally). And at that point, you really are back to figuring out a way to distribute a "known good" piece of software. https://developer.mozilla.org/en-US/docs/Web/Security/Subres... Ed: it might, for example be easier to email an attached minimal html file, than a 50mb electron app (multiply…

You would still have to combine SRI with a fairly strong CSP to avoid any code execution except SRI-covered stuff. It would be a good PoC I guess, but not practical yet for most people.

CSP would only be necessary if the SRI-covered stuff had bugs that let it accidentally load unverified resources. (To be clear, I think CSP is a necessary defense-in-depth measure for everyone, but this case doesn't uniquely require it.)

Re: Tanker: End-to-End Encryption SDK for JavaScript

#83
post #5
post #4

The issue with client-side, in-browser encryption is that you cannot audit or trust the software. Without fingerprinting/certification of the entire javascript-source the server could serve a manipulated source code that exfiltrates data, targeted only at specific users, i.e. not the auditors. Think NSLs or sufficiently crafty industrial espionage. CSPs do not save you here. You can't TOFU in-browser JS, you can't tr…

Could it be done with a browser extension?

This is what the webext-signed-pages [1] extension does. This only works in a secure manner with Firefox though because Chrome extensions don't have access to the content of the HTTP responses [2].

[1] https://github.com/tasn/webext-signed-pages [2] https://bugs.chromium.org/p/chromium/issues/detail?id=487422

Re: Tanker: End-to-End Encryption SDK for JavaScript

#84

E2E encryption in JS in browser will never be secure. In a client with shared threads and untrusted content on the page it will always be vulnerable to timing attacks. It's unrealistic to create a constant-time implementation in JavaScript. For node/backend this is great but please don't use it on a public site.

Genuine question - is this what you're referring to? Very curious.

https://www.usenix.org/system/files/conference/usenixsecurit...

Re: Tanker: End-to-End Encryption SDK for JavaScript

#85

I keep asking, what is the threat model for end-to-end encryption in JS? Like, is there an Alice, Bob, Carol, Eve story under which E2E in JS makes sense? The canonical example that doesn't make sense is when Alice and Bob want to communicate privately using Eve as a webmail/chat provider who wants to snoop in on the communications. Alice and Bob can't just trust Eve to provide a copy of E2Ejs in a tag on EveMail.com…

Download (and check the hash, like any other application) a static one page "app" that you can open anywhere later and use to communicate/post information from any network you happen to be at?

Re: Tanker: End-to-End Encryption SDK for JavaScript

#86
post #4

The issue with client-side, in-browser encryption is that you cannot audit or trust the software. Without fingerprinting/certification of the entire javascript-source the server could serve a manipulated source code that exfiltrates data, targeted only at specific users, i.e. not the auditors. Think NSLs or sufficiently crafty industrial espionage. CSPs do not save you here. You can't TOFU in-browser JS, you can't tr…

> Without fingerprinting/certification of the entire javascript-source the server > could serve a manipulated source code that exfiltrates data

This is actually one of the described use cases of the new webpackage specification: https://tools.ietf.org/html/draft-yasskin-webpackage-use-cas...

Here is the current draft: https://wicg.github.io/webpackage/draft-yasskin-dispatch-web...

Re: Tanker: End-to-End Encryption SDK for JavaScript

#87

I keep asking, what is the threat model for end-to-end encryption in JS? Like, is there an Alice, Bob, Carol, Eve story under which E2E in JS makes sense? The canonical example that doesn't make sense is when Alice and Bob want to communicate privately using Eve as a webmail/chat provider who wants to snoop in on the communications. Alice and Bob can't just trust Eve to provide a copy of E2Ejs in a tag on EveMail.com…

As others have posted, JS is much more than script tags in the browser. There's also React Native, Electron, Node, and many other less well known platforms for JS outside of the browser. Additionally, browser E2E encryption depends on trusting the provider just as WhatsApp or iMesssage depend on trusting Facebook or Apple. The browser is really just another delivery mechanism for code that runs on the client and you…

> EDIT: To be clear, the browser is a code distribution platform, just like the App Store.

Not exactly the same, and the difference is important.

An iOS app is an iOS app is an iOS app: every user gets the same app. Malicious updates to bonafide releases cannot be targeted to specific users and will be distributed to everybody. Same for playstore.

A browser effectively requests an update, directly, every single time the app is started.† Updates can be targeted very precisely, both to a time and a user.

Circumventing this difference is not a detail, and eliding that when talking about browsers, honestly, implies regular use. Including the behaviour described above.

† An exception is a trick using web workers and github which appeared on HN a while back. That was an actual novice use for JS crypto.

Re: Tanker: End-to-End Encryption SDK for JavaScript

#88
post #81

https://docs.tanker.io/latest/guide/device-unlocking/#end-to... > If you want your app to be fully end-to-end, you can use the lower level > unlock mechanisms, which are all end-to-end compliant So if I want to use the SDK in a "fully" end-to-end secure way, I first need to implement by myself a secure way to transmit the user root secret (the unlock key) between the user's devices, and make sure this key is always a…

No, the unlock key is for the user to keep, and never be transmitted by anyone else than the user themselves. If you do the transmission, it's not end to end anymore.

This option is only for users concerned about security, the other unlock methods are less strong but still provide security.

Re: Tanker: End-to-End Encryption SDK for JavaScript

#89

I keep asking, what is the threat model for end-to-end encryption in JS? Like, is there an Alice, Bob, Carol, Eve story under which E2E in JS makes sense? The canonical example that doesn't make sense is when Alice and Bob want to communicate privately using Eve as a webmail/chat provider who wants to snoop in on the communications. Alice and Bob can't just trust Eve to provide a copy of E2Ejs in a tag on EveMail.com…

How about a different scenario?

Eve is not the threat. Eve is going along serving email for Alice and Bob just fine for quite a while.

Then one day Fred compromises Eve. Fred can dump data directly out of Eve's database. Depending on how Fred gains access, full disk encryption, database encryption, row-level encryption, etc. might or might not present themselves as layers of security that he must bypass. If Fred has compromised the running service, he will likely have access to the data and any keys, source material needed to derive the keys, or external decryption mechanisms (HSMs, database-side services) from within the service itself.

If the messages inside of the database have been encrypted on the clients with keys not held in the server (E2E), Fred now has another layer of defense in front of him, only this one requires Fred to inject script into the clients to scrape the necessary keys. When the client is running Javascript in the browser, this is obviously easier than on clients deployed through some other mechanism, but still more difficult than being able to get everything Fred needs in memory in the server.

Mainly, it's another layer of defense, and if the service is using it for other clients, a browser-based client would need to have it to function anyway (even if that weakens the security of the users choosing to use it).

An alternate scenario is that Eve is also not a threat, but is instead a business that doesn't want the liability of having certain material in the plain inside of its premises ever.

Re: Tanker: End-to-End Encryption SDK for JavaScript

#90

I keep asking, what is the threat model for end-to-end encryption in JS? Like, is there an Alice, Bob, Carol, Eve story under which E2E in JS makes sense? The canonical example that doesn't make sense is when Alice and Bob want to communicate privately using Eve as a webmail/chat provider who wants to snoop in on the communications. Alice and Bob can't just trust Eve to provide a copy of E2Ejs in a tag on EveMail.com…

How about a different scenario? Eve is not the threat. Eve is going along serving email for Alice and Bob just fine for quite a while. Then one day Fred compromises Eve. Fred can dump data directly out of Eve's database. Depending on how Fred gains access, full disk encryption, database encryption, row-level encryption, etc. might or might not present themselves as layers of security that he must bypass. If Fred has…

> Eve is not the threat.

But Eve is where the attacks are going to come from. Whether it's Eve's intention, or was under coersion by Fred makes no difference to the end user. Browser E2E encryption is at best marginally harder to break, but it gives the user a bigger sense of privacy than it deserves, may be to the detriment of the unlearned user.

Post reply on HN