I need to use the cryptography library to get the MD5 from a file, here's whats I have:
from cryptography.hazmat.primitives import hashes
archivos = input()
with open(archivos, "rb") as f:
bfile = f.read()
print(bfile)
readable_hash = hashes.Hash(hashes.MD5())
readable_hash.update(bfile)
readable_hash.finalize()
print(readable_hash)
When I print bfile i get this, and that's what I need to hash to MD5:
b'RGBX\x01\x00\x00\x00X\x00b\x00o\x00x\x00G\x00a\x00m\x00e\x00s\x00\x00\x00'
and when I try to print readable_hash that supose it contains the MD5, I just get this:
<cryptography.hazmat.primitives.hashes.Hash object at 0x000001EE89A17F10>