Java Code Examples for org.jasypt.salt.RandomSaltGenerator

The following examples show how to use org.jasypt.salt.RandomSaltGenerator. These examples are extracted from open source projects. 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 Project: dhis2-core   Author: dhis2   File: EncryptionConfig.java    License: 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 Project: jasypt-spring-boot   Author: ulisesbocchio   File: EncryptorTest.java    License: 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 Project: bearchoke   Author: bjornharvold   File: EncryptionConfig.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
public RandomSaltGenerator randomSaltGenerator() {
    return new RandomSaltGenerator();
}