public class MEDS {
public static void main(String [] args) {
userInput input = new userInput();
String choice = "Enter your choice: ";
String dphrase = "Enter the phrase you want encrypted: ";
String pdphrase;
String ephrase = "Enter the phrase you want decrypted: ";
String pephrase;
System.out.println("Welcome to M.E.D.S.");
System.out.println("");
System.out.println("Mike's Encryption / Decryption Software");
System.out.println("");
System.out.println("Options:");
System.out.println("-----------------");
System.out.println("| 1. Encryption |");
System.out.println("| 2. Decryption |");
System.out.println("-----------------");
System.out.println("");
input.getUserInput(choice);
if (input.input.equals("1")) {
System.out.println("");
pdphrase = input.getUserInput(dphrase);
if (pdphrase.contains("a")) {
pdphrase = pdphrase.replaceAll("a", "Z2");
}
if (pdphrase.contains("b")) {
pdphrase = pdphrase.replaceAll("b", "C4");
}
if (pdphrase.contains("c")) {
pdphrase = pdphrase.replaceAll("c", "F1");
}
if (pdphrase.contains("d")) {
pdphrase = pdphrase.replaceAll("d", "T0");
}
if (pdphrase.contains("e")) {
pdphrase = pdphrase.replaceAll("e", "R5");
}
if (pdphrase.contains("f")) {
pdphrase = pdphrase.replaceAll("f", "Q1");
}
if (pdphrase.contains("g")) {
pdphrase = pdphrase.replaceAll("g", "K2");
}
if (pdphrase.contains("h")) {
pdphrase = pdphrase.replaceAll("h", "O0");
}
if (pdphrase.contains("i")) {
pdphrase = pdphrase.replaceAll("i", "K6");
}
if (pdphrase.contains("j")) {
pdphrase = pdphrase.replaceAll("j", "N5");
}
if (pdphrase.contains("k")) {
pdphrase = pdphrase.replaceAll("k", "L1");
}
if (pdphrase.contains("l")) {
pdphrase = pdphrase.replaceAll("l", "S5");
}
if (pdphrase.contains("m")) {
pdphrase = pdphrase.replaceAll("m", "R1");
}
if (pdphrase.contains("n")) {
pdphrase = pdphrase.replaceAll("n", "S3");
}
if (pdphrase.contains("o")) {
pdphrase = pdphrase.replaceAll("o", "S0");
}
if (pdphrase.contains("p")) {
pdphrase = pdphrase.replaceAll("p", "A8");
}
if (pdphrase.contains("q")) {
pdphrase = pdphrase.replaceAll("q", "L6");
}
if (pdphrase.contains("r")) {
pdphrase = pdphrase.replaceAll("r", "E4");
}
if (pdphrase.contains("s")) {
pdphrase = pdphrase.replaceAll("s", "I3");
}
if (pdphrase.contains("t")) {
pdphrase = pdphrase.replaceAll("t", "F3");
}
if (pdphrase.contains("u")) {
pdphrase = pdphrase.replaceAll("u", "M3");
}
if (pdphrase.contains("v")) {
pdphrase = pdphrase.replaceAll("v", "P7");
}
if (pdphrase.contains("w")) {
pdphrase = pdphrase.replaceAll("w", "L3");
}
if (pdphrase.contains("x")) {
pdphrase = pdphrase.replaceAll("x", "J7");
}
if (pdphrase.contains("y")) {
pdphrase = pdphrase.replaceAll("y", "H8");
}
if (pdphrase.contains("z")) {
pdphrase = pdphrase.replaceAll("z", "N2");
}
if (pdphrase.contains("A")) {
pdphrase = pdphrase.replaceAll("A", "N3");
}
if (pdphrase.contains("B")) {
pdphrase = pdphrase.replaceAll("B", "R0");
}
if (pdphrase.contains("C")) {
pdphrase = pdphrase.replaceAll("C", "B3");
}
if (pdphrase.contains("D")) {
pdphrase = pdphrase.replaceAll("D", "O4");
}
if (pdphrase.contains("E")) {
pdphrase = pdphrase.replaceAll("E", "Y4");
}
if (pdphrase.contains("F")) {
pdphrase = pdphrase.replaceAll("F", "N0");
}
if (pdphrase.contains("G")) {
pdphrase = pdphrase.replaceAll("G", "G6");
}
if (pdphrase.contains("H")) {
pdphrase = pdphrase.replaceAll("H", "Y1");
}
if (pdphrase.contains("I")) {
pdphrase = pdphrase.replaceAll("I", "U8");
}
if (pdphrase.contains("J")) {
pdphrase = pdphrase.replaceAll("I", "L4");
}
if (pdphrase.contains("K")) {
pdphrase = pdphrase.replaceAll("K", "E7");
}
if (pdphrase.contains("L")) {
pdphrase = pdphrase.replaceAll("L", "W0");
}
if (pdphrase.contains("M")) {
pdphrase = pdphrase.replaceAll("M", "Y3");
}
if (pdphrase.contains("N")) {
pdphrase = pdphrase.replaceAll("N", "E0");
}
if (pdphrase.contains("O")) {
pdphrase = pdphrase.replaceAll("O", "S1");
}
if (pdphrase.contains("P")) {
pdphrase = pdphrase.replaceAll("P", "R6");
}
if (pdphrase.contains("Q")) {
pdphrase = pdphrase.replaceAll("Q", "F4");
}
if (pdphrase.contains("R")) {
pdphrase = pdphrase.replaceAll("R", "C0");
}
if (pdphrase.contains("S")) {
pdphrase = pdphrase.replaceAll("S", "O6");
}
if (pdphrase.contains("T")) {
pdphrase = pdphrase.replaceAll("T", "Y0");
}
if (pdphrase.contains("U")) {
pdphrase = pdphrase.replaceAll("U", "B8");
}
if (pdphrase.contains("V")) {
pdphrase = pdphrase.replaceAll("V", "Q0");
}
if (pdphrase.contains("W")) {
pdphrase = pdphrase.replaceAll("W", "O5");
}
if (pdphrase.contains("X")) {
pdphrase = pdphrase.replaceAll("X", "B6");
}
if (pdphrase.contains("Y")) {
pdphrase = pdphrase.replaceAll("Y", "B1");
}
if (pdphrase.contains("Z")) {
pdphrase = pdphrase.replaceAll("Z", "V6");
}
System.out.println("");
System.out.println("Encrypted Phrase:");
System.out.println("");
System.out.println(pdphrase);
System.out.println("");
}
if (input.input.equals("2")) {
System.out.println("");
pephrase = input.getUserInput(ephrase);
if (pephrase.contains("V62")) {
pephrase = pephrase.replaceAll("V62" , "a");
}
System.out.println("");
System.out.println("Decrypted Phrase:");
System.out.println("");
System.out.println(pephrase);
System.out.println("");
}
}
}