7 ms·
FileKit: An open source end-to-end encrypted cloud storage service in JavaScript
- IloveHN84 7y agoBut how safe is cryptography in JavaScript, knowingly that the language allows funny mathematics and comparison results?
- 52-6F-62 7y agoI had to do a little digging into where it was pulling its crypto methods from and it looks like the have a bit of their own library, but it uses libsodium via javascript wrappers underneath: https://github.com/TankerHQ/sdk-js/tree/master/packages/crypto/src https://github.com/TankerHQ/sdk-js/tree/master/packages/cryp... https://github.com/jedisct1/libsodium.js https://github.com/jedisct1/libsodium.js So, I guess take that as you will. I haven't read much of the actual source yet. edit: I sort of expected there would be a move to the server since it looks like they built their library to run on the server, even if it's running all of the libsodium methods in javascript but it's definitely pulling the browser version and running it all in the client: https://github.com/TankerHQ/sdk-js/blob/master/packages/filekit/src/FileKit.js#L2 https://github.com/TankerHQ/sdk-js/blob/master/packages/file...
- jarfil 7y agoJavaScript itself is quite safe, more so if it's running isolated like in a browser. Trusting your data to a piece of JavaScript code sent by a remote server, though, is only as safe as the server.
- tptacek 7y agoThe "safety" being discussed here isn't system integrity, but rather cryptographic side channel safety, which is very much an open question in Javascript.
- marcus_holmes 7y agoit's not so "isolated" - running Javascript in a page can be examined and potentially altered from a number of vectors (probably the simplest is extensions). AFAIK there's no way of running JS in a browser that is "safe" in the crypto sense.
- dboreham 7y agoThat isn't unsafe, just annoying.
- wglb 7y agoDoing cryptography in the browser is a bad idea: https://tonyarcieri.com/whats-wrong-with-webcrypto https://tonyarcieri.com/whats-wrong-with-webcrypto Also https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2011/august/javascript-cryptography-considered-harmful/ https://www.nccgroup.trust/us/about-us/newsroom-and-events/b...
- edwardr 7y agoBrowser 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 https://share.labs.tozny.com
- tptacek 7y agoNo, 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.
- espadrine 7y agoMy 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-encryption.png 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.
- tptacek 7y agoThere'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.
- mmazing 7y agoMost men can probably pull a vehicle a fair distance using only their scrotum. However, this does not mean that you should.
- Sephr 7y agoThis 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 https://github.com/eligrey/FileSaver.js 2. https://github.com/transcend-io/penumbra https://github.com/transcend-io/penumbra
- blastrock 7y agoThe encryption/upload is streamed, but the download/decryption is not, we will work on that. Thanks for the link!