Live data from Hacker News

SJCL – Stanford JavaScript Crypto Library

github.com

1–10 of 99 posts

Re: SJCL – Stanford JavaScript Crypto Library

#2
There's a discussion going on of people who claim doing Crypto in the browser is super insecure. (Crockford is one of them) I wonder to what degree this is true or what needs to be done to do at least some basic crypto in the browser like AES for personal user data.

Re: SJCL – Stanford JavaScript Crypto Library

#3

There's a discussion going on of people who claim doing Crypto in the browser is super insecure. (Crockford is one of them) I wonder to what degree this is true or what needs to be done to do at least some basic crypto in the browser like AES for personal user data.

I've written about this, here: http://stackoverflow.com/a/24677597/19212, in response to the question "Can local storage ever be considered secure?", and in particular using encryption from the SJCL.

Here is the gist, copied for convenience:

> There are libraries that do implement the desired functionality, e.g. Stanford Javascript Crypto Library. There are inherent weaknesses, though (as referred to in the link from @ircmaxewell's answer):

- Lack of entropy / random number generation;

- Lack of a secure keystore i.e. the private key must be password-protected if stored locally, or stored on the server (which bars offline access);

- Lack of secure-erase;

- Lack of timing characteristics.

> Each of these weaknesses corresponds with a category of cryptographic compromise. In other words, while you may have "crypto" by name, it will be well below the rigour one aspires to in practice.

> These concerns will likely be addressed in the WebCrypto API, but that is not here yet.

Re: SJCL – Stanford JavaScript Crypto Library

#4

There's a discussion going on of people who claim doing Crypto in the browser is super insecure. (Crockford is one of them) I wonder to what degree this is true or what needs to be done to do at least some basic crypto in the browser like AES for personal user data.

The only time you should ever use crypto in the browser is if you're building an end-to-end encrypted app in the browser.

Re: SJCL – Stanford JavaScript Crypto Library

#5

There's a discussion going on of people who claim doing Crypto in the browser is super insecure. (Crockford is one of them) I wonder to what degree this is true or what needs to be done to do at least some basic crypto in the browser like AES for personal user data.

This "discussion" has been going on for a long time. Here is an article posted to HN back in 2011 that you might be interested in: https://www.nccgroup.trust/us/about-us/newsroom-and-events/b...

Re: SJCL – Stanford JavaScript Crypto Library

#6
post #5

There's a discussion going on of people who claim doing Crypto in the browser is super insecure. (Crockford is one of them) I wonder to what degree this is true or what needs to be done to do at least some basic crypto in the browser like AES for personal user data.

This "discussion" has been going on for a long time. Here is an article posted to HN back in 2011 that you might be interested in: https://www.nccgroup.trust/us/about-us/newsroom-and-events/b...

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

Re: SJCL – Stanford JavaScript Crypto Library

#7

There's a discussion going on of people who claim doing Crypto in the browser is super insecure. (Crockford is one of them) I wonder to what degree this is true or what needs to be done to do at least some basic crypto in the browser like AES for personal user data.

JavaScript's random generator is not cryptographically "secure" because it's not random enough. You can however make your own random generator by using keyboard/mouse input, microphone noise, etc for entropy.

Re: SJCL – Stanford JavaScript Crypto Library

#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 mashing together code and markup and then trying to permissively parse and execute it never goes well for security.

Re: SJCL – Stanford JavaScript Crypto Library

#10
post #4

There's a discussion going on of people who claim doing Crypto in the browser is super insecure. (Crockford is one of them) I wonder to what degree this is true or what needs to be done to do at least some basic crypto in the browser like AES for personal user data.

The only time you should ever use crypto in the browser is if you're building an end-to-end encrypted app in the browser.

Then encryption should be a standard API provided by the browser. We already have a level of trust in the browser for crypto implementation, we should not be relying on independent javascript code.
Post reply on HN