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

Optimize usage of SINGLE_HASH_MIN #5520

Open
solardiz opened this issue Aug 11, 2024 · 0 comments
Open

Optimize usage of SINGLE_HASH_MIN #5520

solardiz opened this issue Aug 11, 2024 · 0 comments

Comments

@solardiz
Copy link
Member

As @AlekseyCherepanov noticed, running "single crack" mode against bcrypt hashes on CPU without OpenMP is wasteful because our bcrypt implementation computes 3 hashes at a time, whereas SINGLE_HASH_MIN is 8, which isn't a multiple of 3. We should probably modify the code such that it rounds to a multiple of min_keys_per_crypt.

While looking into this, I see that for logging from john.c we try and infer the chunk size using SINGLE_HASH_MIN, but the actual code in single.c is now more complicated. So we may get logging inconsistent with what we actually do next. Fixing the above issue could introduce yet another inconsistency of this sort. In particular this message might be wrong:

        if ((options.flags & (FLG_SINGLE_CHK | FLG_BATCH_CHK)) && chunk < SINGLE_HASH_MIN)
                chunk = SINGLE_HASH_MIN;
        if (chunk > 1)
                log_event("- Candidate passwords %s be buffered and tried in chunks of %d",
                        min_chunk > 1 ? "will" : "may",
                        chunk);
@solardiz solardiz added this to the Potentially 2.0.0 milestone Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant