I noticed that in ic-cdk v0.18, vetKey uses context: blob instead of derivation_path: vec blob. How is derivation_path converted to context? I haven’t found any documentation on this yet.
Hello! As we have now created and backed up a test key, which will be enabled soon, I wanted to give a quick update regarding some more minor changes to the vetKD API that we did in order to simplify it even further. Similar to the previous API adaptations, functionally there are no changes. The API changes are as follows:
-
Renamed field
derivation_idtoinput- Motivation: The term
derivation_idoften caused confusion andinputis a more standard name in the context of key derivation schemes.
- Motivation: The term
-
Changed field
derivation_path: vec blobtocontext: blob-
Motivation for changing
vec blobtoblob: The public key derivation algorithm that we are using internally is actually non-hierarchical, so there is no need to use avec bloband using ablobsimplifies the API and makes it easier to understand and also to explain. Up to now this was avec blobbecause we wanted to use the same type that we also use for the derivation paths for tECDSA and tSchnorr. But both of these use hierarchical public key derivation, so there thevec blobis in fact required. We think that simplifying the API outweighs the desire to have consistency with the tECDSA/tSchnorr derivation paths. -
Motivation for renaming
derivation_pathtocontext: The main use case for the derivation path is to do domain separation, i.e., to specify the context in which the derived keys are to be used. Given this, directly calling itcontextseems beneficial in that it makes the meaning of the field more clear and intuitive, and thus the API easier to use.
-
-
Renamed API
vetkd_derive_encrypted_keytovetkd_derive_key- Motivation: Although the fact that the returned key is encrypted is relevant in that it ensures that subnet nodes don’t see the key in clear text, this can be considered an implementation detail. Also the name
vetkd_derive_encrypted_keyis somewhat long andvetkd_derive_keyis short and sweet. In any case, in the returned struct, the (single) field is still calledencrypted_key, so it is still explicit that the returned key is encrypted.
- Motivation: Although the fact that the returned key is encrypted is relevant in that it ensures that subnet nodes don’t see the key in clear text, this can be considered an implementation detail. Also the name
-
Renamed field
encryption_public_keytotransport_public_key- Motivation: everyone everywhere (in publications, slides, demos, etc.) called this transport public key. The only reason this was not called
transport_public_keyin the API so far was because the containing API method was calledvetkd_derive_encrypted_keyand the nameencryption_public_keyshould have made it clear that it is this very public key under which the “encrypted key” is encrypted. Now that we are removing the partencrypted_from the API name, this reason is obsolete and we are free to call ittransport_public_key.
- Motivation: everyone everywhere (in publications, slides, demos, etc.) called this transport public key. The only reason this was not called
The changes are reflected in the spec PR, which will be merged as soon as the new test key is enabled.
Most vetKD-related examples have been updated accordingly already (see dfinity/examples/pull/1144 and dfinity/examples/pull/1145), the remaining ones will be updated shortly. The chainkey-testing-canister was updated as well (see chainkey-testing-canister/pull/10) and it was re-deployed.
After reviewing the basic_timelock_ibe example, I found that anyone can obtain the vetkey for any auction.
If encrypted bid data is accessible, the bid price can be decrypted—a malicious node provider could exploit this.
I believe this example is misleading and inappropriate for developers.
I used test_key_1 on the mainnet—vetkd_public_key succeeded, but vetkd_derive_key failed with the error: 'SignCostError(InvalidKeyName)' .
The canister uses ic-cdk v0.18 .
@zensh Can you please describe the steps describing what a malicious party would need to do in order to get unauthorized access to a vetKey in that example? I believe the only function in that example that retrieves vetKeys is invoked by a timer, so the conditions for retrieving vetKeys are quite limited and there is no canister APIs either allowing to derive vetKeys directly.
The test_key_1 is created and backed up, but it’s not yet enabled. IIRC we wanted to create a proposal next Monday today s.t. the key can be enabled latest next Monday if the proposal is accepted. cc: @franzstefan
Sorry, my mistake—I just realized IbeCiphertext is an asymmetric encryption algorithm. Client users don’t need the vetkey; instead, they encrypt data using a public key. This is a great feature!
Bare in mind that there are some necessary changes related to the public key derivation that are being rolled out with the latest release, so you may need to retrieve again your public keys once the rollout has finished (expected next Monday).
Out of curiosity, Do you have any existing use cases in mind? We would be happy to hear about those and provide support if needed.
In our use case, we employ vetkey to encrypt and protect the TEE’s root key. This root key is randomly generated inside the TEE during its initial service setup.
Additionally, in dMsg.net, all user keys will also be protected by vetkey.
We submitted the proposal to enable the test key on subnet fuqsr: Subnet Management - fuqsr (Application) - #49 by andrea
You might want to check out this from the current release. Btw love the work you did with ic-tee.
The purposes differ: IC’s TEE runs ICP nodes, while our ic-tee executes applications - specifically backend services that can’t be implemented with canisters.
Just tried it, test_key_1 is working now—only ic-cdk v0.18 left.
We’re seeing an unusual vetKD problem arising from a project for sharing encrypted files:
I am getting `vetkd_proper.js:98 (xed out) Proper VetKD key derivation failed: Error: Failed to derive encrypted key: vetKD system unavailable: IC0536: Management canister has no method ‘vetkd_encrypted_key’
at deriveFileKey (vetkd_proper.js:55:13)
at async Proxy.uploadFile (index.js:897:27)
at async Proxy.handleFileSelect (index.js:987:5)
index.js:973 Upload error: Error: VetKD_DERIVATION_FAILED: Failed to derive encrypted key: vetKD system unavailable: IC0536: Management canister has no method ‘vetkd_encrypted_key’
at deriveFileKey (vetkd_proper.js 26)
at async Proxy.uploadFile (index.js:897:27)
at async Proxy.handleFileSelect (index.js:987:5)
Is this live? do we need to pick a specific subnet?
Is this live? do we need to pick a specific subnet?
@shipstone, yes, the vetKeys feature is live, and you don’t need to target a specific subnet, as requests are automatically routed to the correct subnet that holds the master key.
vetKD system unavailable: IC0536: Management canister has no method ‘vetkd_encrypted_key’
The problem seems to be that you are using an outdated name for the key derivation function (vetkd_encrypted_key). We made some minor modifications to the vetKD API before the feature went live (see this and this), so as to make the API simpler and easier to understand. The new name is vetkd_derive_key. You find a detailed description of the new API here.
In the current VetKeys design, can the canister see the plaintext of the decrypted data?
No, VetKeys are end-to-end, so basically you encrypt data on client A, store it in canister B and then fetch it and decrypt it on client C.
The VetKeys API provides a way to generate private key material with access control from a canister towards multiple clients. For example, everyone who’s a member of a group chat can request the same private key material to encrypt and decrypt the messages within the group chat.
Adding to message by @sea-snake. It is also entirely possible and many times advisable to decrypt to plaintext in the canister. It depends on the usecase. If you for instance do a voting app where all votes are revealed after a certain point in time or a poker game where everyones hands are revealed at the same time, then decryption in the canister is the way to go.