Skip to content

Instantly share code, notes, and snippets.

@mizanRahman
Created September 11, 2018 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mizanRahman/dc6af0160a0d79778b1276e3e66a3d16 to your computer and use it in GitHub Desktop.
Save mizanRahman/dc6af0160a0d79778b1276e3e66a3d16 to your computer and use it in GitHub Desktop.
package com.example.kpcat;
import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
import org.jasypt.encryption.StringEncryptor;
import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
@SpringBootApplication
@EnableEncryptableProperties
public class KpcatApplication {
public static void main(String[] args) {
SpringApplication.run(KpcatApplication.class, args);
}
@Bean("jasyptStringEncryptor")
public StringEncryptor stringEncryptor() {
return new StringEncryptor() {
@Override
public String encrypt(String message) {
return "encrypted " + message;
}
@Override
public String decrypt(String encryptedMessage) {
return "decrypted " + encryptedMessage;
}
};
}
}
@mizanRahman
Copy link
Author

compile('com.github.ulisesbocchio:jasypt-spring-boot:2.1.0')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment