+

CN1952949A - A software protection method based on modified one time pad - Google Patents

A software protection method based on modified one time pad Download PDF

Info

Publication number
CN1952949A
CN1952949A CNA2006101222917A CN200610122291A CN1952949A CN 1952949 A CN1952949 A CN 1952949A CN A2006101222917 A CNA2006101222917 A CN A2006101222917A CN 200610122291 A CN200610122291 A CN 200610122291A CN 1952949 A CN1952949 A CN 1952949A
Authority
CN
China
Prior art keywords
function
encryption
key
software
encrypted
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CNA2006101222917A
Other languages
Chinese (zh)
Other versions
CN100428262C (en
Inventor
马识佳
罗笑南
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sun Yat Sen University
Original Assignee
Sun Yat Sen University
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 Sun Yat Sen University filed Critical Sun Yat Sen University
Priority to CNB2006101222917A priority Critical patent/CN100428262C/en
Publication of CN1952949A publication Critical patent/CN1952949A/en
Application granted granted Critical
Publication of CN100428262C publication Critical patent/CN100428262C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Storage Device Security (AREA)

Abstract

本发明公开一种基于改进的一次一密乱码本的软件保护方法。本方法包括加密和解密两个过程,摒弃了传统的一步解密的方式,在运行时通过即时解码器以函数为单位一步步解密软件,仅对一次运行中必须的部分解密,使得攻击者难以获得完整的解密后程序,难以篡改并绕过未解密部分中的软件保护功能,增强了抗攻击性,在运行效果上,由于解密分散进行,就解决了启动延时长的问题。用基于一次一密加密技术,与传统的对称密钥加密算法相比,进一步减少了运行时开销,使得该技术在目前处理器上可以流畅运行。该方法增强了基于加密的软件保护的实用性,增大了破解的难度。The invention discloses a software protection method based on an improved one-time pad random codebook. This method includes two processes of encryption and decryption, abandons the traditional one-step decryption method, and uses the instant decoder to decrypt the software step by step in units of functions during operation, and only decrypts the necessary part in one operation, making it difficult for attackers to obtain The complete decrypted program is difficult to tamper with and bypass the software protection function in the undecrypted part, which enhances the anti-attack performance. In terms of running effect, since the decryption is carried out in a decentralized manner, the problem of long startup delay is solved. Compared with the traditional symmetric key encryption algorithm, the one-time pad encryption technology is used to further reduce the runtime overhead, so that the technology can run smoothly on the current processor. The method enhances the practicability of encryption-based software protection and increases the difficulty of cracking.

Description

一种基于改进的一次一密乱码本的软件保护方法A Software Protection Method Based on Improved One-Time-Password Random Code Book

技术领域technical field

本发明属于软件加密解密保护技术领域,具体是一种基于改进的一次一密乱码本的软件保护方法。The invention belongs to the technical field of software encryption and decryption protection, in particular to a software protection method based on an improved one-time password garbled code book.

背景技术Background technique

软件盗版是指非法拷贝并转售软件。盗版给整个软件产业带来巨大的损失。盗版者最基本的技术手段就是通过逆向工程来破解程序,进而对软件进行非法的篡改,用来去掉软件中的合法性自检程序片断等软件保护手段。从技术上对软件进行保护,有着重要的工程应用价值,为了增加盗版者进行逆向工程的难度,提出过混淆技术,抗反汇编技术,反调试技术。然而,没有任何一种技术在理论上是不可攻破的。软件保护的意义在于增加盗版者的法律风险或者增加工程上非法复制软件的技术难度。简单的抗反汇编技术,通过在目标文件中增加无用的随机字节来迷惑反汇编器,相对容易破解。使用加密技术来保护软件,对程序进行加密,运行前自动解密。这样由于可执行程序的磁盘映像中保存的是加密后的程序,反汇编器由于无法获得程序的明文就无法进行反汇编操作。然而使用加密技术进行软件保护,面临着2个必须解决的难题:①加密后的软件要在运行时自行解密,带来运行时开销,对大型的可执行程序更为严重,有较长的启动延时。②程序最终要转化成处理器能够理解的二进制代码流,一方面要对处理器暴露这些信息,另一方面对攻击者隐藏这些信息,这是一个两难问题。通常攻击者对被加密软件的攻击并不是针对密码算法的攻击,而是通过逆向工程手段破解软件的自引导程序片断,找到密钥进行解密,或者,直接利用自引导程序解密之后形成的存储器中的映像。Software piracy is the illegal copying and reselling of software. Piracy has brought huge losses to the entire software industry. The most basic technical method for pirates is to crack the program through reverse engineering, and then illegally tamper with the software to remove software protection methods such as legality self-check program fragments in the software. Technically protecting software has important engineering application value. In order to increase the difficulty of reverse engineering for pirates, obfuscation technology, anti-disassembly technology, and anti-debugging technology have been proposed. However, no technology is theoretically unhackable. The significance of software protection is to increase the legal risks of pirates or to increase the technical difficulty of illegally copying software in engineering. Simple anti-disassembly technology, which confuses the disassembler by adding useless random bytes in the object file, is relatively easy to crack. Use encryption technology to protect the software, encrypt the program, and automatically decrypt it before running. In this way, since the encrypted program is stored in the disk image of the executable program, the disassembler cannot perform the disassembly operation because the plaintext of the program cannot be obtained. However, the use of encryption technology for software protection faces two problems that must be solved: ① The encrypted software must be decrypted at runtime, which brings runtime overhead, which is more serious for large executable programs and has a longer startup time. delay. ②The program should be transformed into a binary code stream that the processor can understand. On the one hand, the information should be exposed to the processor, and on the other hand, it should be hidden from the attacker. This is a dilemma. Usually, the attacker's attack on the encrypted software is not an attack on the cryptographic algorithm, but cracks the self-boot program fragment of the software through reverse engineering, finds the key for decryption, or directly uses the self-boot program to decrypt the memory formed after the decryption. of the image.

通过加密来保护软件,是防止盗版者通过逆向工程破解程序的一种有效方式。传统加密保护方式,运行时解密开销大,又由于采用一次性解密方式,易受到攻击而直接从存储器中获得解密后的程序映像。Protecting software through encryption is an effective way to prevent pirates from cracking programs through reverse engineering. The traditional encryption protection method has a large cost of decryption at runtime, and because of the one-time decryption method, it is vulnerable to attacks and obtains the decrypted program image directly from the memory.

发明内容Contents of the invention

本发明的目的是提供一种基于改进的一次一密乱码本的软件加密方法。本发明方法摒弃了传统的一步解密的方式,在运行时通过即时解码器以函数为单位一步步解密软件,仅对一次运行中必须的部分解密,使得攻击者难以获得完整的解密后程序,难以篡改并绕过未解密部分中的软件保护功能,增强了抗攻击性,在运行效果上,由于解密分散进行,就解决了启动延时长的问题。用基于一次一密加密技术,与传统的对称密钥加密算法相比,进一步减少了运行时开销,使得该技术在目前处理器上可以流畅运行。该方法增强了基于加密的软件保护的实用性,增大了破解的难度。The purpose of the present invention is to provide a software encryption method based on an improved one-time pad random code book. The method of the present invention abandons the traditional one-step decryption method, and uses the real-time decoder to decrypt the software step by step with the function as the unit during operation, and only decrypts the necessary part in one operation, making it difficult for the attacker to obtain the complete decrypted program. Tampering and bypassing the software protection function in the undecrypted part enhances the anti-attack performance. In terms of operation effect, since the decryption is performed in a decentralized manner, the problem of long startup delay is solved. Compared with the traditional symmetric key encryption algorithm, the one-time pad encryption technology is used to further reduce the runtime overhead, so that the technology can run smoothly on the current processor. The method enhances the practicability of encryption-based software protection and increases the difficulty of cracking.

本发明实现上述发明目的所采用的技术方案如下:本方法包括加密和解密两个过程,加密过程包括以下步骤:The technical scheme that the present invention realizes above-mentioned purpose of the invention adopted is as follows: the method comprises two processes of encryption and decryption, and the encryption process comprises the following steps:

a.为当前处理函数在改进的一次一密乱码本中随机选取加密密钥,在全局数据结构“已加密函数表”中标记该函数已被加密处理,并记录加密密钥;a. Randomly select an encryption key in the improved one-time pad random code book for the current processing function, mark the function as encrypted in the global data structure "encrypted function table", and record the encryption key;

b.在函数体之前为函数添加一个跳板;b. Add a springboard to the function before the function body;

c.扫描当前处理函数的每一条指令,对于函数调用做特殊处理,为其增加传递隐式参数的指令;c. Scan each instruction of the current processing function, do special processing for function calls, and add instructions for passing implicit parameters to it;

d.对函数体的指令逐条扫描结束后,使用步骤a中产生的密钥对函数体使用改进的一次一密乱码本加密。d. After scanning the instructions of the function body one by one, use the key generated in step a to encrypt the function body with an improved one-time pad random code book.

解密过程是:在软件运行时,每个函数当第1次被调用的时候进行解密操作,即时解码器负责解密每个函数,解密后的函数体仍在主存中原来的位置,然后把函数体前面的跳板打上补丁去掉,当第2次执行的时候直接执行解密后的函数体,无须再次解密。The decryption process is: when the software is running, each function is decrypted when it is called for the first time, and the real-time decoder is responsible for decrypting each function. The decrypted function body is still in the original position in the main memory, and then the function The springboard in front of the body is patched and removed, and when it is executed for the second time, the decrypted function body is directly executed without decrypting it again.

所述步骤a中的一次一密乱码本是一个足够大的二进制密钥池K,设其大小为N个字节,每个字节的编址为0,1,…,N-1;这个二进制密钥池中的密钥为N个介于[0,255]之间的随机数。The one-time pad in the step a is a sufficiently large binary key pool K, whose size is N bytes, and the addressing of each byte is 0, 1, ..., N-1; this The keys in the binary key pool are N random numbers between [0, 255].

所述步骤a中密钥的选取过程如下:首先生成一个[0,N-1]之间的随机数x,以K[x]作为密钥的第一个字节,然后根据被加密方法体的二进制编码长度,选取K[x]的后续字节,如果到达密钥池的结尾,则从密钥池的开始位置继续选取,直到密钥长度等于被加密方法体的二进制编码长度。The selection process of the key in the step a is as follows: first generate a random number x between [0, N-1], use K[x] as the first byte of the key, and then according to the encrypted method body The binary code length of K[x] is selected, and if the end of the key pool is reached, the selection is continued from the beginning of the key pool until the key length is equal to the binary code length of the encrypted method body.

所述步骤c中隐式参数是指被调用函数的加密密钥,如果被调用函数已经在此之前被加密保护,则加密密钥可以从全局数据结构“已加密函数表”中获得,对于被调用函数还没有被加密的情况,递归调用本算法首先处理被调用函数。The implicit parameter in step c refers to the encryption key of the called function. If the called function has been encrypted and protected before then, the encryption key can be obtained from the global data structure "encrypted function table". If the calling function has not been encrypted, the recursive call algorithm first processes the called function.

所述步骤d中使用后的一次一密乱码本以某种形式存在于加密后的程序当中,可以以明文的形式,也可以以使用某种加密算法加密后的密文形式存在。The one-time pad used in the step d exists in the encrypted program in some form, which can be in the form of plain text or in the form of cipher text encrypted by using some encryption algorithm.

所述解密过程中用于解密的具体密钥(密钥在乱码本中的起始位置)并不以明文的形式在代码中存在,而是由被解密函数的调用者在调用时作为一个隐式参数来提供。The specific key used for decryption in the decryption process (the starting position of the key in the garbled code book) does not exist in the code in the form of plain text, but is used as an implicit key when called by the caller of the decrypted function. formula parameters to provide.

与普通加密方法相比,本发明软件保护方法的优点在于:Compared with common encryption method, the advantage of software protection method of the present invention is:

1、在运行时通过即时解码器以函数为单位一步步揭开隐藏在软件中的秘密。仅对一次运行中必须的部分解密,使得攻击者难以获得完整的解密后程序,难以篡改并绕过未解密部分中的软件保护功能,增强了抗攻击性。1. Uncover the secrets hidden in the software step by step with the function as a unit through the real-time decoder at runtime. Only the necessary part of one operation is decrypted, making it difficult for an attacker to obtain a complete decrypted program, and it is difficult to tamper with and bypass the software protection function in the undecrypted part, which enhances the attack resistance.

2、在运行效果上,由于解密分散进行,就解决了启动延时长的问题。用基于一次一密加密技术,与对称密钥加密算法相比,进一步减少了运行时开销,使得该技术在目前处理器上可以流畅运行。该方法增强了基于加密的软件保护的实用性,增大了破解的难度。2. In terms of operation effect, since the decryption is carried out in a decentralized manner, the problem of long startup delay is solved. Compared with the symmetric key encryption algorithm, the one-time-pad encryption technology further reduces the runtime overhead, so that the technology can run smoothly on the current processor. The method enhances the practicability of encryption-based software protection and increases the difficulty of cracking.

3、用于解密的具体密钥并不以明文的形式在代码中存在,而是由被解密函数的调用者在调用时作为一个隐式参数来提供。所以只有解密了一个函数的某一调用者才可以进一步解密被调用的函数。3. The specific key used for decryption does not exist in the code in the form of plain text, but is provided as an implicit parameter by the caller of the decrypted function when calling. So only a caller who has decrypted a function can further decrypt the called function.

4、即时解密技术一步步揭开隐藏在代码中的秘密。在软件的执行过程中,没有使用到的软件片断的逻辑不会被揭秘,这就避免了攻击者一次性通过调试器等工具获得解密后应用程序在主存中的映像。4. Instant decryption technology reveals the secrets hidden in the code step by step. During the execution of the software, the logic of unused software segments will not be revealed, which prevents the attacker from obtaining the image of the decrypted application program in the main memory through tools such as a debugger at one time.

5、即时解密技术仅仅对一次运行中需要的代码进行解密,对没有运行到的代码并不解密,这又进一步减少了解密所需的时间。与传统的一次性解密方法相比较,解密的操作分为多次进行,也有效地减小了软件启动的时间。由于采用退化的一次一密乱码本加解密,解密的运算仅仅是简单的异或操作,即使对于交互性应用也感觉不到明显的延时。5. The instant decryption technology only decrypts the codes needed in one run, and does not decrypt the codes that have not been run, which further reduces the time required for decryption. Compared with the traditional one-time decryption method, the decryption operation is divided into multiple times, which also effectively reduces the software startup time. Due to the use of the degenerated one-time pad garbled codebook for encryption and decryption, the decryption operation is only a simple XOR operation, and no obvious delay is felt even for interactive applications.

附图说明Description of drawings

图1是解密过程示意图;Figure 1 is a schematic diagram of the decryption process;

图2是本方法和传统软件加密保护方法的运行时间开销比较图。Fig. 2 is a comparison diagram of running time overhead between this method and the traditional software encryption protection method.

具体实施方式Detailed ways

下面结合附图对本发明作进一步说明。The present invention will be further described below in conjunction with accompanying drawing.

本发明方法是采用用改进的一次一密乱码本来实现软件加密的。一次一密乱码本使用一个大的不重复的真随机密钥字母集,这个密钥字母集被称为乱码本。本发明方法是将一次一密乱码本加密算法进行推广,用二进制数字组成的一次密乱码本代替由字母组成的一次一密乱码本,用异或代替明文字母加法。解密时只需对照一次一密乱码本再次异或即可。在使用加密方法对软件进行保护时,解密是在软件运行时自动完成的,所以解密时间要占用软件的运行时间。用一次一密乱码本,解密的操作仅仅是一个简单的异或操作,与传密码算法相比,解密时间有大幅提高。改进的一次一密乱码本,是一个足够大的二进制密钥池K,设其大小为N个字节,每个字节的编址为0,1,…,N-1。这个二进制密钥池中的密钥为N个介于[0,255]之间的随机数。对软件的加密保护,以程序中的函数为单位,对每个函数体分别加密,并且在密钥池中随机选取不同的密钥。密钥的选取过程如下,生成一个[0,N-1]之间的随机数x,以K[x]作为密钥的第一个字节,根据被加密方法体的二进制编码长度,选取K[x]的后续字节,如果到达密钥池的结尾,则从密钥池的开始位置继续选取,直到密钥长度等于被加密方法体的二进制编码长度。设程序中共有方法F个,即使攻击者清楚加密保护算法的原理,但是如果无法准确获得每个方法的密钥,而尝试破解软件需要进行F×N次试验,而且每次试验结果是否正确很难判断,从而无法自动完成。由于N是足够大的数,并且在一个实际的软件中F一般也很大,这就使破解加密的尝试在实际的工程中不可行。对于软件的保护并不依赖于算法的保密性是本算法的一个良好性质。The method of the present invention realizes software encryption by using an improved one-time-pass random code book. One-time pad garbled codes use a large set of non-repeating true random key letters, which is called garbled codes. The method of the invention is to popularize the encryption algorithm of the one-time pad garbled code book, replace the one-time pad garbled code book composed of letters with the one-time pad garbled code book composed of binary numbers, and replace the addition of plaintext letters with XOR. When decrypting, it only needs to be XORed again against the one-time password garbled code book. When the encryption method is used to protect the software, the decryption is automatically completed when the software is running, so the decryption time takes up the running time of the software. With the one-time pad, the decryption operation is just a simple XOR operation. Compared with the traditional encryption algorithm, the decryption time is greatly improved. The improved one-time pad is a sufficiently large binary key pool K, whose size is N bytes, and the address of each byte is 0, 1, ..., N-1. The keys in this binary key pool are N random numbers between [0, 255]. Encryption and protection of software, with the function in the program as the unit, each function body is encrypted separately, and different keys are randomly selected in the key pool. The key selection process is as follows, generate a random number x between [0, N-1], take K[x] as the first byte of the key, and select K according to the binary code length of the encrypted method body If the subsequent bytes of [x] reach the end of the key pool, continue to select from the beginning of the key pool until the key length is equal to the binary code length of the encrypted method body. Assuming that there are F methods in the program, even if the attacker knows the principle of the encryption protection algorithm, if the key of each method cannot be obtained accurately, F×N trials are required to try to crack the software, and it is very difficult to determine whether the result of each trial is correct. Difficult to judge, so it cannot be done automatically. Since N is a large enough number, and F is generally large in an actual software, this makes the attempt to break the encryption infeasible in actual engineering. It is a good property of this algorithm that the protection of software does not depend on the secrecy of the algorithm.

软件加密过程如下,从软件的入口函数开始,以函数为单位递归进行:①为当前处理函数随机选取加密密钥,在全局数据结构“已加密函数表”中标记该函数已被加密处理,并记录加密密钥。②在函数体之前为函数添加一个跳板。③扫描当前处理函数的每一条指令,对于函数调用做特殊处理,为其增加传递隐式参数的指令。这个隐式参数为被调用函数的加密密钥。如果被调用函数已经在此之前被加密保护,则加密密钥可以从全局数据结构“已加密函数表”中获得。对于被调用函数还没有被加密的情况,递归调用本算法首先处理被调用函数。④对函数体的指令逐条扫描结束后,使用①中产生的密钥对函数体使用乱码本加密。退化的一次一密乱码本就以某种形式存在于加密后的程序当中。可以以明文的形式,也可以以使用某种加密算法加密后的密文形式存在。本发明的健壮性不依赖于保守乱码本的秘密,由于每个方法采用不同密钥加密,即使获得乱码本也难以轻易破解。这与传统的使用一个密钥加密软件,并且依靠保守密钥的秘密来防范破解的方法是本质不同的。传统的基于加密的软件保护方法,在软件自引导的时候,一次性对软件进行解密。这种方法的一个显著弱点是解密后的软件以明文的形式存在于主存当中,很容易让攻击者通过调试器等工具直接从主存获得解密后的软件。本发明方法采用即时解密技术,每个函数当第1次被调用的时候才进行解密操作,解密结束之后交处理器执行。本发明在每个加密后的函数体的前面都添加了一个跳板,调用即时解码器。即时解码器负责在运行时解密每个函数,解密后的函数体仍在主存中原来的位置,只不过前面的跳板已经被打上补丁去掉,当第2次执行的时候直接执行解密后的函数体,无须再次解密,如图1所示。The software encryption process is as follows, starting from the entry function of the software, and recursively proceeding in units of functions: ① Randomly select an encryption key for the current processing function, mark the function as encrypted in the global data structure "encrypted function table", and Record the encryption key. ② Add a springboard to the function before the function body. ③ Scan each instruction of the current processing function, do special processing for the function call, and add instructions for passing implicit parameters to it. This implicit parameter is the encryption key of the called function. If the called function has been encrypted before then, the encryption key can be obtained from the global data structure "encrypted function table". For the situation that the called function has not been encrypted yet, recursively call this algorithm to process the called function first. ④ After scanning the instructions of the function body one by one, use the key generated in ① to encrypt the function body with a garbled code book. The degenerated one-time pad garbled codebook exists in some form in the encrypted program. It can be in the form of plain text or in the form of cipher text encrypted with some encryption algorithm. The robustness of the present invention does not depend on keeping the secret of the garbled code book, because each method adopts different keys for encryption, even if the garbled code book is obtained, it is difficult to easily crack it. This is fundamentally different from the traditional method of using a key to encrypt software and relying on the secret of the key to prevent cracking. In the traditional encryption-based software protection method, the software is decrypted once when the software is self-booting. A significant weakness of this method is that the decrypted software exists in the main memory in the form of plain text, and it is easy for an attacker to obtain the decrypted software directly from the main memory through tools such as a debugger. The method of the present invention adopts the instant decryption technology, and each function performs the decryption operation when it is called for the first time, and after the decryption is completed, it is handed over to the processor for execution. The present invention adds a springboard in front of each encrypted function body to call the instant decoder. The real-time decoder is responsible for decrypting each function at runtime. The decrypted function body is still in the original location in the main memory, but the previous springboard has been patched and removed. When it is executed for the second time, the decrypted function is directly executed. Body, no need to decrypt again, as shown in Figure 1.

用于解密的具体密钥(密钥在乱码本中的起始位置)并不以明文的形式在代码中存在,而是由被解密函数的调用者在调用时作为一个隐式参数来提供。所以只有解密了一个函数的某一调用者才可以进一步解密被调用的函数。即时解密技术一步步揭开隐藏在代码中的秘密,在软件的执行过程中,没有使用到的软件片断的逻辑不会被揭秘,这就避免了攻击者一次性通过调试器等工具获得解密后应用程序在主存中的映像。现代软件的功能是强大而复杂的,一个软件系统可以完成若干项主要功能,软件的一次运行仅使用其中一部分功能。并且软件中有很大一部分的逻辑是用来处理各种异常和例外情况的,在通常情况下这些代码并不运行。这就保证了一个攻击者,即使多次运行软件也很难把软件解密完全。未被解密的代码中,就可以隐藏用于软件合法性自检和自毁的程序片断。这些程序片断如果不被盗版者成功的去除,盗版的非法拷贝的使用价值就会大大降低。现代软件是庞大的,即时解密技术仅仅对一次运行中需要的代码进行解密,对没有运行到的代码并不解密,这又进一步减少了解密所需的时间。与传统的一次性解密方法相比较,解密的操作分为多次进行,也有效地减小了软件启动的时间。由于采用退化的一次一密乱码本加解密,解密的运算仅仅是简单的异或操作,即使对于交互性应用也感觉不到明显的延时。The specific key used for decryption (the starting position of the key in the garbled code book) does not exist in the code in the form of plain text, but is provided as an implicit parameter by the caller of the decrypted function when calling. So only a caller who has decrypted a function can further decrypt the called function. The real-time decryption technology reveals the secrets hidden in the code step by step. During the execution of the software, the logic of the unused software fragments will not be revealed, which prevents the attacker from obtaining the decryption through a debugger and other tools at one time. The application's image in main memory. The functions of modern software are powerful and complex. A software system can complete several main functions, and only a part of the functions are used in one run of the software. And a large part of the logic in the software is used to handle various exceptions and exceptions, and these codes do not run normally. This ensures that an attacker can hardly decrypt the software completely even if the software is run many times. In the undecrypted code, the program fragments used for software legality self-check and self-destruction can be hidden. If these program fragments are not successfully removed by pirates, the use value of pirated illegal copies will be greatly reduced. Modern software is huge, and the instant decryption technology only decrypts the codes needed in one run, and does not decrypt the codes that have not been run, which further reduces the time required for decryption. Compared with the traditional one-time decryption method, the decryption operation is divided into multiple times, which also effectively reduces the software startup time. Due to the use of the degenerated one-time pad garbled codebook for encryption and decryption, the decryption operation is only a simple XOR operation, and no obvious delay is felt even for interactive applications.

为了验证基于退化的一次一密乱码本的软件加密技术和即时解密技术在运行时开销方面的优势,将其与传统的软件加密保护方法进行了比较。选择不同大小的应用程序映像,以考察不同规模应用程序应用这项技术的可行性。对于使用的加密算法,采用了本文中建议的退化的一次一密乱码本加密,标准DES,3DES。而没有采用基于公开密钥的RSA等算法,这是因为软件实现的RSA算法比DES算法要慢100倍[2],运行时开销过大。使用AMD Athlon XP 2500+处理器512 MDDR存储器的计算机为试验平台,DES、3DES算法采用cryptlib的高效软件实现,所得试验数据如图2中所示。其中,DES,3DES,OTP分别对应采用相应算法一次性解密的总时间,其后的列对应着采用JIT(Just-In-Time,运行时编译执行)方式解密一个函数的平均时间。对于现代的微处理器,其计算能力已很强大。对于对称密钥加密和一次一密乱码本加密的解密时间均有不错的实验结果。对于较小的应用程序,即使用DES/3DES进行加密并一次解密也不会带来大的启动时延。对于较大的应用程序,用DES/3DES进行加密并且一次解密就会略感时延,这就体现出一次一密乱码本比DES、3DES分别快约3倍、9倍的优势。使用即时解密更能大大缩短启动时延,用上述3种算法启动时时延均不明显。解密每个函数的时间根据采用的加密算法而变化,以一次一密乱码本最短。对于交互式应用,用一次一密乱码本加密JIT解密方式,运行中无停滞感。对于对称密钥加密,如用JIT解密,运行时偶有停滞感,这是集中解密造成的时延。In order to verify the advantages of degenerate one-time pad garbled software encryption technology and on-the-fly decryption technology in terms of runtime overhead, it is compared with traditional software encryption protection methods. Application images of different sizes were selected to examine the feasibility of applying this technology to applications of different sizes. For the encryption algorithm used, the degenerate one-time pad garbled encryption proposed in this paper, standard DES, 3DES is adopted. And did not use algorithms such as RSA based on the public key, this is because the RSA algorithm implemented by software is 100 times slower than the DES algorithm [2], and the runtime overhead is too large. The computer using AMD Athlon XP 2500+ processor and 512 MDDR memory is the test platform, and the DES and 3DES algorithms are realized by the efficient software of cryptlib. The obtained test data are shown in Figure 2. Among them, DES, 3DES, and OTP respectively correspond to the total time of one-time decryption using the corresponding algorithm, and the subsequent columns correspond to the average time of decrypting a function using JIT (Just-In-Time, runtime compilation and execution) method. For modern microprocessors, its computing power is already very powerful. There are good experimental results for the decryption time of symmetric key encryption and one-time pad encryption. For smaller applications, even using DES/3DES to encrypt and decrypt once will not bring a large startup delay. For larger applications, using DES/3DES for encryption and one-time decryption will cause a slight delay, which shows that the one-time password random code book is about 3 times and 9 times faster than DES and 3DES respectively. The use of instant decryption can greatly shorten the start-up delay, and the start-up delay is not obvious when using the above three algorithms. The time to decrypt each function varies according to the encryption algorithm used, and the one-time-pass random code book is the shortest. For interactive applications, use the one-time pad garbled encryption JIT decryption method, and there is no sense of stagnation during operation. For symmetric key encryption, if JIT is used for decryption, there may occasionally be a sense of stagnation during operation, which is the delay caused by centralized decryption.

Claims (6)

1, a kind of method for protecting software based on improved One-time pad, this method comprise two processes of encryption and decryption, it is characterized in that: described ciphering process step is as follows:
A. for working as pre-treatment function picked at random encryption key in improved One-time pad, the encrypted processing of this function of mark in global data structures " encryption function table ", and recording of encrypted key;
B. before function body, add a springboard for function;
C. scanning is done special processing for function call, for it increases the instruction of transmitting the implicit expression parameter when each bar instruction of pre-treatment function;
D. one by one behind the end of scan, use the key that produces among the step a to use improved One-time pad to encrypt to the instruction of function body to function body;
Described decrypting process is: when running software, each function is decrypted operation invoked the time when the 1st time, the instantaneous decoding device is responsible for deciphering each function, function body after the deciphering is original position in main memory still, then the springboard of function body front being stamped patch removes, when carrying out for the 2nd time, directly carry out the function body after deciphering, need not decipher once more.
2, method for protecting software according to claim 1 is characterized in that the One-time pad among the described step a is an enough big binary keys pond K, establishes its size for N byte, each byte be addressed to 0,1 ..., N-1; Key in this binary keys pond is N the random number between [0,255].
3, method for protecting software according to claim 1 and 2; it is characterized in that key among the described step a to choose process as follows: at first generate one [0; N-1] between random number x; with k[x] as first byte of key; according to the binary coding length of encrypted method body, choose K[x then] subsequent byte, if arrive the ending of pool of keys; then continue to choose, equal the binary coding length of encrypted method body up to key length from the starting position of pool of keys.
4, method for protecting software according to claim 1; it is characterized in that implicit expression parameter among the described step c is meant the encryption key of the function that is called; the encrypted before this protection of function if be called; then encryption key can obtain from global data structures " encryption function table "; also do not have encrypted situation for the function that is called, this algorithm of recursive call is at first handled the function that is called.
5, method for protecting software according to claim 1; One-time pad after it is characterized in that in the described steps d using is present in the middle of the program after the encryption with certain form; can also can exist with form expressly to use the ciphertext form after certain cryptographic algorithm is encrypted.
6, method for protecting software according to claim 1; it is characterized in that the concrete key (key is in the reference position of clobber book) that is used for deciphering in the described decrypting process does not exist in code with form expressly, but when calling, provide as an implicit expression parameter by decrypted function calls person.
CNB2006101222917A 2006-09-22 2006-09-22 A Software Protection Method Based on Improved One-Time-Password Random Code Book Expired - Fee Related CN100428262C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006101222917A CN100428262C (en) 2006-09-22 2006-09-22 A Software Protection Method Based on Improved One-Time-Password Random Code Book

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006101222917A CN100428262C (en) 2006-09-22 2006-09-22 A Software Protection Method Based on Improved One-Time-Password Random Code Book

Publications (2)

Publication Number Publication Date
CN1952949A true CN1952949A (en) 2007-04-25
CN100428262C CN100428262C (en) 2008-10-22

Family

ID=38059290

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006101222917A Expired - Fee Related CN100428262C (en) 2006-09-22 2006-09-22 A Software Protection Method Based on Improved One-Time-Password Random Code Book

Country Status (1)

Country Link
CN (1) CN100428262C (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101986663A (en) * 2010-11-29 2011-03-16 北京卓微天成科技咨询有限公司 OTP-based cloud storage data storing method, device and system
CN102819702A (en) * 2012-07-19 2012-12-12 腾讯科技(深圳)有限公司 File encryption operation method and file encryption operation system
TWI488478B (en) * 2008-06-11 2015-06-11 微軟公司 Techniques for performing symmetric cryptography
CN105049203A (en) * 2015-06-17 2015-11-11 复旦大学 Configurable 3DES encryption and decryption algorism circuit capable of supporting multiple work modes
CN106599620A (en) * 2016-11-16 2017-04-26 中国人民解放军国防科学技术大学 Binary software protection method based on dynamic code conversion
CN113380016A (en) * 2021-06-09 2021-09-10 贵州电网有限责任公司 Metering automation system based on handheld device and use method thereof
CN117454438A (en) * 2023-12-25 2024-01-26 深圳鼎智通讯有限公司 Attacked self-destruction system and intelligent payment terminal

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1064558A (en) * 1992-03-23 1992-09-16 天宇光电技术开发有限公司 The function encryption method of computer software and device thereof
NO302388B1 (en) * 1995-07-13 1998-02-23 Sigurd Sigbjoernsen Procedure and apparatus for protecting software against unauthorized use
US6236727B1 (en) * 1997-06-24 2001-05-22 International Business Machines Corporation Apparatus, method and computer program product for protecting copyright data within a computer system
AT411500B (en) * 2001-06-12 2004-01-26 Siemens Ag Oesterreich DUAL TOLL SYSTEM
CN1288526C (en) * 2004-09-01 2006-12-06 中国科学院计算技术研究所 Software protective method based on function encrypting

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI488478B (en) * 2008-06-11 2015-06-11 微軟公司 Techniques for performing symmetric cryptography
CN101986663A (en) * 2010-11-29 2011-03-16 北京卓微天成科技咨询有限公司 OTP-based cloud storage data storing method, device and system
CN102819702A (en) * 2012-07-19 2012-12-12 腾讯科技(深圳)有限公司 File encryption operation method and file encryption operation system
US9154309B2 (en) 2012-07-19 2015-10-06 Tencent Technology (Shenzhen) Company Limited Method and system for running encrypted files
CN102819702B (en) * 2012-07-19 2015-11-25 腾讯科技(深圳)有限公司 File encryption operation method and file encryption operational system
CN105049203A (en) * 2015-06-17 2015-11-11 复旦大学 Configurable 3DES encryption and decryption algorism circuit capable of supporting multiple work modes
CN105049203B (en) * 2015-06-17 2018-06-29 复旦大学 A kind of configurable 3DES enciphering and deciphering algorithms circuit for supporting multi-operation mode
CN106599620A (en) * 2016-11-16 2017-04-26 中国人民解放军国防科学技术大学 Binary software protection method based on dynamic code conversion
CN113380016A (en) * 2021-06-09 2021-09-10 贵州电网有限责任公司 Metering automation system based on handheld device and use method thereof
CN117454438A (en) * 2023-12-25 2024-01-26 深圳鼎智通讯有限公司 Attacked self-destruction system and intelligent payment terminal
CN117454438B (en) * 2023-12-25 2024-04-09 深圳鼎智通讯有限公司 Attacked self-destruction system and intelligent payment terminal

Also Published As

Publication number Publication date
CN100428262C (en) 2008-10-22

Similar Documents

Publication Publication Date Title
Yan et al. Improving cost, performance, and security of memory encryption and authentication
CN100428262C (en) A Software Protection Method Based on Improved One-Time-Password Random Code Book
CN105681039B (en) Method and apparatus for generating keys and corresponding decryption
US9053300B2 (en) Device and a method for generating software code
JP3747520B2 (en) Information processing apparatus and information processing method
TWI478050B (en) Methods and devices for instruction level software encryption
JP5167348B2 (en) Software encryption method, software decryption method, software encryption device, and software decryption device
CN106228076B (en) A kind of picture validation code guard method and system based on SGX
CN102346834A (en) Method for encrypting and protecting Java application software
CA2771080A1 (en) Secure media path methods, systems, and architecture
CN105681025A (en) Security white box realizing method and device for national cipher standard algorithm SM4
WO2008079524A3 (en) Key protection mechanism
CN101359991A (en) Identity-based public key cryptography private key escrow system
CN104704501B (en) securely generate and store passwords in computer systems
CN101957903A (en) Method and device for protecting class files
KR101269089B1 (en) Software modulation prevention method using own encryption
KR101458479B1 (en) Method of encrypting and decrypting the data of the session state
US20170046280A1 (en) Data processing device and method for protecting a data processing device against attacks
CN103995992A (en) Method and device for protecting software
CN111884814B (en) Method and system for preventing intelligent terminal from being counterfeited
CN105426702A (en) Android operating system based application program encrypting method and device, and Android operating system based application program decrypting method and device
CN118740825A (en) Method, device, storage medium and vehicle for transmitting vehicle configuration file
Vaslin et al. A security approach for off-chip memory in embedded microprocessor systems
CN104504312A (en) Software anti-debug protecting method
JP3570781B2 (en) Software protection system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20081022

Termination date: 20140922

EXPY Termination of patent right or utility model
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载