Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java and Javascript intearaction

 
ashi roy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way out to use RSA or some other crypto algorithm to encrypt/decrypt string/text in javascript/java, and vice versa.
What I mean is, if I encrypt a string in jsp (using javascript, @ on formSubmit), pass it to action class, and now how can i decrypt it in my java code?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64847
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"ashi", please check your private messages for an important administrative matter.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64847
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I really don't see how JavaScript enters into your question. You encrypt on the server, and decrypt next time on the server as well.
[ June 02, 2008: Message edited by: Bear Bibeault ]
 
ashi roy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I mean is, I have a login.jsp, on form submit I would like to encrypt the password and once the password reaches to the form controller or action class, I would like to decrypt it back. Is it possible to have javascript encryption (RSA or something similar) and using the same same algorith in a java class to decrypt it??
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64847
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you want to encrypt it on the client? That makes no sense since the script is visible to anyone on the net.

If want to protect a password during transmission, that's what SSL is for.
 
Prashant Chandra
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Edit: thread hijack removed. Please ask your own questions in a new post]
[ June 03, 2008: Message edited by: Bear Bibeault ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic