@Test public void testEncryptDecryptItem() throws Exception { Item item = new Item("link", "login", "pass"); Item encryptedItem = Encrypter.encryptItem(item, password); assertEquals(Encrypter.decryptItem(encryptedItem, password), item); }
@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 testEncryptShort() throws Exception { Encrypter.encrypt(testString, password); }
@Test public void testEncryptDecryptShort() throws Exception { String result = Encrypter.encrypt(testString, password); assertEquals(Encrypter.decrypt(result, password), testString); }
@Test public void testDecryptItem() throws Exception { Item item = new Item("link", "login", "pass"); Encrypter.decryptItem(Encrypter.encryptItem(item, password), password); }
@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)); }
@Test public void testEncrypt() throws Exception { encrypter.encrypt(testString); }