Authentication device, authentication method, and authentication program
The authentication system addresses the challenge of applying high-strength obfuscation across various terminals by dynamically adjusting obfuscation levels based on terminal execution environments, ensuring secure authentication and preventing stack overflows.
Patent Information
- Application Number
- JP2022104911
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2022-06-29
- Publication Date
- 2025-04-16
- Estimated Expiration
- 2042-06-29
AI Technical Summary
Existing authentication systems face challenges in applying high-strength obfuscation techniques stably across various terminals due to constraints in execution environments.
An authentication system that includes a flag information storage unit, a conversion rule storage unit, and an obfuscation processing unit, which dynamically adjusts the obfuscation level based on the terminal's execution environment by controlling the number of stacks and memory usage in the stack memory.
Enables appropriate obfuscation according to the terminal's execution environment, preventing stack overflows and ensuring secure authentication by dynamically managing the number of stacks and memory usage.
Smart Images

Figure 0007663536000001 
Figure 0007663536000002
Abstract
Description
[Technical field]
[0001] The present invention relates to an authentication system that receives data generated by a specific program and verifies the validity of the data. [Background technology]
[0002] Conventionally, when taking measures against phishing, in order to verify that the terminal of the communication partner is using the program intended by the server, data generated by this program is sent from the terminal to the server, and the server verifies the value and checks whether the value sent is correct. If the communication partner is running the correct program, this verification makes it possible to infer that other operations in this program, such as functions to check that the terminal is not behaving in an unauthorized manner, are also operating.
[0003] In order to protect the programs provided by the server to the terminals from analysis by attackers, various obfuscation techniques have been proposed. Obfuscation is a technique that increases the cost of analyzing a program by converting the program into a complex form without changing the execution result of the program (for example, see Patent Document 1). [Prior art documents] [Patent documents]
[0004] [Patent Document 1] JP 2011-018119 A Summary of the Invention [Problem to be solved by the invention]
[0005] When protecting a program, dynamically performing obfuscation is one of the effective methods for improving the strength of the obfuscation. However, due to restrictions on the obfuscation method depending on the execution environment of the target device, it has been difficult to stably apply strong obfuscation to various devices.
[0006] An object of the present invention is to provide an authentication device, an authentication method, and an authentication program that can provide appropriate obfuscation to an authentication program executed on a terminal in accordance with the execution environment. [Means for solving the problem]
[0007] The authentication device of the present invention includes a flag information storage unit that stores, for each obfuscation flag indicating a terminal type, a maximum stack number of a stack memory used by a program that can be executed normally; a conversion rule storage unit that stores a conversion rule of program code for obfuscation and the number of stacks increased in the stack memory in correspondence with each other; a flag receiving unit that receives the obfuscation flag from a communication partner terminal; an obfuscation processing unit that obfuscates an authentication program in accordance with the conversion rule, counts the number of stacks increased in the stack memory, and controls the number of stacks so as not to exceed the maximum stack number corresponding to the received obfuscation flag; a program transmitting unit that transmits the authentication program obfuscated by the obfuscation processing unit to the communication partner terminal; and a verification unit that receives an execution result of the authentication program and verifies the legitimacy of the execution result.
[0008] The flag information storage unit may store a maximum memory usage for each of the obfuscation flags, the conversion rule storage unit may store the conversion rule in association with the increased memory usage, and the obfuscation processing unit may count the increased memory usage while obfuscating the authentication program in accordance with the conversion rule, and control the increased memory usage so as not to exceed the maximum memory usage corresponding to the received obfuscation flag.
[0009] The flag information storage unit may store, for each of the obfuscation flags, whether a system call can be used, and the obfuscation processing unit may select the conversion rule based on whether the system call can be used.
[0010] The flag information storage unit may store, for each of the obfuscation flags, whether or not an overflow of a variable can be used, and the obfuscation processing unit may select the conversion rule based on whether or not an overflow can be used.
[0011] The authentication method of the present invention includes a flag information storage step of storing, for each obfuscation flag indicating a type of terminal, a maximum stack number of a stack memory used by a program that can be executed normally; a conversion rule storage step of storing a conversion rule of a program code for obfuscation and the number of stacks increased in the stack memory in correspondence with each other; a flag receiving step of receiving the obfuscation flag from a communication partner terminal; an obfuscation processing step of counting the number of stacks increased in the stack memory while obfuscating an authentication program in accordance with the conversion rule, and controlling the number of stacks so as not to exceed the maximum stack number corresponding to the received obfuscation flag; a program transmitting step of transmitting the authentication program obfuscated in the obfuscation processing step to the communication partner terminal; and a verification step of receiving an execution result of the authentication program and verifying the legitimacy of the execution result.
[0012] An authentication program according to the present invention causes a computer to function as the authentication device. Effect of the Invention
[0013] According to the present invention, it is possible to provide an authentication program to a terminal after performing appropriate obfuscation according to the execution environment. [Brief description of the drawings]
[0014] [Figure 1] FIG. 2 is a diagram showing a communication flow in the authentication system of the embodiment. [Diagram 2] FIG. 2 is a diagram illustrating a functional configuration of a server according to an embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0015] An example of an embodiment of the present invention will now be described. FIG. 1 is a diagram showing a communication flow in an authentication system 1 of the present embodiment.
[0016] The authentication system 1 includes a server 10 and a terminal 20 as authentication devices, and in order for the server 10 to verify that the terminal 20 has executed a specific program, the server 10 transmits an obfuscated authentication program to the terminal 20 to have it executed, and the server 10 receives the execution result of this program and verifies its legitimacy.
[0017] First, the terminal 20 transmits a flag for determining a program obfuscation method to the server 10 (step S1). This flag is data indicating the execution environment of the terminal 20, and the server 10 limits the number of stacks in the stack memory used by the obfuscated program according to the acquired flag.
[0018] Next, the server 10 transmits the obfuscated program to the terminal 20 (step S2). The terminal 20 executes the received program, and transmits data obtained as a result of the execution to the server 10 (step S3).
[0019] FIG. 2 is a diagram showing the functional configuration of the server 10 in this embodiment. The server 10 is an information processing device (computer) including a control unit 11, a storage unit 12, and various input / output interfaces.
[0020] The control unit 11 is a part that controls the entire server 10, and realizes each function in this embodiment by appropriately reading and executing various programs stored in the storage unit 12. The control unit 11 may be a CPU.
[0021] The storage unit 12 is a storage area for storing various programs for causing the hardware group to function as the server 10, various data, and the like, and may be a ROM, a RAM, a flash memory, a hard disk drive (HDD), or the like. Specifically, the storage unit 12 stores an authentication program for implementing the authentication method of this embodiment, and also includes a flag information storage unit 121 and a conversion rule storage unit 122.
[0022] The flag information storage unit 121 stores, for each obfuscation flag indicating the type of terminal, the maximum stack number of the stack memory used by a program that can be executed normally. Furthermore, the flag information storage unit 121 may store, for each obfuscation flag, the maximum memory usage, whether a system call can be used, whether an overflow can be used, and the like.
[0023] The conversion rule storage unit 122 stores conversion rules for obfuscation of program code in association with the number of stacks to be increased in the stack memory. Furthermore, the conversion rule storage unit 122 may store the conversion rule in association with an increase in memory usage.
[0024] The control unit 11 includes a flag receiving unit 111 , an obfuscation processing unit 112 , a program transmitting unit 113 , and a verifying unit 114 .
[0025] The flag receiving unit 111 receives an obfuscation flag in advance from a terminal of a communication partner to be authenticated. Note that an obfuscation flag is assigned in advance to each of the multiple terminals 20 according to its type, and the server 10 can determine the model information of the terminal 20 from the flag.
[0026] The obfuscation processor 112 counts the number of stacks that increases in the stack memory while obfuscating the authentication program in accordance with the conversion rule, and controls so that the number of stacks does not exceed the maximum stack number that corresponds to the obfuscation flag received from the terminal 20. Furthermore, the obfuscation processor 112 may count the increasing memory usage while obfuscating the authentication program in accordance with the conversion rule, and control the memory usage so as not to exceed the maximum memory usage corresponding to the received obfuscation flag. Furthermore, the obfuscation processor 112 may select a conversion rule based on whether a system call associated with an obfuscation flag can be used or whether an overflow of a variable can be used.
[0027] For example, consider a program that defines variables like this (where __NEXT__ means the following program): i = "Hello" __NEXT__ Consider the obfuscation of replacing the following: for (i in {"Hello":0}) {__NEXT__}
[0028] In this case, although the execution result does not change, obfuscation not only changes the description in the source code, but also adds a scope by a for loop at runtime, resulting in the use of a new stack in the stack memory.
[0029] Normally, a sufficient number of stacks are prepared for such stack memory at runtime, but if a program that requires a large number of stacks is generated by automated source code conversion such as obfuscation, a stack overflow may occur depending on the execution environment. This problem is particularly noticeable in devices that do not have a margin in terms of performance, such as IoT devices. On the other hand, IoT devices may possess functions similar to those of high-performance personal computers in order to promote the added value of being connected to the Internet, and as a result, security measures may be required.
[0030] The above-mentioned obfuscation can be achieved, for example, by i = "Hel" + "lo" Conversions such as i = "Hello World".substring(0, 5) A conversion method such as the following is also possible. As described above, there are various obfuscation conversion rules, and differences exist in the number of stacks in the stack memory, memory usage, whether or not a system call is used, whether or not an overflow is used, and the like.
[0031] The obfuscation processor 112 generates an obfuscated program at a level of obfuscation suitable for the terminal 20 by changing the number of stacks in the stack memory used in the obfuscated program in accordance with the obfuscation flag for each terminal 20.
[0032] Specifically, the obfuscation processor 112 first obtains the maximum stack number of the stack memory according to the obfuscation flag from the flag information storage unit 121. Furthermore, the conversion rule storage unit 122 holds an increased stack number in the stack memory for each source code conversion rule for obfuscation, and the obfuscation processor 112 counts the number of stacks increased when converting source code. The obfuscation processor 112 prevents the stack number from exceeding the maximum stack number by not performing conversion that would increase the stack number if the maximum stack number is exceeded. Alternatively, the obfuscation processor 112 may not perform some of the conversions related to obfuscation so as not to exceed the maximum stack number.
[0033] The program transmission unit 113 transmits the authentication program obfuscated by the obfuscation processing unit 112 to the terminal 20 of the communication partner.
[0034] The verification unit 114 receives the execution result of the authentication program from the terminal 20, and verifies the validity of this execution result, that is, that it is an expected value.
[0035] As described above, according to this embodiment, the server 10 obtains in advance an obfuscation flag corresponding to the program execution environment of each terminal 20, and when obfuscating the authentication program and providing it to the terminal 20, the server 10 can perform appropriate obfuscation so that the number of stacks in the stack memory used by the program does not exceed the maximum number of stacks that can be executed normally.
[0036] Conventional obfuscation is usually applied to a program in advance, and the obfuscated program is tested in advance to see if it works correctly on various devices. This is because such obfuscated programs do not necessarily behave exactly the same as the unobfuscated programs. However, when performing dynamic obfuscation, it is necessary to prevent such differences in behavior, and so far, only obfuscation methods with small differences in behavior have been applied. On the other hand, source code conversion that increases the number of stacks used in stack memory means changing the structure of the program itself, and therefore has the potential to dramatically improve the strength of obfuscation. In order to use such conversion with high obfuscation strength, conversion according to the characteristics of the execution environment is necessary, and this embodiment can provide a dynamic obfuscation mechanism that increases the number of stacks up to the maximum stack number.
[0037] Furthermore, the server 10 can control the memory usage in addition to the number of stacks used in the stack memory. Obfuscation conversion methods include source code conversion rules that use a large amount of memory. Therefore, the server 10 holds memory usage for conversion rules that use a large amount of memory, and counts the memory usage when converting source code. If the memory usage exceeds the maximum memory usage according to the obfuscation flag, the server 10 does not perform conversion that requires such memory usage, thereby avoiding memory shortages in the terminal 20.
[0038] Furthermore, the server 10 may determine from the obfuscation flag whether a special system call or variable overflow can be used, and perform conversion using such operations only in the case of a terminal 20 where such operations are available. This makes it possible to further increase the strength of obfuscation depending on the environment of the terminal 20.
[0039] According to this embodiment, for example, the obfuscation strength of the authentication program can be appropriately set for each device, making it possible to build a site that is less susceptible to phishing, which makes it possible to contribute to Goal 9 of the Sustainable Development Goals (SDGs) led by the United Nations, which is to "build resilient infrastructure, promote sustainable industrialization and foster innovation."
[0040] Although the embodiments of the present invention have been described above, the present invention is not limited to the above-described embodiments. Furthermore, the effects described in the above-described embodiments are merely a list of the most preferable effects resulting from the present invention, and the effects of the present invention are not limited to those described in the embodiments.
[0041] The authentication method by the server 10 (authentication device) is realized by software. When it is realized by software, a program constituting this software is installed in an information processing device (computer). These programs may be recorded on a removable medium such as a CD-ROM and distributed to users, or may be distributed by being downloaded to the user's computer via a network. Furthermore, these programs may be provided to the user's computer as a Web service via a network without being downloaded. [Explanation of symbols]
[0042] 1 Authentication System 10 Server (authentication device) 11 Control section 12 Storage section 20 Terminals 111 Flag receiver 112 Obfuscation Processing Unit 113 Program Transmission Unit 114 Verification Department 121 Flag information storage unit 122 Conversion rule memory
Claims
1. a flag information storage unit that stores a maximum number of stacks of a stack memory that can be used by a normally executable program for each obfuscation flag that indicates a type of the terminal; a conversion rule storage unit that stores a conversion rule for obfuscating a program code and a number of stacks to be increased in the stack memory in association with each other; A flag receiving unit that receives the obfuscation flag from a communication partner terminal; an obfuscation processing unit that counts an increasing number of stacks in the stack memory while obfuscating the authentication program in accordance with the conversion rule, and controls the number of stacks not to exceed the maximum stack number corresponding to the received obfuscation flag; a program transmission unit that transmits the authentication program obfuscated by the obfuscation processing unit to the communication partner terminal; an authentication device comprising: a verification unit that receives an execution result of the authentication program and verifies the validity of the execution result.
2. the flag information storage unit stores a maximum memory usage for each of the obfuscation flags; the conversion rule storage unit stores the conversion rule in association with an increased memory usage amount; The authentication device according to claim 1 , wherein the obfuscation processing unit counts the increasing memory usage while obfuscating the authentication program in accordance with the conversion rule, and controls the memory usage so as not to exceed the maximum memory usage corresponding to the received obfuscation flag.
3. the flag information storage unit stores, for each of the obfuscation flags, whether a system call can be used; The authentication device according to claim 1 , wherein the obfuscation processor selects the conversion rule based on whether the system call is available.
4. the flag information storage unit stores, for each of the obfuscation flags, whether or not a variable overflow can be used; The authentication device according to claim 1 , wherein the obfuscation processor selects the conversion rule based on whether or not the overflow can be used.
5. a flag information storage step of storing a maximum stack number of a stack memory used by a normally executable program for each obfuscation flag indicating a type of the terminal; a conversion rule storage step of storing a conversion rule for obfuscation of a program code in association with a number of stacks to be increased in the stack memory; a flag receiving step of receiving the obfuscation flag from a communication partner terminal; an obfuscation processing step of counting an increasing number of stacks in the stack memory while obfuscating the authentication program in accordance with the conversion rule, and controlling the number of stacks not to exceed the maximum number of stacks corresponding to the received obfuscation flag; a program transmission step of transmitting the authentication program obfuscated in the obfuscation processing step to the terminal of the communication partner; a verification step of receiving an execution result of the authentication program and verifying the validity of the execution result, the authentication method being executed by a computer.
6. An authentication program for causing a computer to function as the authentication device according to any one of claims 1 to 4.
Citation Information
Patent Citations
Program obfuscation apparatus and obfuscation program
JP2010072958A
Gateway apparatus
JP2010220038A
Program obfuscation device and program
JP2011018119A
Device, method and program for data distribution
JP2012114528A
Authentication method, authentication program and authentication device
JP2014178906A