Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

The secure Argon2 password hashing algorithm.

Project Description

Argon2 won the Password Hashing Competition and argon2_cffi is the simplest way to use it in Python and PyPy:

>>> from argon2 import PasswordHasher
>>> ph = PasswordHasher()
>>> hash = ph.hash("s3kr3tp4ssw0rd")
>>> hash  # doctest: +SKIP
'$argon2i$v=19$m=512,t=2,p=2$5VtWOO3cGWYQHEMaYGbsfQ$AcmqasQgW/wI6wAHAMk4aQ'
>>> ph.verify(hash, "s3kr3tp4ssw0rd")
True
>>> ph.verify(hash, "t0t411ywr0ng")
Traceback (most recent call last):
  ...
argon2.exceptions.VerifyMismatchError: The password does not match the supplied hash

argon2_cffi’s documentation lives at Read the Docs, the code on GitHub. It’s rigorously tested on Python 2.7, 3.4+, and PyPy.

Release Information

16.3.0 (2016-11-10)

Vendoring Argon2 @ 1c4fc41f81f358283755eea88d4ecd05e43b7fd3 (20161029)

Changes:

  • Prevent side-effects like the installation of cffi if setup.py is called with a command that doesn’t require it. #20
  • Fix a bunch of warnings with new cffi versions and Python 3.6. #14 #16
  • Add low-level bindings for Argon2id functions.

Full changelog.

Credits & License

argon2_cffi is maintained by Hynek Schlawack and released under the MIT license.

The development is kindly supported by Variomedia AG.

A full list of contributors can be found in GitHub’s overview.

Vendored Code

Argon2

The original Argon2 repo can be found at https://github.com/P-H-C/phc-winner-argon2/.

Except for the components listed below, the Argon2 code in this repository is copyright (c) 2015 Daniel Dinu, Dmitry Khovratovich (main authors), Jean-Philippe Aumasson and Samuel Neves, and under CC0 license.

The string encoding routines in src/encoding.c are copyright (c) 2015 Thomas Pornin, and under CC0 license.

The BLAKE2 code in src/blake2/ is copyright (c) Samuel Neves, 2013-2015, and under CC0 license.

The authors of Argon2 also were very helpful to get the library to compile on ancient versions of Visual Studio for ancient versions of Python.

The documentation also quotes frequently from the Argon2 paper to avoid mistakes by rephrasing.

msinttypes

In order to be able to compile on Visual Studio 2008 and Visual Studio 2010 which are required for Python 2.7 and 3.4 respectively, we also ship two C headers with integer types. They are from the msinttypes project (auto-import on GitHub) and licensed under New BSD:

Copyright (c) 2006-2013 Alexander Chemeris

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the product nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ‘’AS IS’’ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Release History

Release History

This version
History Node

16.3.0

History Node

16.2.0

History Node

16.1.0

History Node

16.0.0

History Node

15.0.1

History Node

15.0.0

History Node

15.0.0b5

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
argon2_cffi-16.3.0-cp27-cp27m-macosx_10_6_intel.whl (57.1 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Nov 10, 2016
argon2_cffi-16.3.0-cp27-cp27m-manylinux1_i686.whl (87.9 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Nov 10, 2016
argon2_cffi-16.3.0-cp27-cp27m-manylinux1_x86_64.whl (88.8 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Nov 10, 2016
argon2_cffi-16.3.0-cp27-cp27mu-manylinux1_i686.whl (87.9 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Nov 10, 2016
argon2_cffi-16.3.0-cp27-cp27mu-manylinux1_x86_64.whl (88.8 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Nov 10, 2016
argon2_cffi-16.3.0-cp27-cp27m-win32.whl (34.8 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Nov 10, 2016
argon2_cffi-16.3.0-cp27-cp27m-win_amd64.whl (36.3 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Nov 10, 2016
argon2_cffi-16.3.0-cp34-cp34m-macosx_10_6_intel.whl (57.1 kB) Copy SHA256 Checksum SHA256 cp34 Wheel Nov 10, 2016
argon2_cffi-16.3.0-cp34-cp34m-manylinux1_i686.whl (84.7 kB) Copy SHA256 Checksum SHA256 cp34 Wheel Nov 10, 2016
argon2_cffi-16.3.0-cp34-cp34m-manylinux1_x86_64.whl (85.4 kB) Copy SHA256 Checksum SHA256 cp34 Wheel Nov 10, 2016
argon2_cffi-16.3.0-cp34-cp34m-win32.whl (35.1 kB) Copy SHA256 Checksum SHA256 cp34 Wheel Nov 10, 2016
argon2_cffi-16.3.0-cp34-cp34m-win_amd64.whl (36.1 kB) Copy SHA256 Checksum SHA256 cp34 Wheel Nov 10, 2016
argon2_cffi-16.3.0-cp35-cp35m-macosx_10_6_intel.whl (57.1 kB) Copy SHA256 Checksum SHA256 cp35 Wheel Nov 10, 2016
argon2_cffi-16.3.0-cp35-cp35m-manylinux1_i686.whl (84.8 kB) Copy SHA256 Checksum SHA256 cp35 Wheel Nov 10, 2016
argon2_cffi-16.3.0-cp35-cp35m-manylinux1_x86_64.whl (85.5 kB) Copy SHA256 Checksum SHA256 cp35 Wheel Nov 10, 2016
argon2_cffi-16.3.0-cp35-cp35m-win32.whl (36.4 kB) Copy SHA256 Checksum SHA256 cp35 Wheel Nov 10, 2016
argon2_cffi-16.3.0-cp35-cp35m-win_amd64.whl (39.7 kB) Copy SHA256 Checksum SHA256 cp35 Wheel Nov 10, 2016
argon2_cffi-16.3.0-cp36-cp36m-macosx_10_6_intel.whl (57.1 kB) Copy SHA256 Checksum SHA256 cp36 Wheel Apr 11, 2017
argon2_cffi-16.3.0-cp36-cp36m-manylinux1_i686.whl (84.7 kB) Copy SHA256 Checksum SHA256 cp36 Wheel Apr 11, 2017
argon2_cffi-16.3.0-cp36-cp36m-manylinux1_x86_64.whl (85.4 kB) Copy SHA256 Checksum SHA256 cp36 Wheel Apr 11, 2017
argon2_cffi-16.3.0-cp36-cp36m-win32.whl (36.4 kB) Copy SHA256 Checksum SHA256 cp36 Wheel Apr 11, 2017
argon2_cffi-16.3.0-cp36-cp36m-win_amd64.whl (39.7 kB) Copy SHA256 Checksum SHA256 cp36 Wheel Apr 11, 2017
argon2_cffi-16.3.0.tar.gz (1.5 MB) Copy SHA256 Checksum SHA256 Source Nov 10, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting