News for hackers. Stuff that matters.
Re:Stanford JavaScript Crypto Library by BiteCode_dev on Monday June 15, 2020 @06:20PM (#23533752)
It's way lower level, and easier to missuse.
Re:Stanford JavaScript Crypto Library by henriquez on Monday June 15, 2020 @10:22PM (#23535366)
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.

Re:Stanford JavaScript Crypto Library by codysc on Monday June 15, 2020 @10:53PM (#23535501)
I agree that Web Crypto has a lot to offer. I use it in my latest project.

In terms of it being easy to misuse, I think that applies to cryptography in general, but there are some gotchas lingering in javascript.

Self blog promoting. I just put this out a few days ago on this very subject. https://pritact.com/blog/posts/crypto-mistakes-part-1.html

Re:Stanford JavaScript Crypto Library by memexy on Monday June 15, 2020 @11:25PM (#23535671)
> 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.

That's a really nice feature. This should be better advertised. I wasn't aware that Web Crypto was even a thing.

Re:Stanford JavaScript Crypto Library by codysc on Tuesday June 16, 2020 @12:11AM (#23535878)
Yes, that kinda HSMish model of non-extractable keys is a very nice touch. I really wish they would add Argon2 though. PBKDF2 is still a valid choice but there are a lot of HW optimized solvers out there for it.