使用如下命令:
openssl enc -aes-128-cbc -in test.cpp -out test11.cpp -iv f123 -K 1223 #aes-128-cbc为填充模式 -iv指定盐 -K指定秘钥
出现“hex string is too short, padding with zero bytes to length”这样错误
解决:使用命令:
openssl enc -aes-128-cbc -in test.cpp -out test11.cpp -iv f12aaaaaa888888888888888888888aa -K f12aaaaaa888888888888888888888aa #将盐和秘钥设置32字节的16进制字符串
如果采用256cbc,那么盐设置32字节,秘钥设置为64字节。