-
Notifications
You must be signed in to change notification settings - Fork 21
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
System API for threshold key derivation (vetKD) #158
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for ic-interface-spec ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
🤖 Here's your preview: https://jfhyp-gaaaa-aaaak-qck6q-cai.icp0.io/docs |
@fspreiss Can someone else forge the derivation_id for vetkd_encrypted_key and then invoke it? |
@tokuryoo, a canister can only get vetKeys for itself form the system API, that is, vetKeys are domain-separated by the canister that calls the system API. This means that derivation_ids cannot be forged so that one canister gets to the vetKeys of another canister. In any case, it is important that a canister does authentication regarding the vetKeys it forwards to users, that is, a canister must only give users their own keys. This can be achieved, for example, by using the calling user as derivation_id. You can see an example of this here, where |
@fspreiss CanisterB
|
@fspreiss |
@tokuryoo, this is not possible. Even if canisters A and B use the exact same This is because the system API is not using the derivation path directly for calculating the vetKey, but a combination of the calling canister's identity (for example, A or B) and the derivation path. (You can see the insecure implementation of the system API canister do that here.) This combination is what I meant with "domain separation" in my message above. You can think if it as follows: each vetKey requested from the system API is tied to the domain (meaning zone or realm) of the canister.
The two are used for different use cases. If your use case requires a key for symmetric encryption, you can use AES-GCM-256. If your use case requires a key for asymmetric encryption, you can use identity-based encryption (IBE). So it really depends on what you need. We aimed to make the vetKD system API flexible enough to support all of these.
We recently recorded a workshop video where the concepts of vetKD are explained and a walk-through of all the currently available demos is provided. You might find this helpful. You find a link to the latter here, and there are also several useful links in the video's description, such as developer docs, crypto background, Real-World Crypto conference talk, etc. I hope this helps. |
@fspreiss |
@tokuryoo, yes, that's definitely possible. Because it is the canister deciding who can (and cannot) get access to a particular vetKey, the canister can decide to give out some key to multiple people. The file sharing you mentioned is one example scenario. Another example scenario is group chat, where a canister gives out the key to the group's messages to all members of the group. |
@fspreiss |
@fspreiss just watching the walk-through video you did now, the talks here make me understand domain separation and derivation ids better, thanks. |
@fspreiss |
@tokuryoo, the slide 8 you are referring to (and also slide 7) is merely explaining the concept of an identity-based encryption (IBE) scheme, which typically relies on a central authority to derive keys. However, with the proposed vetKD primitive, on the Internet Computer, this central authority would be replaced with a set of nodes, where each node only has a share of the master secret. The latter is depicted in slide 9 and the ones following. Keys can only be derived if sufficiently many nodes agree to perform the key derivation. This means that even if one or even several node administrators up to a certain threshold would be malicious, then they still would not be able to derive (or "steal") keys. Regarding how If you have not done this already, I suggest to watch Gregory's Real-World Crypto conference talk: there everything is explained really well. Maybe you know this already, but there is also an active forum thread on threshold key derivation on the Internet Computer on the DFINITY forum here. Feel free to also ask questions there. |
@fspreiss
eks_i ← EKDer(msk_i, id, tpk) |
I have resolved it. There's no need to worry about it. |
It seems that vetKeys API has a deficiency: Retrieving a secret key for later signing allows to produce multiple signatures with that secret key, all of which would be verified true by a signature checker. This allows a canister with hacked hardware to secretly produce multiple signatures (and use it for example to authenticate multiple different calls to OpenAI API instead of one requested by a user, to steal OpenAI tokens). I propose to introduce additional API:
|
Can also this be implemented?
Moreover, the above could be rectified to support both symmetric and asymmetric encryption, possibly. |
Moreover, if secret key API retrieval API is not removed (being replaced by my API), then hacked canister hardware can without user's allowance use the retrieved key (multiple times), so authenticating to an external service without user allowance. |
Proposes two new system APIs for the prospective threshold key derivation (vetKD) feature in the management canister.
Notes
Alternatives considered
We considered the following alternative API, where one would have two sets of API pairs: one pair for threshold key derivation, and a second one for threshold BLS signatures.
This alternative was discarded, however, because there is a concern that not all possible future use cases can be covered with this split API approach.
TODOs