Lenin_Daniel

Key_2

Mar 3rd, 2016
1,174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. 2d96a450784ba8b8c5cb8e260bdcc128
  2.  
  3. <!DOCTYPE HTML5>
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head>
  7. <title>Mi aplicacion</title>
  8. </head>
  9. <script src="https://code.jquery.com/jquery-2.2.4.js"
  10. integrity="sha256-iT6Q9iMJYuQiMWNd9lDyBUStIq/8PuOW33aOqmvFpqI="
  11. crossorigin="anonymous"></script>
  12. <script src="https://apidocs.unleashedsoftware.com/public/js/hmac-sha256.js"></script>
  13.  
  14. <body>
  15. <script>
  16. $(document).ready(function(){
  17. $("#formulario").submit(function() {
  18. var author = '{ "query" : "login", "user" : "'+$("#nombre").val()+'", "pass" : "'+$("#contrasena").val()+'"}';
  19. alert(author);
  20. var encode_author = btoa(author);
  21. $("#Authorization").val(encode_author+"."+CryptoJS.HmacSHA256(author, "secret"));
  22. alert($("#Authorization").val());
  23. return true;
  24. });
  25. });
  26. </script>
  27. <BR>
  28. <INPUT TYPE="text" NAME="nombre" id="nombre"><BR>
  29. <INPUT TYPE="text" NAME="contrasena" id="contrasena"><BR>
  30.  
  31. <FORM ACTION="prueba.aspx" METHOD="POST" ID="formulario">
  32. <INPUT TYPE="text" NAME="Authorization" ID="Authorization" hidden="true"><BR>
  33. <INPUT TYPE="submit" VALUE="Enviar">
  34. </FORM>
  35. </body>
  36. </html>
Advertisement
Add Comment
Please, Sign In to add comment