Created
December 2, 2012 19:19
-
-
Save benfb/4190534 to your computer and use it in GitHub Desktop.
VigenereRunner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class VigenereRunner | |
{ | |
public static void main(String[] args) | |
{ | |
//instantiate a Scanner object | |
Scanner scan = new Scanner(System.in); | |
//prompt the user for the text to encrypt | |
System.out.println("Plain text: "); | |
//assign user input to a variable | |
String pt = scan.next(); | |
//prompt the user for a keyword to use | |
System.out.println("Keyword: "); | |
//assign user input to a variable | |
String key = scan.next(); | |
//instantitate a Vigenere object and pass in the user input | |
Vigenere vigenere = new Vigenere(pt, key); | |
//text your program | |
System.out.println(vigenere.equals(vigenere)); //tests to see if the key is the same as the original message | |
System.out.println(vigenere.encrypt()); //encrypts and prints | |
System.out.println(vigenere.decrypt()); //decrypts and prints | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment