import CryptoJS from 'crypto-js';
function decrypt(content) {
    const key = CryptoJS.enc.Hex.parse('16308B814B3E3CEC160BDCD8B56E3FD3');
    const cipherText = CryptoJS.enc.Hex.parse(content);
    var decrypted = CryptoJS.AES.decrypt(
        {
            ciphertext: cipherText
        },
        key,
        {
            mode: CryptoJS.mode.ECB,
            padding: CryptoJS.pad.Pkcs7
        }
    );
    return decrypted.toString(CryptoJS.enc.Utf8);
}

function encrypt(content) {
    const key = CryptoJS.enc.Hex.parse('16308B814B3E3CEC160BDCD8B56E3FD3');
    var encrypted = CryptoJS.AES.encrypt(content, key, {
        mode: CryptoJS.mode.ECB,
        padding: CryptoJS.pad.Pkcs7
    });
    return encrypted.ciphertext.toString(CryptoJS.enc.Hex);
}
export default { decrypt, encrypt };
