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?


5 Answers 5


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.


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.

  • In this case simply use the openssl-1.0 bindings which enforces the old encoding that changed when using recent version 2 binaries: openssl-1.0 enc -d -aes-256-cbc -a -in bitcoin-wallet-backup-2017-09-28
    – mschmoock
    Commented Dec 4, 2017 at 15:55
  • I got a warning *** WARNING : deprecated key derivation used. Using -iter or -pbkdf2 would be better. but the decryption of the secret keys worked fine, though!
    – Leder
    Commented Jan 27, 2021 at 10:29

This script seems to do the work


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)

  • Im not understand about " save above 3 lines or . . . . " because my result outfile.txt words cannot read . Excample " ãíâVÏ7@ãíâVÏ7@ " Thank you .
    – user27565
    Commented Jul 22, 2015 at 5:10
  • @SekeratKejunG See this gist. The 3 lines are a batch file. You can just skip straight to 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 Commented Jul 22, 2015 at 8:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.