jsencrypt
jsencrypt copied to clipboard
There are about 5‰ probability of encrypting errors
var log = console.log;
function genPwd() {
return Math.random().toFixed(6).substr(2);
}
var passwordPublicKey = 'your public key';
var encrypt = new JSEncrypt();
encrypt.setPublicKey(passwordPublicKey);
var count = 0;
while(count < 10000) {
var six = genPwd();
pwd = hex_md5(six);
pwd += '_' + 20190327150955;
count++
var pass = encrypt.encrypt(pwd);
if (pass.length != 344) {
log('error', pass.length);
}
}
log('end');
i have met this problem too, have you solve it?
i have met this problem too, have you solve it?
已经解决了。 看你是杭州的,直接用中文吧。 因为每次加密的失败率都是千分之五。那么只要长度错误就加密,做个循环直到正确。循环次数可以小于某个数,以防万一碰到特殊情况。
i have met this problem too, have you solve it?
已经解决了。 看你是杭州的,直接用中文吧。 因为每次加密的失败率都是千分之五。那么只要长度错误就加密,做个循环直到正确。循环次数可以小于某个数,以防万一碰到特殊情况。
好的
长度如何计算出来?
固定344?
特意来围观。哈哈哈
i have met this problem too, have you solve it?
已经解决了。 看你是杭州的,直接用中文吧。 因为每次加密的失败率都是千分之五。那么只要长度错误就加密,做个循环直到正确。循环次数可以小于某个数,以防万一碰到特殊情况。
好的
后来发现这个问题好像是ES6不兼容导致的,你试着改改代码看
i have met this problem too, have you solve it?
已经解决了。 看你是杭州的,直接用中文吧。 因为每次加密的失败率都是千分之五。那么只要长度错误就加密,做个循环直到正确。循环次数可以小于某个数,以防万一碰到特殊情况。
好的
后来发现这个问题好像是ES6不兼容导致的,你试着改改代码看
好的
请问如何兼容ie6,7,8