var CryptoJS = require("crypto-js");//replace thie with script tag in browser env//encryptvar rawStr = "hello world!";var wordArray = CryptoJS.enc.Utf8.parse(rawStr);var base64 = CryptoJS.enc.Base64.stringify(wordArray);console.log('encrypted:', base64);//decryptvar parsedWordArray = CryptoJS.enc.Base64.parse(base64);var parsedStr = parsedWordArray.toString(CryptoJS.enc.Utf8);console.log("parsed:",parsedStr);复制代码