How can I encrypt the password using j_security_check?

Hi,

I have two applications: a web application and a rich client application (Swing), both of them are using the same loginModule.

In the rich client application, in the in the login dialog I encrypt the password before sending in to the loginModule, and in the login module I decrypt it.

I want to use the same encryption methods in the web application, in my login.jsp.

After the user presses the ok button I want to encrypt the password before sending it to the login module.

For this I am holding the two hidden fields:

<TD><INPUT TYPE="Hidden" NAME="j_username" SIZE=17 CLASS=FORM VALUE="name"></TD><TD><INPUT TYPE="Hidden" NAME="j_password" SIZE=17 CLASS=FORM VALUE="password"></TD>

And when pressing the ok button I am calling a javascript method using the onclick.

In the javascript function I am able to manipulate the name & password that I pass to the login module, but I don't know how to encrypt them (using my java code). I don't know if & how to use jsp tags in the javascript method (I tried, but of course it doesn't work...)

Can anyone please help me?

Thanks a lot,

Efrat

[1359 byte] By [efratba] at [2007-10-3 0:10:42]
# 1
Ok, never write encryption code on your client side, example: JavaScript. It's visible and can be use easly for hack your site.Instead, I recommend use a client encription standard mechanism like SSL.
Rulasa at 2007-7-14 17:00:17 > top of Java-index,Security,Other Security APIs, Tools, and Issues...