开发者

RSA encrypt in Javascript and decrypt in Java - NO SSL

I have written a java utility for key pair generation for RSA encryption. But to encrypt the passwo开发者_JAVA百科rd, 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜