Skip to content

Commit

Permalink
Create DictionaryAttacks.py
Browse files Browse the repository at this point in the history
  • Loading branch information
celalaygar authored Feb 22, 2024
1 parent 37fbd08 commit 68cbe2a
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Hacking-13-Dictionary-Attacks/DictionaryAttacks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import hashlib
print("# # # # # # Password Hacking # # # # # #")

password_found = 0

inputinput_hashed = input(" Please enter the hashed password: ")

password_document = input(" \n Please enter the passwords file name including its path (root / home/): ")

try:
password_file = open(password_document, 'r')
except:
print("Error: ")
print(password_document, "is not found.\n Please enter the path of file correctly.")
quit()

for word in password_file:
encoding_word = word.encode('utf-8')
hashed_word = hashlib.md5(encoding_word.strip())
digesting = hashed_word.hexdigest()

if digesting == input_hashed:
print ("Password found.\n The required password is: ", word)
password_found = 1
break

if not password_found:
print(" The password is not found in the ", password_document, "file")
print('\n')
print(" # # # # # # Thank you # # # # # # ")

0 comments on commit 68cbe2a

Please sign in to comment.