0
点赞
收藏
分享

微信扫一扫

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


使用如下命令:

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 条评论