Package org.jasypt.util.text

Examples of org.jasypt.util.text.BasicTextEncryptor.decrypt()


    te.setPassword(PASSWORD_FOR_ENCRYPTION);
    // Encrypt text. By default the algorithm used is PBEWithMD5AndDES
    String encryptedText = te.encrypt(TEXT_TO_ENCRYPT);
    System.out.printf("testTextEncryptionUsingBasicTextEncryptor : '%s' become '%s'\n", TEXT_TO_ENCRYPT, encryptedText);
    // Valid "encrypted" text
    Assert.assertEquals(te.decrypt(encryptedText), TEXT_TO_ENCRYPT);
  }

  /**
   * This test show how encrypt a text using a strong encryptor (using
   * symetric key)
View Full Code Here


    }

    private static String desencriptar(String cadena, String clave) {
         BasicTextEncryptor desencriptador = new BasicTextEncryptor();
         desencriptador.setPassword(clave);
         String cadenaDesencriptada = desencriptador.decrypt(cadena);
         return cadenaDesencriptada;
    }

    /**
    * @param args the command line arguments
View Full Code Here

        String message = "super secret message";
        String encrypted = encryptor.encrypt(message);
        System.out.println(encrypted);

        assertEquals(message, encryptor.decrypt(encrypted));

    }

    @Test
    public void propsTest() throws IOException {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.