encryptText: function(l, n, j) {
var i = l || "encryptKey";
if (n) {
var m = f("#" + i).val() || "";
var k;
var h = c("JSEncrypt");
if (typeof (h) === "function" && m) {
var o = new h();
o.setPublicKey(m);
k = o.getKey().encrypt(n)
} else {
console && console.error("【警告】加密组件初始化失败...", m);
k = n
}
} else {
k = n
}
if (typeof (j) === "string") {
f("#" + j).val(k)
}
return k
},
encryptEle: function(j, h, i) {
if (!h) {
return null
}
var k = f("#" + h).val() || "";
return b.encryptText(j, k, i)
},
encryptText: function(l, n, j) {
var i = l || "encryptKey";
if (n) {
var m = f("#" + i).val() || "";
var k;
var h = c("JSEncrypt");
if (typeof (h) === "function" && m) {
var o = new h();
o.setPublicKey(m);
k = o.getKey().encrypt(n)
} else {
console && console.error("【警告】加密组件初始化失败...", m);
k = n
}
} else {
k = n
}
if (typeof (j) === "string") {
f("#" + j).val(k)
}
return k
},
function jiami(password) {
var k;
var o = new JSEncrypt();
o.setPublicKey("30819f3******************************************************************************************************010001");
k = o.getKey().encrypt(password)
return k
}
转自:https://www.freebuf.com/articles/web/333922.html
注:如有侵权请联系删除
学习更多技术,关注我: