Guest User

Untitled

a guest
Feb 25th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. import string
  2. from itertools import product
  3.  
  4. # send the password string here to crack
  5. def crack(x):
  6.  
  7. # in real life you wouldn't have a length, but this is so slow idc
  8. for i in range(len(x)+1):
  9. # I love you ittertools! Recursion is not my strong point, ascii only because its slow
  10. possible = product(string.ascii_letters, repeat=i)
  11. # start checking 1 at a time
  12. for i in possible:
  13. # product return tuples change them to strings
  14. if ''.join(i) == x:
  15. # show the password and exit the function
  16. print(''.join(i), 'was the password')
  17. return
  18. # if not found tell them you're done at least
  19. print('password not found')
  20.  
  21. crack('pw')
Add Comment
Please, Sign In to add comment