Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage of encrypted content encryption keys in an EDV #45

Open
tplooker opened this issue Nov 12, 2020 · 9 comments
Open

Storage of encrypted content encryption keys in an EDV #45

tplooker opened this issue Nov 12, 2020 · 9 comments
Labels
ready for PR Ready for Pull Request

Comments

@tplooker
Copy link
Member

In some instances a group of documents inside an EDV may have a common level of access meaning they could be encrypted with a common encryption key and that encryption key is then encrypted once (via key agreement and key wrapping) to each of the valid recipients. This optimisation can be useful to bypass the need to perform the key agreement and key wrapping step on each document inside the group.

How this would look for instance is an EDV persists a document of the following structure.

{
  "id":"z19x9iFMnfo4YLsShKAvnJk4L",
  "sequence":0,
  "jwe":{
    "protected": {
        "enc":"C20P",
        "kid": "https://edv.example.com/document/4287248957624"
    }, // base64 decoded
    "iv":"FoJ5uPIR6HDPFCtD",
    "ciphertext":"tIupQ-9MeYLdkAc1Us0Mdlp1kZ5Dbavq0No-eJ91cF0R0hE",
    "tag":"TMRcEPc74knOIbXhLDJA_w"
  }
}

Where the kid references another document in the EDV of the following structure

{
  "id":"z19x9iFMnfo4YLsShKAvnJk4L",
  "jwe":{
    "protected": {
        "enc":"A256KW"
    }, // base64 decoded
    "recipients":[
      {
        "header":{
          "kid":"urn:123",
          "alg":"ECDH-ES",
          "epk":{
            "kty":"OKP",
            "crv":"X25519",
            "x":"d7rIddZWblHmCc0mYZJw39SGteink_afiLraUb-qwgs"
          },
          "apu":"d7rIddZWblHmCc0mYZJw39SGteink_afiLraUb-qwgs",
          "apv":"dXJuOjEyMw"
        }
      }
    ],
    "iv":"FoJ5uPIR6HDPFCtD",
    "ciphertext":"tIupQ-9MeYLdkAc1Us0Mdlp1kZ5Dbavq0No-eJ91cF0R0hE", < - encrypted content encryption key
    "tag":"TMRcEPc74knOIbXhLDJA_w"
  }
}

Where the decryption of the above document yields the content encryption/decryption key for the first document.

Questions

  1. The above approach can be implemented with EDV's today where an encrypted content encryption key is stored as an encrypted document, however if we wanted greater semantic separation we could elect to store encrypted content encryption keys under a new endpoint /keys instead of storing these as encrypted documents.

  2. Should this pattern feature anywhere in the spec or is it more of a candidate for an implementation guide?

@OR13
Copy link
Contributor

OR13 commented Nov 12, 2020

should kid be a URL, or would it be better if it were just a JWK thumbprint ?

Seems like replication would be broken if it were a URL.

@tplooker
Copy link
Member Author

tplooker commented Nov 12, 2020

Good question I think this raises the general question of how to refer documents in an EDV that isn't instance specific, and or whether there should be a relative URL referencing scheme

@OR13
Copy link
Contributor

OR13 commented Nov 12, 2020

yeah, I would say the URLs should be portable... or we failed... they are portable today.

AFAIK the proposal you are making is compatible, and could be supported.... it is not currently defined in the spec, or supported anywhere.

@OR13
Copy link
Contributor

OR13 commented Nov 17, 2020

Whats the nexts step on this? my read is that its low priority and would require minor changes to support. I feel we have bigger fish to fry.

@dmitrizagidulin dmitrizagidulin transferred this issue from decentralized-identity/confidential-storage May 25, 2021
@agropper
Copy link

agropper commented May 25, 2021 via email

@TallTed
Copy link
Contributor

TallTed commented Aug 5, 2021

Someone who has edit access to third-party comments could perhaps edit @agropper's latest comment above, to change all instances of @tobias Looker ***@***.***> (no codefence) to `@tobias Looker ***@***.***>` (with codefence) or @tplooker (who is actually on the issue), so we stop pinging @tobias about this issue?

Thanks, @dmitrizagidulin!

@tplooker
Copy link
Member Author

tplooker commented Aug 5, 2021

Discussed on WG call 5th of August, no resolution taken about the future of the issue. Had a brief discussion about other potential usecases for the capability such as integration with a web KMS.

@dmitrizagidulin
Copy link
Contributor

Discussed on Aug 2, 2021 call.

See comment on #42 (comment) -- this should be covered in the Sharing section.

@dmitrizagidulin dmitrizagidulin added the ready for PR Ready for Pull Request label Sep 2, 2021
@TallTed
Copy link
Contributor

TallTed commented Sep 2, 2021

[@dmitrizagidulin] Discussed on Aug 2, 2021 call.

s/Aug 2/Sept 2/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for PR Ready for Pull Request
Projects
None yet
Development

No branches or pull requests

5 participants