Hey guys, basically what i'm trying to do is take each line from two text files and store them into two variables, salt and original. I then want to pass these 2 variables to a different method called:
crypt(String salt, String original)
How would I go about doing this?
Many thanks
public static void main(String[] args)
{
String salt = new String();
String original = new String();
try{
// Open the file that is the first
FileReader wordlist = new FileReader("/home/cougar/students/u335122/Desktop/Crypt/wordlist.txt");
FileReader password = new FileReader("/home/cougar/students/u335122/Desktop/Crypt/salt.txt");
BufferedReader bufRead = new BufferedReader(wordlist);
BufferedReader bufRead2 = new BufferedReader(password);
int count = 0;
int count1 = 0;
original = bufRead.readLine();
salt = bufRead2.readLine();
//count++;
//count1++;
// Read through file one line at time. Print line
while (original != null){
System.out.println(original);
original = bufRead.readLine();
// count++;
}
while (salt != null){
System.out.println(salt);
salt = bufRead2.readLine();
// count1++;
}
bufRead.close();
bufRead2.close();
} catch (Exception e) {
System.out.println("Error: " + e.getMessage());
}
System.out.println
(
"[" + salt + "] [" + original + "] => [" +
JCrypt.crypt(salt, original) + "]"
);
}