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

Ed25519 ECDH #28

Open
cloudhead opened this issue Jan 24, 2023 · 3 comments · May be fixed by #29
Open

Ed25519 ECDH #28

cloudhead opened this issue Jan 24, 2023 · 3 comments · May be fixed by #29

Comments

@cloudhead
Copy link

cloudhead commented Jan 24, 2023

Hey there, we're using this great library to implement an authenticated handshake between nodes that run on user machines. Users are also able to sign objects with their node key and it's important to be able to authenticate user nodes with the same key as the one they sign objects with. We've identified three potential ways to make this happen:

  1. Do the ECDH using ed25519 -- this would require the functionality be implemented in this library
  2. Move to ristretto255, which has library support for both ECDH and signing.
  3. Use an unauthenticated handshake, eg. Noise_NN with x25519, and do ed25519 authentication by sending certificates on the secure channel

The issue with (2) is that we store private keys in SSH format and make heavy use of ssh-agent, so moving to ristretto255 is not that straightforward. (3) is what we currently have, but it seems sub-optimal to have another roundtrip and protocol just for this, when DH is basically the right tool for the job.

I know it's possible to do ECDH with ed25519, just slower, and was hoping you'd consider adding support to your library, if you think it makes sense!

Cheers

@cloudhead cloudhead linked a pull request Jan 26, 2023 that will close this issue
@somehybrid
Copy link

I don't think ECDH would be necessary here. One, X25519 is much faster than ECDH, and secondly, it's trivial to convert an Ed25519 key to an X25519 key. For an example, see rust-crypto's way of converting between Ed25519 and Curve25519 keys, or signal's (V)XEdDSA

(plus, there might be some issues in public key exchange)

@jedisct1
Copy link
Owner

jedisct1 commented Dec 9, 2023

X25519 is ECDH, and is not really faster than DH over Edwards25519, especially if conversions are needed.

But if you need to convert from Ed25519 to Curve25519, that library already implements it.

@cloudhead
Copy link
Author

It's not possible to convert an X25519 key to Ed25519 though, which is what I need to make this work. I guess there is also https://www.signal.org/docs/specifications/xeddsa/ as a solution, but haven't looked into it.

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

Successfully merging a pull request may close this issue.

3 participants