"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const index = require("../../../_virtual/index.js");
const KP = {
  key: "36cb62b6d87d43e1",
  // 秘钥 16*n:
  iv: "1234567812345678"
  // 偏移量
};
function getAesString(data, key, iv) {
  key = index.default.enc.Utf8.parse(key);
  iv = index.default.enc.Utf8.parse(iv);
  let encrypted = index.default.AES.encrypt(data, key, {
    iv,
    mode: index.default.mode.CBC,
    padding: index.default.pad.Pkcs7
  });
  return encrypted.toString();
}
function getDAesString(encrypted, key, iv) {
  key = index.default.enc.Utf8.parse(key);
  iv = index.default.enc.Utf8.parse(iv);
  let decrypted = index.default.AES.decrypt(encrypted, key, {
    iv,
    mode: index.default.mode.CBC,
    padding: index.default.pad.Pkcs7
  });
  return decrypted.toString(index.default.enc.Utf8);
}
const aes = {
  en: (data) => getAesString(data, KP.key, KP.iv),
  de: (data) => getDAesString(data, KP.key, KP.iv)
};
exports.aes = aes;
