Example #1
0
  @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);
  }
Example #2
0
  @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);
  }
Example #3
0
  @Test
  public void testEncryptShort() throws Exception {

    Encrypter.encrypt(testString, password);
  }
Example #4
0
  @Test
  public void testEncryptDecryptShort() throws Exception {

    String result = Encrypter.encrypt(testString, password);
    assertEquals(Encrypter.decrypt(result, password), testString);
  }
Example #5
0
  @Test
  public void testDecryptItem() throws Exception {

    Item item = new Item("link", "login", "pass");
    Encrypter.decryptItem(Encrypter.encryptItem(item, password), password);
  }
Example #6
0
 @Test
 public void testEncryptDecrypt() throws Exception {
   String result = encrypter.encrypt(testString);
   assertEquals(encrypter.decrypt(result), testString);
 }
Example #7
0
  @Test
  public void testDecrypt() throws Exception {

    encrypter.decrypt(encrypter.encrypt(testString));
  }
Example #8
0
 @Test
 public void testEncrypt() throws Exception {
   encrypter.encrypt(testString);
 }