package kr.co.i4way.util;

import org.jasypt.encryption.StringEncryptor;
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;

import kr.co.i4way.util.JsonUtil;

public class Test {

	public static void main(String[] args) {
		JsonUtil.decrypt_param3("tVIs1T89WnKMXFMUdO/BUA==", "12345678901234567890123456789012", "1234567890123456", "Yes");
//		StringEncryptor newStringEncryptor = null;
//		try {
//			newStringEncryptor = createEncryptor("hyundai-motor");
//			String resultText = newStringEncryptor.encrypt("HCCCWAS1!");
//	        System.out.println(resultText);
//
//		} catch (Exception e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
	}
	
	private static StringEncryptor createEncryptor(String password){

        StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
        SimpleStringPBEConfig config = new SimpleStringPBEConfig();
        config.setPassword(password);
        config.setAlgorithm("PBEWithMD5AndTripleDES"); // 권장되는 기본 알고리즘
        config.setKeyObtentionIterations("1000");
        config.setPoolSize("1");
        config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator");
        config.setStringOutputType("base64");
        encryptor.setConfig(config);

        return encryptor;
    }
	
	
	
	

}
