1. 简介
AES对称加密算法,通过使用密码KEY完成对明文的加密与解密操作
2. 生成密钥
这里的密钥要跟后台的保持一致
3. 下载CryptoJS
pip install CryptoJS -i https://pypi.tuna.tsinghua.edu.cn/simple
4. JS引用CryptoJS
const CryptoJS = require(‘crypto-js’);
5. Encrypt加密操作
export function Encrypt(word) {
let encrypted = CryptoJS.AES.encrypt(word, key, {
iv: iv,
mode: CryptoJS.mode.CBC,