4 ms·
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 genera
by lucideer 10y ago
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. NodeJS). The browser as environment does seem to introduce a stigma around security to the entire JS ecosystem, and I wonder if its warranted.
- deleted 10y ago[deleted]
- tptacek 10y agoNode, 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.
- StavrosK 10y agoWhat's a good library to link against? NaCl?
- tptacek 10y agoThere have to be Node.js libsodium bindings by now, right?
- StavrosK 10y agoYou'd think... There's node-sodium, it looks like it's a binding but it claims to be a port. Who knows.
- technion 10y agoAs is often the problem with npm, the question is "which one"? https://www.npmjs.com/search?q=libsodium&page=1&ranking=optimal https://www.npmjs.com/search?q=libsodium&page=1&ranking=opti... Whilst I would lean towards the one from jedisct1 because I know they maintain the C version, I can't expect an average developer to know that. Edit: Typing
- wslh 10y ago> 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. NodeJS). What I can say is that NodeJS has the biggest and more mature amount of cryptocurrency libraries. This doesn't obviously imply that the crypto libs used are the best ones or they are secure. For example, OpenPGP.js [1] was audited by Cure53 and the changes to support elliptic curve cryptography (RFC 6637) [2] were done and audited by my company (two different teams). [1] https://github.com/openpgpjs/openpgpjs/blob/master/README.md#security-audit https://github.com/openpgpjs/openpgpjs/blob/master/README.md... [2] https://github.com/Jaxx-io/openpgpjs-secp256k1 https://github.com/Jaxx-io/openpgpjs-secp256k1