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」的未定義或空引用
Error: Unable to get property 'createEncryptor' of undefined or null reference.
ECB不安全,MD5不是基於密碼的密鑰派生機制。使用AES,而不是3DES。 – 2014-11-23 13:02:07