Live data from Hacker News

FileKit: An open source end-to-end encrypted cloud storage service in JavaScript

github.com

21–30 of 34 posts

Re: FileKit: An open source end-to-end encrypted cloud storage service in JavaScript

#21
post #6
post #5

Earlier quoted context omitted.

Browser crypto has come a long way. With libraries like libsodium and proper implementation I think it’s drastically better than at the time of those articles (2013 and 2011). Source: we also write encryption libraries and have a free implementation of our browser sdk at https://share.labs.tozny.com

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.

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 storage service in JavaScript

#22
post #6

Earlier quoted context omitted.

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.

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.

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 storage service in JavaScript

#23
post #6
post #5

Earlier quoted context omitted.

Browser crypto has come a long way. With libraries like libsodium and proper implementation I think it’s drastically better than at the time of those articles (2013 and 2011). Source: we also write encryption libraries and have a free implementation of our browser sdk at https://share.labs.tozny.com

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.

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 storage service in JavaScript

#24
post #6
post #5

Earlier quoted context omitted.

Browser crypto has come a long way. With libraries like libsodium and proper implementation I think it’s drastically better than at the time of those articles (2013 and 2011). Source: we also write encryption libraries and have a free implementation of our browser sdk at https://share.labs.tozny.com

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.

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 storage service in JavaScript

#25
post #21
post #6

Earlier quoted context omitted.

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.

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 r…

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 storage service in JavaScript

#26
post #6

Earlier quoted context omitted.

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.

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, et…

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 storage service in JavaScript

#27
post #6
post #5

Earlier quoted context omitted.

Browser crypto has come a long way. With libraries like libsodium and proper implementation I think it’s drastically better than at the time of those articles (2013 and 2011). Source: we also write encryption libraries and have a free implementation of our browser sdk at https://share.labs.tozny.com

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.

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.

Re: FileKit: An open source end-to-end encrypted cloud storage service in JavaScript

#28
post #21
post #6

Earlier quoted context omitted.

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.

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 r…

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 storage service in JavaScript

#29
post #21

Earlier quoted context omitted.

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 r…

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...

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 storage service in JavaScript

#30
This doesn't seem to be doing downloading in a streaming manner, as indicated by its use of my old "file-saver"[1] library. Edit: Originally thought this also did encryption without streaming.

Nowadays I would recommend using Penumbra[2] (another library I've worked on) with StreamSaver.js for streaming file encryption/decryption/downloading.

1. https://github.com/eligrey/FileSaver.js

2. https://github.com/transcend-io/penumbra

Post reply on HN