安全argon2密码哈希算法。

argon2-cffi的Python项目详细描述


PyPIDocumentation StatusTravis CI statusAppVeyor CI StatusTest CoverageIRCCode style: black

Argon2赢得了Password Hashing Competitionargon2_cffi是在python和pypy中使用它的最简单方法:

>>> fromargon2importPasswordHasher>>> 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

注意

passlib1.7.0及更高版本也提供了使用此库的Argon2 support

argon2_cffi的文档位于Read the Docs,即GitHub上的代码。 它在Python2.7、3.4+和Pypy上进行了严格的测试。

发布信息

19.1.0(2019-01-17)

自动售货机argon2@670229c(20171227)

向后不兼容的更改:

none

反对意见:

none

更改:

  • argon2.extract_parameters()中添加了对argon2 v1.2哈希的支持。

Full changelog

信贷和许可证

argon2_cffi由hynek schlawack维护,并在MIT license下发布。

这项发展得到了Variomedia AG的善意支持。

作者的完整列表可以在github的overview中找到。

卖方代码

参数2

原始argon2 repo可以在https://github.com/P-H-C/phc-winner-argon2/找到。

除了下面列出的组件外,此存储库中的argon2代码版权所有(c)2015 daniel dinu、dmitry khovratovich(主要作者)、jean-philippe aumasson和samuel neves,并在CC0许可下。

src/encoding.c中的字符串编码例程是版权所有的(c)2015 Thomas Pornin,并在CC0许可下。

src/blake2/中的BLAKE2代码是版权所有(c)Samuel Neves,2013-2015,并在CC0许可下。

argon2的作者也非常有助于让库在visual studio的古代版本上编译python的古代版本。

文档还经常引用argon2paper中的内容,以通过重新措辞避免错误。

msinttypes

为了能够在visual studio 2008和visual studio 2010上编译python 2.7和3.4分别需要的代码,我们还提供了两个整数类型的c头。 它们来自msinttypes projectauto-import on GitHub),并根据新的bsd获得许可:

版权所有(c)2006-2013 Alexander Chemeris

以源和二进制形式重新分配和使用,有无 如果满足以下条件,则允许修改:

  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.

本软件由作者“按原样”和任何明示或暗示的 担保,包括但不限于 对特定用途的适销性和适销性被驳回。在不 任何直接的,间接的,偶然的, 特殊、惩戒性或后果性损害(包括但不限于, 替代货物或服务的采购;使用、数据或利润的损失; 或营业中断),无论是何种原因,根据任何责任理论, 无论是合同、严格责任还是侵权行为(包括疏忽或 否则)以任何方式使用本软件,即使 被告知可能发生这种损害。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
空字符串检查在java中未按预期工作   JavaSpringWebClient:自动计算主体的HMAC签名并将其作为头传递   foreach是否有一个Java等效的foreach循环和一个引用变量?   java如何在Eclipse中导入jar   使用特定第三方或java时lombok触发错误。*方法或构造函数   安卓 java将对象数组转换为int数组   java使一定百分比的JUnit测试通过   java Android:将Seekbar的一个值与另一个值进行比较   java将int数组(图像数据)写入文件的最佳方式是什么   java取代了系统。yml的构造函数内的getProperty   sqlite Java将公钥和私钥转换为字符串,然后再转换回字符串   安卓获取白色像素并将其保存到java opencv中的数组中   java为什么是ServerSocket。setSocketFactory静态?   Java数组似乎在不直接修改的情况下更改值