/** Driver.java -- main module for our encryption program */ import java.io.*; // where BufferedReader is defined public class Driver { public static void main(String [] args) throws IOException { //System.out.println("There are " + args.length + " arguments."); System.out.print("Do you wish to encrypt or decrypt? (e/d) "); BufferedReader kbd = new BufferedReader(new InputStreamReader(System.in)); char choice = kbd.readLine().charAt(0); // Let's use the Caesar cipher as our encryption scheme. If we want // to change to another scheme, just use a different class that // implements the Encryption interface. Caesar cipher = new Caesar(); if (choice == 'e') { System.out.print("Enter text to encrypt: "); String input = kbd.readLine(); cipher.encrypt(input); } else if (choice == 'd') { System.out.print("Enter encrypted text: "); String input = kbd.readLine(); cipher.decrypt(input); } } }