Python: Model hashing operations in cryptography package

This commit is contained in:
Rasmus Wriedt Larsen
2021-03-02 13:54:36 +01:00
parent c5f826580b
commit fa88f22453
2 changed files with 78 additions and 1 deletions

View File

@@ -4,7 +4,7 @@ from binascii import hexlify
hasher = hashes.Hash(hashes.MD5())
hasher.update(b"secret message") # $ MISSING: CryptographicOperation CryptographicOperationInput=b"secret message" CryptographicOperationAlgorithm=MD5
hasher.update(b"secret message") # $ CryptographicOperation CryptographicOperationInput=b"secret message" CryptographicOperationAlgorithm=MD5
digest = hasher.finalize()
print(hexlify(digest).decode('utf-8'))