A question of PKCS5
Posted: Mon Sep 17, 2018 1:22 am
Hi, everyone.
Anyone know how to calculate PKCS5 padding algorithm?
I knew that the PKCS5 padding algorithm fills bytes at the end of data until the length of total data is multiple block size.
For example, AES block size is 32 bytes. And the data is 30 bytes. The padding bytes is "0202". If the data is 28 bytes, the padding bytes will be "04040404". But If the data length is 32 bytes too, whether I should add 32bytes padding bytes?
Anyone know how to calculate PKCS5 padding algorithm?
I knew that the PKCS5 padding algorithm fills bytes at the end of data until the length of total data is multiple block size.
For example, AES block size is 32 bytes. And the data is 30 bytes. The padding bytes is "0202". If the data is 28 bytes, the padding bytes will be "04040404". But If the data length is 32 bytes too, whether I should add 32bytes padding bytes?