Bitcoin Forum
May 17, 2024, 12:41:03 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 [4]  All
  Print  
Author Topic: Private Key lost one character  (Read 6359 times)
JBRai
Newbie
*
Offline Offline

Activity: 26
Merit: 3


View Profile
May 19, 2020, 10:18:35 PM
 #61

under corrupted_wif put my private with the missing character and left "should be" empty like ' '
the file is on my desktop under folder called BTC1
Ok... then your "terminal" needs to be in the 'BTC1' directory, when you run the python command, otherwise it won't be able to find the script Wink

On MacOSX, the path to your desktop folder BTC should be something like:
Code:
/Users/YOURUSERNAME/Desktop/BTC1

so if you use the command:
Code:
cd /Users/YOURUSERNAME/Desktop/BTC1

You should see the command prompt change and show you the BTC1 folder... then if you try to run the script again with:
Code:
python corrupt_wif.py

For this code as i have left #should be ' ' blank should i addin my corrupt key with a random letter at the end to add it up to 52 characters?
# Provide a WIF private key with a single missing character.
# Wrong Char             
corrupted_wif = 'KykLRngWxXA8RkznbcQ5UzJbD2QfABiR9E6yVGvigHo2WrwBeGm'
#  Should be:   ''
#  Missing Char                           
for candidate_wif in candidate_wifs(corrupted_wif):
    print(candidate_wif)

It should work.

BTC Address: 35W3H2vRnh8R7QqZYBkE4YWYci8B3Lwqo3
JBRai
Newbie
*
Offline Offline

Activity: 26
Merit: 3


View Profile
May 19, 2020, 10:20:45 PM
 #62

Hi All

I was wanting to know if anyone could provide me a search command as i am missing 4 characters from my private key base 58.  From the search command how would you know if the private key is valid or not?

My private key starts with K i have 48/49 characters i just require a search command so my friend can complete this for me?

please let me know thanks

You should get the private key with crunch...

Code:
crunch 52 52 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz -t L4rK1yDtCWekvXuE6oXD9jCYfFNV2cWRpVuPLBcCU2z8Tris@@@@ -o bf.txt

But there are two things to consider...

1.-If you have 48 chars or 49... then you add 4 or 3 @ at the end of the command.

2.-If the 4 missing characters are at the end of the string or whats the position of the missing chars because if they are random the chance to recover it is really small.

how do i use Crunch do i have copy the code in txt file and run it in terminal on mac ? i am using a mac book pro


BTC Address: 35W3H2vRnh8R7QqZYBkE4YWYci8B3Lwqo3
JBRai
Newbie
*
Offline Offline

Activity: 26
Merit: 3


View Profile
May 21, 2020, 10:09:06 AM
 #63

Hi All

I was wanting to know if anyone could provide me a search command as i am missing 4 characters from my private key base 58.  From the search command how would you know if the private key is valid or not?

My private key starts with K i have 48/49 characters i just require a search command so my friend can complete this for me?

please let me know thanks

You should get the private key with crunch...

Code:
crunch 52 52 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz -t L4rK1yDtCWekvXuE6oXD9jCYfFNV2cWRpVuPLBcCU2z8Tris@@@@ -o bf.txt

But there are two things to consider...

1.-If you have 48 chars or 49... then you add 4 or 3 @ at the end of the command.

2.-If the 4 missing characters are at the end of the string or whats the position of the missing chars because if they are random the chance to recover it is really small.

Thanks it has worked, but the address is not getting accepted into blockchain it say invalid address Private key address? please help

BTC Address: 35W3H2vRnh8R7QqZYBkE4YWYci8B3Lwqo3
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
May 22, 2020, 12:41:28 AM
 #64

For this code as i have left #should be ' ' blank should i addin my corrupt key with a random letter at the end to add it up to 52 characters?
# Provide a WIF private key with a single missing character.
# Wrong Char              
corrupted_wif = 'KykLRngWxXA8RkznbcQ5UzJbD2QfABiR9E6yVGvigHo2WrwBeGm'
#  Should be:   ''
#  Missing Char                           
for candidate_wif in candidate_wifs(corrupted_wif):
    print(candidate_wif)

You only need to put your "corrupted WIF" in on the line that says: corrupted_wif = '.................'

The "#should be" line is just a comment in the code, it will not be executed so can be left blank. As long as you have the line:

Code:
corrupted_wif = '<WIF_MISSING_ONE_CHAR_GOES_HERE>'

Filled out correctly, then it should work OK!

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
math09183
Member
**
Offline Offline

Activity: 170
Merit: 58


View Profile
May 22, 2020, 08:20:24 AM
 #65


I was wanting to know if anyone could provide me a search command as i am missing 4 characters from my private key base 58.  From the search command how would you know if the private key is valid or not?

My private key starts with K i have 48/49 characters i just require a search command so my friend can complete this for me?

please let me know thanks

Thanks it has worked, but the address is not getting accepted into blockchain it say invalid address Private key address? please help

Do you know finally what is the exact situation?
If you are sure that you miss characters at the end and even you know the expected BTC address, it is very easy to find.
pooya87
Legendary
*
Offline Offline

Activity: 3458
Merit: 10563



View Profile
May 22, 2020, 09:36:38 AM
 #66

I have created a simple application to restore WIF if lost characters are at the end:
https://github.com/Mathematician09183/WifFinder

if i understood your Java code correctly you are looping through all chars and that's a lot of unnecessary code. if the missing character is at the end then that character is the checksum which is recoverable in a couple of very simple steps:
- replace the missing char with anything from the charset (like 1)
- decode the result using Base58 encoding (not Base58check which is usually the method used to check and remove checksum)
- remove the last 4 bytes
- now encode this result with Base58check
you have the key!

this works for 1 to 4 or probably up to 6 missing characters at the end.

ps. i don't think @JBRai problem is with 1 char or even that char being at the end.

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

Activity: 170
Merit: 58


View Profile
May 22, 2020, 09:40:47 AM
 #67

I have created a simple application to restore WIF if lost characters are at the end:
https://github.com/Mathematician09183/WifFinder

if i understood your Java code correctly you are looping through all chars and that's a lot of unnecessary code. if the missing character is at the end then that character is the checksum which is recoverable in a couple of very simple steps:
- replace the missing char with anything from the charset (like 1)
- decode the result using Base58 encoding (not Base58check which is usually the method used to check and remove checksum)
- remove the last 4 bytes
- now encode this result with Base58check
you have the key!

this works for 1 to 4 or probably up to 6 missing characters at the end.

ps. i don't think @JBRai problem is with 1 char or even that char being at the end.

Yes, of course. In fact it was the fastest to do, just in few minutes. I rely on bitcoinj code to verify signature and load/reject key.
If character is lost in the middle, then of course it becomes much more interesting, but for 1-2 characters still doable in the reasonable time.
JBRai
Newbie
*
Offline Offline

Activity: 26
Merit: 3


View Profile
May 22, 2020, 10:12:05 PM
 #68


I was wanting to know if anyone could provide me a search command as i am missing 4 characters from my private key base 58.  From the search command how would you know if the private key is valid or not?

My private key starts with K i have 48/49 characters i just require a search command so my friend can complete this for me?

please let me know thanks

Thanks it has worked, but the address is not getting accepted into blockchain it say invalid address Private key address? please help

Do you know finally what is the exact situation?
If you are sure that you miss characters at the end and even you know the expected BTC address, it is very easy to find.


I do not even know the btc address for both private keys this is how long ago it is.  Also i have another address which 54 characters long i need a script which will fix it.

BTC Address: 35W3H2vRnh8R7QqZYBkE4YWYci8B3Lwqo3
math09183
Member
**
Offline Offline

Activity: 170
Merit: 58


View Profile
May 22, 2020, 10:16:35 PM
 #69


I do not even know the btc address for both private keys this is how long ago it is.  Also i have another address which 54 characters long i need a script which will fix it.


If it is 54, I would remove characters from the end and try to restore correct WIF.
For other WIFs - it is difficult because you do not know what you look for. It is not a problem to generate WIF - the point it to find your address.
JBRai
Newbie
*
Offline Offline

Activity: 26
Merit: 3


View Profile
May 22, 2020, 10:56:41 PM
 #70


I do not even know the btc address for both private keys this is how long ago it is.  Also i have another address which 54 characters long i need a script which will fix it.


If it is 54, I would remove characters from the end and try to restore correct WIF.
For other WIFs - it is difficult because you do not know what you look for. It is not a problem to generate WIF - the point it to find your address.

How would you restore correct WIF with 54 characters?   how would i sort out the original privkey?

BTC Address: 35W3H2vRnh8R7QqZYBkE4YWYci8B3Lwqo3
Pages: « 1 2 3 [4]  All
  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!