Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Cryptomanul on October 29, 2020, 12:59:57 PM



Title: Looking for some tools to work on private keys
Post by: Cryptomanul on October 29, 2020, 12:59:57 PM
Hope that's the right subforum to ask.
Found out that I need something like this (http://lenschulwitz.com/base58) and this (http://gobittest.appspot.com/PrivateKey) for secure offline usage. Actually, I need:
1) base58 encode/decode (somehow I can find only online tools and libraries on google and nothing that could be just used offline) 
2) sha256 hash (tried to use built in Notepad++ but somehow results are quite different from sha256 on http://gobittest.appspot.com/PrivateKey, seems I'm misunderstanding something here)

If these tools could bulk work on files with multiple strings (like input.txt->output.txt) this would be perfect. Maybe someone knows what should I use? I'm not very good at coding, so I'm looking for something simple to use/install.

Also if there is some tool to bulk validate WIFC format private keys (by validating I mean situation like: I have 10k+ strings, each 52 symbols, beginning with K. I need to check which strings are properly generated WIFC keys that can be used as, you know, private keys and write the correct ones to the output file) it could be very handy.   


Thanks!


Title: Re: Looking for some tools to work on private keys
Post by: webtricks on October 29, 2020, 03:16:47 PM
Hope that's the right subforum to ask.
Found out that I need something like this (http://lenschulwitz.com/base58) and this (http://gobittest.appspot.com/PrivateKey) for secure offline usage. Actually, I need:
1) base58 encode/decode (somehow I can find only online tools and libraries on google and nothing that could be just used offline) 
2) sha256 hash (tried to use built in Notepad++ but somehow results are quite different from sha256 on http://gobittest.appspot.com/PrivateKey, seems I'm misunderstanding something here)

If these tools could bulk work on files with multiple strings (like input.txt->output.txt) this would be perfect. Maybe someone knows what should I use? I'm not very good at coding, so I'm looking for something simple to use/install.

Also if there is some tool to bulk validate WIFC format private keys (by validating I mean situation like: I have 10k+ strings, each 52 symbols, beginning with K. I need to check which strings are properly generated WIFC keys that can be used as, you know, private keys and write the correct ones to the output file) it could be very handy.   

Thanks!

About SHA256 hash, the issue is that you are simply trying to generate hash of string representation of private key. To correctly generate sha256, you need integer value of private key in hexadecimal form.

Try using this website for testing purpose and to understand the difference between 'string representation of hex' and actual 'hex': https://www.liavaag.org/English/SHA-Generator/ . Choose the input type = 'hex' and then generate the SHA256 hash.

Regarding your required tool, I don't know if there is any available online that matches your tailored requirements. However, I can create one. You need to tell me if you have any prior knowledge of Javascript or not so I can edit the tool accordingly providing the required level of ease. I have already created a javascript library in past which fulfills most of what you are looking for. I just have to tweak it a little to match your preferences. You then just have to download the file and run offline in browser - as simple as that.


Title: Re: Looking for some tools to work on private keys
Post by: LoyceV on October 29, 2020, 03:44:36 PM
I'm not sure if it fits all your requirements, but bitcoin-tool is probably a good start. I don't want to provide a link, because I'm not sure if the Github link I find is the official one. I downloaded my copy years ago. Just to be sure: run it in a VM to protect your (offline) host.


Title: Re: Looking for some tools to work on private keys
Post by: BrewMaster on October 29, 2020, 04:48:00 PM
If these tools could bulk work on files with multiple strings (like input.txt->output.txt) this would be perfect. Maybe someone knows what should I use? I'm not very good at coding, so I'm looking for something simple to use/install.

if you tell us what you are trying to do we can help you better. for example why do you want to create so many WIFs?
the text conversion specially when base58 is involved will be very slow and since it is not a normal thing, the chances of finding a program that does what you ask here is little to none. but for example if you were trying to brute force a key, there are better tools available without needing this method. or if you were trying to create a paper wallet, then you should use deterministic setup and only have one master key.


Title: Re: Looking for some tools to work on private keys
Post by: BitMaxz on October 29, 2020, 05:47:57 PM
I'm not sure if it fits all your requirements, but bitcoin-tool is probably a good start. I don't want to provide a link, because I'm not sure if the Github link I find is the official one. I downloaded my copy years ago. Just to be sure: run it in a VM to protect your (offline) host.

I tried to search this tool there are many similar names but I found only one link from github that I think this is the official one.

Here's the link https://github.com/matja/bitcoin-tool


Title: Re: Looking for some tools to work on private keys
Post by: Cryptomanul on October 30, 2020, 11:12:11 AM
Thanks, people!


if you tell us what you are trying to do we can help you better. for example why do you want to create so many WIFs?
the text conversion specially when base58 is involved will be very slow and since it is not a normal thing, the chances of finding a program that does what you ask here is little to none. but for example if you were trying to brute force a key, there are better tools available without needing this method. or if you were trying to create a paper wallet, then you should use deterministic setup and only have one master key.

Actually all the fuzz is about restoring physically damaged paper wallet. WIFC key, some symbols here and there are damaged and there is no way to restore them physically. There are couple of leads that could narrow down the search, but not much. My idea was:
1) generate all possible combinations
2) decode base58
3) remove all strings without 01 byte before the checksum
4) remove all strings there checksum doesn't match
5) if the number of possibilities will be still too huge: generate list of adresses for these keys
6) compare the list with the list of alive bitcoin wallets and find my own)

I guess this would take a load of uptime, but I'm not much in the hurry. There isn't much money on the wallet, so it's more like a challenge and also money is money:)

Right now I'm planing to use fix-base58check feature in bitcoin-tool. Looks promising. Though if I could show it which symbols are definitely correct this probably would save much time during bruteforce process.

I'm not sure if it fits all your requirements, but bitcoin-tool is probably a good start. I don't want to provide a link, because I'm not sure if the Github link I find is the official one. I downloaded my copy years ago. Just to be sure: run it in a VM to protect your (offline) host.


I tried to search this tool there are many similar names but I found only one link from github that I think this is the official one.

Here's the link https://github.com/matja/bitcoin-tool

Thanks! This thing looks very promising in my situation:)


Title: Re: Looking for some tools to work on private keys
Post by: LoyceV on October 30, 2020, 12:07:56 PM
Actually all the fuzz is about restoring physically damaged paper wallet. WIFC key, some symbols here and there are damaged and there is no way to restore them physically.
What do you mean by "WIFC"? Is that a compressed WIF (https://en.bitcoin.it/wiki/Wallet_import_format)?
If it's a more or less "standard" problem, using existing software is much faster than trying to create your own method to restore the keys.

How many characters are missing? I've used a C-program that could restore up to 5 characters within a few minutes, as long as you know the location of the missing characters. See elbandi's post (https://bitcointalk.org/index.php?topic=1624496.msg16359515#msg16359515).

There's also The FinderOuter, a bitcoin recovery tool (https://bitcointalk.org/index.php?topic=5214021.0) that may help.