암복호화 상용 모듈 추가

master
mjkhan21 10 months ago
parent 5e585c4cb8
commit afdc7ca8e7

@ -0,0 +1,41 @@
# DGuard Java API Agent Configuration File
isEncrypt=false
daemon_number=5
daemon_ip=211.119.124.9
daemon_ip2=127.0.0.1
daemon_ip3=127.0.0.1
daemon_port=9999
log_level=5
cache=ON
info_index=1
certification=null
private_key=null
Query_Collection_Mode=3
db_type=oracle
token_file=3rd-party/dguard/token/xit_agent.token
audit_path=3rd-party/dguard/logs/
server_name=localhost
audit_option=false
prove_mode=false
DBuser=oracle
SecureId=
SecurePwd=
TokenPwd=
Double_Enc_Flag=true
Double_Enc_Error_Flag=false
Random_Algorithm=SHA256DRBG
log_server_use=false
log_server_ip=127.0.0.1
log_server_port=19999
acc_flag=false
Timeout=3000
Policy_File_Flag=false
Policy_File_Path=
Trim_Flag=true
Exception_Flag=true
Encoding_Flag=false
Encoding_Type=UTF-8
BLOB_Decrypt_Size=976
Hmac_Digest_Use=false
Jar_HMAC_Checksum=cAKi10ktdv9T+G1BY+ax0eIHD4Y0WM8KFHB6BVupcx8=
Config_HMAC_Checksum=nkNp7yruN6EJ5XLYkSdDZVrATe99sK7qBsz9Yw+2MBY=

Binary file not shown.

Binary file not shown.

@ -0,0 +1 @@
7141df12354b9cc23474c858645b9859c349215e4c40bdc477840ae58164a751

Binary file not shown.

Binary file not shown.

@ -0,0 +1,36 @@
import com.Ineb.Dguard.*;
import com.Ineb.Exception.DguardLoginException;
import com.Ineb.Exception.DguardNetworkException;
import com.Ineb.Exception.DGuardPropertyException;
import java.sql.*;
import java.util.*;
import java.io.*;
public class APITest2 {
public static void main(String[] args) {
try {
DguardManager dm = DguardManager.Init("db_agent", "Agent!1700", "Agent!1700", "./3rd-party/dguard/conf/dguard.conf");
String Table = "CRYPTO";
String Column1 = "PWD";
String Column2 = "ENC";
String[] Data = {"1234", "000010000001", "9999999999999"};
String HashStr = dm.MsgDigest(Table, Column1, Data[0]);
System.out.println("MsgDigest " + " : [" + HashStr + "]");
String EncStr;
String DecStr;
for (int i = 0; i < Data.length; i++) {
EncStr = dm.Encrypt(Table, Column2, Data[i]);
System.out.println("Encrypt " + i + " : [" + EncStr + "]");
DecStr = dm.Decrypt(Table, Column2, EncStr);
System.out.println("Decrypt " + i + " : [" + DecStr + "]");
}
} catch(Exception e) {
e.printStackTrace();
}
}
}

@ -0,0 +1,2 @@
javac -classpath C:\Ineb\lib\SecureDriver.jar;C:\Ineb\lib\INICrypto_v4.0.4.jar;C:\Ineb\lib\INISAFEPKI_v1.1.0.jar;C:\Ineb\lib\tibero4-jdbc.jar APITest2.java

@ -0,0 +1,2 @@
javac -classpath ../lib/DguardAPI.jar:../lib/MagicJCrypto-v2.0.0.0.jar:../lib/log4j-1.2.17.jar APITest2.java

Binary file not shown.

@ -0,0 +1,69 @@
import com.Ineb.Dguard.*;
import com.Ineb.Exception.DguardLoginException;
import com.Ineb.Exception.DguardNetworkException;
import com.Ineb.Exception.DGuardPropertyException;
import java.io.*;
import java.sql.*;
public class MySQLDec {
static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
static final String DB_URL = "jdbc:mysql://192.168.100.211:3306/testdb";
static final String USERNAME = "ineb";
static final String PASSWORD = "ineb1234";
public static void main(String[] args) {
DguardManager dm = null;
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rset=null;
try{
dm = DguardManager.Init("bidfunding", "Agent!1700", "Agent!1700", "/home/dguard/javaapi/conf/dguard.conf");
Class.forName(JDBC_DRIVER);
conn = DriverManager.getConnection(DB_URL,USERNAME,PASSWORD);
conn.setAutoCommit(false);
System.out.println("- MySQL Connection");
String selectSql = "SELECT seq, data FROM tbl01";
pstmt = conn.prepareStatement(selectSql.toString());
rset = pstmt.executeQuery();
while(rset.next()){
int seq = rset.getInt("SEQ");
String data01 = rset.getString("data");
String decdata01 = dm.Decrypt("TBL", "ENC", data01);
System.out.print("SEQ : " + seq + "\n");
System.out.print("DATA : " + data01 + "\n");
System.out.print("DEC : " + decdata01 + "\n");
}
rset.close();
pstmt.close();
conn.close();
}catch(SQLException se1){
se1.printStackTrace();
}catch(Exception ex){
ex.printStackTrace();
}finally{
try{
if(pstmt!=null)
pstmt.close();
}catch(SQLException se2){
}
try{
if(conn!=null)
conn.close();
}catch(SQLException se){
se.printStackTrace();
}
}
System.out.println("- MySQL Connection Close");
}
}

Binary file not shown.

@ -0,0 +1,98 @@
import com.Ineb.Dguard.*;
import com.Ineb.Exception.DguardLoginException;
import com.Ineb.Exception.DguardNetworkException;
import com.Ineb.Exception.DGuardPropertyException;
import java.io.*;
import java.sql.*;
public class MySQLEnc {
static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
static final String DB_URL = "jdbc:mysql://192.168.100.211:3306/testdb";
static final String USERNAME = "ineb";
static final String PASSWORD = "ineb1234";
public static void main(String[] args) {
DguardManager dm = null;
Connection conn = null;
PreparedStatement pstmt = null;
PreparedStatement updatePstmt = null;
ResultSet rset=null;
try{
dm = DguardManager.Init("bidfunding", "Agent!1700", "Agent!1700", "/home/dguard/javaapi/conf/dguard.conf");
Class.forName(JDBC_DRIVER);
conn = DriverManager.getConnection(DB_URL,USERNAME,PASSWORD);
conn.setAutoCommit(false);
System.out.println("- MySQL Connection");
String selectSql = "SELECT seq, data FROM tbl01";
pstmt = conn.prepareStatement(selectSql.toString());
rset = pstmt.executeQuery();
String updateSql = "UPDATE tbl01 SET data = ? WHERE seq = ?";
updatePstmt = conn.prepareStatement(updateSql.toString());
int commitCnt = 0;
while(rset.next()){
int seq = rset.getInt("SEQ");
String data01 = rset.getString("data");
String encdata01 = dm.Encrypt("TBL", "ENC", data01);
System.out.print("SEQ : " + seq + "\n");
System.out.print("DATA : " + data01 + "\n");
System.out.print("ENC : " + encdata01 + "\n");
updatePstmt.setString(1, encdata01);
updatePstmt.setInt(2, seq);
updatePstmt.addBatch();
updatePstmt.clearParameters();
if ( commitCnt > 0 && commitCnt % 1000 == 0 ) {
updatePstmt.executeBatch();
updatePstmt.clearBatch();
conn.commit();
System.out.println(commitCnt + ", " + data01 + ", " + encdata01);
}
commitCnt++;
}
updatePstmt.executeBatch();
conn.commit();
conn.setAutoCommit(true);
System.out.println("Commit count : " + commitCnt);
rset.close();
updatePstmt.close();
pstmt.close();
conn.close();
}catch(SQLException se1){
se1.printStackTrace();
}catch(Exception ex){
ex.printStackTrace();
}finally{
try{
if(pstmt!=null)
pstmt.close();
}catch(SQLException se2){
}
try{
if(conn!=null)
conn.close();
}catch(SQLException se){
se.printStackTrace();
}
}
System.out.println("- MySQL Connection Close");
}
}

@ -0,0 +1,2 @@
javac -classpath ../../lib/DguardAPI.jar:../../lib/INICrypto_v4.1.1.jar:../../lib/INISAFEPKI_v1.1.21.jar:../../lib/log4j-1.2.17.jar MySQLDec.java

@ -0,0 +1,2 @@
javac -classpath ../../lib/DguardAPI.jar:../../lib/INICrypto_v4.1.1.jar:../../lib/INISAFEPKI_v1.1.21.jar:../../lib/log4j-1.2.17.jar MySQLEnc.java

@ -0,0 +1,2 @@
java -Xms64m -Xmx128m -classpath .:../../lib/DguardAPI.jar:../../lib/MagicJCrypto-v2.0.0.0.jar:../../lib/log4j-1.2.17.jar:../../lib/com.mysql.jdbc_5.1.5.jar MySQLDec

@ -0,0 +1,2 @@
java -Xms64m -Xmx128m -classpath .:../../lib/DguardAPI.jar:../../lib/MagicJCrypto-v2.0.0.0.jar:../../lib/log4j-1.2.17.jar:../../lib/com.mysql.jdbc_5.1.5.jar MySQLEnc

Binary file not shown.

@ -0,0 +1,68 @@
import com.Ineb.Dguard.*;
import com.Ineb.Exception.DguardLoginException;
import com.Ineb.Exception.DguardNetworkException;
import com.Ineb.Exception.DGuardPropertyException;
import java.io.*;
import java.sql.*;
public class PGSQLDec {
static final String DB_URL = "jdbc:postgresql://10.22.170.25:5432/miracle";
static final String USERNAME = "miracle";
static final String PASSWORD = "q!fvYOP^evn";
public static void main(String[] args) {
DguardManager dm = null;
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rset=null;
try{
dm = DguardManager.Init("miraclefunding", "Agent!1700", "Agent!1700", "/home/inebsoft/javaapi/conf/dguard.conf");
conn = DriverManager.getConnection(DB_URL,USERNAME,PASSWORD);
conn.setAutoCommit(false);
System.out.println("- PostgreeSQL Connection");
String selectSql = "SELECT id, seyfert_guid FROM admin_model";
pstmt = conn.prepareStatement(selectSql.toString());
rset = pstmt.executeQuery();
while(rset.next()){
int id = rset.getInt("id");
String data01 = rset.getString("seyfert_guid");
System.out.print("ID : " + id + "\n");
System.out.print("DATA : " + data01 + "\n");
String decdata01 = dm.Decrypt("TBL", "ENC", data01);
System.out.print("DEC : " + decdata01 + "\n");
}
rset.close();
pstmt.close();
conn.close();
}catch(SQLException se1){
se1.printStackTrace();
}catch(Exception ex){
ex.printStackTrace();
}finally{
try{
if(pstmt!=null)
pstmt.close();
}catch(SQLException se2){
}
try{
if(conn!=null)
conn.close();
}catch(SQLException se){
se.printStackTrace();
}
}
System.out.println("- PostgreeSQL Connection Close");
}
}

@ -0,0 +1,96 @@
import com.Ineb.Dguard.*;
import com.Ineb.Exception.DguardLoginException;
import com.Ineb.Exception.DguardNetworkException;
import com.Ineb.Exception.DGuardPropertyException;
import java.io.*;
import java.sql.*;
public class PGSQLEnc {
static final String DB_URL = "jdbc:postgressql://127.0.0.1:5432/miracle";
static final String USERNAME = "miracle";
static final String PASSWORD = "q!fvYOP^evn";
public static void main(String[] args) {
DguardManager dm = null;
Connection conn = null;
PreparedStatement pstmt = null;
PreparedStatement updatePstmt = null;
ResultSet rset=null;
try{
dm = DguardManager.Init("miraclefunding", "Agent!1700", "Agent!1700", "/home/inebsoft/javaapi/conf/dguard.conf");
conn = DriverManager.getConnection(DB_URL,USERNAME,PASSWORD);
conn.setAutoCommit(false);
System.out.println("- PostgreeSQL Connection");
String selectSql = "SELECT seq, data FROM tbl01";
pstmt = conn.prepareStatement(selectSql.toString());
rset = pstmt.executeQuery();
String updateSql = "UPDATE tbl01 SET data = ? WHERE seq = ?";
updatePstmt = conn.prepareStatement(updateSql.toString());
int commitCnt = 0;
while(rset.next()){
int seq = rset.getInt("SEQ");
String data01 = rset.getString("data");
String encdata01 = dm.Encrypt("TBL", "ENC", data01);
System.out.print("SEQ : " + seq + "\n");
System.out.print("DATA : " + data01 + "\n");
System.out.print("ENC : " + encdata01 + "\n");
updatePstmt.setString(1, encdata01);
updatePstmt.setInt(2, seq);
updatePstmt.addBatch();
updatePstmt.clearParameters();
if ( commitCnt > 0 && commitCnt % 1000 == 0 ) {
updatePstmt.executeBatch();
updatePstmt.clearBatch();
conn.commit();
System.out.println(commitCnt + ", " + data01 + ", " + encdata01);
}
commitCnt++;
}
updatePstmt.executeBatch();
conn.commit();
conn.setAutoCommit(true);
System.out.println("Commit count : " + commitCnt);
rset.close();
updatePstmt.close();
pstmt.close();
conn.close();
}catch(SQLException se1){
se1.printStackTrace();
}catch(Exception ex){
ex.printStackTrace();
}finally{
try{
if(pstmt!=null)
pstmt.close();
}catch(SQLException se2){
}
try{
if(conn!=null)
conn.close();
}catch(SQLException se){
se.printStackTrace();
}
}
System.out.println("- PostgreeSQL Connection Close");
}
}

@ -0,0 +1,2 @@
javac -classpath ../../lib/DguardAPI.jar:../../lib/INICrypto_v4.1.1.jar:../../lib/INISAFEPKI_v1.1.21.jar:../../lib/log4j-1.2.17.jar PGSQLDec.java

@ -0,0 +1,2 @@
javac -classpath ../../lib/DguardAPI.jar:../../lib/INICrypto_v4.1.1.jar:../../lib/INISAFEPKI_v1.1.21.jar:../../lib/log4j-1.2.17.jar PGSQLEnc.java

@ -0,0 +1,2 @@
java -Xms64m -Xmx128m -classpath .:../../lib/DguardAPI.jar:../../lib/MagicJCrypto-v2.0.0.0.jar:../../lib/log4j-1.2.17.jar:../../lib/postgresql-9.3-1100.jdbc4.jar PGSQLDec

@ -0,0 +1,2 @@
java -Xms64m -Xmx128m -classpath .:../../lib/DguardAPI.jar:../../lib/MagicJCrypto-v2.0.0.0.jar:../../lib/log4j-1.2.17.jar:../../lib/postgresql-9.3-1100.jdbc4.jar PGSQLEnc

@ -0,0 +1,2 @@
java -classpath .;..\lib\SecureDriver.jar;..\lib\INICrypto_v4.0.4.jar;..\lib\INISAFEPKI_v1.1.0.jar;..\lib\tibero4-jdbc.jar APITest2

@ -0,0 +1,2 @@
java -Xms64m -Xmx128m -classpath .:../lib/DguardAPI.jar:../lib/MagicJCrypto-v2.0.0.0.jar:../lib/log4j-1.2.17.jar: APITest2

@ -0,0 +1 @@
dFP7QMHS2p+NoG/K/NqCbe4D/wBDg6QZNWbkHZwrsu2TB9J5YJn/IXWInHxpux3OafVU0WUmbs4BH+Np7FVQnfyI1w71J7WlKh3XsZkxXVIbkkRGyFHhIFmvIi9kSvs1uIJO7HTL2/JQDn3/hRtZCbuJBfxy/pRA+sm1Y+KDBPXky8pauyP0ABSXivx44ol/ETGj5Qc5/yiElpdtu2i14tMoUgkfYLXRlNkz74oHFsCC5oRWxajcLK9WNFe9+iv5YYEJngdBush+X8rrQJc0M1gaqAEBagv06RTZrfd/Cfm9BSBVDVuaHiHM4BunUzsidjRoZADwbJxnbl+rA2Tf+fUQbTZakwToaPYH9sSOamlkfuqF68J+pNZkYRtVmWNk9qDoWRwz8i77foo6lmWGiQVr2tq3O2vrfq21QicL1ope3xiIA5Xp4ZW44WFiNZ+7BDZHzNGX8PaS7vOBWkmM2rpByNi19LXnij2gp+Rfo5mMSEgxj3bx/SGcOQ7KWZ7nfa8Gqmk2b5fiUrFgHHlNQoX8/0vXcYAp93yjiZKiVnyg0TLAD2DAOGvBWUZXyGtqV85zcb8r+vRFUgrIu1IQCR1EC7+MOiyuDKj/SD5hqWm/0IxizCIPGsZAFw6Cn+6rXUJ4U5r2U74yQmYLPnguDmDiGbQpY0kv/0fgTaNmBJjmeJqYCOWDUtnEoLrqDqliiH+L/o21KgZNv2nZi9a+Ryq/UoSU6sm8a5gvLewhGk9LZ+lQUfmlDAOwe/qnapQGQWPFkHlJUUL5xDWuUjUsLrR3Txuy6gqrmZnaBK/SEme2zBSOxT4dsjY+C2Zl5NF7y3pL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OWHWTdBQRaOFlEKQzupcRPpp9dBtmu9zuQsf9ntXUcdpD2XanqxU2FUoqM54lbmb9AggNm4ud9QKksYWrTcA7T0rMdlyWDpiz3/tTNFfwtJlUOZNilyF7j2uN9xPlxsMu1r3MZqUtVqF+mlmMXzaP6B/NETk6ObtERwfJ05p+nv93M9+Vil09xvtmxqWAY7I1UW5no8FW2nlBoy5cKGtLilfCywpC55vYybfnoV4qgdKxiF/AokWPP3zPP6d/8WSdoCAAB4lpZtmcQfQI31tI9EbQUev79PVLPBScJePeOkCLExM11ghrtuUgCaAk8VWTenqWEixZU19w+qnWpFlg6jsvZSjgIiQfjMsZb01EH2+eheaKHSEGUFzPvvkng0UTQBcxhnOGusyPzVKYgNStpO1rzd4UGnNv04yJOf32/6HIgWxsH

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save