tags:

views:

389

answers:

5

hi,

I have a login form. The form is submitted via ajax to an .aspx file to actually carry out the login action. In this case, I either have to use $.get() or $.post() but each of them reveals the password (when I look in firebug).

Is there any way to hide the posting information from the user?

+2  A: 

Use https - plain http is no place to try to "hide" passwords or other valuable info.

Alex Martelli
A: 

There is no difference in your logic and a website which uses normal posting ;-) You can use an ssl certificate to encrypt the traffic.

Shoban
A: 

Either you can use SSL as mentioned by Alex & Shoban, or you can encrypt the password and then sent it via Ajax request.

Kirtan
but how come I don't see this info in other web sites, which I know also don't use SSL?
Emin
+1  A: 

ssl should be your only choice because if you will try to encrypt password on simple http... due to client side scripting your are exposing your encryption logic to users.... so ssl is right choice in this.

Usman Masood
so shall I use server-side code to validate instead of ajax - if I cannot use SSL ?
Emin
on http everything is going plain text.e.g.here is a simple version of login info on a http you can clearly see that its readable:<input name="username" type="text" value="test" id="usernametext" /> <input name="password" type="text" value="star" id="passowrdtext" />give a try to Zech's provided link to Javascript crypto libraries... they seem to be a good choice as they will makes the hack not easy... but still it would be possible... without SSL
Usman Masood
A: 

It is highly recommended to use SSL if at all possible. But, you could encrypt the password before sending it using JavaScript crypto libraries.

Zach