Consensys / eth-lightwallet

Lightweight JS Wallet for Node and the browser
MIT License
1.47k stars 501 forks source link

Signature and nonce #130

Closed Robien closed 7 years ago

Robien commented 7 years ago

Hello,

I noticed that when I use the signMsg function it always return the same value for the same input. If I use the web3 console it is different each time.

I read that the digital signature algorithm need to use random nonce to generate the resulting signature. It still works without it but it may be less safe.

What is the strategy used by eth-lightwallet? is it OK to not use a random value? are there a plan to implement it?

Thanks

coder5876 commented 7 years ago

Hi @Robien, we use the RFC6979 deterministic signature algorithm, which generates the nonce from the cipher text. The danger with nonce reuse is to use the same nonce for different messages, which doesn't happen here.

Robien commented 7 years ago

Thank you for your reply. I am not a specialist in security and I am glad to know you know your stuff :)

That perfectly answer my question.