3 ms·
I've written about this, here: http://stackoverflow.com/a/24677597/19212 http://stackoverflow.com/a/24677597/19212, in response to the question "Can local stora
by bmh_ca 10y ago
I've written about this, here: http://stackoverflow.com/a/24677597/19212 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.
- blablabla123 10y agoThanks a lot for your answer, I also read the one on SO. I'm actually thinking to use WebCrypto API for a current (kind of side-)project. I guess if you wrote a blog post about that, that could be really interesting. Until now I only heard "strong no" towards crypto in JS. Even if it's not perfect, if it can be designed towards "better than nothing". Also given that the Web is likely becoming the major platform for everything at some point in time...
- bmh_ca 10y agoIt looks like you could get away with WebCrypto nowadays for up-to-date mainstream browsers: http://caniuse.com/#feat=cryptography http://caniuse.com/#feat=cryptography