title: How to encrypt data and pass it using ajax call?
body: <p>I am working with express js. I have a modal form which has username and password field. i am posting the form data using ajax call. everything works fine but only issue is the username and password which i am entering are visible in post header, so is there any way in jquery to encrypt the form data before submitting..</p>
  
  <p>here is my code</p>
  
  <pre><code> $("#login").click(function(){
       var d=$("#form-1").serialize();
      // console.log("serialize data=",d);
      $.ajax({
          method : 'POST',
          url  :'/login',
          data :d ,
          success:function(response){
              console.log("response=",response.message);
              if (response.message=='success'){
                  $("#msg").hide();
                   $('#myModal').modal('toggle');
                  console.log('in if 83');
                  }
              else
                  {
                  console.log("in else");
                  $("#msg").text("invalid username or password");
                  $("#msg").show();
                  }
  
          }
      });   
  
    });
  </code></pre>