-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProcess.java
More file actions
44 lines (28 loc) · 925 Bytes
/
Process.java
File metadata and controls
44 lines (28 loc) · 925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
public class Process{
public static void main(String[] args){
ArrayList<Key> key = new ArrayList<Key>();
String choice;
String cipher;
String plain;
Scanner scan = new Scanner(System.in);
//asks user for file name with cipher key
System.out.print("Enter a file name containing your key: ");
String fileName = scan.next();
// ask user to encrypt or decrypt using the key
System.out.print("Would you like to encrypt or decrypt? ");
choice = scan.next();
// ask for name of file containing message
System.out.println("Enter a file name containing your message: ");
String fileName2 = scan.next();
//perform the appropriate substitution on the message
if (choice.equals("encrypt"))
{
}
else if (choice.equals("decrypt"))
{
}
//display both text and cipher
for(Key ke : key)
System.out.println(ke.getCipher() + "\n" + ke.getPlain());
}
}