Advertisement
Guest User

Untitled

a guest
Aug 20th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. #!/usr/local/bin/python3
  2.  
  3. from string import ascii_lowercase
  4. from itertools import product
  5.  
  6. tab = " azertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN0123456789_$&#@"
  7. password = "souris"
  8. login = input("Give me an interesting input\n")
  9. nblog = len(login)
  10. nbpass = len(password)
  11. sum = 1
  12. n = min(nblog, nbpass)
  13. charset = 'azertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN0123456789_$&#@'
  14. def solve_password(password, maxrange):
  15. for i in range(maxrange):
  16. for attempt in product(charset, repeat=i):
  17. #print("index1 : ", tab.index(complete_list[i]))
  18. index1=tab.index(attempt[i]) + 10
  19. #print("index2 : ", tab.index(password[i]))
  20. index2=tab.index(password[i]) + 10
  21. sum=sum+(index1*n*(i+1))*(index2*(i+1)*(i+1))
  22. print("sum : ", sum)
  23. if sum == 3696619 :
  24. print("Password trouve : ", attempt)
  25.  
  26. solved = solve_password(login, n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement