Skip to content

Instantly share code, notes, and snippets.

@mehmetcemyucel
Last active April 4, 2021 09:25
Show Gist options
  • Save mehmetcemyucel/ea932a25248b6a8cc72e16034c02d939 to your computer and use it in GitHub Desktop.
Save mehmetcemyucel/ea932a25248b6a8cc72e16034c02d939 to your computer and use it in GitHub Desktop.
mcy-sb-jasypt
@SpringBootApplication
public class McySbJasyptApplication {
public static void main(String[] args) {
SpringApplication.run(McySbJasyptApplication.class, args);
}
@Bean(name = "mcyEncryptor")
public StringEncryptor stringEncryptor() {
PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor();
SimpleStringPBEConfig config = new SimpleStringPBEConfig();
config.setPassword("anyPrivateKey");
config.setAlgorithm("PBEWithMD5AndDES");
config.setKeyObtentionIterations("1000");
config.setPoolSize("1");
config.setProviderName("SunJCE");
config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator");
config.setStringOutputType("base64");
encryptor.setConfig(config);
return encryptor;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment