# Thread: wpa cap cracking probs with brute force

1. if you can program try and write a program to do it for you, you will have to choose what char sets you want ie lowercase/uppercase/numeric???

you can use simple formula to calculate how many permutations you will generate

ie if you only use lowercase and uppercase letters you are looking at 46!/(46-10)! = 1.5*10^16

dont want to hijack your thread but I would be intressted to know how you calculate roughly how long this will take a modern processor

lastly how do you know its 10 characters long??

2. Code:
```import java.util.*;

//************charsets***********
//abcdefghijklmnopqrstuvwxyz
//ABCDEFGHIJKLMNOPQRSTUVWXYZ
//0123456789
//?!"#\$%&'()*+,-./:;<=>?[\]^_`{|}~

public class bruteforcer{

static String charset = new String("abcdefgh");
static final int maxlen = 3;

public static void main(String[] args){
bruteforcer(stringtochararray(charset));
}

public static void bruteforcer(char[] charset){

//initialize array to -1
short[] perm = new short[maxlen];
for ( int i = 0; i < perm.length; i++ ) {
perm[i] = -1;
}

//all possibilities
StringBuilder attempt = new StringBuilder();
POSSIBILITIES: for (;;) {
//add 1 to lowest charpos and carry over
perm[0]++;
for ( int i = 0; i < perm.length; i++ ){
if ( perm[i] == charset.length ) {
perm[i] = 0;
if ( i+1 == perm.length ) {
break POSSIBILITIES;
} else {
perm[i+1]++;
}
} else {
break;
}
}
//construct string
for ( int i = perm.length - 1; i >= 0; i-- ) {
if ( perm[i] >= 0 ) {
attempt.append(charset[perm[i]]);
}
}
System.out.println(attempt);
attempt.setLength(0);
}

}//end of brute method

public static char[] stringtochararray(String mystring){
char[] temparray = new char[mystring.length()];
for(int p =0;p<mystring.length();p++){			//putting chars into array called myarray
temparray[p] = mystring.charAt(p);
}
return temparray;
}//end of stringtochararray

}//end of class```
here is some code in java, put any letters you want in charset and change maxlen to 10
it will then print out every combination of letters from your desired charset

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•