Openssl PKCS#5/PKCS#7 padding

2019-05-18 19:01发布

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

1条回答
霸刀☆藐视天下
2楼-- · 2019-05-18 19:16

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).

查看更多
登录 后发表回答