Openssl PKCS#5/PKCS#7 padding

醉酒当歌 提交于 2019-12-07 23:49:10

问题


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:


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



来源:https://stackoverflow.com/questions/11591089/openssl-pkcs5-pkcs7-padding

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!