Plutus icon indicating copy to clipboard operation
Plutus copied to clipboard

Unsupported hash type ripemd160 with hashlib in Python

Open ghost opened this issue 1 year ago • 6 comments

Dear Friends Hi Please help me

`reading database files... DONE database size: 23180116 processes spawned: 12 Process Process-1: Traceback (most recent call last): File "/usr/lib/python3.10/hashlib.py", line 160, in __hash_new return _hashlib.new(name, data, **kwargs) ValueError: [digital envelope routines] unsupported

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/root/plutus/plutus.py", line 66, in main address = public_key_to_address(public_key) File "/root/plutus/plutus.py", line 31, in public_key_to_address var = hashlib.new('ripemd160') File "/usr/lib/python3.10/hashlib.py", line 166, in __hash_new return __get_builtin_constructor(name)(data) File "/usr/lib/python3.10/hashlib.py", line 123, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type ripemd160 Process Process-2: Traceback (most recent call last): File "/usr/lib/python3.10/hashlib.py", line 160, in __hash_new return _hashlib.new(name, data, **kwargs) ValueError: [digital envelope routines] unsupported

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/root/plutus/plutus.py", line 66, in main address = public_key_to_address(public_key) File "/root/plutus/plutus.py", line 31, in public_key_to_address var = hashlib.new('ripemd160') File "/usr/lib/python3.10/hashlib.py", line 166, in __hash_new return __get_builtin_constructor(name)(data) File "/usr/lib/python3.10/hashlib.py", line 123, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type ripemd160 Process Process-3: Traceback (most recent call last): File "/usr/lib/python3.10/hashlib.py", line 160, in __hash_new return _hashlib.new(name, data, **kwargs) ValueError: [digital envelope routines] unsupported

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/root/plutus/plutus.py", line 66, in main address = public_key_to_address(public_key) File "/root/plutus/plutus.py", line 31, in public_key_to_address var = hashlib.new('ripemd160') File "/usr/lib/python3.10/hashlib.py", line 166, in __hash_new return __get_builtin_constructor(name)(data) File "/usr/lib/python3.10/hashlib.py", line 123, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type ripemd160 Process Process-4: Traceback (most recent call last): File "/usr/lib/python3.10/hashlib.py", line 160, in __hash_new return _hashlib.new(name, data, **kwargs) ValueError: [digital envelope routines] unsupported

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/root/plutus/plutus.py", line 66, in main address = public_key_to_address(public_key) File "/root/plutus/plutus.py", line 31, in public_key_to_address var = hashlib.new('ripemd160') File "/usr/lib/python3.10/hashlib.py", line 166, in __hash_new return __get_builtin_constructor(name)(data) File "/usr/lib/python3.10/hashlib.py", line 123, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type ripemd160 Process Process-5: Traceback (most recent call last): File "/usr/lib/python3.10/hashlib.py", line 160, in __hash_new return _hashlib.new(name, data, **kwargs) ValueError: [digital envelope routines] unsupported

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/root/plutus/plutus.py", line 66, in main address = public_key_to_address(public_key) File "/root/plutus/plutus.py", line 31, in public_key_to_address var = hashlib.new('ripemd160') File "/usr/lib/python3.10/hashlib.py", line 166, in __hash_new return __get_builtin_constructor(name)(data) File "/usr/lib/python3.10/hashlib.py", line 123, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type ripemd160 Process Process-6: Traceback (most recent call last): File "/usr/lib/python3.10/hashlib.py", line 160, in __hash_new return _hashlib.new(name, data, **kwargs) ValueError: [digital envelope routines] unsupported

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/root/plutus/plutus.py", line 66, in main address = public_key_to_address(public_key) File "/root/plutus/plutus.py", line 31, in public_key_to_address var = hashlib.new('ripemd160') File "/usr/lib/python3.10/hashlib.py", line 166, in __hash_new return __get_builtin_constructor(name)(data) File "/usr/lib/python3.10/hashlib.py", line 123, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type ripemd160 Process Process-7: Traceback (most recent call last): File "/usr/lib/python3.10/hashlib.py", line 160, in __hash_new return _hashlib.new(name, data, **kwargs) ValueError: [digital envelope routines] unsupported

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/root/plutus/plutus.py", line 66, in main address = public_key_to_address(public_key) File "/root/plutus/plutus.py", line 31, in public_key_to_address var = hashlib.new('ripemd160') File "/usr/lib/python3.10/hashlib.py", line 166, in __hash_new return __get_builtin_constructor(name)(data) File "/usr/lib/python3.10/hashlib.py", line 123, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type ripemd160 Process Process-8: Traceback (most recent call last): File "/usr/lib/python3.10/hashlib.py", line 160, in __hash_new return _hashlib.new(name, data, **kwargs) ValueError: [digital envelope routines] unsupported

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/root/plutus/plutus.py", line 66, in main address = public_key_to_address(public_key) File "/root/plutus/plutus.py", line 31, in public_key_to_address var = hashlib.new('ripemd160') File "/usr/lib/python3.10/hashlib.py", line 166, in __hash_new return __get_builtin_constructor(name)(data) File "/usr/lib/python3.10/hashlib.py", line 123, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type ripemd160 Process Process-9: Traceback (most recent call last): File "/usr/lib/python3.10/hashlib.py", line 160, in __hash_new return _hashlib.new(name, data, **kwargs) ValueError: [digital envelope routines] unsupported

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/root/plutus/plutus.py", line 66, in main address = public_key_to_address(public_key) File "/root/plutus/plutus.py", line 31, in public_key_to_address var = hashlib.new('ripemd160') File "/usr/lib/python3.10/hashlib.py", line 166, in __hash_new return __get_builtin_constructor(name)(data) File "/usr/lib/python3.10/hashlib.py", line 123, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type ripemd160 Process Process-10: Traceback (most recent call last): File "/usr/lib/python3.10/hashlib.py", line 160, in __hash_new return _hashlib.new(name, data, **kwargs) ValueError: [digital envelope routines] unsupported

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/root/plutus/plutus.py", line 66, in main address = public_key_to_address(public_key) File "/root/plutus/plutus.py", line 31, in public_key_to_address var = hashlib.new('ripemd160') File "/usr/lib/python3.10/hashlib.py", line 166, in __hash_new return __get_builtin_constructor(name)(data) File "/usr/lib/python3.10/hashlib.py", line 123, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type ripemd160 Process Process-11: Traceback (most recent call last): File "/usr/lib/python3.10/hashlib.py", line 160, in __hash_new return _hashlib.new(name, data, **kwargs) ValueError: [digital envelope routines] unsupported

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/root/plutus/plutus.py", line 66, in main address = public_key_to_address(public_key) File "/root/plutus/plutus.py", line 31, in public_key_to_address var = hashlib.new('ripemd160') File "/usr/lib/python3.10/hashlib.py", line 166, in __hash_new return __get_builtin_constructor(name)(data) File "/usr/lib/python3.10/hashlib.py", line 123, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type ripemd160 Process Process-12: Traceback (most recent call last): File "/usr/lib/python3.10/hashlib.py", line 160, in __hash_new return _hashlib.new(name, data, **kwargs) ValueError: [digital envelope routines] unsupported

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/root/plutus/plutus.py", line 66, in main address = public_key_to_address(public_key) File "/root/plutus/plutus.py", line 31, in public_key_to_address var = hashlib.new('ripemd160') File "/usr/lib/python3.10/hashlib.py", line 166, in __hash_new return __get_builtin_constructor(name)(data) File "/usr/lib/python3.10/hashlib.py", line 123, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type ripemd160`

ghost avatar Dec 28 '22 08:12 ghost

ValueError: unsupported hash type ripemd160

check your openssl version if its still supported

jkunzetop avatar Dec 28 '22 10:12 jkunzetop

Thanks for replay how to fix it?

ghost avatar Dec 28 '22 13:12 ghost

You can google the error message to find a solution. You have to do some configurations for openssl.

Follow the steps at https://stackoverflow.com/a/72508879 and it should work

Isaacdelly avatar Dec 31 '22 03:12 Isaacdelly

Hi Isaacdelly. I am having the same error as above. I have tried the fix you suggested but it does not work for me. I did the configuration but it did not work. I went further and tried Paramiko to replace Openssl encryption but that also did not work. I even tried to add Ripemd160 as a 3rd party protocol in Openssl The problem I picked up is that Openssl updated in November to version 3.0.7 and ripemd160 was put in it as a legacy protocol, it's included in the upgrade but Openssl does not call it when needed, a problem with the Openssl package, and the are not really giving attention to fixing it.

So, I see 1 of 2 fixes for this to continue working. 1 Rollback my Openssl from 3.0.7 to 1.1.1 to make it compatible with your code and hope for the best. 2. You change the code to include Openssl3 in it as it is the newest version.

Please let me know witch route to take.

Did some further investigation, got it to run successfully.

My method:

https://stackoverflow.com/a/72508879 fixes the problem, just remember when you edit the openssl.cnf file that you must remove the # from [default_sect] activate = 1

[legacy_sect] activate = 1

Otherwise the packages wont work.

Apparently according to Openssl the "bug" was fixed with release 3.0.7. So, if you can upgrade to 3.0.7 do it otherwise use this fix to solve the error.

BTW im running Windows 10 with an Ubuntu 18.04 sub interface on a virtual machine. Thats for the Windows gurus who are battling to get it working on a pure Windows environment. Took me 15 days of battling on pure Windows an couldn't get it to work and decided to install Ubuntu subsystem. Thanks Isaacdelly, gave me a bit of a chalenge and stimulated my mind a bit again.

Sakkie123456 avatar Jan 04 '23 07:01 Sakkie123456

Did not work for me

  • Installed OpenSSL 3.0.7
  • configured penssl_conf = openssl_init

[openssl_init] providers = provider_sect

[provider_sect] default = default_sect legacy = legacy_sect

[default_sect] activate = 1

[legacy_sect] activate = 1

(without the hash)

still not working

ValueError Base 16

So I think I have to install Ubuntu?

Nasdorove avatar Jan 28 '23 10:01 Nasdorove

Core issue is OpenSSL I tried 3.0.2; 3.0.7 and 3.1.0 beta neither worked. Re-installed Ubuntu terminal 20.04.5 LTS and left OpenSSL ver 1.1.1 on it. And then it worked. (Learned a bunch about Linux in process, that I did not want to learn)

konigsberg9 avatar Feb 15 '23 00:02 konigsberg9