Input byte array has incorrect ending byte at 24(一次密钥问题解决)

1.背景

安卓加密某个参数并传至后端解密

2.错误信息

1
Input byte array has incorrect ending byte at 24

3.错误原因

存在\r|\n之类的特殊字符需要全局替换为空的字符串,否则后端再解析过程中会出现报错导致无法解密。

4。解决办法

1
str.replaceAll("\r|\n", "");
文章目录
  1. 1.背景
  2. 2.错误信息
  3. 3.错误原因
  4. 4。解决办法