summaryrefslogtreecommitdiff
path: root/crack_hash.py
diff options
context:
space:
mode:
authorjerome <jerome@xlinfo.fr>2025-10-12 17:41:22 +0200
committerjerome <jerome@xlinfo.fr>2025-10-12 17:41:22 +0200
commitba41fa46e69dbb264dfbed1b9fca5daab44a07c7 (patch)
treed9c6eeee3a32b0d5a004f2846882868c29ba531c /crack_hash.py
parentec7b5913698416b775665a871a0d4102b47c680c (diff)
downloadpython-ba41fa46e69dbb264dfbed1b9fca5daab44a07c7.tar.gz
python-ba41fa46e69dbb264dfbed1b9fca5daab44a07c7.zip
organisation
Diffstat (limited to 'crack_hash.py')
-rw-r--r--crack_hash.py33
1 files changed, 0 insertions, 33 deletions
diff --git a/crack_hash.py b/crack_hash.py
deleted file mode 100644
index b51cec7..0000000
--- a/crack_hash.py
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env python
-"""crack_hash module"""
-import sys
-import hashlib
-import argparse
-
-
-
-def crack_hash(hashlist, wordlist, hashsum):
- """
- Args:
- hashlist la liste de hashes à trouver
- wordlist: le dictionnaire
- hashsum: la somme de controle : md5,sha256 ou sha512
- """
- with open(hashlist,"r") as fichier1:
- hashes=fichier1.readlines()
- for hash in hashes:
- with open(wordlist, "r") as fichier2:
- lignes = fichier2.readlines()
- for ligne in lignes:
- if getattr(hashlib,hashsum)(ligne.strip().encode()).hexdigest() == hash.strip():
- print(f"trouvé: {ligne.strip()}")
- break
-
-if __name__ == "__main__":
- parser = argparse.ArgumentParser()
- parser.add_argument('hashlist', help='La liste de hash à trouver')
- parser.add_argument('wordlist', help='Le dictionnaire choisi')
- parser.add_argument('hashsum', help='la somme de contrôle : md5,sha256 ou sha512')
- parser.parse_args()
- crack_hash(sys.argv[1], sys.argv[2], sys.argv[3])
-