Bindings for whirlpool hash reference implementation.
Project description
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file whirlpool-1.1.0.tar.gz.
File metadata
- Download URL: whirlpool-1.1.0.tar.gz
- Upload date:
- Size: 39.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a48d931b0725467afc88c027e4e712e106bc6cd2aa636151cfe72975a7832826
|
|
| MD5 |
4b6402b563665ff81fe9eaab3ad26901
|
|
| BLAKE2b-256 |
a57b2209ff235df8ad2aa1ab171a072830828877ea97e64d388c6c2ed07a169c
|
Provenance
The following attestation bundles were made for whirlpool-1.1.0.tar.gz:
Publisher:
ci.yml on oohlaf/python-whirlpool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
whirlpool-1.1.0.tar.gz -
Subject digest:
a48d931b0725467afc88c027e4e712e106bc6cd2aa636151cfe72975a7832826 - Sigstore transparency entry: 1995768111
- Sigstore integration time:
-
Permalink:
oohlaf/python-whirlpool@41f97c86898c59a7995e23c9d89579ea644ac292 -
Branch / Tag:
refs/tags/v1.1.1 - Owner: https://github.com/oohlaf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@41f97c86898c59a7995e23c9d89579ea644ac292 -
Trigger Event:
push
-
Statement type:
File details
Details for the file whirlpool-1.1.0-cp312-cp312-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl.
File metadata
- Download URL: whirlpool-1.1.0-cp312-cp312-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl
- Upload date:
- Size: 76.0 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81e2ff4a51cc94e1ad1b1514128957459dde69fa515f334bc8e63ce05019cba8
|
|
| MD5 |
abade15159177af8902a24c44694ee48
|
|
| BLAKE2b-256 |
6d5e29484c103d7fc582b13af95a0d44eeb258a420d93a26dee812e001008043
|
Provenance
The following attestation bundles were made for whirlpool-1.1.0-cp312-cp312-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl:
Publisher:
ci.yml on oohlaf/python-whirlpool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
whirlpool-1.1.0-cp312-cp312-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl -
Subject digest:
81e2ff4a51cc94e1ad1b1514128957459dde69fa515f334bc8e63ce05019cba8 - Sigstore transparency entry: 1995768161
- Sigstore integration time:
-
Permalink:
oohlaf/python-whirlpool@41f97c86898c59a7995e23c9d89579ea644ac292 -
Branch / Tag:
refs/tags/v1.1.1 - Owner: https://github.com/oohlaf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@41f97c86898c59a7995e23c9d89579ea644ac292 -
Trigger Event:
push
-
Statement type: