You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm posting this issue in order to help anyone who comes across this problem.
If you try to use the code: hashlib.new('ripemd160', thingtobehashed).digest()
and you receive this error: ValueError: unsupported hash type ripemd160
It is because Hashlib uses openssl under the hood, and openssl has recently decided to depreciate support for the ripemd160 algorithm. See the relevant issues below:
There may be some way to re-enable support for ripemd160 under the hood, but I think an easier solution is to just copy/paste the pure python implementation of ripemd160 and use that instead. See the link below (code courtesy of the legend Pieter Wuille):
If you would like, I can submit a PR that adds this file to the chapters and updates the existing hash160 function (with notes explaining the issue). But maybe there's a cleaner way to fix this, I don't know.
The text was updated successfully, but these errors were encountered:
cmdruid
changed the title
Openssl removed ripemd160 support. Any code using hashlib's 'ripemd160' will fail.
Openssl removed ripemd160 support. Code using hashlib's 'ripemd160' algorithm may fail.
Sep 4, 2022
I'm posting this issue in order to help anyone who comes across this problem.
If you try to use the code:
hashlib.new('ripemd160', thingtobehashed).digest()
and you receive this error:
ValueError: unsupported hash type ripemd160
It is because Hashlib uses openssl under the hood, and openssl has recently decided to depreciate support for the ripemd160 algorithm. See the relevant issues below:
openssl/openssl#16994
bitcoin/bitcoin#23710
There may be some way to re-enable support for ripemd160 under the hood, but I think an easier solution is to just copy/paste the pure python implementation of ripemd160 and use that instead. See the link below (code courtesy of the legend Pieter Wuille):
https://github.com/bitcoin/bitcoin/blob/master/test/functional/test_framework/ripemd160.py
If you would like, I can submit a PR that adds this file to the chapters and updates the existing hash160 function (with notes explaining the issue). But maybe there's a cleaner way to fix this, I don't know.
The text was updated successfully, but these errors were encountered: