Skip to content

Commit

Permalink
v2.4 add sha512
Browse files Browse the repository at this point in the history
  • Loading branch information
proplayer919 committed Mar 30, 2024
1 parent 2a82ff4 commit 71da662
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ Hashcrack is a simple, fast, and free hash bruteforcer for all different hashing
- SHA256
- SHA1
- BCRYPT
- SHA512

## Usage

`<program> [-c or --crack] <hash> [-a or --algorithm] <hash algorithm> [-si or --show-info]`
'-c / --crack' - Crack hash
'-a / --algorithm' - Hash algorithm (sha256, md5, sha1, bcrypt)
'-a / --algorithm' - Hash algorithm (sha256, md5, sha1, bcrypt, sha512)
'-si / --show-info' - Show current information (dynamically updating - slows down a lot)\n
`<program> [-h or --hash] <text to hash> [-a or --algorithm] <hash algorithm>`
'-h / --hash' - Hash text
'-a / --algorithm' - Hash algorithm (sha256, md5, sha1, bcrypt)
'-a / --algorithm' - Hash algorithm (sha256, md5, sha1, bcrypt, sha512)
11 changes: 7 additions & 4 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from colorama import Style
import bcrypt

title_text = "HASHCRACK v2.3"
title_text = "HASHCRACK v2.4"

args = sys.argv

Expand All @@ -33,6 +33,9 @@ def calculate_hash_sha1(text):
def calculate_hash_bcrypt(text):
return bcrypt.hashpw(text.encode(), bcrypt.gensalt()).hex()

def calculate_hash_sha512(text):
return hashlib.sha512(text.encode()).hexdigest()


def print_to_screen(text):
sys.stdout.write("\033[H\033[J")
Expand Down Expand Up @@ -87,7 +90,7 @@ def batch_worker():
current_try_hashed = hasher(current_try)

if print_current:
print_to_screen(combine_strings(title_text + "\n", "Cracking hash: " + hash_value, "Currently trying: " + current_try, "Currently trying (hashed): " + current_try_hashed, "Time elapsed: " + str(round(time() - start_time, 2)) + " seconds", "Attempts: " + str(attempts), "Speed: " + str(round(attempts / round(time() - start_time + 0.1, 2))) + " hashes / second"))
print_to_screen(combine_strings(title_text + "\n", "Cracking hash: " + hash_value, "Currently trying: " + current_try, "Currently trying (hashed): " + current_try_hashed, "Time elapsed: " + str(round(time() - start_time, 2)) + " seconds", "Attempts: " + str(attempts), "Speed: " + str(round(attempts / round(time() - start_time + 0.1, 2))) + " hashes / second", "Hash algorithm: " + hash_algorithm))

if hash_value == current_try_hashed:
cracked = current_try
Expand All @@ -112,7 +115,7 @@ def batch_worker():
if result is not None:
cracked = result

print_to_screen(combine_strings(title_text + "\n", "Cracked hash: " + hash_value, "Cracked: " + cracked, "Time elapsed: " + str(round(time() - start_time, 3)) + " seconds", "Attempts: " + str(attempts), "Speed: " + str(round(attempts / (time() - start_time + 0.1), 2)) + " hashes / second"))
print_to_screen(combine_strings(title_text + "\n", "Cracked hash: " + hash_value, "Cracked: " + cracked, "Time elapsed: " + str(round(time() - start_time, 3)) + " seconds", "Attempts: " + str(attempts), "Speed: " + str(round(attempts / (time() - start_time + 0.1), 2)) + " hashes / second", "Hash algorithm: " + hash_algorithm))
except Exception as e:
print_to_screen(f"Error: {str(e)}")

Expand Down Expand Up @@ -155,4 +158,4 @@ def batch_worker():
elif mode == "h":
print_to_screen(combine_strings(title_text + "\n", "Text to hash: " + hash_text, "Hash: " + globals().get("calculate_hash_" + hash_algorithm, calculate_hash_sha256)(hash_text), "Hash algorithm: " + hash_algorithm + "\n"))
else:
print_to_screen(combine_strings(title_text + " Usage\n", "<program> [-c or --crack] <hash> [-a or --algorithm] <hash algorithm> [-si or --show-info]", "'-c / --crack' - Crack hash", "'-a / --algorithm' - Hash algorithm (sha256, md5, sha1, bcrypt)", "'-si / --show-info' - Show current information (dynamically updating - slows down a lot)\n", "<program> [-h or --hash] <text to hash> [-a or --algorithm] <hash algorithm>", "'-h / --hash' - Hash text", "'-a / --algorithm' - Hash algorithm (sha256, md5, sha1, bcrypt)"))
print_to_screen(combine_strings(title_text + " Usage\n", "<program> [-c or --crack] <hash> [-a or --algorithm] <hash algorithm> [-si or --show-info]", "'-c / --crack' - Crack hash", "'-a / --algorithm' - Hash algorithm (sha256, md5, sha1, bcrypt, sha512)", "'-si / --show-info' - Show current information (dynamically updating - slows down a lot)\n", "<program> [-h or --hash] <text to hash> [-a or --algorithm] <hash algorithm>", "'-h / --hash' - Hash text", "'-a / --algorithm' - Hash algorithm (sha256, md5, sha1, bcrypt, sha512)"))

0 comments on commit 71da662

Please sign in to comment.