python-whirlpool
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 irc.freenode.net.
Later on, the wrapper was rewritten by Olaf Conradi to use the hashlib interface and he made the library compatible with Python 3.
Installation
This library is available on PyPI.
pip install whirlpool
Usage
This is the same interface provided by the other digest algorithms in Python's hashlib.
import whirlpool
wp = whirlpool.new("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 = whirlpool.new(data.encoding('utf-8'))
Strings that are marked as binary do not need encoding.
Development
The source code is available on GitHub.
git clone https://github.com/oohlaf/python-whirlpool.git
cd python-whirlpool
Install in development mode using:
pip install -e .
Testing
This module is tested using Python 2.7, PyPy, and Python 3.9 and up.
You can run the test suite locally with:
python -m unittest discover -s test -p 'test_*.py'
For a multi-version local test matrix, you can also use:
tox
Release files for Whirlpool 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| whirlpool-1.1.2.tar.gz | 39.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| whirlpool-1.1.2-cp312-cp312-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.17+ x86-64, Linux glibc 2.5+ x86-64 | Details |
Total release size: 115.8 kB
Release files / whirlpool-1.1.2.tar.gz
| Download URL | whirlpool-1.1.2.tar.gz |
|---|---|
| Size | 39.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
29262e58347060c83209a3a1773b42aa81da38b32e5a700a3755e821c2f9d31b
|
|
BLAKE2b-256 checksum How to use checksums |
aaeb4e3b69a95dfcaba5166f63638456f80a1cf65eef2a0a79a461c2b4f32ae1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 28, 2026.
Transparency logRelease files / whirlpool-1.1.2-cp312-cp312-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl
| Download URL | whirlpool-1.1.2-cp312-cp312-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl |
|---|---|
| Size | 76.0 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
545e09a97c65aa35954588a95c1a7b79b41ea5809df9c82a88f6eb6fe56bcd22
|
|
BLAKE2b-256 checksum How to use checksums |
83068d8d5e20fd0939254b23fd88841c517d508dda736315de9ca9774fa81061
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 28, 2026.
Transparency log