General

Safety way to save passwords in a DB

Started by big_latino_cock · Feb 24, 2025

#5816
I has been saving passwords with SHA3-256 + salt, and at the moment fits good for the services.

Did you have any alternative? or other experiences?
#5817
↳ Replying to @big_latino_cock
Use Argon2id with a minimum configuration of 19 MiB of memory, an iteration count of 2, and 1 degree of parallelism.

If Argon2id is not available, use scrypt with a minimum CPU/memory cost parameter of (2^17), a minimum block size of 8 (1024 bytes), and a parallelization parameter of 1.

For legacy systems using bcrypt, use a work factor of 10 or more and with a password limit of 72 bytes.

If FIPS-140 compliance is required, use PBKDF2 with a work factor of 600,000 or more and set with an internal hash function of HMAC-SHA-256.

Consider using a pepper to provide additional defense in depth (though alone, it provides no additional secure characteristics).
#5818
↳ Replying to @big_latino_cock
Argon2id with a high work factor and unique random salts.

Alongside strong access controls and monitoring.