import java.util.*; public class EncryptionClient { public static void main(String[] args) { int key = 2; Encryption e = new Encryption(key); Decryption d = new Decryption(key); String plaintext = ""; String ciphertext = ""; Scanner input = new Scanner(System.in); System.out.println("Welcome to the encryption/decryption portal"); boolean isDone = false; while (!isDone) { System.out.println("What phrase would you like to encrypt?"); System.out.print("> "); plaintext = input.nextLine(); ciphertext = e.encrypt(plaintext); System.out.println("\"" + plaintext + "\" has been encrypted to \"" + ciphertext + "\""); System.out.println(); System.out.println("What phrase would you like to decrypt?"); System.out.print("> "); ciphertext = input.nextLine(); plaintext = d.decrypt(ciphertext); System.out.println("\"" + ciphertext + "\" has been decrypted to \"" + plaintext + "\""); System.out.println(); System.out.println("Would you like to do another round? (y/n)"); System.out.print("> "); String answer = input.nextLine(); if (answer.startsWith("n") || answer.startsWith("N")) { isDone = true; } } } }