Argon2
noun
say it: “AR-gon TOO” /ˈɑrɡɑn tu/
A modern way of hashing passwords that is slow on purpose and needs memory for every guess, with a random salt in each hash, so stolen hashes are very slow to crack.
What is Argon2?
Argon2 is a way of hashing passwords that's slow on purpose and needs a block of memory for every guess, with a
random salt in each hash, so guessing passwords from stolen hashes takes an attacker real time. Argon2id is the
variety meant for passwords. In Python, pwdlib's PasswordHash.recommended() uses it.
from pwdlib import PasswordHash
password_hash = PasswordHash.recommended() # Argon2id
stored = password_hash.hash("correct-horse-staple")
print(stored[:31]) # $argon2id$v=19$m=65536,t=3,p=4$
print(password_hash.verify("correct-horse-staple", stored)) # True
print(password_hash.verify("correct-horse-stable", stored)) # False
In a sentence
- “A hash that starts with $argon2id$ was made with Argon2's variety for passwords.”
- “The study group API stores each password as an Argon2 hash, never the password itself.”
Level: Journeyman · More Web Development terms at this level
Updated