This post is mainly relative to Algorithms and Optimization of Java.
Please don’t comment with negative criticizing statements regarding the title, this is for my own education XD.
There’s so much more than my full implementation to even make this thing usable.
To begin, I got bored and decided to make one :
I’ve been working on it for about 2 days so far.
Not to brag but rather to give some details, it can currently handle up to 11 slots. (Numbers, Uppercase/Lowercase mixes)
Version 0.4: http://i47.tinypic.com/16gao88.png
Version 0.5:
At the moment the algorithm is like so:
Before we begin:
[Pseudo Code Definition]
[A Quote I heard]
Pseudo Code:
/*
* Long method >...<
*/
private boolean brute_force_for(TargetPassword target, int target_slots, String target_query_types[]) {
String password = (String) targetPassword.targetObject;
switch (target_slots) {
/* 1 SLOT FOR PASSWORD */
case 1:
for (a = 0; a < target_query_types.length; a++) {
COMPUTATED_DATA[a] = appendLetter(a);
if (password.equals(COMPUTATED_DATA[a])) {
return pass_cracked(password);
}
debug(COMPUTATED_DATA[a]);
}
break;
/* 2 SLOTS FOR PASSWORD */
case 2:
for (a = 0; a < target_query_types.length; a++)
for (ab = 0; ab < target_query_types.length; ab++) {
COMPUTATED_DATA[a] = (new StringBuilder(String.valueOf(appendLetter(a)))).append(appendLetter(ab)).toString();
if (password.equals(COMPUTATED_DATA[a])) {
return pass_cracked(password);
}
debug(COMPUTATED_DATA[a]);
}
break;
}
}
Code Notes:
The for loops will continue for a total of 11 switch statements, i removed these to keep the code short.
But as you can imagine it gets lengthy and bulky while processing hundreds of thousands / millions of combinations per second.
What my main questions are:
How can I optimize the method seen above.
Should I use StringBuilders or not?
Can I wrap my for loops into a more optimized / less repetitive way?
I’m using String[] arrays for my allowed characters constants, is this efficient?
I’m using a Switch() statement, is this efficient?
Is anything you see unnecessary / not where it should be?
Have one of these been built ‘Virus Free’ using Java?
Is it possible for this to be processed on a GPU for faster computations?
Closing Statement:
Hope somebody can help me, thanks.
If a staff member finds this post ‘malicious’ please note there’s so much more needed for this code to work due to it’s state of being ‘pseudo’.
Thanks guys, looking forward to any feedback.