<div dir="ltr"><div>I'm trying to help someone recover his password for an older format ethereum encrypted private key (EPK). My plan has been to use his best guess at the password to brute force the actual password.<br></div><div><br></div><div>The EPK is a 132 character string, and it looks something like this: U2FsdGV0X185M9YAa/27pmEvFzC5pqLI4xWrA6ouGVCx0EeJ9s8DzeGuBtYJPDCKDy0m80yvHdQYDMPa+Hwv2JPbuGJNoUMhFWpcQW1VF+EAy0tYb7Wtv2+IRWZzcpsE8e2a</div><div><br></div><div>(That is: 128 ASCII digits and/or letters, plus three "+" and a "/".)</div><div><br></div><div>This article (<a href="https://www.reddit.com/r/Bitcoin/comments/3gwdge/importing_old_encrypted_private_keys/">https://www.reddit.com/r/Bitcoin/comments/3gwdge/importing_old_encrypted_private_keys/</a>) seems to describe a very similar EPK. The author of that post decrypted their key with the following command:</div><div><br></div><div>openssl enc -in FILE_OF_KEYS -a -d -salt -aes256 -pass pass:"PASSWORD_HERE"</div><div><br></div><div>I have tried this same approach, but I'm getting an error:</div><div><br></div><div>EVP_DecryptFinal_ex:wrong final block length</div><div><br></div><div>Here's an example:</div><div><br></div><div>/usr/bin/openssl enc -d -aes-256-cbc -a -in enc_private_key.txt -out recovered.key -pass pass:TheBig7ebowski</div><div><br></div><div>And here's the output:</div><div><br></div><div>bad decrypt</div><div><br></div><div>140220549330848:error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length:evp_enc.c:581:</div><div><br></div><div>I'm not sure how to interpret that output. I could interpret it as:</div><div>o Your system for decrypting the password is perfect, but: this is not the right password.</div><div>o There's something wrong with the EPK -- its length must be a multiple of the AES block length.</div><div>o There's something wrong with the unencrypted private key -- its length must be a multiple of the AES block length.</div><div>o Something else entirely</div><div><br></div><div>Can anyone help me understand how to interpret this error message?</div><div><br></div><div>Thanks,</div><div>Chris</div></div>