RSA 在 Javascript 中加密并在 Java 中解密 - 无 SSL
我编写了一个 java 实用程序,用于生成 RSA 加密的密钥对。但要加密密码,我必须在客户端 javascript 中执行此操作
有人有示例代码可以在 javascript 中执行此操作吗?我可以在哪里传递公钥和密码(字符串)并取回加密的密码?非常需要这个。
我尝试了 jCryption 和 http://www.ohdave.com/rsa/ 但没有赚到太多钱出来了。 :(
该应用程序没有 SSL。任何其他安全加密方法/过程/库都将受到欢迎。
I have written a java utility for key pair generation for RSA encryption. But to encrypt the password, I have to do it in client side javascript
Does anyone has a sample code to do that in javascript? Where I can just pass the public key and the password (string) and get the encrypted password back ? Badly need this.
I tried jCryption and http://www.ohdave.com/rsa/ but couldn't make much out of it. :(
The application doesn't have SSL. Any other secure encryption method/procedure/library will be most welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经在 javascript 中使用了 C# 的开始实现的一些内容,并看到了正确的结果。它确实已经有 RSA。
http://www.codeproject.com/KB/tips/JocysComJavaScriptClasses.aspx
您可以像 C# 调用一样实例化它(大多数情况下)。由于您有 JAVA 经验,因此学习曲线应该不会很大。
我不知道 RSA 是否需要它,但在我使用过的一些函数上;在使用一部分之前,您必须转换为二进制数组才能获得正确的示例。 (例如MD5或SHA1)
希望有帮助。
I have used bits of this beginning implementation of C# in javascript for other pieces and seen correct results. It does have RSA already.
http://www.codeproject.com/KB/tips/JocysComJavaScriptClasses.aspx
You can instantiate it the same as C# calls (for the most part). Since you have JAVA experience, it shouldn't be a large learning curve.
I don't know if it's required for the RSA, but on some functions I've used; you have to convert to a binary array before using a portion to get the right example. (Such as the MD5 or SHA1)
Hope that helps.