Comment

Comment by henriquez

The only low-level thing I noticed about the native Web Crypto APIs is its reliance on typed arrays. The speed difference is night and day as the native stuff can be hardware-accelerated by dedicated CPU instructions.

Browser support is very good: https://caniuse.com/#feat=cryptography

Documentation is also very good: https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypt...

In terms of "ease of misuse" it's debatable. One of the biggest default security improvements with Web Crypto is that *cryption keys are _not readable by JS_ once instantiated - they can only be used by the cryptographic functions (unless you explicitly make them exportable). This is a subtle but very important defense against certain drive-by attacks that could dump loaded keys from whatever non-native JS crypto library you might be using.

In general I don't think it's safe to be using crypto at all outside of basic stuff like password hashing if you don't have a basic understanding of concepts like salt lengths, block cipher modes, hasher output sizes, etc. so I don't really agree with the "easier to misuse" statement. Some library that holds your hand more isn't going to significantly make things safer.

parent henriquez 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton