|
@@ -4,6 +4,7 @@ import com.its.utils.AES256Util;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
|
|
import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
|
|
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;
|
|
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;
|
|
|
|
+import org.jasypt.salt.StringFixedSaltGenerator;
|
|
import org.junit.jupiter.api.Test;
|
|
import org.junit.jupiter.api.Test;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
|
|
@@ -39,8 +40,8 @@ public class ItsOpServerApplicationTests {
|
|
// ==> SimpleStringPBEConfig 사용시 아래 3개 반드시 설정해야함
|
|
// ==> SimpleStringPBEConfig 사용시 아래 3개 반드시 설정해야함
|
|
config.setPassword(encKey); // 암호화에 사용할 키
|
|
config.setPassword(encKey); // 암호화에 사용할 키
|
|
config.setPoolSize(1); // Pool Size
|
|
config.setPoolSize(1); // Pool Size
|
|
- //config.setSaltGenerator(new StringFixedSaltGenerator("fixedSalt")); // 고정으로 암호화(Default: Random)
|
|
|
|
- config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator");
|
|
|
|
|
|
+ config.setSaltGenerator(new StringFixedSaltGenerator("fixedSalt")); // 고정으로 암호화(Default: Random)
|
|
|
|
+ //config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator");
|
|
//config.setAlgorithm("PBEWithMD5AndTripleDES");
|
|
//config.setAlgorithm("PBEWithMD5AndTripleDES");
|
|
config.setAlgorithm("PBEWithMD5AndDES"); // Jasypt 를 이용한 암호화 알고리즘
|
|
config.setAlgorithm("PBEWithMD5AndDES"); // Jasypt 를 이용한 암호화 알고리즘
|
|
config.setProviderName("SunJCE");
|
|
config.setProviderName("SunJCE");
|
|
@@ -58,8 +59,8 @@ public class ItsOpServerApplicationTests {
|
|
private String stringOutputType = "base64";*/
|
|
private String stringOutputType = "base64";*/
|
|
encryptor.setConfig(config);
|
|
encryptor.setConfig(config);
|
|
|
|
|
|
- String yiits = encryptor.encrypt("yiits");
|
|
|
|
- String rutis = encryptor.encrypt("rutis");
|
|
|
|
|
|
+ String yiits = encryptor.encrypt("PTATMS");
|
|
|
|
+ String rutis = encryptor.encrypt("PTATMS");
|
|
log.info("{}", yiits);
|
|
log.info("{}", yiits);
|
|
log.info("{}", rutis);
|
|
log.info("{}", rutis);
|
|
}
|
|
}
|