Bitcoin Forum
June 17, 2024, 12:50:52 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Bitcoin Core won't take my passphrase  (Read 4130 times)
CDNinATL (OP)
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile
September 21, 2014, 02:09:23 AM
 #1

So about 6 months ago I decided to encrypt my BTC wallet (good thing). Set the password and all that. Since then I upgraded from 0.9.0 core to the latest 9.2.1. Now my wallet won't accept my passphrase. I wasn't exactly sure on password so I extracted the hash from the wallet and ran John the Ripper in a Debian VM and verified the passphrase. The wallet itself is on my Windows 2012 server (not sure if that's relevant or not). Every time I try to reset the passphrase or send my coin to my Armory wallet (either will do), it just keeps telling me that the passprase is incorrect.

So far I've ran -upgradewallet, -rescan and -salvagewallet switches on it but none of them are letting me access my coin.

I guess next up will be the fixwallet.py inside of my linux vm and see if that makes any difference but I've never used it before. Any other suggestions would be awesome!!

Foxpup
Legendary
*
Offline Offline

Activity: 4396
Merit: 3062


Vile Vixen and Miss Bitcointalk 2021-2023


View Profile
September 21, 2014, 08:20:24 AM
 #2

I extracted the hash from the wallet
Huh There is no hashed password stored in the wallet to extract. What exactly did you do?

Will pretend to do unspeakable things (while actually eating a taco) for bitcoins: 1K6d1EviQKX3SVKjPYmJGyWBb1avbmCFM4
I am not on the scammers' paradise known as Telegram! Do not believe anyone claiming to be me off-forum without a signed message from the above address! Accept no excuses and make no exceptions!
CDNinATL (OP)
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile
September 21, 2014, 11:22:42 AM
 #3

I extracted the hash from the wallet
Huh There is no hashed password stored in the wallet to extract. What exactly did you do?
I ran bitcoin2john.py command that came with John the Ripper.
Newar
Legendary
*
Offline Offline

Activity: 1358
Merit: 1001


https://gliph.me/hUF


View Profile
September 21, 2014, 12:20:28 PM
 #4

Can you install 0.9.0 on another system again and see if it works?

OTC rating | GPG keyid 1DC91318EE785FDE | Gliph: lightning bicycle tree music | Mycelium, a swift & secure Bitcoin client for Android | LocalBitcoins
CDNinATL (OP)
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile
September 21, 2014, 03:51:20 PM
 #5

Can you install 0.9.0 on another system again and see if it works?
I can. I'll give it a go on my main computer.
btchris
Hero Member
*****
Offline Offline

Activity: 672
Merit: 504

a.k.a. gurnec on GitHub


View Profile WWW
September 21, 2014, 06:39:28 PM
 #6

I extracted the hash from the wallet
Huh There is no hashed password stored in the wallet to extract. What exactly did you do?
I ran bitcoin2john.py command that came with John the Ripper.

This means that JtR was able to decrypt the mkey (and verify that the padding bytes were correct, which makes it extremely likely that the password was correct). JtR doesn't try to actually decrypt any private keys to check them against the stored public keys.

If the first private key, or its associated public key, is corrupted, this will happen (although that seems unlikely to me...). If this is the case, `pywallet.py --recover` can help.

CDNinATL, can you let us know how this turns out? I'm personally interested...

Also, does your password contain any non-ASCII characters (any characters not list here: https://en.wikipedia.org/wiki/ASCII#ASCII_printable_code_chart)?
CDNinATL (OP)
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile
September 21, 2014, 07:30:25 PM
 #7

I extracted the hash from the wallet
Huh There is no hashed password stored in the wallet to extract. What exactly did you do?
I ran bitcoin2john.py command that came with John the Ripper.

This means that JtR was able to decrypt the mkey (and verify that the padding bytes were correct, which makes it extremely likely that the password was correct). JtR doesn't try to actually decrypt any private keys to check them against the stored public keys.

If the first private key, or its associated public key, is corrupted, this will happen (although that seems unlikely to me...). If this is the case, `pywallet.py --recover` can help.

CDNinATL, can you let us know how this turns out? I'm personally interested...

Also, does your password contain any non-ASCII characters (any characters not list here: https://en.wikipedia.org/wiki/ASCII#ASCII_printable_code_chart)?
No. Capital and lower case letters, numbers and the tilde key. I wasn't sure if the tilde was the issue but I was able to encrypt a blank wallet and then successfully change the password.

I'll try the pywallet thing later. Right now I'm up against washing machine and a bearing that doesn't want to be replaced!
CDNinATL (OP)
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile
September 22, 2014, 09:26:51 PM
 #8

So I'm looking at the command pywallet.py --recover and it looks like it requires a size option be set. How do you what number to put in there? The rest of the command, seems easy enough.
btchris
Hero Member
*****
Offline Offline

Activity: 672
Merit: 504

a.k.a. gurnec on GitHub


View Profile WWW
September 22, 2014, 10:27:56 PM
 #9

So I'm looking at the command pywallet.py --recover and it looks like it requires a size option be set. How do you what number to put in there? The rest of the command, seems easy enough.

The size option is there mostly for hard drive scans. For a wallet, just choose a size that's larger than the wallet size.

You need to append a (strange) unit to the end of the size, so for example --recov_size=100Mo means 100 megaoctets.

(Be sure to take a backup of the wallet file before running pywallet on it, just in case)
CDNinATL (OP)
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile
September 23, 2014, 02:10:12 AM
 #10

This is what I'm getting:

Quote
terry@CrackIt-WS:~$ sudo python pywallet.py --recover --recov_device /home/terry/wallet.dat --recov_size 2Mio --recov_outputdir /home/terry/fxd
Enter the passphrase for the wallet that will contain all the recovered keys: **********

Enter the possible passphrases used in your deleted wallets.
Don't forget that more passphrases = more time to test the possibilities.
Write one passphrase per line and end with an empty line.
Possible passphrase: **********
Possible passphrase:

Starting recovery.

Read 0.0 Go in 0.0 minutes

Found 1 possible wallets
Found 234 possible encrypted keys
Found 0 possible unencrypted keys

Possible wallet #1
    with passphrase #1 

Private keys not decrypted: 234
Trying all the remaining possibilities (234) might take up to 0 minutes.
Do you want to test them? (y/n): y

Private keys not decrypted: 234
Try another password, check the size of your partition or seek help
The wallet is encrypted and the passphrase is correct


Importing:


The new wallet /home/terry/fxd/recovered_wallet_1411437903.dat contains the 0 recovered key
To me it seems like it's accepting the password but the private keys won't take them. Or am I reading this wrong??
btchris
Hero Member
*****
Offline Offline

Activity: 672
Merit: 504

a.k.a. gurnec on GitHub


View Profile WWW
September 23, 2014, 01:39:35 PM
 #11

This is mysterious....

First, a little background (if you're interested, if not just skip to the questions):

Bitcoin Core makes two checks when validating your password.

A. Run the password through a key derivation function (PBKDF1-SHA512) to generate a derived_key.
B. Use the derived_key to decrypt (with AES256) the 48-byte long encrypted_mkey (from the wallet) into a decrypted_mkey.
C. Check (1): make sure the decrypted_mkey is exactly 32 bytes long plus 16 valid padding bytes at the end.
D. Use the decrypted_mkey to decrypt a single (arbitrary) encrypted_privkey (from the wallet) into a decrypted_privkey.
E. Mathematically derive from the decrypted_privkey a derived_pubkey.
F. Check (2): make sure the derived_pubkey is equal to the pubkey stored in the wallet file.

JtR doesn't bother with check (2) in the interest of speed. This should be OK, because the likelihood that check (1) passes, but check (2) fails should be extremely small (something like 1 in 2^128).

pywallet doesn't bother with check (1) (in other words, it always "accepts" the password at first), it simply truncates the decrypted_mkey to 32 bytes in length and ignores any padding (even when the padding is invalid). It only uses check(2) (running that check against every encrypted_privkey if you answer "y" to that question it asked).

If JtR thinks you have the right password, but pywallet and Bitcoin Core disagree... than I'm not sure what's going on.

So... questions...

Could you try btcrecover (another Python script)? (use "--passwordlist --wallet wallet.dat" for its options.) It should use the same single check as JtR.

Where did you get your JtR? If you compiled it from source, how recent is it (there were some recent Bitcoin-related updates to JtR)?

Do you have any wallet.dat backups (even if they're encrypted)?
CDNinATL (OP)
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile
September 23, 2014, 03:09:38 PM
 #12

I'll give that python command a go at lunch time.

This was the command I used in Debian to get JtR:
git clone -b bleeding-jumbo git://github.com/magnumripper/JohnTheRipper JohnTheRipper

I have multiple copies of the wallet.dat. All are recent as I didn't want to mess with the original file other attempting to unlock it. What I don't have is an older version sitting around (wish I did).

Newar
Legendary
*
Offline Offline

Activity: 1358
Merit: 1001


https://gliph.me/hUF


View Profile
September 23, 2014, 03:11:37 PM
 #13

I guess 0.9.0 didn't work either.

Can you dump your wallet with pywallet?

OTC rating | GPG keyid 1DC91318EE785FDE | Gliph: lightning bicycle tree music | Mycelium, a swift & secure Bitcoin client for Android | LocalBitcoins
CDNinATL (OP)
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile
September 23, 2014, 03:20:07 PM
 #14

I guess 0.9.0 didn't work either.

Can you dump your wallet with pywallet?
I still need to try that. I did do it but it may not be a proper test as the machine I put it on had it at one point. I do have a clean laptop I can put it but I haven't had a chance yet.

As for pywallet --dump, I can also try that a bit later.

CDNinATL (OP)
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile
September 24, 2014, 12:09:42 AM
 #15

Ok...so I wasn't reading the output of JtR correctly. I purposely added a dummy password to the script I used to come up with the wordlist and that's when I realized I come close enough. So I'm back to that stage on trying to remember what I based my password on...grrrrrr
btchris
Hero Member
*****
Offline Offline

Activity: 672
Merit: 504

a.k.a. gurnec on GitHub


View Profile WWW
September 24, 2014, 12:30:13 AM
 #16

Ok...so I wasn't reading the output of JtR correctly. I purposely added a dummy password to the script I used to come up with the wordlist and that's when I realized I come close enough. So I'm back to that stage on trying to remember what I based my password on...grrrrrr

Well, although I'm kinda happy (sorry) that something weird and mysterious isn't going on, I'm unhappy that this could make things more difficult for you...

On the (small) plus side, you already have JtR compiled, so if you'd like to use it to search for your password, it's a great option.

btcrecover is faster if you have a discrete video card, in terms of guesses per second (and JtR is faster if you don't have one). I also think that btcrecover is the easier option if you already have a good idea of what your password is, but I'm just a teensy bit biased (I'm the author of btcrecover)....

If you do choose to try btcrecover, the tutorial and quick start is here: https://github.com/gurnec/btcrecover/blob/master/TUTORIAL.md#btcrecover-tutorial

Let me know if you have any questions.
2112
Legendary
*
Offline Offline

Activity: 2128
Merit: 1068



View Profile
September 24, 2014, 03:13:56 AM
 #17

Windows 2012 server
the tilde key
You have a classic setup to get bitten by http://en.wikipedia.org/wiki/Dead_key issue. This is especially easy on Windows which keeps the keyboard layout state per thread/window. So many people are unaware that when the new window pops up the keyboard layout may have been temporarily changed for the duration of this new window being open. In all cases like this that I've personally assisted it was always caused by careless change in keyboard layout, keyboard driver, physical keyboard or the way the key presses are transmitted through the various "remote desktop" tools.

Like, are you positive that nobody in your household had recently started learning e.g. Spanish or stopped learning German?

Please comment, critique, criticize or ridicule BIP 2112: https://bitcointalk.org/index.php?topic=54382.0
Long-term mining prognosis: https://bitcointalk.org/index.php?topic=91101.0
ForgottenPassword
Full Member
***
Offline Offline

Activity: 154
Merit: 100


View Profile
September 24, 2014, 11:47:30 PM
 #18

It's possible that your keyboard layout has changed from US to UK or US international. Try using one of these instead of the tilda:

`
¬
#
"
'

I have private messages disabled. Send me an email instead. My contact details can be found here.

Tip Address: 13Lwo1hK5smoBpFWxmqeKSL52EvN8U7asX
sbrzol
Hero Member
*****
Offline Offline

Activity: 569
Merit: 500


View Profile
October 21, 2014, 09:14:29 AM
 #19

I have the same problem, is there any solution ?

Here are my two posts with my issue

First time i thought the problem is connected to Armory , but now i do not know
https://bitcointalk.org/index.php?topic=56424.msg9263763#msg9263763


https://bitcointalk.org/index.php?topic=34028.msg9271649#msg9271649    Re: Pywallet 2.2: manage your wallet [Update required]
btchris
Hero Member
*****
Offline Offline

Activity: 672
Merit: 504

a.k.a. gurnec on GitHub


View Profile WWW
October 21, 2014, 04:57:04 PM
 #20

I have the same problem, is there any solution ?

Here are my two posts with my issue

First time i thought the problem is connected to Armory , but now i do not know
https://bitcointalk.org/index.php?topic=56424.msg9263763#msg9263763


https://bitcointalk.org/index.php?topic=34028.msg9271649#msg9271649    Re: Pywallet 2.2: manage your wallet [Update required]

Responded to you in the pywallet thread over here.
Pages: [1] 2 »  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!