1
0
mirror of https://github.com/bitcoinbook/bitcoinbook synced 2024-12-23 15:18:11 +00:00

seed random number generator in ec-math.py

This commit is contained in:
Amir Taaki 2015-01-18 21:21:22 +01:00
parent f7804da5db
commit 406a3303bb

View File

@ -1,5 +1,6 @@
import ecdsa
import random
import time
from ecdsa.util import string_to_number, number_to_string
# secp256k1, http://www.oid-info.com/get/1.3.132.0.10
@ -37,6 +38,9 @@ def get_point_pubkey_uncompressed(point):
'%064x' % point.y()
return key.decode('hex')
# Seed random number generator.
random.seed(time.time())
# Generate a new private key.
secret = random_secret()
print "Secret: ", secret