wood burning stoves 2.0*
The moose likes JSP and the fly likes Java and Javascript intearaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Java and Javascript intearaction" Watch "Java and Javascript intearaction" New topic
Author

Java and Javascript intearaction

ashi roy
Greenhorn

Joined: Jun 02, 2008
Posts: 4
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

Joined: Jan 10, 2002
Posts: 60785
    
  65

"ashi", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

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

Joined: Jun 02, 2008
Posts: 4
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

Joined: Jan 10, 2002
Posts: 60785
    
  65

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

Joined: Jun 28, 2007
Posts: 3
[Edit: thread hijack removed. Please ask your own questions in a new post]
[ June 03, 2008: Message edited by: Bear Bibeault ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Java and Javascript intearaction
 
Similar Threads
how do i encrypt/decrypt query string.
Java and Javascript intearaction
Java and Javascript intearaction
Encryption-decryption file problem
RC4 cypher in Java, decypher in JavaScript.