mirror of
https://github.com/headporter81/specialsource-homepage-backend.git
synced 2026-10-07 15:21:09 +09:00
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
package company.specialsource.config;
|
||||
|
||||
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.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@EnableEncryptableProperties
|
||||
public class JasyptConfig {
|
||||
|
||||
@Value("${jasypt.encryptor.password}")
|
||||
private String password;
|
||||
|
||||
@Bean("jasyptStringEncryptor")
|
||||
public StringEncryptor stringEncryptor() {
|
||||
PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor();
|
||||
SimpleStringPBEConfig config = new SimpleStringPBEConfig();
|
||||
config.setPassword(password); // 암호화 키 (절대 외부에 유출 금지!)
|
||||
config.setAlgorithm("PBEWithMD5AndDES");
|
||||
config.setKeyObtentionIterations("1000");
|
||||
config.setPoolSize("1");
|
||||
config.setProviderName("SunJCE");
|
||||
config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator");
|
||||
config.setIvGeneratorClassName("org.jasypt.iv.NoIvGenerator");
|
||||
config.setStringOutputType("base64");
|
||||
encryptor.setConfig(config);
|
||||
return encryptor;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user