fortesp / bitcoinaddress

Bitcoin Wallet Address Generator
https://pypi.org/project/bitcoinaddress/
MIT License
144 stars 51 forks source link

Openssl removed ripemd160 - issues on Ubuntu22 #20

Open MCM-Mike opened 2 years ago

MCM-Mike commented 2 years ago
Type "help", "copyright", "credits" or "license" for more information.
>>> from bitcoinaddress import Wallet
>>> wallet = Wallet()
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 "<stdin>", line 1, in <module>
  File "/home/user/.local/lib/python3.10/site-packages/bitcoinaddress/wallet.py", line 16, in __init__
    self.address = Address.of(self.key)
  File "/home/user/.local/lib/python3.10/site-packages/bitcoinaddress/address.py", line 88, in of
    address.generate()
  File "/home/user/.local/lib/python3.10/site-packages/bitcoinaddress/address.py", line 94, in generate
    self.mainnet.generate_publicaddress1()
  File "/home/user/.local/lib/python3.10/site-packages/bitcoinaddress/address.py", line 38, in generate_publicaddress1
    self.pubaddr1 = self.instance._generate_publicaddress1(Address.MainNet.PREFIX_A,
  File "/home/user/.local/lib/python3.10/site-packages/bitcoinaddress/address.py", line 107, in _generate_publicaddress1
    m = prefix_a + hash160(p).digest()
  File "/home/user/.local/lib/python3.10/site-packages/bitcoinaddress/util.py", line 20, in hash160
    return ripemd(hashlib.sha256(v).digest())
  File "/home/user/.local/lib/python3.10/site-packages/bitcoinaddress/util.py", line 24, in ripemd
    r = 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**

**Kernel**: 5.15.0-33
Ubuntu 22.04 LTS
**OpenSSL**: OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)
https://www.openssl.org/news/changelog.html

`The low-level MD2, MD4, MD5, MDC2, RIPEMD160 and Whirlpool digest functions have been deprecated.`

I would need some advice here ?
Exohayvan commented 1 year ago

Just spend days trying to find a way around this. Check this out. Worked for me. OpenSSL was under /usr/lib/ssl for me

08DA2BD7-89CA-40D9-BCB7-1ED870989284

dmugtasimov commented 1 year ago

A link https://stackoverflow.com/questions/69922525/python-3-9-8-hashlib-and-ripemd160 for those who do not like retyping from screenshots