-
Notifications
You must be signed in to change notification settings - Fork 1
/
HashIt.py
65 lines (55 loc) · 1.86 KB
/
HashIt.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env python3
## Hash your text with this tool
## GITHUB: https://github.com/Kourva/kozyol
# Imports
import threading
import requests
import time
import sys
# Args
if len(sys.argv) < 2:
print("\033[1;33mUsage: \033[1;37mkozyol.py \033[1;33m--query=\033[1;37mquery \033[1;33m--method=\033[1;37mmethod \033[1;33m--encode=\033[1;37mencoding")
print("\033[1;33mWhere:")
print("\033[1;37m --query :\033[1;32m \"your text\"")
print("\033[1;37m --method :\033[1;32m md5 | sha256 | sha512")
print("\033[1;37m --encode :\033[1;32m hex | base64 | base64url")
print("\n")
sys.exit()
else:
for arg in sys.argv:
if arg.startswith("--query"):
query = arg.split("=")[1]
if arg.startswith("--method"):
method = arg.split("=")[1]
if arg.startswith("--encode"):
encode = arg.split("=")[1]
# Global variable
Progress = True
# Hasjing message
def searching():
global Progress
while True:
for msg in ["\r\033[1;31mHashing * ", "\r\033[1;31mHashing ** ", "\r\033[1;31mHashing ***"]:
sys.stdout.write(msg)
sys.stdout.flush()
time.sleep(0.5)
if not Progress:
print("\r\033[1;33mDone! \n")
break
# Hashing progress
def kozyol(query, method, encode):
response = requests.get(f"https://hashable-api.herokuapp.com/hash?str={query}&method={method}&encoding={encode}")
return response.text
# Main function
def main():
global Progress, Result, query, method, encode
print(f"\033[1;37mmethod -> \033[1;32m{method}\033[1;37m | encoding -> \033[1;32m{encode}")
thread = threading.Thread(target= searching)
thread.start()
Result = kozyol(query, method, encode)
Progress = False
time.sleep(2)
print(f"\033[1;37mResult -> \033[1;32m{Result}")
# Run
if __name__ == '__main__':
main()