bitcoinjs / tiny-secp256k1

A tiny secp256k1 native/JS wrapper
MIT License
84 stars 54 forks source link

How to decrypt/encrypt using private/public keys? #13

Closed jojoin closed 5 years ago

jojoin commented 5 years ago

I want to develop and implement a feature: using private key serial signature, get a final signature string, and then verify it use public key list in sequence.

Can I get your help ?

dcousens commented 5 years ago

Trying to understand what you're actually after here, but it seems:

Is that all?

jojoin commented 5 years ago

No, I mean:

I didn't find the way to decrypt it. Didn't it support?

dcousens commented 5 years ago

Ah, this library doesn't support ECDH like-encryption utilities or tools. It is highly focused for specific usage in bitcoinjs-lib signing and verifying.

You might be able to use https://github.com/cryptocoinjs/secp256k1-node/blob/master/API.md#ecdhbuffer-publickey-buffer-privatekey---buffer instead.

@fanatid ?

jojoin commented 5 years ago

very thanks !

fanatid commented 5 years ago

@dcousens no, ECDH only about creating shared secret from 2 private keys without disclosing keys to each other with Elliptic Curves. I can not remember anything what used private key for encrypting and public for decrypting.