Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

前端解密出现异常Malformed UTF-8 data #55

Open
dawnFlyme opened this issue Apr 26, 2020 · 4 comments
Open

前端解密出现异常Malformed UTF-8 data #55

dawnFlyme opened this issue Apr 26, 2020 · 4 comments

Comments

@dawnFlyme
Copy link

后端返回数据显示加密成功,前端解密时出现异常
crypto-js.js:460 Uncaught (in promise) Error: Malformed UTF-8 data

@dawnFlyme
Copy link
Author

目前我将mater分支代码重新package,替换maven远程拉取的jar是可以跑起来的。比较怀疑是AesEncryptUtils这个类中出现了偏差。

@changhr2013
Copy link

我想知道你的对称密钥的生成和保存形式,以及你前端的密钥还原二进制密钥时的做法。
master 分支的代码的确对密钥的处理做了修改,密钥本身应该是一个 16 字节的随机数,它的 Hex 形式应该是 32 长度的字符串。
master 分支现在的做法通过解 Hex 串还原二进制密钥,而之前的做法是直接使用字符串本身的 byte 数组形式。
原则上来讲,master 分支其实是更标准的做法。

@yinjihuan
Copy link
Owner

master分支是后面别人提供的pr,后面会发布新版本的

@smile-vi
Copy link

smile-vi commented Dec 7, 2021

前端解密出现异常Malformed UTF-8 data,版本是1.2.2的,是什么原因

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants