请问一下 cocos creator 3.x 下可用的 AES 加解密方案是什么?

npm install crypto-js 之后, AES 加解密在开发环境是可以用的,但是打包成 mobile 版本时报错:

[Build] [build-script]ModuleNotFoundError: (i18n needed)resolve_error_module_not_found: {“specifier”:“crypto”,“parentURL”:“file:///xxx/demo_project/node_modules/crypto-js/core.js”}

查阅论坛资料有提到 官方放弃了对 crypto-js 的支持。

那么请教一下,生产环境大家怎么解决这个问题?

感谢官方以及各位高手~

有crypto-ts
自己github找

https://gitee.com/dream93/scl/blob/main/util/EncryptUtil.ts

遇到了同样的问题 你现在解决了吗

你这个打包不报错吗

报什么错?

crypto-es

没事 可以用 多谢

这里面的解密方法有问题 解密出来是空的

key和iv的位数不对,微信加我的是你吗?

是的 多谢哥 问题解决了