I\'m using a C++ wrapper for OpenSSL\'s AES-256-CBC encryption that follows the recipe from OpenSSL docs. It\'s meant to take some data to encrypt, a key and an initializati
I figured it out. The problem was that I'm using the wrong command line parameter. It should be -K
for the key, not -k
. This is the correct format:
printf '%s' '48656c6c6f20776f726c6421' | xxd -r -ps | openssl aes-256-cbc -iv 00000000000000000000000000000000 -K 0000000000000000000000000000000000000000000000000000000000000000 -nosalt | xxd -ps
and this gives the exact same result as OpenSSL in C++.