Forum Moderators: open

Message Too Old, No Replies

sending password onClick from input

         

ernest1b

1:25 pm on Jul 2, 2010 (gmt 0)

10+ Year Member



I have a registration form which is processed by using javascript and php. First I show registration.php and data from it is sended with ajax to registration_process.php

<form id="registration">
Name<input type="name" id="name" />
Password<input type="password" id="password" />
</form>
<script>
$(document).ready(function(){
$('#submit').click(function() {
var name=$('#name').val();
var password=$('#password').val();
//then it sends those data with ajax to registration.php
...
</script>

registration_process.php
<?
if($_POST[password]){
$password=$_POST[password]
...
}
?>

The problem is that is probably not secure way. Is any way to encrypt value of input? For example something like this
var name=$('#name').encrypt().val();

tnx!

ernest1b

5:32 pm on Jul 2, 2010 (gmt 0)

10+ Year Member



Is that even any huge security risk if I send password to 2nd step with ajax without encrypting it?

I see that also Facebook doesn't do it. As you can try, Facebook sends to 2nd step of registration the value of password with ajax (POST reg_passwd__) without encrypt it.

Fotiman

10:00 pm on Jul 4, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you want it to be secure, you should send the request over HTTPS instead of HTTP. This encrypts the value as it is sent over the wire.