Bitcoin Forum
June 16, 2024, 05:52:37 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Need help with Python Scrict Private Key Search  (Read 199 times)
Marshal TITO (OP)
Newbie
*
Offline Offline

Activity: 11
Merit: 2


View Profile
April 20, 2021, 04:44:06 PM
 #1

Hi all

i am new to this Forum so a BIG "HI" to all.

I try different scripts from Github, now i found one, that bring me to a Problem.

https://github.com/shiky8/Btc_Brute

i want to play around with this script, and i try to change it to print all results in a txt file.

But it dont work.

The script is made to only show the "Match" Result, is it possible to write all, that is shown on the screen in a txt file ?

Hope i write understandable, my english is so LALA !

NotATether
Legendary
*
Offline Offline

Activity: 1638
Merit: 6897


bitcoincleanup.com / bitmixlist.org


View Profile WWW
April 20, 2021, 05:47:54 PM
 #2

Yeah in fact it's very simple to tweak it to print all addresses.

This is the source code of the entire script:

Code:
import blocksmith
address_1 = str(input('Enter the btc address: ')) #'1PQc5NNSdvRwyw2RvrrQcBF4jHnmQFRkaL'
sert=0
while True:    
    paddress_1aphrase = blocksmith.KeyGenerator()
    paddress_1aphrase.seed_input('qwertyuiopasdfghjklzxcvbnm1234567890') # paddress_1aphrase
    private_Key = paddress_1aphrase.generate_key()
    address = blocksmith.BitcoinWallet.generate_address(private_Key)
    sert+=1
    if address_1 == address:
        print("we found it ")
        print("private private_Key = ", private_Key)
        print("address = ",address)
        break
    else:
        print("trying private private_Key = ", private_Key)
        print("address = ",address)
        continue

To print to a file like you asked, we just write f = open("results.txt", "w") followed by print(..., file=f) on every statement you want to redirect. This has the consequence of causing no output to be sent to the terminal.

So the modified script would look like this:

Code:
import blocksmith
address_1 = str(input('Enter the btc address: ')) #'1PQc5NNSdvRwyw2RvrrQcBF4jHnmQFRkaL'
sert=0
f = open("results.txt", "w")
while True:    
    paddress_1aphrase = blocksmith.KeyGenerator()
    paddress_1aphrase.seed_input('qwertyuiopasdfghjklzxcvbnm1234567890') # paddress_1aphrase
    private_Key = paddress_1aphrase.generate_key()
    address = blocksmith.BitcoinWallet.generate_address(private_Key)
    sert+=1
    if address_1 == address:
        print("we found it ", file=f)
        print("private private_Key = ", private_Key, file=f)
        print("address = ",address, file=f)
        break
    else:
        print("trying private private_Key = ", private_Key, file=f)
        print("address = ",address, file=f)
        continue

However, I do not recommend making this change. The computational speed of programs is limited by the time it takes to write I/O to a console or disk, and it has very high latency because you are making the same write() kernel call millions of times, and that's going to dominate and throttle the program speed.

Basically instead of iterating through billions of keys per second you will be printing and iterating through just thousands per second.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Marshal TITO (OP)
Newbie
*
Offline Offline

Activity: 11
Merit: 2


View Profile
April 20, 2021, 06:01:14 PM
 #3

UPS this side of the medal i have not look at.

Thank you for your help, now i understand the position of the " print " funktion a bit more.

This was the only, so called brute script i found, that ws not to hard to handle for me.

My goal was to fix 2 PK i have, one starts with a 5 and one with L5, but only 42 and 43 characters are left, after my daughter try to be Picasso, when she was 3 years old.

Not only Picasso drawing, also she tear of the paper, where it was written, in 2016.
I forget the pice that was left, and found it yesterday when i sort the old documents out.

I have the Public Keys so i try this script, maybe it exist a better solution !?
NotATether
Legendary
*
Offline Offline

Activity: 1638
Merit: 6897


bitcoincleanup.com / bitmixlist.org


View Profile WWW
April 20, 2021, 06:07:45 PM
 #4

UPS this side of the medal i have not look at.

Thank you for your help, now i understand the position of the " print " funktion a bit more.

This was the only, so called brute script i found, that ws not to hard to handle for me.

My goal was to fix 2 PK i have, one starts with a 5 and one with L5, but only 42 and 43 characters are left, after my daughter try to be Picasso, when she was 3 years old.

Not only Picasso drawing, also she tear of the paper, where it was written, in 2016.
I forget the pice that was left, and found it yesterday when i sort the old documents out.

I have the Public Keys so i try this script, maybe it exist a better solution !?

Was the beginning or end of the private key torn off?

If it was at the end, then given that it was only a few characters lost, we can use the BitCrack program (https://bitcointalk.org/index.php?topic=4453897.msg39845999#msg39845999) to brute force the key by trying all the possible characters that it could've been. I'll help you set it up (and run it for free for you if you can't).

Alternatively, have you ever spent Bitcoin from that private key? There is a faster program we can use if you manage to find a transaction ID that spends from it, but it requires its public key.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Marshal TITO (OP)
Newbie
*
Offline Offline

Activity: 11
Merit: 2


View Profile
April 20, 2021, 06:36:49 PM
 #5

Like you guess, it is the end that is missed.

The child logic was, ooo the right side of the paper is free, there i can draw, and nobody will be angry  Roll Eyes Roll Eyes nobody was angry BTC was around 450 $ and now, its a CAR  Cry Cry

Like i say the PK with the 5 at the start has 42 Characters left,

The PK with the L5 has 43 characters left.

And there have be Transactions made on the addresses its a bit confussed,

I try to send you pm, but it says i cant because new member.

The TX method maybe work.
NotATether
Legendary
*
Offline Offline

Activity: 1638
Merit: 6897


bitcoincleanup.com / bitmixlist.org


View Profile WWW
April 20, 2021, 07:01:04 PM
 #6

And there have be Transactions made on the addresses its a bit confussed,

OK, what is the address for this private key so I can look it up in a block explorer to extract the public key?

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
PrimeNumber7
Copper Member
Legendary
*
Offline Offline

Activity: 1624
Merit: 1899

Amazon Prime Member #7


View Profile
April 21, 2021, 02:29:32 AM
 #7

Code:
    else:
        print("trying private private_Key = ", private_Key, file=f)
        print("address = ",address, file=f)
        continue
I don't think this code snippet should be used. I don't see any point in logging private keys that are not a match if you are trying to brute force a private key.

However, I do not recommend making this change. The computational speed of programs is limited by the time it takes to write I/O to a console or disk, and it has very high latency because you are making the same write() kernel call millions of times, and that's going to dominate and throttle the program speed.

Basically instead of iterating through billions of keys per second you will be printing and iterating through just thousands per second.
If I am not mistaken, the sdout on the terminal would quickly eat up available memory since the sdout is never flushed, so printing to the terminal IMO is not a good idea. Your concern would also be addressed if my above suggestion is implemented.
WanderingPhilospher
Full Member
***
Offline Offline

Activity: 1078
Merit: 219

Shooters Shoot...


View Profile
April 21, 2021, 05:20:44 AM
 #8

Like you guess, it is the end that is missed.

The child logic was, ooo the right side of the paper is free, there i can draw, and nobody will be angry  Roll Eyes Roll Eyes nobody was angry BTC was around 450 $ and now, its a CAR  Cry Cry

Like i say the PK with the 5 at the start has 42 Characters left,

The PK with the L5 has 43 characters left.

And there have be Transactions made on the addresses its a bit confussed,

I try to send you pm, but it says i cant because new member.

The TX method maybe work.
With only 9 to 10 characters missing at the end, should only take a few seconds to find your private key. Easy.
Coding Enthusiast
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
April 21, 2021, 06:09:41 AM
 #9

Like i say the PK with the 5 at the start has 42 Characters left,
The PK with the L5 has 43 characters left.
Check out my project, The FinderOuter.
In "Missing Base58" option enter the characters you have and replace the remaining missing characters with '*' and click Find button.
Look at examples 3 and 4 for more information.


The optimized method works for up to 11 missing chars at the end of a compressed key and up to 9 for uncompressed. Since you are missing 9 for both it works for you. I'll optimize it soon to support more.

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
Marshal TITO (OP)
Newbie
*
Offline Offline

Activity: 11
Merit: 2


View Profile
April 21, 2021, 09:33:15 AM
 #10

Looks great, i have win 10, does it run on it ?
Coding Enthusiast
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
April 21, 2021, 10:53:14 AM
 #11

Looks great, i have win 10, does it run on it ?
Yes, FinderOuter can run on all operating systems.
You have to compile the source code yourself for Windows, although I suggest always dealing with private keys on an air-gap machine.
Steps are explained in ReadMe file on GitHub.
Remember to use release configuration:
Code:
dotnet build --c Release

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!