Intent to ship Web Crypto

240 views
Skip to first unread message

ero...@chromium.org

unread,
Jun 3, 2014, 7:21:26 PM6/3/14
to blin...@chromium.org, Ryan Sleevi

Spec


http://www.w3.org/TR/2014/WD-WebCryptoAPI-20140325/


Summary

  • Adds crypto.subtle, which contains methods for generating keys, importing keys, unwrapping keys, wrapping keys, encrypting, decrypting, signing, verifying, and digest
  • Exposes the pre-existing crypto.getRandomValues() to Web Workers
  • This API will only be exposed to secure origins, as security-sensitive operations are inherently dangerous when performed on insecure connections.


Link to “Intent to Implement” blink-dev discussion


Thread


Is this feature supported on all five Blink platforms (Windows, Mac, Linux, Chrome OS and Android)?


Yes.

However the specific algorithms supported on each platform varies. In particular on Linux, version 3.16.2 of NSS is required, and on Android fewer algorithms are currently implemented.

Support for additional algorithms, on all platforms, will be added in future releases.


Compatibility Risk


The WebCrypto API does not mandate any particular algorithms. It is possible for different user agents to support different ones, leading to incompatibilities between consumers of the API.


Another consideration is that support for algorithms may be deprecated once they are deemed insecure. Hence strict compatibility between past and new versions of Blink cannot be guaranteed.


OWP launch tracking bug?


http://crbug.com/379976


Link to entry on the feature dashboard


http://www.chromestatus.com/features/5030265697075200

Alex Russell

unread,
Jun 3, 2014, 8:43:30 PM6/3/14
to ero...@chromium.org, blink-dev, Ryan Sleevi
On Tue, Jun 3, 2014 at 4:21 PM, <ero...@chromium.org> wrote:

Spec


http://www.w3.org/TR/2014/WD-WebCryptoAPI-20140325/


Summary

  • Adds crypto.subtle, which contains methods for generating keys, importing keys, unwrapping keys, wrapping keys, encrypting, decrypting, signing, verifying, and digest
  • Exposes the pre-existing crypto.getRandomValues() to Web Workers
  • This API will only be exposed to secure origins, as security-sensitive operations are inherently dangerous when performed on insecure connections.
Presumably, as with Service Workers, the restriction to Secure Origins will simply cause APIs to fail, not to be selectively available depending on origin type?

Regards
 

Link to “Intent to Implement” blink-dev discussion


Thread


Is this feature supported on all five Blink platforms (Windows, Mac, Linux, Chrome OS and Android)?


Yes.

However the specific algorithms supported on each platform varies. In particular on Linux, version 3.16.2 of NSS is required, and on Android fewer algorithms are currently implemented.

Support for additional algorithms, on all platforms, will be added in future releases.


Compatibility Risk


The WebCrypto API does not mandate any particular algorithms. It is possible for different user agents to support different ones, leading to incompatibilities between consumers of the API.


Another consideration is that support for algorithms may be deprecated once they are deemed insecure. Hence strict compatibility between past and new versions of Blink cannot be guaranteed.


OWP launch tracking bug?


http://crbug.com/379976


Link to entry on the feature dashboard


http://www.chromestatus.com/features/5030265697075200

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Eric Roman

unread,
Jun 3, 2014, 8:56:39 PM6/3/14
to Alex Russell, blink-dev, Ryan Sleevi
On Tue, Jun 3, 2014 at 5:42 PM, Alex Russell <sligh...@google.com> wrote:



On Tue, Jun 3, 2014 at 4:21 PM, <ero...@chromium.org> wrote:

Spec


http://www.w3.org/TR/2014/WD-WebCryptoAPI-20140325/


Summary

  • Adds crypto.subtle, which contains methods for generating keys, importing keys, unwrapping keys, wrapping keys, encrypting, decrypting, signing, verifying, and digest
  • Exposes the pre-existing crypto.getRandomValues() to Web Workers
  • This API will only be exposed to secure origins, as security-sensitive operations are inherently dangerous when performed on insecure connections.
Presumably, as with Service Workers, the restriction to Secure Origins will simply cause APIs to fail, not to be selectively available depending on origin type?

Correct.

crypto.subtle would be visible from all origins, however all its methods will fail [1]
More details on the proposed change: in https://codereview.chromium.org/299253003/

[1]  Promise will be rejected with a NotSupportedError

Anne van Kesteren

unread,
Jun 4, 2014, 3:11:14 AM6/4/14
to Eric Roman, Alex Russell, blink-dev, Ryan Sleevi
On Wed, Jun 4, 2014 at 2:56 AM, Eric Roman <ero...@chromium.org> wrote:
> crypto.subtle would be visible from all origins, however all its methods
> will fail [1]
> More details on the proposed change: in
> https://codereview.chromium.org/299253003/

Is the standard going to be updated to require this?


--
http://annevankesteren.nl/

Ryan Sleevi

unread,
Jun 4, 2014, 3:18:45 AM6/4/14
to Anne van Kesteren, blink-dev, Eric Roman, Alex Russell

Can you clarify what you would expect? Something similar to Service Workers' language?

The spec already permits user agents the flexibility in how algorithms are exposed, as Eric has noted. This is inherently necessary for legal and political reasons (crypto is still classified/controlled similarly to munitions, 15 years after the great crypto wars)

Within Chrome, the API is exposed, but on insecure origins, no algorithms are implemented.

Anne van Kesteren

unread,
Jun 4, 2014, 3:36:52 AM6/4/14
to Ryan Sleevi, blink-dev, Eric Roman, Alex Russell
On Wed, Jun 4, 2014 at 9:18 AM, Ryan Sleevi <rsl...@chromium.org> wrote:
> Can you clarify what you would expect? Something similar to Service Workers'
> language?

Something like if
http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#entry-settings-object
's origin is not an
https://w3c.github.io/webappsec/specs/mixedcontent/#assumed-secure-origin
(or whatever definition is actually used here), reject p with a
TypeError."

If the APIs are exposed at all, it seems like that can be a normative
requirement and probably should be.


--
http://annevankesteren.nl/

Ryan Sleevi

unread,
Jun 4, 2014, 3:50:17 AM6/4/14
to Anne van Kesteren, Eric Roman, blink-dev, Alex Russell

There is, unfortunately, not consensus within the WG for such language being a normative requirement of the spec, despite the clear impossibility of building a trusted system on an untrusted connection, without an a-priori or out of bands means of building trust.

This is, in part, reflected by the desire of some WG members to use these APIs within consumer devices (eg: smart TVs), for which TLS is seen as unreasonably expensive or complex, and similarly, including or exposing hardware identifiers ( http://www.w3.org/TR/webcrypto-key-discovery/ ) is viewed as a valid way to bootstrap an 'acceptable' level of trust.

In this regard, there has been a rather long-standing spirited debate within the WG on what represents an acceptable minimal security guarantee, and whether applications can achieve that with no reliance on TLS. Unfortunately, the lowest common denominator currently prevails.

While the WGLC has completed, enough feedback has been received to warrant a new edition that contains substantive API changes - many already identified before WGLC was entered. As such, support for a normative requirement for TLS would still, no doubt, be very welcome within the WG.

Anne van Kesteren

unread,
Jun 4, 2014, 4:06:44 AM6/4/14
to Ryan Sleevi, Eric Roman, blink-dev, Alex Russell
On Wed, Jun 4, 2014 at 9:50 AM, Ryan Sleevi <rsl...@chromium.org> wrote:
> While the WGLC has completed, enough feedback has been received to warrant a
> new edition that contains substantive API changes - many already identified
> before WGLC was entered. As such, support for a normative requirement for
> TLS would still, no doubt, be very welcome within the WG.

I filed https://www.w3.org/Bugs/Public/show_bug.cgi?id=25972


--
http://annevankesteren.nl/

Alex Russell

unread,
Jun 5, 2014, 4:22:14 PM6/5/14
to Anne van Kesteren, Ryan Sleevi, Eric Roman, blink-dev
I support Chrome moving forward with this regardless of the spec resolution about secure origins.

Eric Roman

unread,
Jun 10, 2014, 5:21:44 PM6/10/14
to Alex Russell, Anne van Kesteren, Ryan Sleevi, blink-dev
Ping.

Yay or nay on shipping Web Crypto?

Adam Barth

unread,
Jun 10, 2014, 5:31:20 PM6/10/14
to ero...@chromium.org, sligh...@google.com, ann...@annevk.nl, rsl...@chromium.org, blin...@chromium.org
On Tue Jun 10 2014 at 2:21:41 PM, Eric Roman <ero...@chromium.org> wrote:
Ping.

Yay or nay on shipping Web Crypto?

I have one concern about the issue below:


On Wed Jun 04 2014 at 12:50:16 AM, Ryan Sleevi <rsl...@chromium.org> wrote:

While the WGLC has completed, enough feedback has been received to warrant a new edition that contains substantive API changes - many already identified before WGLC was entered.

Are these changes likely to break the API?  I'm concerned that the spec might change after we ship the feature.

Adam

Ryan Sleevi

unread,
Jun 10, 2014, 6:05:31 PM6/10/14
to Adam Barth, Eric Roman, Alex Russell, Anne van Kesteren, Ryan Sleevi, blink-dev
There is one API breaking change that the WG agreed on, and had outstanding, before pushing to WGLC; This was unfortunate, but governs how import/export of JSON Web Keys is handled.

This is in the process of being resolved (in spec and in Chrome's implementation).

There is one other public-API-relevant change outstanding (exposing the length of HMAC keys); however, that can be determined for existing keys, and thus doesn't change.

The remainder of the changes focused on elements that were critically under-specified, but which implementors had consistently implemented the same thing in existing implementations.

Then again, no other UA is shipping something spec-compatible at the moment, simply prefixed.

Adam Barth

unread,
Jun 10, 2014, 6:15:27 PM6/10/14
to rsl...@chromium.org, ero...@chromium.org, sligh...@google.com, ann...@annevk.nl, blin...@chromium.org
On Tue Jun 10 2014 at 3:05:28 PM, Ryan Sleevi <rsl...@chromium.org> wrote:
On Tue, Jun 10, 2014 at 2:31 PM, Adam Barth <aba...@google.com> wrote:
On Tue Jun 10 2014 at 2:21:41 PM, Eric Roman <ero...@chromium.org> wrote:
Ping.

Yay or nay on shipping Web Crypto?

I have one concern about the issue below:

On Wed Jun 04 2014 at 12:50:16 AM, Ryan Sleevi <rsl...@chromium.org> wrote:

While the WGLC has completed, enough feedback has been received to warrant a new edition that contains substantive API changes - many already identified before WGLC was entered.

Are these changes likely to break the API?  I'm concerned that the spec might change after we ship the feature.

There is one API breaking change that the WG agreed on, and had outstanding, before pushing to WGLC; This was unfortunate, but governs how import/export of JSON Web Keys is handled.

This is in the process of being resolved (in spec and in Chrome's implementation).

There is one other public-API-relevant change outstanding (exposing the length of HMAC keys); however, that can be determined for existing keys, and thus doesn't change.

The remainder of the changes focused on elements that were critically under-specified, but which implementors had consistently implemented the same thing in existing implementations.

Then again, no other UA is shipping something spec-compatible at the moment, simply prefixed.

How confident are you that the spec wont change in compatible ways between now and CR?

Adam

Alex Russell

unread,
Jun 10, 2014, 6:15:42 PM6/10/14
to Ryan Sleevi, Adam Barth, Eric Roman, Anne van Kesteren, blink-dev
I'm not worried about these changes. I can't LGTM this, but it has my support.

Ryan Sleevi

unread,
Jun 10, 2014, 6:18:11 PM6/10/14
to Adam Barth, Alex Russell, Eric Roman, blin...@chromium.org, ann...@annevk.nl

API surface? Confident of no further changes.

There is still ongoing discussion about MTI algorithms and key sizes. The spec requires none at present. There is also requests for addition algorithms or supported parameters, but those too are uneventful.

Adam Barth

unread,
Jun 10, 2014, 6:19:31 PM6/10/14
to rsl...@chromium.org, Alex Russell, Eric Roman, blin...@chromium.org, ann...@annevk.nl
Ok.  LGTM

TAMURA, Kent

unread,
Jun 11, 2014, 9:14:55 PM6/11/14
to Adam Barth, rsl...@chromium.org, Alex Russell, Eric Roman, blink-dev, Anne van Kesteren
LGTM2.
--
TAMURA Kent
Software Engineer, Google


Jochen Eisinger

unread,
Jun 12, 2014, 10:18:10 AM6/12/14
to TAMURA, Kent, Adam Barth, Ryan Sleevi, Alex Russell, Eric Roman, blink-dev, Anne van Kesteren
lgtm3
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages