Created
April 5, 2013 17:21
-
-
Save nsa-yoda/5321031 to your computer and use it in GitHub Desktop.
Rudimentary Python based MD5 cracker up to a value of 99,999,999 only ints.
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
# Takes a user input, hashes it with MD5 crypt, and attempts to match it via brute force | |
import hashlib, time | |
md = hashlib.md5() | |
print("Welcome to a brute force MD5 cracker. \n") | |
password = input("Enter a password, composed of a number up to 99,999,999: ") | |
md.update(str(password).encode("utf-8")) | |
hashed_password = md.hexdigest() | |
print("Attempting to crack it via brute force increment") | |
start_time = time.time() | |
for i in range(99999999): | |
md = hashlib.md5() | |
md.update(str(i).encode("utf-8")) | |
hashed_total_int = md.hexdigest() | |
if hashed_total_int == hashed_password: | |
print("Your password is " + str(i)) | |
break; | |
elapsed_time = time.time() - start_time | |
print("Elapsed time: " + str(elapsed_time) + " seconds") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment