I need help in this. I want to encrypt password before assigning it to jquery variable then send to php controller via ajax. Unfortunately I cant insert the password(which is jquery variable) into php hash function. Any help will be appreciated.I want the 'password' inside hash function to be the value I received in the var password. This is the code snippet:
$(document).ready(function() {
$("#login").click(function() {
var username = $("#username").val();
var password = $("#password").val();
var encPass = '<?php echo hash("SHA512", "password"); ?>'
});
});