爬到网页的javascript:
var rsa = new RSAKey(); rsa.setPublic("cc6be3d4de56287b8c3616b33bc1b7a5a2bb9148352140262420ee007f83b3165fb7674a759d60c24b71fd5437c7810f127f2c4370c2d4bdfcb55c08f1b3c715b7b2f57228e78e34039d2b967f54a58e345bc91e3dd54c7bea86d73c9e2de968736bf2b97f59bea891aa3519ae7238d76dff57cabba7cc0d370775657f3b5c92", "10001");
var loginNameRsa = rsa.encrypt(loginName);
var passwordRsa = rsa.encrypt(password)
这种rsa公钥是啥子格式。
不懂javascript和加密,自己断断续续摸索鼓捣几天还是不懂,只好求助了。大佬指个方向,我该如何用bash脚本来获取loginNameRsa和passwordRsa的结果?
吉林网友:啊,python搞定.
- #!/usr/bin/python
- #encoding=utf-8
- from jsbn import RSAKey
- rsa = RSAKey()
- rsa.setPublic("hex", "10001")
- crypto = rsa.encrypt(test)
- print crypto
复制代码