BrU32

JS Random Password Gen With Encoding SRC V3!!!!!

Sep 7th, 2016
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. <center>
  2. Password:<br>
  3. <input type="text" name="password" id="password"><p>
  4. Encoded Hash:<br>
  5. <input type="text" name="password" id="password1"><p>
  6. Strong<input type="checkbox" id="s1" name="s1" onclick="javascript:m1.checked=false;
  7. w1.checked=false;"/>
  8. Medium<input type="checkbox" id="m1" name="m1" onclick="javascript:s1.checked=false;
  9. w1.checked=false;"/>
  10. Weak<input type="checkbox" id="w1" name="w1" onclick="javascript:m1.checked=false;
  11. s1.checked=false;"/><p>
  12. <button onclick="javascript:
  13. if(s1.checked==true){
  14. GenStrongPass();
  15. }
  16. if(m1.checked==true){
  17. GenMedPass();
  18. }
  19. if(w1.checked==true){
  20. GenWeakPass();
  21. }
  22. ">Generate Password</button><br>
  23. <br>
  24. <button onclick="javascript:
  25. password.value=''
  26. password1.value=''
  27. w1.checked=false;
  28. m1.checked=false;
  29. s1.checked=false;
  30. ">Clear Current Password</button>
  31.  
  32. <script>
  33. function GenWeakPass()
  34. {
  35. var text = "";
  36. var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,/\?";
  37. for( var i=0; i < 8; i++ )
  38. text += possible.charAt(Math.floor(Math.random() * possible.length));
  39. var hash1=atob(text);
  40. password.value=(text);
  41. password1.value=atob(password.value);
  42. }
  43. function GenMedPass()
  44. {
  45. var text = "";
  46. var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,/\?";
  47.  
  48. for( var i=0; i < 12; i++ )
  49. text += possible.charAt(Math.floor(Math.random() * possible.length));
  50. var hash2=atob(text);
  51. password.value=(text);
  52. password1.value=atob(password.value);
  53. }
  54. function GenStrongPass()
  55. {
  56. var text = "";
  57. var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,/\?";
  58.  
  59. for( var i=0; i < 18; i++ )
  60. text += possible.charAt(Math.floor(Math.random() * possible.length));
  61. var hash3=atob(text);
  62. password.value=(text);
  63. password1.value=atob(password.value);
  64. }
  65. </script>
  66. </center>
Advertisement
Add Comment
Please, Sign In to add comment