// aes.js
const key = CryptoJS.enc.Utf8.parse("mysecretkey12345");  // 16位密钥
const iv = CryptoJS.enc.Utf8.parse("initialvector123");   // 16位IV

function encryptAES(text) {
    const encrypted = CryptoJS.AES.encrypt(text, key, {
        iv: iv,
        mode: CryptoJS.mode.CBC,
        padding: CryptoJS.pad.Pkcs7
    });
    return encrypted.toString();
}

window.encryptAES = encryptAES;
