Skip to main content

Whirlpool: Bindings for whirlpool hash reference implementation.

Project description


Travis CI Build Status AppVeyor Build Status License: Unlicense

The Whirlpool algorithm is designed by Vincent Rijmen and Paulo S.L.M. Barreto. It is a secure and modern digest function that has been recommended by the NESSIE project and adopted in the ISO/IEC 10118-3 international standard.

Digest functions, also known as hash functions, produce fixed-length output (a digest or hash) from a variable-length message. They are designed to be a one-way function.

This library is a Python wrapper around the Whirlpool C reference implementation. The Whirlpool reference implementations are public domain, as is this code.

The first version of the wrapper was written by James Cleveland with help from #python on

Later on the wrapper was rewritten by Olaf Conradi to use the hashlib interface and he made the library compatible with Python 3.


This library is available on PyPI.

pip install whirlpool


This is the same interface as provided by the other digest algorithms in Python’s hashlib.

import whirlpool

wp ="My String")
hashed_string = wp.hexdigest()

wp.update("My Salt")
hashed_string = wp.hexdigest()

Starting with Python 3 text strings (as shown above) are stored as unicode. You need to specify the encoding of these strings before hashing.

wp ='utf-8'))

Strings that are marked as binary do not need encoding.


The source code is available on GitHub.

git clone
cd python-whirlpool

Install in development mode using:

python develop

Or install in editable mode using pip:

pip install -e .


This module is tested using Python 2.7, PyPy, and Python 3.3 and up.

You can run the test suite using

python test

Whirlpool Changelog

All notable changes to this project will be documented in this file. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

1.0.0 (2018-02-19)


  • Port to Python 3.

  • Added PyPy support. PyPy3 does not work due to functions that have not yet been ported (like missing PyUnicode_New).

  • Added Continuous Integration using Travis CI and AppVeyor.

  • Added automatic upload to PyPI for successful build tags. Proper vX.Y.Z style tags upload to production PyPI, any other build (including .devX appended) upload to Test PyPI.


  • Fix struct function declaration prototype warnings.

  • Fix pointer warnings.



  • Removed the old deprecated hash() interface.

0.3 (2013-01-23)


  • Added the same interface as other Python digest algorithms have (like the default hashlib module).


  • Created proper unit tests.


  • The hash() function is deprecated. Please transition to the hashlib interface and use new() and hexdigest().

0.2 (unreleased)

  • This release was skipped.

0.1 (2011-05-18)


  • Initial commit by James Cleveland.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Whirlpool-1.0.0.tar.gz (41.9 kB view hashes)

Uploaded source

Built Distributions

Whirlpool-1.0.0-cp36-cp36m-win_amd64.whl (51.8 kB view hashes)

Uploaded cp36

Whirlpool-1.0.0-cp36-cp36m-win32.whl (52.3 kB view hashes)

Uploaded cp36

Whirlpool-1.0.0-cp35-cp35m-win_amd64.whl (51.8 kB view hashes)

Uploaded cp35

Whirlpool-1.0.0-cp35-cp35m-win32.whl (52.3 kB view hashes)

Uploaded cp35

Whirlpool-1.0.0-cp34-cp34m-win_amd64.whl (50.1 kB view hashes)

Uploaded cp34

Whirlpool-1.0.0-cp34-cp34m-win32.whl (51.3 kB view hashes)

Uploaded cp34

Whirlpool-1.0.0-cp33-cp33m-win_amd64.whl (50.1 kB view hashes)

Uploaded cp33

Whirlpool-1.0.0-cp33-cp33m-win32.whl (51.3 kB view hashes)

Uploaded cp33

Whirlpool-1.0.0-cp27-cp27m-win_amd64.whl (54.0 kB view hashes)

Uploaded cp27

Whirlpool-1.0.0-cp27-cp27m-win32.whl (55.3 kB view hashes)

Uploaded cp27

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page