aes cbc128模式加密出现“hex string is too long, ignoring excess”或者“hex string is too short, padding with ze

阅读 96

2022-12-01


使用如下命令:

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字节。

精彩评论(0)

0 0 举报