Advertisement
skip420

genpass

Sep 11th, 2022
796
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.19 KB | None | 0 0
  1. # python genpass.py
  2.  
  3.  
  4. # generates single password randomly
  5.  
  6.  
  7. import random
  8. import string
  9. import os.path
  10. #random numbers section
  11. num1 = random.randrange(100,500)
  12. number_section =  num1
  13. #random letters section
  14. string.letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()'
  15. let1 = random.choice(string.letters)
  16. let2 = random.choice(string.letters)
  17. let3 = random.choice(string.letters)
  18. let4 = random.choice(string.letters)
  19. let5 = random.choice(string.letters)
  20. let6 = random.choice(string.letters)
  21. let7 = random.choice(string.letters)
  22. let8 = random.choice(string.letters)
  23. letters_section = let1 + let2 + let3 + let4 + let5 + let6 + let7 + let8
  24. #letters and numbers combination
  25. password = str(number_section) + letters_section
  26. #input section
  27. password_for = raw_input('This password is for: ')
  28. your_pass =  'Your password for' + ' ' + password_for + ' ' + 'is:' + ' ' + password
  29. print your_pass
  30. #save section
  31. save_path = '/home/ghostproxy/Desktop/wordlists'
  32. name_of_file = raw_input("What is the name of the file: ")
  33. completeName = os.path.join(save_path, name_of_file+".txt")        
  34. file1 = open(completeName, "w")
  35. toFile = your_pass
  36. file1.write(toFile)
  37. file1.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement