Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import string
- from itertools import product
- # send the password string here to crack
- def crack(x):
- # in real life you wouldn't have a length, but this is so slow idc
- for i in range(len(x)+1):
- # I love you ittertools! Recursion is not my strong point, ascii only because its slow
- possible = product(string.ascii_letters, repeat=i)
- # start checking 1 at a time
- for i in possible:
- # product return tuples change them to strings
- if ''.join(i) == x:
- # show the password and exit the function
- print(''.join(i), 'was the password')
- return
- # if not found tell them you're done at least
- print('password not found')
- crack('pw')
Add Comment
Please, Sign In to add comment