Argon2 is a password-hashing function created by by Alex Biryukov, Daniel Dinu, and Dmitry Khovratovich.git
Argon2算法曾在2015 年的Password Hashing密碼加密大賽中勝出。github
Argon2官網:https://www.argon2.com/算法
------------------------------------------------------------------------優化
0x00 phc-winner-argon2的安裝
加密
git clone https://github.com/P-H-C/phc-winner-argon2 cd phc-winner-argon2 make
使用方法:spa
echo -n "CTF_110_911" | ./argon2 12345678 -d -t 100 -m 15 -p 1 -l 64
0x01 argon2-cffi的安裝.net
CFFI: C Foreign Function Interface for Python. Interact with almost any C code from Python, based on C-like declarations that you can often copy-paste from header files or documentation.code
pip install argon2_cffi
請不要安裝pip install argon2blog
argon2-cffi的github:https://github.com/hynek/argon2-cffi (因爲總更新,不建議今後安裝)ip
argon2-cffi文檔:https://argon2-cffi.readthedocs.io/en/stable/
0x02 argon2-cffi的使用
# -*- coding:utf8 -*- __author__='pcat@chamd5.org' from argon2 import PasswordHasher ph=PasswordHasher() hash='$argon2d$v=19$m=32768,t=100,p=1$MTIzNDU2Nzg$iuSRO5tkWxBxqgkI5g9O5ZersA//xvgvrKxH8QuxBBI4yKbG4aRFqITP/Rh5giFRuL9PTJP+/0BUfNwZHzx9bQ' pwd='CTF_110_911' assert ph.verify(hash,pwd)==True
0x03 argon2的各個版本