cryptocoinjs / secp256k1-node

Node.js binding for an Optimized C library for EC operations on curve secp256k1
Other
341 stars 120 forks source link

Is there a method to encrypt data with a specific public key ? #196

Closed JW-Rami closed 1 year ago

JW-Rami commented 1 year ago

I can't find documentation about the encryption part for encrypt data with a specific public key

junderw commented 1 year ago

ECDSA is not for encryption.

There is a separate standard called ECIES which allows you to encrypt and decrypt data using symmetric keys generated from ECDH keys.

https://www.npmjs.com/package/eccrypto

This library supports ECIES, and the public and private keys generated by this library are compatible with that library.