Most likely because ecdsa can only sign and not encrypt. This is true for every implementation of ecdsa as its a limitation of ecdsa.
Whilst I see how to sign data using elliptic curves (crypto/ecdsa), I can't see how to encrypt data using elliptic curve keys. Can someone point me in the right direction?Thanks.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Whilst I see how to sign data using elliptic curves (crypto/ecdsa), I can't see how to encrypt data using elliptic curve keys. Can someone point me in the right direction?
Whilst I see how to sign data using elliptic curves (crypto/ecdsa), I can't see how to encrypt data using elliptic curve keys. Can someone point me in the right direction?
Please forgive my ignorance here, but the box functions appear to require both public and private keys to encrypt and decrypt. I'm wanting to have my system create tokens (encrypted data by private key) provided to client systems (that I don't control), to use with services (that I do control) that use a public key to decrypt it. My interest in elliptic curves instead of say RSA is comes down to key/block/token size for a reasonable level of security.
Please forgive my ignorance here, but the box functions appear to require both public and private keys to encrypt and decrypt.
If you are passing data to a third-party (the client systems) that you don't control then you might be able to simply use secret-key cryptography with a shared key between the encryption and decryption parts. (i.e. nacl/secretbox.)
In order to use public key cryptography (nacl/box) you can generate a random public/private keypair when encrypting and include the public key with the ciphertext for the decryption. This is called ElGamal encryption. The generated public/private keypair may be reused for several different encryptions, but the nonce must be strongly random. (I.e. read the nonce from crypto.rand.Reader.)