Replies: 4 comments
-
By the way, correct me if I'm wrong anywhere, I'm not really an expert on this. I also found some other related SE question, which suggest that when the memory cost is too low, a GPU may unfortunately have an advantage over a CPU with too many lanes. |
Beta Was this translation helpful? Give feedback.
-
What makes your password harder to bruteforce, is total number of times Blake2b was called by your E.g. I'm actually very surprised that |
Beta Was this translation helpful? Give feedback.
-
I read through all the existing issues about argon2 parallelism and I have a different reason for needing it - it's required for compatibility with an externally-specified file format that my application needs to support. If libsodium doesn't provide access to that parmeter through the API (which I know is possible because the third party Argon2 implementation libsodium embeds supports it: ) then really stuck between a rock and a hard place.I don't read Makefile very well so I can't tell if the argon2id_hash_raw symbol is exported by libsodium or not. If so then I can copy the header into my sources and rely on the implementation being available if I've linked to libsodium at least until some future update switches things around and breaks my application, if not I can copy the entire Daniel Dinu and Dmitry Khovratovich implementation into my applications source tree and pray that I don't run into any symbol collision bugs, especially in static builds. |
Beta Was this translation helpful? Give feedback.
-
I'm bumping this thread because I ran into this issue recently. Because libsodium doesn't let the caller specify the number of threads, it's not possible to generate the correct key created by other implementation. I've compared 3 argon2id implementations: The code used to test all three implementations in in this gist: https://gist.github.com/z3bra/acee29fb2815e170c5674177beb041bc
As you can see, when p=1 (default hardcoded value for libsodium), all 3 computed hash are the same. However, when you change this value to 4 (as recommended per RFC 9106), the computed hash values from go and phc implementations change. As libsodium's value is hardcoded, the hash remain the same. Because of this, it is impossible to use libsodium when dealing with Argon2 keys that are generated elsewhere. I realize that adding this parameter to the API will break compatibility. But it would be nice to add this parameter to the Currently working on a patch (#1221) |
Beta Was this translation helpful? Give feedback.
-
I know this is not the first request for parallelism support in the
pwhash
API (#488/#986/#993), but it seems weird to me that this is not implemented. Let me elaborate:On #986 @jedisct1 commented:
Isn't the idea of having parallelism support that the computation is not much slower for desktop computers while it is slower for crackers using specialized hardware, because of the large amount of shared memory between multiple CPUs? This is also mentioned by someone on Crypto SE (although that in itself of course doesn't make it true).
The Argon2 draft RFC currently recommends p=4 lanes (it used to recommend choosing your own value (as the first parameter you choose, by the way, so before memory and then time), but probably this was changed because of portability).
Or does the comment mean that the slowdown on dedicated hardware is not that significant?
Of course not all password hashing functions support parallelism like Argon2 does, but I don't think that that should mean that we can't take advantage of it in functions that do support it.
Beta Was this translation helpful? Give feedback.
All reactions