Skip to content

andrewpayne68/openssl-fix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 

Repository files navigation

openssl fix for legacy crypto algorithms

Error

Unsupported hash type ripemd160 with hashlib in Python Error:

ValueError: unsupported hash type ripemd160

Hashlib uses OpenSSL for ripemd160 and apparently OpenSSL disabled some older crypto algos around version 3.0 in November 2021. All the functions are still there but require manual enabling. See issue 16994 of OpenSSL github project for details. openssl/openssl#16994

Fix

To quickly enable it, find the directory that holds your OpenSSL config file or a symlink to it, by running the below command:

openssl version -d

You can now go to the directory and edit the config file:

sudo nano openssl.cnf

Make sure that the config file contains following lines:

openssl_conf = openssl_init

[openssl_init]
providers = provider_sect

[provider_sect]
default = default_sect
legacy = legacy_sect

[default_sect]
activate = 1

[legacy_sect]
activate = 1

Tested on: OpenSSL 3.0.2, Python 3.10.4, Linux Ubuntu 22.04 LTS aarch64

About

Unsupported hash type ripemd160 with hashlib in Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published