forked from sinansonlu/CS102-Git-Tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCipherTest.java
24 lines (18 loc) · 964 Bytes
/
CipherTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Test class for Cipher
public class CipherTest {
public static void main(String[] args)
{
Cipher cipher = new Cipher();
// text1 is used for testing, encrypting followed by decrypting should return the original text
String text1 = "this should be encrypted now!";
String text1_encrypted = cipher.encrypt(text1);
String text1_decrypted = cipher.decrypt(text1_encrypted);
System.out.println("Original Text: " + text1);
System.out.println("Encrypted Text: " + text1_encrypted);
System.out.println("Decrypted Text: " + text1_decrypted);
System.out.println();
// text2 is the message to be decrypted, something meaningful should print if Cipher is working correctly
String text2 = "iu, git pldp hehocplvgk vj tiouvgk, plvj jliqay sduh jhgjh. ldeh d kiiy phos!";
System.out.println(cipher.decrypt(text2));
}
}