org.jasypt.salt.RandomSaltGenerator Java Examples

The following examples show how to use org.jasypt.salt.RandomSaltGenerator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EncryptionConfig.java    From dhis2-core with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Bean( "aes128StringEncryptor" )
public PooledPBEStringEncryptor aes128StringEncryptor()
{
    PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor();
    encryptor.setAlgorithm( "PBEWITHSHA256AND128BITAES-CBC-BC" );
    encryptor.setPassword( password );
    encryptor.setPoolSize( 4 );
    encryptor.setSaltGenerator( new RandomSaltGenerator() );

    return encryptor;
}
 
Example #2
Source File: EncryptorTest.java    From jasypt-spring-boot with MIT License 5 votes vote down vote up
@SneakyThrows
private void setup_PBEWITHHMACSHA512ANDAES_256() {
    SimplePBEByteEncryptor encryptor = new SimplePBEByteEncryptor();
    encryptor.setPassword("some password loco");
    encryptor.setSaltGenerator(new RandomSaltGenerator());
    encryptor.setIterations(1000);
    encryptor.setAlgorithm("PBEWITHHMACSHA512ANDAES_256");
    _PBEWITHHMACSHA512ANDAES_256 = encryptor;
}
 
Example #3
Source File: EncryptionConfig.java    From bearchoke with Apache License 2.0 4 votes vote down vote up
@Bean
public RandomSaltGenerator randomSaltGenerator() {
    return new RandomSaltGenerator();
}