Issue
I think it's probably openssl, but I just cannot get the correct parameters.
For example, I can get the correct output by this online tool
href="https://www.devglan.com/online-tools/aes-encryption-decryption" rel="nofollow noreferrer">https://www.devglan.com/online-tools/aes-encryption-decryption,
The output is correct as I expect, but by commands:
# echo -n "abcd" |openssl enc -aes-128-cbc -K EEEEEEEEEEEEEEEE -iv FFFFFFFFFFFFFFFF -nopad | xxd
bad decrypt
139769171543968:error:0607F08A:digital envelope routines:EVP_EncryptFinal_ex:data not multiple of block length:evp_enc.c:479:
# echo -n "abcd" |openssl enc -aes-128-cbc -K EEEEEEEEEEEEEEEE -iv FFFFFFFFFFFFFFFF | xxd
0000000: 37fa 2274 4251 cd91 66ad 761c a7ed bbc5 7."tBQ..f.v.....
# echo -n "abcd" |openssl enc -aes-128-cbc -K EEEEEEEEEEEEEEEE -iv FFFFFFFFFFFFFFFF
7ú"tBQ͑fv§í»År
I cannot get the same output, so would you help to provide a shell command(openssl preferred) which can give the same output?
Update:
Thanks to Bob's answer, I can get the encryption command, but what's the decryption command to get "abcd"? Below doesn't work:
echo -n "f72bbb809d7648fa2010a2fb55602185" |openssl enc -aes-128-cbc -d -K 45454545454545454545454545454545 -iv 46464646464646464646464646464646
bad decrypt
139672610080672:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:611:
Solution
openssl requires Hex encoding of manual keys and IVs, not ASCII encoding. (ASCII or UTF-8 encoding these, as the online tools seems to be doing, dramatically reduces your keyspace and makes AES insecure.)
"E" is 0x45 and "F" is 0x46, so the equivalent openssl command is:
echo -n "abcd" |openssl enc -aes-128-cbc -K 45454545454545454545454545454545 -iv 46464646464646464646464646464646 | xxd
00000000: f72b bb80 9d76 48fa 2010 a2fb 5560 2185 .+...vH. ...U`!.
Answered By - Rob Napier Answer Checked By - Robin (WPSolving Admin)