2012-07-31

I would like to know if someone know any library to do encryption in javascript and decryption in java. I have already tried many API, But getting not not getting same values in java.
I want public-private key encryption and hence try to use RSA.

Few i have used are:

www-cs-students.stanford.edu/~tjw/jsbn/

ats.oka.nu/titaniumcore/js/crypto/readme.txt

www.ohdave.com/rsa/

Few thing i checked, javascript breaks string into small chunks and then encrypt them which make cipher text different in java and javascript. I edit javascript code to use string as a whole but didn't worked.

I also tried to set charset of html page to utf-8 but it also not worked. I got success in encrypting single character string like 'K' to be encrypted and decrypted correctly which makes me think that there is problem in encrypting string in javascript by dividing it in small chunks (which i checked, but it fails with encrypting it as a whole).

my java implementation is:

Kindly let me know if it is possible as i have searched many question (in stackoverflow itself) but unable to find a solution. I am searching for a well tested pre-built library.

Show more