Skip to main content

The secure Argon2 password hashing algorithm.

Project description

PyPI Documentation Status Travis CI status AppVeyor CI Status Test Coverage IRC Code style: black

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
'$argon2id$v=19$m=102400,t=2,p=8$tSm+JOWigOgPZx/g44K5fQ$WDyus6py50bVFIPkjA28lQ'
>>> ph.verify(hash, "s3kr3tp4ssw0rd")
True
>>> ph.check_needs_rehash(hash)
False
>>> 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

18.2.0 (2018-08-19)

Vendoring Argon2 @ 670229c (20171227)

Changes:

  • The hash type for argon2.PasswordHasher is Argon2id now.

    This decision has been made based on the recommendations in the latest Argon2 RFC draft. #33 #34

  • To make the change of hash type backward compatible, argon2.PasswordHasher.verify() now determines the type of the hash and verifies it accordingly.

  • Some of the hash parameters have been made stricter to be closer to said recommendations. The current goal for a hash verification times is around 50ms. #41

  • To allow for bespoke decisions about upgrading Argon2 parameters, it’s now possible to extract them from a hash via the argon2.extract_parameters() function. #41

  • Additionally argon2.PasswordHasher now has a check_needs_rehash() method that allows to verify whether a hash has been created with the instance’s parameters or whether it should be rehashed. #41

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-18.2.0.tar.gz (1.8 MB view details)

Uploaded Source

Built Distributions

argon2_cffi-18.2.0-cp37-cp37m-win32.whl (36.0 kB view details)

Uploaded CPython 3.7m Windows x86

argon2_cffi-18.2.0-cp36-cp36m-win32.whl (36.0 kB view details)

Uploaded CPython 3.6m Windows x86

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

Uploaded CPython 3.5m Windows x86

argon2_cffi-18.2.0-cp34-cp34m-win32.whl (34.2 kB view details)

Uploaded CPython 3.4m Windows x86

argon2_cffi-18.2.0-cp34-abi3-manylinux1_x86_64.whl (93.4 kB view details)

Uploaded CPython 3.4+

argon2_cffi-18.2.0-cp34-abi3-macosx_10_6_intel.whl (60.1 kB view details)

Uploaded CPython 3.4+ macOS 10.6+ intel

argon2_cffi-18.2.0-cp27-cp27mu-manylinux1_x86_64.whl (96.8 kB view details)

Uploaded CPython 2.7mu

argon2_cffi-18.2.0-cp27-cp27mu-manylinux1_i686.whl (95.7 kB view details)

Uploaded CPython 2.7mu

argon2_cffi-18.2.0-cp27-cp27m-win32.whl (34.0 kB view details)

Uploaded CPython 2.7m Windows x86

argon2_cffi-18.2.0-cp27-cp27m-manylinux1_x86_64.whl (96.8 kB view details)

Uploaded CPython 2.7m

argon2_cffi-18.2.0-cp27-cp27m-manylinux1_i686.whl (95.7 kB view details)

Uploaded CPython 2.7m

File details

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

File metadata

  • Download URL: argon2_cffi-18.2.0.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for argon2_cffi-18.2.0.tar.gz
Algorithm Hash digest
SHA256 dcb813d41a877820a42dcd3b8450acdef9ce9c8470d1192ae9e1d31f5f4efb22
MD5 1d9f4dbc1529ee4f3c45833fd8399dfb
BLAKE2b-256 d8760e095ad4e3b5bd24c454f147a9e9ffbc291688ebb7e916c26700c026e3de

See more details on using hashes here.

File details

Details for the file argon2_cffi-18.2.0-cp37-cp37m-win32.whl.

File metadata

  • Download URL: argon2_cffi-18.2.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 36.0 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for argon2_cffi-18.2.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 53c3e84fa45f03fd9cc2fc91ff7d05c004bd4b024e1d10126ecb414212516729
MD5 da155a4168685b753e55054cab8dbfa4
BLAKE2b-256 b1eb35fadf6bae189092b828547f3933fe0a57ee91291bd41c6b1508e4a881bf

See more details on using hashes here.

File details

Details for the file argon2_cffi-18.2.0-cp36-cp36m-win32.whl.

File metadata

  • Download URL: argon2_cffi-18.2.0-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 36.0 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for argon2_cffi-18.2.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 acd092b451342437bf8363d605949a9527d6d0fad94c7248d3e14ccf20848688
MD5 74447ef9783395224c822f97edddaa0b
BLAKE2b-256 f425a979b075f87cf797a68c1c4c44d3bdad93978c9a3a0657b17286d6d28246

See more details on using hashes here.

File details

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

File metadata

  • Download URL: argon2_cffi-18.2.0-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 36.0 kB
  • Tags: CPython 3.5m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for argon2_cffi-18.2.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 5c1399c36cdeaf0cb657293b5f20b4c67b697962efa9eb669d0b1b6bae145b3b
MD5 3ea80a4e30e16776d1f6fe8d8864653e
BLAKE2b-256 9fd2439b493c36abd07d36099e20597426236b34427cf8a17dffdcb948d99ff0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: argon2_cffi-18.2.0-cp34-cp34m-win32.whl
  • Upload date:
  • Size: 34.2 kB
  • Tags: CPython 3.4m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for argon2_cffi-18.2.0-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 ac24f676cc032923a6c2b1a52badfdd2ebd928fa4578295e32fd91901c5eb5a2
MD5 2ad96da56998f7845b253869ae22abf1
BLAKE2b-256 ba9016092d6381dd69f3113937f5c7b90122c0bffd3ad84ab55171fb7bc10237

See more details on using hashes here.

File details

Details for the file argon2_cffi-18.2.0-cp34-abi3-manylinux1_x86_64.whl.

File metadata

  • Download URL: argon2_cffi-18.2.0-cp34-abi3-manylinux1_x86_64.whl
  • Upload date:
  • Size: 93.4 kB
  • Tags: CPython 3.4+
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for argon2_cffi-18.2.0-cp34-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5b38b48c2bee9282f4ab1443cffe47c0cbfa49ab92e090b0a43354057b772fa8
MD5 8442ae4ceedde48f7115126bacd858e7
BLAKE2b-256 48e40725b00fed91e5427e48fee5e5b5e93a3c6e665b63a416948b7e08159fc4

See more details on using hashes here.

File details

Details for the file argon2_cffi-18.2.0-cp34-abi3-macosx_10_6_intel.whl.

File metadata

  • Download URL: argon2_cffi-18.2.0-cp34-abi3-macosx_10_6_intel.whl
  • Upload date:
  • Size: 60.1 kB
  • Tags: CPython 3.4+, macOS 10.6+ intel
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for argon2_cffi-18.2.0-cp34-abi3-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 b6fbc59848326fcc33768550ddb6766a2454827c5796f7d5ee34a7c1783ab3a1
MD5 0bf0d572ab7dee92c6510e4969bf4f50
BLAKE2b-256 7104a8e60a994ab1eada276bba4d3faa5d1572c78a90c9ca26a0c3f5664291c5

See more details on using hashes here.

File details

Details for the file argon2_cffi-18.2.0-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

  • Download URL: argon2_cffi-18.2.0-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 96.8 kB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for argon2_cffi-18.2.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2e58a8f7d98e0be93db67df236de1535afb63529fe4320ad85a2ff05595db0c0
MD5 6eda8e38136b5ff4434ec813c12f4c01
BLAKE2b-256 5b7c738602032b816ad19861f115a756284268e687d69a88e16ac245b3c35aad

See more details on using hashes here.

File details

Details for the file argon2_cffi-18.2.0-cp27-cp27mu-manylinux1_i686.whl.

File metadata

  • Download URL: argon2_cffi-18.2.0-cp27-cp27mu-manylinux1_i686.whl
  • Upload date:
  • Size: 95.7 kB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for argon2_cffi-18.2.0-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 7f3afdeaeaf3cbff487300c8e8fc339ba47eb492e5875f9858b0016b3385283c
MD5 86b7a667fbc5c50796323d445be28695
BLAKE2b-256 adcaa6deef535468c209b265d3bfa3621d240656045d8097e00ce8818cbe605f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: argon2_cffi-18.2.0-cp27-cp27m-win32.whl
  • Upload date:
  • Size: 34.0 kB
  • Tags: CPython 2.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for argon2_cffi-18.2.0-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 c191f7ec6d649359efd5c3a5a33784cc2a3901987db5fa95b1dbb50b20bfaad5
MD5 cbad71498c77c200a793d3db80ae7b5b
BLAKE2b-256 73c8fd5b03d6f813144e11720648438c50595c383d8da8300636abda852b7f14

See more details on using hashes here.

File details

Details for the file argon2_cffi-18.2.0-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

  • Download URL: argon2_cffi-18.2.0-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 96.8 kB
  • Tags: CPython 2.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for argon2_cffi-18.2.0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4b8facfcaa90d74634d3d7fed749d81bc254f8a1f9fffbfffd11a920dffcd12c
MD5 c2fb7c57e5114de77c6a988cd2f2f5bc
BLAKE2b-256 828dc996e2a14226ab81b6b7ece4d528dcdab801f5d8ef9a67adb117f65d026e

See more details on using hashes here.

File details

Details for the file argon2_cffi-18.2.0-cp27-cp27m-manylinux1_i686.whl.

File metadata

  • Download URL: argon2_cffi-18.2.0-cp27-cp27m-manylinux1_i686.whl
  • Upload date:
  • Size: 95.7 kB
  • Tags: CPython 2.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for argon2_cffi-18.2.0-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 b57a434ea06da36b280111b2c941c3524dede089cf1bb570dfbf52bb714ed42b
MD5 8e90f230fa7fba7652154dcffa73743a
BLAKE2b-256 8ef308f3c0e093c3dc2259e2d8f4c06859a2930a23e670536d96e8378884f8bc

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