W3C home > Mailing lists > Public > public-webcrypto@w3.org > June 2012

Re: Need for Smart Card support

From: Ryan Sleevi <sleevi@google.com>
Date: Mon, 11 Jun 2012 10:49:49 -0700
Message-ID: <CACvaWvYQeQABnpGEpbTUE-bZZO-byd9xOwyiaFtH_Epu-hLBCw@mail.gmail.com>
To: Lu HongQian Karen <karen.lu@gemalto.com>
Cc: David Dahl <ddahl@mozilla.com>, Ali Asad <Asad.Ali@gemalto.com>, "James L. Davenport" <jdavenpo@mitre.org>, "public-webcrypto@w3.org" <public-webcrypto@w3.org>
On Mon, Jun 11, 2012 at 10:25 AM, Lu HongQian Karen <karen.lu@gemalto.com>wrote:

> The crypto API itself (for encryption, signing, hash etc.) should be
> generic without specific reference to hardware devices.****
>
> ** **
>
> A web application or the user should be able to choose which crypto
> provider (implemented in software or hardware) to use, which may be default
> to the one built-in the browser or OS. A hardware secure element may
> implement a different crypto provider. This approach has been implemented
> in current browsers (or add-ons) so that SSL/TLS mutual authentications are
> possible. Users can choose which crypto provider to use, for example,
> select her smart card. The problems are: first, the crypto functionalities
> are only available to the web browsers but not to web applications; and
> second, different OS’s and browsers uses different API’s (Microsoft’s CAPI,
> Apple’s CSSM, PKCS#11 for everyone else). ****
>
> ** **
>
> May be choosing crypto providers and accessing hardware devices belong to
> different working groups?****
>
> ** **
>
> Regards,****
>
> Karen
>

I certainly don't speak for the chairs/WG, but as an implementer, I would
specifically want to avoid re-implementing APIs in which "selecting crypto
provider" was a core design point of the functionality. Web pages don't
derive any cryptographic value from knowing the crypto providers on a users
system without implementing some form of proof-of-possession (since the
users system may lie), and the user significantly loses privacy and the API
loses portability. I also think the user is not particularly well-served,
in that most users do not have any cryptographic background, and thus
presenting them with a choice of cryptographic providers is asking for
information that they cannot reasonably (as a novice) provide.

SSL/TLS client authentication, as implemented in browsers today as part of
their core implementation (eg: discounting addons), does not require the
user to have any particular knowledge about any secure elements, providers,
or their implementation. The user simply selects a "certificate".

To that end, I think as far as users, browsers, and sites go, if there does
need to be any recognition of a pre-provisioned key, and that requires some
degree of user interaction (perhaps to grant permission to that origin to
use that key), then a similar approach can/should be used.

I think one of the big concerns about 'secure elements' is that they
typically represent high-value keys. This can be both directly high value -
eg: this is the key I use to authenticate with my bank - or they may be
indirectly 'high value' - if I know you have this key, I can track you
across multiple origins and it's expensive/impossible for you to disable
this tracking ('supercookie'). This is why I think any specific handling
for 'secure elements' may be better served once we've laid a solid
foundation, and then we can explore what the interaction scenarios would be
for these elements.

Depending on how we handle key identification, it's concievable that there
may be an API for something like:
(Website -> User) "I would like to use any keys identifier by X Y or Z if
you have them"
(Browser -> User) "The site at domain foo wishes to use the following key:
X" (user doesn't have Y or Z)
(User makes selection)
(Browser -> Website) "The following keys are now available: X"

However, even such a trivial exchange carries with it security
complications. A website could then try to enumerate all the keys the user
has by measuring how long it takes the user to respond. If the user can
respond instantly, the site can assume the user has no keys identified by X
Y or Z, while if there is some delay, it might assume the user possesses
one or more.

Unlike other APIs (such as filesystem or geolocation), the mere act of
saying "no" yields an attacker information, which is why we must be very
careful, and why I'm very hesitant towards supporting such efforts
initially.

****
>
> ** **
>
> *From:* Ryan Sleevi [mailto:sleevi@google.com]
> *Sent:* Friday, June 08, 2012 1:45 PM
> *To:* David Dahl
> *Cc:* Ali Asad; James L. Davenport; public-webcrypto@w3.org
>
> *Subject:* Re: Need for Smart Card support****
>
> ** **
>
> ** **
>
> On Fri, Jun 8, 2012 at 9:43 AM, David Dahl <ddahl@mozilla.com> wrote:****
>
> Of course, the existing PKCS#11 routine (Prefs->Advanced->Encryption) in
> Firefox is a way to register a device. Perhaps I am under the impression
> that the API would govern the registration of hardware modules?****
>
> ** **
>
> I would think that would definitely be out of scope.****
>
> ** **
>
> "Registration of hardware modules" inevitably involves native code, and
> the idea of a JavaScript API allowing sites to install native code is a
> non-starter. Further, as noted in the charter and as Harry noted,
> specifically trying to avoid that as it involves device-specific calls.***
> *
>
>  ****
>
>
> I need to read up on how other browsers do this - and how NSS deals with
> crypto hardware and keyIDs. I think the real question here is does the API
> not have to do anything, just have the keyID passed to it to operate? All
> of the implementation details are hidden from the API, and things
> just work?****
>
> ** **
>
> I would prefer that, in our first draft, and consistent with the charters
> goals, that any awareness of smart cards or secure elements be left out.
> Simply dealing in key IDs is, I believe, sufficient enough to support the
> core use cases and primary goals, and also gives implementors the
> flexibility to expose keys stored in secure elements in an
> implementation-independent way that is compatible with the core API.****
>
> ** **
>
> For web developers, the nature of whether or not a key is stored in a
> secure element is unknown/unknowable to them - they have simply have a key
> ID, for which they can do the appropriate low or high level crypto
> operations.****
>
> ** **
>
> At the risk of fueling a fire, I do not believe the "this key is in a
> secure element" can be reliably exposed to applications, both due to the
> web security model and due to the vendor-specific nature. As Anders
> Rundgren repeatedly pointed out during the community group and the activity
> on the public-identity mailing list, proof of possession/proof of a key
> being within secure element has been a fundamental challenge in crypto, one
> which inevitably requires significantly more complex *protocols* that
> simply don't belong within a generic, simple API for signing/encrypting.
> Anything short of such complex schemes/protocols can easily be faked, and
> thus add zero security or programmatic value and only hinder further
> progress.****
>
> ** **
>
>
> Cheers,
>
> David****
>
>
> ----- Original Message -----
> From: "David Dahl" <ddahl@mozilla.com>
> To: "Ali Asad" <Asad.Ali@gemalto.com>
> Cc: "James L. Davenport" <jdavenpo@mitre.org>, public-webcrypto@w3.org
> Sent: Friday, June 8, 2012 11:18:56 AM
> Subject: Re: Need for Smart Card support
>
> ----- Original Message -----
> > From: "Ali Asad" <Asad.Ali@gemalto.com>
> > To: "James L. Davenport" <jdavenpo@mitre.org>, public-webcrypto@w3.org
> > Sent: Monday, June 4, 2012 9:32:25 AM
> > Subject: RE: Need for Smart Card support
> >
> > I think it will be good to have an option for interacting with secure
> > element (smart card being one example) in the API. Browsers that
> > choose to support it can implement it while others can skip it. But
> > the fact that it is there in the API will allow creation of secure
> > applications (as indicated by the use cases below) for those
> > interested in them.
> >
>
> I would like to see what the interfaces for this look like.
>
> A. How does the browser (in a cross-browser and platform way) know about
> the secure element? In other words, how is the secure element registered
> with the browser?
>
> B. Does the secure element appear to the browser as another software API
> that can be called, e.g: window.crypto.secureElement.* ?
>
> * or *
>
> C. Does the secure element export keys which the browser imports and uses
> like any other keys that have a key handle?
>
> I wonder what this looks like in practice. Is this a combination of crypto
> API + new browser features that 'register' the secure element with the
>  browser?  It does not appear an API can do all of this alone.
>
> Cheers,
>
> David
>
>
>
>
>
> ****
>
> ** **
>
Received on Monday, 11 June 2012 17:50:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 11 June 2012 17:50:19 GMT