// AES Encrypt const encrypted = CryptoJS.AES.encrypt( CryptoJS.enc.Utf8.parse(originPassword), CryptoJS.enc.Utf8.parse(key), { mode: CryptoJS.mode.ECB, }); // To Base64 const passwordEncrypted = CryptoJS.enc.Base64.stringify(encrypted.ciphertext); console.log(passwordEncrypted);