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

Improving performance of --show #2 #3990

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mohemiv
Copy link
Contributor

@mohemiv mohemiv commented Apr 17, 2024

Related: #3988

This PR adds a redundant signature check to modules 01711, 02100, 07500, 13100, 13400, 18200, 19600, 19700, 19800, 19900, 20200, 20300, 20400, 28800, 28900, and 29700 to enhance potfile reading performance.

These algorithms are the ones most commonly used in penetration testing. Enhancing them should improve the user experience.

Regarding magic constants in the code:

  /**
   * Checking the signature for performance optimization
   */

  if (line_len < 64) return (PARSER_SALT_LENGTH);

  if (strncmp(line_buf, SIGNATURE_SHA512B64S, strlen (SIGNATURE_SHA512B64S))) {
    return (PARSER_SIGNATURE_UNMATCHED);
  }

It wasn't initially introduced by me. I just increased the already existed constants:

  // assume no signature found
  if (line_len < 12) return (PARSER_SALT_LENGTH);

If you would like to change something, I'm ready to hear your suggestions.

…00, 13400, 18200, 19600, 19700, 19800, 19900, 20200, 20300, 20400, 28800, 28900, and 29700 to improve potfile reading performance
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