mafintosh / sodium-encryption

Sodium encryption that works in node and in the browser
MIT License
46 stars 1 forks source link

Signing with scalarMultiplicationKeyPair #1

Open mikeal opened 7 years ago

mikeal commented 7 years ago

Apparently there is a difference in key size between the keys generated by scalarMultiplicationKeyPair and what https://github.com/mafintosh/sodium-signatures needs for signatures. Is there a way to use the same keypair for encryption and signing with sodium?

poga commented 7 years ago

sodium-signatures generate ed25519 key pair. sodium-encryption generate curve25519 key pair.

You can use https://github.com/dchest/ed2curve-js to convert an ed25519 key pair to curve25519.

However, using different key pairs for encryption and signing is recommened.

mikeal commented 7 years ago

@poga am I reading the post that you linked to incorrectly or does it actually say that it's fine to use the same keypair?

mikeal commented 7 years ago

also, thanks for the link to ed2curve, that solves my problem entirely :)