因项目需要, 传输数据需要加密, 因此有了一些经验, 现简易抽出来分享!
请求:
前端 cryptojs 用 rsa/aes 或 rsa/des 加密, 后端. net 解密
返回
后端. net 用 rsa/aes 或 rsa/des 加密, 前端 cryptojs 解密
图示:
数据发送加密:
返回数据加密:
开源代码分享: https://github.com/guandy/NetSSL https://github.com/guandy/NetSSL
现只是简易抽出, 如果后续需求量大可考虑做成组件
来源: http://www.bubuko.com/infodetail-2848936.html