import java.io.*;
import com.javamex.arcmexer.*;
public class Decryption{
public static void main(String[] args) {
//String pw = "12345678";
String line = null;
//int recCount = 0;
int count = 0;
String x = null;
try {
FileInputStream f = new FileInputStream("C://ReadZip.zip");
ArchiveReader r = ArchiveReader.getReader(f);
ArchiveEntry entry ;
FileReader fr = new FileReader("C://test.txt");
BufferedReader br = new BufferedReader(fr);
while ((entry = r.nextEntry())!= null && (line = br.readLine())!= null) {
String filename = entry.getFilename();
System.out.println("What is the password of " + filename + "?");
if (entry.isProbablyCorrectPassword(line)){
System.out.println("Password found: " + line);
count++;
if (count==1)
x = "st" ;
else if (count==2)
x="nd";
else
x="th";
System.out.println("We found the password with the: " + count + x + " trial");
}else{
System.out.println("That password isn't the correct.Try again");
}
}
} catch (Exception e){
System.out.println("Exception raised!");
e.printStackTrace();
}
}
}
Tags:
Replies are closed for this discussion.
© 2024 Created by Neil Coffey. Powered by