Posts

Showing posts with the label How secure is bitcoin private key generated by this script?

How secure is bitcoin private key generated by this script?

How secure is bitcoin private key generated by this script? I found this python script on github . It generates a pair of bitcoin private key and address. I know the private key may be vulnerable if it is created insecurely. I don't have much knowledge about Cryptology. Can you check if the script is secure? #!/usr/bin/env python # Joric/bitcoin-dev, june 2012, public domain import hashlib import ctypes import ctypes.util import sys ssl = ctypes.cdll.LoadLibrary (ctypes.util.find_library ('ssl') or 'libeay32') def check_result (val, func, args): if val == 0: raise ValueError else: return ctypes.c_void_p (val) ssl.EC_KEY_new_by_curve_name.restype = ctypes.c_void_p ssl.EC_KEY_new_by_curve_name.errcheck = check_result class KEY: def __init__(self): NID_secp256k1 = 714 self.k = ssl.EC_KEY_new_by_curve_name(NID_secp256k1) self.compressed = False self.POINT_CONVERSION_COMPRESSED = 2 self.POINT_CONVERSION_UNCOM...