Spardan
02-21-2005, 10:02 AM
Hey guys... thought I might be able to pick your brains with this...
I'm developing a distributed password cracker, in order to look at different load balancing algorithms. Most, such as DJohn and LC5, break up the task beforehand and you then load each machine in the cluster with their portion of the task and wait for them to complete. I'm aiming to do this dynamically.
So far, I have a recursive algorithm to generate all the combinations of a character set for a set string length, e.g., for a charset of "ab" and a string length of 3, the algorithm will generate all combinations of a and b in a 3-character string.
I'm doing this with 2 arrays. One contains the character set, the other is an integer array, the length of the string, with all bits initialised to 0.
The algorithm works by incrementing the integer array as if it were a counter, and generating the string from the values in the arrays, such as:
char array : 0 | 1 |
a | b |
int array 0 | 0 | 0 | so string is aaa
int array 1 | 0 | 0 | so string is baa
and so on.
This is all working fine though it may seem a bit kludgey to some. My problem is that I need to find a way to break up the possible variations of the int array to pass them out dynamically, e.g. tell one machine to start from 0 | 0 | 0 | and end at 1 | 1 | 0 |, tell another to start at 1 | 1 | 1 | and end at n | n | n |
I'm guessing this needs recursion too, as the single machine method I've developed does (in order to increment an n length array successfully), but I can't see it, as doing it this way basically means I'm working with different-base number systems for different string lengths.
Any ideas at all, no matter how random would be appreciated, or if anyone knows a forum full of applied math geeks who won't kill me for not knowing calculus, that would be great.
I'm developing a distributed password cracker, in order to look at different load balancing algorithms. Most, such as DJohn and LC5, break up the task beforehand and you then load each machine in the cluster with their portion of the task and wait for them to complete. I'm aiming to do this dynamically.
So far, I have a recursive algorithm to generate all the combinations of a character set for a set string length, e.g., for a charset of "ab" and a string length of 3, the algorithm will generate all combinations of a and b in a 3-character string.
I'm doing this with 2 arrays. One contains the character set, the other is an integer array, the length of the string, with all bits initialised to 0.
The algorithm works by incrementing the integer array as if it were a counter, and generating the string from the values in the arrays, such as:
char array : 0 | 1 |
a | b |
int array 0 | 0 | 0 | so string is aaa
int array 1 | 0 | 0 | so string is baa
and so on.
This is all working fine though it may seem a bit kludgey to some. My problem is that I need to find a way to break up the possible variations of the int array to pass them out dynamically, e.g. tell one machine to start from 0 | 0 | 0 | and end at 1 | 1 | 0 |, tell another to start at 1 | 1 | 1 | and end at n | n | n |
I'm guessing this needs recursion too, as the single machine method I've developed does (in order to increment an n length array successfully), but I can't see it, as doing it this way basically means I'm working with different-base number systems for different string lengths.
Any ideas at all, no matter how random would be appreciated, or if anyone knows a forum full of applied math geeks who won't kill me for not knowing calculus, that would be great.