3 ms·
In the same way that we trust bcrypt when we get the source from somewhere we know, it would be possible to make an encryption module in JS that gets imported f
by onion2k 12y ago
In the same way that we trust bcrypt when we get the source from somewhere we know, it would be possible to make an encryption module in JS that gets imported from a trusted location eg https://github.com/shaneGirish/bcrypt-nodejs/blob/master/bCrypt.js[1] https://github.com/shaneGirish/bcrypt-nodejs/blob/master/bCr.... So long as the web app imports that version, and checks it against a hash from another trusted location then it would be possible to get true end-to-end encrpytion entirely in a browser without trusting some random server. You'd 'just' have to trust Github (or any other trustworthy server) instead.
[1] That's specifically for Node, but it could be tweaked to work in browsers.
- tptacek 12y agoNo, you can't do that, because browser Javascript lacks a mechanism to segregate one "module" from another. In fact, any page that merely populates the DOM can override any security decision made by any Javascript file. This idea comes up a lot, and nobody's ever explained to me a workable method for doing an integrity check of the entire Javascript runtime associated with a specific site. It's not as easy to do as it sounds.
- evv 12y agoYou're right, but these sorts of browser apps will continue to be made because of the convenience. The cheapest browser-app integrity check that I know of is shipping the dev code, complete with source maps. Allow anyone to read and debug what is going on inside your app.
- tptacek 12y agoThat doesn't work either, because the app users read can be totally different than the app that ends up running the next time the DOM updates itself in the background. See? "Fun" problem.