Thursday, September 9, 2010

Designing Simple Brute-Force Algorithm

I decided to write a brute-force algorithm and as a start, it will be a simple one. This algorithm lists all possible character combinations of all lengths starting from 4 through 22. You can also extend its functionality to include space and non-alphanumeric characters.
I also decided to give this code the ability to save its stop point and  to restore it on next start. In other words, if your program stops at the combination 002, the next time it starts it will resume at 003 and so on. This property is implemented in most of password recovery programs which use brute-force attacks.

Here is the source code

This console application runs for 20 seconds generating the in-order combinations. Just before exit, it saves its stop point.

N.B. You can freely change the code to meet your needs.

N.B. The code is only for demonstration.

No comments:

Post a Comment