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)