bitchan / eccrypto

JavaScript Elliptic curve cryptography library
Creative Commons Zero v1.0 Universal
302 stars 99 forks source link

ECDSA Sign returns always same signature(but it shouldn't) #59

Open Asphiii opened 4 years ago

Asphiii commented 4 years ago

Hello, I've got a problem with the ECDSA Sign function. It should return always different signatures due to the K value, but it doesn't - its always the same. How can I change that manually? Best regards, Luke

przpl commented 4 years ago

I had similar problem with different library (elliptic). I don't know eccrypto details but I think it may be an implementation of a "Deterministic ECDSA": RFC 6979.

In Deterministic ECDSA the same K value will be used for the same data thus giving the same signature. For other data other K will be used, so we don't have to worry.

JBaczuk commented 4 years ago

@Asphiii I know this is late, sorry, can you share your code? If you run the example in the REAME it does generate a different signature every time.