It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
from M2Crypto import EC
[...]
ec = EC.gen_params(ec_curve)
[...]
with open(outfile, 'a') as finds:
while True:
ec.gen_key()
[...]
def gen_key(self):
"""
Generates the key pair from its parameters. Use::
keypair = EC.gen_params(curve)
keypair.gen_key()
to create an EC key pair.
"""
assert m2.ec_key_type_check(self.ec), "'ec' type error"
m2.ec_key_gen_key(self.ec)
%rename(ec_key_gen_key) EC_KEY_generate_key;
from __future__ import print_function
import hashlib
import time
import binascii
import base64
import sys
import ahocorasick
ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
def base58encode(inp):
BASE = 58;
bi = int(binascii.hexlify(inp), 16)
s = ""
while bi > 0:
s = ALPHABET[bi%BASE] + s
bi = bi/BASE
nPad = 0
for c in inp:
if c == '\0': nPad += 1
else: break
return (ALPHABET[0]*nPad) + s
def public2address(publickey):
ripemd = hashlib.new('ripemd160')
version = '\x00'
ripemd.update(hashlib.sha256(publickey).digest())
keyhash = version+binascii.unhexlify(ripemd.hexdigest())
checksum = hashlib.sha256(hashlib.sha256(keyhash).digest()).digest()[0:4]
bitcoinaddress = base58encode(keyhash+checksum)
return bitcoinaddress
def main():
outfile = sys.argv[1]
target = sys.argv[2]
from M2Crypto import EC
curve = 'secp256k1'
ec_curve = eval('EC.NID_%s' % curve)
tree = ahocorasick.KeywordTree()
file = open(target)
print("Reading file...")
for line in file:
l = line.rstrip()
tree.add(l)
print("Generating tree...")
tree.make()
ec = EC.gen_params(ec_curve)
CONST1 = binascii.unhexlify("308201130201010420")
CONST2 = binascii.unhexlify("a081a53081a2020101302c06072a8648ce3d0101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f300604010004010704410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020101a144034200")
test = False
count = 0
t = time.time()
interval = 500
with open(outfile, 'a') as finds:
while True:
ec.gen_key()
#M2Crypto adds some stuff to the public key
pubkey = ec.pub().get_der()[23:]
address = public2address(pubkey)
where = tree.search(address.lower()[:10])
if test or where:
print("Address: "+address)
print("Public key: "+binascii.hexlify(pubkey))
#For some reason it can only save the private key to a file -.-
ec.save_key("key"+outfile, None)
with open("key"+outfile) as keyfile:
keyfile.readline()
priv = keyfile.readline().rstrip()
#M2Crypto adds some stuff to the private key.
#Removing it, and re-encoding to base58
shortpriv = base64.b64decode(priv)[7:-9]
print("Private key base58: "+base58encode('\x80'+shortpriv+hashlib.sha256(hashlib.sha256('\x80'+shortpriv).digest()).digest()[0:4]))
priv = CONST1 + shortpriv + CONST2 + pubkey
print("Private key full hex: "+binascii.hexlify(priv))
if not test:
word = address[where[0]:where[1]]
print(word)
finds.write(word+" "+address+" "+binascii.hexlify(pubkey)+" "+binascii.hexlify(priv)+"\n")
print("")
count += 1
if count%interval == 0:
dt = time.time() - t
print(str(int(interval/dt)) + " keys/sec ",end='\r')
t = time.time()
main()