modified: py/hashcracker.py
modified: py/main.py hashcracker update und main.py update für testsmain
parent
3f6efe921b
commit
861a8a3e2d
|
@ -1,5 +1,6 @@
|
|||
import main
|
||||
import string
|
||||
import ast
|
||||
characters = list(string.printable)
|
||||
hash = input("hash? ")
|
||||
hashing = main.hasher()
|
||||
|
@ -11,5 +12,20 @@ print("decoded! "+str(out))
|
|||
print("decoding to bin...")
|
||||
nout = []
|
||||
for i in out:
|
||||
nout.append(hashing.tobin(i))
|
||||
print("decoded! "+str(nout))
|
||||
nout.append(str(hashing.tobin(i)))
|
||||
print("decoded! "+str(nout))
|
||||
print("reversing bin to characters...")
|
||||
out = ""
|
||||
for i in nout:
|
||||
half = int((len(i))/2)
|
||||
if half != 0:
|
||||
i1 = characters[hashing.todec(i[:half])]
|
||||
i2 = characters[hashing.todec(i[half:])]
|
||||
else:
|
||||
i2 = ""
|
||||
i1 = characters[hashing.todec(i)]
|
||||
out = out + i1 + i2
|
||||
print("done.")
|
||||
print(out)
|
||||
#nah, funktioniert nicht
|
||||
|
||||
|
|
18
py/main.py
18
py/main.py
|
@ -49,23 +49,15 @@ class hasher:
|
|||
|
||||
if __name__ == "__main__":
|
||||
hashing = hasher()
|
||||
target = "Hello, World! This is the hashing test string."
|
||||
target = "Hello, World!"
|
||||
"""file = filedialog.askopenfilename()
|
||||
file = open(file, 'r')
|
||||
target = file.read()
|
||||
file.close()"""
|
||||
print("single character hash: "+repr(hashing.ohash(target)))
|
||||
print("string hash: "+repr(hashing.mhash(target)))
|
||||
print("decoding into decimal...")
|
||||
out = []
|
||||
for i in hashing.mhash(target):
|
||||
out.append(characters.index(i))
|
||||
print("decoded! "+str(out))
|
||||
print("decoding to bin...")
|
||||
nout = []
|
||||
for i in out:
|
||||
nout.append(hashing.tobin(i))
|
||||
print("decoded! "+str(nout))
|
||||
|
||||
|
||||
#571213444d2354675632
|
||||
target = "571213444d2354675632"
|
||||
print("single character hash: "+repr(hashing.ohash(target)))
|
||||
print("string hash: "+repr(hashing.mhash(target)))
|
||||
|
||||
|
|
Loading…
Reference in New Issue