Hi guys. I'm new to cryptography. I'm practicing different hash algorithm. IS there any one who can tell me how to write a simple hash function that creates a 32-bit hash of a file?
Thanks.
Thanks.
import BitVector
import io
if __name__ == "__main__":
message = raw_input("your message:")
f = open('file.dat','w')
f.write(message)
f.close()
f = open('file.dat')
while 1:
rr = f.readline(1)
hex = rr.encode("hex")
bits = bin(int(hex, 16))[2:]
print bits
if not rr:break
f.close()
Comment