Skip to content

Commit

Permalink
Update genter.py
Browse files Browse the repository at this point in the history
  • Loading branch information
therealOri authored Nov 7, 2023
1 parent df4c463 commit e4e08a4
Showing 1 changed file with 7 additions and 32 deletions.
39 changes: 7 additions & 32 deletions genter.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,6 @@ def str_hash(password, salt):
return None


if hash_lst[2] in hash_type:
password = bytes(password, 'utf-8')
if len(password) > 72:
pass_len = len(password)
return 404, pass_len

for byte in password:
if byte == 0:
pass_len = len(password)
return 404, pass_len


pass_salt = bytes(salt, 'utf-8')
if len(pass_salt) > 16:
salt_len = len(pass_salt)
return 404_2, salt_len



if hash_lst[0] in hash_type:
clear()
password = bytes(password, 'utf-8')
Expand All @@ -112,6 +93,7 @@ def str_hash(password, salt):
return result1[0], result1[1], hash_type



if hash_lst[1] in hash_type:
clear()
password = bytes(password, 'utf-8')
Expand All @@ -124,6 +106,7 @@ def str_hash(password, salt):
return result1[0], result1[1], hash_type



if hash_lst[2] in hash_type:
clear()
password = bytes(password, 'utf-8')
Expand All @@ -137,6 +120,7 @@ def str_hash(password, salt):




# config.json file loading.
def j_load():
if os.path.isfile('config.json'):
Expand Down Expand Up @@ -667,19 +651,10 @@ def main():
clear()
continue

if final_hash[0] == 404:
input(f'Unable to generate hash as lengh of "pword" is "{final_hash[1]}" and is more than 72 bytes long.\n\nPress "enter" to continue...')
clear()
continue
if final_hash[0] == 404_2:
input(f'Unable to generate hash as lengh of "salt" is "{final_hash[1]}" and is more than 16 bytes long.\n\nPress "enter" to continue...')
clear()
continue
else:
# "final_hash[2]" is name of hash that was used. "[1]" is the salt and "[0]" is the actual hash value.
print(f'{final_hash[2]} hash & salt for "{pword}" | Hash: {final_hash[0]} | Salt - {final_hash[1]}\n\n')
input('Press "enter" to continue...')
clear()
# "final_hash[2]" is name of hash that was used. "[1]" is the salt and "[0]" is the actual hash value.
print(f'{final_hash[2]} hash & salt for "{pword}" | Hash: {final_hash[0]} | Salt - {final_hash[1]}\n\n')
input('Press "enter" to continue...')
clear()



Expand Down

0 comments on commit e4e08a4

Please sign in to comment.