pycryptodome icon indicating copy to clipboard operation
pycryptodome copied to clipboard

SHA256 Support for version 3.10.1?

Open PCaff opened this issue 5 years ago • 10 comments

I started getting the following error with the upgrade to 3.10.1:

AttributeError: function/symbol 'SHA256_init' not found in library '/opt/conda/anaconda/lib/python3.6/site-packages/Crypto/Util/../Hash/_SHA256.cpython-36m-x86_64-linux-gnu.so': /opt/conda/anaconda/lib/python3.6/site-packages/Crypto/Util/../Hash/_SHA256.cpython-36m-x86_64-linux-gnu.so: undefined symbol: SHA256_init

Is anyone else getting this? Example code in pycryptodome/Doc/src/hash/sha256.rst will reproduce this error.

PCaff avatar Feb 11 '21 19:02 PCaff

Those .so files are not distributed with the 3.10.1 wheel in pypi. Is it correct that you compiled it on installation?

Legrandin avatar Feb 12 '21 14:02 Legrandin

@Legrandin Yes, all I did was run the pip install.

PCaff avatar Feb 12 '21 14:02 PCaff

Sorry, so you run pip install and the package got compiled? No wheels used?

Legrandin avatar Feb 12 '21 15:02 Legrandin

Yes, that's correct.

PCaff avatar Feb 12 '21 18:02 PCaff

Can you please provide the output of:

 pip uninstall -y pycryptodome
 pip install -v pycryptodome

Legrandin avatar Feb 12 '21 21:02 Legrandin

I am getting the same error, but it works when I use SHA1 instead of 256. I am also trying to sign the data with PKCS1_v1_5 from Crypto.Signature

Anexa85 avatar Feb 28 '21 22:02 Anexa85

This problem still exists in version 3.12.0. EDIT: I think this only happens when both PyCrypto and pycryptodome are installed at the same time. Makes sense that this would cause issues.

Time0o avatar Dec 29 '21 12:12 Time0o

I think this only happens when both PyCrypto and pycryptodome are installed at the same time. Makes sense that this would cause issues.

kindly noted that this answer is correct when i get the same error of AttributeError: function/symbol 'SHA256_init'

CSOTD avatar Jan 30 '22 07:01 CSOTD

so how you guys fix it?

Wdy2433438568 avatar Oct 26 '22 07:10 Wdy2433438568

I solved it by uninstalling pycrypto.

pip3 uninstall pycrypto pip3 install pycryptodome

this should resolve the issue on macOS X

Sureshdussa avatar Jan 16 '23 20:01 Sureshdussa