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, 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.

  • 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. Oct 16, 2016 at 23:18
  • 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
    Oct 18, 2016 at 11:27
  • 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? Oct 18, 2016 at 12:08
  • 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
    Jan 3, 2017 at 20:52

1 Answer 1


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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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