<p>The best way to restore a backup file is always to use the same app used for creating the backup. In other words, install the app again, then use Options > Safety > Restore wallet.</p>

CC BY-SA 3.0
2017-01-03T20:54:36.830Z
2017-01-03T20:54:36.830Z
Andreas
<p>Bitcoin Wallet for Android allows you to back up your wallet.  It asks for a password when doing so.</p>

<p>After much faffing, I finally managed to.. dum, dum, dum! .. copy the file to the SD card, and then I removed the SD card and mounted on a Linux system.</p>

<p>According to <a href="https://bitcoin.stackexchange.com/questions/17176/how-to-decode-private-key-from-android-bitcoin-wallet">this question</a>, the way to decrypt it is </p>

<pre><code>$ openssl enc -d -aes-256-cbc -a -in bitcoin-wallet-backup-2016-09-30
</code></pre>

<p>but I get:</p>

<pre><code>enter aes-256-cbc decryption password:
error reading input file
</code></pre>

<p>when doing so.  This is an extremely poor error message from openssl.  I have confirmed that the file is readable using other utilities.</p>

CC BY-SA 3.0
2016-10-16T23:18:51.493Z
That certainly is a poor error message from openssl.  One way to find out what is really going on is to use `strace`.  Try `strace openssl <args>` and look for a line that starts `open("bitcoin-wallet-backup-...", ...)`.  You might see the OS error code at the end of the line.
Nate Eldredge
CC BY-SA 3.0
2016-10-18T11:27:02.117Z
`open("s/bitcoin-wallet-backup-2016-09-30", O_RDONLY) = 3`. I believe 3 is the fd.  Then it reads it a few times, fine `read(3, "\0\0\0\0\0\ [...] = 4096` etc.  This is not an IO problem at this level with the input file.
projix
CC BY-SA 3.0
2016-10-18T12:08:21.903Z
Huh.  So it may be down to reading and/or single-stepping the openssl source.  One question though, the answer you cited is several years old.  Have you checked the Bitcoin Wallet documentation to see if this is still the way the backups are encrypted?
Nate Eldredge
CC BY-SA 3.0
2017-01-03T20:52:46.207Z
Backup encryption did not change. The underlying cleartext format however did, from base58-encoded private keys (text-based) to a protobuf wallet file (binary).
Andreas
<backup><bitcoin-wallet-app><wallet-recovery>
How to restore from backup of Android Bitcoin Wallet
projix
# How to restore from backup of Android Bitcoin Wallet

(Asked by: username_0 on 2016-10-16)

Bitcoin Wallet for Android allows you to back up your wallet. It asks for a password when doing so.

After much faffing, I finally managed to.. dum, dum, dum! .. copy the file to the SD card, and then I removed the SD card and mounted on a Linux system.

According to [this question](https://bitcoin.stackexchange.com/questions/17176/how-to-decode-private-key-from-android-bitcoin-wallet), the way to decrypt it is

```
$ openssl enc -d -aes-256-cbc -a -in bitcoin-wallet-backup-2016-09-30

```

but I get:

```
enter aes-256-cbc decryption password:
error reading input file

```

when doing so. This is an extremely poor error message from openssl. I have confirmed that the file is readable using other utilities.

**Tags:** backup, bitcoin-wallet-app, wallet-recovery

> **Comments:**
> **username_1**: That certainly is a poor error message from openssl.  One way to find out what is really going on is to use `strace`.  Try `strace openssl <args>` and look for a line that starts `open("bitcoin-wallet-backup-...", ...)`.  You might see the OS error code at the end of the line.  
> **username_0**: `open("s/bitcoin-wallet-backup-2016-09-30", O_RDONLY) = 3`. I believe 3 is the fd.  Then it reads it a few times, fine `read(3, "\0\0\0\0\0\ [...] = 4096` etc.  This is not an IO problem at this level with the input file.  
> **username_1**: Huh.  So it may be down to reading and/or single-stepping the openssl source.  One question though, the answer you cited is several years old.  Have you checked the Bitcoin Wallet documentation to see if this is still the way the backups are encrypted?  
> **username_2**: Backup encryption did not change. The underlying cleartext format however did, from base58-encoded private keys (text-based) to a protobuf wallet file (binary).  

---

## 1 answers

### Answer by username_2 on 2017-01-03. Score: 3

The best way to restore a backup file is always to use the same app used for creating the backup. In other words, install the app again, then use Options > Safety > Restore wallet.


---

