Package org.jasypt.util.text

Examples of org.jasypt.util.text.StrongTextEncryptor.encrypt()


    // Declare a strong encryptor
    StrongTextEncryptor te = new StrongTextEncryptor();
    // Set password to use
    te.setPassword(PASSWORD_FOR_ENCRYPTION);
    // Encrypt text. By default the algorithm used is PBEWithMD5AndTripleDES
    String encryptedText = te.encrypt(TEXT_TO_ENCRYPT);
    System.out.printf("testTextEncryptionUsingStrongTextEncryptor : '%s' become '%s'\n", TEXT_TO_ENCRYPT, encryptedText);
    // Valid "encrypted" text
    Assert.assertEquals(te.decrypt(encryptedText), TEXT_TO_ENCRYPT);
  }
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.