private static final String SECURE_STRING = System.getProperty( "org.uberfire.secure.key", "org.uberfire.admin" );
private static final String SECURE_ALGORITHM = System.getProperty( "org.uberfire.secure.alg", "PBEWithMD5AndDES" );
@Override
public String encrypt( final String plainText ) {
final StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
encryptor.setPassword( SECURE_STRING );
encryptor.setAlgorithm( SECURE_ALGORITHM );
String result = plainText;
try {
result = encryptor.encrypt( plainText );
} catch ( EncryptionOperationNotPossibleException e ) {
log.error( "Unable to encrypt",
e );
}
return result;