Author

Topic: how to see my private key bye decrypted wallet.dat (Read 149 times)

member
Activity: 180
Merit: 38
If db_dump does not work you can also try
Code:
hexdump 'wallet.dat' -C > wallet.hex

And then open in notepad and use search and find 'mkey' and 'ckey'
If the wallet is not corrupt it should be in there.
HCP
legendary
Activity: 2086
Merit: 4361
If the scripts like PyWallet or core-decrypt aren't able to read the file... and the db_dump utility doesn't work... then you're probably going to have to try and extract the hex bytes manually using a hexeditor and searching through the wallet.dat for the various markers (ie. mkey and ckey etc).

Honestly, that's going to be a giant P.I.T.A. Undecided It's not impossible... it'll just be a ton of work... and depending on how corrupt the file is and/or how exactly it was corrupted, it might actually be impossible to decrypt the individual keys ie. if the mkey is corrupt, you're basically stuffed Undecided

Unfortunately, as I haven't yet figured out how to get from encrypted mkey -> unencrypted mkey -> unencrypted ckeys etc... I am not going to be able to assist much further at this point in time.

Hopefully someone else with more knowledge of the technical details of decrypting the mkey will be able to assist.
newbie
Activity: 13
Merit: 0
HCP Thank you that was a helpful comment/thread. My issues is that the wallet in question is corrupt and i'm unable to open it i have tried a number of things to fix it but so far no luck, i understand there is 1 master private key and a number of private keys and that is what i'm trying to extract from the wallet.dat file.
If you or other can help me i would be grateful and be willing to send 1 LTC for the time wasted.

Thank you
HCP
legendary
Activity: 2086
Merit: 4361
You'd need to understand how the wallet.dat encryption works then... it's not like the entire wallet is actually encrypted (if it was, you wouldn't even be able to open the wallet.dat in a "Core" application and see the addresses/transaction history etc without entering your passphrase).

Instead, what happens is that it is just the private key data that is stored encrypted. As per the info here: https://en.bitcoin.it/wiki/Wallet_encryption
Wallet encryption uses AES-256-CBC to encrypt only the private keys that are held in a wallet. The keys are encrypted with a master key which is entirely random. This master key is then encrypted with AES-256-CBC with a key derived from the passphrase using SHA-512 and OpenSSL's EVP_BytesToKey and a dynamic number of rounds determined by the speed of the machine which does the initial encryption (and is updated based on the speed of a computer which does a subsequent passphrase change).

So, the encrypted private key and your passphrase alone are not enough to decrypt the private key... you actually have to decrypt the "master" key first... then use that master key to decrypt your individual private keys.

There has been some discussion about this on another thread: https://bitcointalksearch.org/topic/m.56938441

I've been able to get as far as extracting the encrypted master key and getting the IV, Salt, iteration count etc... but I'm not sure about how to actually decrypt the master key and then decrypt the individual private keys at this point.
newbie
Activity: 13
Merit: 0
i already tried salvagewallet, and also PyWallet to try and recover wallet but no luck, its not litecoin by the way its another altcoin. i know the Private key is in inside the wallet.dat file if i can decrypted the wallet.dat i should be able to fix it but i dont know how decrypted it.
HCP
legendary
Activity: 2086
Merit: 4361
cant load my wallet which is why i'm trying to get the private key this way, the wallet is corrupted.  i have the public address that the coins been sent and about the ''malware on that computer, you'll probably lose your money'' i'll be doing it off line so i should be good but thank you for the heads up
Have you tried the salvage feature of the "wallet-tool" that comes with newer versions of Bitcoin Core? Not sure if this is actually available in Litecoin Core as yet. In which case you'd need to use the -salvagewallet option when starting Litecoin Core and see if that helps.

Alternatively, you can use PyWallet to try and recover data from Litecoin wallet.dat's... you just need to use the --otherversion argument and provide the appropriate version... which for litecoin would be 48.


As always, only work with copies of the wallet file!
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
Going offline on a computer which may have malware is not safe enough because what if it collects the keys while you're offline and then transmits them the next time you go online?

If you use Windows, just ignore the warning. Or install Virtual box https://www.virtualbox.org/ and then any Linux from image (https://www.linuxlookup.com/linux_iso) and Linux version of litecoin wallet https://litecoin.org/#download

Considering that the private keys eventually must go out of the virtual machine to the host this isn't safe either. Safest option is to burn a Linux Live ISO onto a DVD or a USB and boot from that, installing bitcoin core and pywallet and other stuff you may need there (to a hard disk of course, because the root filesystem on a Live ISO is read-only).
legendary
Activity: 952
Merit: 1385
cant load my wallet which is why i'm trying to get the private key this way, the wallet is corrupted.  i have the public address that the coins been sent and about the ''malware on that computer, you'll probably lose your money'' i'll be doing it off line so i should be good but thank you for the heads up


If you use Windows, just ignore the warning. Or install Virtual box https://www.virtualbox.org/ and then any Linux from image (https://www.linuxlookup.com/linux_iso) and Linux version of litecoin wallet https://litecoin.org/#download
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
Follow @NeuroticFish, but replace bitcoin-qt with Litecoin Core since you mentioned 1 LTC (not 1 BTC).
newbie
Activity: 13
Merit: 0
cant load my wallet which is why i'm trying to get the private key this way, the wallet is corrupted.  i have the public address that the coins been sent and about the ''malware on that computer, you'll probably lose your money'' i'll be doing it off line so i should be good but thank you for the heads up
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
How to decrypted my wallet.dat (Yes, I know the password) so i can see my private key? if anyone can help there is 1 LTC for them

wallet.dat contains a lot of addresses and their private keys.

If you also know the address for which you want the private key, then it's simple:

1. Go to Bitcoin-qt -> help -> about bitcoin -> console tab
2.
Code:
walletpassphrase "your password" 600
dumpprivkey "your address"

I'll add that if you do this and you have malware on that computer, you'll probably lose your money.
newbie
Activity: 13
Merit: 0
How to decrypted my wallet.dat (Yes, I know the password) so i can see my private key? if anyone can help there is 1 LTC for them
Jump to: