hackweb
notes on hacking and technology
IT EN
main menu
user menu
you are not logged in

Password hashing: bcrypt, scrypt, Argon2

December 22, 2025 · 1 min read · #crypto #passwords #authentication

A stolen database must not reveal passwords. The defence is a hash designed to be slow, with a unique per-user salt.

Why not SHA-256

SHA and MD5 are fast: a GPU tries billions of hashes per second, and a dictionary falls in minutes. You need functions deliberately expensive in time and memory.

// PHP: picks and upgrades the algorithm itself
$hash = password_hash($pw, PASSWORD_ARGON2ID);
if (password_verify($pw, $hash)) { /* ok */ }

Which one

Argon2id is the modern choice: memory cost hinders GPUs/ASICs. scrypt similar. bcrypt still acceptable (mind the 72-byte limit). The salt is handled for you; a separate pepper is not required if parameters are adequate. Raise the cost over time.


« back to home

latest posts
 
your IP address:
216.73.216.108
visitor #1
MOTD:
Every abstraction leaks somewhere.
Here we look at where.
topics