Skip to content
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

internal/argon2: return errors #294

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

chrisccoulson
Copy link
Collaborator

We're currently wrapping x/crypto/argon2 which panics on some invalid
arguments. Instead, move the checking of these arguments in order to
avoid some panics.

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.
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.
This makes it clearer that we are actually testing something valid.
We're currently wrapping x/crypto/argon2 which panics on some invalid
arguments. Instead, move the checking of these arguments in order to
avoid some panics.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant