I have a wallet backup that's encrypted and I have the password, but when I run this:

openssl enc -d -aes-256-cbc -md md5 -a -in bm2 > bitcoin-wallet-decrypted

and enter my password, I get this:

*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
bad decrypt
140513103832384:error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length:../crypto/evp/evp_enc.c:599:

I do not know why. So I ran this:

cat bitcoin-wallet-decrypted | tr -cd "[:print:]" | awk '{print $1}'

then the output is


I haven't been able to figure out what I am doing wrong, please any help will be greatly appreciated.

1 Answer 1


This happens because of the double encryption. The wallet backup had spending pin and password, So I had to restore it using Android App then export another backup which decrypts fine.

This seem to happen on the backups of 2014 up to 2015, So It might be because of Bitcoin Android App version.

Hope this helps someone.

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.