zaplocker icon indicating copy to clipboard operation
zaplocker copied to clipboard

Insecure digital signature

Open targon opened this issue 2 years ago • 1 comments

In step 1.(3) of the protocol the payment hash is used directly as the message hash for a digital signature. This is not a secure way to create digital signatures, you need to hash the message (=payment hash) one more time to get to the message hash. If you do not do this, signatures can be forged by randomly creating the signature parameters first and deriving the message hash from them.

(You may get away with this here because then nobody knows the preimage, but I would still consider it bad practice!)

targon avatar Oct 23 '23 15:10 targon

I think it is secure because if someone forges a signature in the manner you describe they will not be able to settle the payment, so the sender won't lose any money

supertestnet avatar Oct 23 '23 23:10 supertestnet