1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| const JSEncrypt = require('node-jsencrypt'); let encrypt; function rsa(pwd, publicKey) { if (!encrypt) { encrypt = new JSEncrypt(); } if (!pwd || typeof pwd !== 'string') { return ''; } let newPwd = pwd; if (newPwd.length > 230) { newPwd = newPwd.substr(0, 230); } encrypt.setPublicKey(publicKey); let result = encrypt.encrypt(newPwd); let tryTimes = 0; while (result.length !== 344) { result = encrypt.encrypt(newPwd); if (tryTimes > 10) { return ''; } tryTimes += 1; } return result; } const pk = 'publicKey'; const pwd = '密码'; console.log(rsa(pwd,pk));
|
tcpdump -S -e -vv -i wlo1 host xx.xx.xx.xx