"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.decrypt = exports.encrypt = void 0;
const crypto_js_1 = __importDefault(require("crypto-js"));
const SECRET_KEY = 'FOXPAGE.SECRET_KEY';
const encrypt = (str) => {
    const encData = crypto_js_1.default.AES.encrypt(str, SECRET_KEY).toString();
    const result = crypto_js_1.default.enc.Base64.stringify(crypto_js_1.default.enc.Utf8.parse(encData));
    return result;
};
exports.encrypt = encrypt;
const decrypt = (str) => {
    const decData = crypto_js_1.default.enc.Base64.parse(str).toString(crypto_js_1.default.enc.Utf8);
    const result = crypto_js_1.default.AES.decrypt(decData, SECRET_KEY).toString(crypto_js_1.default.enc.Utf8);
    return result;
};
exports.decrypt = decrypt;
