I'm using pycryptodome library to do hashing. I tried SHA using pycryptodome.
from Crypto.Hash import SHA256
mess = b'hello'
h = SHA256.new(mess)
print(h.hexdigest())
This is the code I'm using but is giving me errors.
Traceback (most recent call last):
File "/Users/thekc/PycharmProjects/MS_CS/Misc/ANS/roughwork.py", line 4, in <module>
h = SHA256.new(mess)
File "/Users/thekc/PycharmProjects/MS_CS/venv/lib/python3.9/site-packages/Crypto/Hash/SHA256.py", line 158, in new
return SHA256Hash().new(data)
File "/Users/thekc/PycharmProjects/MS_CS/venv/lib/python3.9/site-packages/Crypto/Hash/SHA256.py", line 73, in __init__
result = _raw_sha256_lib.SHA256_init(state.address_of())
File "/Users/thekc/PycharmProjects/MS_CS/venv/lib/python3.9/site-packages/cffi/api.py", line 912, in __getattr__
make_accessor(name)
File "/Users/thekc/PycharmProjects/MS_CS/venv/lib/python3.9/site-packages/cffi/api.py", line 908, in make_accessor
accessors[name](name)
File "/Users/thekc/PycharmProjects/MS_CS/venv/lib/python3.9/site-packages/cffi/api.py", line 838, in accessor_function
value = backendlib.load_function(BType, name)
AttributeError: function/symbol 'SHA256_init' not found in library '/Users/thekc/PycharmProjects/MS_CS/venv/lib/python3.9/site-packages/Crypto/Util/../Hash/_SHA256.cpython-39-darwin.so': dlsym(0x88adddf0, SHA256_init): symbol not found
Process finished with exit code 1