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

Maximum password length: "Provided password longer than supported in command line utility" #339

Open
mb720 opened this issue Dec 30, 2021 · 1 comment

Comments

@mb720
Copy link

mb720 commented Dec 30, 2021

Hi and thanks for argon2!

Using version 20190702 of argon2, I hit the limit for maximum input length:

printf 'x%.0s' {1..128} | argon2 my_salt_is_here
Error: Provided password longer than supported in command line utility

Also in argon's source code I can see that the maximum password length is 127.

I was wondering:

  1. Whether there are ways around that length limit, the error message suggests that the command line utility doesn't support longer inputs. Maybe argon2 per se doesn't have that limitation.
  2. What's the reason for limiting input length to 127 bytes.

Thanks!

@LoganDark
Copy link

It's because the command-line utility doesn't expand the input buffer past that length:

char pwd[MAX_PASS_LEN], *salt;

  • Maybe argon2 per se doesn't have that limitation.

Correct, I think argon2 only has a limitation of 4GB (as that's the limit of a 32-bit unsigned integer).

2. What's the reason for limiting input length to 127 bytes.

I assume because it's stored on the stack. In my experience there's a convention to be nice to the stack and stay below ~1KB of usage. I'm sure if the buffer was allocated on the heap it would be able to be much larger. Perhaps you could open a PR to change it.

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

No branches or pull requests

2 participants