<p>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.</p>

<p><a href="https://superuser.com/questions/1245384/openssl-bad-decrypt-between-0-9-8o-and-1-1-0f">https://superuser.com/questions/1245384/openssl-bad-decrypt-between-0-9-8o-and-1-1-0f</a></p>

<p>For example, originally without that MD5 option I was seeing:</p>

<pre><code>$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:
</code></pre>

<p>But then with the MD5 option:</p>

<pre><code>$openssl enc -d -aes-256-cbc -a -in bitcoin-wallet-backup-2017-09-28 -out decrypted -md md5
enter aes-256-cbc decryption password: ******
</code></pre>

<p>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.</p>

CC BY-SA 3.0
2017-12-04T15:55:46.667Z
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
CC BY-SA 4.0
2021-01-27T10:29:02.413Z
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
CC BY-SA 3.0
2017-09-29T00:17:12.933Z
2017-09-29T00:22:26.590Z
2017-09-29T00:22:26.590Z
mbp146520
<p>This script seems to do the work</p>

<p><a href="https://github.com/jleni/wallet-decrypt" rel="nofollow noreferrer">https://github.com/jleni/wallet-decrypt</a></p>

<p>You just need to create a backup and it will give you back a mnemonic that you can use in electrum or electrum cash.</p>

CC BY-SA 3.0
2017-09-27T15:40:21.550Z
2017-09-27T15:40:21.550Z
Juan Leni
<p>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:</p>

<p><a href="https://bitcointalk.org/index.php?topic=2061691.0" rel="nofollow noreferrer">https://bitcointalk.org/index.php?topic=2061691.0</a></p>

CC BY-SA 3.0
2017-11-21T07:18:16.247Z
2017-11-21T08:22:37.010Z
2017-11-21T08:22:37.010Z
Juancho
<p>I go a bit fancier:</p>

<pre><code>set /p xin=
set xout="%xin%.txt"
openssl enc -d -aes-256-cbc -a -in "%XIN%" -out %XOUT% 
</code></pre>

<p>But basically you want to name a file for the output and also the -k flag allows <strong>PASSWORD</strong> directly to be entered, like so:</p>

<p>openssl enc -d -aes-256-cbc -a -in "<strong>INFILE</strong>" -out "<strong>OUTFILE</strong>.txt" -k <strong>PASSWORD</strong> , </p>

<p>where <strong>CAPS</strong> is the variable. Save above 3 lines or single openssl cmd into a *.bat (WinBatch file)</p>

CC BY-SA 3.0
2015-07-22T08:48:55.507Z
@SekeratKejunG See [this gist](https://gist.github.com/anonymous/f88486d1d2a6616d5328). 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
Wizard Of Ozzie
CC BY-SA 3.0
2014-04-19T11:01:46.277Z
2014-04-19T11:01:46.277Z
Wizard Of Ozzie
<p>from: <a href="https://github.com/schildbach/bitcoin-wallet/tree/master/wallet">https://github.com/schildbach/bitcoin-wallet/tree/master/wallet</a></p>

<pre><code>The backup file is encrypted using your chosen password. You can use OpenSSL to decrypt:

openssl enc -d -aes-256-cbc -a -in &lt;filename&gt;
</code></pre>

CC BY-SA 3.0
2017-07-02T18:26:40.947Z
The instructions have been moved to: https://github.com/bitcoin-wallet/bitcoin-wallet/blob/master/wallet/README.recover.md
Justin D. Harris
CC BY-SA 3.0
2013-11-24T00:52:55.067Z
2013-11-24T00:52:55.067Z
Theodore Robert Campbell Jr
<p>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.</p>

<p>How do I decrypt the file so I can import the key to my Bitcoin Qt?</p>

CC BY-SA 3.0
2014-07-16T23:10:21.623Z
possible duplicate of [Is there a known way to export my wallet private key from the "Bitcoin Android" app (com.bitcoinandroid)?](http://bitcoin.stackexchange.com/questions/3247/is-there-a-known-way-to-export-my-wallet-private-key-from-the-bitcoin-android)
Nate Eldredge
<wallet><bitcoin-core><bitcoin-wallet-app>
How to decode private key from Android Bitcoin Wallet?
pmichna
# How to decode private key from Android Bitcoin Wallet?

(Asked by: username_0 on 2013-11-23)

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?

**Tags:** wallet, bitcoin-core, bitcoin-wallet-app

> **Comments:**
> **username_1**: possible duplicate of [Is there a known way to export my wallet private key from the "Bitcoin Android" app (com.bitcoinandroid)?](http://bitcoin.stackexchange.com/questions/3247/is-there-a-known-way-to-export-my-wallet-private-key-from-the-bitcoin-android)  

---

## 5 answers

### Answer by username_8 on 2013-11-24. Score: 24 | Accepted answer

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

> **Comments:**
> **username_9**: The instructions have been moved to: https://github.com/bitcoin-wallet/bitcoin-wallet/blob/master/wallet/README.recover.md  

---

### Answer by username_2 on 2017-09-29. Score: 5

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.

> **Comments:**
> **username_3**: 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  
> **username_4**: 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!  

---

### Answer by username_5 on 2017-09-27. Score: 1

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.


---

### Answer by username_6 on 2017-11-21. Score: 0

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:

<https://bitcointalk.org/index.php?topic=2061691.0>


---

### Answer by username_7 on 2014-04-19. Score: -1

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)

> **Comments:**
> **username_7**: @SekeratKejunG See [this gist](https://gist.github.com/anonymous/f88486d1d2a6616d5328). 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  

---

