Guest User

Untitled

a guest
Nov 18th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. def passwordCombination(password, charset):
  2. print('Cracking password using cartesian product')
  3. cProduct = itertools.product(charSet, repeat= len(password))
  4. attempts = 0
  5.  
  6. for i in cProduct:
  7. attempts += 1
  8. i = ''.join(i)
  9.  
  10. if(i == password):
  11. print('Found password after attempts : ' + str(attempts) + ', password : ' + str(i))
  12. return
  13. else:
  14. print("Could not crack password")
  15.  
  16. pass = 'frans'
  17.  
  18. passwordCombination(pass, charSet)
Add Comment
Please, Sign In to add comment