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:

>>> import argon2
>>> hash = argon2.hash_password(b"secret")
>>> hash   # doctest: +SKIP
b'$argon2i$m=512,t=2,p=2$c29tZXNhbHQ$2IdoNVglVTxb9w4YVJqW8w'
>>> argon2.verify_password(hash, b"secret")
True
>>> argon2.verify_password(hash, b"wrong")
Traceback (most recent call last):
  ...
argon2.exceptions.VerificationError: Decoding failed

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

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.6/2.7 and 3.3/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.

Changelog

Versions are year-based with a strict backward compatibility policy. The third digit is only for regressions.

15.0.1 (2015-12-18)

Vendoring argon2 @ 4fe0d8cda37691228dd5a96a310be57369403a4b.

Changes:

  • Fix long_description on PyPI.

15.0.0 (2015-12-18)

Vendoring argon2 @ 4fe0d8cda37691228dd5a96a310be57369403a4b.

Changes:

  • verify_password() doesn’t guess the hash type if passed None anymore. Supporting this resulted in measurable overhead (~ 0.6ms vs 0.8ms on my notebook) since it had to happen in Python. That means that naïve usage of the API would give attackers an edge. The new behavior is that it has the same default value as hash_password() such that verify_password(hash_password(b"password"), b"password") still works.

  • Conditionally use the SSE2-optimized version of argon2 on x86 architectures.

  • More packaging fixes. Most notably compilation on Visual Studio 2010 for Python 3.3 and 3.4.

  • Tweaked default parameters to more reasonable values. Verification should take between 0.5ms and 1ms on recent-ish hardware.

15.0.0b5 (2015-12-10)

Vendoring argon2 @ 4fe0d8cda37691228dd5a96a310be57369403a4b.

Initial work. Previous betas were only for fixing Windows packaging. The authors of argon2 were kind enough to help me to get it building under Visual Studio 2008 that we’re forced to use for Python 2.7 on Windows.

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-15.0.1.tar.gz (818.2 kB view details)

Uploaded Source

Built Distributions

argon2_cffi-15.0.1-cp35-none-win_amd64.whl (34.5 kB view details)

Uploaded CPython 3.5 Windows x86-64

argon2_cffi-15.0.1-cp35-none-win32.whl (31.5 kB view details)

Uploaded CPython 3.5 Windows x86

argon2_cffi-15.0.1-cp35-cp35m-macosx_10_6_intel.whl (49.7 kB view details)

Uploaded CPython 3.5m macOS 10.6+ intel

argon2_cffi-15.0.1-cp34-none-win_amd64.whl (30.3 kB view details)

Uploaded CPython 3.4 Windows x86-64

argon2_cffi-15.0.1-cp34-none-win32.whl (30.1 kB view details)

Uploaded CPython 3.4 Windows x86

argon2_cffi-15.0.1-cp34-cp34m-macosx_10_6_intel.whl (49.6 kB view details)

Uploaded CPython 3.4m macOS 10.6+ intel

argon2_cffi-15.0.1-cp33-none-win_amd64.whl (30.4 kB view details)

Uploaded CPython 3.3 Windows x86-64

argon2_cffi-15.0.1-cp33-none-win32.whl (30.1 kB view details)

Uploaded CPython 3.3 Windows x86

argon2_cffi-15.0.1-cp33-cp33m-macosx_10_6_intel.whl (49.7 kB view details)

Uploaded CPython 3.3m macOS 10.6+ intel

argon2_cffi-15.0.1-cp27-none-win_amd64.whl (30.7 kB view details)

Uploaded CPython 2.7 Windows x86-64

argon2_cffi-15.0.1-cp27-none-win32.whl (30.2 kB view details)

Uploaded CPython 2.7 Windows x86

argon2_cffi-15.0.1-cp27-none-macosx_10_6_intel.whl (49.6 kB view details)

Uploaded CPython 2.7 macOS 10.6+ intel

argon2_cffi-15.0.1-cp26-none-win_amd64.whl (31.0 kB view details)

Uploaded CPython 2.6 Windows x86-64

argon2_cffi-15.0.1-cp26-none-win32.whl (30.4 kB view details)

Uploaded CPython 2.6 Windows x86

argon2_cffi-15.0.1-cp26-none-macosx_10_7_intel.whl (46.7 kB view details)

Uploaded CPython 2.6 macOS 10.7+ intel

File details

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

File metadata

File hashes

Hashes for argon2_cffi-15.0.1.tar.gz
Algorithm Hash digest
SHA256 2cabe7d49daedfb0592a791f0bfa6d1c30c390ccf5d765cd2a8fed8ad7b38e06
MD5 b3733eab7c25374e7509f7bc844870ab
BLAKE2b-256 7a77c0e41da2817d9c4d88ed2e5e9d863d9106c5e5eccb00be3606a34961e515

See more details on using hashes here.

File details

Details for the file argon2_cffi-15.0.1-cp35-none-win_amd64.whl.

File metadata

File hashes

Hashes for argon2_cffi-15.0.1-cp35-none-win_amd64.whl
Algorithm Hash digest
SHA256 e359a578a3e996e3fbb19e0ac74f1e8ce84c4bd456212392aa9634b53ee237d6
MD5 10b73cd92958fd0a7f575af96f30e329
BLAKE2b-256 fc2277a1eced838d683d39a79aa3185b2177be0ffd0363d3d8812c55f1d793d5

See more details on using hashes here.

File details

Details for the file argon2_cffi-15.0.1-cp35-none-win32.whl.

File metadata

File hashes

Hashes for argon2_cffi-15.0.1-cp35-none-win32.whl
Algorithm Hash digest
SHA256 e17aabb04a4f5b6e75fe6bdfa610e77f8562050860909fd4e56a7d2e67cabdde
MD5 ed3f430d79e9b21ba4b2e835ee34af9f
BLAKE2b-256 54cd1036ff11914c60b50a7fc5a5cd227c7d62780c6dabceb44ab42fe279dda0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for argon2_cffi-15.0.1-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 f632768c886628df864d63011d4f2663cc4e506cbb4b2aee2a3b19953909688f
MD5 757ee6ea396a6bcc5e90dd346cdded16
BLAKE2b-256 44a177224563205582573f3c59f325896028a7258e08622770c946b7822ac203

See more details on using hashes here.

File details

Details for the file argon2_cffi-15.0.1-cp34-none-win_amd64.whl.

File metadata

File hashes

Hashes for argon2_cffi-15.0.1-cp34-none-win_amd64.whl
Algorithm Hash digest
SHA256 17e9aaa54c0127e424c01cf098d5f807663272e6f702ed91cf95ed69d5a67ab3
MD5 3ff74a46976afdabb9d892bb1c4ca6c6
BLAKE2b-256 16019859a3f539c5b095bf77b2da6dcc9f28918971aaf1dc6894080c142c964e

See more details on using hashes here.

File details

Details for the file argon2_cffi-15.0.1-cp34-none-win32.whl.

File metadata

File hashes

Hashes for argon2_cffi-15.0.1-cp34-none-win32.whl
Algorithm Hash digest
SHA256 62cccacc291c5c87aa04f000fd661b3cf83572eb923e1f65bafd8e5aca147fb2
MD5 ecafe66f65422b66b8fd926aacb8a811
BLAKE2b-256 936bb383d7430f8e6cf55478a82af673d3b6bd33edb5b2d0ee3451f5081d7d7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for argon2_cffi-15.0.1-cp34-cp34m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 8a6a7f24bed9065301ca3b74b9635434eb7053a77e3600aa82f29f5ea46c0f08
MD5 b7e1449f2a9760ca378a9ff096947fbc
BLAKE2b-256 f07d7733ea5c8ac55bb87aa9dda1fe29b3c05a917078c92942003d6d38b71e3b

See more details on using hashes here.

File details

Details for the file argon2_cffi-15.0.1-cp33-none-win_amd64.whl.

File metadata

File hashes

Hashes for argon2_cffi-15.0.1-cp33-none-win_amd64.whl
Algorithm Hash digest
SHA256 a3e46e3b930d276ae63534ff7f6e86a395db6a30d4f3b2a632ff620eaf135edf
MD5 984d9057ca64fcb7ba4c8166601213ac
BLAKE2b-256 d01844e44daba6c17014cafd52b444d0d7683c4c628a937e07caf557dd3675ae

See more details on using hashes here.

File details

Details for the file argon2_cffi-15.0.1-cp33-none-win32.whl.

File metadata

File hashes

Hashes for argon2_cffi-15.0.1-cp33-none-win32.whl
Algorithm Hash digest
SHA256 ed949660078d0514760e5280760e4b27edc27b98a488860e8de185073e4abc0d
MD5 9b0a42e3e540455e713b08ff2eed7119
BLAKE2b-256 3e36155a782e7868b31db28333a3ec72f65e20af4ea7d8628a5c4d508ff325bb

See more details on using hashes here.

File details

Details for the file argon2_cffi-15.0.1-cp33-cp33m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for argon2_cffi-15.0.1-cp33-cp33m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 515a6b4684da436b93ae9612db99b69e9cd568d23d6ab6150039313f1444bd9b
MD5 bd2c75999b5d64e584ae890b30e219d9
BLAKE2b-256 0152773237f9bf0c22a495f1c20a7060831cbb972128d0015ff161debfbfca3a

See more details on using hashes here.

File details

Details for the file argon2_cffi-15.0.1-cp27-none-win_amd64.whl.

File metadata

File hashes

Hashes for argon2_cffi-15.0.1-cp27-none-win_amd64.whl
Algorithm Hash digest
SHA256 346803d4dcc9c52d3ac95ce69aa6575208f10a1c1b8f4ad2bfe7d63318b67469
MD5 52bf7006f8991678c13d053f0aca508a
BLAKE2b-256 4ea04e1b2cabcdef6c5d63dc28d518ed68566740966b95089ca12680869916fa

See more details on using hashes here.

File details

Details for the file argon2_cffi-15.0.1-cp27-none-win32.whl.

File metadata

File hashes

Hashes for argon2_cffi-15.0.1-cp27-none-win32.whl
Algorithm Hash digest
SHA256 551beccf3cea42f013107a29a0f6d92018c4d2f607d96bf00f4c308a59f96222
MD5 7ff23359302d7cd0fc00197422c3f5ac
BLAKE2b-256 724b7bdc001e8bbb93faab4b349f2b9788e39220db16ebb44ce9e2f9293b326d

See more details on using hashes here.

File details

Details for the file argon2_cffi-15.0.1-cp27-none-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for argon2_cffi-15.0.1-cp27-none-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 330b83b75e7e40ecd29a19113d82ffff84a8a0affb4136e9842e434c6d634df4
MD5 b0e39ff05e8ee30344b2b01086ee16b9
BLAKE2b-256 e3346cf65baecb19bd9939593f0e0e7823000f7734315bed2ecf6d9d6b35002a

See more details on using hashes here.

File details

Details for the file argon2_cffi-15.0.1-cp26-none-win_amd64.whl.

File metadata

File hashes

Hashes for argon2_cffi-15.0.1-cp26-none-win_amd64.whl
Algorithm Hash digest
SHA256 94a63223d78ce6fa4e6bf5d13fb7cc772517e8c7720b59312d3d2a39854ee9cf
MD5 2d0e987e1b9c8f6aa3938e633f47b8c1
BLAKE2b-256 4784b37eb35be8af0f3164acf7bc82fcc1a905b2c405ad195ce7c0fd12569d94

See more details on using hashes here.

File details

Details for the file argon2_cffi-15.0.1-cp26-none-win32.whl.

File metadata

File hashes

Hashes for argon2_cffi-15.0.1-cp26-none-win32.whl
Algorithm Hash digest
SHA256 db13ba983d5bcb3c9e1c6fff79fc9a1ba97d5cfa262482c23f19f48af1f58240
MD5 01ef94371eb12509bb5d604285313c5e
BLAKE2b-256 9386dc53ed25c6507c4e051358701d1a59defb0f6274b05d01f3b998813970c2

See more details on using hashes here.

File details

Details for the file argon2_cffi-15.0.1-cp26-none-macosx_10_7_intel.whl.

File metadata

File hashes

Hashes for argon2_cffi-15.0.1-cp26-none-macosx_10_7_intel.whl
Algorithm Hash digest
SHA256 bf65d2a759d4092dffa829a1f9558a2c388177547e405f1714a2f045ff09b2c1
MD5 5f30656c872141a1db86adc6b419cf43
BLAKE2b-256 bfe0acfd269fd29000a9d54167f44712a731faf95dfdd179fc5fcc62e548bdb6

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