2

i have a simple Jquery code which is for sending $.ajax request and passing the login information to controller to check for the login credentials. i want to encrypt the data. please let me know how can i do that?.

i am posting my Jquery code here to give you an idea.

=============

Jquery Login Button clcik event

$('#btnLogin').click(function (e) {
        var email = $('#Email').val();
        var Password = $('#Password').val();
        var postdata =
        {
            "Email": email,
            "Password": Password
        };
        $('.Loading').fadeIn(50);
        $.ajax({

            url: '@Url.Action("CheckLogin","Home")',
            data: postdata,
            success: function (msg) {
                var data = msg.split(':');
                $('#Result').html(data[0]);
                $('.Loading').fadeOut(50);
             },
            error: function (data) {

                $('#Result').html(data);
                $('.Loading').fadeOut(50);
            }

        });
        e.preventDefault();
    });

========================== as you can see i am passing the username & password in Ajax, when the request goes i can see my username and password in Firebug...

please help ? thx.

1 Answer 1

1

Put your entire page on SSL (HTTPS).
This will encrypt all data going up and down the wire.

You'll still see the data in Firebug, but there's nothing wrong with that.
(If the attacker has access similar to Firebug's, there is nothing you can do to defend yourself)

Sign up to request clarification or add additional context in comments.

5 Comments

please can you tell me how can i do that in Jquery? i mean the parameters, methods, syntax etc....
HTTPS has nothing to do with Javascript. Put your entire page on an HTTPS URL.
thats not good then... if i make my site public then everyone who uses firebug will trace the information ...:( there should be some kind of solution to this...
Only the person in front of the computer (who typed the password in the first place) or a local virus (which can run a keylogger anyway) can use Firebug. Just use SSL.
thx mate... that was useful... so i have to use [ResuireHttps] on controller actions ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.