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

Get signing public key from DH public key, for the same secret Key/seed #70

Closed
fruiz500 opened this issue Mar 21, 2015 · 1 comment
Closed
Labels

Comments

@fruiz500
Copy link

This is somewhat related to #46 but not quite. I would like the same secret key to work for DH and for signing. One way to do it is this:

  1. Generate a DH keypair with: nacl.box.keyPair()
  2. Get the signing secret key from the DH secret key as a seed:
    secretKey_sign = nacl.sign.keyPair.fromSeed(secretKey_DH),
    the first 32 bytes will be the same as secretKey_DH
  3. Get the signing public key from the signing secret key with: nacl.sign.keyPair.fromSecretKey(secretKey_sign)

Now, the signer can do this and end up with two different public keys to give out, but it would be cleaner if the rest of the world could get one public key from the other. I guess the main difficulty is that those are points on different curves: a Montgomery curve for DH, and an Edwards curve for signatures, so that the process might require reversing one of the secret key -> public key generation steps.

But since the two curves are intimately related, perhaps the two public keys are related in some way that would allow calculating one from the other directly. Is there a possibility of this?

Thanks!

@dchest
Copy link
Owner

dchest commented Mar 21, 2015

Check out https://github.com/dchest/ed2curve-js (you'll have to go with nacl.sign.keyPair as the initial key pair).

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

No branches or pull requests

2 participants