TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Web Cryptography API posted as W3C working draft

64 pointsby sweisover 12 years ago

10 comments

tptacekover 12 years ago
From the two quick reads I've given it, not a fan.<p>On the plus side: building this stuff directly into the browser image may prevent people from deploying Javascript Cryptography, which is unsafe in every environment. Systems built on the Web Cryptography bindings are at least anchored to trusted implementations of algorithms already resident in the browser.<p>On the minus side:<p>* These interfaces may have the opposite effect. Mass-market websites must support all popular browser versions. For the foreseeable future, we won't have a market in which the majority of browsers implement something like this. Unfortunately, the web crypto API is something that is very easy to duplicated "cosmetically" in Javascript. So the net effect of this in the medium term is probably negative. That said, I also understand that we've got to rip off the band-aid sometime.<p>* The interface is low-level. I appreciate that an API like this naturally wants to be low-level, to maximize the number of things you can build on top of it. But most of the things you could build on these particular building blocks will have subtle vulnerabilities. Not only that, but the interface doesn't appear to provide even the "envelope" abstraction that other low-level libraries present.<p>* So much of this design is low-level that enough of the security of the system is left to content-controlled Javascript, so many (perhaps most) of the systems that rely on this library are going to have exactly the same problem as they do now.<p>* The low-level building blocks they provide are incoherent. If you wanted to just expose all the little knobs and wires that it could take to implement pre-existing (and broken) crypto standards, then an interface which pretends that AES-CBC and AES-GCM are two different ways to do the same thing makes some sense; some systems need GCM, and some need CBC, and you don't have to give much thought to the difference. But this library doesn't even do that; for instance, it doesn't look like callers control the nonce in AES-CTR. A good way to sum this up: if this API succeeds in the market, there are going to be deployed, widely used systems that use RSA for bulk encryption.<p>If I was elected Archduke of Browser Crypto, the first standard I would propose would be a simple authenticated AES-encrypted envelope format; something like, PBKFD2-keyed HMAC-SHA256-authenticated AES-CBC messages. Something impossible to screw up, because Javascript authors aren't asked to make design decisions.
评论 #4549908 未加载
评论 #4549935 未加载
评论 #4549794 未加载
daekenover 12 years ago
While I think this could be a good thing in theory, exposing such a low level crypto interface is likely to end in pain. How many people can combine the building blocks into something secure? And MITM/XSS still give up the keys to the castle.<p>I'd much rather see a simple high-level interface to crypto in the browser.
评论 #4550084 未加载
zrailover 12 years ago
This looks like it could be pretty useful. The main argument against crypto in the browser is that if you send crypto js over a non encrypted channel it's vulnerable to MITM, and if you're going over HTTPS you might as well just send it plaintext. If the browsers themselves implemented secure crypto it could be a boon to certain types of applications, for example S/MIME in webmail.
评论 #4549770 未加载
kzahelover 12 years ago
Yes, we all know cryptography is incredibly easy to get wrong.<p>That doesn't mean providing the primitives to implement bad crypto is responsible for the bad crypto.<p>I think the main benefit of this will be improved speed over existing standard javascript crypto support libraries (sjcl, jsbn).
评论 #4550284 未加载
prodigal_erikover 12 years ago
I'd like to see a declarative way to sign or encrypt parts of a document or form submission to protect them from tampering by the origin server. But js is under the control of the origin server, so I don't see this as a security advance over TLS, just a crutch for broken apps with no non-js mode using HTTP correctly.
评论 #4549982 未加载
romanivover 12 years ago
I would very much rather see higher-level crypto, especially crypto that could be used declaratively, without JavaScript. (Something similar to Enigmail, but for browsers.)<p>Heck, there isn't even a standard way to verify a hash on downloaded files.
darkhornover 12 years ago
By the way keygen <a href="http://www.w3schools.com/html5/tryit.asp?filename=tryhtml5_keygen" rel="nofollow">http://www.w3schools.com/html5/tryit.asp?filename=tryhtml5_k...</a>
morroccomoleover 12 years ago
For the record this is only the First Public Working Draft. A lot can and will change. We are looking for commentary to understand if we are on the right track
rbellioover 12 years ago
Something else to read in my free time now :)
wglbover 12 years ago
So is this "Bad Crypto made Easy"?