Advertisement
MGakowski

Hash Cracker

Mar 28th, 2023
868
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. import hashlib
  2.  
  3. # Prompt the user to enter an MD5 hash to crack
  4. md5_hash = input("Enter the MD5 hash to crack: ")
  5.  
  6. # Open the word list file
  7. wordlist_file = open("wordlist.txt", "r")
  8.  
  9. # Loop over each word in the file
  10. for word in wordlist_file:
  11.     # Remove the newline character at the end of the word
  12.     word = word.strip()
  13.    
  14.     # Calculate the MD5 hash of the current word
  15.     word_hash = hashlib.md5(word.encode()).hexdigest()
  16.    
  17.     # Check if the calculated hash matches the user's hash
  18.     if word_hash == md5_hash:
  19.         print("Password found: " + word)
  20.         break  # Stop searching the word list
  21.  
  22. # Close the word list file
  23. wordlist_file.close()
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement