Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2019
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. import hashlib
  2.  
  3.  
  4. #our list of bad passwords
  5. bad=["password", "passw0rd","password1", "mypassword","qwerty", "welcome",
  6. "abcdefg", "admin", "login", "starwars", "batman", "superman",
  7. "00000", "11111", "22222", "33333", "44444", "55555", "66666",
  8. "77777", "88888", "99999", "1234567890", "12345", "123456", "2468",
  9. "1234", "princess", "cheese", "pizza", "porsche", "guitar", "piano",
  10. "cats", "dogs", "birds", "monkeys", "baseball", "soccer", "football",
  11. "basketball", "tennis", "fishing"]
  12.  
  13. #returns the sha224 hash of the input
  14. def getHash(text):
  15. return hashlib.sha224(text.encode()).hexdigest()
  16.  
  17. #make our dictionary of passwords
  18. def makeDictionary():
  19. dictionary = {}
  20. for password in bad:
  21. dictionary[getHash(password)] = password
  22. return dictionary
  23.  
  24.  
  25. #main
  26. while True :
  27. passwords = makeDictionary()
  28. word = input("Enter a hashed password to crack: ")
  29. if word in passwords.keys():
  30. print("The password is: "+ passwords[word])
  31. else:
  32. print("Couldn't crack password")
  33.  
  34.  
  35. Mary: '4fc07c8146ff8d20695edb3d980fab332183eb02af267d5d68de188d'
  36. Sahil: '02578d6a87eb6007f862ef2fa154022594aa876d5c6aa3a0a61b2b67'
  37. David: '5dd08b23e498e17e60a14d475e1278f02b0a5d66d62018a650e8ed60'
  38. Natalia: 'aa621a8486dc2000fa8e6502cc5dee7c719dda2659c13201e864c021'
  39. Nick: '489854666b057109a51aa1ad9f7c5dae26f10d4f36f9849ddf98a7eb'
  40. Hudi: '9b1cdbab8c8410d63ca8700b12d03b9f0bf93d33b793653cc0983ef3'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement