Hi all I'm new and I'm horrible at Java. I've written this decryption code for a Caesar cipher but now I need to decrypt a one-time pad. Is there any way to simply work with what I have and rewrite it to work with a one-time pad? Or must I start over. Here is what I have.
import java.io.*;
class Decrypt {
public static void main(String[] args) {
int rotation = Integer.parseInt(args[1]);
try {
FileInputStream input = new FileInputStream(args[0]);
FileOutputStream output = new FileOutputStream("out.txt");
while(input.available()>0) {
int theByte = input.read();
theByte = theByte - rotation;
output.write(theByte);
}
}
catch(Exception e) {
}
}
}