Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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")