OpenSSL PKCS#5/PKCS#7填充 [英] Openssl PKCS#5/PKCS#7 padding

查看:168
本文介绍了OpenSSL PKCS#5/PKCS#7填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道openssl如何处理使用AES-128-CBC时可被8字节分割的消息. openssl如何检测没有要删除的填充(PKCS#5/PKCS#7)?尤其是当消息以ASCII码小于或等于8的字符结尾时.

I was wondering how openssl handles a message that is dividable by 8 bytes when using AES-128-CBC. How can openssl detect that there is no padding (PKCS#5/PKCS#7) to be removed? Especially when the message ends in a character with an ASCII code less than or equal to 8.

我希望我的问题清楚. 谢谢

I hope my question is clear. Thanks

推荐答案

好的答案是,即使可以将数据除以块大小,也总是要添加填充.这样,一个8字节的字符串将被8个字节填充(ASCII码为8).

Well the answer is that padding is always added, even if the data can be divided by the block size. Thus a 8 byte string will be padded with 8 bytes (with ASCII code 8).

这篇关于OpenSSL PKCS#5/PKCS#7填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆