EXERCICI PRÀCTIC D’ENCRIPTACIÓ.
El procediment:
Pases de la implementació:
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
alert("somhi");
$.post("encriptador.php",
{
missatge: document.getElementById("missatge").value
},
function(data,status){
alert(data);
});
});
});
</script>
</head>
<body>
<input id="missatge"></input><button>envia missatge</button>
</body>
</html>
<?php
$m=$_POST["missatge"];
echo "el missatge ".$m." encriptat és ";
echo hash('ripemd160', $m);
?>