Title: SHA256 recognizing signer Post by: Piggy on August 18, 2017, 05:44:13 AM Hi,
Anybody has some material/code snippet/example explaining how given multiple signed messages (using SHA256), we can determine which were signed with the same key? Thanks Title: Re: SHA256 recognizing signer Post by: jambola2 on August 18, 2017, 05:49:50 AM I think you've misunderstood what SHA-256 is.
SHA is a hash function, ie: it takes one value (a message), and outputs one value (a hash). There is no key involved. Bitcoin signature uses ECDSA, there's stuff like PGP which uses RSA/DSA. But no, SHA256 does not allow for signatures. The closest I can think of, is when a website publishes a SHA checksum for a file, allowing you to verify that the file was not maliciously altered. Maybe explain your specific situation more, that might help others figure out what you're looking for. Title: Re: SHA256 recognizing signer Post by: Piggy on August 18, 2017, 06:02:54 AM I think you've misunderstood what SHA-256 is. SHA is a hash function, ie: it takes one value (a message), and outputs one value (a hash). There is no key involved. Bitcoin signature uses ECDSA, there's stuff like PGP which uses RSA/DSA. But no, SHA256 does not allow for signatures. The closest I can think of, is when a website publishes a SHA checksum for a file, allowing you to verify that the file was not maliciously altered. Maybe explain your specific situation more, that might help others figure out what you're looking for. thanks to clarify that. I read in bitcoin or other coins, a transaction is accepted when other nodes recognize that the public key (address) and the hashed transaction itself were signed with the same key. I'm interested in how this is done in specific, i guess i should look up for ECDSA now. Thats why i was not finding anything :-\ If you can still point me to some code sample / documents you know would be appreciated. Thanks Title: Re: SHA256 recognizing signer Post by: jambola2 on August 18, 2017, 07:08:26 AM thanks to clarify that. I read in bitcoin or other coins, a transaction is accepted when other nodes recognize that the public key (address) and the hashed transaction itself were signed with the same key. I'm interested in how this is done in specific, i guess i should look up for ECDSA now. Thats why i was not finding anything :-\ If you can still point me to some code sample / documents you know would be appreciated. Thanks To be honest, I think the easiest resource for this is likely just Wikipedia: https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm It outlines both the signature generation algorithm, and the signature verification algorithm. If you really want to look at some code, here's a Python module dealing with the signature verification: https://github.com/nanotube/supybot-bitcoin-marketmonitor/blob/master/GPG/local/bitcoinsig.py You can look through the code, but I don't think it will be easily understood. Title: Re: SHA256 recognizing signer Post by: Piggy on August 18, 2017, 08:00:54 AM thanks to clarify that. I read in bitcoin or other coins, a transaction is accepted when other nodes recognize that the public key (address) and the hashed transaction itself were signed with the same key. I'm interested in how this is done in specific, i guess i should look up for ECDSA now. Thats why i was not finding anything :-\ If you can still point me to some code sample / documents you know would be appreciated. Thanks To be honest, I think the easiest resource for this is likely just Wikipedia: https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm It outlines both the signature generation algorithm, and the signature verification algorithm. If you really want to look at some code, here's a Python module dealing with the signature verification: https://github.com/nanotube/supybot-bitcoin-marketmonitor/blob/master/GPG/local/bitcoinsig.py You can look through the code, but I don't think it will be easily understood. that python code is quite something :) ill start to read to read how the algorithm is working in general then, thanks for your help! |