Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于RSA自定义算法 #61

Open
lzyforever opened this issue Jun 16, 2020 · 3 comments
Open

关于RSA自定义算法 #61

lzyforever opened this issue Jun 16, 2020 · 3 comments

Comments

@lzyforever
Copy link

按照DEMO中的RSA自定义算法进行配置后,前端使用什么工具进行RSA加密的喃?现目前我前端使用了JSEncrypt进行加密和解密,但是使用后端生成的公钥和密钥都无法进行加解密,仔细看了一下,后端生成的加密结果是256位,然而前端加密出来的只有127位,请赐教!谢谢!

@yinjihuan
Copy link
Owner

后面我提供个demo吧

@dubujianghu
Copy link

同问,请求作者写个demo

@yinjihuan
Copy link
Owner

https://github.com/yinjihuan/monkey-api-encrypt/blob/master/monkey-api-encrypt-springboot-example/src/main/resources/static/js/security.js 中就有Rsa的算法,但是不建议在前端用Rsa, 之前我没写就是因为写不下去了。
一加密浏览器就卡死了,玩不下去。

使用方式:
var publicKey = RSAUtils.getKeyPair(public_exponent, '', modulus);
var rsa_pwd = RSAUtils.encryptedString(publicKey, rep_password);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants