Skip to main content

Whirlpool: Bindings for whirlpool hash reference implementation.

Project description

python-whirlpool

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 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 as 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:

python setup.py develop

Or install in editable mode using pip:

pip install -e .

Testing

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

You can run the test suite using

python setup.py 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)

Added

  • 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.

Fixed

  • Fix struct function declaration prototype warnings.

  • Fix pointer warnings.

Changed

Deprecated

  • Removed the old deprecated hash() interface.

0.3 (2013-01-23)

Added

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

Changed

  • Created proper unit tests.

Deprecated

  • 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)

Added

  • 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 details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m Windows x86

Whirlpool-1.0.0-cp36-cp36m-macosx_10_12_x86_64.whl (54.6 kB view details)

Uploaded CPython 3.6m macOS 10.12+ x86-64

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

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m Windows x86

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

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4m Windows x86

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

Uploaded CPython 3.3m Windows x86-64

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

Uploaded CPython 3.3m Windows x86

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

Uploaded CPython 2.7m Windows x86-64

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

Uploaded CPython 2.7m Windows x86

Whirlpool-1.0.0-cp27-cp27m-macosx_10_12_x86_64.whl (54.1 kB view details)

Uploaded CPython 2.7m macOS 10.12+ x86-64

File details

Details for the file Whirlpool-1.0.0.tar.gz.

File metadata

  • Download URL: Whirlpool-1.0.0.tar.gz
  • Upload date:
  • Size: 41.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Whirlpool-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b8e60a8f5a0e09ad0c4015c2f7911d34afedd9dc18528a3c6197475e94b96f54
MD5 6868d6253523197ff1a2ce68985482f5
BLAKE2b-256 4ff0a16d7ab69b445e5b812fccf8246a9a9c2dfebd430c6c1d6de6d857c00e79

See more details on using hashes here.

File details

Details for the file Whirlpool-1.0.0-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for Whirlpool-1.0.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 cce34e66cbc8fb0eeb26dd52f5cc5d1619b86f0b3a258086097ca190627ee335
MD5 60cb981f9f3c22843942c68880357bb6
BLAKE2b-256 1b3b517991d27b38b5c68bc61436c7963cbe077649210ae0f3660ac84e047ffc

See more details on using hashes here.

File details

Details for the file Whirlpool-1.0.0-cp36-cp36m-win32.whl.

File metadata

File hashes

Hashes for Whirlpool-1.0.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 606fde7d52689ccac8e2eac7a526991d7eee61a849738d7cd2c99879870b377f
MD5 41b159a9f336dac3b938cfcda2dbece2
BLAKE2b-256 0101621ac7e2dfae4be612ee57552e2bce7187e5bb49776971e66698af871318

See more details on using hashes here.

File details

Details for the file Whirlpool-1.0.0-cp36-cp36m-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for Whirlpool-1.0.0-cp36-cp36m-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 af69f321d2a6f7e91d3bbc35ec7c5f5889e87317241e53ddfb98e51101e67a8b
MD5 1aeb96f0f1d020fee899ca2e5929ca2a
BLAKE2b-256 11a22277a39659a53b9d60a54e906f0daaeca18a8ac135c6d3b3e69d730165e7

See more details on using hashes here.

File details

Details for the file Whirlpool-1.0.0-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for Whirlpool-1.0.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 86a6f9e2ce08da24c70e641c4a9011fb999b9f94fe5a8d0b55a32b6a7a358d10
MD5 9e99a26f861bb628ff58c3f4f23bb455
BLAKE2b-256 b26476a3df9c8e930848458a6c634fa54f5c551a62302091c103e0cc86ab9f90

See more details on using hashes here.

File details

Details for the file Whirlpool-1.0.0-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for Whirlpool-1.0.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 055ef2559c862da53a5a3b0b7c0f70b1731af18d9ddb7b2e2e08a2cfe2a059d8
MD5 6e18183349f5449a2cc260a1bc1d0eee
BLAKE2b-256 3f6b5ad8ec3dd60c9374973efcb73421939de6a92655e3c980da1ca8bbf52fae

See more details on using hashes here.

File details

Details for the file Whirlpool-1.0.0-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for Whirlpool-1.0.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 d4376ee639f8d517e30023f9438a1f4c3a4fcf8e99a655dd47b7712f9e9413a7
MD5 bfa2127c4b89668ca7dc90e4d4f259fd
BLAKE2b-256 1628877e932db468f0547a9479204416298c31bbeebddf264bfca68e0e85fe83

See more details on using hashes here.

File details

Details for the file Whirlpool-1.0.0-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for Whirlpool-1.0.0-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 43366e01b68dc2235e0aa72ab38d57194da4b5e9f7e8cdccb5c7df922c555463
MD5 715c01a39db5dea2f76b24f23d55bc87
BLAKE2b-256 0c29567f81a77a22f2d60edef3c74f37385d7f5efff37a0b5e3b60c0163f3f8e

See more details on using hashes here.

File details

Details for the file Whirlpool-1.0.0-cp33-cp33m-win_amd64.whl.

File metadata

File hashes

Hashes for Whirlpool-1.0.0-cp33-cp33m-win_amd64.whl
Algorithm Hash digest
SHA256 367df3bd03487286da7e0cd6c8ab4aee0070edf5d40a580c796b6c476729183b
MD5 04dc440a3a2d8c684d0ac71d75297a6b
BLAKE2b-256 2d41dbfcb6a4fd6a0db764573c2442eaffbf2681ab64cb68d651e39e18a526a1

See more details on using hashes here.

File details

Details for the file Whirlpool-1.0.0-cp33-cp33m-win32.whl.

File metadata

File hashes

Hashes for Whirlpool-1.0.0-cp33-cp33m-win32.whl
Algorithm Hash digest
SHA256 a3752421aeba3f2cd86dcbc63fcb8c068493e2343f9efc49c86666717589d20c
MD5 0d50e2fb96db71d3f36f44e856e21115
BLAKE2b-256 3507b1c295124d78dd5932235d68445479c1fcde72f8088d86454767f51af274

See more details on using hashes here.

File details

Details for the file Whirlpool-1.0.0-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for Whirlpool-1.0.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 ca2d5e9cd54dd845a3cb807db9c1d77b75a165aafc5949429266968684d928c5
MD5 cda0ad61cbfd5f2ea812c814d96e8056
BLAKE2b-256 ccf5f4acbfff474f576fb5ca90f2e9f405edc14288a3af1736b14e8be90aeaa8

See more details on using hashes here.

File details

Details for the file Whirlpool-1.0.0-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for Whirlpool-1.0.0-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 ec69aa2121a69f318b20e2f14c7c52fa6f67b2622573ec901764b5846452655c
MD5 5c23abfb3c502067e91b5d7f8ab16fd6
BLAKE2b-256 ebff60e55b3c828d9c02067a6e47876d2f93af51b77d1b84532bcf5a44d3dc8f

See more details on using hashes here.

File details

Details for the file Whirlpool-1.0.0-cp27-cp27m-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for Whirlpool-1.0.0-cp27-cp27m-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 859bf1c6abcaea3cf2fe94533c6b0e4c66ce56b5aaedaf00988f60323ebdcd04
MD5 c87a13e1beae11b2c2a9cd6b2ef972e0
BLAKE2b-256 f8bcd2f06113e802d89c614674d9f81bdccfad6f0c3b77edbd730ac9b1ba208f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page