// 公共方法1
import { CryptoJS } from './CryptoJS.js';
import { kValueA } from './kValue/kValueA.js';
import { kValueB } from './kValue/kValueB.js';
import { kValueC } from './kValue/kValueC.js';
import { kValueD } from './kValue/kValueD.js';
import { kValueE } from './kValue/kValueE.js';
import { kValueF } from './kValue/kValueF.js';
import { kValueG } from './kValue/kValueG.js';
import { kValueH } from './kValue/kValueH.js';
import { vValueA } from './vValue/vValueA.js';
import { vValueB } from './vValue/vValueB.js';
import { vValueC } from './vValue/vValueC.js';
import { vValueD } from './vValue/vValueD.js';
import { vValueE } from './vValue/vValueE.js';
import { vValueF } from './vValue/vValueF.js';
import { vValueG } from './vValue/vValueG.js';
import { vValueH } from './vValue/vValueH.js';
var Aes = {
    /*AES加密*/
    Encrypt(data) {
        let dataStr = data;
        let AuthTokenKey =
            kValueA.kValue[0] +
            '' +
            kValueB.kValue[1] +
            '' +
            kValueC.kValue[2] +
            '' +
            kValueD.kValue[3] +
            '' +
            kValueE.kValue[4] +
            '' +
            kValueF.kValue[5] +
            '' +
            kValueG.kValue[6] +
            '' +
            kValueH.kValue[7] +
            '' +
            kValueA.kValue[8] +
            '' +
            kValueB.kValue[9] +
            '' +
            kValueC.kValue[10] +
            '' +
            kValueD.kValue[11] +
            '' +
            kValueE.kValue[12] +
            '' +
            kValueF.kValue[13] +
            '' +
            kValueG.kValue[14] +
            '' +
            kValueH.kValue[15];
        let AuthTokenIv =
            vValueA.vValue[0] +
            '' +
            vValueB.vValue[1] +
            '' +
            vValueC.vValue[2] +
            '' +
            vValueD.vValue[3] +
            '' +
            vValueE.vValue[4] +
            '' +
            vValueF.vValue[5] +
            '' +
            vValueG.vValue[6] +
            '' +
            vValueH.vValue[7] +
            '' +
            vValueA.vValue[8] +
            '' +
            vValueB.vValue[9] +
            '' +
            vValueC.vValue[10] +
            '' +
            vValueD.vValue[11] +
            '' +
            vValueE.vValue[12] +
            '' +
            vValueF.vValue[13] +
            '' +
            vValueG.vValue[14] +
            '' +
            vValueH.vValue[15];
        let encrypted = CryptoJS.AES.encrypt(dataStr, CryptoJS.enc.Latin1.parse(AuthTokenKey), {
            iv: CryptoJS.enc.Latin1.parse(AuthTokenIv),
            mode: CryptoJS.mode.CBC,
            padding: CryptoJS.pad.Pkcs7
        });
        return encrypted.toString();
    },
    /*AES解密*/
    Decrypt(data) {
        let data2 = data; //.replace(/\n/gm, "");
        let AuthTokenKey =
            kValueA.kValue[0] +
            '' +
            kValueB.kValue[1] +
            '' +
            kValueC.kValue[2] +
            '' +
            kValueD.kValue[3] +
            '' +
            kValueE.kValue[4] +
            '' +
            kValueF.kValue[5] +
            '' +
            kValueG.kValue[6] +
            '' +
            kValueH.kValue[7] +
            '' +
            kValueA.kValue[8] +
            '' +
            kValueB.kValue[9] +
            '' +
            kValueC.kValue[10] +
            '' +
            kValueD.kValue[11] +
            '' +
            kValueE.kValue[12] +
            '' +
            kValueF.kValue[13] +
            '' +
            kValueG.kValue[14] +
            '' +
            kValueH.kValue[15];
        let AuthTokenIv =
            vValueA.vValue[0] +
            '' +
            vValueB.vValue[1] +
            '' +
            vValueC.vValue[2] +
            '' +
            vValueD.vValue[3] +
            '' +
            vValueE.vValue[4] +
            '' +
            vValueF.vValue[5] +
            '' +
            vValueG.vValue[6] +
            '' +
            vValueH.vValue[7] +
            '' +
            vValueA.vValue[8] +
            '' +
            vValueB.vValue[9] +
            '' +
            vValueC.vValue[10] +
            '' +
            vValueD.vValue[11] +
            '' +
            vValueE.vValue[12] +
            '' +
            vValueF.vValue[13] +
            '' +
            vValueG.vValue[14] +
            '' +
            vValueH.vValue[15];
        let decrypted = CryptoJS.AES.decrypt(data2, CryptoJS.enc.Latin1.parse(AuthTokenKey), {
            iv: CryptoJS.enc.Latin1.parse(AuthTokenIv),
            mode: CryptoJS.mode.CBC,
            padding: CryptoJS.pad.Pkcs7
        });
        return CryptoJS.enc.Utf8.stringify(decrypted).toString();
    }
};
export default Aes;
