hacking in java
Hi all,
I need some help with my coding. basically the idea is to break
6 passwords using a dictionary attack or in this case
i want to read from file and compare with the encrypted password.
any experts can help me break the password? :(
/*Checks input passwords with passwords in file*/
staticboolean check_password(String t)throws IOException
{
int[] pswdfile;
int no_of_passwords=6;
boolean found=false;
//This is the password file
pswdfile=newint[no_of_passwords];
pswdfile[0]=328310406;
pswdfile[1]=312771985;
pswdfile[2]=731343680;
pswdfile[3]=519808427;
pswdfile[4]=534288373;
pswdfile[5]=504933131;
long encrypted_t=Encrypt(t);
for(int i=0;i<no_of_passwords;i++)
{
if(encrypted_t==pswdfile[i])
{
System.out.println(t+" is the password of user number "+(i+1));
System.out.println("Search successful at: "+getCurrentTimestamp());
found=true;
}
}
return found;
}
/*This is the main program.*/
publicstaticvoid main(String[] args)throws IOException
{
BufferedReader in =new BufferedReader(new InputStreamReader(System.in));
String password="";
do{
System.out.print("Enter your password: ");
password=in.readLine();
//continue looping until a correct password is entered
try{
BufferedReader in =new BufferedReader(new FileReader("infilename"));
String str;
while ((str = in.readLine()) !=null){
process(str);
}
in.close();
}catch (IOException e){
}
}while(check_password(password)!=true);
}
>

