Skip to main content

The secure Argon2 password hashing algorithm.

Project description

Documentation Status https://travis-ci.org/hynek/argon2_cffi.svg?branch=master https://codecov.io/github/hynek/argon2_cffi/coverage.svg?branch=master https://ci.appveyor.com/api/projects/status/3faufu7qgwc8nv2v/branch/master?svg=true https://www.irccloud.com/invite-svg?channel=%23cryptography-dev&hostname=irc.freenode.net&port=6697&ssl=1

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.1.0 (2016-04-19)

Vendoring Argon2 @ 00aaa66

Backward-incompatible changes:

  • Python 3.3 and 2.6 aren’t supported anymore. They may work by chance but any support to them has been ceased.

    The last Python 2.6 release was on October 29, 2013 and isn’t supported by the CPython core team anymore. Major Python packages like Django and Twisted dropped Python 2.6 a while ago already.

    Python 3.3 never had a significant user base and wasn’t part of any distribution’s LTS release.

Changes:

  • Add VerifyMismatchError that is raised if verification fails only because of a password/hash mismatch. It’s a subclass of VerificationError therefore this change is completely backward compatible.

  • Add support for Argon2 1.3. Old hashes remain functional but opportunistic rehashing is strongly recommended.

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.

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

argon2_cffi-16.1.0.tar.gz (1.2 MB view details)

Uploaded Source

Built Distributions

argon2_cffi-16.1.0-cp35-cp35m-win_amd64.whl (39.2 kB view details)

Uploaded CPython 3.5m Windows x86-64

argon2_cffi-16.1.0-cp35-cp35m-win32.whl (36.0 kB view details)

Uploaded CPython 3.5m Windows x86

argon2_cffi-16.1.0-cp35-cp35m-macosx_10_6_intel.whl (56.4 kB view details)

Uploaded CPython 3.5m macOS 10.6+ intel

argon2_cffi-16.1.0-cp34-cp34m-win_amd64.whl (34.9 kB view details)

Uploaded CPython 3.4m Windows x86-64

argon2_cffi-16.1.0-cp34-cp34m-win32.whl (34.3 kB view details)

Uploaded CPython 3.4m Windows x86

argon2_cffi-16.1.0-cp34-cp34m-macosx_10_6_intel.whl (56.3 kB view details)

Uploaded CPython 3.4m macOS 10.6+ intel

argon2_cffi-16.1.0-cp27-cp27m-win_amd64.whl (35.3 kB view details)

Uploaded CPython 2.7m Windows x86-64

argon2_cffi-16.1.0-cp27-cp27m-win32.whl (34.2 kB view details)

Uploaded CPython 2.7m Windows x86

argon2_cffi-16.1.0-cp27-cp27m-macosx_10_6_intel.whl (56.3 kB view details)

Uploaded CPython 2.7m macOS 10.6+ intel

File details

Details for the file argon2_cffi-16.1.0.tar.gz.

File metadata

File hashes

Hashes for argon2_cffi-16.1.0.tar.gz
Algorithm Hash digest
SHA256 57765157ea65c1bc6a7b19bcc54f5aa4af57817f1a349c59339a720edc2b1c3f
MD5 42c3c4a3cfedb7acd6b1a0042d254cd1
BLAKE2b-256 812ae1df75308a46a519ef773e89c2fa1622b446418613336d88431a084a3714

See more details on using hashes here.

File details

Details for the file argon2_cffi-16.1.0-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for argon2_cffi-16.1.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 ab384bd65b037adc742555ff5ed7a25e546c55f7ee6cc5ace9427907aa5452ca
MD5 f2da1005eed23b059c252dbcadc1517b
BLAKE2b-256 c9d8e5e1541180a3f503f690fc01cf1475b77a606b8abbbdb05e3aeaa67300b1

See more details on using hashes here.

File details

Details for the file argon2_cffi-16.1.0-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for argon2_cffi-16.1.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 c38daba0a3e571aea9af3f01891cbd22b3ac00a6cd8ea5773079e46338f3c8b0
MD5 1003d23556c137624df82a562c45965a
BLAKE2b-256 fec4047154df0e04ad6e26871fe5eead6c4a3916f1e6e04dd5ee77f6253caed2

See more details on using hashes here.

File details

Details for the file argon2_cffi-16.1.0-cp35-cp35m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for argon2_cffi-16.1.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 5ea3f0f1ec06a2eaf079424601d9264a3993e3b1b307655407d210d62640b761
MD5 9c37ea2d53fc06155128b4b427bfe046
BLAKE2b-256 f2044394b2e4229cb92376c367a18d8607a9d3e9ae6eb3d62dc43b4be52081a2

See more details on using hashes here.

File details

Details for the file argon2_cffi-16.1.0-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for argon2_cffi-16.1.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 4893b63d5ca11d17964a393b8355e68738af244d22cf76449769649907b2b7b5
MD5 72c199abfc50855de1f2ee31952a78ee
BLAKE2b-256 98eb7fe867c639caf4f2009c0e4c2c6b45ec6523cc4c852baee2684244543d23

See more details on using hashes here.

File details

Details for the file argon2_cffi-16.1.0-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for argon2_cffi-16.1.0-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 d22e0bc3273215ff55c7e5984e51fee8bb6c5254b9fd1b9daf3aa59c1556e55a
MD5 a9ce84a570e5c3fa64fda16d2208b81b
BLAKE2b-256 d0f03d87b5632cadc58c5103b82a97bbaba39ef8bc7f8c4638ebf3a5db6ed644

See more details on using hashes here.

File details

Details for the file argon2_cffi-16.1.0-cp34-cp34m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for argon2_cffi-16.1.0-cp34-cp34m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 f0849d03bc17106aadf0357b301f7998349da4b700529d1dee3306d032220e29
MD5 e11ecbb3530eef47305f8f417a9069aa
BLAKE2b-256 d22eb46abcc08c08b365361f1d1ff176d4b6529383cf104c58f775d2035aeae1

See more details on using hashes here.

File details

Details for the file argon2_cffi-16.1.0-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for argon2_cffi-16.1.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 56c683716f93ef7d61189546fb9a556bf4d0cd1a353787328fde0cb1f6a9870b
MD5 6c7478f0ee8166cd65d59ae194a9ce9a
BLAKE2b-256 952d78184cd34b6602f067d7268c478d44f7bf1164f01c01e50de6297c572aa8

See more details on using hashes here.

File details

Details for the file argon2_cffi-16.1.0-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for argon2_cffi-16.1.0-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 92f64a97092699e4afff50a90640160ad6c4f26bdcb54cbc9748f92d5d55c4cd
MD5 420530b84810779f87e04668b775a450
BLAKE2b-256 e17bd83f989510af3dae0dce2a16d597edf39aacee7eff200578503b9e421644

See more details on using hashes here.

File details

Details for the file argon2_cffi-16.1.0-cp27-cp27m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for argon2_cffi-16.1.0-cp27-cp27m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 faef91394e49a4ebd807bc7e2a06c1f068d882d871a1c9bc2065e55962384af0
MD5 b151221ce88c0d51f18fab6e014ce64b
BLAKE2b-256 e8c121800981ef39229f732b6883e7aa5977c74cef7c1d33b72c4554bf117113

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