Created
December 7, 2017 06:10
-
-
Save svyatonik/cf36dec2623685eab0cbcd87fca0a244 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
#!/usr/bin/python2.7 | |
import secp256k1 # install by typing `pip install secp256k1` | |
key_id = bytes(bytearray.fromhex('0000000000000000000000000000000000000000000000000000000000000001')) | |
sk = secp256k1.PrivateKey() | |
sig_raw = sk.ecdsa_sign_recoverable(key_id, raw=True) | |
sig_der = sk.ecdsa_recoverable_serialize(sig_raw) | |
pub_der = sk.pubkey.serialize(compressed=False) | |
print 'SECRET: ' + ''.join('{:02x}'.format(ord(c)) for c in sk.private_key) | |
print 'PUBLIC: ' + ''.join('{:02x}'.format(ord(c)) for c in pub_der[1:]) | |
print 'SIGNATURE: ' + ''.join('{:02x}'.format(ord(c)) for c in sig_der[0]) + '{:02x}'.format(sig_der[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment