-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for the hybrid mode of Argon2 for passphrases #287
add support for the hybrid mode of Argon2 for passphrases #287
Conversation
12e86c4
to
05fd1ba
Compare
We already allow the memory cost to be set to a value that is greater than 4GiB - only capping the maximum here when benchmarking is used. This handles the threads parameter in the same way.
f88aa4f
to
b48505c
Compare
Passphrase support currently hardcodes the use of argon2i, which is the data-independent version of Argon2. Whilst this has better side-channel resistance than data-dependent versions, it requires more iterations to protect against time-memory tradeoff attacks. Cryptsetup recently switch to argon2id by default for passphrase hashing, which is the hybrid version that provides a good balance between side-channel resistance and time-memory tradeoff. This introduces support for selecting between the 2 versions for passphrase support. There are other versions of Argon2, such as the data-dependent version which sacrifices side-channel resistance for better resistance against time-memory tradeoff attacks, but this isn't supported by the argon2 go package.
b48505c
to
d5b6604
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this has conflicts now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, the assumption around Mode values and using conversions is slightly odd. As one could have also declared type Argon2Mode = argon2.Mode perhaps?
argon2_test.go
Outdated
func (s *argon2Suite) TestModeConstants(c *C) { | ||
c.Check(Argon2i, Equals, Argon2Mode(argon2.ModeI)) | ||
c.Check(Argon2id, Equals, Argon2Mode(argon2.ModeID)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see we have this test that enforces the property but still a bit odd overall
I've just updated this to make |
Passphrase support currently hardcodes the use of argon2i, which is
the data-independent version of Argon2. Whilst this has better
side-channel resistance than data-dependent versions, it requires
more iterations to protect against time-memory tradeoff attacks.
Cryptsetup recently switch to argon2id by default for passphrase
hashing, which is the hybrid version that provides a good balance
between side-channel resistance and time-memory tradeoff.
This introduces support for selecting between the 2 versions for
passphrase support.
There are other versions of Argon2, such as the data-dependent version
which sacrifices side-channel resistance for better resistance against
time-memory tradeoff attacks, but this isn't supported by the argon2 go
package.