Live data from Hacker News

SJCL – Stanford JavaScript Crypto Library

github.com

21–30 of 99 posts

Re: SJCL – Stanford JavaScript Crypto Library

#21
On a related note, I made a little browser-based file encryption app: https://hypervault.github.io/ which uses the Triplesec library (https://github.com/keybase/triplesec), which seemed a nice alternative to SJCL.

Since I know someone will bring up the insecurity of browser crypto: this app is entirely self-contained (the HTML file can be saved and run offline).

Re: SJCL – Stanford JavaScript Crypto Library

#23
post #6

Earlier quoted context omitted.

Keep in mind that today's browsers have native crypto APIs that weren't available when this was written. ( https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_... )

I wasn't aware of this, and checked caniuse, nad there's already some solid support, although the standard isn't complete.

WebCrypto API was released as a W3C Recommendation January 26, 2017. Indeed, the working group has now shut down (they decided not to do anything about any other APIs than low-level crypto stuff...).

Re: SJCL – Stanford JavaScript Crypto Library

#24
post #14

More interestingly, and recent, there is Web Crypto: https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_... Although I have no idea about the state of the thing.

I feel WebCrypto (strange architectural choices made by people whose priorities are availability of crypto, not consistency of security) is even more questionable than running SJCL (a good crypto done by good people in questionable environment) in browser.

Re: SJCL – Stanford JavaScript Crypto Library

#26
post #8

Browser crypto is really problematic. For one, the client is downloading the crypto JS implementation (almost) every time they are using the app. Server compromised? crypto.js is rendered useless. HTTPS certificate compromised? crypto.js is useless. And also: XSS vuln on your website? crypto.js is useless since attacker will just exfiltrate your private key / password through XSS. The browser is wonderful for UI but…

This is true. The value that in-browser JavaScript crypto does provide, however, is that it requires a MITM attack (which is definitely possible, especially for state level actors, but by anyone with enough control of a trusted CA); It is useful against dragnet recording of all communications - as long as the key/password itself is safe.

Re: SJCL – Stanford JavaScript Crypto Library

#27

In every one of these threads, there are inevitable comments along the lines of "in-browser crypto is inherently unsecure", which often follows to a more general "javascript crypto is inherently unsecure". This question might be slightly off-topic here, given this seems to be an in-browser library, but can anyone who knows a bit more about this topic than I comment on the state of out-of-browser JS crypto (e.g. NodeJ…

[deleted]

Re: SJCL – Stanford JavaScript Crypto Library

#28

In every one of these threads, there are inevitable comments along the lines of "in-browser crypto is inherently unsecure", which often follows to a more general "javascript crypto is inherently unsecure". This question might be slightly off-topic here, given this seems to be an in-browser library, but can anyone who knows a bit more about this topic than I comment on the state of out-of-browser JS crypto (e.g. NodeJ…

Node, V8, and Javascript in general isn't the most hospitable platform on which to do crypto work (Rust, Go, and Java are better for it), but if it's worse than Ruby or Python, it's only marginally worse.

One challenge is that SJCL is a very well-designed library that assumes it has no low-level primitives to work with, but in a Node environment you have native code to lean on, and you're better off doing than than using pure-Javascript crypto. But Node's native crypto is just bindings to OpenSSL --- not great.

Re: SJCL – Stanford JavaScript Crypto Library

#29
post #22
post #9

Is there a market for end-to-end encrypted app in the browser?

We are using WebCrypto in 1Password.com implementation and polyfill with SJCL when a browser does not support the algorithms we need (PBKDF2, AES-GCM in Safari, etc).

We do the same thing at Virtru.

Re: SJCL – Stanford JavaScript Crypto Library

#30
post #24
post #14

More interestingly, and recent, there is Web Crypto: https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_... Although I have no idea about the state of the thing.

I feel WebCrypto (strange architectural choices made by people whose priorities are availability of crypto, not consistency of security) is even more questionable than running SJCL (a good crypto done by good people in questionable environment) in browser.

I agree. Not making this up: the primary goal of WebCrypto was the elimination of Flash and plugins to enable streaming media players. It's not designed for security. It eliminates some of the least worrisome flaws in browser crypto (side-channel attacks against the lowest-level primitives) but leaves all the rest of the problems intact.
Post reply on HN