News for hackers. Stuff that matters.
Re:FileKit: An open source end-to-end encrypted cloud storag... by tptacek on Thursday August 29, 2019 @03:18PM (#20832677)
No, it's not drastically better than it was in 2013.

People have done lots of things with browser cryptography, that's true. But none of what they've done addresses or mitigates the central flaw of browser javascript cryptography, which is that to use it, you have to continuously and durably trust the server. If you're doing that, you might as well just do the cryptography serverside.

Re:FileKit: An open source end-to-end encrypted cloud storag... by tzs on Thursday August 29, 2019 @05:27PM (#20833886)
The issue of having to trust the server also applies in a lot of non-browser cases. For example, I have to trust the 1Password update server, or forego 1Password updates.

It looks like the issues with browser-based cryptography from those two articles fall into three broad groups.

1. You have to trust the server.

2. The browsers don't do a good job of letting a site's JavaScript keep things secret from other things running in the browser.

3. If you implement cryptography in JavaScript, you are probably going to screw it up. There's a lot more to doing it right than just knowing to use AES and whatever the currently favored hash function is.

#1 is probably acceptable in a lot of cases, and #3 can probably be addressed by using the Webassembly version of libsodium.That leaves #2 as the apparently insurmountable issue.

Suppose the user was willing to create a separate Firefox or Chrome profile just for using my web-based app, and did not install any browser plug-ins under that profile, set its home page to my app page, and never used that profile to visit any other sites.

How close would that come to dealing with #2?

Re:FileKit: An open source end-to-end encrypted cloud storag... by pvg on Thursday August 29, 2019 @10:18PM (#20835458)
The issue of having to trust the server also applies in a lot of non-browser cases. For example, I have to trust the 1Password update server, or forego 1Password updates.

These are not quite the same kinds of trust - nearly every request to a compromised web app server is an opportunity to inject malicious code and malicious UI and compromise the clientside part of the app.

Compromising a software update server doesn't necessarily get you any of that - for instance, your 1Password client will presumably verify the authenticity of the update before it applies it.

Re:FileKit: An open source end-to-end encrypted cloud storag... by goliatone on Thursday August 29, 2019 @08:26PM (#20834949)
Re #2 There’s this [1] tc39 proposal.

You could also hack a solution using dynamic method names and Symbols.

[1] https://github.com/tc39/proposal-private-methods/blob/master...

Re:FileKit: An open source end-to-end encrypted cloud storag... by csande17 on Thursday August 29, 2019 @11:15PM (#20835693)
I don't think the private methods proposal will help with cryptography at all. The "security" it provides boils down to making it difficult for code outside the class to access the value, like you can already do with closures like this:

    function makeCounter() {
      var x = 0;
      return function() { return ++x; };
    }
It doesn't help at all with side-channel attacks, which are the main reason why it's hard to safely perform cryptographic operations in a just-in-time interpreted language like JavaScript. It also doesn't stop rogue scripts on the same page from pulling the user's passwords/keys right out of the password field, URL bar, localStorage, or wherever else your script gets them from.
Re:FileKit: An open source end-to-end encrypted cloud storag... by javajosh on Thursday August 29, 2019 @06:22PM (#20834300)
the central flaw of browser javascript cryptography, which is that to use it, you have to continuously and durably trust the server

What do you think of doing JavaScript Crypto in a browser extension? An extension runs code in the browser without persistent trust of a server (at least in the traditional webapp way; you have to persistently trust the extension update server, extension authors, chrome update server, etc). You could do things like quickly, interactively encrypt chunks of text with a symmetric key. Presumably you'd use an extension UI to enter your keys, to avoid keylogging.

I think it would be illuminating to have a small suite of well-implemented cryptographic primitives, curated by a well-known expert, installed and ready to use on any string in the browser.

(BTW why don't we see more random chunks of cyphertext everywhere? It would seem to me a good channel, to use a combination of public forums to transfer short bursts of cyphertext. Where are the encrypted Twitter broadcasts??)

Re:FileKit: An open source end-to-end encrypted cloud storag... by tptacek on Thursday August 29, 2019 @08:45PM (#20835042)
I don't love browser extensions but the trust model issues with it are not identical to content-controlled Javascript.
Re:FileKit: An open source end-to-end encrypted cloud storag... by tipiak on Friday August 30, 2019 @04:21AM (#20836740)
The issue with browser extensions, is that you are not far away from the common hurdles of developing, using and releasing a "real" desktop/mobile application. Having nothing to install and landing on a page that just works, is a big plus for you users.
Re:FileKit: An open source end-to-end encrypted cloud storag... by devoply on Thursday August 29, 2019 @03:58PM (#20833016)
I wonder why browsers don't build their own browser api for file and mail crypto ... and that way you don't have to trust the server. And you can verify that the server is using browser crypto.
Re:FileKit: An open source end-to-end encrypted cloud storag... by adamredwoods on Thursday August 29, 2019 @05:04PM (#20833660)
I wonder if we'd even need the server at any capacity for encryption by that point.
Re:FileKit: An open source end-to-end encrypted cloud storag... by espadrine on Thursday August 29, 2019 @03:34PM (#20832819)
My understanding of FileKit is that you do trust the Tanker server, but only for delivering JS and handling identities.

It only contains public keys and encrypted DEKs (data encryption keys); see this image: https://docs.tanker.io/filekit/latest/going-further/file-enc...

The file content should therefore only be accessible by holders of private keys for which the file was encrypted.

Re:FileKit: An open source end-to-end encrypted cloud storag... by tptacek on Thursday August 29, 2019 @03:34PM (#20832823)
There's no difference between trusting the server to deliver Javascript cryptography source code and trusting the server with your secrets. The server can just deliver code (in a number of different ways) to compromise those secrets.
Re:FileKit: An open source end-to-end encrypted cloud storag... by danShumway on Thursday August 29, 2019 @04:56PM (#20833572)
Well... there's no technical difference.

My understanding from the Apple/FBI fiasco is that it's an open question whether the US government is legally able to compel you to write and deliver custom code to your clients. But any local judge can issue you a warrant to hand over encrypted customer data that you're holding the key to.

But IANAL, maybe my take on that is overly simplistic.

Re:FileKit: An open source end-to-end encrypted cloud storag... by blastrock on Thursday August 29, 2019 @05:46PM (#20834022)
Actually, Filekit is meant to be integrated into an application, and that application is responsible for delivering JS and handling identities, not the Tanker server.
Re:FileKit: An open source end-to-end encrypted cloud storag... by dane-pgp on Thursday August 29, 2019 @08:00PM (#20834825)
Interestingly, the technology of Signed HTTP Exchanges could potentially be used as the basis for a system that removes the need to trust the server. The current Internet-Draft even includes a section on the Binary Transparency use case:

https://wicg.github.io/webpackage/draft-yasskin-http-origin-...

What's still missing, I think, is a way for a publisher to tell a browser "Only run new code from this domain after checking that the user is happy to upgrade". That would put the "web app" on roughly the same security footing as a desktop application with a built-in update system.

Re:FileKit: An open source end-to-end encrypted cloud storag... by dboreham on Thursday August 29, 2019 @05:06PM (#20833678)
Wondering...browsers do seem to be able to do secure crypto in two existing scenarios: when presenting a client TLS certificate; and when performing authentication via WebAuthn in conjunction with U2F. Would it be possible to re-purpose either of those mechanisms to do other potentially useful secure crypto (e.g. sign blockchain transactions)?
Re:FileKit: An open source end-to-end encrypted cloud storag... by chatmasta on Thursday August 29, 2019 @09:09PM (#20835157)
I don't see how you have to trust the server unless it's also serving the client bundle. There are many decentralized use cases where you might "bring your own client" (or maybe one trusted server gives it to you) and use the client to interact with other untrusted servers.

You can have a trusted client and an untrusted server.