// Brute force password cracker 1.0
// Copyright (C) 2020 Henrik Riskær
// This program was written for the Essential Programming course at Roskilde
// University as part of the curricular coding assignments.
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import java.util.Arrays;
import java.util.Random;
public class Main {
public static void main
(String[] args
){
int[] pw = pwGen(4);
System.
out.
println("Starting bruteforce of array...");
printArray(pw);
int solution = attack(pw);
System.
out.
println("Password Successfully brute forced. password is: " + solution
);
}
public static int[] pwGen(int digits){
int[] pw = new int[digits];
for(int i = 0; i < digits; i++){
pw[i] = rand.nextInt(10);
}
return pw;
}
public static void printArray(int[] diller){
for(int i = 0; i < diller.length; i++){
}
}
public static int arrayToInt(int[] intKassen){
int res = 0;
for (int i=0; i < intKassen.length; i++){
res = res*10;
res = res+intKassen[i];
}
return res;
}
public static int attack(int[] pw){
int n = arrayToInt(pw);
int i = 0;
for (i = 0; i < n; i++){
if(i != n){
System.
out.
println("it wasn't " + i
);
}
}
return i;
}
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}