-
Notifications
You must be signed in to change notification settings - Fork 12
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
Remove Ed25519 -> X25519 conversion from spec #39
Comments
@OR13 is the proposal to not have the |
big fan of this - would simplify things and improve security |
On further consideration, I'd be +1 to removing |
^ exactly... for example, here is how we generate
Here would be the new structure for
|
imo how you derive a public key or private key is out of scope for the spec.... that includes curve conversion, mnemonics, or key generation functions that take passwords. |
For the use cases that have no need of an integrated key agreement key and for those use cases where its mere presence may cause some regulatory trouble (unknown), it would simplify things. For use cases where an integrated key agreement key is beneficial, it will complicate things. Regarding "improve security", however, I have to disagree, if the current literature is to be believed (that sharing the same key for both ed25519 and x25519 operations has been proven secure). Sure, it may be the case that certain governments would not accept the same key to be used for both of these operations, but that is merely a matter of current policy.
Being able to generate a key is not the same thing as having a verification relationship in a DID document authorizing its use for a specific purpose. Removing A large part of the interoperability story around DIDs is that applications can treat the DID documents the same, regardless of the method used. This provides a separation of concerns: use a trusted DID resolver and once you've got a DID document, you can rely on its verification relationships and methods from there and ignore the DID method. |
To be clear on my position here: If the use cases just aren't there for key agreement keys for ed25519 |
A use case that needs to be considered here (and whether or not You are required to use a single DID for which you can both authenticate (or take an action, i.e., invoke a capability) and do encrypted communications/data. The fact that So -- are there use cases such as the one above where |
Another option to consider, would be to register another public key type in the multicodec table that means: "an ed25519 public key that can be transformed using a birational map for use as an x25519 key". So there would be a different |
yep, if the multicodec says "ed25519 public key that will be converted to x25519 public key" thats fine... but still likely to trigger security folks who don't want to see that happening. worth noting that RSA / P-256 and other key types already support both key agreement and signatures... using "snowflake" did key formats should be optional imo... another option is to do the conversion before encoding the did, and handle this like we handle bls12381 g1 + g2. https://github.com/multiformats/multicodec/blob/master/table.csv#L94 |
Waiiit, the whole point here is that this conversation got started because of the security "best practice" that one should not use the same key for both purposes. (Or derive the key, either.) |
No, because we are not using Ed25519 for keyAgreement today, we are converting to X25519 and then using that key... You can't have it both ways... Either you think it's a good idea to have a key for a single purpose, or you think it's a good idea to be honest about what purposes a key can support. I think we should expose what is supported by a SINGLE KEY TYPE, and nothing more.... I would also be ok making did key look like this:
since interpreting 'verification relationships as purposes' and then allowing everything that is possible to be expressed seems to be a security pattern failure... or a reflection of practical reality... (ED25519 for assertion and authentication). since did key is deterministic, and multiformats don't encode purposes in the key type (hmm i wonder why?).... we would appear to have 2 options:
since 2 would make did:key useless, we are left with 1. Ed25519 should be allowed for keyAgreement IF and ONLY IF, it's possible to use it for that purpose. NEW_KEY_TYPE should be allowed for PURPOSE IF and ONLY IF, it's possible to use it for that purpose. Converting between types for specific keys should not be a legal way to circumvent 1... its complexity, attack surface, and implementation burden. |
Hmm, to me, calling it a different key and saying that there's a security-related concern because it's the same key is having it both ways. Factually, it is the same key, just represented differently (a point on one curve vs. a point on another birationally equivalent one). It is precisely the fact that it is the same key that is driving the security-related concern from some people (though there's a security proof suggesting the concern is unwarranted). If it were actually a different key, then it would be the "snowflake" (as you describe) but the security-related concern would be dropped. Perhaps the argument is that it's a snowflake because the representation changes. Maybe that's what you were going for. But I don't think we should say that having a different representation for key agreement makes something a "snowflake" that should be discouraged. We don't know what kind of curves/other math primitives might be of use in the future to make the same key material be used more efficiently in different protocols. |
If we can get an ed25519+x25519 key type into multiformats, then I think that's the path forward here as it would work with the above and give us the consistency we want. |
Sure, but thats an argument to have with DJB and the folks who decided Ed25519 != Curve25519... they are different keys, their bytes are different.... they have different do you think or should it be encoded as this matters if resolvers refuse to implement derivation, the latter representation would still allow them to resolve... and... it would also support: seed 1 - > Ed25519 k1
Whereas today: seed 1 - > Ed25519 k1 -> X25519 k2 is happening.... this would probably be valuable when working with HSMs. |
Hmm, we may end up needing to support both approaches but perhaps we should only start out with the first one. We should probably use a different multicodec value for each one (or include some value that indicates whether there's more than one set of key bytes). The latter approach would probably have the benefits you suggest, but I'd be concerned about having to think through all of the implications of people starting to use N many keys in |
The ephemeral nature of this method favors convenience features like this, when security measures allow. In that sense, I do support the idea of having key agreement in ed25519. |
But the method is weakened by "snowflake edge cases"... you still have the ability to use X25519 keys with did:key... and you still have the ability to do key agreement and signature with P-384. Security reviews of the method will object to these edge cases... as they should. |
We will be removing key conversion from our libraries shortly. |
This would eliminate concern regarding the security of the operation.
and make ed25519 keys like every other key type.
The text was updated successfully, but these errors were encountered: