Fluffyofqweam

Foreast11

May 21st, 2020
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. char = 'abcdefghijklnmopqrstuvwxyzABCDEFGHIJKLNMOPQRSTUVWXYZ1234567890@#$&!-_'
  2.  
  3. class creation:
  4. def make_my_own():
  5. return input('password here: ')
  6. def random_password():
  7. try:
  8. length = int(input('lengh of randomly generated password: '))
  9. except:
  10. length = 4
  11. print("You didn't put a number. Pretty uncool you know, so it'll automatically be 4")
  12. y = ''
  13. import random
  14. for x in range(length):
  15. y += random.choice(char)
  16. return y
  17.  
  18. def choice():
  19. passwordchoice = input('random or your own [random]/[own]: ')
  20. if passwordchoice == 'random':
  21. return creation.random_password()
  22. elif passwordchoice == 'own':
  23. return creation.make_my_own()
  24. else:
  25. print('invalid choice')
  26.  
  27. password = choice()
  28.  
  29. def brute():
  30. guessing = ' '
  31. addchar = 'a'
  32. position_char = 0
  33. position_guessing = 0
  34. while guessing != password:
  35. while position_char != len(char):
  36. guessing = guessing.replace(guessing[position_guessing],addchar)
  37. position_char += 1
  38. try:
  39. addchar = char[position_char]
  40. except:
  41. print('i breaked') #test
  42. break
  43. print(guessing,addchar,position_char) #test
  44. guessing += ' '
  45. position_guessing = position_guessing + 1
  46. print(position_guessing) #test
  47. position_char = 0
  48. #position_guessing = 0
  49. addchar = 'a'
  50. print('do i loop') #test
  51. Brute()
Add Comment
Please, Sign In to add comment