SJCL – Stanford JavaScript Crypto Library
51–60 of 99 posts
Re: SJCL – Stanford JavaScript Crypto Library
#52Re: SJCL – Stanford JavaScript Crypto Library
#53Shameless plug: SJCL is a great library and easy to work with. I've used it to build a non-profit decentralized encryption tool that can be used to send and receive files that will self-decrypt using SJCL, JavaScript FileReader, and HTML5 download attributes. User A creates a password to encrypt a file using this client-side mechanism - which produces a self-decrypting HTML file. User B opens this HTML file in their…
How does User B obtain the password to decrypt the file? How does the key distribution part work?
Re: SJCL – Stanford JavaScript Crypto Library
#54For someone not really familiar with javascript could someone explain how sensitive information is removed from memory when no longer needed? Does the runtime expose semantics to ensure memory is zeroed? Also given javascript is garbage collected are there concerns about timing attacks? Or can you prevent the GC from running in critical sections like Go (I assume Java offers this too)?
I can't answer your questions with certainty, but for those who can, could ES6 WeakMap address these two things?
Re: SJCL – Stanford JavaScript Crypto Library
#55Earlier quoted context omitted.
SJCL provides a secure random interface (it implements Fortuna). It's not great, and SJCL is not especially performant. But its interface, cryptographically, is (as I said) superior to that of WebCrypto. I'm not sure it matters that WebCrypto is native and "can't be overwritten", given that all the glue connecting the crypto is pure Javascript and can easily be rewritten.
I meant that the WebCrypto API does not rely on network transmission and that window.crypto and window.crypto.subtle are read-only properties in compliant implementations. Those two characteristics alone would seem to solve many of the problems enumerated on https://www.nccgroup.trust/us/about-us/newsroom-and-events/b... , namely the chicken-egg problem of secure javascript transmission and the malleability of the JS…
(I wrote the document you're citing, for what it's worth).
Re: SJCL – Stanford JavaScript Crypto Library
#56For someone not really familiar with javascript could someone explain how sensitive information is removed from memory when no longer needed? Does the runtime expose semantics to ensure memory is zeroed? Also given javascript is garbage collected are there concerns about timing attacks? Or can you prevent the GC from running in critical sections like Go (I assume Java offers this too)?
Re: SJCL – Stanford JavaScript Crypto Library
#57Earlier quoted context omitted.
How does User B obtain the password to decrypt the file? How does the key distribution part work?
It's a plaintext password - not nearly as secure as PGP or the like.
Re: SJCL – Stanford JavaScript Crypto Library
#58Shameless plug: SJCL is a great library and easy to work with. I've used it to build a non-profit decentralized encryption tool that can be used to send and receive files that will self-decrypt using SJCL, JavaScript FileReader, and HTML5 download attributes. User A creates a password to encrypt a file using this client-side mechanism - which produces a self-decrypting HTML file. User B opens this HTML file in their…
And since C' and C'' are delivered as (js) executables - Eve can choose what to do - try for a compromise when B runs C', show the original message but run additional code for C'' ... ?
Re: SJCL – Stanford JavaScript Crypto Library
#59Earlier quoted context omitted.
You typically download SSH once, while you download js potentially on every page load. It is also much harder to monkey-patch a native binary than to inject js into a browser tab. Browsers by default trust any of hundreds of CA's, while SSH trusts none by default.
I know that website JS isn't a solution. But can't the browsers provide APIs for this? I mean they force me to directly use user-events to switch to full-screen, why can't the do such things for crypto APIs, so that no one could mess with this?
Re: SJCL – Stanford JavaScript Crypto Library
#60In 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 u…