Exemplo n.º 1
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);
  }
Exemplo n.º 2
0
  @Test
  public void testEncryptShort() throws Exception {

    Encrypter.encrypt(testString, password);
  }
Exemplo n.º 3
0
  @Test
  public void testEncryptDecryptShort() throws Exception {

    String result = Encrypter.encrypt(testString, password);
    assertEquals(Encrypter.decrypt(result, password), testString);
  }
Exemplo n.º 4
0
 @Test
 public void testEncryptDecrypt() throws Exception {
   String result = encrypter.encrypt(testString);
   assertEquals(encrypter.decrypt(result), testString);
 }
Exemplo n.º 5
0
  @Test
  public void testDecrypt() throws Exception {

    encrypter.decrypt(encrypter.encrypt(testString));
  }
Exemplo n.º 6
0
 @Test
 public void testEncrypt() throws Exception {
   encrypter.encrypt(testString);
 }