Buenas, estou fazendo ainda meu trabalho para quebrar senhas com MD5. Queria usar threads estendendo uma classe thread, Neste código fazendo com que cada thread percorra uma parte do meu dicionário (dictAll), e não sei nem como começar. Alguém por favor poderia me dar uma luz?
código:
package testemd5;
import br.com.senacrs.util.MD5;
public class TesteMD5 {
@SuppressWarnings("empty-statement")
public static void main(String[] args) {
char dictAll[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D',
'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U',
'W', 'V', 'X', 'Y', 'Z', '!', '@', '#', '$', '%', '&', '*', '(', ')', '_', '-',
'+', '=', '[', ']', '{', '}', '?', '/', '|', '>', '<', '.', '\\'};
String dicthash[] = {"13240457817d091164402b9604824b67", "5438364b0199c0004432ac04dae29525",
"2271dc8fa2a6ff3b4c23180a66c480dc", "19d6ebafc1e11bea79fb2b85aa760ad9", "f3f3aa37990860260b2e6ceeaf672837",
"dcaff46aec8f457fa874d0b7a04960be", "f21ee05fa5d24c7de11e4aca9700aa8f", "827ccb0eea8a706c4c34a16891f84e7b",
"9605eb53e0da2675998ad751baf255ce", "58396401112fa9245099fff81ba63dec", "972c16f442eba60469680bf869dd6a89",
"50e318711a43cc8e965d90337f49deb8", "fe60293345d3e4f675441f1c4424ed4e", "d79096188b670c2f81b7001f73801117",
"48a58da106a36dd10852b229dfdc2088", "36510ae837f23c4da6e541a3e8edafb8", "9d495d6a637e83e277de834c2b31a8a1",
"54d9d99fad304a6d0329fc1fb6bdb517", "dfa8327f5bfa4c672a04f9b38e348a70", "70d06803ce18c714944dac18cd58f292",
"7a32b47d202ac6f583bbd9c42a0961ef", "69e80cd4d08679e2739f801516bfb170", "6cfe61694ee1bb13ae719d47c2f80b7a",
"e2ba49209f8ce01f1025d5f14400bf5b",};
System.out.println("Seja Bem Vindo!");
char palavra2[] = new char[5];
long timeI = System.currentTimeMillis();
for (int k = 0; k < dictAll.length; k++) {
palavra2[4] = dictAll[k];
for (int f = 0; f < dictAll.length; f++) {
palavra2[3] = dictAll[f];
for (int b = 0; b < dictAll.length; b++) {
palavra2[2] = dictAll[b];
for (int j = 0; j < dictAll.length; j++) {
palavra2[0] = dictAll[j];
for (int i = 0; i < dictAll.length; i++) {
palavra2[1] = dictAll[i];
String hash = MD5.gerarMD5(String.valueOf(palavra2));
//System.out.println("VALOR -> " + String.valueOf(palavra2));
//System.out.println("HASH: " + hash);
for (int h = 0; h < dicthash.length; h++) {
if (hash.equalsIgnoreCase(dicthash[h])) {
long total_quebra = ((System.currentTimeMillis() - timeI) / 1000);
System.out.println("SENHA QUEBRADA! EM: " + total_quebra + " segundos");
System.out.println("SENHA: " + String.valueOf(palavra2));
System.out.println("HASH: " + hash);
}
}
}
}
}
}
}
long timeF = System.currentTimeMillis();
long total = timeF - timeI;
System.out.println("Tempo Final: " + total);
}
}