I have AES-encrypted file, which encoded to base64 one-line string (without breaklines) and need to decrypt it. Here it is.
But when i use:
openssl enc -d -a -aes-256-cbc -in encrypted -out decrypted
OpenSSL throws "error reading input file"
But base64 util decrypts it like a charm:
base64 -d encrypted | openssl enc -d -aes-256-cbc > decrypted
Trying to find find the cause and convert to one-line base64 file:
base64 -w 0 aesfile | openssl enc -d -a -aes-256-cbc > decrypted
# error reading input file
base64 aesfile | openssl enc -d -a -aes-256-cbc > decrypted
# no errors, file decrypted
Conclusion: OpenSSL can't decode non-multiline base64 inputs
Encrypt
openssl enc -aes-256-cbc -pass pass:YOURPASSWORD -p -in msg.txt -out enc.txt -base64
Decrypt
openssl enc -aes-256-cbc -base64 -pass pass:YOURPASSWORD -d -p -in enc.txt -out dec.txt
If there's no newline
in the encrypted file after the base64
line, you get an error saying error reading input file
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With