-
-
Save brianmcmichael/e399d483ff8b4cff8bf60686daa17514 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ecdsa | |
import ecdsa.ellipticcurve as EC | |
curve = ecdsa.SECP256k1 | |
x = int('11db93e1dcdb8a016b49840f8c53bc1eb68a382e97b1482ecad7b148a6909a5c', 16) | |
y = int('b2e0eaddfb84ccf9744464f82e160bfa9b8b64f9d4c03f999b8643f656b412a3', 16) | |
point = EC.Point(curve.curve, x, y) | |
pubkey = ecdsa.VerifyingKey.from_public_point(point, curve) | |
hash1 = 90774958364900180671716888080665726921328827653065727390791155349203800699667 | |
r1 = 97921318692748166969765893503724782362221860890089306445657980140065784098104 | |
s1= 17870770544568028453805091504963125490615703388985597936947183001452377396233 | |
sig = ecdsa.ecdsa.Signature(r1, s1) | |
if pubkey.pubkey.verifies(hash1, sig): | |
print("Good") | |
else: | |
print("Bad") | |
hash1 = 70438975929202441702137589012525894517177874894451752259863210250765743151652 | |
r1 = 67469108926628898148530592947733862172872496318648607111578457920563549925544 | |
s1= 48322980310687297275040392060954045679965067960426297271026705220954611568793 | |
sig = ecdsa.ecdsa.Signature(r1, s1) | |
if pubkey.pubkey.verifies(hash1, sig): | |
print("Good") | |
else: | |
print("Bad") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Forked for archival purposes
h/t gmaxwell
https://gist.github.com/dymurray/ae77b54881fc3a815f9ffd176af94a89#gistcomment-2761793