I want to import my private key from the android's Bitcoin Wallet (the one created by Andreas Schildbach) but it can export it only in an encrypted way.
How do I decrypt the file so I can import the key to my Bitcoin Qt?
Bitcoin Stack Exchange is a question and answer site for Bitcoin users, developers, and enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI want to import my private key from the android's Bitcoin Wallet (the one created by Andreas Schildbach) but it can export it only in an encrypted way.
How do I decrypt the file so I can import the key to my Bitcoin Qt?
from: https://github.com/schildbach/bitcoin-wallet/tree/master/wallet
The backup file is encrypted using your chosen password. You can use OpenSSL to decrypt:
openssl enc -d -aes-256-cbc -a -in <filename>
If anyone is trying this in 2017, openssl has now defaulted to use SHA256 instead of the MD5 assumed in the older answers. Add "-md md5" (no quotes) to your openssl command line string.
https://superuser.com/questions/1245384/openssl-bad-decrypt-between-0-9-8o-and-1-1-0f
For example, originally without that MD5 option I was seeing:
$openssl enc -d -aes-256-cbc -a -in bitcoin-wallet-backup-2017-09-28 -out decrypted
enter aes-256-cbc decryption password: ******
bad decrypt
140031244338432:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:../crypto/evp/evp_enc.c:535:
But then with the MD5 option:
$openssl enc -d -aes-256-cbc -a -in bitcoin-wallet-backup-2017-09-28 -out decrypted -md md5
enter aes-256-cbc decryption password: ******
It runs successfully and creates a file called "decrypted" which is mostly binary data but starts with ^Vorg.bitcoin.production^R and contains your 12 word mnemonic as text near the top of the file.
*** WARNING : deprecated key derivation used. Using -iter or -pbkdf2 would be better.
but the decryption of the secret keys worked fine, though!
This script seems to do the work
https://github.com/jleni/wallet-decrypt
You just need to create a backup and it will give you back a mnemonic that you can use in electrum or electrum cash.
This guide was the only one that worked for me. The mnemonic phrase didn't work on Electrum nor Electron Cash, but the exported private key as described here did:
I go a bit fancier:
set /p xin=
set xout="%xin%.txt"
openssl enc -d -aes-256-cbc -a -in "%XIN%" -out %XOUT%
But basically you want to name a file for the output and also the -k flag allows PASSWORD directly to be entered, like so:
openssl enc -d -aes-256-cbc -a -in "INFILE" -out "OUTFILE.txt" -k PASSWORD ,
where CAPS is the variable. Save above 3 lines or single openssl cmd into a *.bat (WinBatch file)
âVÏ7@ãí
âVÏ7@ " Thank you .
openssl enc -d -aes-256-cbc -a -in "encrypted" -out "decrypted.txt"
. encrypted
is the base64 AES encrypted text file, decrypted.txt
will be a Litecoin wallet in text. If the files in the gist decrypt but your wallet isn't decrypting, then something else is wrong
Jul 22, 2015 at 8:48