错误:无法获取属性' createEncryptor'未定义或空引用

时间:2014-11-23 04:46:05

标签: javascript cryptography

function generateload_Click(form1)
{
    window.text="Thishasto";
    window.key = "hello";
    var useHashing = true;
    var encrypted;
    if (useHashing){
        key = CryptoJS.MD5(key).toString();
    }

    window.options = {
        mode: CryptoJS.mode.ECB, 
        padding: CryptoJS.pad.Pkcs7
    };

    window.textWordArray = CryptoJS.enc.Utf8.parse(text);
    window.keyHex = CryptoJS.enc.Hex.parse(key);

    window.encrypted = CryptoJS.TripleDES.encrypt(textWordArray, keyHex, options);

    alert(encrypted);
}
在IE中运行时

返回以下错误

  

错误:无法获取属性' createEncryptor'未定义或空引用。

1 个答案:

答案 0 :(得分:1)

同样的问题here。通过包含每个模式和填充源文件解决。