Jhonjhon_123

Untitled

May 10th, 2012
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. <SCRIPT LANGUAGE="JavaScript">
  2. <!-- Begin
  3. var symbols = " !\"#$%&'()*+'-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
  4.  
  5. function Encode2(pass) {
  6. Semilla = "PescaoDeth:Killme";
  7. j = 0;
  8. b = "";
  9. for (i = 0; i < pass.length; i++) {
  10. a = tonum(pass.charAt(i)) ^ tonum(Semilla.charAt(j));
  11. //alert('__a__: ' + String.fromCharCode(a) + ':' + a);
  12. b += tochar(a);
  13. if (j < Semilla.length - 1) {
  14. j++;
  15. } else {
  16. j = 0;
  17. }
  18.  
  19. }
  20. return(b);
  21. }
  22.  
  23. function Encode(pass) {
  24. Semilla = "PescaoDeth:Killme";
  25. j = 0;
  26. b = "";
  27. for (i = 0; i < pass.length; i++) {
  28. a = tonum(pass.charAt(i)) ^ tonum(Semilla.charAt(j));
  29. //alert('__a__: ' + String.fromCharCode(a) + ':' + a);
  30. b += tochar(a);
  31. if (j < Semilla.length - 1) {
  32. j++;
  33. } else {
  34. j = 0;
  35. }
  36.  
  37. }
  38.  
  39. //alert(b);
  40.  
  41. document.getElementsByName("Input2")[0].value = b;
  42.  
  43.  
  44. if (b == "eRKZV_wSM#r") {
  45. alert("Perfecto");
  46. } else {
  47. //alert("Incorrecto");
  48. }
  49.  
  50. }
  51.  
  52. function tonum(charx) {
  53. var loc;
  54. loc = symbols.indexOf(charx);
  55. //alert(String.fromCharCode(32+loc) + ':' + (32+loc) + ':' + symbols[loc]);
  56. if (loc > -1) {
  57. return (32 + loc);
  58. }
  59. return (0);
  60. }
  61.  
  62. function tochar(num) {
  63. var loc;
  64. loc = symbols.charAt(num - 32);
  65. return loc;
  66. }
  67. // End -->
  68. </script>
  69. <center><form name="yashira" onsubmit="return false;"><table border=1><tr><td><center>Ingrese el password <input size=200 name=Input onKeyup="Encode(this.form.Input.value)"><p>eRKZV_wSM#r<input size=200 name=Input2><p><input type="button" value="Login" onClick="Encode(this.form.Input.value)"></center><p></td></tr></table></form></center>
Advertisement
Add Comment
Please, Sign In to add comment