SHA-3 (NIST competition version) extension module for CPython 2.x and 3.x
C Python Other
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


python-sha3 - SHA-3 (NIST competition version) extension for CPython

# Warning!

**This package implements the original Keccak hash function as selected by NIST
in 2012. It is incompatible with the final SHA-3 standard.**

On April 7, 2014, SHA-3 draft standard was released with a change that
introduced additional padding of input data. The updated specification became
final as FIPS 202 on August 5, 2015.
This Python module does not include the modification and will produce different

There are no plans to update this module to the latest revision of the
standard. It will remain compliant with the original Keccak proposal.
To calculate actual SHA-3 hashes, please consider migrating your code to a
FIPS 202 implementation (like

This extension module can be used with Python 2.x (from 2.4 upwards) and 3.x.

Four classes with different digest sizes are currently available:
 - sha3.sha224 - SHA-3 224 bits
 - sha3.sha256 - SHA-3 256 bits
 - sha3.sha384 - SHA-3 384 bits
 - sha3.sha512 - SHA-3 512 bits

The interface of these classes follows conventions from Python's builtin
hashlib module.

Internally python-sha3 uses the optimized version of the Keccak algorithm,
written and released into the public domain by its designers.
Both 32-bit and 64-bit architectures are supported (tested on x86 and x86_64

Like hashlib, python-sha3 has optional support for concurrency.
To enable concurrent hashing, pass '--enable-threads' when building the module
When built with multithreading support, python-sha3 will release the GIL
during hash calculations and use a per object, fine-grained lock instead.

The most current development version is available at:

Bugs can be reported at:

This software is distributed under the MIT license.
Please see the LICENSE file included in the package for details.