Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Patrick349 on September 22, 2016, 06:35:32 PM



Title: Private Key Restorer
Post by: Patrick349 on September 22, 2016, 06:35:32 PM
I need a private key restorer.


Title: Re: Private Key Restorer
Post by: achow101 on September 22, 2016, 06:38:48 PM
AFAIK there are no tools that do this. You will have to make one yourself.


Title: Re: Private Key Restorer
Post by: ghost15 on September 22, 2016, 06:56:17 PM
Hey guys,

I just found an old paper wallet. (I have only printed out private key and the bitcoin address) :)
But there are a few letters or numbers that I can't read anymore. :(

Now I need a tool where I can first enter the private key with the letters or numbers I don't know anymore... in this format:

5HpHag-65TZ-G1PH3CSu63k8Dbp-D8s5ip-nEB3kEsreAnc-uDf

After I entered this I want to enter the letters or numbers that can be possible or I can choose all letters or numbers to check.

Then I want to enter the bitcoin address which would be for this example:

1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm

Now the tool should check every private key that might be possible from my selection.

I hope you can help. :)

Best regards,

Patrick ;D
Bitcoin Address
1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm
Bitcoin Address Compressed
1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH


Public Key (130 characters [0-9A-F]): 0479BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798483ADA7726A3C 4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8
Public Key (compressed, 66 characters [0-9A-F]): 0279BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798

Private Key WIF
51 characters base58, starts with a '5'
5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf
Private Key WIF Compressed
52 characters base58, starts with a 'K' or 'L'
KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn


Private Key Hexadecimal Format (64 characters [0-9A-F]): 0000000000000000000000000000000000000000000000000000000000000001
Private Key Base64 (44 characters): AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE=


Title: Re: Private Key Restorer
Post by: LoyceV on September 22, 2016, 07:11:22 PM
5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf
OP and you:
Code:
5HpHag-65TZ-G1PH3CSu63k8Dbp-D8s5ip-nEB3kEsreAnc-uDf
5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf
I'm curious: how did you do this?
5 digits isn't that much, so an altered version of vanitygen could brute force it in seconds. But do you just happen to have that lying around?


Title: Re: Private Key Restorer
Post by: ghost15 on September 22, 2016, 07:35:31 PM
you can do it at https://www.bitaddress.org/
but it will take you a long time to exploit all the feasible solution.
about 570000 possibility withe these five missing letters  :'(
good luck


Title: Re: Private Key Restorer
Post by: LoyceV on September 22, 2016, 08:34:20 PM
you can do it at https://www.bitaddress.org/
but it will take you a long time to exploit all the feasible solution.
about 570000 possibility withe these five missing letters  :'(
good luck
So how did you do it in 20 minutes? It would be a nice trick to have if I ever need it.


Title: Re: Private Key Restorer
Post by: ghost15 on September 22, 2016, 09:20:09 PM
you can do it at https://www.bitaddress.org/
but it will take you a long time to exploit all the feasible solution.
about 570000 possibility withe these five missing letters  :'(
good luck
So how did you do it in 20 minutes? It would be a nice trick to have if I ever need it.
I have not done it in 20 minutes but 2 seconds ;D.                                                                                                                                   
because all the private key are numbers from 1 to 115792089237316195423570985008687907853269984665640564039457584007913129639935 (this privat key: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff or 5Km2kuu7vtFDPpxywn4u3NLu8iSdrqhxWT8tUKjeEXs2f9yxoWz as WIF), and the numbers of this key is just 1                                                                               
Quote
Private Key Hexadecimal Format (64 characters [0-9A-F]):                                                                                                      0000000000000000000000000000000000000000000000000000000000000001


Title: Re: Private Key Restorer
Post by: DannyHamilton on September 22, 2016, 09:48:02 PM
I could probably throw together a C program that would do this for you.  Do you have the ability to compile and run a C program?

If not, I might also be able to put together something in node.js



Title: Re: Private Key Restorer
Post by: elbandi on September 22, 2016, 10:27:42 PM
Compile this code: http://pastebin.com/S8WARrRn

This code is for address with 5 unknow "-" chars!!

First set your address to 58. line, and compile the code (you need openssl dev installed, apt-get install libssl-dev):

Code:
gcc -o recovery recovery.c -I /usr/include -Wall -lssl -lcrypto -O2

run it ( ./recovery ), and stop with ctrl+c, you got 5 "index: XX" lines.

Modify the "define C_X_INDEX" lines in the code (line 49-53). Compile again.

Run again and wait, get a coffee, or 10.  :D



Title: Re: Private Key Restorer
Post by: LoyceV on September 23, 2016, 07:55:23 AM
Compile this code: http://pastebin.com/S8WARrRn

This code is for address with 5 unknow "-" chars!!

First set your address to 58. line, and compile the code (you need openssl dev installed, apt-get install libssl-dev):

Code:
gcc -o recovery recovery.c -I /usr/include -Wall -lssl -lcrypto -O2

run it ( ./recovery ), and stop with ctrl+c, you got 5 "index: XX" lines.

Modify the "define C_X_INDEX" lines in the code (line 49-53). Compile again.

Run again and wait, get a coffee, or 10.  :D


I've got it running, to test :)

Code:
Test: 11...1.984325s
Test: 12...1.990294s
Test: 13...1.985650s
Test: 14...1.966374s
Test: 15...1.970396s
Test: 16...1.968263s
Test: 17...1.960968s
Test: 18...2.025619s
Test: 19...2.121881s
Test: 1A...2.021763s
Test: 1B...1.986647s
Test: 1C...2.025444s
Test: 1D...1.988550s
Test: 1E...2.019848s
Test: 1F...2.009220s
Test: 1G...1.994616s
Test: 1H...1.994534s
Test: 1J...1.989563s
When it says Test: 1A, it's searching for the all possibilities on the 3 dots that start with A1, until it stops at Tz.
5HpHag-65TZ-G1PH3CSu63k8Dbp-D8s5ip-nEB3kEsreAnc-uDf
5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf
That makes it a bit slower than vanity gen, doing 62^3=238328 keys in 2 seconds. Vanitygen does 3 times more, but uses both 2 cores.

Edit:
Test: Tx...1.986084s
Test: Ty...1.994141s
Test: Tz...
FOUND: 5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf

Thanks! I will keep this program, I may need it someday.


Title: Re: Private Key Restorer
Post by: elbandi on September 23, 2016, 08:30:08 AM
What does this output mean? When it says Test: 1A, what is it doing? Is it searching for the all possibilities on the 3 dots that start with A1, so it will stop at Tz?
5HpHag-65TZ-G1PH3CSu63k8Dbp-D8s5ip-nEB3kEsreAnc-uDf
5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf
"Test 1A" means: testing this privkeys: 5HpHag165TZAG1PH3CSu63k8Dbp*D8s5ip*nEB3kEsreAnc*uDf
there are 58*58 (=3364) so groups, with your cpu (~2 sec/testgroup) you get the result about 2 hours.

What doIf I'm right on this, it's a bit slower than vanity gen, doing 62^3=238328 keys in 2 seconds. Vanitygen does 3 times more on 2 cores.
i dont know vanitygen, how do you run it to test this keys?


Title: Re: Private Key Restorer
Post by: DannyHamilton on September 23, 2016, 12:16:12 PM
Yes, normaly I can run a C programm. :)

It would be nice if you can throw a programm togehter. ;)

No problem.

I'll put something together this weekend and test it for a few days next week to see how good I can get the performance.

In the meantime if you find another copy of your private key, or manage to remember what the values were, just let me know so I don't waste time on it.


Title: Re: Private Key Restorer
Post by: LoyceV on September 23, 2016, 12:46:56 PM
"Test 1A" means: testing this privkeys: 5HpHag165TZAG1PH3CSu63k8Dbp*D8s5ip*nEB3kEsreAnc*uDf
there are 58*58 (=3364) so groups, with your cpu (~2 sec/testgroup) you get the result about 2 hours.
Thanks. I edited my post the same time you posted this.
You say 58 where I assumed 62. I didn't realize until now the private key excludes the same characters that are excluded from the address.

Quote
i dont know vanitygen, how do you run it to test this keys?
Vanitygen searches random private keys until it finds an address with a certain prefix. Example: 1Loyce.
Annoyingly, it segfaults since I've (re)installed libssl-dev.

In the meantime if you find another copy of your private key, or manage to remember what the values were, just let me know so I don't waste time on it.
elbandi already posted a working program.


Title: Re: Private Key Restorer
Post by: LFC_Bitcoin on September 23, 2016, 09:03:46 PM
I could probably throw together a C program that would do this for you.  Do you have the ability to compile and run a C program?

If not, I might also be able to put together something in node.js



Top guy DannyHamilton is, one of the best here. OP you are lucky to have found a poster who is willing to do this for you.

Anomgst all the bull shit & scamming that goes on here it's good to see there are some good people here.


Title: Re: Private Key Restorer
Post by: dex1 on September 24, 2016, 12:28:50 PM
Compile this code: http://pastebin.com/S8WARrRn

This code is for address with 5 unknow "-" chars!!

First set your address to 58. line, and compile the code (you need openssl dev installed, apt-get install libssl-dev):

Code:
gcc -o recovery recovery.c -I /usr/include -Wall -lssl -lcrypto -O2

run it ( ./recovery ), and stop with ctrl+c, you got 5 "index: XX" lines.

Modify the "define C_X_INDEX" lines in the code (line 49-53). Compile again.

Run again and wait, get a coffee, or 10.  :D





Great code, works fine alas only with uncompressed private keys.

Would it be possible to write similar program to work with compressed ones ?



Title: Re: Private Key Restorer
Post by: elbandi on September 25, 2016, 12:28:47 PM

Great code, works fine alas only with uncompressed private keys.

Would it be possible to write similar program to work with compressed ones ?


Sure, here is the universal version: http://pastebin.com/gPzBp6u3

it recognize the compression type from the first char.

if the first char is a missing char, you have to set the compression type by manual (compressed = 0; or compressed = 1;)

tips are welcome: 1JsU1mfK3qxC37JoFiVhvi3KoA7ceUaMrZ  ::)


Title: Re: Private Key Restorer
Post by: salman786786 on May 06, 2020, 08:54:39 PM
I need a private key restorer.


guys i have Etherium private key was saved in notepad accidently my kids press some alphabet and first 20 digits missing and i have saved it without notic can anyone please help me to recover if its possible



Title: Re: Private Key Restorer
Post by: HCP on May 06, 2020, 11:37:15 PM
guys i have Etherium private key was saved in notepad accidently my kids press some alphabet and first 20 digits missing
20 characters missing!!?! :o :o :o

Your chances of being able to recover that in a 'timely' manner are pretty much zero... that's nearly 1/3 of the 64 hex characters making up a private key... and something ludicrous like 16^20 permutations... 1208925819614629174706176 to be precise. :o :o :o :-\


Title: Re: Private Key Restorer
Post by: bob123 on May 07, 2020, 06:21:33 PM
guys i have Etherium private key was saved in notepad accidently my kids press some alphabet and first 20 digits missing and i have saved it without notic can anyone please help me to recover if its possible

Unfortunately not.
You would have been able to restore a few chars, but definitely not 20.

By the way, if you don't have an offline backup (not stored on your computer), you don't have a backup at all.
Any incident affecting your computer (electrical short, ransomware, .. ) could have lead to a loss of the private key.

Storing a backup on the same device as the wallet is not a backup at all.


Title: Re: Private Key Restorer
Post by: Csmiami on May 07, 2020, 06:43:04 PM
---
Was your private key saved in a file before your kid fucked it up? If that's the case, you may be able to restore an earlier version of said file; and with some luck, it will contain the whole privkey.


Title: Re: Private Key Restorer
Post by: MixMAx123 on May 07, 2020, 07:26:45 PM
I wrote a Java tool that can do that, but 20 characters are impossible in her lifetime.

https://github.com/MrMaxweII/repairPrivKey

https://user-images.githubusercontent.com/34688939/75074392-dc6ee100-54fb-11ea-8273-e5a6f540dee7.png


Title: Re: Private Key Restorer
Post by: j2002ba2 on May 10, 2020, 09:41:29 AM
guys i have Etherium private key was saved in notepad accidently my kids press some alphabet and first 20 digits missing and i have saved it without notic can anyone please help me to recover if its possible

If your key was reused then it's possible to recover it. Then the time complexity is only 240, which is doable in 15 minutes on a V100 GPU.

Reused key means you sent coins from it, and know the public key.
Or if you signed anything and have the signature.


Title: Re: Private Key Restorer
Post by: hijack86 on May 22, 2020, 01:49:15 PM
hi!  :)
How to run this tool ?
What a version of java need install?


Title: Re: Private Key Restorer
Post by: MixMAx123 on May 22, 2020, 03:20:07 PM
It should run with any Java version. https://java.com/de/download/

It is then started with a double click on the .jar file.   https://github.com/MrMaxweII/repairPrivKey/releases/download/V1.3.1/repairPrivKey.jar




Title: Re: Private Key Restorer
Post by: ewaspiro on May 24, 2020, 12:13:51 PM
I need a private key restorer.


guys i have Etherium private key was saved in notepad accidently my kids press some alphabet and first 20 digits missing and i have saved it without notic can anyone please help me to recover if its possible



You could try these guys https://keychainx.io