java.lang.RuntimeException: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 16 when decrypting with padded cipher
时间: 2023-10-12 22:03:02 浏览: 251
引用中的错误提示"javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher"是在解密过程中出现的异常。这个异常的意思是解密的输入长度必须是8的倍数才能使用填充模式进行解密。同样的,引用中的异常提示"javax.crypto.IllegalBlockSizeException: Input length must be multiple of 16 when decrypting with padded cipher"是在AES解密过程中出现的异常。这个异常的意思是解密的输入长度必须是16的倍数才能使用填充模式进行解密。而引用中的异常提示"java.lang.RuntimeException: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 16 when decrypting with padded cipher"也是在解密过程中出现的异常,意思与前两个异常相同,都是解密的输入长度必须是16的倍数才能使用填充模式进行解密。所以,解决这个问题的方法就是确保解密的输入长度是符合要求的,即是8的倍数或是16的倍数。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padd](https://blog.csdn.net/weixin_45915335/article/details/124152930)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [javax.crypto.IllegalBlockSizeException: Input length must be multiple of 16 when decrypting with pad](https://blog.csdn.net/qq_30624649/article/details/114937740)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [java javax.crypto.IllegalBlockSizeException: Data must not be longer than 245 bytes](https://blog.csdn.net/weixin_38081382/article/details/125485124)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文