1+ package base ;
2+ import java .util .Scanner ;
3+ import java .util .Random ;
4+
5+ public class Main {
6+
7+
8+ public static void main (String [] args ) {
9+
10+ // create a new scanner with the specified String Object
11+ Scanner scanner = new Scanner (System .in );
12+
13+ //Welcome Text and makes an line with no text to seperate the actual encryption/decryption
14+ System .out .println ("SafeFile 2018 Java Version" );
15+ System .out .println ("Liscenced with Apache Liscence, Version 2.0" );
16+ System .out .println ();
17+
18+ //Check if user wants to encrypt or decrypt
19+ //DECRYPT HAS NOT BEEN ADDED IN SO CODE IS COMMENTED OUT
20+ //System.out.println("Would you like to Encrypt or Decrypt (Select one in the same spelling)");
21+ // String EorD = scanner.next();
22+
23+ //if (EorD.equals("Encrypt")) {
24+
25+ Scanner scanner1 = new Scanner (System .in );
26+
27+ //Check how the user wants to encrypt
28+ System .out .println ("How Would You Like to Encrypt? - Available Currently: Ceaser Cypher" );
29+ System .out .println ("For Ceaser Cypher, enter Ceaser" ); //More would be added in as more encryption ways are added into the program
30+
31+ String howE = scanner .next ();
32+
33+ if (howE .equals ("Ceaser" )) {
34+
35+ System .out .println ("What is the text you would like to encrypt?" );
36+ String textE = scanner1 .next ();
37+
38+ System .out .println ("What is the offset for the Ceaser Cypher?" );
39+ String numE = scanner1 .next ();
40+
41+ int numEi = Integer .parseInt (numE );
42+
43+ String encrypted = Encrypter .encode (textE , numEi );
44+
45+ System .out .println ("Below is encrypted Text with Ceaser Cypher, offset of " + numE );
46+ System .out .println (encrypted );
47+
48+ // close the scanner
49+ scanner1 .close ();
50+ scanner .close ();
51+
52+ }
53+ //}
54+
55+ }
56+ //else if (EorD.equals("Decrypt")){
57+
58+ //Asks the user how they want to decrypt
59+ //System.out.println("How Would You Like to Decrypt? - Available Currently: Ceaser Cypher");
60+ //String howD = scanner.next();
61+
62+ //if(howD.equals("Ceaser Cypher")) {
63+
64+ //Asks user the text and offset they want to use to decrypt the ceaser cypher
65+ //System.out.println("What is the text you would like to decrypt?");
66+ // String textD = scanner.next();
67+
68+ //System.out.println("What is the offset for the Ceaser Cypher?");
69+ //String numD = scanner.next();
70+
71+ //int numDi = Integer.parseInt(numD);
72+
73+ //String decrypted = Encrypter.encode(textD, numDi);
74+
75+ //System.out.println(decrypted);
76+
77+ //System.out.println("please close and open the application again if you want to do another calculation");
78+
79+
80+ //}
81+
82+
83+
84+ //}
85+
86+ }
0 commit comments