Created
May 4, 2019 11:02
-
-
Save harieamjari/56cca2d2c7ba8ecdf3b23b3ed2b456e5 to your computer and use it in GitHub Desktop.
A python script that tries to crack hash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
import string | |
import sys | |
hash_name = 'd5787cd36cdf96b5ff9edcfb2461e092a9cbe6e0e15474464346950a5c6b5616' | |
# random_list = ['a', 'b', 'c', 'd'] | |
random_list = list(string.ascii_lowercase) | |
length = len(random_list) | |
lens = 0 | |
print("\nSHA-256") | |
while lens < length: | |
print("\n", lens, random_list[lens]) | |
for i in random_list: | |
word = random_list[lens] + i | |
hash = hashlib.sha256(word.encode('utf-8')).hexdigest() | |
if hash == hash_name: | |
print(word, '--> match found! ', hash) | |
sys.exit() | |
else: | |
print(word, '--> no match') | |
lens += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment