crypto.js 387 Bytes
var CryptoJS = require('crypto-js');

// 勿动!!!!!!
const secretKey = '6334f4af-c34b-4529-b9bb-ac0982b8d9f7';

export const encrypt = function(msg) {
    return CryptoJS.AES.encrypt(msg, secretKey).toString();
};

export const decrypt = function(ciphertext) {
    const bytes = CryptoJS.AES.decrypt(ciphertext, secretKey);
    return bytes.toString(CryptoJS.enc.Utf8);
};