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 use of decode_base64 #9

Open
jawaad-ahmad opened this issue Aug 2, 2020 · 0 comments
Open

Optimize use of decode_base64 #9

jawaad-ahmad opened this issue Aug 2, 2020 · 0 comments

Comments

@jawaad-ahmad
Copy link

Povl Ole Haarlev Olsen commented on the original blog on 25 Apr 2015 (https://blog.rootshell.be/2010/11/03/bruteforcing-ssh-known_hosts-files/) stating:

Another optimization step would be to move the decode_base64($saltStr[$i]) step from searchHash() (i.e. ALL THE TIME) to the loop where you read the file (i.e. ONCE per salt).

I also think it make senses to use decode_base64() on the digest in the read loop (i.e. once) and later compare it with $hmac->digest (instead of b64digest). No need to spend time on base64 encoding all the time, if we don’t really need it.

I'm assuming this is what's meant in the Todo list in the code:

# Todo
# ----
# - Increase performances
# ...
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

1 participant