openid / OpenID4VP

56 stars 19 forks source link

Response Encryption : Why HPKE without JSON envelope #310

Open hlozi opened 1 week ago

hlozi commented 1 week ago

The encryption for The Digital Credential Response should be specified in detail to ensure interoperability. Since the API is one-shot and doesn’t allow for negotiation, there should be a single encryption method. Negotiation would lead to privacy leaks.

Why HPKE ?

jogu commented 1 week ago

I think there's 3 separate points that are probably being mixed together here:

  1. For the interoperability profiles we need to select a single encryption method (which is a pretty uncontentious statement and something OID4VP does expect people to do, e.g. ISO 18013-7 picked ECDH-ES I think)
  2. The suggestion that HPKE should be that single encryption method (which is possible already without any breaking changes to OID4VP / will be possible when https://datatracker.ietf.org/doc/draft-ietf-jose-hpke-encrypt/ is further along in the IETF process. The suggestion to (optionally?) omit APU/AVP headers is I presume something that could be suggested to the authors of this draft if it currently requires them.)
  3. The suggestion to not use JARM, which would require a breaking change to OID4VP itself, rather than simply profiling it.
paulbastian commented 1 week ago

As discussed on DCP Call, currently the JARM encrypts the vp_token, which is a JSON structure. A possible (breaking) optimization could be to only encrypt individual Credentials, that could enable passing the encrypted credential to a SecureElement without it doing any JSON parsing.

c2bo commented 1 week ago

As discussed on the WG call today, I'd propose to initially add a small note in the JARM section that clarifies the different options from JOSE and explicitly points to HPKE as one such option.

Switching from the current variant to encryption on the level of individual credentials is something that needs a bit more discussion and also has some dependencies on features currently getting discussed like wallet attestation as part of the authorization response (and where exactly it resides).

paulbastian commented 6 days ago

To illustrate, currently we do:

Auth Response -> JARM JWE -> vp_token -> credential
                                      -> credential

The suggestion is to:

Auth Response -> vp_token -> JARM JWE -> credential
                          -> JARM JWE -> credential