WO2015046655A1 - 자가변환 기반 애플리케이션 코드 난독화 장치 및 그 방법 - Google Patents

자가변환 기반 애플리케이션 코드 난독화 장치 및 그 방법 Download PDF

Info

Publication number
WO2015046655A1
WO2015046655A1 PCT/KR2013/008750 KR2013008750W WO2015046655A1 WO 2015046655 A1 WO2015046655 A1 WO 2015046655A1 KR 2013008750 W KR2013008750 W KR 2013008750W WO 2015046655 A1 WO2015046655 A1 WO 2015046655A1
Authority
WO
WIPO (PCT)
Prior art keywords
code
important
unit
application
critical
Prior art date
Application number
PCT/KR2013/008750
Other languages
English (en)
French (fr)
Inventor
이정현
정진혁
Original Assignee
숭실대학교 산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 숭실대학교 산학협력단 filed Critical 숭실대학교 산학협력단
Priority to US14/360,304 priority Critical patent/US9230123B2/en
Priority to EP13894475.6A priority patent/EP2897074B1/en
Priority to JP2015542939A priority patent/JP5996810B2/ja
Publication of WO2015046655A1 publication Critical patent/WO2015046655A1/ko

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/14Protecting executable software against software analysis or reverse engineering, e.g. by obfuscation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/121Restricting unauthorised execution of programs
    • G06F21/125Restricting unauthorised execution of programs by manipulating the program code, e.g. source code, compiled code, interpreted code, machine code

Definitions

  • the present invention relates to an apparatus and method for obfuscating an application code, and more particularly, to an apparatus and method for obfuscating an application code using a self-transformation-based obfuscation technique.
  • the existing application obfuscation apparatus for Java language and the method apply obfuscation by changing the code structure constituting the application for an application running in a Java Virtual Machine.
  • the obfuscated application is composed of the command set and object file structure that operate in the Java virtual machine as before the obfuscation is applied.
  • the reverse engineering vulnerabilities of managed code include the following: Compiled object code contains source code information such as class name, member variable name, method name, and the code is explicitly structured to find specific logic through reverse engineering. It is easy to analyze.
  • the Android application is composed of managed code running on the Dalvik Virtual Machine and is stored in a Dalvik Executable (DEX) file format.
  • Android applications also contain the same reverse engineering vulnerabilities in managed code as Java applications.
  • An object of the present invention is to provide a self-transformation based application code obfuscation device and method for protecting Android applications.
  • Application code obfuscation device for achieving the above object, the input unit for receiving the code used for the application, by analyzing the input code to be protected from application forgery or forgery attack
  • a code separation unit for separating the code into a general code including a critical code that is needed and an important code caller for calling the critical code, and an important code connection unit for encrypting the critical code and storing address information of each of the critical codes
  • An encryption unit for inserting address information, a vector table generator for inserting a dummy code into the general code, converting the important code caller to call the dummy code, and generating a vector table including vector information of the important code Insert into the critical code, the application seal
  • a control unit for inserting an important code calling unit converting unit into the important code so that the important code calling unit calls the important code at the time of execution, and a code combining unit for generating the application by combining the general code and the important code.
  • a first compiling unit for compiling important code added with the important code connection unit, the vector table generating unit, the important code calling unit conversion unit in a native environment, and the general code converted by the important code calling unit to call dummy code in a managed environment. It may further include a second compilation unit for compiling to generate an executable file.
  • the encryption unit may encrypt a binary code by applying a self-conversion-based code protection technique to the compiled critical code.
  • the code conversion unit may add a startup routine for loading the general code in association with the important code.
  • the scrambler may further include a scrambler that scrambles a sensitive identifier defined in the sensitive code and the general code by a meaningless character or a string.
  • the general code in the form of a DEX file may be converted into an optimized optimized DEX (ODEX) file and loaded into a Dalvik virtual machine (DVM).
  • ODEX optimized optimized DEX
  • DVM Dalvik virtual machine
  • the encrypted important code connection unit, the vector table generation unit, the important code call unit conversion unit, and the important code are decrypted, the vector table generation unit generates the vector table, and the important code call unit conversion unit Converts a significant code to be called, and when the important code caller calls a critical code through a vector value recorded in the vector table, the important code connection unit uses the vector table and the address information of the critical code, It can be executed by calling important code corresponding to the value.
  • an application obfuscation method using an application obfuscation device receiving a code used for the application, and analyzing the input code, it is necessary to be protected from application forgery or forgery attack.
  • Step executing the application A step of inserting in said critical code parts important call code conversion unit to said critical code portion invoked to call the critical code, and a step of generating said application by combining the normal code and critical code.
  • the code constituting the application is separated into a sensitive code and a general code, and encryption is applied in different environments to compensate for reverse engineering vulnerabilities existing in the managed code. You can increase the sex.
  • the critical code caller for calling important codes is stored in the form of calling dummy code when the application is not executed, and the static code of the attacker is converted to call the actual important code using the self-transformation technique when the application is executed. And prevent dynamic analysis.
  • FIG. 1 is a block diagram of an application obfuscation device according to an embodiment of the present invention.
  • FIG. 2 is a flowchart of an application obfuscation method according to an embodiment of the present invention.
  • FIG. 3 is a diagram illustrating a file structure of a critical code according to an embodiment of the present invention.
  • FIG. 4 is a diagram illustrating a file structure of an obfuscated critical code according to an embodiment of the present invention.
  • FIG. 5 is a flowchart illustrating a process of executing an application by a client terminal according to an embodiment of the present invention.
  • 6A and 6B illustrate a process of executing an obfuscated application by a client terminal according to an exemplary embodiment of the present invention.
  • FIG. 7 is a diagram illustrating a vector table according to an embodiment of the present invention.
  • FIG. 1 is a view for explaining an application obfuscation device according to an embodiment of the present invention.
  • an application obfuscation apparatus 100 may include an input unit 110, a code separator 120, a code converter 130, a scrambler 140, and an encryption unit 145.
  • the controller 150 may include a code combiner 160, and may further include a compiler 170.
  • the input unit 110 receives an application code.
  • the input code is a code for generating an application, and may be a code in the form of a source code or a managed code.
  • the code separating unit 120 analyzes the code input from the input unit 110 and separates the important code that needs to be protected from application forgery or tampering attacks into a general code other than the important code.
  • the code conversion unit 130 converts the important code separated by the code separation unit 120 from managed code to native code.
  • the scrambler 140 scrambles the important code and the sensitive identifier defined in the general code with meaningless characters or strings.
  • the encryption unit 145 encrypts the binary code by applying a self-conversion-based code protection technique to the compiled critical code.
  • the controller 150 inserts the dummy code into the general code to convert the important code caller to call the dummy code. Also, a vector table generation unit for generating a vector table including vector information of a critical code is inserted into the critical code. In addition, the controller 150 inserts an important code caller converting unit into the important code so that the important code caller calls the important code when the application is executed.
  • the code combiner 160 combines the encrypted general code and the important code to generate a combined file that can be distributed to the client.
  • a file having an apk (Android package) extension corresponds to a combined file.
  • the compiling unit 170 may include a first compiling unit 171 that operates in a native environment to compile an important file, and a second compiling unit 172 that operates in a managed environment to compile general code.
  • the first compiling unit 171 compiles the critical code added with the important code connection unit, the vector table generation unit, and the important code call unit conversion unit in a native environment.
  • the second compiling unit 172 generates an executable file by compiling general code converted by the important code calling unit to call dummy code in a managed environment.
  • FIG. 2 is a flowchart of an application obfuscation method according to an embodiment of the present invention.
  • the input unit 110 receives an application code (S210).
  • the input unit 110 may be provided with an input interface unit in the form of a keypad.
  • the input code may be source code or code in the form of a managed code that may be executed in a Java Virtual Machine (JVM) or a Dalvik Virtual Machine (DVM).
  • JVM Java Virtual Machine
  • DVM Dalvik Virtual Machine
  • the code separating unit 120 analyzes the code input from the input unit 110 and separates the important code that needs to be protected from an application forgery or tampering attack into a general code other than the important code (S220).
  • the general code may include a sensitive method calling routine capable of calling the important code or the native code converted from the important code in the general code area.
  • Critical code refers to code that needs to be protected from forgery or tampering by an attacker from the user's point of view.
  • codes other than important codes are called general codes.
  • Core code can be used synonymously with critical code.
  • the code separator 120 may determine a code that matches the important code model in the inputted execution code as the important code using a prestored important code model.
  • the code conversion unit 130 converts the important code separated by the code separation unit 120 from the managed code to the native code (S230). That is, the code converting unit 130 converts an important code in the form of a managed code into a native code.
  • Native code is code that runs in a CPU environment and is closer to binary code than managed code, unlike managed code that runs in a JVM or DVM.
  • the code conversion unit 130 may convert the important code into the C code.
  • important code may be used synonymously with native code or C code.
  • Critical code is stored in native code sections in the form of Executable and Linkable Format (ELF).
  • ELF Executable and Linkable Format
  • the ELF type has an advantage that the structure of the code is not explicitly distinguished, so that it is not easily exposed to dynamic analysis or static analysis for code forgery or modulation compared to the DEX type.
  • the ELF form consists of low-level CPU instructions closer to machine language than Dalvik instructions, making it difficult for an attacker to perform dynamic and static analysis.
  • the code conversion unit 130 may add a startup routine for loading in association with the important code to the general code (S235).
  • the initiating routine may include a Java Native Interface (JNI) function.
  • JNI Java Native Interface
  • the scrambler 140 scrambles the important code and the sensitive identifier defined in the general code with a meaningless character or a string (S240).
  • Scramble Identifier is a type of batch obfuscation that makes reverse engineering difficult by replacing an identifier in a code with one or more alphabetical sequences.
  • the important code has a native file structure as shown in the left figure of FIG.
  • FIG. 3 is a diagram illustrating a file structure of a critical code according to an embodiment of the present invention
  • FIG. 4 is a diagram illustrating a file structure of an obfuscated important code according to an embodiment of the present invention.
  • the export table includes addresses of a plurality of important codes (important codes A, important codes B, ...), and each address is stored in a native code section in a library form.
  • the important code B Corresponding to the significant code A, the important code B, .
  • the encryption unit 145 encrypts the character string (S245). That is, the encryption unit 145 encrypts the string by using data obfuscation techniques such as data storage, data encoding, and data ordering for strings in critical codes in a native environment. You can do
  • the encryption unit 145 generates an important code connection unit in the form of a code in a native code section as shown in the right figure of FIG. 3, where the important code connection unit is for each of the native codes defined in the export table of the left view of FIG. 3. Contains address information.
  • the encryption unit 145 merges the addresses for each of the native codes defined in the Export Table of the left figure of FIG. 3, and generates an address of the critical code connection unit as shown in the right figure of FIG. 3 (S250). .
  • address information indicating the position of the important code connection unit is stored in the export table.
  • control unit 150 inserts a dummy code (Dummy code, garbage code) in the general code in the form of Java code (S255), and the important code call unit to call the dummy code to call the important code dummy code (S255)
  • the conversion is made (S260). In this way, by converting the dummy code to call, it prevents the static attack from the attacker, and converts the important code to be called by the self-transformation technique when the application is executed to ensure normal execution.
  • the controller 150 inserts a vector table generator for generating a vector table into the important code (S270).
  • the vector table is used to call the important code later when the application is loaded at the client terminal.
  • control unit 150 inserts an important code call unit conversion unit into the important code (S275).
  • the important code caller conversion unit converts the important code callers that call the dummy code when the application is executed to call the important code so that the application is executed normally.
  • the first compiling unit 171 compiles the critical code added with the critical code connection unit, the vector table generation unit, and the important code calling unit conversion unit, and the encryption unit 145 protects the code based on the self-conversion based on the compiled important code.
  • the technique it is possible to encrypt the binary code (S280).
  • the important codes are encrypted together with an important code connection unit, a vector table generation unit, and an important code calling unit conversion unit. It has a combined structure.
  • the second compiling unit 172 generates an executable file by compiling the general code converted so that the critical code calling unit calls the dummy code through step S260 (S290).
  • an executable file is a file running in a JVM or a DVM, specifically, a DEX file.
  • the combiner 160 combines the encrypted general code and the important code to generate an obfuscated application in the form of a combined file (S295).
  • the application generated by the coupling unit 160 is uploaded to an app store, an Android market, and the like, and is later downloaded to a network connected client terminal.
  • FIG. 5 is a flowchart illustrating a process of executing an application by a client terminal according to an embodiment of the present invention
  • FIGS. 6A and 6B illustrate a process of executing an obfuscated application by a client terminal according to an embodiment of the present invention. It is a figure for demonstrating.
  • 7 is a diagram illustrating a vector table according to an embodiment of the present invention.
  • the client terminal downloads the obfuscated application through the Android market or the app store (S510).
  • the obfuscated application is installed in the client terminal.
  • the obfuscated application is divided into a general code part that runs in the Dalvik virtual machine and an important code part that is in ELF type that runs in the native environment.
  • the general code part has a structure as shown in FIG. 6A. That is, the general code portion is formed in the form of a DEX file, and includes a dummy code, a plurality of important code calling units, and a startup routine. As described above, the critical code caller is designed to call the dummy code to prevent the static analysis of the attacker.
  • the control unit (not shown) of the client loads the general code into the Dalvik virtual machine using a startup routine included in the general code as shown in FIG. 6B.
  • the general code is not immediately executed in the form of a DEX file, but is converted into an ODEX (Optimized DEX) file through a DEX optimization process and loaded into a Dalvik virtual machine (DVM).
  • ODEX Optimized DEX
  • the important code call method using the descriptor which is the string data in the DEX file is converted into the important code call method through the address of the data structure called Vtable in the ODEX file.
  • the important code is loaded into a memory area controlled by the CPU.
  • the decryption routine included in the critical code is a portion of the critical code encrypted using the native code self-transformation technique (significant code A, significant code B,..., significant code connection, vector table generator, important code caller conversion unit). Decode the (S530).
  • the vector table generator When the significant code portion is decoded as described above, the vector table generator generates a vector table (S540).
  • the vector table is a set of vector information connecting between the important code caller and the called important code, and each dynamic vector is matched with each important code to be called.
  • the dynamic vector V1 matches the important code A
  • the dynamic vector V2 matches the important code C and the dynamic vector V3, respectively.
  • the critical code calling unit converting unit converts the important code calling unit to call the important code calling the dummy code (S550). That is, the significant code caller converting unit converts the vector value of each important code caller corresponding to the generated vector table.
  • the critical code calling unit A_dummy which has called the dummy code before executing the application, is converted in the same manner as merged_V1 so that the important code A can be called.
  • the reason why the important calling part converter can convert the important code calling part that called the dummy code to call the important code is because the Vtable and the address used when the important code is called in the ODEX (Optimized DEX) file are important codes for the dummy code. This is because the address is converted to a Vtable for the address.
  • ODEX Optimized DEX
  • the critical code caller when the important code caller conversion unit is executed, the critical code caller is retrieved from the ODEX loaded in the memory, and the dummy code call Vtable and address are converted into the important code call Vtable and address through a self-transformation method. It also converts the vector values needed for the call.
  • the call vector used in the critical code caller restored by the self-conversion technique is determined by a dynamically generated vector table, and the vector table is generated by a constructor composed of native codes. Therefore, vector mapping is changed at every execution, and there is an economic advantage because it does not require a separate server to generate it.
  • the important code caller that called the dummy code before the application execution is converted to call the important code.
  • the restored critical code caller calls the critical code through the vector value recorded in the vector table, and the critical code connection unit calls the critical code mapped to the vector value passed through the vector table as an argument (S560). . That is, when the critical code caller requests the critical code A in the same manner as merged_V1, the critical code connection unit calls the critical code A corresponding to V1 by referring to the vector table.
  • the conversion of the important code call unit is completed by the important code call unit conversion unit, and all routines included in the application can be normally executed.
  • the important code is stored in the ELF form and the structure of the important code is not explicitly distinguished, thereby exposing relatively less analysis information than the DEX form, and the instruction configuration is Dalvik. It consists of lower level CPU instructions than the instructions, which prevents the attacker from analyzing. In addition, the attacker's low level of CPU instructions and unspecified critical code structures increase the complexity of the analysis, while simultaneously analyzing the code running in the managed and native environments of the Dalvik VM. Because obfuscation techniques must be applied to the code, it can be difficult to analyze the code. In addition, the critical code caller, which calls important code, is stored in the form of calling dummy code when the application is not executed, and converts to the actual important code by using the self-transformation technique when the application is executed. Prevent dynamic analysis.

Abstract

본 발명은 자가변환 기반 애플리케이션 난독화 장치 및 그 방법에 관한 것이다. 본 발명에 따르면, 애플리케이션을 구성하는 코드를 중요 코드와 일반 코드로 분리하여 서로 다른 환경에서 암호화를 적용함으로써 기존의 매니지드 코드에 존재하는 역공학 취약성을 보완하여 애플리케이션의 위조 내지 변조에 대한 보안성을 높일 수 있다. 또한, 중요 코드를 호출하기 위한 중요 코드 호출부가 애플리케이션의 비실행시에는 더미 코드를 호출하는 형태로 저장되어 있고, 애플리케이션의 실행시 자가변환 기법을 이용해 실제 중요 코드를 호출하도록 변환하기 때문에 공격자의 정적 및 동적 분석을 방지한다.

Description

자가변환 기반 애플리케이션 코드 난독화 장치 및 그 방법
본 발명은 애플리케이션 코드 난독화 장치 및 그 방법에 관한 것으로서, 더욱 상세하게는 자가변환 기반 난독화 기법을 이용한 애플리케이션 코드 난독화 장치 및 그 방법에 관한 것이다.
Java 언어 대상의 기존의 애플리케이션 난독화 장치 및 그 방법은, 자바 가상 머신(Java Virtual Machine)에서 동작하는 애플리케이션을 대상으로 애플리케이션을 구성하는 코드 구조를 변경함으로써 난독화를 적용한다. 여기서 난독화가 적용된 애플리케이션은 난독화 적용 전과 동일하게 자바 가상 머신에서 동작하는 명령어 집합과 목적파일 구조로 구성된다.
하지만, 기존의 난독화 장치 또는 방법에 의하는 경우, 가상 머신에서 동작하는 매니지드 코드(Managed Code)가 가지는 역공학 취약성은 난독화 이후에도 동일하게 남아있게 되어 문제가 된다.
매니지드 코드가 가지는 역공학 취약성은 다음과 같은데, 컴파일 된 목적 코드에 클래스 명, 멤버 변수 명, 메소드 명 등 소소 코드 정보가 포함되며 코드가 명시적으로 구조화되어 있어서 역공학을 통해 특정 로직을 찾거나 분석하는 것이 용이하다.
안드로이드 애플리케이션도 상기 자바 머신에서 동작하는 애플리케이션과 비슷하게 달빅 가상머신(Dalvik Virtual Machine)에서 동작하는 매니지드 코드로 구성되며 DEX(Dalvik Executable) 파일 형식으로 저장된다. 따라서 안드로이드 애플리케이션도 자바 애플리케이션과 동일한 매니지드 코드의 역공학 취약성을 내포하고 있다.
본 발명의 배경이 되는 기술은 대한민국 등록특허공보 제10-1234591호(2013.2.19. 공고)에 기재되어 있다.
본 발명이 해결하고자 하는 과제는, 안드로이드 애플리케이션 보호를 위한 자가변환 기반 애플리케이션 코드 난독화 장치 및 그 방법을 제공하는 것이다.
상기한 바와 같은 목적을 달성하기 위한 본 발명의 하나의 실시예에 따른 애플리케이션 코드 난독화 장치는, 애플리케이션에 사용되는 코드를 입력받는 입력부, 상기 입력된 코드를 분석하여 애플리케이션 위조 내지 변조 공격으로부터 보호될 필요가 있는 중요 코드 및 상기 중요 코드를 호출하기 위한 중요 코드 호출부를 포함하는 일반 코드로 분리하는 코드 분리부, 상기 중요 코드를 암호화하고, 상기 중요 코드 각각의 주소 정보를 저장하고 있는 중요 코드 연결부의 주소 정보를 삽입하는 암호화부, 상기 일반 코드에 더미 코드를 삽입하여 상기 중요 코드 호출부가 상기 더미 코드를 호출하도록 변환하고, 상기 중요 코드의 벡터 정보가 포함된 벡터 테이블을 생성하기 위한 벡터 테이블 생성부를 상기 중요 코드에 삽입하며, 상기 애플리케이션 실행 시에 상기 중요 코드 호출부가 상기 중요 코드를 호출하도록 하는 중요 코드 호출부 변환부를 상기 중요 코드에 삽입하는 제어부, 그리고 상기 일반 코드와 중요 코드를 결합하여 상기 애플리케이션을 생성하는 코드 결합부를 포함한다.
상기 중요 코드 연결부, 벡터 테이블 생성부, 중요 코드 호출부 변환부가 추가된 중요 코드를 네이티브 환경에서 컴파일하는 제 1컴파일부, 그리고 상기 중요 코드 호출부가 더미 코드를 호출하도록 변환된 일반 코드를 매니지드 환경에서 컴파일하여 실행 파일을 생성하는 제 2컴파일부를 더 포함할 수 있다.
상기 암호화부는, 상기 컴파일된 중요 코드에 자가변환 기반의 코드 보호기법을 적용하여 바이너리 코드를 암호화할 수 있다.
상기 코드 변환부는, 상기 일반 코드에 상기 중요 코드와 연동하여 로딩하기 위한 개시 루틴(Startup Routine)을 추가할 수 있다.
상기 중요 코드 및 일반 코드에서 정의된 중요 식별자(sensitive identifier)를 의미 없는 문자 또는 문자열로 교체하여 스크램블하는 스크램블러를 더 포함할 수 있다.
상기 애플리케이션을 전송받은 클라이언트가 상기 개시 루틴을 이용하여 상기 애플리케이션을 실행하는 경우, DEX 파일 형태의 상기 일반 코드가 최적화된 ODEX(Optimized DEX) 파일 형태로 변환되어 달빅 가상 머신(DVM)에 로딩될 수 있다.
상기 암호화된 중요 코드 연결부, 벡터 테이블 생성부, 중요 코드 호출부 변환부 및 중요 코드가 복호화되며, 상기 벡터 테이블 생성부는 상기 벡터 테이블을 생성하고, 상기 중요 코드 호출부 변환부는 상기 중요 코드 호출부가 상기 중요 코드를 호출하도록 변환시키며, 상기 중요 코드 호출부는 상기 벡터 테이블에 기록된 벡터 값을 통해 중요 코드를 호출하면, 상기 중요 코드 연결부는 상기 벡터 테이블과 상기 중요 코드의 주소 정보를 이용하여, 상기 벡터 값에 대응되는 중요 코드를 호출하여 실행시킬 수 있다.
본 발명의 다른 실시예에 따르면, 애플리케이션 난독화 장치를 이용한 애플리케이션 난독화 방법에 있어서, 상기 애플리케이션에 사용되는 코드를 입력받는 단계, 상기 입력된 코드를 분석하여 애플리케이션 위조 내지 변조 공격으로부터 보호될 필요가 있는 중요 코드 및 상기 중요 코드를 호출하기 위한 중요 코드 호출부를 포함하는 일반 코드로 분리하는 단계, 상기 중요 코드를 암호화하고, 상기 중요 코드 각각의 주소 정보를 저장하고 있는 중요 코드 연결부의 주소 정보를 삽입하는 단계, 상기 일반 코드에 더미 코드를 삽입하여 상기 중요 코드 호출부가 상기 더미 코드를 호출하도록 변환하고, 상기 중요 코드의 벡터 정보가 포함된 벡터 테이블을 생성하기 위한 벡터 테이블 생성부를 상기 중요 코드에 삽입하는 단계, 상기 애플리케이션 실행 시에 상기 중요 코드 호출부가 상기 중요 코드를 호출하도록 하는 중요 코드 호출부 변환부를 상기 중요 코드에 삽입하는 단계, 그리고 상기 일반 코드와 중요 코드를 결합하여 상기 애플리케이션을 생성하는 단계를 포함한다.
이와 같이 본 발명에 따르면, 애플리케이션을 구성하는 코드를 중요 코드와 일반 코드로 분리하여 서로 다른 환경에서 암호화를 적용함으로써 기존의 매니지드 코드에 존재하는 역공학 취약성을 보완하여 애플리케이션의 위조 내지 변조에 대한 보안성을 높일 수 있다.
또한, 중요 코드를 호출하기 위한 중요 코드 호출부가 애플리케이션의 비실행시에는 더미 코드를 호출하는 형태로 저장되어 있고, 애플리케이션의 실행시 자가변환 기법을 이용해 실제 중요 코드를 호출하도록 변환하기 때문에 공격자의 정적 및 동적 분석을 방지한다.
도 1은 본 발명의 실시예에 따른 애플리케이션 난독화 장치의 구성도이다.
도 2는 본 발명의 실시예에 따른 애플리케이션 난독화 방법의 순서도이다.
도 3은 본 발명의 실시예에 따른 중요 코드의 파일 구조를 설명하기 위한 도면이다.
도 4는 본 발명의 실시예에 따른 난독화된 중요 코드의 파일 구조를 설명하기 위한 도면이다.
도 5는 본 발명의 실시예에 따른 클라이언트 단말이 애플리케이션을 실행시키는 과정을 설명하기 위한 순서도이다.
도 6a 및 도 6b는 본 발명의 실시예에 따른 클라이언트 단말이 난독화된 애플리케이션을 실행하는 과정을 설명하기 위한 도면이다.
도 7은 본 발명의 실시예에 따른 벡터 테이블을 설명하기 위한 도면이다.
이하에서는 첨부한 도면을 참조하여 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 본 발명의 실시예를 상세히 설명한다. 그러나 본 발명은 여러 가지 상이한 형태로 구현될 수 있으며 여기에서 설명하는 실시예에 한정되지 않는다. 그리고 도면에서 본 발명을 명확하게 설명하기 위해서 설명과 관계없는 부분은 생략하였으며, 명세서 전체를 통하여 유사한 부분에 대해서는 유사한 도면 부호를 붙였다.
먼저 본 발명의 실시예에 따른 애플리케이션 난독화 장치에 대하여 설명한다.
도 1은 본 발명의 실시예에 따른 애플리케이션 난독화 장치를 설명하기 위한 도면이다.
도 1을 참조하면, 본 발명의 실시예에 따른 애플리케이션 난독화 장치(100)는 입력부(110), 코드 분리부(120), 코드 변환부(130), 스크램블러(140), 암호화부(145), 제어부(150) 및 코드 결합부(160)를 포함하고, 컴파일부(170)를 더 포함할 수 있다.
먼저, 입력부(110)는 애플리케이션의 코드를 입력받는다. 여기서, 입력되는 코드는 애플리케이션을 생성하기 위한 코드로서, 소스 코드(Source Code) 또는 매니지드 코드(Managed Code) 형식의 코드일 수 있다.
코드 분리부(120)는 입력부(110)로부터 입력된 코드를 분석하여 애플리케이션 위조 내지 변조 공격으로부터 보호될 필요가 있는 중요 코드와 상기 중요 코드 이외의 일반 코드로 분리한다.
코드 변환부(130)는 코드 분리부(120)에서 분리된 중요 코드를 매니지드 코드(Managed Code)에서 네이티브 코드(Native Code)로 변환한다.
스크램블러(140)는 중요 코드와 일반 코드에서 정의된 중요 식별자(Sensitive Identifier)를 의미 없는 문자 또는 문자열로 교체하여 스크램블(Scramble)한다.
암호화부(145)는 컴파일된 중요 코드에 자가변환 기반의 코드 보호기법을 적용하여 바이너리 코드를 암호화한다.
제어부(150)는 일반 코드에 더미 코드를 삽입하여 중요 코드 호출부가 더미 코드를 호출하도록 변환시킨다. 또한, 중요 코드의 벡터 정보가 포함된 벡터 테이블을 생성하기 위한 벡터 테이블 생성부를 중요 코드에 삽입한다. 그리고, 제어부(150)는 애플리케이션 실행 시에 중요 코드 호출부가 중요 코드를 호출하도록 하는 중요 코드 호출부 변환부를 중요 코드에 삽입한다.
코드 결합부(160)는 암호화된 일반 코드와 중요 코드를 결합하여 클라이언트에 배포가 가능한 형태의 결합 파일을 생성한다. 본 발명에 따른 하나의 실시예로서 안드로이드 애플리케이션의 경우 확장자가 apk(Android package)인 파일이 결합 파일에 해당한다.
컴파일부(170)는 중요 파일을 컴파일 하기 위하여 네이티브 환경에서 동작하는 제1 컴파일부(171)와 일반 코드를 컴파일 하기 위하여 매니지드 환경에서 동작하는 제2 컴파일부(172)를 포함할 수 있다.
제1 컴파일부(171)는 중요 코드 연결부, 벡터 테이블 생성부, 중요 코드 호출부 변환부가 추가된 중요 코드를 네이티브 환경에서 컴파일한다. 그리고 제2 컴파일부(172)는 중요 코드 호출부가 더미 코드를 호출하도록 변환된 일반 코드를 매니지드 환경에서 컴파일 하여 실행 파일을 생성한다.
이하, 본 발명의 실시예에 따른 애플리케이션 난독화 방법에 대하여 설명한다.
도 2는 본 발명의 실시예에 따른 애플리케이션 난독화 방법의 순서도이다.
입력부(110)는 애플리케이션의 코드를 입력 받는다(S210). 입력부(110)는 키패드 형태로서 입력 인터페이스부가 구비될 수 있다. 입력되는 코드는 소스 코드이거나 자바 가상 머신(Java Virtual Machine: JVM) 또는 달빅 가상 머신(Dalvik Virtual Machine, DVM)에서 실행될 수 있는 매니지드 코드(Managed Code) 형식의 코드일 수 있다.
코드 분리부(120)는 입력부(110)로부터 입력된 코드를 분석하여 애플리케이션 위조 내지 변조 공격으로부터 보호될 필요가 있는 중요 코드와 상기 중요 코드 이외의 일반 코드로 분리한다(S220).
여기서 일반 코드는, 일반 코드 영역에서 중요 코드 또는 중요 코드가 변환된 네이티브 코드를 호출할 수 있는 중요 코드 호출부(Sensitive Method Calling Routine)를 포함한다. 중요 코드란 사용자의 관점에서 공격자의 위조 내지 변조 행위로부터 보호될 필요가 있는 코드를 나타낸다. 중요 코드와 반대되는 개념으로 중요 코드 이외의 코드를 일반 코드로 칭한다. 핵심 코드는 중요 코드와 동의어로 사용될 수 있다.
코드 구분을 위해 코드 분리부(120)는 기 저장된 중요 코드 모델을 이용하여 상기 입력된 실행 코드에서 중요 코드 모델과 매칭되는 코드를 중요 코드로 판단할 수 있다.
코드 변환부(130)는 코드 분리부(120)에서 분리된 중요 코드를 매니지드 코드(Managed Code)에서 네이티브 코드(Native Code)로 변환한다(S230). 즉 코드 변환부(130)는 매니지드 코드(Managed Code) 형태의 중요 코드를 네이티브 코드(Native Code) 형태로 변환한다. 네이티브 코드(Native Code)는 JVM 또는 DVM에서 실행되는 매니지드 코드(Managed Code)와 달리 CPU 환경에서 실행되며 매니지드 코드보다 바이너리 코드에 가까운 코드이다.
본 발명에 따른 하나의 실시예로서 코드 변환부(130)는 중요 코드를 C 코드로 변환 할 수 있다. 이하 본 발명의 실시예에서 중요 코드는 네이티브 코드 또는 C 코드와 동의어로 사용될 수 있다.
중요 코드는 ELF(Executable and Linkable Format) 형태로 네이티브 코드 섹션에 저장된다. ELF 형태는 코드의 구조가 명시적으로 구분되지 않아 DEX 형태에 비해 코드 위조 내지 변조를 위한 동적 분석 또는 정적 분석에 상대적으로 쉽게 노출되지 않는 장점이 있다. 또한, ELF 형태는 명령어 구성이 달빅(Dalvik) 명령어에 비해 기계어에 가까운 낮은 수준의 CPU 명령어로 구성되어 있어서 공격자의 동적 분석 및 정적 분석을 어렵게 한다.
또한 코드 변환부(130)는 일반 코드에 중요 코드와 연동하여 로딩하기 위한 개시 루틴(Startup Routine)을 추가할 수 있다(S235). 본 발명에 따른 하나의 실시예로서 개시 루틴은 JNI(Java Native Interface) 함수를 포함할 수 있다.
스크램블러(140)는 중요 코드와 일반 코드에서 정의된 중요 식별자(Sensitive Identifier)를 의미 없는 문자 또는 문자열로 교체하여 스크램블(Scramble)한다(S240). 식별자 변환(Scramble Identifier)은 코드 내의 식별자(Identifier)를 하나 또는 그 이상의 알파벳 나열로 바꾸어 역공학을 어렵게 하는 배치 난독화의 일종이다.
S240과 같이 스크램블 과정을 거치면 중요 코드는 도 3의 좌측 도면과 같은 네이티브 파일 구조를 가지게 된다.
도 3은 본 발명의 실시예에 따른 중요 코드의 파일 구조를 설명하기 위한 도면이고, 도 4는 본 발명의 실시예에 따른 난독화된 중요 코드의 파일 구조를 설명하기 위한 도면이다.
도 3의 좌측 도면을 살펴보면, Export Table은 복수의 중요 코드(중요 코드A, 중요 코드 B, … ) 각각의 어드레스를 포함하고 있는데, 각각의 어드레스는 네이티브 코드 섹션에 라이브러리 형태로 저장된 해당 중요 코드(중요 코드 A, 중요 코드 B, …)에 각각 대응된다.
다음으로, 암호화부(145)는 문자열에 대하여 암호화를 한다(S245). 즉, 암호화부(145)는 네이티브 환경에서 중요 코드 내의 문자열에 대하여 저장장소(Data Storage) 변환, 인코딩(Data Encoding) 변환, 순서(Data Ordering) 변환과 같은 자료 난독화 기법을 사용하여 문자열을 암호화를 할 수 있다.
그리고, 암호화부(145)는 도 3의 우측 도면과 같이 네이티브 코드 섹션에 코드 형태의 중요 코드 연결부를 생성하는데, 이때 중요 코드 연결부는 도 3의 좌측 도면의 Export Table에 정의된 네이티브 코드 각각에 대한 어드레스 정보를 포함한다.
그리고, 암호화부(145)는 도 3의 좌측 도면의 Export Table에 정의된 네이티브 코드 각각에 대한 어드레스를 병합(Merge)하여, 도 3의 우측 도면과 같이 중요 코드 연결부의 어드레스를 생성한다(S250).
그 결과, 도 3의 우측 도면과 같이 Export Table에는 중요 코드 연결부의 위치를 나타내는 어드레스 정보가 저장된다.
다음으로, 제어부(150)는 Java 코드 형태의 일반 코드에 더미 코드(Dummy code, 쓰레기 코드)를 삽입하고(S255), 중요 코드를 호출하기 위한 중요 코드 호출부가 더미 코드를 호출하도록 중요 코드 호출부를 변환한다(S260). 이와 같이 더미 코드를 호출하도록 변환함으로써, 공격자로부터 정적 공격을 방지하고, 애플리케이션 실행 시에 자가변환 기법을 통해 중요 코드를 호출하도록 변환하여 정상적인 실행이 되도록 한다.
그리고, 제어부(150)는 중요 코드에 벡터 테이블을 생성하기 위한 벡터 테이블 생성부를 삽입한다(S270). 여기서 벡터 테이블은 추후 애플리케이션이 클라이언트 단말에서 로딩될 때 중요 코드를 호출하기 위해 사용된다.
다음으로 제어부(150)는 중요 코드에 중요 코드 호출부 변환부를 삽입한다(S275). 중요 코드 호출부 변환부는 애플리케이션 실행 시에 더미 코드를 호출하는 중요 코드 호출부들이 중요 코드를 호출하도록 변환하여 정상적으로 애플리케이션이 실행되도록 한다.
다음으로 제 1 컴파일부(171)는 중요 코드 연결부, 벡터 테이블 생성부, 중요 코드 호출부 변환부가 추가된 중요 코드를 컴파일하고, 암호화부(145)는 컴파일된 중요 코드에 자가변환 기반의 코드 보호기법을 적용하여 바이너리 코드를 암호화할 수 있다(S280).
도 4는 S280 과정을 통해 난독화된 중요 코드의 구조를 나타낸 것으로, 도 4에서 보는 바와 같이 중요 코드들은 중요 코드 연결부, 벡터 테이블 생성부, 중요 코드 호출부 변환부와 함께 암호화되며, 복호화 루틴이 결합된 구조를 가진다.
제 2컴파일부(172)는 S260 단계를 통해 중요 코드 호출부가 더미 코드를 호출하도록 변환된 일반 코드를 컴파일하여 실행 파일을 생성한다(S290). 본 발명에 따른 실시예로서 실행 파일은 JVM 또는 DVM에서 동작하는 파일이며, 구체적으로는 DEX파일이다.
결합부(160)는 각각 암호화된 일반 코드와 중요 코드를 결합하여 결합 파일 형태의 난독화된 애플리케이션을 생성한다(S295). 그리고 결합부(160)에 의해 생성된 애플리케이션은 앱 스토어, 안드로이드 마켓 등에 업로드되며, 추후 네트워크 연결된 클라이언트 단말로 다운로드 된다.
이하에서는, 도 5 내지 도 7을 통하여 애플리케이션을 다운로드 받은 클라이언트 단말이 애플리케이션을 실행시키는 과정에 대하여 설명한다.
도 5는 본 발명의 실시예에 따른 클라이언트 단말이 애플리케이션을 실행시키는 과정을 설명하기 위한 순서도이고, 도 6a 및 도 6b는 본 발명의 실시예에 따른 클라이언트 단말이 난독화된 애플리케이션을 실행하는 과정을 설명하기 위한 도면이다. 도 7은 본 발명의 실시예에 따른 벡터 테이블을 설명하기 위한 도면이다.
먼저 클라이언트 단말은 안드로이드 마켓이나 앱 스토어를 통하여 난독화된 애플리케이션을 다운로드 받는다(S510).
그러면, 난독화된 애플리케이션이 클라이언트 단말에 설치되는데, 난독화된 애플리케이션은 달빅 가상 머신에서 동작하는 일반 코드 부분과 네이티브 환경에서 동작하는 ELF 형태의 중요 코드 부분으로 나뉘어 진다.
여기서, 일반 코드 부분은 도 6a와 같은 구조를 가진다. 즉, 일반 코드 부분은 DEX 파일 형태로 이루어지며, 더미 코드와 복수의 중요 코드 호출부, 개시 루틴(Startup Routine)을 포함한다. 그리고, 앞에서 설명한 바와 같이, 중요 코드 호출부는 공격자의 정적 분석 방지를 위하여 더미 코드를 호출하도록 설계된다.
사용자가 다운로드 받은 애플리케이션을 실행시키면(S520), 클라이언트의 제어부(미도시)는 도 6b와 같이 일반 코드에 포함된 개시 루틴(Startup Routine)을 이용하여 일반 코드를 달빅 가상 머신(DVM)에 로딩시킨다. 여기서, 일반 코드는 DEX 파일 형태로 바로 실행되지 않고, DEX 최적화(Optimization) 과정을 거쳐 ODEX(Optimized DEX) 파일 형태로 변환되어 달빅 가상 머신(DVM)에 로딩된다.
이와 같은 최적화 과정을 통해 DEX 파일에서는 문자열 데이터인 디스크립터을 이용한 중요 코드 호출 방식이 ODEX 파일에서는 Vtable이라는 자료구조의 어드레스를 통한 중요 코드 호출 방식으로 변환된다.
한편, 사용자가 다운로드 받은 애플리케이션을 실행시키면 중요 코드는 CPU가 제어하는 메모리 영역에 로딩된다.
그러면, 중요 코드에 포함된 복호화 루틴은 네이티브 코드 자가 변환 기법을 이용하여 암호화된 중요 코드 부분(중요 코드 A, 중요 코드 B, …, 중요 코드 연결부, 벡터 테이블 생성부, 중요 코드 호출부 변환부)을 복호화시킨다(S530).
이와 같이 중요 코드 부분이 복호화되면 벡터 테이블 생성부는 벡터 테이블을 생성한다(S540). 여기서, 벡터 테이블은 중요 코드 호출부와 호출되는 중요 코드 간을 연결하는 벡터 정보의 집합으로, 도 7과 같이 동적 벡터 각각은 호출될 중요 코드와 각각 매칭이 된다. 도 7에 따른 벡터 테이블에서는 동적 벡터 V1은 중요 코드 A와, 동적 벡터 V2는 중요 코드 C와 동적 벡터 V3은 중요 코드 B와 각각 매칭되는 것을 예로 들었다.
다음으로 중요 코드 호출부 변환부는 더미 코드를 호출하던 중요 코드 호출부가 중요 코드를 호출하도록 중요 코드 호출부를 변환시킨다(S550). 즉, 중요 코드 호출부 변환부는 생성된 벡터 테이블에 대응하여, 각 중요 코드 호출부의 벡터 값을 변환시킨다. 도 7과 연관하여 예를 들면, 애플리케이션 실행 전에 더미 코드를 호출하던 중요 코드 호출부(A_dummy)가 중요 코드 A를 호출할 수 있도록 merged_V1과 같은 방식으로 변환된다.
이와 같이 중요 호출부 변환부가 더미 코드를 호출하던 중요코드 호출부를 중요 코드를 호출하도록 변환시킬 수 있는 이유는 ODEX(Optimized DEX) 파일에서 중요 코드 호출시 사용되는 Vtable과 어드레스를 더미 코드용에서 중요 코드용 Vtable과 어드레스로 변환하기 때문이다.
즉, 중요 코드 호출부 변환부가 실행되면, 메모리에 적재된 ODEX에서 변환된 중요 코드 호출부를 검색하여, 자가변환 기법을 통해 더미 코드 호출용 Vtable과 어드레스를 중요 코드 호출용 Vtable과 어드레스로 변환하고, 호출에 필요한 벡터 값 역시 변환한다. 이때 자가변환 기법에 의해 복원된 중요코드 호출부에서 사용되는 호출 벡터는 동적으로 생성된 벡터 테이블에 의해 결정되며 벡터 테이블은 네이티브 코드로 구성된 생성자에 의해 생성된다. 따라서 벡터 매핑은 매 실행시마다 변하게 되며 이를 생성하기 위한 별도의 서버를 요구하지 않아 경제적인 장점이 있다.
따라서, 본 발명의 실시예에 따르면 ODEX에 포함되어 있는 Vtable을 이용하여, 애플리케이션 실행 전에 더미 코드를 호출하였던 중요코드 호출부가 중요 코드를 호출하도록 변환된다.
이와 같이 복원된 중요 코드 호출부는 벡터 테이블에 기록된 벡터 값을 통해 중요 코드를 호출하게 되고, 중요 코드 연결부는 벡터 테이블을 통해 인자로 넘어오는 벡터 값에 매핑되는 중요 코드를 호출하게 된다(S560). 즉, 중요 코드 호출부가 merged_V1과 같은 방식으로 중요 코드 A를 요청하면, 중요 코드 연결부는 벡터 테이블을 참조하여 V1에 대응하는 중요 코드 A를 호출하게 된다.
이와 같이 중요 코드 호출부 변환부에 의해 중요 코드 호출부의 변환이 완료되어 애플리케이션에 포함된 모든 루틴은 정상적인 실행이 가능하게 된다.
이와 같이 본 발명의 실시예에 따르면, 중요 코드는 ELF 형태로 저장되며 중요 코드의 구조가 명시적으로 구분되지 않아 DEX 형태에 비해 상대적으로 적은 분석 정보를 노출시키게 되며, 명령어 구성이 달빅(Dalvik) 명령어에 비해 낮은 수준의 CPU 명령어로 구성되어 공격자의 분석을 방해한다. 또한 공격자는 낮은 수준의 CPU 명령어와 명시적이지 않은 중요 코드 구조로 인해 분석 복잡도가 증가하게 되고 달빅 가상 머신(Dalvik VM)의 매니지드 환경과 네이티브 환경에서 동작하는 코드를 동시에 분석해야 함과 동시에 각 환경에 맞는 난독화 기법을 적용해야 하므로 코드 분석을 난해하게 할 수 있다. 또한, 중요 코드를 호출하는 중요 코드 호출부가 애플리케이션의 비실행시에는 더미 코드를 호출하는 형태로 저장되어 있고, 애플리케이션의 실행시 자가변환 기법을 이용해 실제 중요 코드를 호출하도록 변환하기 때문에 공격자의 정적 및 동적 분석을 방지한다.
이제까지 본 발명에 대하여 실시예들을 중심으로 살펴보았다. 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자는 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 변형된 형태로 구현될 수 있음을 이해할 수 있을 것이다. 그러므로 개시된 실시예들은 한정적인 관점이 아니라 설명적인 관점에서 고려되어야 한다. 따라서 본 발명의 범위는 전술한 실시예에 한정되지 않고 특허청구범위에 기재된 내용 및 그와 동등한 범위 내에 있는 다양한 실시 형태가 포함되도록 해석되어야 할 것이다.

Claims (12)

  1. 애플리케이션에 사용되는 코드를 입력받는 입력부,
    상기 입력된 코드를 분석하여 애플리케이션 위조 내지 변조 공격으로부터 보호될 필요가 있는 중요 코드 및 상기 중요 코드를 호출하기 위한 중요 코드 호출부를 포함하는 일반 코드로 분리하는 코드 분리부,
    상기 중요 코드를 암호화하고, 상기 중요 코드 각각의 주소 정보를 저장하고 있는 중요 코드 연결부의 주소 정보를 삽입하는 암호화부,
    상기 일반 코드에 더미 코드를 삽입하여 상기 중요 코드 호출부가 상기 더미 코드를 호출하도록 변환하고, 상기 중요 코드의 벡터 정보가 포함된 벡터 테이블을 생성하기 위한 벡터 테이블 생성부를 상기 중요 코드에 삽입하며, 상기 애플리케이션 실행 시에 상기 중요 코드 호출부가 상기 중요 코드를 호출하도록 하는 중요 코드 호출부 변환부를 상기 중요 코드에 삽입하는 제어부, 그리고
    상기 일반 코드와 중요 코드를 결합하여 상기 애플리케이션을 생성하는 코드 결합부를 포함하는 애플리케이션 난독화 장치.
  2. 제1항에 있어서,
    상기 중요 코드 연결부, 벡터 테이블 생성부, 중요 코드 호출부 변환부가 추가된 중요 코드를 네이티브 환경에서 컴파일하는 제 1컴파일부, 그리고
    상기 중요 코드 호출부가 더미 코드를 호출하도록 변환된 일반 코드를 매니지드 환경에서 컴파일하여 실행 파일을 생성하는 제 2컴파일부를 더 포함하는 애플리케이션 난독화 장치.
  3. 제2항에 있어서,
    상기 암호화부는,
    상기 컴파일된 중요 코드에 자가변환 기반의 코드 보호기법을 적용하여 바이너리 코드를 암호화하는 애플리케이션 난독화 장치.
  4. 제3항에 있어서,
    상기 코드 변환부는,
    상기 일반 코드에 상기 중요 코드와 연동하여 로딩하기 위한 개시 루틴(Startup Routine)을 추가하는 애플리케이션 난독화 장치.
  5. 제4항에 있어서,
    상기 중요 코드 및 일반 코드에서 정의된 중요 식별자(sensitive identifier)를 의미 없는 문자 또는 문자열로 교체하여 스크램블하는 스크램블러를 더 포함하는 애플리케이션 난독화 장치.
  6. 제5항에 있어서,
    상기 애플리케이션을 전송받은 클라이언트가 상기 개시 루틴을 이용하여 상기 애플리케이션을 실행하는 경우,
    DEX 파일 형태의 상기 일반 코드가 최적화된 ODEX(Optimized DEX) 파일 형태로 변환되어 달빅 가상 머신(DVM)에 로딩되는 애플리케이션 난독화 장치.
  7. 제6항에 있어서,
    상기 암호화된 중요 코드 연결부, 벡터 테이블 생성부, 중요 코드 호출부 변환부 및 중요 코드가 복호화되며,
    상기 벡터 테이블 생성부는 상기 벡터 테이블을 생성하고,
    상기 중요 코드 호출부 변환부는 상기 중요 코드 호출부가 상기 중요 코드를 호출하도록 변환시키며,
    상기 중요 코드 호출부는 상기 벡터 테이블에 기록된 벡터 값을 통해 중요 코드를 호출하면, 상기 중요 코드 연결부는 상기 벡터 테이블과 상기 중요 코드의 주소 정보를 이용하여, 상기 벡터 값에 대응되는 중요 코드를 호출하여 실행시키는 애플리케이션 난독화 장치.
  8. 애플리케이션 난독화 장치를 이용한 애플리케이션 난독화 방법에 있어서,
    상기 애플리케이션에 사용되는 코드를 입력받는 단계,
    상기 입력된 코드를 분석하여 애플리케이션 위조 내지 변조 공격으로부터 보호될 필요가 있는 중요 코드 및 상기 중요 코드를 호출하기 위한 중요 코드 호출부를 포함하는 일반 코드로 분리하는 단계,
    상기 중요 코드를 암호화하고, 상기 중요 코드 각각의 주소 정보를 저장하고 있는 중요 코드 연결부의 주소 정보를 삽입하는 단계,
    상기 일반 코드에 더미 코드를 삽입하여 상기 중요 코드 호출부가 상기 더미 코드를 호출하도록 변환하고, 상기 중요 코드의 벡터 정보가 포함된 벡터 테이블을 생성하기 위한 벡터 테이블 생성부를 상기 중요 코드에 삽입하는 단계,
    상기 애플리케이션 실행 시에 상기 중요 코드 호출부가 상기 중요 코드를 호출하도록 하는 중요 코드 호출부 변환부를 상기 중요 코드에 삽입하는 단계, 그리고
    상기 일반 코드와 중요 코드를 결합하여 상기 애플리케이션을 생성하는 단계를 포함하는 애플리케이션 난독화 방법.
  9. 제8항에 있어서,
    상기 중요 코드 연결부, 벡터 테이블 생성부, 중요 코드 호출부 변환부가 추가된 중요 코드를 네이티브 환경에서 컴파일하는 단계, 그리고
    상기 중요 코드 호출부가 더미 코드를 호출하도록 변환된 일반 코드를 매니지드 환경에서 컴파일하여 실행 파일을 생성하는 단계를 더 포함하는 애플리케이션 난독화 방법.
  10. 제9항에 있어서,
    상기 암호화부는,
    상기 컴파일된 중요 코드에 자가변환 기반의 코드 보호기법을 적용하여 바이너리 코드를 암호화하는 애플리케이션 난독화 장치.
  11. 제10항에 있어서,
    상기 애플리케이션을 전송받은 클라이언트가 개시 루틴을 이용하여 상기 애플리케이션을 실행하는 경우,
    DEX 파일 형태의 상기 일반 코드가 최적화된 ODEX(Optimized DEX) 파일 형태로 변환되어 달빅 가상 머신(DVM)에 로딩되는 애플리케이션 난독화 방법.
  12. 제11항에 있어서,
    상기 애플리케이션을 전송받은 클라이언트가 개시 루틴을 이용하여 상기 애플리케이션을 실행하는 경우,
    상기 암호화된 중요 코드 연결부, 벡터 테이블 생성부, 중요 코드 호출부 변환부 및 중요 코드가 복호화되는 단계,
    상기 벡터 테이블 생성부는 상기 벡터 테이블을 생성하는 단계,
    상기 중요 코드 호출부 변환부는 상기 중요 코드 호출부가 상기 중요 코드를 호출하도록 변환시키는 단계, 그리고
    상기 중요 코드 호출부는 상기 벡터 테이블에 기록된 벡터 값을 통해 중요 코드를 호출하면, 상기 중요 코드 연결부는 상기 벡터 테이블과 상기 중요 코드의 주소 정보를 이용하여, 상기 벡터 값에 대응되는 중요 코드를 호출하여 실행시키는 단계를 포함하는 애플리케이션 난독화 방법.
PCT/KR2013/008750 2013-09-27 2013-09-30 자가변환 기반 애플리케이션 코드 난독화 장치 및 그 방법 WO2015046655A1 (ko)

Priority Applications (3)

Application Number Priority Date Filing Date Title
US14/360,304 US9230123B2 (en) 2013-09-27 2013-09-30 Apparatus for tamper protection of application code based on self modification and method thereof
EP13894475.6A EP2897074B1 (en) 2013-09-27 2013-09-30 Application code obfuscation device based on self-conversion and method therefor
JP2015542939A JP5996810B2 (ja) 2013-09-27 2013-09-30 自己書換え基盤のアプリケーションコード難読化装置及びその方法

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR10-2013-0115309 2013-09-27
KR20130115309A KR101490047B1 (ko) 2013-09-27 2013-09-27 자가변환 기반 애플리케이션 코드 난독화 장치 및 그 방법

Publications (1)

Publication Number Publication Date
WO2015046655A1 true WO2015046655A1 (ko) 2015-04-02

Family

ID=52590314

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2013/008750 WO2015046655A1 (ko) 2013-09-27 2013-09-30 자가변환 기반 애플리케이션 코드 난독화 장치 및 그 방법

Country Status (5)

Country Link
US (1) US9230123B2 (ko)
EP (1) EP2897074B1 (ko)
JP (1) JP5996810B2 (ko)
KR (1) KR101490047B1 (ko)
WO (1) WO2015046655A1 (ko)

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101328012B1 (ko) * 2013-08-12 2013-11-13 숭실대학교산학협력단 애플리케이션 코드 난독화 장치 및 그 방법
US9659156B1 (en) * 2014-03-20 2017-05-23 Symantec Corporation Systems and methods for protecting virtual machine program code
KR101518420B1 (ko) * 2014-11-11 2015-05-07 주식회사 에스이웍스 안드로이드 플랫폼에서의 apk 파일 관리 장치 및 방법
KR101619458B1 (ko) 2016-03-02 2016-05-10 (주)케이사인 애플리케이션 코드 난독화 장치 및 이를 이용한 애플리케이션 코드 난독화 방법
CN105975311B (zh) * 2016-05-09 2021-01-29 腾讯科技(深圳)有限公司 一种应用启动方法及装置
KR101704703B1 (ko) * 2016-06-08 2017-02-08 (주)케이사인 더미 코드를 사용하는 애플리케이션 코드 은닉 장치 및 이를 이용한 애플리케이션 코드 은닉 방법
KR101845155B1 (ko) * 2016-06-30 2018-04-03 라인 가부시키가이샤 어플리케이션 패키지를 제공하는 방법 및 시스템, 그리고 어플리케이션을 실행하는 방법 및 시스템
KR101688814B1 (ko) * 2016-07-11 2016-12-22 (주)케이사인 주 기억 장치 내부의 코드 수정을 통한 애플리케이션 코드 은닉 장치 및 이를 이용한 애플리케이션 코드 은닉 방법
KR101753811B1 (ko) * 2016-12-14 2017-07-19 올댓소프트 코. 동적 할당 메모리를 이용하는 애플리케이션 코드 자가 변환 장치 및 이를 이용한 애플리케이션 코드 자가 변환 방법
JP7131946B2 (ja) 2017-04-20 2022-09-06 Line株式会社 アプリケーションの保安性を評価する方法およびシステム
WO2018194196A1 (ko) * 2017-04-20 2018-10-25 라인 가부시키가이샤 Elf 파일의 난독화 적용 여부의 탐지 및 보안성 평가를 위한 방법 및 시스템
US11314865B2 (en) * 2017-08-01 2022-04-26 The Trustees Of Princeton University Pluggable trust architecture
CN110032833B (zh) * 2018-01-11 2021-06-15 武汉斗鱼网络科技有限公司 一种Web应用程序的处理方法及装置
CN108536488B (zh) * 2018-04-17 2021-12-07 Oppo广东移动通信有限公司 应用启动优化方法、装置、存储介质及终端设备
US10776508B2 (en) * 2018-07-13 2020-09-15 Bank Of America Corporation Holistic and secure resource provisioning gateway system
KR102177920B1 (ko) * 2018-10-12 2020-11-13 네이버비즈니스플랫폼 주식회사 원본코드 패킹장치 및 원본코드 패킹방법
KR102113966B1 (ko) * 2019-11-25 2020-05-21 숭실대학교산학협력단 분석회피기법 우회 장치, 방법 및 이를 수행하기 위한 프로그램을 기록한 기록매체
US11748460B2 (en) * 2020-04-27 2023-09-05 Imperva, Inc. Procedural code generation for challenge code
KR20210154017A (ko) * 2020-06-11 2021-12-20 라인플러스 주식회사 클래스 분산 및 순차적 메모리 적재를 이용한 파일 보호 방법 및 시스템
KR20230142091A (ko) * 2022-04-01 2023-10-11 (주)잉카엔트웍스 Dex 파일 보호를 위한 보안 제공 장치와 방법 및 보안 실행 장치와 방법

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006072584A (ja) * 2004-08-31 2006-03-16 Fuji Xerox Co Ltd 実行プログラム生成装置、実行プログラム生成方法、プログラム処理装置、プログラム処理方法及びプログラム
JP2006164184A (ja) * 2004-12-10 2006-06-22 Ntt Docomo Inc プログラム分割装置、プログラム実行装置、プログラム分割方法及びプログラム実行方法
US20100306854A1 (en) * 2009-06-01 2010-12-02 Ab Initio Software Llc Generating Obfuscated Data
KR101234591B1 (ko) 2011-05-13 2013-02-19 주식회사 인프라웨어테크놀러지 Jni를 이용한 안드로이드 난독화 방법
KR101265099B1 (ko) * 2011-06-15 2013-05-20 주식회사 터보테크 소프트웨어 보안 처리방법 및 기록매체
KR101269089B1 (ko) * 2011-08-19 2013-05-29 고려대학교 산학협력단 자가암호화를 이용한 소프트웨어 변조방지 방법

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6006328A (en) * 1995-07-14 1999-12-21 Christopher N. Drake Computer software authentication, protection, and security system
US6480959B1 (en) * 1997-12-05 2002-11-12 Jamama, Llc Software system and associated methods for controlling the use of computer programs
JP2001244349A (ja) * 2000-02-29 2001-09-07 Nec Corp 半導体装置とその製造方法
GB0024918D0 (en) * 2000-10-11 2000-11-22 Sealedmedia Ltd Method of providing java tamperproofing
JP2003280755A (ja) * 2002-03-25 2003-10-02 Nec Corp 自己復元型プログラム、プログラム生成方法及び装置、情報処理装置並びにプログラム
US7383443B2 (en) * 2002-06-27 2008-06-03 Microsoft Corporation System and method for obfuscating code using instruction replacement scheme
JP2005135265A (ja) * 2003-10-31 2005-05-26 Fujitsu Ltd 情報処理装置
US7409675B2 (en) * 2004-02-27 2008-08-05 Microsoft Corporation Code rewriting
US20080168562A1 (en) * 2005-02-25 2008-07-10 Tomoyuki Haga Secure Processing Device and Secure Processing System
US7937693B2 (en) * 2006-04-26 2011-05-03 9Rays.Net, Inc. System and method for obfuscation of reverse compiled computer code
CN102598017B (zh) * 2009-11-13 2016-03-09 爱迪德技术有限公司 提高Java字节码的防窜改能力的系统和方法
EP2378452B1 (en) * 2010-04-16 2012-12-19 Thomson Licensing Method, device and computer program support for verification of checksums for self-modified computer code
KR101299099B1 (ko) * 2011-09-07 2013-09-16 주식회사 팬택 임베디드 시스템에서 최적화된 가상화 모듈을 관리하는 장치 및 방법
JP2013061843A (ja) * 2011-09-14 2013-04-04 Fujifilm Corp コンピュータ・ソフトウエア解析システムならびにクライアント・コンピュータ,その動作制御方法およびその動作プログラム

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006072584A (ja) * 2004-08-31 2006-03-16 Fuji Xerox Co Ltd 実行プログラム生成装置、実行プログラム生成方法、プログラム処理装置、プログラム処理方法及びプログラム
JP2006164184A (ja) * 2004-12-10 2006-06-22 Ntt Docomo Inc プログラム分割装置、プログラム実行装置、プログラム分割方法及びプログラム実行方法
US20100306854A1 (en) * 2009-06-01 2010-12-02 Ab Initio Software Llc Generating Obfuscated Data
KR101234591B1 (ko) 2011-05-13 2013-02-19 주식회사 인프라웨어테크놀러지 Jni를 이용한 안드로이드 난독화 방법
KR101265099B1 (ko) * 2011-06-15 2013-05-20 주식회사 터보테크 소프트웨어 보안 처리방법 및 기록매체
KR101269089B1 (ko) * 2011-08-19 2013-05-29 고려대학교 산학협력단 자가암호화를 이용한 소프트웨어 변조방지 방법

Also Published As

Publication number Publication date
EP2897074A4 (en) 2016-06-15
EP2897074B1 (en) 2017-06-14
KR101490047B1 (ko) 2015-02-04
JP2016503543A (ja) 2016-02-04
EP2897074A1 (en) 2015-07-22
JP5996810B2 (ja) 2016-09-21
US9230123B2 (en) 2016-01-05
US20150154407A1 (en) 2015-06-04

Similar Documents

Publication Publication Date Title
WO2015046655A1 (ko) 자가변환 기반 애플리케이션 코드 난독화 장치 및 그 방법
WO2015023024A1 (ko) 애플리케이션 코드 난독화 장치 및 그 방법
WO2015023023A1 (ko) 코드 난독화 장치 및 그 방법
WO2015026091A1 (ko) 공통 중간 언어 기반 프로그램을 위한 보안 제공 방법
WO2015053509A1 (ko) 동적 라이브러리를 보호하는 방법 및 장치
WO2017026739A1 (ko) 어플리케이션의 코드 난독화를 위한 시스템 및 방법
US8090959B2 (en) Method and apparatus for protecting .net programs
WO2016111413A1 (ko) 분간이 난해한 식별자 변환을 이용한 코드 난독화 장치 및 방법
WO2017150769A1 (ko) 애플리케이션 코드 난독화 장치 및 이를 이용한 애플리케이션 코드 난독화 방법
US10482221B2 (en) Protecting a computer program against reverse engineering
WO2018018797A1 (zh) 功能模块跨平台运行的实现方法和装置
CN102831342A (zh) 一种提高安卓系统中应用程序保护强度的方法
WO2016024838A1 (ko) 클라우드 기반의 애플리케이션 보안 서비스 제공 방법 및 시스템
WO2015093671A1 (ko) Arm 프로세서 기반의 파일 난독화 방법
WO2018012693A1 (ko) 주 기억 장치 내부의 코드 수정을 통한 애플리케이션 코드 은닉 장치 및 이를 이용한 애플리케이션 코드 은닉 방법
WO2016104918A1 (ko) 코드 변환 방법 및 코드 변환 장치
WO2023191557A1 (ko) Dex 파일 보호를 위한 보안 제공 장치와 방법 및 보안 실행 장치와 방법
WO2016064044A1 (ko) 모바일 기기 및 상기 모바일 기기의 동작 방법
Park et al. Multi-partitioned bytecode wrapping scheme for minimizing code exposure on android
WO2017213320A1 (ko) 더미 코드를 사용하는 애플리케이션 코드 은닉 장치 및 이를 이용한 애플리케이션 코드 은닉 방법
CN117828556A (zh) 一种代码处理方法、装置、电子设备及可读存储介质
Itabashi et al. Implementing an applet system without fixing virtual‐machine designs
JP2006024027A (ja) 電子透かし挿入方法および装置
CN117492900A (zh) 类文件加载方法、装置、电子设备及存储介质
CN114741715A (zh) 一种应用程序源码加密方法、装置、计算机设备和计算机可读存储介质

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 14360304

Country of ref document: US

REEP Request for entry into the european phase

Ref document number: 2013894475

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2013894475

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2015542939

Country of ref document: JP

Kind code of ref document: A

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13894475

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE