@Test public void testEncrpytion() throws Exception { String key = new KeyGenerator().generateKey(); Encrypter e = new Encrypter(Base64.decodeBase64(key)); System.out.println(key); String str = "Ticket to ride"; String enc = e.encrypt(str); String dec = e.decrypt(enc); System.out.println(str + " -> " + enc + " -> " + dec); assertEquals(str, dec); }
@Test public void testDecryptShort() throws Exception { Encrypter.decrypt(Encrypter.encrypt(testString, password), password); }
@Test public void testEncryptDecryptShort() throws Exception { String result = Encrypter.encrypt(testString, password); assertEquals(Encrypter.decrypt(result, password), testString); }
@Test public void testEncryptDecrypt() throws Exception { String result = encrypter.encrypt(testString); assertEquals(encrypter.decrypt(result), testString); }
@Test public void testDecrypt() throws Exception { encrypter.decrypt(encrypter.encrypt(testString)); }