RE: ACTION-22: Key export

No, I was thinking of authorization and export as separable issues.


-          You can only see keys that you are authorized for.

-          Of the keys you can see, you can potentially export the exportable ones without UI.

Regarding the DH+KDC model, I wonder if this isn't getting real close to a high-level API. It feels like it's a hop and a skip away from a generic box/unbox API. This is not to say that it isn't a worthy goal, just that it may be hard to generalize to a low-level API.

From: Mitch Zollinger [mailto:mzollinger@netflix.com]
Sent: Wednesday, August 15, 2012 10:28 PM
To: Vijay Bharadwaj
Cc: public-webcrypto@w3.org
Subject: Re: ACTION-22: Key export

On 8/14/12 9:38 AM, Vijay Bharadwaj wrote:

Mitch> As described during our f2f: we would like to use a KDF on a Diffie-Hellman negotiated shared secret to create a session key (or session keys) where the raw session key is never allowed to be accessed by the webapp.


I agree with the aim, but as discussed earlier I don't know of a way to make this work in general. In general, the output of a KDF is "just bytes" as far as the algorithm is concerned, so it's hard to see a way to pick some bytes from that output and designate them as "special" (i.e. key material). I suppose this case could be made to work if we applied additional restrictions, but that may require a different API that takes in key or secret handles rather than an ArrayBuffer.

Exactly. As described in the Netflix use case document, the idea is that the shared secret created by a DH exchange is one which the app is never allowed to access. There are clearly some pitfalls of implementation in this model; if a generic Diffie-Hellman was compatible with this DH+KDC model of key creation, the server would not know the difference between a client which was using DH with exportable shared secret and the special DH+KDC model.

This requires a bit more design; there are ways of doing this that depend on other types of attestation (imagine that the underlying implementation created a signature on the DH public component sent by the client to the server only when the special DH+KDC model was invoked, for example), but in general, I still believe that the API can allow for this type of exchange without even specifying the actual algorithms.

ProtectedKeyExchange kex = KeyExchange("KeyExchange Algorithm Foo");
Uint8Array client_pub = kex.getPublic();
/* ...send client_pub to server... */
/* ...get server_pub from server... */
/* complete exchange, created keying material precursor inside of kex */
kex.exchange(server_pub);
/* get handle to shared secret */
Handle handle = kex.getSharedSecret();
/* derive a session key */
Key key = Key.create(KDC.get("MyKDCAlgorithm"), handle);

I know in our offline conversation, you brought up some good points around FIPS compliance & only using the shared secret for a single key derivation. Despite that cautionary advice, is there something that would prevent us from accomplishing the above?



Mitch> In terms of expected user interaction in a browser, is there some idea of a key store password, where the user has to enter the password to explicitly export a wrapped key? Or is this a click-through dialog box where the user simply clicks "Ok" and the webapp gains access to the raw key?

I was imagining a situation where this is determined by the key itself. Most exportable keys would be exported with no user interaction at all, and non-exportable keys would just fail. Keys stored on smart cards for example may require UI but that is imposed by the card not the UA.

Ok. I was getting this mixed up with Ryan's & Mark's conversation around domain bound vs. domain authorized sites. With "domain authorization" though, in your model, if the site that created the key created it with exportable=true, then the second site could just export the key without any user interaction? (I don't think this is what you meant.)

Mitch



From: Mitch Zollinger [mailto:mzollinger@netflix.com]<mailto:[mailto:mzollinger@netflix.com]>
Sent: Monday, August 13, 2012 5:52 PM
To: public-webcrypto@w3.org<mailto:public-webcrypto@w3.org>
Subject: Re: ACTION-22: Key export

On 8/13/2012 7:54 AM, Vijay Bharadwaj wrote:


We've gone around on this a few times, including at the f2f, so here is a concrete proposal. I'm trying to find a balance between extensibility and not loading up the API with a bunch of stuff, so feedback is welcome.

I see the following use cases for key import/export:

-          Create session key object from derived key bytes (using either KDF or secret agreement): this would require raw key import

I would add:
 - Create session key object from derived key bytes, using KDF of underlying keying material, which does not allow raw key import / export.

As described during our f2f: we would like to use a KDF on a Diffie-Hellman negotiated shared secret to create a session key (or session keys) where the raw session key is never allowed to be accessed by the webapp.




-          Create key object from public key received from peer (for asymmetric encryption or signature verification): this would require public key import, where the public key is likely ASN.1 encoded in many apps

-          Export/import (wrapped) content encryption key for data encryption: this could be just the wrapped key or something like a PKCS#7 RecipientInfo (which is ASN.1 encoded). Import/export requires a handle to the wrapping key.

-          Export/import of private keys for distribution, with formats like PKCS#8.

>From an API perspective, supporting export seems to be straightforward. The Key object needs an export (or wrap) method, which takes a target format and potentially a wrapping key as parameters.

In terms of expected user interaction in a browser, is there some idea of a key store password, where the user has to enter the password to explicitly export a wrapped key? Or is this a click-through dialog box where the user simply clicks "Ok" and the webapp gains access to the raw key?




It seems to me there are two API models to support import. Either have an ability to create an empty Key object, then invoke an import method on that object, or make it part of the construction of the Key object. I propose the latter, so that we don't complicate the state model of the Key object.

So in WebIDL,

interface Crypto {

... other stuff ...

KeyGenerator importKey(DOMString format, ArrayBuffer keyBlob, optional Key wrappingKey=null);
}

interface Key {

... other stuff ...

KeyExporter exportKey(DOMString format, optional Key wrappingKey=null);
}

Where KeyExporter is exactly like KeyGenerator but returns a value instead of a Key object.

One big issue is what key formats should be supported. For symmetric keys it makes sense to support a raw format, but for asymmetric keys things are more complex. As has been brought up on other threads, many commonly-used formats are ASN.1 based and so it seems like supporting that would really help interoperability. However, I'd like to avoid a repeat of the mandatory algorithms discussion. Any ideas here are welcome.

Received on Thursday, 16 August 2012 19:51:49 UTC