Bcrypt vs Argon 2

Azareal

Paragon
Joined
Dec 18, 2010
Messages
1,680
Reaction score
353
FP$
4,498
Bcrypt and Argon 2, well Argon2i to be accurate (there are five variants which each tackle different use cases), are currently the best options for hashing passwords.

Bcrypt is the time-tested solution, while Argon 2 was the winner of the password hashing competition a few years ago and is relatively new meaning that the cryptographic community has had less time to analyse it's flaws and it's less portable across languages / platforms due to to people having had less time to write implementations for it.

The advantages of Argon 2 is that unlike Bcrypt, there isn't a limit on the number of characters you can have in a password (around 50 bytes for bcrypt, depending on the language, a character might take up one or more bytes up-to a surprisingly high number in some) and it has higher memory requirements, so it's supposedly harder to crack with GPUs and what-not (although, the memory requirements tend to be brought down on production webservers to save resources).

For Argon 2, the number of threads, amount of memory, iterations, etc. can be tweaked independently of each other, while with bcrypt, you get a single number which you set as the "cost" making scaling the requirements when you have surplus resources in an area more difficult.

Plus, Argon 2 is also supposed to deal with certain types of side channels, etc., if I recall, which should make it tougher in some areas.
As for the one which has the cooler name, it would have to be Argon 2 lol
 
Last edited:
I haven’t heard of Argon2 until now. I’d stick with either bcrypt or PBKDF2. The latter is cool because its iterations can be easily tweaked for the situation, though the former has a few fundamental advantages that make it a solid choice
 
I haven’t heard of Argon2 until now. I’d stick with either bcrypt or PBKDF2. The latter is cool because its iterations can be easily tweaked for the situation, though the former has a few fundamental advantages that make it a solid choice
Argon 2 is getting quite a name for itself, although it's still fairly new which makes me a little nervous (mostly the hassle of jumping from one hash to another), so I'll probably stick with bcrypt in the meanwhile, but I have Argon 2 all ready and commented out, if people want that as an option.

https://github.com/golang/go/issues/19896#issuecomment-292730283
https://crypto.stackexchange.com/qu...shing-security-of-argon2-versus-bcrypt-pbkdf2
Just a cursory search, there is a lot of stuff out there.
 
The primary gain of scrypt and argon2 over bcrypt is a hit to parallelism due to the addition of memory requirements. GPUs with thousands of cores will need (but don't have) good amounts of memory, so most of those cores will need to remain idle. FPGAs and ASICs become much more expensive as they have to incorporate large amounts of memory, so you're really just forcing an attacker to trade a significantly larger number of dollars for equivalent parallelism.

Argon2 is the winner meaning it has memory password hashing function which can be used to hash passwords for credential storage, key derivation, or other applications.

Being memory hard means that it is not only computationally expensive, but it also uses a lot of memory (which can be configured). This means that it is much more difficult to attack Argon2 hashes using GPUs or dedicated hardware.
 
Back
Top Bottom