-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChiperTest.java
More file actions
54 lines (48 loc) · 2.35 KB
/
Copy pathChiperTest.java
File metadata and controls
54 lines (48 loc) · 2.35 KB
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
45
46
47
48
49
50
51
52
53
54
public class ChiperTest {
public static void main(String[] args){
System.out.println("Ceaser's Cipher Method");
String message = "Hello Ceaser";
CeaserCipher cc = new CeaserCipher();
String EncryptedString = cc.encryption(3, message);
String DecryptedString = cc.decryption(3, EncryptedString);
System.out.println("ENC : "+EncryptedString);
System.out.println("DEC : "+DecryptedString);
System.out.println("-----------------------------------\n");
System.out.println("Keyword Cipher Method");
String sndMessage = "hellokeyword";
KeywordCipher kc = new KeywordCipher();
kc.makeMap("network");
String KCES = kc.encryption(sndMessage);
String KCDS = kc.decryption(KCES);
System.out.println("ENC : "+KCES);
System.out.println("DEC : "+KCDS);
System.out.println("-----------------------------------\n");
System.out.println("DoubleMap Cipher Method");
String thdMessage = "hellodoublemap";
DoubleMapCipher dmc = new DoubleMapCipher();
dmc.makeFirstMap("network");
dmc.makeSecondMap(3);
String DMCES = dmc.encryption(thdMessage);
String DMCDS = dmc.decryption(DMCES);
System.out.println("ENC : "+DMCES);
System.out.println("DEC : "+DMCDS);
System.out.println("-----------------------------------\n");
System.out.println("Column Cipher Method");
String frtMessage = "heaven helps those who help themselves";
ColumnCipher coc = new ColumnCipher(7);
String COCES = coc.encryption(frtMessage);
String COCDS = coc.decryption(COCES);
System.out.println("ENC : "+COCES);
System.out.println("DEC : "+COCDS);
System.out.println("-----------------------------------\n");
System.out.println("Column&Keyword Cipher Method");
String fthMessage = "heaven helps those who help themselves";
ColumnKeywordCipher ckc = new ColumnKeywordCipher();
ckc.setKeywordAndColumnLength("network", 7);
String CKCES = ckc.encryption(fthMessage);
String CKCDS = ckc.decryption(CKCES);
System.out.println("ENC : "+CKCES);
System.out.println("DEC : "+CKCDS);
System.out.println("-----------------------------------\n");
}
}