Input length must be multiple of 16 when decrypting with padded cipher
时间: 2023-11-01 21:31:21 浏览: 1138
AES加密解密源码,解决Linux报错问题
As an AI language model, I can tell you that this error message appears when you are trying to decrypt data that has been encrypted using a padding scheme, such as PKCS#7 or ISO/IEC 7816-4. Padding is used to ensure that the data being encrypted is a multiple of the block size of the cipher being used, which is typically 16 bytes for many block ciphers.
When you decrypt the data, the padding needs to be removed in order to obtain the original plaintext. However, if the input length is not a multiple of 16 bytes, it means that the padding has not been applied correctly or has been corrupted in some way.
To resolve this error, you should check that the data being decrypted is the same length as the original plaintext, minus any padding that may have been added. You should also check that the padding scheme used for encryption is compatible with the decryption algorithm being used.
阅读全文