0

I have some Java code that sends the public exponent and modulus (very, very long integer) via json to the javascript.

I need to apply RSA encryption on a text field (password) using these values in JavaScript.

I have tried many available things on net but no success yet. And I don't have SSL in the application.

Can someone please help me on this? Some sample/exact code will be a blessing.

3
  • I assumed you're talking about JavaScript, not Java. Note that they are not the same thing. Commented Oct 12, 2011 at 14:35
  • @pimvdb thanks. I edited the body also. I need encryption in javascript and I have the decryption in java. Commented Oct 12, 2011 at 14:41
  • Sorry, I misread. I thought you were using both for the same thing. You're completely correct. Commented Oct 12, 2011 at 14:59

1 Answer 1

7

Have you checked out http://code.google.com/p/jscryptolib/ ?

Alternatively there is another implementation here: http://www-cs-students.stanford.edu/~tjw/jsbn/

You can find a demo of the second implementation here: http://www-cs-students.stanford.edu/~tjw/jsbn/rsa.html - just view source to see how it's used

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks Martin. But jscrypto demo never mentions rsa. The demo html not even loads the RSA script.maybe I am missing something, but I found it a mess. Will try the other one..
Try to look under the header "Supported Cryptography Algorithms", there you will find the line "Public key cryptography: RSA, DSA, ECC, CPK, IBE" which does mention RSA :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.