Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Python wrapper extension for C Whirlpool reference implementation.
C Python
Branch: master
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
AUTHORS.txt Added manifest.


The Whirlpool algorithm is designed by Vincent Rijmen and Paulo S.L.M. Barreto. This is just a wrapper to the Whirlpool C reference implementation. The Whirlpool reference implementations are public domain, as is this code.

Wrapper written by James Cleveland with help from #python on

Wrapper extended to use the hashlib interface and ported to Python 3 by Olaf Conradi.


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.

Deprecated usage

For backward compatibility the old interface remains available. From Python 3 onwards, the old interface is dropped.

import whirlpool

hashed_string = whirlpool.hash("My String")


This module is tested using Python 2.7 and Python 3.3.

Something went wrong with that request. Please try again.