Use the built-in 'sha' module. This module is expected to be working and is included by default. There is also a pure Python version in pypy/lib which is used if the built-in is disabled, but it is several orders of magnitude slower.