phc-winner-argon二、argon2-cffi安裝使用方法

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的各個版本

  • Argon2d 最大限度地提升了對GPU破解攻擊的抵抗力。它以密碼相關的順序訪問存儲器陣列,這下降了時間 - 存儲器權衡(TMTO)攻擊的可能性,可是引入了可能的側面信道攻擊。
  • Argon2i 優化了抵禦側向通道攻擊的能力。它以密碼無關的順序訪問內存陣列。
  • Argon2id 是一個混合版本。它遵循Argon2i方法進行第一次經過內存,Argon2d方法用於後續經過。Internet-Draft建議使用Argon2id,除非有理由選擇其餘兩種模式之一。
相關文章
相關標籤/搜索