partner code를 key사용

This commit is contained in:
jaewohong
2026-01-08 09:48:27 +09:00
parent bfa74e5d7e
commit e947a0ca7a
2 changed files with 22 additions and 34 deletions
@@ -2,36 +2,27 @@ package com.eactive.eai.transformer.function.crypto;
import java.util.Stack;
import com.eactive.eai.common.context.ElinkTransactionContext;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.function.PostfixMathCommand;
import com.eactive.eai.common.property.PropManager;
import java.nio.charset.StandardCharsets;
import org.apache.commons.lang3.StringUtils;
// kj bank import 2025-09-23 jwhong
//import org.kjbank.simple.core.crypto.seed.SeedUtil;
import com.eactive.eai.common.seed.SeedKJ;
//import com.eactive.eai.common.seed.SeedKJ;
//security-1.0.0.jar 사용으로 변경 2026-01-05
import com.eactive.eai.security.seed.Seed;
import com.eactive.eai.common.context.ElinkTransactionContext;
public class SeedKJDecrypt extends PostfixMathCommand {
public SeedKJDecrypt() {
numberOfParameters = 2;
numberOfParameters = 1;
}
public void run(Stack inStack) throws ParseException {
checkStack(inStack);
//샘플
String seedSalt = ElinkTransactionContext.getSeedSalt();
System.out.println("seedSalt = " + seedSalt);
// USER FUNCTION에서 Parameter 에서 가져옴
Object param2 = inStack.pop();
String param2Str = String.valueOf(param2); // null 안전 처리
String decryptKey = StringUtils.leftPad(param2Str, 16, '0');
String seedKey = ElinkTransactionContext.getSeedKey();
String decryptKey = StringUtils.leftPad(seedKey, 16, '0');
Object param = inStack.pop();
@@ -57,7 +48,7 @@ public class SeedKJDecrypt extends PostfixMathCommand {
}
try {
String decryptedData = SeedKJ.decrypt(new String(value, StandardCharsets.UTF_8), decryptKey);
String decryptedData = Seed.decrypt(decryptKey, new String(value, StandardCharsets.UTF_8));
inStack.push(decryptedData);
} catch (Exception e) {
@@ -66,4 +57,3 @@ public class SeedKJDecrypt extends PostfixMathCommand {
}
}
}
@@ -5,29 +5,27 @@ import java.util.Stack;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.function.PostfixMathCommand;
import com.eactive.eai.common.property.PropManager;
import java.nio.charset.StandardCharsets;
// security-1.0.0.jar 사용으로 변경 2026-01-05
import com.eactive.eai.security.seed.Seed;
//kj bank import 2025-09-23 jwhong
import com.eactive.eai.common.seed.SeedKJ;
import com.eactive.eai.common.seed.SeedCipher;
//import com.eactive.eai.common.seed.SeedKJ;
import org.apache.commons.lang3.StringUtils;
import java.util.Base64;
//import org.kjbank.simple.core.crypto.seed.SeedUtil;
import com.eactive.eai.common.context.ElinkTransactionContext;
public class SeedKJEncrypt extends PostfixMathCommand {
public SeedKJEncrypt() {
numberOfParameters = 2;
numberOfParameters = 1;
}
public void run(Stack inStack) throws ParseException {
checkStack(inStack);
// USER FUNCTION에서 Parameter 에서 가져옴
Object param2 = inStack.pop();
String param2Str = String.valueOf(param2); // null 안전 처리
String encryptKey = StringUtils.leftPad(param2Str, 16, '0');
String seedKey = ElinkTransactionContext.getSeedKey();
String encryptKey = StringUtils.leftPad(seedKey, 16, '0');
Object param = inStack.pop();
@@ -53,7 +51,7 @@ public class SeedKJEncrypt extends PostfixMathCommand {
}
try {
String encryptedData = SeedKJ.encrypt(new String(value, StandardCharsets.UTF_8), encryptKey);
String encryptedData = Seed.encrypt(encryptKey, new String(value, StandardCharsets.UTF_8));
inStack.push(encryptedData);
} catch (Exception e) {