WO2006115217A1 - プログラム変換装置及び秘密保持プログラム - Google Patents

プログラム変換装置及び秘密保持プログラム Download PDF

Info

Publication number
WO2006115217A1
WO2006115217A1 PCT/JP2006/308454 JP2006308454W WO2006115217A1 WO 2006115217 A1 WO2006115217 A1 WO 2006115217A1 JP 2006308454 W JP2006308454 W JP 2006308454W WO 2006115217 A1 WO2006115217 A1 WO 2006115217A1
Authority
WO
WIPO (PCT)
Prior art keywords
selection
program
instruction group
target data
processing
Prior art date
Application number
PCT/JP2006/308454
Other languages
English (en)
French (fr)
Inventor
Taichi Sato
Motoji Ohmori
Rieko Asai
Yuichi Futa
Tomoyuki Haga
Masahiro Mambo
Original Assignee
Matsushita Electric Industrial Co., Ltd.
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 Matsushita Electric Industrial Co., Ltd. filed Critical Matsushita Electric Industrial Co., Ltd.
Priority to US11/918,785 priority Critical patent/US20090217008A1/en
Priority to JP2007514686A priority patent/JP4235243B2/ja
Publication of WO2006115217A1 publication Critical patent/WO2006115217A1/ja

Links

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/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/52Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
    • G06F21/54Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow by adding security routines or objects to programs
    • 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
    • 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

Definitions

  • the present invention relates to a technology for converting a program that holds and executes secret information into a program that makes it difficult to analyze secret information illegally.
  • it is a program for detecting a watermark of copy control information embedded in an image. If the processing of the watermark detection program is analyzed by an unauthorized analyst, a tool may be created to remove the watermark embedded in the image. Therefore, it is desirable that such programs are difficult for fraud analysts to analyze.
  • the program is plaintext in memory at execution time, there is a threat that the program in memory is extracted and analyzed. For such threats, if it is difficult to analyze in what order the program instructions included in the extracted program are executed, it will be difficult to create a tool to remove the watermark.
  • a control structure of a program as a method for preventing illegal analysis Z tampering of a program that performs processing using a secret element is controlled by converting Z processing etc. to a format different from the original program.
  • a method of program obfuscation can be considered that complicates the structure and makes the program difficult to analyze (see, for example, Non-Patent Document 1).
  • Non-Patent Document 2 a branch instruction (for example, switch statement) that determines a branch destination based on a value indicating an instruction group to be executed and an array are used.
  • a method of controlling the execution order of each instruction group Non-Patent Document 2.
  • a plurality of instruction groups for example, instruction groups 1 to 3 and executed in this order
  • a program that calculates the value indicating the instruction group to be executed next by an arithmetic expression using an array and stores the calculated value in the variable Var used in the switch statement.
  • Non-Patent Document 1 Tatsumi Shida, Matsumoto, Inoue, Tamper Resistant Software Construction Method ", ISEC 97- 59
  • the program instruction inserted at the end of each instruction group and each data stored in the array may be acquired, for example, the storage area of the computer device may be obtained. . Therefore, if the unauthorized analyst knows the program instruction inserted at the end of each instruction group and each data stored in the array, the unauthorized analyst determines the value of the variable used in the switch statement. Can be acquired, the control structure of the original program can be reconstructed, and analysis of the original program can be easily performed.
  • the present invention can not make it easy for unauthorized analysts to analyze the original program! /,
  • the present invention is a program conversion apparatus that generates a secrecy program also for an original program power, and processing in a predetermined order and program acquisition means for acquiring an original program. Means to output the same execution result as the original program and generate multiple selection target data to which different selection identifiers are associated, and a pre-processing instruction to substitute a value into each of the multiple selection parameters.
  • a selection processing instruction group including an instruction group for acquiring a selection identifier indicating selection target data to be processed next based on preprocessing instruction group generation means for generating a group and an arithmetic expression using the plurality of selection parameters.
  • Selection processing instruction group generation means for generating, selection information indicating selection target data processed in the past according to values of selection parameters
  • Update processing instruction group generating means for generating an update processing instruction group that reflects the value of at least one selection parameter among the values of one or more selection parameters previously substituted into the child or the selection parameter;
  • a process including an instruction group, the process selection instruction group, the update process instruction group, and the plurality of selection target data, a process of executing the process selection instruction group, and a selection identifier acquired by the selection process instruction group
  • a secrecy program generation unit configured to generate a secrecy program for repeating processing of processing selection target data and processing of executing the update processing instruction group when the selection target data is processed.
  • the secrecy maintainer generated by the program conversion device
  • the selection parameter indicates a selection identifier indicating selection target data processed in the past, or one or more of the arithmetic expression having been substituted in the past. It reflects the value of at least one of the selected parameter values.
  • an array in which a plurality of fixed values are stored is used.
  • the secret holding program generated by the program conversion device of the present invention After determining the block to be executed, it always updates the selection parameter used in the equation, so that the values stored in the multiple selection parameters will be identified. Therefore, unauthorized analysts can not easily analyze the original program.
  • the predetermined order is a selection identifier sequentially calculated by repeatedly executing the selection processing instruction group and the update processing instruction group by giving a predetermined initial value to the plurality of selection parameters. Even if it is the order of
  • the program conversion apparatus can generate a confidential program that outputs the same execution result as the original program when a predetermined initial value is given to each selection parameter.
  • each of the plurality of selection target data may be one or more data.
  • the program conversion apparatus can generate a secret holding program that handles selection target data as data.
  • the original program has secret information to be concealed
  • the selection processing instruction group generation unit comprises an instruction group for calculating the selection identifier according to a first arithmetic expression using the plurality of selection parameters.
  • a selection processing instruction group is generated, and the update processing instruction group generation means generates an update processing instruction group for updating the plurality of selection parameters based on the value of the selection target data indicated by the calculated selection identifier.
  • the program conversion device further generates a transition processing instruction group for generating a transition processing instruction group for calculating the same value as the secret information according to a second arithmetic expression using a plurality of updated selection parameters.
  • a group generation unit for arranging the generated transition processing instruction group between the arrangement position of the update processing instruction group and the arrangement position of the secret information. And the process of calculating the secret information by the transition processing instruction group may be performed.
  • the secrecy program generated by the program conversion device calculates the same value as the secrecy information, the selection processing instruction group, the update processing instruction group, and the transition. Because of concealment by processing instructions, it is difficult for fraudulent analysts to analyze confidential information.
  • the program conversion apparatus may further include dividing means for dividing the original program into one or more blocks, and each of the plurality of selection target data may include different blocks.
  • the program conversion apparatus can generate a secrecy holding program that treats selection target data as a block into which the original program power is also divided.
  • the plurality of selection parameters are the first to n-th selection parameters
  • the update processing instruction group generation unit generates a number j 1 (j is 2) for each of the plurality of selection target data. It is possible to store the value stored in the selection parameter of the above n) or less integer in the j-th selection parameter, and generate the update processing instruction group storing the constant value in the first selection parameter.
  • the security program generated by the program conversion device is configured to reflect the value of at least one selection parameter among the values of one or more selection parameters previously substituted into the arithmetic expression.
  • the values of the plurality of selection parameters can be updated.
  • the number of the selection target data is a predetermined number which is equal to or greater than the number of the blocks
  • the arithmetic expression is the Pi X i-th selection for each of the first to n-th selection parameters.
  • a parameter (i is an integer of 1 or more and n or less) is calculated, each of the calculated results is added, and the addition result is subjected to modulo operation with the predetermined number as the modulo value N to calculate a selection identifier.
  • Pi and modulo N may be disjoint.
  • the program conversion apparatus can reliably determine the selection target data using the arithmetic expression.
  • the selection target data generation unit selects one value for one block, and a storage unit that stores each of the selection identifiers calculated by the arithmetic expression up to the present time,
  • the value stored in the selection parameter of j 1 (j is an integer of 2 or more and n or less) is stored in the jth selection parameter, and the selected value is stored in the first selection parameter,
  • An execution unit for executing the equation, a determination unit for determining whether or not a selection identifier having the same selection identifier as the calculated value calculated is stored in the storage unit, and a negative determination result.
  • the storage unit stores the selected one value as the constant value for the one block and stores the one block in the selection target data indicated by the calculated value, and the determination result is positive. If it is determined, the repetition control unit controls to repeat the processing by the execution unit and the determination unit until the constant value is determined and one block is stored in the selection target data. , And the processing by the selection target data generation means is all Cho, as is performed on the block.
  • the program conversion apparatus uses the arithmetic expression of the update processing instruction group to determine the selection target data for storing the next block.
  • the plurality of selection parameters can be updated so as to be target data.
  • the generated security program can reliably determine the block to be executed next by an arithmetic expression using a plurality of selection parameters, and can therefore provide the same function as the original program. .
  • the selection processing instruction group generation unit may generate a selection processing instruction group that always acquires an identifier indicating selection target data that has not been executed.
  • the security protected program generated by the program conversion device can always acquire selection target data including blocks that have not been executed.
  • the secret holding program since the secret holding program always uses different selection target data as the selection target data to be executed next according to the selection processing instruction group, it is difficult for the unauthorized analyst to specify the correct execution order.
  • the selection processing instruction group generation unit determines whether or not an identifier indicating selection target data that has not been executed has been executed for each of the plurality of selection target data. It may be possible to generate selection processing instructions to be acquired using the indicated management information.
  • the secrecy holding program generated by the program conversion device can always obtain selection target data including a block that has not been executed using the management information. it can.
  • the plurality of selection parameters are first to n-th selection parameters, and the management information is currently executed or not yet executed for each of the plurality of selection target data.
  • the number of selection target data is a predetermined number that is equal to or greater than the number of blocks, and the selection processing instruction group generation unit includes the array table,
  • the Pi X i-th selection parameter (i is an integer of 1 or more and n or less) is calculated for each of the first to n-th selection parameters, each calculation result is added, and the addition result is The arithmetic equation for performing a modulo operation with the predetermined number as a modulo value N and calculating a temporary selection identifier indicating data to be selected including a block to be executed next, and the calculation calculated using the equation Temporary selection identifier
  • the temporary selection identifier is used as a true selection identifier indicating the selection target data including the block to be executed next.
  • an acquisition program instruction group for acquiring a temporary selection identifier is generated based on a predetermined selection order until acquisition of selection target data that has not been executed, and the selection process is performed.
  • the instruction group may include the array table, the arithmetic expression, and the acquisition program instruction group, and Pi and the modulo value N may be relatively prime.
  • the secrecy holding program generated by the program conversion device can reliably acquire selection target data including a block that has not been executed using the array table.
  • the update processing instruction group generation unit stores the value stored in the j-th (j is an integer of 2 or more and n or less) selection parameter in the j-th selection parameter, and the selection processing
  • the update processing instruction group may be generated to store the true selection identifier acquired in the instruction group into the nth variable.
  • the security program generated by the program conversion device always selects the selection parameter value indicating the selection target data processed in the past. Since the value of at least one selection parameter is reflected among the identifier or the value of one or more selection parameters substituted in the past in the arithmetic expression, a plurality of the plurality of selection parameters are reflected. The value stored in the selection parameter is specified.
  • the arithmetic expression is a group of first acquired program instructions for acquiring the one parameter, using the index indicating one selection parameter
  • the management information is It is an array table which shows the state of either the execution completed or the non-execution at the present time with respect to each of the plurality of selection object data
  • the selection processing instruction group generation means includes the first acquired program instruction group Based on the arrangement table and the arrangement order of selection identifiers indicating one or more selection target data not yet executed among the arrangement table, the value of the parameter acquired by the acquisition program instruction group is used.
  • Generating a second acquisition program instruction group for acquiring the selection identifiers arranged in the order shown; and the selection processing instruction group including the first acquisition program instruction group And may include the array table and the second acquisition program instruction group.
  • the security protection program generated by the program conversion device can acquire the selection identifier indicating the selection target data to be executed next using the index.
  • the update processing instruction group generation unit may generate the update processing instruction group which increments the value of the index.
  • the security protected program generated by the program conversion device updates the index. Even if the fraud analyst knows one block, the index value does not divide, so the block to be executed next will not be identified. Therefore, unauthorized analysts can not easily analyze the original program.
  • the number of selection target data is a predetermined number that is equal to or greater than the number of blocks
  • the plurality of selection parameters are first to nth parameters
  • the management information is the plurality of the plurality of selection parameters.
  • It is an array table showing either an executed or unexecuted state at the present time for each of the selection target data
  • the selection processing instruction group generating means comprises: the array table;
  • the PiX i-th selection parameter (i is an integer of 1 or more and n or less) is calculated for each of n selection parameters, each calculation result is added, and the predetermined number is added to the addition result.
  • the security protected program generated by the program conversion device can reliably acquire selection target data including a block that has not been executed.
  • the secrecy program since the secrecy program always uses different selection target data as the selection target data to be executed next by the selection processing instruction group, it is difficult for an unauthorized analyst to specify the correct execution order.
  • the number of selection target data is a predetermined number that is equal to or greater than the number of blocks
  • the secrecy holding program generation means further includes each of the plurality of blocks included in the selection target data. Thereafter, a camouflage block including one or more program instructions may be inserted into one or more selection target data not including the block.
  • the secrecy program generated by the program conversion device includes the spoofed block, it is possible to make analysis by the unauthorized analyst difficult.
  • the present invention is a secret processing apparatus that executes secret processing to be concealed by processing a plurality of selection target data whose processing order is fixed, and is a pre-processing that substitutes a value into each of the plurality of selection parameters. Based on the execution means, an arithmetic expression using the plurality of selection parameters, a selection processing execution means for acquiring a selection identifier indicating selection target data to be processed next, a value of the selection parameter, and the like.
  • Update processing execution means for reflecting the value of at least one of a selection identifier indicating processed selection target data, or one or more selection parameter values substituted in the past in the selection parameter;
  • selection target data execution means for processing the selection target data indicated by the selection identifier acquired by the selection processing execution means, and is regarded as the end of the security program. The processing according to the selection processing execution means, the update processing instruction execution means, and the selection target data execution means is repeated until then.
  • the secret processing device updates the plurality of selection parameters of the arithmetic expression.
  • at least one selection parameter among the values of one or more selection parameters substituted in the past for the selection identifier indicating selection target data processed in the past, or the value of one or more The value of is reflected.
  • the secret processing device of the present invention determines data to be selected next to be executed. After that, always update the selection parameter used in the equation, so that the values stored in multiple selection parameters will be identified. Therefore, the fraudulent analyst can not easily analyze the secret process.
  • each of the plurality of selection target data may be one or more data.
  • the secret processing apparatus can treat the selection target data as data.
  • the secret process is a process of calculating the secret information by performing a predetermined process instead of using the secret information to be concealed, and the selection process execution means performs an operation using the plurality of selection parameters.
  • the selection identifier is calculated by a formula, and the update processing execution means updates the plurality of selection parameters based on the value of the selection target data indicated by the selection identifier, and the secret processing device further updates the selection processing parameter.
  • a transition processing execution unit may be provided which calculates the same value as the secret information by the predetermined processing using a plurality of selection parameters.
  • the secret processing apparatus conceals the method of calculating the same value as the secret information, it becomes difficult for the unauthorized analyst to analyze the secret information.
  • the secret process is a process of executing an original program divided into one or more blocks by an external device, and the blocks include one or more program instructions.
  • Each of the plurality of selection target data may include different blocks.
  • the security processing device can treat the selection target data as a block divided from the original program.
  • the plurality of selection parameters are the first to n-th selection parameters
  • the update process execution unit is configured to select one of j1 (j is 2 or more and n or less) for each of the plurality of selection target data.
  • Value stored in the selection parameter of integer of Storing the constant value in the first selection parameter, the constant value being
  • the external device may have a value preset when the security program is generated so that a selection identifier indicating selection target data to be executed next is calculated.
  • the secret processing device reflects the value of at least one selection parameter among the values of the one or more selection parameters substituted in the past in the arithmetic expression to set the plurality of selection parameters. You can update the value.
  • the number of the selection target data is a predetermined number which is equal to or greater than the number of the blocks
  • the arithmetic expression is the Pi X i-th selection for each of the first to n-th selection parameters.
  • a parameter (i is an integer of 1 or more and n or less) is calculated, each of the calculated results is added, and the addition result is subjected to modulo operation with the predetermined number as the modulo value N to calculate a selection identifier.
  • Pi and modulo N may be disjoint.
  • the security processing device can reliably determine the selection target data by the arithmetic expression.
  • the selection process execution means may always obtain an identifier indicating the unexecuted selection target data.
  • the secret processing apparatus can always obtain selection target data including unexecuted blocks.
  • the secret processing performed by the secret processing apparatus since the secret processing performed by the secret processing apparatus always uses different selection target data as the selection target data to be executed next, it is difficult for an unauthorized analyst to specify the correct execution order. .
  • the selection process execution means includes an identifier indicating an unexecuted selection object data, management information indicating whether each of the plurality of selection object data items has been executed or not. Even if you use to get it ,.
  • the secret processing apparatus can always obtain selection target data including a block that has not been executed using the management information.
  • the plurality of selection parameters are the first to n-th selection parameters
  • the number of selection target data is a predetermined number that is equal to or greater than the number of blocks
  • the management information Is an array table showing a state of execution or non-execution at this time or deviation for each of the plurality of selection target data, and the selection processing execution
  • the means holds the array table
  • the arithmetic expression includes, for each of the first to n-th selection parameters, a Pi X i-th selection parameter (i is an integer of 1 or more and n or less).
  • Each of the calculated and calculated results is added, and the addition result is subjected to modulo operation with the predetermined number as the modulo value N, and a temporary selection identifier indicating selection target data including a block to be executed next It is an arithmetic expression to be calculated, and the selection processing execution means indicates that the selection object data indicated by the temporary selection identifier calculated by the calculation expression is not yet executed in the array table.
  • the temporary selection identifier is set as a true selection identifier indicating selection target data including the block to be executed next, and when it is indicated that execution has been completed, the selection target data not yet executed is acquired.
  • Selection order predetermined up to Yo also as being relatively prime to acquire selection identifier of the base Dzu-out temporary row ,, Pi and modulo value N.
  • the secret processing apparatus can reliably obtain selection target data including a block that has not been executed, using the array table.
  • the update process execution means stores the value stored in the j-th (j is an integer of 2 or more and n or less) selection parameter in the j-th selection parameter, and the selection process execution means
  • the acquired true selection identifier may be stored in the nth variable.
  • the secret processing device when updating the selection parameter, the secret processing device always uses the value of the selection parameter, the selection identifier indicating the selection target data processed in the past, or the arithmetic expression in the past. Since the value of at least one selection parameter among the values of the one or more selection parameters substituted is reflected, the values stored in the plurality of selection parameters become difficult to specify.
  • the management information is an array table indicating a state of deviation of the executed or unexecuted state at a current point for each of the plurality of selection target data
  • the selection processing execution means is the array table
  • a first acquisition unit that executes the arithmetic expression for acquiring the selection parameters of the plurality of selection parameters using an index indicating one selection parameter, and one of the array tables being unexecuted.
  • the selection identifiers arranged in the order indicated by the value of the selection parameter acquired by the first acquisition unit are taken. Even if it includes the second acquisition part to acquire.
  • the secret processing device can obtain the selection identifier indicating the selection target data to be executed next using the index.
  • the update process execution unit increments the value of the index.
  • the secret processing device updates the index. Even if the unauthorized analyst knows one block, it does not know the value of the index, so the block to be executed next will not be identified. Therefore, unauthorized analysts can not easily analyze the original program.
  • the number of selection target data is a predetermined number that is equal to or greater than the number of blocks
  • the plurality of selection parameters are first to nth parameters
  • the management information is It is an arrangement table which shows a state of deviation which has been executed or not performed at present for each of the plurality of selection object data
  • the selection processing execution means holds the arrangement table, and the calculation
  • the PiX i-th selection parameter (i is an integer of 1 or more and n or less) is calculated for each of the first to n-th selection parameters, each calculation result is added, and the addition is performed.
  • the selection processing execution means Is the sequence The order indicated by the value calculated by the arithmetic expression based on the arrangement order of the selection identifiers indicating one or more selection target data not yet executed in the same table as the table. You may even get the selection identifier placed in.
  • the secret processing apparatus can reliably acquire selection target data including a block that has not been executed.
  • the secret processing performed by the secret processing apparatus since the secret processing performed by the secret processing apparatus always uses different selection target data as the selection target data to be executed next, it is difficult for an unauthorized analyst to specify the correct execution order. .
  • the secret process is a process of executing a secrecy holding program generated from the original program by the external device, and the number of selection target data is a predetermined number which is equal to or more than the number of blocks.
  • one or more selection target data not including a block includes a camouflage block including one or more program instructions
  • the holding program may include each block divided from the original program and one or more fake blocks.
  • the security program to be executed by the security processing device can make analysis by a fraudulent analyst difficult because it includes a camouflage process.
  • FIG. 1 is a block diagram showing the configuration of a security holding system 1.
  • FIG. 2 is a diagram showing the structure of a security program 100.
  • FIG. 3 A diagram showing a specific program of the secrecy holding program 100.
  • FIG. 4 is a flow chart showing an operation of processing when the security program 100 is executed in a normal system.
  • FIG. 5 is a block diagram showing the configuration of a program obfuscation device 10.
  • FIG. 6 is a block diagram showing the configuration of a secrecy program generation unit 203.
  • FIG. 7 A flowchart showing an operation outline of the program obfuscation device 10.
  • FIG. 8 is a flowchart showing an operation of generation processing of selection target data. Continue to Figure 9.
  • FIG. 9 is a flowchart showing an operation of generation processing of selection target data. Continue from Figure 8.
  • FIG. 10 is a block diagram showing a configuration of a security holding system 2.
  • FIG. 11 is a diagram showing the structure of a secrecy holding program 300.
  • FIG. 12 A flow diagram showing an operation of processing when the security program 300 is executed in a normal system.
  • FIG. 13 is a block diagram showing the configuration of a program obfuscation device 30.
  • FIG. 14 A flow chart showing an outline of operation of the program obfuscation device 30.
  • FIG. 15 is a block diagram showing the configuration of a security system 3.
  • FIG. 16 A diagram showing the structure of a secrecy holding program 500.
  • FIG. 17 is a diagram showing a control flow of a program to be obfuscated.
  • FIG. 18 A diagram schematically describing each block of the secrecy program 500.
  • FIG. 19 A diagram showing a specific program of the secrecy holding program 500.
  • FIG. 20 A diagram showing a concrete example in which each block of the security program 500 is described in C language.
  • FIG. 21 is a block diagram showing a configuration of a secret processing device 60.
  • FIG. 22 is a view showing an example of the data structure of a management information table T700.
  • FIG. 23 is a block diagram showing a configuration of a control unit 700.
  • FIG. 24 is a flow chart showing the operation of the secret processing device 60.
  • FIG. 25 is a block diagram showing a configuration of a program obfuscation device 50.
  • FIG. 26 is a block diagram showing the configuration of an arrangement order determination unit 804.
  • FIG. 28 is a flowchart showing an operation of a placement determination process.
  • FIG. 30 is a diagram illustrating an execution order of the function providing instruction groups 1 to 3.
  • FIG. 30 is a diagram illustrating an execution order of the function providing instruction groups 1 to 3.
  • FIG. 31 is a block diagram showing the configuration of a selection processing unit 722b.
  • 32 is a flowchart showing an operation of selection identifier acquisition processing.
  • FIG. 33 is a diagram showing a control flow of an obfuscated target program.
  • FIG. 34 is a block diagram showing the configuration of a program obfuscation device 50c.
  • FIG. 35 A diagram showing a control flow obtained by replacing the control flow shown in FIG. 33 with the generated three function providing instructions.
  • FIG. 36 A diagram showing a control flow of a program in which each function provision instruction group is expanded.
  • FIG. 37 is a block diagram showing a configuration of an arrangement order determination unit 804c.
  • FIG. 38 A diagram showing the structure of a secrecy holding program 1800.
  • FIG. 39 is a flowchart showing an operation of a placement order determination unit 804d.
  • FIG. 40 This is a figure showing a concrete example in which each block of the security program 500e is described in C language.
  • FIG. 41 is a view showing the structure of a secrecy holding program 2000.
  • FIG. 42 is a flowchart showing a specific example of the operation of the security program 2000.
  • FIG. 43 is a block diagram showing the configuration of a program obfuscation device 1010.
  • FIG. 44 is a flowchart showing an operation of a placement determination process.
  • FIG. 45 shows the structure of a security program 2200.
  • FIG. 46 is a flow chart showing a specific example of the operation of the security program 2200.
  • FIG. 47 is a block diagram showing a configuration of a program obfuscation device 3010.
  • FIG. 48 is a flowchart showing an operation of a placement determination process.
  • the security system 1 comprises a program obfuscation device 10 and a program execution device 20.
  • the program obfuscation device 10 generates the secrecy holding program 100 from the obfuscation target program whose secrecy is to be executed, and distributes the generated secrecy holding program 100 to the program execution device 20.
  • the program execution device 20 executes the security program 100 distributed from the program obfuscation device 10.
  • the program to be obfuscated is composed of three instruction groups of instruction group A, instruction group B, and instruction group C, and the operation is correctly performed by executing the instruction groups A, B and C in this order. It shall be.
  • Confidentiality program 100 is a program that performs processing using a secret element and is analyzed by an unauthorized analyst as to what execution order the program instructions contained in the program are to be executed. I do not want to be a program. For example, it is a program in which a program instruction handling secret information is replaced with another program instruction group by a method described in Non-Patent Document 1 for watermark detection program or the like and distributed and arranged. As for the latter, the unauthorized analyst collects the replaced program instructions, and if executed in the correct order, the value of the secret information can be calculated.
  • the security program 100 is a program which is roughly difficult to analyze in what execution order a plurality of selection target data 140 to 146 included in the program are executed.
  • the selection target data 140 to 146 also include selection target data which is not executed at the time of execution of a normal system. Selection target data that is not executed is incorporated in order to increase the number of possible execution order combinations that the fraud analyst who does not know the correct execution order can consider.
  • normal system execution refers to processing without special operations such as forced change of program capability and selection parameters using a debugger or the like.
  • the security program 100 comprises a pre-processing instruction group 110, a selection processing instruction group 120, a transition processing instruction group 130, and selection target data 140, 141, ⁇ 146 They are arranged in the order shown in 2.
  • the security program 100 receives, from the calling program, the 32-bit input values inl, in2, in3 and parameters to be used in processing the functions provided by this program.
  • the security program 100 is configured to hold each value (here, three values) of a plurality of selection parameters used for processing in the selection processing instruction group 120.
  • the first, second and third 32-bit selections Processing is performed using a parameter variable and a 32-bit selection identifier variable that holds the selection identifier.
  • the selection parameter is a parameter used when determining the selection target of selection target data 140, 141, ⁇ ⁇ ⁇ 146, and the selection identifier is an identifier uniquely identifying the selection target data. It is.
  • the security program 100 provided in the present embodiment is a program that can execute the selection target data (including the selection target main instruction group) in the correct order by using the value that also receives the program power of the calling source. Original program power It is a difficult program for fraudulent analysts to know the execution order of the selection target data (including the selection target main instruction group) without being able to know the received values.
  • the preprocessing instruction group 110 is a program instruction group that calculates an initial value of a selection parameter group to be used by the selection processing instruction group 120.
  • the selection parameter group is also a variable force for the first, second and third selection parameters.
  • the preprocessing instruction group 110 is a program instruction group to be executed first when the security program 100 is activated.
  • the preprocessing instruction group 110 receives the 32-bit input values inl, in2, in3 from the calling program, and stores the received values in the selection parameter variable as the initial values of the selection parameter group. It consists of a pre-processing program instruction group and a second pre-processing program instruction group branching to the selection processing instruction group 120, which are sequentially performed.
  • the first preprocessing program instruction group stores the values inl, in2, and in3 in the first to third selection parameter variables, respectively.
  • the first preprocessing program instruction group receives values “1”, “2”, and “3” as input values inl, in2, and in3, respectively, and selects the first to third selection parameters. Perform processing to store the values “1”, “2”, and “3” in the variable respectively.
  • the second pre-processing program instruction group is, for example, a program described in C language, in the case where the label "label 120:” is inserted at the beginning of the selection processing instruction group 120, It is a program instruction represented by a program instruction "goto label-120;”.
  • the pre-processing instruction group 110 is also configured to have only the first pre-processing program instruction group.
  • the selection processing instruction group 120 is a program instruction group that selects one of the selection target data 140 to 146 as a selection identifier based on the selection parameter group.
  • the selection processing instruction group 120 includes a first selection processing program instruction group that calculates a selection identifier using a selection parameter group, and a second selection processing program instruction group that branches to the transition processing instruction group 130. Do in order.
  • the selection identifier is a value used in the transition processing instruction group described later.
  • the first selection processing program instruction group calculates pi X (first selection parameter variable) + p2 X (second selection parameter variable) + p3 X (third selection parameter variable) mod NN , A set of program instructions for storing the calculated value in the selection identifier variable.
  • NN is the number of data to be selected.
  • pl, p2 and p3 are prime numbers that are mutually prime to the NN, and are different numbers when modulating the NN.
  • NN may be a prime number
  • pl, p2 and p3 may be mutually different prime numbers less than NN.
  • the operator “X” represents multiplication.
  • pl, p2, p2, and NN be values “2”, “3”, “5”, and “7”, respectively, and equation 1 “2 ⁇ (variable for first selection parameter) + 3 ⁇ (first It is assumed that the group of program instructions calculate 2 selection parameter variables) + 5 X (third selection parameter variable) MOD 7 ′ ′.
  • the program instruction group branching to transition processing instruction group 130 is the same as the second pre-processing program instruction group described in pre-processing instruction group 110, and the branch destination is transition processing instruction group 130. It is a thing.
  • the transition processing instruction group 130 is a program instruction group that performs processing of branching to any of the selection target data 140 to 146 based on the selection identifier calculated by the selection processing instruction group 120. Ru.
  • the program in which the security program 100 is written is a C language program
  • the data to be selected 140, 141, ⁇ ⁇ ⁇ 146 are respectively labeled at the beginning of the labels "label-140:” and "label-141:” ⁇ ⁇ ⁇
  • the transition processing instruction group 130 will be the following program instructions.
  • the selection target data 140 to 146 are program instructions which are executed when branching by the transition processing instruction group 130.
  • the selection target data 140 to 146 are respectively composed of selection target main instructions 150 to 156, update processing instructions 160 to 166, and branch instructions 170 to 176, which are arranged in the order shown in FIG. There is.
  • Each instruction group is a program instruction group which also has one or more program instructions.
  • the selection target data 141 to 146 are the same as the contents of the selection target data 140, and thus the description thereof is omitted.
  • the main instruction group to be selected 150 is a program instruction group that performs part of processing of a function provided by this program (for example, a function of water mark detection) or These instructions are not related to the target function and are not executed when executing on a normal system (hereinafter referred to as normal system execution).
  • processing of functions provided by this security protected program is performed by being executed in the order of the selection target main instruction groups 152, 154, 156. That is, the selected main instruction groups 152, 154, and 156 are program instructions including a part of the processing of the function provided by the obfuscated program, and each of the selected main instruction groups 152, 154, and 156 is selected. Are, in order, identical to the instruction groups A, B and C.
  • the main instruction group to be selected 150, 151, 153, 155 is a program instruction group including processing unrelated to the function to be provided.
  • the instruction groups of the selection target main instruction groups 152, 154, and 156 which are a part of the functions provided by the security program, are referred to as function providing instruction groups 1 to 3, respectively.
  • instructions that are not executed during execution of a normal system included in the selection target main instruction group 150, 155, 153, and 155 are called a camouflage function providing instruction group.
  • the update processing instruction group 160 is a program instruction group that updates the value of the selected parameter group.
  • the update processing instruction group 160 has a constant value used to update the value of the selected parameter group in advance.
  • the selection processing instruction group 120 selects a valid selection target as the next process using the received selection parameter group and the constant value. Create a new set of selection parameters that can
  • the update processing instruction group 160 selects the value of the second selection parameter variable as the third selection parameter. New selection parameter by storing the value of the first selection parameter variable in the second selection parameter variable, substituting the constant value that has in advance in the selection parameter variable 1 Generate
  • the constant values can be obtained by substituting the values “(constant value)”, “x”, “y” of the first to third selection parameter variables into Expression 1 of the selection processing instruction group 120.
  • the selection identifier is a value that does not indicate one or more data to be selected so far. If this is a value to be one selection target data selected so far, the selection target data becomes a process of continuously performing an infinite loop.
  • the security program 100 executes the processing of the functions provided by the security program by being executed in the order of the selection target main instruction groups 152, 154 and 156 as described above.
  • the update processing instruction group 162 After the selection target main instruction group 152 is executed, the update processing instruction group 162 stores the value “2” of the second selection parameter variable in the third selection parameter variable, and executes the first The value “1” of the selection parameter variable is stored in the second selection parameter variable. At this time, by setting the constant value A of the update processing instruction group 162 to “6”, the selection processing instruction group 120 can select the selection target data 144 as the next valid processing.
  • the update processing instruction group 164 stores the value “1” of the second selection parameter variable in the third selection parameter variable, The value “6” of the selection variable for 1 is stored in the second selection parameter variable.
  • the selection processing instruction group 120 can select the selection target data 146 as the next valid processing.
  • the update processing instruction group 166 stores the value “6” of the second selection parameter variable in the third selection parameter variable, The value "2" of the selection variable for 1 is stored in the second selection parameter variable.
  • the selection processing instruction group 120 designates selection target data other than the selection target data 142, 144, 146 which have been executed so far. It is possible to do something.
  • the update processing instruction groups 160, 161, 163, and 165 of the selection target data 140, 141, 143, and 145 which are not executed in the normal system operation are not selected out of the values “0” to “6”. Choose values that are used so that they do not overlap.
  • values “1”, “3”, “4”, and “5” are set for the update processing instruction groups 160, 161, 163, and 165, respectively.
  • the branch instruction group 170 is a program instruction group that branches to the selection processing instruction group 120 or a program instruction group of processing for returning control to the program caller.
  • FIG. 1 a security program 100a described in C language is shown in FIG.
  • the operator "*" represents multiplication.
  • Program instruction group 11 Oa corresponds to preprocessing instruction group 110
  • program instruction group 120 a corresponds to selection processing instruction group 120
  • program instruction group 130 a corresponds to transition processing instruction group 130
  • Program instruction groups 140a, 142a, 143a and 146a correspond to selection target data 140, 142, 143 and 146, respectively.
  • Program instruction groups 150a, 152a, 153a, 156a correspond to main instruction groups 150, 152, 153, 156 to be selected!
  • Program instruction groups 160a, 162a, 163a, and 166a correspond to update processing instruction groups 160, 162, 163, and 166, respectively.
  • Program instruction groups 170a, 172a, 173a and 176a correspond to branch instruction groups 170, 172, 173 and 176, respectively.
  • selection object data 141, 144, 145 is not described on account of drawing.
  • the security program 100 processes the pre-processing instruction group 110 (step S5). Specifically, the preprocessing instruction group 110 receives the values “1”, “2” and “3” as the input values inl, in2 and in3, respectively, and sets the values “3” to the first to third selection parameter variables. A process of storing 1 ′ ′, “2”, and “3” is performed, and the process branches to the selection processing instruction group 120.
  • the security program 100 uses the received input values “1”, “2” and “3” to select
  • the processing of the selective processing instruction group 120 is performed (step S10).
  • the secrecy holding program 100 processes the selection target main instruction group 152 of the selection target data 142 (step S20). Specifically, the selection target main instruction group 152 executes the instruction group A in the obfuscation target program.
  • the security program 100 processes the update processing instruction group 162 (step S25). Specifically, the update processing instruction group 162 stores the value of the second selection parameter variable in the third selection parameter variable, and the value of the first selection parameter variable in the second selection parameter.
  • the security program 100 processes the branch instruction group 172 (step S30).
  • branch instruction group 172 branches to select processing instruction group 120.
  • the process of 130 is performed (step S40). Specifically, the transition processing instruction group 130 branches to the selection target data 144 based on the selection identifier “4” calculated by the selection processing instruction group 120.
  • the secrecy program 100 processes the selection target main instruction group 154 of the selection target data 144 (step S45). Specifically, the selection target main instruction group 154 executes the instruction group B in the obfuscation target program.
  • the security program 100 processes the update processing instruction group 164 (step S50). Specifically, the update processing instruction group 164 stores the value of the second selection parameter variable in the third selection parameter variable, and the value of the first selection parameter variable in the second selection parameter.
  • step S55 the security program 100 processes the branch instruction group 174 (step S55).
  • branch instruction group 174 branches to selection processing instruction group 120.
  • the security program 100 processes the main instruction group 156 to be selected of the data 146 to be selected according to the branch instruction of the transition processing instruction group 130 (step S70). Specifically, the selection target main instruction group 156 executes the instruction group C in the obfuscation target program. Next, the security program 100 processes the update processing instruction group 166 (step S75). Specifically, the update processing instruction group 166 stores the value of the second selection parameter variable in the third selection parameter variable, and the value of the first selection parameter variable in the second selection parameter.
  • step S80 the security program 100 processes the branch instruction group 176 (step S80).
  • branch instruction group 176 performs a process of returning control to the calling program (as selection target data 146 is the selection target data to be executed last, it is necessary to branch to selection processing instruction group 120). Not).
  • selection target data 146 is the selection target data to be executed last, it is necessary to branch to selection processing instruction group 120.
  • the return statement corresponds to this process.
  • the main force of the operation is the secrecy holding program 100.
  • the program execution device 20 executes the secrecy holding program 100 to realize the above operation. That is, the subject of the operation may be replaced from the security program 100 to the program execution device 20.
  • each part of the confidential program 100 is common to any obfuscated target program. It can be used.
  • the program obfuscation device 10 includes an input unit 200, a function provision instruction group generation unit 201, a camouflage function provision instruction group generation unit 202, and a secrecy program generation unit 203. It is done.
  • the program obfuscator 10 comprises a microprocessor, a ROM, a RAM, a node disk unit, a display unit, a keyboard, a mouse and the like. It is a computer system.
  • a computer program is stored in the RAM or the hard disk unit.
  • the computer program is configured by combining a plurality of instruction codes indicating instructions for the computer in order to achieve a predetermined function.
  • Microprocessor Power By operating according to the computer program, the program obfuscation device 10 achieves its function. That is, the microprocessor reads each instruction included in the computer program one by one, decodes the read instruction, and operates according to the result of the decoding.
  • the function providing instruction group generation unit 201 divides the obfuscated target program accepted by the input unit 200 into a plurality of blocks each having one or more program instructions to generate a plurality of function providing instruction groups. If the obfuscation target program includes unconditional jump and conditional jump, the program instruction to be jumped and the program instruction of jump destination are divided into the same block.
  • the terms relating to a compiler are described in Patent Documents 2 and 3.
  • three functional provision instruction groups are generated by dividing into three blocks so that the number of instructions included in each divided part is as equal as possible.
  • the generated function providing instruction groups are classified into the function providing instruction groups 1 to 3 in the order in which the original program instructions are located at the beginning of the obfuscated target program.
  • the camouflage function providing instruction group generation unit 202 generates a plurality of camouflage function providing instructions by randomly combining one or more program instructions written in a programming language in which the obfuscation target program is described.
  • camouflage function providing instruction group may be generated at random or manually using only program instructions included in the obfuscation target program. In this way, It is possible to make it difficult to distinguish between the camouflage function providing instruction group and the instruction originally included in the obfuscated target program, which makes analysis difficult.
  • the camouflage function providing instruction group generation unit 202 is used in the obfuscated target program so that compilation can pass. Create a camouflage function providing instruction group using variables.
  • the spoofing function providing instruction group generation unit 202 may execute such obfuscation in the program after obfuscation.
  • the terms relating to the C language and the method of declaring variables are the specifications of a well-known programming language (C language), and thus the description thereof is omitted here.
  • the terms relating to Java (registered trademark) are the specifications of a well-known programming language Cia va (registered trademark) with respect to the method of declaring variables and the like, and thus the description thereof is omitted here.
  • the camouflage function providing instruction group generation unit 202 generates four camouflage function provision instructions.
  • the secrecy program generation unit 203 uses a plurality of function provision instructions and a plurality of camouflage function provision instructions to generate a pre-processing instruction group 110, a selection processing instruction group 120, a transition processing instruction group 130, and a selection target data 140.
  • the secrecy program generation unit 203 includes a program storage unit 210, a position storage unit 211, a block selection unit 212, a block placement unit 213, a determination unit 214, and an insertion unit 215. ing.
  • the program storage unit 210 has an area for storing each generated instruction group and data to be selected.
  • the position storage unit 211 has an area for storing information indicating the position where each selection target main instruction group is arranged. For example, when the value “2” is stored in the position storage unit 211, one function provision instruction group or one camouflage function provision instruction group is already inserted in the selection target data 142, Show that.
  • the block selection unit 212 selects a block (function provision instruction group) to be arranged next from the obfuscated target program.
  • the block placement unit 213 calculates the placement position of the selected block using Equation 1, and places the selected block at the calculated placement position in the intermediate program.
  • the determination unit 214 determines a substitution value to be substituted into the variable so that an arrangement position other than the arrangement position stored in the position storage unit 211 is calculated.
  • the inserting unit 215 generates a program instruction group (update processing instruction group) for substituting the determined substitution value into the variable, and inserts the generated program instruction group immediately after the arranged block. .
  • Secrecy program generation unit 203 receives 32-bit input values i nl, in 2 and in 3 from the calling source program, and stores the received values as selection parameter group initial values in the selection parameter variable before the first
  • a processing instruction group 110 is formed of a processing program instruction group and a second preprocessing program instruction group which branches to the selection processing instruction group 120, and a preprocessing instruction group 110 is sequentially generated.
  • the secrecy program generation unit 203 stores the generated pre-processing instruction group 110 in the program storage unit 210.
  • the secrecy program generation unit 203 includes a first selection processing program instruction group that calculates a selection identifier using a selection parameter group, and a second selection processing program instruction group that branches to the transition processing instruction group 130, and Here, the secrecy holding program generation unit 203 generates the selection processing instruction group 120 that sequentially performs these operations as the first selection processing program instruction group, Expression 1 “2 X (first selection parameter variable) + 3 A program instruction group for calculating X (second selection parameter variable) + 5 X (third selection parameter variable) MOD 7 "is generated. The secrecy program generation unit 203 stores the generated selection processing instruction group 120 in the program storage unit 210.
  • the secrecy program generation unit 203 branches to one of the selection target data among the selection target data 140 to 146.
  • a transition processing instruction group 130 to perform the logic is generated.
  • the secrecy program generation unit 203 includes the number (three in this case) of the plurality of function provision instruction groups generated by the function provision instruction group generation unit 201 and the camouflage function provision instruction group generation unit 202.
  • the number (in this case, four) of the plurality of camouflage function provision instructions generated at step (c) is acquired, and the total value is calculated.
  • the secrecy program generation unit 203 generates as many label names as the calculated total value (here, 7).
  • the secrecy program generation unit 203 generates the transition processing instruction group 130 by associating the generated label name as a branch destination with each of the values that can be taken by the expression 1 included in the selection processing instruction group 120.
  • the secrecy holding program generation unit 203 stores the generated transition processing instruction group 130 in the program storage unit 210.
  • the secrecy program generation unit 203 determines the number of the plurality of function provision instructions and the number of the function provision instructions. And generate selection target data as many as the total value of the number of function provision instructions.
  • generation of data to be selected will be described using a specific example.
  • the security program creation unit 203 creates selection target data in which only the generated label name is also a force.
  • the secrecy program generation unit 203 generates seven pieces of data to be selected 140-146.
  • the secrecy program generation unit 203 stores, in the program storage unit 210, each of the selection target data that is also the generated label name.
  • the secrecy program generation unit 203 acquires the function provision instruction group 1 from the function provision instruction group generation unit 201. Using the three initial values received by the input unit 200 and the equation 1, the secrecy program generation unit 203 determines selection target data into which the acquired function providing instruction group 1 is to be inserted. Here, since the value “2” is calculated from the three initial values (“1”, “2”, “3”) and the equation 1, the security program creation unit 203 obtains the function providing instruction group 1 as follows. It is inserted into the selection object data 142 stored in the program storage unit 210. The secrecy program generation unit 203 stores “2” in the position storage unit 211.
  • the security program creation unit 203 creates an update processing instruction group 162 to be inserted into the selection target data 142.
  • the secrecy program generation unit 203 performs the second selection parameter.
  • the value "2" of the data variable is stored in the third selection parameter variable, and the value "1" of the first selection parameter variable is stored in the second selection parameter variable.
  • the secrecy program generation unit 203 substitutes the values “(constant value A)”, “1”, and “2” of the first to third selection parameter variables into the equation 1 to obtain the values so far.
  • the security program creation unit 203 generates a branch instruction group 1 72 to be inserted into the selection target data 142, and inserts the generated branch instruction group 172 into the selection target data 142.
  • the secrecy program generation unit 203 generates a branch instruction group 1 72 that branches to the selection processing instruction group 120, and the generated branch instruction group 172 is stored in the selection target data 142 stored in the program storage unit 210. insert.
  • selection target data 142 constituting the security program is generated.
  • the security program creation unit 203 creates an update processing instruction group 164 to be inserted into the selection target data 144.
  • the secrecy program generation unit 203 stores the value “1” of the second selection parameter variable in the third selection parameter variable, and the value “6” of the first selection parameter variable. Store in the second selection parameter variable.
  • the secrecy program generation unit 203 sets the value “(constant value B)” of the first to third selection parameter variables as “constant value B,” “ The value obtained by substituting “6” and “1” into the equation 1 is stored in the position storage unit 211 so as to be a value without indicating one or more data to be selected so far. Get "2" as a constant value B using one or more values.
  • Secret-retention program generation unit 203 generates branch instruction group 174 to be inserted into selection target data 144.
  • the secrecy program generation unit 203 generates a branch instruction group 174 that branches to the selection processing instruction group 120, and inserts the generated branch instruction group 174 into the selection target data 144 stored in the program storage unit 210. .
  • data to be selected 144 constituting the security program is generated.
  • Confidentiality program generation unit 203 generates update processing instruction group 166 to be inserted into selection target data 146.
  • the secrecy program generation unit 203 stores the value "6" of the second selection parameter variable in the third selection parameter variable, and the value "2" of the first selection parameter variable.
  • the security program creation unit 203 substitutes the values “(constant value C)”, “2”, and “6” of the first to third selection parameter variables as the constant value C into the value obtained by equation 1 Is stored in the position storage unit 211 so as to indicate the value of one or more selection target data selected so far, using one or more values as a constant value C, Get "0".
  • Confidentiality program generation unit 203 generates branch instruction group 176 to be inserted into selection target data 146.
  • the secrecy program generation unit 203 generates a branch instruction group 176 that performs processing of returning control to the calling program, and the generated branch instruction group 176 is selected target data stored in the program storage unit 210. Insert at 146 As a result, selection target data 146 constituting the security program is generated. If the last function provision instruction group 3 (selected main instruction group 156) itself ends with a return statement, there is no need to add a return statement again.
  • the secrecy program generation unit 203 acquires the selection target data 140 in which the function providing instruction group or the camouflage function providing instruction group is not inserted.
  • the secrecy program generation unit 203 inserts one camouflage function providing instruction group out of one or more camouflage function provision instructions group not inserted into the selection target data into the acquired selection target data 140.
  • Confidentiality program generation unit 203 is used as a constant value among “0” to “6” and includes an value (here, “1”), and an update process for updating the value of the selected parameter group
  • the instruction group 160 is generated, and the generated update processing instruction group 160 is inserted into the selection target data 140.
  • Secret-retention program generation unit 203 generates branch instruction group 170 to be inserted into selection target data 140.
  • the secrecy program generation unit 203 generates a branch instruction group 170 that branches to the selection processing instruction group 120, and inserts the generated branch instruction group 170 into the selection target data 140.
  • selection target data 140 which constitutes the secrecy program.
  • the generation of the selection target data 141, 143, and 145 is the same as the generation of the selection target data 140, and thus the description thereof is omitted here.
  • the number of selection target data is m.
  • the security program creation unit 203 randomly selects an integer “n” of 1 among the integers from “0” to “m-1”, and selects the values of the first to third selection parameter variables. In equation 1, as n, “the value of the first selection parameter variable”, and “the value of the second selection parameter variable” Substitute to calculate the value. If the calculated value does not exist in the position storage unit 211, the security program creation unit 203 sets the selected integer "n” as a constant value. When the calculated value is present in the position storage unit 211, the secrecy holding program generation unit 203 reselects the integer “n” of 1 randomly among the integers from “0” to “m ⁇ 1”. The above operation is repeated until the equation 1 does not exist in the position storage unit 211 until the value is calculated.
  • secrecy program generation unit 203 When insertion of all the function provision instructions is completed, secrecy program generation unit 203 does not use any of integers from “0” to “m ⁇ l” for each of the plurality of camouflage function provision instructions. Assign an integer.
  • the integer power from “0" to “m-1” was also selected as the integer “n”, it is not limited to this.
  • the integer to be selected may be an integer of 0 or more.
  • the insertion destination of the camouflage function providing instruction group is also determined using the constant value calculation method described above.
  • the confidential program generation unit 203 stores the pre-processing instruction group 110, the selection processing instruction group 120, the transition processing instruction group 130, and the selection target data 140, 141, ⁇ , 146 in the program storage unit 210. Are arranged in the order shown in FIG. 2 to generate a security program 100.
  • the input unit 200 of the program obfuscation device 10 has three initial values (here, “1”, which are given to the secrecy program). Accept “2", "3") (step S100).
  • the function providing instruction group generation unit 201 divides the obfuscated target program accepted by the input unit 200 into a plurality of blocks each having one or more program instructions to generate a plurality of function providing instruction groups (steps) S 105).
  • the camouflage function providing instruction group generation unit 202 is a camouflage that randomly combines one or more program instructions written in a programming language in which an obfuscation target program is written! A plurality of function providing instructions are generated (step S110).
  • Secrecy program generation unit 203 receives 32-bit input values i nl, in 2 and in 3 from the calling program, and stores the received values as selection parameter group initial values in the selection parameter variables.
  • a pre-processing instruction group consisting of one pre-processing program instruction group and a second pre-processing program instruction group branching to a selected processing instruction group is generated (step S115).
  • Confidentiality program generation unit 203 uses a selection parameter group to calculate a selection identifier from a first selection processing program instruction group and a second selection processing program instruction group branching to a transition processing instruction group. And generates a group of selection processing instructions for sequentially performing these (step S120).
  • the secrecy program generation unit 203 uses the first selection processing program instruction group as the formula 1 “2 X (first selection parameter variable) + 3 X (second selection parameter variable) + 5 X (third selection parameter variable) MOD 7 Generates a group of program instructions for calculating “6”.
  • the secrecy program generation unit 203 Based on the selection identifier calculated by the selection processing instruction group, the secrecy program generation unit 203 performs transition processing instruction group for performing processing to branch to selection target data among a plurality of selection target data. Generate (step S 125). Specifically, the secrecy program generation unit 203 includes the number (m) of the plurality of function provision instruction groups generated by the function provision instruction group generation unit 201 and the camouflage function provision instruction group generation unit 202. The number (n) of the plurality of generated camouflage function provision instructions is acquired, and the total value is calculated. The security program generation unit 203 generates the same number of label names as the calculated total value (here, 7). Confidentiality program generation unit 203 generates a transition processing instruction group by associating the generated label name as a branch destination with each of the values that can be taken by Equation 1 included in selection processing instruction group 120. Do.
  • the secrecy program generating unit 203 uses the three initial values, equation 1, and the plurality of generated function providing instructions and the plurality of spoofed function providing instructions, the secrecy program generating unit 203 generates a plurality of function providing instructions. As many selection target data as the total value of the number and the number of function provision instructions are generated (step S130).
  • the secrecy program generation unit 203 generates the pre-processing instruction group, the selection processing instruction group, A secrecy holding program is generated by arranging the transition processing instruction group and a plurality of selection target data in order (step S135).
  • the secrecy program generation unit 203 generates data to be selected consisting of only the generated label names (step S200).
  • Secret-retention program generation unit 203 sets 1 in counter i (step S205).
  • the counter i indicates what number of the function providing instruction group currently focused on should be executed.
  • the secrecy program generation unit 203 acquires from the function provision instruction group generation unit 201 the function provision instruction group of the i-th execution order.
  • the secrecy program generation unit 203 determines selection target data into which the acquired i-th function providing instruction group is to be inserted, using the selection parameter group and Expression 1. If i is 1, the secrecy program generation unit 203 determines the selection target data using the selection parameter group that also has three initial values and Equation 1, and the i is 2 or more. In this case, the secrecy program generation unit 203 determines data to be selected using the updated selected parameter group and Expression 1.
  • the secrecy program generation unit 203 inserts the i-th function providing instruction group in the execution order into the determined selection target data (step S210).
  • the security program creation unit 203 stores the value of the second selection parameter variable in the third selection parameter variable, and the value of the first selection parameter variable is stored in the second selection parameter variable. Store in The value obtained by substituting the values “constant value”, “1”, and “2” of the first to third selection parameter variables into equation 1 is selected so far. A constant value is acquired such that the value does not indicate one or more selection target data (step S215).
  • Confidentiality program generation unit 203 generates an update processing instruction group for updating the value of the selected parameter group, including the acquired constant value, and inserts the generated update processing instruction group into the selection target data. (Step S220).
  • the security program creation unit 203 determines whether the value of the counter i is equal to the number m of function provision instructions or not (step S 225).
  • the secrecy program generation unit 203 When it is determined that they do not match (“NO” in step S225), the secrecy program generation unit 203 generates a branch instruction group that branches to the selected processing instruction group, and generates the generated branch instruction group as selection target data. (Step S230).
  • step S225 If it is determined that they match ("YES" in step S225), the secrecy holding program generation unit 203 generates a branch instruction group that performs a process of returning control to the calling source program, and selects the generated branch instruction group. Insert it into the data (step S235).
  • the security program creation unit 203 adds the value “1” to the counter i (step S 240).
  • the secrecy program generation unit 203 determines whether the counter i is larger than the number of function provision instructions (step S243).
  • step S243 If it is determined that the size is not large ("NO" in step S243), the secrecy holding program generator 203 returns to step S210 and repeats the process again.
  • step S243 If it is determined that the size is large (“YES” in step S243), the security program creation unit 203 repeats steps S245 to S275 for the number n of camouflage function providing instructions.
  • Secrecy program generation unit 203 receives both the function providing instruction group and the spoofing function providing instruction group, and obtains one selection target data including only the label name! ).
  • Confidentiality program generation unit 203 acquires one instruction group for providing a fake camouflage function providing instruction that is inserted into the selection object data, and the acquired camouflage function provision instruction group is acquired at step S250. Insert it into the data (step S255).
  • the secrecy program generation unit 203 acquires a value, which is used as a constant value (step S260), generates an update processing instruction group including the acquired constant value, and updating the value of the selected parameter group. And insert the generated update processing instructions into the data to be selected (step S265).
  • Confidentiality program generation unit 203 generates a branch instruction group for branching to a selection processing instruction group, and inserts the generated branch instruction group into selection target data (step S 270). If the process of step S250 or the like is repeated until the number n of camouflage function providing instructions is n, the secrecy program generation unit 203 ends the process (step S275).
  • force using Equation 1 as a calculation equation for calculating the selection identifier is not limited to this.
  • the formula for calculating the selection identifier may be another formula using a variable for selection parameters.
  • an initial value may be set to the selection identifier variable, and the expression using the selection identifier variable may be used.
  • a variable for counter that counts the number of times the selected processing instruction group is called may be provided in the selected processing instruction group, and the expression may also use the counter variable.
  • variable for counter may be processed to increase the value of the counter other than the selection processing instruction group.
  • the update target instruction group 166 may not be included in the selection target data 146 including the final function provision instruction group 3.
  • the number of selection parameters is three, the present invention is not limited to this.
  • the number of selection parameters is more than one.
  • Expression 1 is “pl X (variable for the first selection parameter) + P 2 X (variable for the second selection parameter) + ⁇ + pn X (variable for the nth selection parameter) MOD It becomes "NN" (n is an integer of 2 or more).
  • pl, p2, ..., pn are prime numbers that are prime to each other, and let NN be the number of data to be selected.
  • the value stored in the i'th parameter is stored in the i'th parameter. At this time, it stores in the order of the nth parameter, the nth parameter, ⁇ ⁇ ⁇ ⁇ the second parameter.
  • a constant value held by the selected target main instruction group is stored. Where i is greater than or equal to 2 and less than or equal to It is a number.
  • the initial value of the input value is set to “1”, “2”, “3”, it may not be this value.
  • the input value etc. may be a 32-bit value.
  • the number of bits may be shorter than 32 bits, or may be longer than 32 bits! The number of bits may be! / ⁇ .
  • the initial value of the selection information parameter is set to the value given to the secrecy holding program in the pre-processing unit or the like. It may be a value determined using the function of the device that executes.
  • the value of the secret information may be replaced with processing for calculating using the selection parameter variable and the selection identifier variable.
  • the number of selection target data and the number of selection parameters do not necessarily have to be fixed values. .
  • the power described in the simple method here is an analysis of the control structure according to the method of dividing the block which is not limited to this method. You can generate function-providing instructions according to the way of dividing the block.
  • the analysis of the control structure is well known and therefore the description thereof is omitted.
  • the program obfuscation device 10 determines the selection target data into which the function providing instruction group is to be inserted after determining the initial value and the constant value. I will not.
  • the program obfuscation device 10 may determine initial values and constant values after determining the arrangement of function providing instructions.
  • the program obfuscation device 10 selects the main instruction group to be selected, the update processing order for each of a plurality of selection target data consisting only of label names. After inserting the instruction group and the branch instruction group, the arrangement of the pre-processing instruction group, the selection processing instruction group, the transition processing instruction group, and the plurality of selection target data is determined to generate the confidential program. It is not limited to.
  • Program obfuscation apparatus 10 determines the arrangement of a plurality of selection target data that can be processed only by preprocessing instruction group, selection processing instruction group, transition processing instruction group, and label name, and then a plurality of only the label name is formed.
  • the selected target main instruction group, the update processing instruction group, and the branch instruction group may be inserted into each of the selection target data of to generate a secrecy program.
  • the main instruction groups 152, 154, 156 to be selected are arranged at different positions regardless of the actual execution order, so it is difficult to analyze the execution order. It is.
  • main instruction groups to be selected 152, 154, and 156 do not include direct branch instructions to other main instruction groups to be selected, it is difficult to analyze the execution order.
  • the selection processing instruction group that performs processing to determine which selection target data is branched to next is a program instruction that may branch to all of the selection target main instructions depending on the value of the selection parameter. Because of this, it is difficult to analyze the execution order. Further, the selection target data 140 to 146 include selection target data 140, 141, 143, and 145 which are not executed at the time of execution of the normal system, which makes analysis more difficult.
  • the execution order of the selection target data 140 to 146 is determined using a plurality of selection parameters. Therefore, even if the unauthorized analyst happens to know part of the execution order, it becomes difficult to know the execution order of the other parts.
  • the security program is an algorithm for watermark detection
  • what kind of processing is included in a general watermark detection algorithm that unauthorized analysts are familiar with for general watermark processing? It is possible to know In such a case, it is possible to find out the selection target data likely to be executed out of a large number of selection target data.
  • the selection processing instruction group is processing to determine the execution order based on one selection parameter, it is illegal. The analyst can know the value of only one selection parameter.
  • the transition processing instruction group backcalculates what kind of selection identifier it is using, and further, to provide such a selection identifier.
  • To calculate the selection parameters it is necessary to back calculate what kind of selection parameter the selection processing instruction group has used. After that, it is possible to know the execution order by tracking the change of the value of the selection parameter and the processing of the selection processing instruction group.
  • the selection identifier can not be calculated back.
  • the present embodiment there is a process of updating the selection parameter in the selection target data. Therefore, even if the unauthorized analyst knows the secrecy program and the input value given to the secrecy program, it sequentially analyzes how the value of the selection parameter changes! Without it, you can not analyze the order in which the targets are actually executed. Also, conventionally, when the execution order is determined using, for example, a Switch statement, a value (a value used in a Switch statement) indicating a block to be executed next is directly described at the end of a certain block. In the present embodiment, selection target data to be executed next is determined by executing the selection processing instruction group using the selection parameter group having three values.
  • the function providing instruction group to be executed first is determined from the three legal initial values.
  • the function providing instruction group to be executed second is determined from the selection parameter group (first update selection parameter group) updated by the update processing instruction group.
  • the n-th function-providing command group to be executed is a selection parameter group consisting of three initial value powers, a first update selection parameter group,. It is determined by executing the instruction group.
  • n is an integer of 1 or more. More specifically, by executing the update processing instructions in the correct order, it is possible to properly update the selected parameters.
  • the nth function providing instruction group to be executed is determined.
  • the values used in the Switch statement can be acquired by sequentially updating the selected metric group. That is, in the present embodiment, the value used in the Switch statement is concealed in the program and acquired by sequentially updating the selection parameter group. In this way, acquiring hidden information from V and several other pieces of information is divided into obfuscated obfuscation with divided secret and! / ⁇ , and the update processing instruction group in this embodiment corresponds to divided secret. ing.
  • the security system 2 comprises a program obfuscation device 30 and a program execution device 40, as shown in FIG.
  • the program obfuscation device 30 generates the secrecy holding program 300 from the obfuscation target program whose secrecy is to be executed, and distributes the generated secrecy holding program 300 to the program execution device 40.
  • the program execution device 40 executes the security program 300 distributed from the program obfuscation device 30.
  • the program to be obfuscated is composed of three instruction groups of instruction group A, instruction group B, and instruction group C, and correct operation by executing the instruction groups A, B, and C in this order. It shall be.
  • Confidentiality program 300 is a program that performs processing using two or more pieces of confidential information.
  • the secret information is information that the fraudulent analyst does not want to be analyzed.
  • the secret holding program 300 is a program that performs cryptographic processing using a plurality of subkeys that are secret information. In such programs, there is a demand for concealing multiple secrets. Ru. Here, it is assumed that each of the instruction groups A, B, and C has the force secret information.
  • the security program 300 includes a pre-processing instruction group 310, a selection processing instruction group 320, a main processing instruction group 340, and selection target data 350 to 356, which are arranged in the order shown in FIG.
  • Confidentiality program 300 receives, from the calling program, the 32-bit input values inl, in2, in3 as initial values of the selected parameter group, and parameters used in processing using the secret information, and uses the secret information. It is a group of program instructions that perform the processing.
  • the first to third selection parameters which are 32-bit variables that hold the respective values (here, three values) of the plurality of selection parameters used in the processing of the selection processing instruction group 320.
  • the selection parameter is a parameter used when determining the selection target of selection target data 140, 141, ⁇ ⁇ ⁇ 146, and the selection identifier uniquely identifies the selection target data. It is an identifier.
  • the secrecy program 300 is a program instruction group performing processing using two or more pieces of secret information, and in the present embodiment, the secret information possessed by each of the instruction groups A, B, and C is used as the first to third secret information.
  • the respective values are "100", "200” and "300".
  • the pre-processing instruction group 310 is a program instruction group for calculating an initial value of a selection parameter group used in a selection processing instruction group 320 described later.
  • the selection parameter group is a variable for the first, second and third selection parameters.
  • the processing of the pre-processing instruction group 310 is substantially the same processing as the pre-processing instruction group 110 shown in the first embodiment, and the last one of the pre-processing instruction group 110 is a selection processing instruction group 120 branch.
  • the last of the pre-processing instruction group 310 is a program instruction group that branches to the main processing instruction group 340, while the program instruction group is different.
  • the selection processing instruction group 320 is a program instruction group that selects one of the selection target data 350 to 356 based on the selection parameter group as a selection identifier.
  • the processing of the selection processing instruction group 320 differs from the processing of the selection processing instruction group 120 in that the processing of the force selection processing instruction group 320 is a subroutine.
  • the selection processing instruction group 120 has a program instruction which branches to the transition processing instruction group at the end of the processing of the instruction group, whereas the selection processing instruction group 320 is a program function and is selected At the end of the processing instruction group 320, the point of branching to the caller that called this function is different.
  • Selection target data 350 to 356 are data read out in the update processing instruction group.
  • the selection target data 350 to 356 are, for example, sequence data, and in the case of C language, they are sequences as follows.
  • variable— 140 [7] ⁇ 1, 2, 3, 4, 5, 6, 7 ⁇ ;
  • This array is an array used in the transition processing instruction group 390 to 392, which will be described later, and the transition processing instruction group 390 to 392 depends on the array and the initial value set in the selection parameter in the preprocessing instruction group 310. Determines what kind of program instruction group will be.
  • the main processing instruction group 340 is a program instruction group that performs processing using secret information.
  • the main processing instruction group 340 is a program instruction group having function providing instruction groups 360 to 362, selection processing instruction group calling instructions 370 to 372, update processing instructions 380 to 382, and transition processing instructions 390 to 392
  • the instruction group is arranged at the position shown in FIG.
  • the function providing instruction group 360 is a program instruction group that performs processing using secret information. Program instructions that use the secret information value are described as processing using a secret information variable. It is done. That is, the secret information is converted into a secret information variable in advance. If the value of the secret information variable is the value "100" of the first secret information, the function providing instruction group 360 is a program instruction group that performs the original processing.
  • the function providing instruction group 361 is a similar program instruction group, and the value stored in the secret information variable is the value of the secret information 2 is “200”, the function providing instruction group 361 is an original. It is a program instruction group that performs processing.
  • the function providing instruction group 362 is also a similar program instruction group, and if the value stored in the secret information variable is the value of the secret information 3 being "300", the function providing instruction group 362 performs the original processing. It is a program instruction group.
  • the secret information included in each function provision instruction group is converted into a secret information variable in advance.
  • the selection processing instruction group call instruction 370 to 372 is a program instruction group which calls the selection processing instruction group 320.
  • the update processing instruction group 380 is a program instruction group which performs processing of reading out the value of selection target data corresponding to the selection identifier and performs processing of updating the value of the selection parameter group using the read value.
  • the update processing instruction group 380 first stores the selection target data 350, 351, ⁇ ⁇ ⁇ 356 when the value of the selection identifier variable is 0, 1 ⁇ ⁇ ⁇ , 6 respectively.
  • the update processing instruction group 380 updates the selected parameter group based on the read value.
  • the update processing instruction group 380 stores the value of the second selection parameter in the third selection parameter, stores the value of the first selection parameter in the second selection parameter, and the first selection parameter.
  • the read value is stored in.
  • the update processing instruction groups 381 to 382 have the same configuration as the update processing instruction group 380, and thus the description thereof is omitted here.
  • the transition processing instruction group 390 to 392 is processing to determine the value of the secret information variable based on the value of the selection parameter variable.
  • the transition processing instruction group 390 to 392 is a program instruction group which calculates a value (secret information) to be stored in the selection parameter variable and stores the calculated value in the secret information variable.
  • the transition processing instruction group 390 performs operations using the first to third selection parameter variables, and
  • P4, P5, and P6 are mutually prime prime numbers
  • P4 X (variable for first selection parameter) + P5 X (variable for second selection parameter)” + P6 X is a program instruction group that performs processing of calculating “(third selection parameter variable) + (constant 1)” and storing the calculated value in the secret information variable.
  • the operator "X" represents multiplication.
  • the preprocess instruction group 310, the select process instruction group call instruction 370, the select process instruction group 320, and the update process instruction group 380 are in this order until the transition process instruction group 390 is executed. Is being run by.
  • the pre-processing instruction group 310, the selection processing instruction group call instruction 370, the selection processing instruction group 320, and the update processing instruction group 380 are executed. Executes the values of the input values inl, in2 and in3 which also receive the program power of the caller as the values "1", "2" and "3", respectively.
  • the input value that receives the other caller's program power may be any value.
  • the value of the selection identifier becomes “2”, and the update processing instruction group
  • the value 380 acquires from the selection target data 350 to 356 is “3”, and the updated values of the first to third selection parameter variables are “3”, “1”, and “2”.
  • the value of the secret information variable obtained by substituting the values of the first to third selection parameter variables obtained in this manner into the equation 2 is the value of the first secret information.
  • the value is preset to be "100", and is 81 here.
  • transition processing instruction group 392 is ⁇ 2 ⁇ (variable for first selection parameter) + 3 X (variable for second selection parameter) + 5 X (variable for third selection parameter) + (constant 2) It is an instruction group consisting of
  • the pre-processing instruction group 310 by the time the transition processing instruction group 391 is executed, the pre-processing instruction group 310, the selection processing instruction group call instruction 370, the selection processing instruction group 320, the update processing instruction group 380, the transition processing instruction A group 390, a function providing instruction group 360, a selection processing instruction group calling instruction 371, a selection processing instruction group 320, and an update processing instruction group 381 are executed in this order.
  • the values of the first to third selection parameter variables acquired by the update processing instruction group 381 are “6”, “3”, and “1”. If the constant 2 is calculated by the same method as above, it becomes the value “174”.
  • transition processing instruction group 392 is ⁇ 2 ⁇ (variable for first selection parameter) + 3 X (variable for second selection parameter) + 5 X (variable for third selection parameter) + (constant 3) It is an instruction group consisting of
  • the transition processing instruction group 392 is executed before execution.
  • Logical instruction group 310, selective process instruction group call instruction 370, selective process instruction group 320, update process instruction group 380, transition process instruction group 390, function providing instruction group 360, selective process instruction group call instruction 371, selective process instruction group 320, update processing instruction group 381, transition processing instruction group 391, function providing instruction group 361, selection processing instruction group call instruction 372, selection processing instruction group 320, and update processing instruction group 382, power are executed in this order There is.
  • the values of the first to third selection parameter variables acquired by the update processing instruction group 382 are “6”, “6”, and “3”. If the constant 3 is calculated by the same method as above, it becomes the value “255”.
  • the security program 300 processes the pre-processing instruction group 310 (step S300). Specifically, the preprocessing instruction group 310 receives values "1", “2” and “3” as input values inl, in2 and in3, respectively, and sets values for the first to third selection parameter variables. Perform processing to store “1”, “2” and “3”! Branch to ⁇ Select processing instruction group call instruction 370.
  • the secrecy program 300 processes the selection processing instruction group call instruction 370 (step S305). Specifically, the selection processing instruction group call instruction 370 calls the selection processing instruction group 320.
  • the security program 300 processes the update processing instruction group 380 (step S315).
  • the update processing instruction group 380 reads out the value “3” of the selection target data 352 based on the value “2” of the selection identifier variable.
  • the update processing instruction group 380 stores the value "2" of the second selection parameter in the third selection parameter, stores the value "1" of the first selection parameter in the second selection parameter, and
  • the read value “3” is stored in the selection parameter of.
  • the secrecy program 300 processes the transition processing instruction group 390 using the selection parameter group (first to third selection parameters) generated by the update processing instruction group 380 (step S 320).
  • the transition processing instruction group 390 is the equation 2 “2 X (variable for the first selection parameter) + 3 X (variable for the second selection parameter) + 5 X (variable for the third selection parameter) Use + (constant 1) to calculate the value to be stored in the secret information variable, and store the calculated value in the secret information variable.
  • "100" is stored in the secret information variable.
  • the security program 300 executes the processing of the function provision instruction group 360 based on the value stored in the secret information variable (step S 325). Specifically, the function providing instruction group 360 executes the instruction group A in the obfuscation target program.
  • the security program 300 processes the select processing instruction group call instruction 371 (step S330). Specifically, the selection processing instruction group call instruction 371 calls the selection processing instruction group 320.
  • the security program 300 processes the update processing instruction group 381 (step S340).
  • the update processing instruction group 381 reads the value “6” of the selection target data 355 based on the value “5” of the selection identifier variable.
  • the update processing instruction group 381 stores the value "1" of the second selection parameter in the third selection parameter, stores the value "3" of the first selection parameter in the second selection parameter, and
  • the read value “6” is stored in the selection parameter of.
  • the security program 300 processes the transition processing instruction group 391 using the selection parameter group (first to third selection parameters) generated by the update processing instruction group 381 (step S 345). Specifically, the transition processing instruction group 391 is expressed by Equation 2 “2 X (variable for first selection parameter) + 3 X (variable for second selection parameter) + 5 X (variable for third selection parameter) Use + (constant 2) to calculate the value to be stored in the secret information variable, and store the calculated value in the secret information variable. Here, "200" is stored in the secret information variable.
  • the security program 300 processes the function provision instruction group 361 based on the value stored in the secret information variable (step S 350). Specifically, the function providing instruction group 361 executes the instruction group B in the obfuscation target program.
  • the security program 300 processes the select processing instruction group call instruction 372 (step S355). Specifically, the selection processing instruction group call instruction 372 calls the selection processing instruction group 320.
  • the security program 300 executes the process of the update processing instruction group 382 (step S365).
  • the update processing instruction group 382 reads the value “6” of the selection target data 355 based on the value “5” of the selection identifier variable.
  • the update processing instruction group 382 stores the value “3” of the second selection parameter in the third selection parameter, stores the value “6” of the first selection parameter in the second selection parameter, and
  • the read value “6” is stored in the selection parameter of.
  • the security program 300 processes the transition processing instruction group 392 using the selection parameter group (first to third selection parameters) generated by the update processing instruction group 382 (step S 370).
  • the transition processing instruction group 392 is expressed by Equation 2 “2 X (variable for first selection parameter) + 3 X (variable for second selection parameter) + 5 X (variable for third selection parameter) Use + (constant 3) to calculate the value to be stored in the secret information variable, and store the calculated value in the secret information variable.
  • “300" is stored in the secret information variable.
  • the security program 300 processes the function providing instruction group 362 based on the value stored in the secret information variable (step S 375). Specifically, the function providing instruction group 362 executes the instruction group C in the obfuscation target program.
  • the obfuscated target program power with concealed execution order will also be described with respect to the program obfuscated recording device 30 that generates the secrecy holding program 300.
  • Confidentiality program 300 the respective units other than the function providing instruction group 360-362 and the transition processing instruction group 390-392 can be commonly used for any obfuscated target program.
  • the program obfuscation device 30 includes an input unit 400, a function providing instruction group generation unit 401, a transition processing instruction group generation unit 402, and a secrecy program generation unit 403. It is done.
  • the program obfuscation apparatus 30 is a computer system including a microprocessor, a ROM, a RAM, a node disk unit, a display unit, a keyboard, a mouse and the like.
  • a computer program is stored in the RAM or the hard disk unit.
  • the computer program is configured by combining a plurality of instruction codes indicating instructions for the computer in order to achieve a predetermined function.
  • Microprocessor Power By operating according to the computer program, the program obfuscation device 30 achieves its function. That is, the microprocessor reads each instruction included in the computer program one by one, decodes the read instruction, and operates according to the result of the decoding.
  • the function providing instruction group generation unit 401 divides the obfuscated target program accepted by the input unit 400 into a plurality of blocks each having one or more program instructions and generates a function providing instruction group. If the obfuscation target program includes unconditional jump and conditional jump, the program instruction to be jumped and the program instruction of jump destination are divided into the same block. In addition, program instructions that perform processing using the value of secret information are configured to be included in different blocks.
  • the obfuscated target program is processing using values of three secret information, and Divide into three blocks so that the number of instructions included in each divided part is as equal as possible, and generate three function provision instructions.
  • the generated function providing instruction groups are referred to as function providing instruction groups 1 to 3 in the order in which the original program instructions are located at the beginning of the obfuscated target program.
  • the transition processing instruction group generation unit 402 generates a transition processing instruction group including the equation 2 in which the constant is undecided, for the number of function provision instruction groups generated by the function provision instruction group generation unit 401.
  • the transition processing instruction group generation unit 402 generates three transition processing instruction groups including Equation 2 whose constants are undecided.
  • the security program generation unit 403 uses a plurality of function providing instruction groups and the same number of transition processing instruction groups as the function providing instructions group to generate a pre-processing instruction group 310, a selection processing instruction group 320, and a selection processing instruction group call instruction 370
  • the security program 300 is generated by generating an update process instruction group 380 to 382 and selection target data 350 to 351.
  • the secrecy program generation unit 403 includes a program storage unit 410.
  • the program storage unit 410 has an area for storing each generated instruction group and data to be selected.
  • the secrecy program generation unit 403 acquires the plurality of function provision instruction groups generated by the function provision instruction group generation unit 401, and stores the acquired plurality of function provision instruction groups in the program storage unit 410.
  • a secrecy program generation unit 403 acquires the same number of transition processing instruction groups as the number of function providing instruction groups generated by the transition processing instruction group generation unit 402, and acquires the plurality of transition processing instruction groups acquired. Are stored in the program storage unit 410.
  • Confidentiality program generation unit 403 receives 32-bit input values i nl, in 2 and in 3 from the calling program, and stores the received values as selection parameter group initial values in the selection parameter variable. Processing program instruction group and selection processing instruction group call order A pre-processing instruction group 310 is generated, which is composed of a second pre-processing program instruction group branching to an instruction and sequentially performing these.
  • Security protected program generation unit 403 stores generated pre-processing instruction group 310 in program storage unit 410.
  • the secrecy program generation unit 403 Based on the selection parameter group, the secrecy program generation unit 403 generates a selection processing instruction group 320 that selects one of the selection target data 350 to 356 as a selection identifier.
  • the processing of the selection processing instruction group 320 differs in that the force selection processing instruction group 320, which is substantially the same processing as the selection processing instruction group 120, is a subroutine.
  • the selection processing instruction group 120 has a program instruction which branches to the transition processing instruction group at the end of the processing of the instruction group, whereas the selection processing instruction group 320 is a program function, and the selection processing instruction The end of group 320 differs in that it branches to the caller that called this function.
  • the selection identifier is calculated using Expression 1.
  • Confidentiality program generation section 403 stores the generated selection processing instruction group 320 in program storage section 410.
  • the secrecy program generation unit 403 generates a selection processing instruction group call instruction 370 to 372 that calls the selection processing instruction group 320.
  • Confidential program storage unit 403 stores the generated selection processing instruction group call instruction 370-372 in program storage unit 410.
  • the security program generation unit 403 performs a process of reading out the value of the selection target data corresponding to the selection identifier, and an update processing instruction group which performs a process of updating the value of the selection parameter group using the read value.
  • Secret-retention program generation unit 403 stores the generated update processing instruction groups 380 to 382 in program storage unit 410.
  • the secrecy program generation unit 403 generates selection target data 350 to 356 which is data read out by the update processing instruction group 380 to 382.
  • the secrecy program generation unit 403 stores the generated selection target data 350 to 356 in the program storage unit 410.
  • the selection target data 350 to 356 are, for example, sequence data, and in the case of C language, the sequence is as follows.
  • variable— 140 [7] ⁇ 1, 2, 3, 4, 5, 6, 7 ⁇ ;
  • data to be selected in the present invention can be handled as data.
  • the security program generation unit 403 is stored in the program storage unit 410, and includes a pre-processing instruction group 310, a selection processing instruction group 320, a function providing instruction group 360 to 362, a selection processing instruction group call instruction 370 to 372, By arranging update processing instruction groups 380 to 382, transition processing instruction groups 390 to 392, and selection target data 350 in the order shown in FIG. 11, each constant included in transition processing instruction groups 390 to 392 is not yet found. Generate a security program 300a that is a decision.
  • the security program generation unit 403 updates the generated security program 300 a using the initial values (“1”, “2”, “3”) received by the input unit 400. Execute up to processing by instruction group 380. Thereafter, at the time of execution of the transition processing instruction group 390, the secrecy program generation unit 403 determines the constant 1 using the secret information “100” received by the input unit 400, and performs the transition processing of the determined constant 1 Substitute into Expression 2 included in instruction group 390.
  • the security program creation unit 403 executes up to processing by the update processing instruction group 381. Thereafter, at the time of execution of the transition processing instruction group 391, the secrecy program generation unit 403 determines the constant 2 using the secret information “200” received by the input unit 400, and performs the transition process on the determined constant 2 Substitute into Expression 2 included in instruction group 391.
  • the secrecy program generation unit 403 executes up to processing by the update processing instruction group 382. Thereafter, the secrecy program generation unit 403 executes the transition processing instruction group 392 at the time of execution. Then, using the secret information “300” received by the input unit 400, the constant 3 is determined, and the determined constant 3 is substituted into the equation 2 included in the transition processing instruction group 392.
  • the secrecy program generation unit 403 can generate the secrecy program 300 in which each constant included in the transition processing instruction group 390 to 392 is determined.
  • Secrecy program generation unit 403 arranges selection processing instruction group call instruction 370 to 372, update processing instruction group 380 to 382, transition processing instruction group 390 to 392, determines each constant, and corresponds transition processing instruction group Substituting into Eq. 2 of, each instruction group can be inserted into an appropriate placement position.
  • secrecy program generation section 403 Based on the position information received by input section 400, secrecy program generation section 403 converts the secret information into a secret information variable. In this way, it is possible to process the security program to be generated using a secret variable obtained by converting in advance secret information to be concealed.
  • the input unit 400 of the program obfuscation device 30 has three initial values to be given to the secrecy program (here, “0”). 1), “2”, “3”) and position information indicating the position of the secret information (here, information indicating the positions of three pieces of secret information “100”, “200”, “300”) (Step S400).
  • the function providing instruction group generation unit 401 divides the obfuscated target program received by the input unit 400 into a plurality of blocks each of which includes one or more program instructions and generates a plurality of function providing instruction groups (here, functions Provision instruction groups 360 to 362) are generated (step S405).
  • the transition processing instruction group generation unit 402 generates a transition processing instruction group including Equation 2 whose constant is undecided, for the number of function providing instruction groups generated in step S405 (step S410).
  • the transition processing instruction group generation unit 402 generates transition processing instruction groups 390 to 392 including Equation 2 whose constants are undecided.
  • Confidentiality program generation section 403 generates pre-processing instruction group 310 (step S 415).
  • the secrecy program generation unit 403 generates a selection processing instruction group 320 (step S420).
  • the secrecy program generation unit 403 generates as many selection processing instruction group call instructions 370 to 372 as there are generated function provision instruction groups (step S425).
  • the security program creation unit 403 generates update processing instruction groups 380 to 382 in the same number as the number of generated function providing instruction groups (step S430).
  • the secrecy program generation unit 403 generates data to be selected 350 to 356 (step S435).
  • the arrangement of the processing instruction group 390-392 and the selection target data 350-356 is determined, and the security program 300a is generated (step S440).
  • the secrecy program generation unit 403 determines each constant that is undecided, and each secret The information is converted into a secret information variable, and a secrecy program 300 is generated (step S445).
  • Formula 2 is used as a calculation formula for calculating secret information, the present invention is not limited to this.
  • the formula used to calculate secret information may be another formula that uses variables for selection parameters!
  • the formula 1 is used as a calculation formula for calculating the selection identifier, the present invention is not limited to this.
  • the calculation equation for calculating the selection identifier may be another equation using a selection parameter variable.
  • an initial value may be set to the selection identifier variable, and the expression may be a formula using the selection identifier variable.
  • the selection processing instruction group is called in the selection processing instruction group It is also possible to set a counter variable for counting numbers and use an expression that also uses the counter variable.
  • the counter variable may be processed to increase the value of the counter other than the selection processing instruction group.
  • the number of selection parameters is three, the present invention is not limited to this.
  • the number of selection parameters is more than one.
  • Expression 2 is “pl X (variable for the first selection parameter) + p2 X (variable for the second selection parameter) + ⁇ + pn X (variable for the nth selection parameter) + It becomes a constant value (n is an integer of 2 or more).
  • pl, ⁇ 2, ⁇ , pn are prime numbers that are prime to each other.
  • the value stored in the i'th parameter is stored in the i'th parameter.
  • the n-th parameter, the n-th parameter, and ⁇ ⁇ ⁇ ⁇ are stored in the order of the second parameter.
  • the first parameter stores the value read out from the selection target data corresponding to the selection identifier.
  • i is an integer of 2 or more and n or less.
  • the initial value of the input value is set to “1”, “2”, “3”, it may not be this value.
  • the input value etc. may be a 32-bit value.
  • the number of bits may be shorter than 32 bits, or may be longer than 32 bits! The number of bits may be! / ⁇ .
  • the preprocessing unit or the like executes the program or program other than the secret retention program, in which the initial value of the selection information parameter is the value given to the secret retention program.
  • the value may be determined using the function of the device.
  • the value of the secret information may be replaced with processing for calculating using the selection parameter variable and the selection identifier variable.
  • the number of selection target data and the number of selection parameters do not necessarily have to be fixed values.
  • these values may be provided as an input to the program obfuscation device.
  • the power described in the simple method here is an analysis of the control structure according to the method of dividing the block which is not limited to this method. You can generate function-providing instructions according to the way of dividing the block. The analysis of the control structure is well known in the field of compilers, so the description is omitted.
  • the program obfuscation device 30 converts the secret information into the secret information variable after determining each constant in the equation 2.
  • the program obfuscation device 30 may convert secret information into a secret information variable when generating a plurality of function providing instructions. That is, the program obfuscation device 30 may convert the secret information into a secret information variable before determining each constant in Equation 2. In this case, the program obfuscation device 30 temporarily stores each secret information, and uses the temporarily stored secret information when determining each constant in Equation 2.
  • the unauthorized analyst knows the secrecy program and the input value given to the secrecy program, and analyzes, in order, how the value of the selection parameter changes! If you do not hesitate, you can not analyze the order in which the targets are actually executed.
  • each block is executed only once in the correct procedure. If a fraud analyst knows this, it will be possible to conduct efficient analysis. For example, in the first embodiment, if an unauthorized analyst who does not know the combination of the correct initial values of the program assumes that the combination of the initial values is “0”, “0”, “0”, the security program First, when the expression 100 is executed, the 100 acquires the selection identifier “0”, and branches to the data to be selected 143. Then, by executing the update processing instruction group 163, the values of the respective selected parameters become “1”, “0”, and “0”, respectively.
  • the security program 100 further executes the equation 1 using the updated values “1”, “0”, and “0”, acquires the selection identifier “2”, and branches to the data 142 to be selected. Then, by executing the update processing instruction group 162, the values of the respective selection parameters become “6”, “1” and “0”, respectively.
  • the security program 100 further obtains the selection identifier “1” by executing the equation 1 using the updated values “6”, “1” and “0”, and each selection parameter Updated to 3 ”,“ 6 ”,“ 1 ”.
  • the security program 100 acquires the selection identifier “1” when the equation 1 is executed using the values “3”, “6” and “1”. This means that the selection target data 141 is executed twice.
  • a security system 3 is provided in which the same block is not redundantly executed no matter what combination of initial values is used.
  • the security system 3 includes a program obfuscation device 50 and a secret processing device 60 as shown in FIG.
  • the program obfuscation device 50 generates the secrecy holding program 500 from the obfuscated obfuscation target program whose execution order is hidden, and distributes the generated secrecy holding program 500 to the secrecy processing device 60.
  • the secret processing device 60 executes the security program 500 distributed from the program obfuscation device 50.
  • the structure of the security program 500 will be described.
  • the security program 500 is an obfuscated program so that an unauthorized analyst can not analyze the execution order of program instructions included in the program.
  • the security program 500 includes a preprocessing instruction group 510, a selection processing instruction group 520, a management information update instruction group 525, a transition processing instruction group 530, data to be selected 540, 541,. They are arranged in the order shown in FIG.
  • the selection target data 540 to 546 are respectively the selection target main instruction group 550 to 556, the update processing instruction group 560 to 566, and the branch instruction group 570 to 576, and these are arranged in the order shown in FIG. It is done.
  • Each instruction part is a program instruction group that also has one or more program instructions.
  • the main instruction group to be selected 550 to 556 is a program instruction group indicating a part of the processing of the function (for example, the watermark detection function) provided by this program, or a normal system regardless of the provided function. It is a group of instructions not executed at the time of execution of.
  • the normal system refers to the case where the security program 500 is executed without performing special operations such as forcibly changing the program counter or the selection parameter using a debugger or the like.
  • the obfuscated target program is, for example, a program that executes a control flow program shown in FIG.
  • the first function provision instruction group 601, the second function provision instruction group 602, and the third function provision instruction group 603 in FIG. 17 are a set of program instructions, and are appropriate when executed in the flow shown in FIG. Instructions that output different results.
  • the confidentiality program 500 is obfuscated so that the first function provision instruction group 601, the second function provision instruction group 602, and the third function provision instruction group 603 are included in any of the plurality of selection object data 540 to 546. It is done.
  • selection target data 545, 546, 543 include the first function provision instruction group 601, the second function provision instruction group 602, and the third function provision instruction group 603, respectively.
  • selection target data 545, 546, 543 are selected and executed in order.
  • selection target data 540, 541, 542, 544 to which the first to third function provision instructions are not allocated are selection target data which are not executed in the normal system. These are selection target data that may be executed when an unauthorized analyst who does not know the correct execution order performs analysis by an exhaustive attack, and the unauthorized analyst determines the first to third function provision instructions. It is built in to gain.
  • such an instruction group is referred to as a camouflage function providing instruction group.
  • the security program 500 first executes the preprocessing instruction group 510, the selection processing instruction group 520, the management information update instruction group 525, and the transition processing instruction group 530 sequentially, and then changes it. Based on the processing instruction group 530, any one of the selection target data 540 to 546 is executed. The security program 500 repeats this process until the selection target data 543 is executed.
  • the secrecy program 500 has a structure such that the order of execution of the data to be selected can not be understood even if the transition processing instruction group 130 performs some branching.
  • FIG. 500 a security program 500a described in C language is shown in FIG.
  • Program instruction group 510a corresponds to preprocessing instruction group 510
  • program instruction group 520a corresponds to selection processing instruction group 520
  • program instruction group 525a corresponds to management information update instruction group 525
  • program instruction group 530a is transition processing It corresponds to the instruction group 530.
  • program instruction groups 540a, 543a, 545a and 546a are selected data 540 and 54, respectively.
  • Program instruction groups 550a, 553a, 555a, 556a correspond to main instruction groups 550, 553, 555, 556 to be selected!
  • Program instructions 560a, 563a, 565a, 566a correspond to update processing instructions 560, 563, 565, 566, respectively.
  • Program instruction groups 570a, 573a, 575a and 576a are branch instruction groups 570, 573 and 57, respectively.
  • FIG. 20 specifically shows the flow of processing of the program shown in FIG. Confidentiality program 500 receives, from the calling program, input values in-1 and in-2 and parameters to be used in processing the functions provided by this program, before the functions provided by this program. It is a program instruction group that performs processing.
  • the input values in-1 and in-2 are assumed to be initial values of selection parameters CP-1 and CP-2 used for processing in the selection processing instruction group 520.
  • the number of data to be selected is seven, in-1 and in-2 will be described as non-negative integers less than seven.
  • the secrecy program 500 sets “cp—1” and “cp ⁇ 2” as variables indicating selection parameters CP ⁇ 1 and CP ⁇ 2, and “sv” as a variable indicating selection identifier swVar.
  • the selection parameter is a parameter used when determining the selection target of the selection target data 540, 541, ⁇ , 546, and the selection identifier is an identifier uniquely identifying the selection target data. Yes, it is information that identifies the data to be selected next to be executed.
  • the selection target data 540 to 546 correspond to the selection target data 660 to 666! /.
  • branch instruction groups 570 to 572 and 574 to 586 correspond to “goto label A;”, and the branch instruction group 573 corresponds to “return;”. The specific operation of each instruction group will be described in detail below.
  • the preprocessing instruction group 510 is a program instruction group that calculates an initial value of the selection parameter group used in the selection processing instruction group 520.
  • the pre-processing instruction group 510 is a program instruction group to be executed first when the security program 500 is activated.
  • the preprocessing instruction group 510 receives the caller's program power input value in-1 and in-2 and uses the received value as an initial value of the selection parameter group to select parameters CP-1 to CP-2 It is a program instruction group including an instruction group to be stored and initial instruction of management information as many as the number of selection target data.
  • each piece of management information corresponds to selection target data, and manages whether or not the corresponding selection target data has been executed.
  • the preprocessing instruction group 510 performs processing for storing the values in-1 and in-2 in the selection parameters CP-1 to CP-2. Furthermore, when executing a normal system, values “1” and “2” are given as input values in ⁇ 1 and in ⁇ 2.
  • the preprocessing instruction group 510 initializes the management information possessed by the secret processing device 60 as the initialization of the management information.
  • the management information is composed of six arrays, and the preprocessing instruction group 510 initializes the management information by substituting “0” indicating non-execution to all of these values.
  • the selection processing instruction group 520 is a program instruction group that calculates a selection identifier using the selection parameter group.
  • the selection processing instruction group 520 calculates a selection identifier.
  • the number of data to be selected is represented by the symbol NN.
  • the selection processing instruction group 520 stores the result of Expression 3 as a temporary selection identifier swVar in the selection identifier variable sv. Subsequently, the selection processing instruction group 520 determines whether the data to be selected indicated by sv has already been executed or not.
  • the selection processing instruction group 5 When it is determined that the selection control data indicated by sv is not yet executed, the selection processing instruction group 5
  • the selection processing instruction group 520 searches for the latest non-execution selection target data after the calculated value. Here, if all selection target data after the calculated value has already been executed, the selection processing instruction group 520 searches for selection target data that has not been executed in order from the first selection target data.
  • the selection processing instruction group 520 stores the number of the selection target data found by the search in the selection identifier variable sv. By performing such processing, even if the selection target data corresponding to the calculated value is already executed, the non-execution selection target data will always be selected, and the processing of the normal system will be performed. Different target data will always be executed, regardless of whether or not it is.
  • the management information update instruction group 525 manages the management information corresponding to the selection target data 545.
  • the value of the information tb [5] is updated from “0” indicating no execution to “1” indicating execution completed.
  • the transition processing instruction group 530 is a program instruction group that performs processing of branching to any one of selection target data 540 to 546 based on the selection identifier selected in the selection processing instruction group 520. Specifically, when the value of the selection identifier variable sv is 0, 1, ⁇ , 6, it is a program instruction group that branches to selection target data 540, 541, ⁇ , 546, respectively. is there.
  • the program in which the secrecy program 500 is written is a C language program, and labels "label-140:" at the top of the selection target data 540, 541, ... If "label-141:", ⁇ ⁇ ⁇ ⁇ "label-146:” is described, the transition processing instruction group 530 is the following program instructions.
  • case 1 goto label-141
  • case 6 goto label-146
  • the selection target data 540 to 546 are program instructions to be executed when branching by the transition processing instruction group 530.
  • the selection target data 540 to 546 are program instruction groups each including a selection target main instruction group 550 to 556, an update processing instruction group 560 to 566, and a branch instruction group 570 to 576.
  • Main instruction group to be selected 550 to 556 is a program instruction group indicating processing to be performed on each data to be selected. Specifically, for example, “a” described in the selection target data 660
  • Update processing instruction groups 560 to 566 are program instruction groups for updating each value included in the selection parameter group.
  • the branch instruction group 570 to 576 are a program instruction group which branches to the selected processing instruction group 520 outside the selection target data 540 to 546, respectively, and a program instruction group of a process for returning control to the program caller. , Or
  • the branch instruction group 573 of the selection target data 543 including the third function provision instruction group to be executed last is a program instruction group of processing for returning control to the program caller and is included in other selection target data
  • the branch instruction group to be processed is a program instruction group which branches to the selection processing instruction group 120. Specifically, “goto label A;” or “return” included in each of the selection target data 660 to 666 in FIG. 20 corresponds to this.
  • the security processing device 60 that executes the security holding program 500 will be described.
  • the secret processing device 60 is composed of a control unit 700 and a storage unit 701.
  • the secret processing device 60 is a computer system including a microprocessor, a ROM, a RAM, a hard disk unit, a display unit, a keyboard, a mouse and the like.
  • a computer program is stored in the RAM or the hard disk unit.
  • the computer program is configured by combining a plurality of instruction codes indicating instructions to the computer in order to achieve a predetermined function.
  • Microprocessor Power By operating according to the computer program, the secret handling device 60 achieves its function. That is, the microprocessor set reads each instruction included in the computer program one by one, decodes the read instruction, and operates according to the result of the decoding.
  • the storage unit 701 includes a first program storage unit 702, a second program storage unit 703, a management information storage unit 704, and a selection parameter group storage unit 705.
  • the first program storage unit 702 stores a plurality of selection target data included in the confidential program.
  • the selection target data indicates the procedure of the process using the secret information It is information, specifically, a set of program instructions and the like. These selection target data are
  • the selection target data includes the correct operation of the operation using the secret information, the divided procedure, or the operation using the spoofed secret information that is not executed in the normal system.
  • the first program storage unit 702 stores a total of seven selection target data 540, 541, ⁇ , 546. If the number is limited to seven. It goes without saying that there is nothing.
  • the second program storage unit 703 stores program instructions other than the plurality of selection target data included in the confidential program.
  • second program storage unit 703 stores pre-processing instruction group 510, selected processing instruction group 520, management information update instruction group 525, and transition processing instruction group 530 included in secrecy holding program 500 and stores it. ing.
  • the management information holding unit 704 holds, for each of the selection target data, management information for managing execution and non-execution information of the selection target data.
  • the management information holding unit 704 has a management information table T700.
  • the management information table T700 includes the number of selection target data, and has an area for storing management information corresponding to each of the selection target data.
  • Each of the management information 710 to 716 included in the management information table T700 sequentially corresponds to selection target data 540 to 546.
  • the initial value stored in the management information 710 to 716 is the value “0” indicating that the process is not executed.
  • the corresponding management information is updated by the control unit 700 from the value "0" to the value "1" indicating that the execution has been completed.
  • the selection parameter group holding unit 705 is a selection parameter consisting of selection parameters CP 1 and CP 2. Hold the meter group.
  • the control unit 700 controls the overall operation of the secret processing device 60, and executes a process using the secret information (a secret holding program) so that analysis becomes difficult.
  • control unit 700 includes an overall processing unit 720, a preprocessing unit 721, a selection processing unit 722, a management information updating unit 723, a transition processing unit 724, and an updating processing unit 725.
  • control unit 700 may be configured such that the control unit 700 performs functions of each of these components as needed as long as these components are not provided as separate components.
  • the preprocessing unit 721 operates first when the security program is activated.
  • the preprocessing unit 721 reads out one or more program instructions included in the preprocessing instruction group from the second program storage unit 703 via the overall processing unit 720, and reads one or more program instructions read out. Execute sequentially based on the structure.
  • the preprocessing unit 721 first acquires and obtains the input values in-1 and in-2 of the program power of the caller as the initial values of the selection parameters CP-1 and CP-2.
  • the selected parameters CP-1 and CP-2 are stored in the selected parameter group holding unit 705 via the overall processing unit 720.
  • the preprocessing unit 721 initializes the management information holding unit 704. That is, the value of each piece of management information included in the management information table T700 is set to "0".
  • the selection processing unit 722 determines the selection identifier swVar using the selection parameter.
  • the selection processing unit 722 reads out the program instructions included in the selection processing instruction group from the second program storage unit 703 via the entire processing unit 720, and reads one or more program instructions read out from the second program storage unit 703 Execute sequentially based on the structure.
  • selection processing unit 722 uses selection parameters CP-1 and CP-2 stored in selection parameter group holding unit 705, and equation 3 included in the selection processing instruction group. Calculate a temporary selection identifier.
  • the selection processing unit 722 determines, using the management information table T700, whether or not selection target data corresponding to the calculated temporary selection identifier has already been executed. If it is determined that execution has been completed, the selection processing unit 722 acquires an identifier indicating unexecuted selection target data, and sets the acquired value as the selection identifier swVar.
  • the selection processing unit 722 sets the calculated temporary selection identifier as the selection identifier swVar.
  • the selection processing unit 722 can obtain a value corresponding to non-executed selection target data as the selection identifier swVar. That is, since the same selection target data is not redundantly executed regardless of the initial value of the selection parameter, analysis by the unauthorized analyst can be made difficult.
  • the management information updating unit 723 updates the management information corresponding to the selection target data selected by the selection processing unit 722.
  • the management information updating unit 723 reads out the program instructions included in the management information instruction group from the second program storage unit 703 via the overall processing unit 720, and reads one or more program instructions read out. Execute sequentially based on the structure.
  • the management information updating unit 723 sets the management information corresponding to the selection identifier swVar acquired by the selection processing unit 722 out of the plurality of management information included in the management information table T700 as a value. Update from "0" to the value "1".
  • the management information updating unit 723 sets the value of the management information 715 corresponding to the selection target data 545 to “1”. Update to
  • the transition processing unit 724 determines the selection target data of the branch destination among the plurality of selection target data based on the selection identifier swVar selected by the selection processing unit 722, and selects the main selection target included in the determined selection target data. Execute instruction group.
  • the transition processing unit 724 reads out the program instructions included in the transition processing instruction group from the second program storage unit 703 via the overall processing unit 720, and the read out program instructions are based on the structure of the secrecy holding program. , ..., to execute sequentially.
  • the transition processing unit 724 selects the selection identifier swVa selected by the selection processing unit 722. Among the plurality of selection target data, the selection target data of the branch destination is determined based on r. The transition processing unit 724 reads out the selection target main instruction group included in the determined selection target data via the overall processing unit 720, and executes the read selection target main instruction group.
  • the update processing unit 725 updates the value of the selection parameter after the selection target main instruction group included in the selected selection target data is executed.
  • the update processing unit 725 reads the update processing instruction group included in the selected selection target data from the first program storage unit 702 via the whole processing unit 720, and reads the update processing instruction group read out. Run.
  • the update processing unit 725 updates the selection parameters CP_1 and CP-2 using the selection parameters CP_1 and CP_2 stored in the selection parameter group holding unit 705 and the selection identifier. Since the update method is described above, the description here is omitted.
  • the overall processing unit 720 controls the operation of each component included in the control unit 700.
  • the general processing unit 720 controls the pre-processing unit 721, the selection processing unit 722, the management information updating unit 723, the transition processing unit 724, and the updating processing unit 725 in this order at the start of execution of the secrecy holding program.
  • the overall processing unit 720 controls the end of the secret holding program based on the branch instruction group included in the selection target data, and the selection processing unit 722, the management information updating unit 723, the transition processing unit In step 724, the update processing unit 725 performs control deviation in order.
  • the overall processing unit 720 reads out the group of branch instructions included in the selected selection target data from the first program storage unit 702 via the overall processing unit 720.
  • the entire processing unit 720 is a program instruction group indicating a branch to the read group of branch instruction group selection processing instruction group
  • the entire processing unit 720 is a program instruction group of processing for returning control to the branch instruction group power read out from the program, the entire processing unit 720 executes the secrecy holding program. Exit and return control to the caller of the security program.
  • the preprocessing unit 721 of the secret processing device 60 acquires and acquires input values in-1 and in-2 from the calling source program or an external device as initial values of the selection parameters CP-1 and CP-2.
  • the selected parameters CP_1 and CP_2 are stored in the selected parameter group holding unit 705 via the overall processing unit 720, and the management information table T700 of the management information holding unit 704 is initialized (step S500).
  • the preprocessing unit 721 uses the first program storage unit 702, the second program storage unit 703, the management information storage unit 704, and the selection parameter group storage unit 705 in the storage unit 701. An area is secured, and the values stored in each area are initialized.
  • the selection processing unit 722 calculates a temporary selection identifier using the selection parameters CP-1 and CP-2 stored in the selection parameter group holding unit 705 and the expression 3 included in the selection processing instruction group (see FIG. Step S505).
  • the selection processing unit 722 determines, using the management information table T700, whether or not selection target data corresponding to the calculated temporary selection identifier has been executed (step S510). If it is determined that the process has been executed (“YES” in step S510), the selection processing unit 722 updates the temporary selection identifier (step S515).
  • the selection processing unit 722 sets the calculated temporary selection identifier as the selection identifier swVar.
  • the management information updating unit 723 updates the management information corresponding to the selection identifier swVar among the plurality of management information included in the management information table T700, to the value "0" and the value "1" (step S520).
  • the transition processing unit 724 acquires selection target data of the branch destination among the plurality of selection target data based on the selection identifier swVar, and the selection target included in the acquired selection target data. Execute the main instruction group (step S525).
  • the update processing unit 725 selects the selection parameter stored in the selection parameter group holding unit 705.
  • the selection parameters CP-1 and CP-2 are updated using CP-1 and CP-2 and the selection identifier (step S530).
  • the overall processing unit 720 determines whether or not the branch instruction group included in the selected selection target data indicates the end of the program (step S535).
  • step S 535 overall processing unit 720 ends the security program and controls the caller of the security program to the control source. Return.
  • step S535 If it is determined that the branch instruction group does not indicate the end of the program ("NO" in step S535), that is, if it is determined that the branch instruction group indicates the branch to the selected processing instruction group, the whole is taken into consideration.
  • the processing unit 720 returns to step S505.
  • step S535 if the branch instruction group included in the selected selection target data is an instruction group (eg, goto statement) to branch to the selection processing instruction group, the determination result is If the branch instruction group is an instruction group indicating the end of the program (for example, a return statement), the judgment result is "YES".
  • the branch instruction group is an instruction group indicating the end of the program (for example, a return statement)
  • the program obfuscation / reading device 50 has a program storage unit 800, an input unit 801, a function providing instruction group generation unit 802, a camouflage function providing instruction group generation unit 803, and an arrangement order determination unit 804. , A management instruction group generation unit 805, a secrecy holding program generation unit 806, and an output unit 807.
  • the program obfuscation apparatus 50 is a computer system including a microprocessor, a ROM, a RAM, a node disk unit, a display unit, a keyboard, a mouse and the like.
  • a computer program is stored in the RAM or the hard disk unit.
  • the computer program is a combination of a plurality of instruction codes indicating instructions to the computer in order to achieve a predetermined function. It is constructed.
  • Microprocessor Power By operating according to the computer program, the program obfuscation device 50 achieves its function. That is, the microprocessor reads each instruction included in the computer program one by one, decodes the read instruction, and operates according to the result of the decoding.
  • the program storage unit 800 has an area for storing each instruction group generated by the device and data to be selected.
  • the input unit 801 receives a program to be obfuscated and two initial values to be given to the generated security program.
  • the function providing instruction group generation unit 802 divides the obfuscated target program accepted by the input unit 801 into a plurality of blocks which also have one or more program instruction powers.
  • the function providing instruction group generation unit 802 sets each divided block as a function providing instruction group.
  • the function provision instruction group generation unit 802 can generate a plurality of function provision instruction groups for the obfuscated target program power accepted by the input unit 801 as well.
  • the function providing instruction group generation unit 802 includes a program instruction for performing conditional jump in the obfuscated target program when dividing into a plurality of blocks
  • the function provision instruction group generation unit 802 generates the block including the program instruction. The division is performed so that the program instruction for conditional jump and the plural program instructions of the jump destination are all included in the same block. By dividing in this way, the function provision instruction group generation unit 802 can make the branch destination from one block be one block.
  • function provision instruction group generation unit 802 places the program instruction for unconditional jump and the program instruction of jump destination in the same block. Divide as follows. By dividing in this way, the function provision instruction group generation unit 802 can always make the branch source for one block one block.
  • the function provision instruction group generation unit 802 is divided into three function provision instruction groups.
  • the control flow graph in this case is similar to that shown in FIG. That is, as described above, since the jump source and the jump destination of the jump instruction are divided into one block, the control flow graph of the generated block is a control flow having no branch.
  • program instructions constituting each block are defined as first, second and third function provision instructions in order from the block which is the start point of the control flow.
  • the camouflage function providing instruction group generation unit 803 generates a plurality of camouflage function provision instructions based on the obfuscation target program received by the input unit 801.
  • the camouflage function providing instruction group generation unit 803 generates, for example, a camouflage function providing instruction group in which program instructions of the programming language in which the obfuscation target program is described are randomly combined.
  • the spoofing function providing instruction group may be generated at random or manually using only program instructions included in the obfuscated target program, or an instruction not included in the input program is appropriately generated. It does not matter.
  • a programming language that performs compilation processing such as programming language power C language, Java (registered trademark) language
  • an instruction to provide a camouflage function using a variable that is used in an input program so that the compilation passes. Generate a group.
  • a variable that is not used in the input program is included in the spoofing function provision instruction group, by making the program after obfuscation add a declaration of such a variable, it is made not to fail in control.
  • a program instruction group independent of the obfuscated target program is generated. That is, taking the secret keeping program 500 of FIG. 16 as an example, it is the selection target main instruction group that is a division of the obfuscation target program procedure that changes depending on the obfuscation target program. Therefore, the management instruction group generation unit 805 generates another instruction group.
  • the management instruction group generation unit 805 includes a pre-processing instruction group 510, a selection processing instruction group 520, a management information update instruction group 525, a transition processing instruction group 530, one update processing instruction group, A first branch instruction group consisting of a program instruction group in which a branch destination indicates a selection processing instruction group, and a second branch instruction group consisting of a program instruction group of processing for returning control to a program caller are generated.
  • the management instruction group generation unit 805 uses the number (in this case, three) of the plurality of function provision instruction groups generated by the function provision instruction group generation unit 802 and the camouflage function provision instruction group generation unit 803.
  • the number of generated multiple camouflage function provision instructions (here four) is acquired, and the total value thereof is calculated.
  • the management instruction group generation unit 805 generates the same number of label names as the calculated total value (here, 7).
  • the management instruction group generation unit 805 generates the transition processing instruction group 530 by associating the generated label name as a branch destination with each of the values that can be taken by Equation 3 included in the selection processing instruction group 520. .
  • the management instruction group generation unit 805 generates selection target data in which only the generated label names are available.
  • the management instruction group generation unit 805 generates seven selection target data 540 to 546.
  • the management instruction group generation unit 805 includes the generated preprocessing instruction group 510, selected processing instruction group 520, management information update instruction group 525, transition processing instruction group 530, one update processing instruction group, and the first branch.
  • the instruction group and the second branch instruction group are stored in program storage unit 800.
  • management instruction group generation unit 805 also stores selection target data 540 to 546 consisting only of the generated label names in the program storage unit 800.
  • the arrangement order determination unit 804 generates the function providing instruction group (in this case, three function It is determined in which order the instruction group (a group of instructions) and the group of instructions to provide a camouflage function (here, four instruction to provide a camouflage function) are assigned to the selection target main instruction group 550-556. Specifically, placement order determination unit 804 determines which one of main instruction groups 550 to 556 to be selected to arrange first to third function provision instructions, and selects one of the remaining four main instruction groups to be selected. Decide whether to place the camouflage function provision instruction group.
  • the function providing instruction group in this case, three function It is determined in which order the instruction group (a group of instructions) and the group of instructions to provide a camouflage function (here, four instruction to provide a camouflage function) are assigned to the selection target main instruction group 550-556. Specifically, placement order determination unit 804 determines which one of main instruction groups 550 to 556 to be selected to arrange first to third function provision instructions, and selects one
  • the arrangement order determination unit 804 stores in advance the equation 3 described above.
  • pl, p2 and NN in the equation 3 be “1”, “2” and “7”, respectively.
  • a selection target main instruction group 550 to 556 consisting of label names is generated by a management instruction group generation unit 805 described later !.
  • the arrangement order determination unit 804 confirms the order in which selection identifiers are actually calculated using the initial values of the two selection parameters received by the input unit 801 and the equation 3 stored in advance. By doing this, the main instruction group to be selected to which the function providing instruction group and the camouflage function providing instruction group are to be placed is determined.
  • the arrangement order determination unit 804 includes a control unit 850, a selection processing unit 851, a management information update unit 852, an update processing unit 853, and a management information storage unit 854. The details of each component of the placement order determination unit 804 will be described below.
  • the management information holding unit 854 has a management information table T800.
  • the data structure of the management information table T800 is the same as the data structure of the management information table T700 that the management information storage unit 704 has, and thus the description thereof is omitted here.
  • the value “1” stored in the management information table T 800 indicates that the function providing instruction group is arranged in the corresponding selection target data, and the value “0” indicates the corresponding selection
  • the selection target data indicates that no function providing instruction group is arranged.
  • the initial value of each piece of management information in the management information table T800 is “0”.
  • Control unit 850 This makes it possible to record the position where the function providing instruction group is arranged (arranged selection target data).
  • Control unit 850 has a parameter storage area for storing the selected parameter group! /.
  • Control unit 850 stores the initial values CP-1 and CP-2 (in this case, “1” and “2”, respectively) of the selected parameter received by input unit 801 in the parameter storage area.
  • the control unit 850 controls the operations of the selection processing unit 851, the management information updating unit 852, and the updating processing unit 853.
  • the control unit 850 stores the values that can be obtained by Equation 3 of the selection processing unit 851 described later, that is, the values of the selection identifiers that can be obtained by Equation 3 and the selection target data stored in the program storage unit 800. Make a correspondence with
  • Control unit 850 obtains the generated ith function provision instruction group from function provision instruction group generation unit 802. Based on the selection identifier acquired by selection processing unit 851, control unit 850 stores the acquired function providing instruction group of the first eye into corresponding selection target data stored in program storage unit 800.
  • i is an integer of 1 or more and m or less. Further, control unit 850 temporarily stores the correspondence between the i-th function provision instruction group and the selection target data of the insertion destination.
  • the control unit 850 acquires one camouflage function providing instruction group which is not inserted into the selection target data among the plurality of generated camouflage function provision instructions, from the camouflage function providing instruction group generation unit 803.
  • the control unit 850 inserts the acquired spoofing function providing instruction group into the selection target data of! ⁇ 1 ⁇ with the ith function providing instruction group or the spoofing function providing instruction group inserted.
  • the control unit 850 performs this operation on all the camouflage function providing instructions.
  • control unit 850 can insert the ith function provision instruction group or the camouflage function provision instruction group into each selection target data.
  • the function provision instruction group to be arranged can be selected.
  • the selection processing unit 851 stores the equation 3 described above in advance.
  • the selection processing unit 851 obtains the selection parameters CP-1 and CP-2 stored in the parameter storage area.
  • the selection processing unit 851 calculates a temporary selection identifier using the acquired CP-1 and CP-2 and the equation 3 stored in advance.
  • the selection processing unit 851 determines, using the management information table T800, whether or not the selection target data corresponding to the calculated temporary selection identifier has been arranged.
  • the selection processing unit 851 acquires an identifier indicating unallocated selection target data, and sets the acquired value as the selection identifier swVar.
  • the selection processing unit 851 sets the calculated temporary selection identifier as the selection identifier swVar.
  • the function provision instruction Groups can be placed in appropriate locations.
  • the management information updating unit 852 sets the management information corresponding to the selection identifier swVar acquired by the selection processing unit 851 among the plurality of pieces of management information included in the management information table T800 from the value “0” to the value “1”. Update to
  • the update processing unit 853 updates the selection parameters CP-1 and CP-2 using the selection parameter group stored in the meter storage area and the selection identifier acquired by the selection processing unit 851. . Note that the update method is described above, so the description here is omitted.
  • the update processing unit 853 overwrites the updated selected parameter group in the parameter storage area of the control unit 850.
  • the secrecy program generation unit 806 inserts the update processing instruction group stored in the program storage unit 800 into each of the selection target data so as to be positioned next to the selection target main instruction group. Thereby, the secrecy program generation unit 806 can generate the update processing instruction groups 560 to 566 for each of the selection target data. Operation of generation of update processing instruction group by management instruction group generation unit 805, and generation of confidential program By the above-described operation by the processing unit 806, the update processing instruction groups 560 to 566 can be inserted into an appropriate arrangement destination.
  • a secrecy program generation unit 806 generates a management instruction group for the selection target data into which the m-th function provision instruction group (ie, the function provision instruction group to be executed last in the normal system) is inserted.
  • the second branch instruction group generated by the generation unit 805 is inserted so as to be positioned next to the update processing instruction group.
  • the secrecy program generation unit 806 deletes the program instruction. Or, do not insert the second branch instruction group.
  • the secrecy program generation unit 806 places the first branch instruction group generated by the management instruction group generation unit 805 next to the update processing instruction group with respect to the other selection target data. insert. Thereby, the secrecy program generation unit 806 can generate the selection target data 540 to 546.
  • a secrecy program generation unit 806 arranges each instruction group stored in the program storage unit 800, and generates a secrecy program 500. That is, the management instruction group generation unit 805 arranges the generated instruction groups in the order shown in FIG.
  • the output unit 807 outputs the generated security program to the security processing device 60.
  • the input unit 801 receives two initial values to be provided to the obfuscated program and the generated security program (step S600).
  • the function providing instruction group generation unit 802 divides the obfuscated target program accepted by the input unit 801 into a plurality of blocks which also have one or more program instructions (step S 605).
  • the camouflage function providing instruction group generation unit 803 generates a plurality of camouflage function provision instructions based on the obfuscation target program received by the input unit 801 (step S610).
  • the management instruction group generation unit 805 selects the pre-processing instruction group 510, the selection processing instruction group 520, the management information update instruction group 525, the transition processing instruction group 530, one update processing instruction group, and the branch destination is selected.
  • a first branch instruction group consisting of a program instruction group indicating an instruction group
  • a second branch instruction group consisting of a program instruction group of processing for returning control to the program calling source
  • a plurality of selection target data consisting only of label names Generate (step S615).
  • the number of selection target data is equal to the sum of the number of function provision instructions and the number of camouflage function provision instructions.
  • Arrangement order determining unit 804 determines the arrangement destinations of the function providing instruction group and the camouflage function providing instruction group using the selection parameter group and equation 3 stored in advance (step S 620). Using the update processing instruction group generated by the management instruction group generation unit 805, the secrecy program generation unit 806 generates update processing instruction groups 560 to 566 for each of the selection target data. The secrecy program generation unit 806 generates data to be selected 540 to 546 using the first and second branch instruction groups. The security program creation unit 806 arranges each of the generated instructions and generates the security program 500 (step S625).
  • the output unit 807 outputs the generated security program to the security processing device 60 (step S630).
  • the control unit 850 sets “1” to the counter i, and stores the initial value of the selected parameter group in the parameter storage area.
  • the control unit 850 associates each value of the selection identifier with the selection target data stored in the program storage unit 800 (step S700).
  • the counter i indicates the order in which the function providing instruction group currently focused on should be executed. That is, in this case, the arrangement order is determined in order of the first function provision instruction group.
  • the selection processing unit 851 acquires the selection parameters CP_1 and CP-2 stored in the parameter storage area.
  • the selection processing unit 851 determines whether or not the price S of the management information corresponding to the calculated temporary selection identifier is "1", using the management information table T800 (step S710).
  • the selection processing unit 851 updates the temporary selection identifier (step S715), and returns to step S710. Specifically, if the calculated selection identifier is “5” and the value of the management information corresponding to the value “5” is “1”, the selection processing unit 851 selects the temporary selection. The value "6" is taken as a temporary selection identifier immediately after the identifier "5".
  • the management information updating unit 852 sets the management information corresponding to the selection identifier swVar acquired by the selection processing unit 851 from the value “0” to the value Update to "1" (step S725). For example, when the value of the selection identifier is “5”, the management information corresponding to the selection target data 545 is changed to the non-placement capability in the management information table T800 of the management information storage unit 854.
  • the update processing unit 853 updates the selection parameters CP-1 and CP-2 using the selection parameter group stored in the parameter storage area and the selection identifier acquired by the selection processing unit 851. I do.
  • the update processing unit 853 overwrites the updated selected parameter group in the parameter storage area of the control unit 850 (step S730). For example, if the value of the selection parameter is S “l” or “2” and the value of the selection identifier is “5”, the value of the selection parameter is set to “2” or “5”.
  • Control unit 850 counts the value "1" in counter i (step S735).
  • Control unit 850 determines whether or not counter i is larger than the number of function providing instructions. Tep S 740).
  • control unit 850 If it is determined that the size is not large ("NO" in step S740), the control unit 850 returns to step S705 and controls the operation of the selection processing unit 851.
  • control unit 850 inserts a function providing instruction group for each of the plurality of camouflage function providing instruction groups, and makes it possible!
  • the placement destination is determined so that any of the above selection target data becomes the placement destination (step S745). For example, if the selection target data 540, 541, 542, 544 have not been executed, the position at which the spoofed function providing instruction group is arranged is determined to them, and each spoof provided instruction group is inserted.
  • the selection processing unit 722 of the secret processing device 60 according to the third embodiment and the selection processing command group 520 of the confidentiality protection program 500 only out of a plurality of selection target data which have not been executed yet, The selection target data to be selected next is determined. This makes it possible for the fraudulent analyst, who knows that the secret processing device 60 and the security program 500 will not execute the same selection target data redundantly, searches the exhaustive search by changing the initial value of the selection parameter group. Even if it does, the selection target data will not be selected in duplicate even when the initial value of V ⁇ is substituted, so it will be difficult to analyze efficiently.
  • the program obfuscation device 50 can convert the obfuscation target program into a security protected program to be executed by the security processing device 60. In this way, knowing that the same program instruction group will not be executed redundantly, an unauthorized analyst can conduct an exhaustive search by changing the initial value of the selection parameter group to the converted program. Even if it does, it is not possible to find the wrong initial value efficiently based on whether or not there is overlapping power. Therefore, there is an effect that the input program can be converted into a program that can prevent unauthorized analysis from being efficiently performed in a short time.
  • the program obfuscation device 50 shown above may replace the arrangement order determination unit 804 with an arrangement order determination unit 804a (not shown) shown below.
  • the program obfuscation device 50 only carries out the obfuscation target program. , Accepted by the input unit 801.
  • the difference between the arrangement order determination unit 804 and the arrangement order determination unit 804a is that the former is a method of determining the initial value for the selection parameter and then the position of the function providing instruction group, while the latter is Decide the position where the function provision instruction group from 1st to pth (p is the number of selection parameters) is decided, determine the initial value of the variable for the force selection parameter, and arrange the p + 1 first and subsequent function provision instructions.
  • the former is a method of determining the initial value for the selection parameter and then the position of the function providing instruction group, while the latter is Decide the position where the function provision instruction group from 1st to pth (p is the number of selection parameters) is decided, determine the initial value of the variable for the force selection parameter, and arrange the p + 1 first and subsequent function provision instructions.
  • the arrangement order determination unit 804a includes a control unit 850a, a selection processing unit 851a, a management information update unit 852a, an update processing unit 853a, and a management information storage unit 854a. Details of each component of the arrangement order determination unit 804a will be described below.
  • the management information storage unit 854a is the same as the management information storage unit 854, and the description thereof is omitted here. In the following, if necessary, description will be made using the management information table T800.
  • the control unit 850a stores in advance the number p (here, two) of selection parameters.
  • the control unit 850a has a parameter storage area for storing the selection parameter group.
  • Control unit 850a is a value that can be obtained by equation 3 included in selection processing unit 851a described later, that is, each value of the selection identifier that can be taken by equation 3 and selection target data stored in program storage unit 800. Make the mapping of
  • Control unit 850a is provided with a pipe corresponding to the arrangement destination of each of the first to second function provision instruction groups. Update the value of physical information from “0" to "1". Control unit 850a uses the updated management information table T800, information relating to the locations of the l-th to p-th function provision instruction groups, and a calculation equation for calculating the selection identifier. Calculate the value. Control unit 850a notifies the user by displaying the calculated p initial values using a display unit (not shown).
  • Control unit 850a stores the calculated p initial values in the parameter storage area.
  • the control unit 850 a controls the operations of the selection processing unit 851, the management information updating unit 852, and the update processing unit 853.
  • Control unit 850a inserts the i-th function provision instruction group into corresponding selection target data based on the selection identifier acquired by selection processing unit 851a.
  • i is an integer not less than (P + 1) and not more than m
  • m is the number of function provision instructions. Further, control unit 850a temporarily stores the correspondence between the i-th function provision instruction group and the selection target data of the insertion destination. The selection processing unit 851a will be described later.
  • Control unit 850a inserts one camouflage function providing instruction group among a plurality of generated camouflage function provision commands to each of one or more selection target data in which no function provision instruction group is inserted. Do. Here, the once added camouflage function providing instructions are not inserted into other selection target data.
  • the initial value calculation method is shown below.
  • the first function provision instruction group is arranged in the selection target data 545, and the second function provision instruction group is arranged in the selection target data 546.
  • the control unit 850a acquires the values CP-1 and CP-2 of the selection parameter at the time when the processing of the selection target data 545 is finished.
  • the selection parameter CP-2 (corresponding to the variable cp-2 in the program) is the value of the value of the selection identifier (corresponding to the variable sv in the program). Is substituted.
  • the selection identifier at this point is the identifier (ie, 5) of the selection target data 545 in which the first function provision instruction group is arranged.
  • the selection identifier is then recalculated using the selection parameters to which values have been assigned as described above.
  • the value of the first selection parameter is the initial value of the selection parameter CP-2
  • the value of the second selection parameter is the identifier of the selection target data in which the first function providing instruction group is arranged. It becomes.
  • the position at which the second function provision instruction group is arranged is the selection target data 546. Therefore, the temporary selection identification information calculated by the equation 3 is “5” or “6”.
  • Equation 3 If the value of Equation 3 is “6”, then the unexecuted selection object data 546 is selected, and if the value of Equation 3 is “5”, the already selected selection object data 545 is not selected. This is because the unexecuted selection target data 546 immediately after that is selected.
  • the initial value of the selection parameter CP-2 is either “2” or “3”.
  • the control unit 850a selects one of the initial values of the selection parameter CP-2 as “2” or “3”. In the following, the control unit 850a selects "2" as the initial value of the selection parameter CP-2. I will continue to explain it as a good thing.
  • control unit 850a determines an initial value of selection parameter CP_1.
  • the temporary selection identifier calculated by Expression 3 needs to be “5”.
  • the selection parameter CP 2 The initial value of is “2” as calculated earlier, and when the management information update instruction group 125 is executed for the first time, the value of the selection parameter CP-2 is its initial value.
  • initial values “1” and “2” of the first and second selection parameters are calculated.
  • the selection processing unit 851a is the same as the selection processing unit 851, so the description thereof is omitted here.
  • the management information update unit 852a is the same as the management information update unit 852 and thus the description thereof is omitted here.
  • the update processing unit 853a is the same as the update processing unit 853, so the description thereof is omitted here.
  • the operation of the program obfuscation device of the modification 1 generates a secrecy holding program by adding an initial value calculation process between step S615 shown in FIG. 27 and the arrangement determination process (step S620). can do.
  • Control unit 850a randomly sets the positions at which the l-th to p-th function provision instruction groups are to be arranged (step S800).
  • Control unit 850a calculates an initial value of the j-th selection parameter (step S815), and stores the calculated initial value of the j-th selection parameter in the parameter storage area (step S820).
  • control unit 850a displays the initial values of the calculated 1st to pth selection parameters (step S830).
  • the program obfuscation device of the present modification 1 can convert the obfuscation target program into the secrecy holding program as shown in the first embodiment.
  • an unauthorized analyst who knows that the same program instruction group will not be redundantly executed can perform an exhaustive search by changing the initial value of the selection parameter group to the converted confidential program. Even if they do, they can not efficiently find the wrong initial value based on whether they overlap or not. Therefore, there is an effect that the program to be obfuscated can be converted into a program that can prevent unauthorized analysis from being efficiently performed in a short time.
  • the program obfuscation device of the present modification 1 determines the placement destinations of the function providing instruction groups of the 1st to pth, and then performs the function providing instructions of the 1st to pth again in the placement determining process. It has decided where to place the group. In this case, since the initial value of each selection parameter is calculated so that the selection identifier of the arrangement destination determined in advance is calculated, the l-th function provision instruction group determined by the arrangement determination process The arrangement destination is the same as the predetermined arrangement destination.
  • the program obfuscation device omits the process of determining the position of the function providing instruction group of l to p whose allocation destination has already been determined and omits the process of determining the position. You can decide where to place the instruction group Can.
  • this secret processing apparatus is a secret processing apparatus that may repeatedly execute the same selection target data procedure when executing a normal system.
  • the confidential processing device of the modification 2 is realized by replacing the selection processing unit 722 of the third embodiment with a selection processing unit 722b illustrated in FIG.
  • the selection processing unit 722b has a counter that counts the number of times selection target data has been selected, and changes the method of determining the selection identifier according to the value of the counter.
  • a method of determining the selection identifier similar to that of the third embodiment that is, a method of determining the selection identifier to be updated until a selection identifier indicating unexecuted selection vs. target data is obtained
  • the selection processing unit 722b includes a determination method holding unit 750b, a selection history holding unit 751b, a counter 752b, and a control unit 753b.
  • the determination method holding unit 750b has a determination method table T1000, as shown in FIG.
  • Determination method table T1000 has an area for storing one or more pairs of the number of selections and the determination method.
  • the number of selections indicates the number of selections of the data to be selected, and the method of determination indicates the method of determining the selection identifier in the case of the number.
  • the value “0” When the value “0” is set as the determination method, it indicates that the method of determining the selection identifier is the first determination method, and the value “A” other than the value “0” is set as the determination method In the case of!, It indicates that the method of determining the selection identifier is the second method of determination. Indicates that if the value "A" is set, the same selection identifier as the value selected for the A-th time is to be acquired.
  • the selection identifier for determining the selection target data to be selected first is the first determination method. Represents what is determined. Further, if the combination of the number of selections and the determination method is “3, 1”, the selection identifier for determining the selection target data to be selected for the third time is determined using the second determination method, It represents the same selection identifier as the first determined value.
  • the selection history holding unit 751b holds the selection identifier determined in the past in association with the value of the counter at the time of determination.
  • the counter 752 b counts how many times the selection of the data to be selected currently being performed is the selection.
  • the initial value of the counter 752b is 1, and the value of the counter 752b is incremented each time selection is made.
  • the control unit 753b determines the selection identifier determination method using the value of the counter 752b and the determination method table T1000. Specifically, when the value of the counter 752 b is “1”, the control unit 753 b acquires the determination method “0” corresponding to the selection frequency force “1” of the determination method table T 1000. The control unit 753b determines that the selection identifier determination method is the first determination method because the acquired determination method power is “0”. When the value of the acquired determination method is other than “0”, the control unit 753 b determines that the selection identifier determination method is the second determination method.
  • control unit 753b selects the selection identifier by the same processing as in the case of executing selection processing instruction group 520.
  • the control unit 753 b acquires the selection identifier determined for the A-th time from the selection history storage unit 751 b using the acquired value “A”.
  • Control unit 753b stores the selection history of the value indicated by counter 752b and the determined selection identifier. Store in holder 751b. The controller 753 b increments the value of the counter 1340 by one.
  • step S520 the identifier calculation process described below is performed, and then step S520 and subsequent steps are performed. If the determination in step S535 is "YES”, the process ends, and if "NO", the process returns to the identifier calculation process.
  • the control unit 753b determines the selection identifier determination method using the value of the counter 752b and the determination method table T1000 (step S850).
  • Control unit 753b determines whether the determined determination method is the first determination method (Step S855).
  • control unit 753b selects the selection parameters CP-1 and CP-2 stored in the selection parameter group holding unit 705; A provisional selection identifier is calculated using equation 3 included in the selection processing instruction group (step S 860).
  • Control unit 753b determines, using management information table T700, whether or not the selection target data corresponding to the calculated temporary selection identifier has been executed (step S865).
  • control unit 753b updates the temporary selection identifier (step S870).
  • control unit 753b If it is determined that execution has not been performed ("NO” in step S865), control unit 753b stores the value indicated by counter 752b and the selected identifier determined in selection history holding unit 751b (step S880). , And increment the value count of counter 1340 (step S885) If it is determined that the determination method is the second determination method (“NO” in step S 855), the control unit 753 b uses the determination method table T 1000 or the acquired value “A” of the determination method A times The selection identifier determined for the eye is acquired from the selection history holding unit 751b (step S875), and the operation after step S880 is performed.
  • the selection processing unit 722b in the modification 2 selects one of the selected selection target data when selecting the third, fourth, and sixth selection target data to be executed. It is selected. Therefore, even if the fraudulent analyst performs the exhaustive search by changing the initial value of the selection parameter group, knowing that the obfuscation target program executes the same selection target data in duplicate, V ⁇ Even when the initial value of deviation is substituted, the selection target data is selected redundantly, and it is not possible to efficiently find the wrong initial value. Therefore, there is an effect that the program to be obfuscated can be converted into a program that can prevent unauthorized analysis from being efficiently performed in a short time.
  • the program obfuscation device 50c is a program obfuscation device 50c that has a loop, and the obfuscated target program power secrecy holding program has a fixed number of times the program instruction group in the loop is executed.
  • the control flow of the obfuscated target program is shown as an example in FIG. This program has two loop structures, and the program instruction in each loop is executed twice.
  • the program obfuscation device 50c is, as shown in FIG. 34, a program storage unit 800c, an input unit 801c, a function providing instruction group generating unit 802c, a camouflage function providing instruction group generating unit 803c, an arrangement / order determining unit 804c, and management instructions.
  • a group generation unit 805c, a secrecy program generation unit 806c, an output unit 807, and a selection processing instruction group generation unit 808c are included.
  • the program obfuscation device 50c is a computer system including a microprocessor, a ROM, a RAM, a node disk unit, a display unit, a keyboard, a mouse and the like.
  • the RAM or the hard disk unit can not be combined
  • the program is stored.
  • the computer program is configured by combining a plurality of instruction codes indicating instructions for the computer in order to achieve a predetermined function.
  • Microprocessor power The program obfuscation device 50c achieves its function by operating according to the computer program. That is, the microprocessor reads each instruction included in the computer program one by one, decodes the read instruction, and operates according to the decoding result.
  • the program obfuscation device 50c acquires three function provision instruction groups from the obfuscation object program.
  • the structure of the security program generated by the program obfuscation device 50c is assumed to be the same as the structure of the security program 500 shown above, and in the following description, if necessary, the security program 500. This will be described using the symbols used in.
  • the program storage unit 800c is the same as the program storage unit 800 described in the third embodiment, and thus the description thereof is omitted.
  • the input unit 801 c is the same as the input unit 801 shown in the third embodiment, and thus the description thereof is omitted.
  • the obfuscated target program received by the input unit 801 c is a program that has a loop and the number of times the program instruction group in the loop is executed is determined in advance.
  • a plurality of function provision instruction groups are generated from the obfuscation target program received by the function provision instruction group generation unit 802c and the input unit 801c.
  • function provision instruction group generation unit 802 c executes two program instruction groups existing in the loop (here, execution is performed in step S 905).
  • a plurality of function providing instruction groups are operated in the same manner as the function providing instruction group generating unit 802 shown above for each of the program instruction group 1 to be executed and the program instruction group 2) to be executed in step S925.
  • the function providing instruction group generation unit 802c divides program instruction group 1 into two function providing instructions (hereinafter, function providing It is called instruction group 1 and 2. And generates one function providing instruction group (hereinafter, referred to as function providing instruction group 3) from program instruction group 2.
  • FIG. 35 shows a control flow obtained by replacing the control flow shown in FIG. 33 with the generated three function providing instructions.
  • Program instruction group 1 executed in step S 905 is replaced with function providing instruction group 1 executed in step S 906 and function providing instruction group 2 executed in step S 907, and program instructions executed in step S 925.
  • the group 2 is replaced with the function providing instruction group 3 executed in step S926.
  • Program instruction group 2 and function providing instruction group 3 are identical.
  • camouflage function providing instruction group generation unit 803c is the same as the camouflage function provision instruction group generation unit 803 described above, the description thereof will be omitted.
  • the selection processing instruction group generation unit 808 c generates a program instruction group that causes the selection processing unit 722 b described in the second modification to be realized by a computer or the like.
  • the selection processing instruction group generation unit 808c first generates a determination method table T1000 that the determination method holding unit 750b has.
  • the selection processing instruction group generation unit 808 c generates a control flow of a program in which a loop is expanded from the control flow shown in FIG. Specifically, in FIG. 35, the first and second function-providing instructions, which are program instructions in a loop, are expanded by the number of times the loop is executed, that is, twice, and the third function-providing instructions are similarly expanded. Unfold.
  • Figure 36 shows the control flow of the program in which each function provision instruction group is expanded.
  • the selection processing instruction group generation unit 808 c generates a determination method to be stored in the determination method storage unit 750 b based on the control flow of the program in which the loop is expanded.
  • steps S950 to S975 are blocks executed first to sixth, respectively.
  • the function providing instruction group 1 to be executed third in this control flow is the same as the function providing instruction group 1 to be executed first. Therefore, the selection processing instruction group generation unit 808c corresponds to the number of times of selection "3" of the determination method table T1000. The value “1” is set as the decision method. Similarly, the selection processing instruction group generation unit 808 c sets values “2” and “5” as determination methods corresponding to the number of times of selection “4” and “6” of the determination method table T1000.
  • the method of determining the selection identifier when selecting a block that does not exist on the control flow in FIG. 36 but appears only once even on the control flow after expanding the loop is the unallocated selection target It is a decision method of selecting from data.
  • the selection processing instruction group generation unit 808c generates the determination method table T1000 held by the determination method holding unit 750b. Specifically, the selection processing instruction group generation unit 808c generates a program instruction group which causes the computer to have the data structure of the determination method table T1000.
  • the e- th selection identifier is a selection identifier indicating unexecuted selection target data
  • it has a set of “e, 0” and is the same as the f-th selected selection identifier. In this case, it is possible to realize a decision method table T1000 having a set of “e, f”.
  • the selection processing instruction group generation unit 808c further generates a program instruction group for realizing the selection history holding unit 75 lb, the counter 752b, and the control unit 753b on a computer.
  • a program instruction group for realizing the selection history holding unit 75 lb is an instruction group which stores the selection identifier in association with the value of the counter.
  • the program instruction group for realizing the counter 752 b is an instruction group that has an initial value of “1” and indicates a counter that is incremented by one.
  • the group of instructions for realizing the control unit 753 b is a group of program instructions for realizing the operation described in the second modification. In the following, the instruction group that indicates the counter and the instruction group that realizes the control unit 753b are combined to form the determination method control instruction group.
  • the selection processing instruction group generation unit 808c can generate a program instruction group for operating the selection processing unit 722b.
  • the selection processing instruction group generation unit 808 c stores each generated instruction group in the program storage unit 800 c.
  • the placement order determination unit 804c determines which of the generated function providing instructions (here, three function providing instructions) and the camouflage function providing instructions (here, four camouflage function providing instructions). Decide whether to assign to the main instruction group 550-556 to be selected in such an order. Specifically, placement order determination unit 804c determines which one of main instruction groups 550 to 556 to be selected to arrange the first to third function provision instructions, and selects one of the remaining four main instruction groups to be selected. Decide whether to place the camouflage function provision instruction group.
  • the arrangement order determination unit 804c stores the above-described equation 3 in advance.
  • pl, p2 and NN in Equation 3 be “1”, “2” and “7”, respectively.
  • the arrangement order determination unit 804c uses the initial values of the two selection parameters received by the input unit 801c and the equation 3 stored in advance to determine in what order the selection identifier is actually calculated. By confirming, the main instruction group to be selected on which the function providing instruction group and the camouflage function providing instruction group should be arranged is determined.
  • the arrangement order determination unit 804c includes a control unit 850c, a selection processing unit 851c, a management information update unit 852c, an update processing unit 853c, and a management information storage unit 854c. Details of each component of the arrangement order determination unit 804c will be described below.
  • the management information storage unit 854c is the same as the management information storage unit 854, so the description will be omitted. In the following, if necessary, description will be made using the management information table T800. This makes it possible to record the position where the function providing instruction group is arranged (arranged selection target data).
  • Control unit 850c has a parameter storage area for storing the selected parameter group.
  • Control unit 850c stores initial values CP-1 and CP-2 (in this case, “1” and “2”, respectively) of the selection parameters received by input unit 801c in the parameter storage area.
  • the control unit 850c controls the operations of the selection processing unit 851c, the management information updating unit 852c, and the update processing unit 853c.
  • Control unit 850c stores the values that can be obtained by equation 3 included in selection processing unit 851c described later, that is, the values of the selection identifiers that can be obtained by equation 3 and in program storage unit 800c. V, Corresponds to the selection object data.
  • the control unit 850c acquires the generated ith function provision instruction group from the function provision instruction group generation unit 802c. Based on the selection identifier acquired by selection processing unit 851 c, control unit 850 c stores the acquired function providing instruction group of the first eye in program storage unit 800 c and inserts it into the corresponding selection target data. .
  • i is an integer of 1 or more and m or less. Further, control unit 850 c temporarily stores the correspondence between the i-th function provision instruction group and the selection target data of the insertion destination.
  • the control unit 850c acquires, from the spoofing function providing instruction group generating unit 803, one spoofing function providing instruction group which is not inserted into the selection target data among the plurality of generated spoofing function provision instructions.
  • the control unit 850c inserts the acquired spoofing function providing instruction group into the first selection target data in which the ith function providing instruction group or the spoofing function providing instruction group is not inserted.
  • the control unit 850c performs this operation on all the camouflage function providing instructions.
  • control unit 850c can insert the ith function provision instruction group or the camouflage function provision instruction group into each selection target data.
  • the function provision instruction group to be arranged can be selected.
  • the selection processing unit 851 c stores the above-described equation 3 in advance.
  • the selection processing unit 851 c is provided with each function providing instruction based on the control flow shown in FIG. 36 and the program instruction group for operating the selection processing unit 722 b generated by the selection processing instruction group generation unit 808 c. Decide where to place the group.
  • the selection processing unit 851c acquires the ith function provision instruction group to be executed at the t-th time according to the control flow shown in FIG.
  • t is an integer of 1 or more and 6 or less
  • i is an integer of 1 or more and 3 or less.
  • the selection processing unit 851 c acquires the determination method corresponding to the number of times of selection “t” using the determination method table T 1000 generated by the selection processing instruction group generation unit 808 c.
  • the selection processing unit 851 c acquires the selection identifier swVar by the same operation as the selection processing unit 851 described above.
  • the selection processing unit 851c acquires The selected identifier swVar is associated with the i-th function provision instruction group.
  • the 850 c can insert the i-th function provision instruction group into the selection target data indicated by the corresponding selection identifier swVar.
  • the selection processing unit 851 c acquires the j-th function provision instruction group to be executed at the first time t + 1 and performs the above operation.
  • the operation of the selection processing unit 851c and the operation of inserting the i-th function provision instruction group by the control unit 850c into the selection target data based on the selection identifier acquired by the selection processing unit 851c are appropriate. Can be placed to any destination.
  • the management information update unit 852c is the same as the management information update unit 852 and thus the description thereof is omitted.
  • the update processing unit 853 c is the same as the update processing unit 853, so the description will be omitted.
  • the management instruction group generation unit 805c is the same as the management instruction group generation unit 805 described above, and thus the description thereof is omitted.
  • the secrecy program generation unit 806c arranges each instruction group stored in the program storage unit 800c, and generates a secrecy program. That is, the instruction group generated by the management instruction group generation unit 805c, the instruction group generated by the selection processing instruction group generation unit 808c, and the selection target data generated by the arrangement order determination unit 804c are shown in FIG. Arrange in the proper order, and generate the confidential program 1800. Each instruction group can be inserted into an appropriate arrangement position by the operation of generation of the update processing instruction group by the management instruction group generation unit 805c and the above operation by the secrecy holding program generation unit 806c.
  • the positions of other instruction groups other than the determination method control instruction group 580 generated by the selection processing instruction group generation unit 808 c are not particularly specified, for example, they are included in the pre-processing instruction group 510, etc. Thus, it is possible to secure an area necessary at the start of execution, or to generate the determination method holding unit 750 b on a memory, for example.
  • the confidential program generation unit 806c generates a plurality of function provision instruction groups generated by the function provision instruction group generation unit 802c and a camouflage function provision instruction group generation unit 803c with respect to the selection target main instruction group 550 to 556.
  • the plurality of camouflage function providing instructions are arranged so as to correspond to the order determined by the arrangement order determination unit 804c.
  • the output unit 807 c is the same as the output unit 807 described above, and thus the description thereof is omitted.
  • the operation of the program obfuscation device 50c is basically the same as that of the program obfuscation device 50. In the following, differences from the operation of the program obfuscation device 50 will be mainly described using the flowchart shown in FIG.
  • Step S620 is executed by the placement order determination unit 804c.
  • a step is added in which the selection processing instruction group generation unit 808 c operates.
  • the step of operating the selection processing command group generation unit 808c may be any position before determining the arrangement order by the arrangement order determination unit 804c, that is, before Step S620.
  • the program obfuscation device 50c of the third modification can convert the obfuscated target program into a secrecy holding program as shown in the third embodiment.
  • obfuscation can be performed on a wider variety of input programs because obfuscation can be performed with a program having a loop. It can be applied.
  • the program obfuscation apparatus shown in the fourth modification is a program not including the constant, in addition to the obfuscation of the program by the program obfuscation apparatus of the third embodiment, in addition to the program instruction including the constant. It is a device that adds obscurity words to replace instructions.
  • the program obfuscation device is included in program instructions constituting the function providing instruction group.
  • the first constant to be "(first selection parameter) + (second selection parameter) + (second constant)”.
  • an arrangement order determination unit 804d (not shown) is used instead of the arrangement order determination unit 804 shown in the third embodiment.
  • the placement order determination unit 804d has a program instruction change unit 810d in addition to the components described in the third embodiment.
  • program instruction changing unit 810d performs processing for replacing the constant in the input program with "(first selected parameter) + (second selected parameter) + (second constant)". Specifically, the first and second parameters stored in the parameter storage area when program instruction including a constant is included for each function providing instruction group currently viewed by arrangement order determination unit 804d. Get selection parameters. Program instruction changing unit 810 d replaces the constant with “(first selection parameter) + (second selection parameter) + (second constant)” using the acquired first and second selection parameters. Perform the process of
  • the second constant is calculated by subtracting the respective values of the first constant force and the first and second selection parameters.
  • the operation of the program obfuscation device of the fourth modification will be described below with reference to FIG. 39, focusing on the flow of processing of the placement order determination unit 804d.
  • the operation of the program obfuscation device of the fourth modification is the same as that of the third embodiment except for the operation of the arrangement order determination unit 804d.
  • the placement order determination unit 804d sets “1” to the counter count, and stores the initial value of the selected parameter group in the metric storage area (step S1000).
  • the placement order determination unit 804d acquires the selection parameters CP — 1 and CP — 2 stored in the parameter storage area.
  • the arrangement order determination unit 804d calculates a temporary selection identifier using the acquired CP-1 and CP-2 and the equation 3 stored in advance (step S1005).
  • the placement order determination unit 804d determines the placement destination of the count-th function provision instruction group (step S1010). In particular. The arrangement order determination unit 804d performs steps S710, S715, and S720 shown in FIG.
  • the placement order determination unit 804d determines whether a program instruction including a constant exists in the count-th function provision instruction group (step S1015).
  • arrangement order determining unit 804d acquires a program instruction including a constant, and stores the program instruction in the fixed number and parameter storage area included in the acquired program instruction.
  • a second constant is calculated using the first and second selection parameters being set (step S1020).
  • the placement order determination unit 804d performs the operations of steps S1020 and S1025 for all program instructions including a constant present in the count-th function provision instruction group.
  • the arrangement order determination unit 804d uses the selection parameter group stored in the parameter storage area and the selection identifier acquired by the selection processing unit 851 to select one of the selection parameters CP-1 and CP-2. The update is performed, and the updated selected parameter group is overwritten to the parameter storage area (step S1030).
  • the arrangement order determination unit 804 d updates the management information corresponding to the acquired selected identifier swVar among the plurality of management information included in the management information table T 800 from the value “0” to the value “1” (step S 1035).
  • the arrangement order determination unit 804d adds the value "1" to the counter count (step S1040).
  • the placement order determination unit 804d determines whether the counter count is larger than the number of function provision instructions (step S1045).
  • step S1045 If it is determined that the size is not large ("NO" in step S1045), the process returns to step S1005 to the arrangement order determination unit 804di.
  • placement order determination unit 8 04 d inserts a function providing instruction group for each of a plurality of camouflage function providing instructions.
  • the placement destination is determined such that one of the one or more selection target data is the placement destination (step S1050).
  • step S1015 If it is determined that the program instruction including a constant does not exist in the count-th function provision instruction group (“NO” in step S1015), the placement order determination unit 804d performs step S1030 and subsequent steps.
  • substitution equation for replacing a constant is “(selection parameter 1) + (selection parameter 2) + (second constant)”, but may be another equation.
  • substitution expression needs to be fixed each time the substitution is done Do not mind.
  • the obfuscated target program used in the description is an example, and the control flow, the number of loops, and other control structures are not limited to this.
  • the formula for calculating the selection identifier is “I X (selection parameter CP ⁇ 1) + 2 ⁇ (selection parameter CP ⁇ 2) MOD 7”.
  • the invention is not limited to this. Other expressions may be used as long as they can calculate the candidate of the selection identifier in some form.
  • the update process (update process instruction group) of the selection parameter group is embedded in the selection object data 540 to 546 (for example, the selection object in FIG. 20)
  • Secret The densely held program may refer to the update processing instruction group after execution of the selection target data 540 to 546.
  • step S 535 shown in FIG. 24 is not explicitly made, and after the execution of the selection object data 543 to be finally executed in the normal system execution. Force to end processing is not limited to this.
  • the secrecy program may execute the process of determining whether the executed selection target data is the selection target data to be executed at the end of the processing in a form independent of the selection target data.
  • the selection target identifier is indirectly updated by updating the selection parameter in the third embodiment
  • the security program may be configured to directly update the selection identifier.
  • the selection identifier is updated in step S530 shown in FIG. 24, and if the determination result in step S535 is "N 0", the process returns to step S510.
  • the security program is not limited to the force that stores the input value of the calling source force as the initial value of the selection parameter.
  • the confidential program is a configuration that substitutes the value acquired from another device on the network to the initial value of the selection parameter, and the output value obtained as a result of executing another program held by the program execution device May be substituted for the initial value of the selection parameter
  • the program obfuscation device receives the initial value of the selection parameter at the input unit when converting the obfuscation object program into the secrecy holding program. It is not limited to. In the program obfuscation device, the initial value of the selection parameter is determined, and it may be stored in advance.
  • the number of selection target parts, the number of selection parameters, and the calculation formula of the selection identifier are fixed to generate the secrecy program.
  • the value or expression may not necessarily be a fixed value, but may be another value or expression. These values and expressions are, for example, a configuration given as an input to a program obfuscation device. Even! As a rule, it may be determined based on the total number when attacking using an exhaustive attack.
  • the calculation formula of the selection identifier must be selected at all times. An equation that is less than or equal to the number of data is desirable. In addition, since this formula makes it difficult for fraud analysts to analyze, it is desirable to use a formula in which the value calculated according to the value of the selection parameter fluctuates significantly.
  • the initial value of the selection parameter may be a random value for each program to be obfuscated. As a result, even if the fraud analyst can obtain the initial value of the correct selection parameter, the initial value can not be applied to other programs.
  • the division of the block is described in the simple method.
  • the limitation of this method is not to analyze the control structure according to the method of division of the block. You can generate a function providing instruction group according to the way of division.
  • the force S realizing the secret processing device 60 in the form of a program execution device using a program as described above is not limited to this, and hardware-like May be implemented.
  • the security processing device 60 is not limited to this, which determines the end or continuation of the processing based on the determination result of step S535 in FIG.
  • the secret processing device 60 may determine whether or not the same selection processing data as the number of blocks after division has been selected.
  • FIG. 40 A specific example of the secrecy holding program 500e in this case is shown in the flowchart of FIG.
  • the flow chart of the program shown in FIG. 40 is a specific example in which each block in FIG. 18 is described in C language.
  • the value “i” indicates the number of times of selection target data.
  • the conditional expression “if (i> 3) then return;” included in block 651e controls the end of the security program 500e and the continuation of the process. That is, if the number of selections is greater than three, the security processing device 60 terminates the execution of the security program 500e, and if less than three, Continue the execution of the confidential program 500e.
  • the value “3” included in the conditional expression is the same value as the number of divided blocks.
  • branch instruction group included in the selection target data is unified into the branch instruction which branches to the selection processing instruction group.
  • the number of selection parameters is two, it is not limited thereto.
  • the number of selection parameters is more than one.
  • Equation 3 can be expressed as “pl X (variable for first selection parameter) + p 2 X (variable for second selection parameter) + ⁇ + pn X (variable for nth selection parameter) mod It becomes "NN" (n is an integer of 2 or more).
  • NN and pl, 22, ⁇ , pn are integers that are relatively prime to each other.
  • the value stored in the ith parameter is stored in the ith parameter.
  • the first parameter, the second parameter,..., And the n-1st parameter are stored in this order.
  • the value of the selection identifier used to select the selection target data is stored in the nth parameter.
  • i is an integer of 2 or more and n or less.
  • the program obfuscation device 50 selects a main instruction group to be selected, an update processing instruction group, and a plurality of selection target data consisting of only label names. After inserting the branch instruction group, the arrangement of the preprocessing instruction group, the selection processing instruction group, the transition processing instruction group, and the plurality of selection target data is determined to generate the confidential program, but the invention is not limited thereto.
  • the program obfuscation device 50 determines the arrangement destinations of the pre-processing instruction group, the selection processing instruction group, the transition processing instruction group, and the plurality of selection target data in which only the label name is valid, and thereafter determines only the label name.
  • each of a plurality of selection target data consisting of the selection target main instruction group, the update processing instruction group, and the branch instruction group may be inserted to generate a confidential program.
  • a security program 2000 a program obfuscator 1010 and a secret processor 1020 according to a fourth embodiment of the present invention will be described with reference to the drawings.
  • the configuration of the system is the same as the configuration shown in the third embodiment, so the description will be omitted.
  • the secret processing device 1020 is a device using secret information, as in the case of the secret processing device 60 described in the third embodiment.
  • the secret processing device 1020 and the secret processing device 60 shown in the third embodiment have the same configuration elements, but the processing of each part is different.
  • the description of the processing of each part is central, in order to simplify the explanation, the description of the secret processing program 2000 which realizes the secret processing device by being executed on a computer will be described in the description of the secret processing device. Change.
  • the correspondence between the configuration of the secret processing device 1020 and each part of the security program 2000 is the same as that of the third embodiment.
  • the overall configuration of the security program 2000 is shown in FIG.
  • the details of the secrecy program 2000 will be described below with reference to FIG.
  • the same parts as those of the security program 500 of the third embodiment will be assigned the same reference numerals and explanations thereof will be omitted.
  • the security program 2000 analyzes the execution order of the program instructions included in the program to the unauthorized analyst. It is an obfuscated program so as not to be.
  • the secrecy program 2000 includes a management information update instruction group 525 and a transition processing instruction group 530 similar to those of the third embodiment, a pre-processing instruction group 2010 different from the third embodiment, and a selection processing instruction group 2020. , Selection target data 2040, 2041,... 2046, and these forces are arranged in the order shown in FIG. Specific description of each part will be described later.
  • Selection target data 2040 to 2046 are selection targets similar to those of the third embodiment.
  • the main instruction group 550 to 556, and the update processing instruction group 2060 to 2066 different from the third embodiment and the branch instruction group 2070 to 2076 become a force, and these are arranged in the order shown in FIG.
  • Each part is a group of program instructions that also provide one or more program instructions.
  • Confidentiality program 2000 receives, from the calling program, the three input values in-1, in-2 and in-3 and the parameters used in processing the functions provided by this program. It is a program instruction group that performs processing of the provided function.
  • in-k (k is an index) is a nonnegative integer less than (7-k).
  • the data to be selected is seven powers of 2040 to 2046.
  • the number of selection target data may be n + 1.
  • n is a natural number.
  • in ⁇ k is a non-negative integer less than (n + 1 ⁇ k).
  • m is a natural number of n + 1 or less) may be sufficient.
  • the security program 2000 provided in the present embodiment is a program that can execute the selection target data (including the selection target main instruction group) in the correct order by using the value that receives the program power of the caller as well. This is a program that can not know the values received from the calling program, and it is difficult for an unauthorized analyst to know the execution order of the selection target data (including the selection target main instruction group).
  • the preprocessing instruction group 2010 is a program instruction group for setting the selection parameter group used in the selection processing instruction group 2020.
  • the selection parameter group includes a selection parameter CP_1, a selection parameter CP-2 and a selection parameter CP-3, and a selection parameter index CPI. These selection parameters CP-1 to CP-3 are nonnegative integer values, and the selection parameter index CPI is a natural number.
  • Preprocessing instruction group 2010 is executed first when the security program 2000 is activated.
  • the program value of the calling source receives input values in-1 and in-2 and in-3, and receives each of the three received values as selection parameters CP-1 selection parameter CP-2 selection parameter CP 3 contains program instructions that are stored in 3 and that set the selection parameter index CPI of the selection parameter group to the value “1”.
  • in-1 and in-2 and in-3 have the values "2", "4" and "3”
  • the selection parameters CP-1 to CP-3 have the value "2", respectively.
  • the selection processing instruction group 2020 includes a program instruction group that calculates a selection identifier using the selection parameter group.
  • the selection identifier is a value used when the transition processing instruction group is executed, as in the third embodiment.
  • the CP-CPI-th selection target data is selected among the unexecuted selection target data.
  • the selection target data 2040 to 2046 is a program instruction group in which any one is executed after branching by the transition processing instruction group 530.
  • the selection target data 2040 to 2046 are respectively the selection target main instruction group 150 to 156 similar to the third embodiment, the update processing instruction group 2060 to 2066 different from the third embodiment, and the branch instruction group 2070 Through 2076 are program instructions.
  • main instruction groups to be selected 552, 555, 55 are selected.
  • the processing of the function provided by this security program is performed. That is, the first to third function provision instructions are included in each of the selection target main instructions 552, 555, 554.
  • an impersonation function providing instruction group is included in the main instruction groups 550, 551, 553, and 556 to be selected.
  • the update processing instruction group 2060 to 2066 is a program instruction group which updates the value of the selection parameter group used at the next selection. Specifically, the update processing instruction groups 2060 to 2066 increment the selection parameter index CPI. Thus, the selection processing instruction group 2020 directly designates selection parameters to be used at the time of selection.
  • Branch instruction groups 2070 to 6 are either program instruction groups branching to selected processing instruction group 2020 outside of selection target data 2040 to 2046, or program instruction groups for processing for returning control to the program caller.
  • the branch instruction group 2074 included in the selection target data 2044 including the third function provision instruction group is a program instruction group of processing for returning control to the program call source, and is excluded from selection targets included in other selection target data.
  • the branch instruction group is a program instruction group which branches to the selection processing instruction group 2020.
  • the operation of the secret processing device 1020 changes the operation of steps S500, S505, and S530 shown in FIG. 24 to the following operation.
  • step S500 the initial value of the selection parameter is obtained as many as the number of function providing instruction groups, initialization of the value of the selection parameter index CPI, and execution of preprocessing are performed. change.
  • step S505 is changed to select the selection identifier by selecting the selection parameter having the number indicated by the selection parameter index CPI. For example, when the selection parameter index CPI is "1", the selection parameter CP-1 is selected.
  • Step S530 is changed to increment the value of the selection parameter index CPI.
  • the first to third function provision instructions are included in each of the selection target main instructions 552, 555, 554, and the selection target main instructions 550, 551, 553, 556 includes a group of instructions for providing a camouflage function, and when executed in a normal system, the functions provided by this secrecy holding program are executed in the order of main instructions for selection 552, 555, and 554. Perform the processing of
  • the security program 2000 performs the processing of the pre-processing instruction group 2010 (step S2000). Specifically, the preprocessing instruction group 2010 of the secrecy program 2000 receives the values “2”, “4”, and “3” as input values inl, in2, and in3 from the calling source program, respectively. A process of storing the values “2”, “4”, “3” in the selection parameter variables 1 to 3 and a process of initializing the selection parameter index CPI to the value “1” are performed to select process instruction group 202 Branch to 0.
  • the management information update instruction group 525 updates the management information of the selection target data 2042 corresponding to the selection identifier variable “2” to “executed”.
  • Confidentiality program 2000 processes transition processing instruction group 530 (step S2015)
  • transition processing instruction group 530 performs processing of branching to the selection target data 2042 corresponding to the selection identifier variable “2”.
  • the secrecy holding program 2000 performs the processing of the selection target main instruction group 552 included in the selection target data 2042 (step S2020). Specifically, the selection target data 2042 is
  • the secrecy program 2000 performs the process of the update processing instruction group 2062 (step S2025). Specifically, the update processing instruction group 2062 increments the selection parameter index CPI of the selection parameter group. Here, what the value of the selection parameter index CPI is “1” becomes “2”.
  • the security program 2000 processes the branch instruction group 2072 (step S 2030).
  • branch instruction group 2072 performs processing for branching to selection processing instruction group 2020.
  • the secrecy holding program 2000 performs processing of the selection processing instruction group 2020 (step S2035).
  • the selection processing instruction group 2020 stores the value “5” in the selection identifier variable.
  • the security program 2000 performs the processing of the management information update instruction group 525 (step S2 040). Specifically, the management information update instruction group 525 updates the management information of the selection target data 2045 corresponding to the selection identifier variable “5” to “executed”.
  • transition processing instruction group 530 is a selection pair corresponding to selection identifier variable “5”. A process of branching to elephant data 2045 is performed.
  • the security program 2000 performs the processing of the selection target main instruction group 555 included in the selection target data 2045 (step S2050). Specifically, the selection target data 2045 performs processing equivalent to the second function provision instruction group which is a part of the function provided by this program.
  • the security program 2000 performs the processing of the update processing instruction group 2065 Step S205 5). Specifically, the update processing instruction group 2065 increments the selection parameter index CPI of the selection parameter group. Here, what was the value strength "2" of the selection parameter index becomes "3".
  • the security program 2000 processes the branch instruction group 2075 (step S2060).
  • branch instruction group 2075 performs processing for branching to selected processing instruction group 2020.
  • Confidentiality program 2000 performs processing of management information update instruction group 525 (step S2 070). Specifically, the management information update instruction group 525 updates the management information of the selection target data 2044 corresponding to the selection identifier variable “4” to executed.
  • the security program 2000 processes the transition processing instruction group 530 (step S2075). Specifically, the transition processing instruction group 530 performs processing of branching to the selection target data 2044 corresponding to the selection identifier variable “4”.
  • the security program 2000 performs the processing of the selection target main instruction group 554 included in the selection target data 2044 (step S 2080). Specifically, the selection target data 2044 performs processing equivalent to the third function provision instruction group which is a part of the function provided by this program.
  • the secrecy holding program 2000 processes the update processing instruction group 2064 (step S2805). Specifically, the update processing instruction group 2064 increments the selection parameter index CPI of the selection parameter group. Here, what was the value “3” of the selected parameter index becomes “4”.
  • the security program 2000 processes the branch instruction group 2074 (step S 2090).
  • branch instruction group 2074 performs processing of branching to the caller of the security program 2000.
  • the program obfuscation device 1010 has a program storage unit 800f, an input unit 801f, a function providing instruction group generation unit 802f, a camouflage function providing instruction group generation unit 803f, an arrangement order determination unit 804f, and a management. It comprises an instruction group generation unit 805f, a secrecy program generation unit 806f, and an output unit 807f.
  • the program obfuscation apparatus 1010 is a computer system configured of a microprocessor, a ROM, a RAM, a hard disk unit, a display unit, a keyboard, a mouse and the like. Combination tables are stored in the RAM or the hard disk unit.
  • the computer program is configured by combining a plurality of instruction codes indicating instructions for the computer in order to achieve a predetermined function.
  • the program obfuscation device 1010 achieves its function. That is, the microprocessor reads each instruction included in the computer program one by one, decodes the read instruction, and operates according to the decoding result.
  • arrangement order determination unit 804 and arrangement order determination unit 804 f are a selection parameter.
  • the selection identifier is calculated using a calculation formula for obtaining the initial value of and the selection identifier, but the latter uses the initial value of the selection parameter and does not use the calculation formula.
  • the arrangement order determination unit 804f will be described below.
  • the arrangement order determination unit 804f includes a control unit 850f, a selection processing unit 851f, a management information update unit 852f, an update processing unit 853f, and a management information storage unit 854f.
  • the connection relationship of these components is the same as the connection relationship of the components of the placement order determination unit 804 shown in FIG.
  • the arrangement order determining unit 804 f uses the initial value of the selection parameter to confirm the order in which the selection identifier is actually calculated, thereby providing the function providing instruction group and the fake function providing instruction. Determine the main target instruction set to which the group should be placed.
  • the initial value of the selected parameter is accepted by the input unit 801f, and the initial values of the selected parameters CP-1 to CP-3 are "2". , "4", "3".
  • the management information holding unit 854 f is the same as the management information holding unit 854, and thus the description thereof is omitted. The following description will be made using the management information table T800, if necessary.
  • Control unit 850 f has a parameter storage area for storing the selection parameter group.
  • Control unit 850 f sets the initial values CP-1, CP-2 and CP-3 (here, “2”, “4”, and “3”) of the selection parameters received at input unit 801 f to the parameter storage area.
  • control unit 850 f sets selection parameter index CPI to an initial value “1”, and stores it in the parameter storage area.
  • the control unit 850f controls the operations of the selection processing unit 851f, the management information updating unit 852f, and the updating processing unit 853f.
  • Control unit 850f stores the value of the selection identifier and program storage unit 800f. Correspond with the selected data to be selected.
  • Control unit 850 f acquires the generated ith function provision instruction group from function provision instruction group generation unit 802 f. Based on the selection identifier acquired by selection processing unit 85 If, control unit 850 f stores the function providing instruction group of the acquired first order in program storage unit 800 f and inserts it into the corresponding selection target data. Do.
  • i is an integer of 1 or more and m or less. Further, control unit 850 f temporarily stores the correspondence between the i-th function provision instruction group and the selection target data of the insertion destination.
  • the control unit 850 f acquires one camouflage function providing instruction group which is not inserted into the selection target data among the plurality of generated camouflage function provision instructions, from the camouflage function providing instruction group generation unit 803 f.
  • the control unit 850 f inserts the acquired spoofed function providing instruction group into the first selection target data in which the ith function providing instruction group or the spoofed function providing instruction group is not inserted.
  • the control unit 850 f performs this operation on all the camouflage function providing instructions.
  • control unit 850 f can insert the i-th function provision instruction group or the camouflage function provision instruction group into each selection target data.
  • the function provision instruction group to be arranged can be selected.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Storage Device Security (AREA)

Abstract

 不正解析者がオリジナルプログラムの解析を容易にすることができない秘密保持プログラムを生成するプログラム変換装置を提供する。  プログラム変換装置は、複数の選択パラメータに代入する値を取得する第1命令群と、前記複数の選択パラメータを用いた演算式に基づいて次に処理される選択対象データを示す選択識別子を取得する命令群を含む第2命令群と、選択パラメータの値に過去に処理された選択対象データを示す選択識別子又は前記演算式に過去に代入された1以上の選択パラメータの値のうち少なくとも1の選択パラメータの値を反映させる第3命令群と、所定の順序で処理することにより前記オリジナルプログラムと同一の実行結果を出力し異なる選択識別子が対応付けられる複数の選択対象データとを生成し、前記第1命令群と前記第2命令群と前記第3命令群と前記複数の選択対象データとを含む秘密保持プログラムを生成する。

Description

明 細 書
プログラム変換装置及び秘密保持プログラム 技術分野
[0001] 本発明は、秘密情報を保持して実行するプログラムを、秘密情報を不正に解析す ることを困難にするプログラムに変換する技術に関する。
背景技術
[0002] 従来、秘密の要素を使用して処理を行うプログラムを、不正解析者に解析させたく ないという要求がある。このようなプログラムには、例えば、暗号プログラムがある。暗 号プログラムは、秘密情報である暗号鍵を用いて処理を行うが、これを解析されたく ないという要望がある。
また、例えば、画像に埋め込まれたコピー制御情報のウォーターマークの検出を行 うプログラムである。ウォーターマークの検出プログラムの処理が不正解析者によって 解析された場合、画像に埋め込まれたウォーターマークを除去するツールを作成さ れる恐れがある。よって、このようなプログラムは、不正解析者にとって解析困難であ ることが望まれる。そのような要望に対し、例えばプログラムを暗号ィ匕しておき、実行 時には復号して力もそのプログラムを実行するという方法がある。しかし、このような方 法を用いてもプログラムは実行時にメモリ上で平文となるため、メモリ上のプログラム を抜き取られて解析されるという脅威がある。このような脅威に対し、抜き取ったプログ ラムに含まれるプログラム命令群がどのような実行順序で実行されるかが解析困難で あれば、ウォーターマークを除去するツールを作成することは困難になる。
[0003] 従来、秘密の要素を使用して処理を行うプログラムの不正な解析 Z改ざんを防止 するための方法としてプログラムの制御構造 Z処理などを元のプログラムとは異なる 形式に変換することで制御構造を複雑にして、解析困難なプログラムにするプロダラ ム難読化の方法が考えられて ヽる (例えば非特許文献 1参照)。
非特許文献 1では、秘密情報を含むプログラム命令を、複数のプログラム命令群に 置き換えることでプログラムを難読ィ匕する方法が開示されている。例えば、「dO= 123 4」というプログラム命令において「1234」が被秘匿情報である場合、「dO= 1234」と ヽぅプログラム命令を、「dO= 100」、「dO = dO X 2」、「dO = dO + 30」、「dO = dO+ l 000」、「d0 = d0+4」のようなプログラム命令群に置き換え、これらを分散して配置す ることが述べられている。このような方法を用いれば、プログラム中に存在する定数デ ータを収集しても、その中から被秘匿情報を見つけることができなくなる。
[0004] し力しながら、プログラムに含まれる各命令群の実行順序が知られてしまうと、不正 解析者は、その実行順序に従って、 dOの値を算出することにより被秘匿情報を見つ けることができる。
そこで、従来、プログラムの実行順序の解析を困難にする方法として、実行する命 令群を示す値に基づ ヽて分岐先を決定する分岐命令 (例えば、 switch文)と配列と を用いて、各命令群の実行順序を制御する方法がある (非特許文献 2)。このとき、ォ リジナルプログラムに含まれる複数の命令群 (例えば、命令群 1〜3であり、この順序 に実行される。)は、実行する命令群を示す値と 1対 1に対応付けられており、また、 命令群 1〜3の最後に、配列を用いた演算式により次に実行する命令群を示す値を 算出し、算出した値が、 switch文にて用いられる変数 Varに格納するプログラム命令 が挿入される。配列の個数を 10とすると、挿入されるプログラム命令の一例は、 Var =g[3] +g[4]である。
[0005] これにより、命令群 1〜3の配置順序を入れ替えても、 switch文により実行順序は、 正当なままで保たれている。また、命令群 1〜3の配置順序を入れ替えることで、オリ ジナルプログラムの構造の解析を困難にすることができる。つまり、ウォーターマーク の検出プログラムの解析や、被秘匿情報の取得を困難にすることができる。
非特許文献 1 :鴨志田、松本、井上、〃耐タンパ一ソフトウェアの構成手法に関する考 察"、 ISEC97- 59
非特干文献 2: Chenxi Wang、 A ecurity Architecture lor Survivabilit y Mechanisms", Ph. D. Dissertation (2000)
発明の開示
発明が解決しょうとする課題
[0006] し力しながら、各命令群の最後に挿入されるプログラム命令と配列に格納されてい る各データとは、例えば、コンピュータ装置の記憶領域力 取得される可能性がある 。そのため、各命令群の最後に挿入されるプログラム命令と配列に格納されている各 データとが、不正解析者に知られてしまうと、不正解析者は、 switch文にて用いられ る変数の値を取得し、オリジナルプログラムの制御構造を再構成することができ、オリ ジナルプログラムの解析を容易に行うことができる。
[0007] そこで、本発明は、不正解析者がオリジナルプログラムの解析を容易にすることが できな!/、秘密保持プログラムを生成するプログラム変換装置、前記秘密保持プロダラ ムを実行する秘密処理装置、変換方法、及び秘密処理方法を提供することを目的と する。
課題を解決するための手段
[0008] 上記目的を達成するために、本発明は、オリジナルプログラム力も秘密保持プログ ラムを生成するプログラム変換装置であって、オリジナルプログラムを取得するプログ ラム取得手段と、所定の順序で処理することにより、前記オリジナルプログラムと同一 の実行結果を出力し、異なる選択識別子が対応付けられる複数の選択対象データを 生成する選択対象データ生成手段と、複数の選択パラメータそれぞれに値を代入す る前処理命令群を生成する前処理命令群生成手段と、前記複数の選択パラメータを 用いた演算式に基づいて、次に処理される選択対象データを示す選択識別子を取 得する命令群を含む選択処理命令群を生成する選択処理命令群生成手段と、選択 パラメータの値に、過去に処理された選択対象データを示す選択識別子、又は前記 選択パラメータに過去に代入された 1つ以上の選択パラメータの値のうち少なくとも 1 つの選択パラメータの値を反映させる更新処理命令群を生成する更新処理命令群 生成手段と、前記前処理命令群と前記処理選択命令群と前記更新処理命令群と前 記複数の選択対象データとを含み、前記処理選択命令群を実行する処理と、前記 選択処理命令群により取得される選択識別子が示す選択対象データを処理する処 理と、前記選択対象データが処理されると前記更新処理命令群を実行する処理とを 繰り返す秘密保持プログラムを生成する秘密保持プログラム生成手段とを備えること を特徴とする。
発明の効果
[0009] 上記に示した構成によると、プログラム変換装置にて生成された秘密保持プロダラ ムは、演算式の前記複数の選択パラメータを更新する際に、選択パラメータの値に、 過去に処理された選択対象データを示す選択識別子、又は前記演算式に過去に代 入された 1以上の選択パラメータの値のうち少なくとも 1の選択パラメータの値を反映 させている。従来は、次に実行すべきブロックを決定する際には、複数の固定値が格 納された配列を用いていたが、本発明のプログラム変換装置にて生成された秘密保 持プログラムは、次に実行すべきブロックを決定した後、常に、演算式に用いる選択 ノ メータを更新するので、複数の選択パラメータに格納される値は特定されに《な る。そのため、不正解析者がオリジナルプログラムの解析を容易にすることができな い。
[0010] ここで、前記所定の順序は、前記複数の選択パラメータに所定の初期値を与えて、 前記選択処理命令群及び前記更新処理命令群の実行を繰り返すことにより、順次算 出される選択識別子の順序であるとしてもょ ヽ。
この構成によると、プログラム変換装置は、各選択パラメータに所定の初期値を与 えた場合に、オリジナルプログラムと同一の実行結果を出力する秘密保持プログラム を生成することができる。
[0011] ここで、前記複数の選択対象データのそれぞれは、 1個以上のデータからなるとし てもよい。
この構成〖こよると、プログラム変換装置は、選択対象データをデータとして扱う秘密 保持プログラムを生成することができる。
ここで、前記オリジナルプログラムは、秘匿すべき秘密情報を有し、前記選択処理 命令群生成手段は、前記複数の選択パラメータを用いる第 1の演算式により前記選 択識別子を算出する命令群からなる選択処理命令群を生成し、前記更新処理命令 群生成手段は、算出された前記選択識別子にて示される選択対象データの値に基 づいて、前記複数の選択パラメータを更新する更新処理命令群を生成し、前記プロ グラム変換装置は、さらに、更新した複数の選択パラメータを用いた第 2の演算式に より、前記秘密情報と同一の値を算出する変遷処理命令群を生成する変遷処理命 令群生成手段を備え、前記秘密保持プログラム生成手段は、生成された変遷処理命 令群を、前記更新処理命令群の配置位置と、前記秘密情報の配置位置との間へ配 置し、及び前記秘密情報を前記変遷処理命令群で算出する処理に置換するとしても よい。
[0012] この構成〖こよると、プログラム変換装置にて生成された秘密保持プログラムは、秘密 情報と同一の値を算出する方法を、前記選択処理命令群、前記更新処理命令群、 及び前記変遷処理命令群により隠匿しているので、不正解析者は、秘密情報を解析 することが困難となる。
ここで、プログラム変換装置は、さらに、前記オリジナルプログラムを、 1つ以上のブ ロックに分割する分割手段を備え、前記複数の選択対象データのそれぞれは、異な るブロックを含むとしてもよ 、。
[0013] この構成によると、プログラム変換装置は、選択対象データをオリジナルプログラム 力も分割されたブロックとして扱う秘密保持プログラムを生成することができる。
ここで、前記複数の選択パラメータは、第 1から第 nの選択パラメータであり、前記更 新処理命令群生成手段は、前記複数の選択対象データのそれぞれに対して、第 j 1 (jは 2以上 n以下の整数)の選択パラメータに格納されている値を第 jの選択パラメ ータへ格納し、定数値を第 1の選択パラメータに格納する更新処理命令群を生成す るとしてちよい。
[0014] この構成によると、プログラム変換装置にて生成された秘密保持プログラムは、前記 演算式に過去に代入された 1以上の選択パラメータの値のうち少なくとも 1の選択パ ラメータの値を反映させて前記複数の選択パラメータの値を更新することができる。 ここで、前記選択対象データの個数は、前記ブロックの個数以上力 なる所定の数 であり、前記演算式は、前記第 1から第 nの選択パラメータのそれぞれに対して、 Pi X 第 iの選択パラメータ (iは 1以上 n以下の整数)を算出し、算出した結果それぞれを加 算し、加算結果に、前記所定の数をモジュロ値 Nとするモジュロ演算を施し、選択識 別子を算出し、 Piとモジュロ値 Nとは、互いに素であるとしてもよい。
[0015] この構成によると、プログラム変換装置は、演算式を用いて、選択対象データを確 実に決定することができる。
ここで、選択対象データ生成手段は、現時点までに前記演算式にて算出された選 択識別子それぞれを記憶する記憶部と、 1つのブロックに対して、 1つの値を選択し、 第 j 1 (jは 2以上 n以下の整数)の選択パラメータに格納されて ヽる値を第 jの選択パ ラメータへ格納し、選択した値を第 1の選択パラメータに格納して、前記演算式を実 行する実行部と、算出された算出値と同一の選択識別子が前記記憶部に記憶され ているカゝ否かを判断する判断部と、判断結果が否定的である場合には、前記選択さ れた 1つの値を、前記 1つのブロックに対する前記定数値と決定し、前記 1つのブロッ クを算出された算出値が示す選択対象データに格納する格納部と、判断結果が肯 定的である場合には、前記定数値が決定され、 1つのブロックが選択対象データに 格納されるまでの間、前記実行部と前記判断部とによる処理を繰り返すように制御す る繰返制御部とを備え、前記選択対象データ生成手段による処理は、全てのブロック に対して実行されるとしてちょ 、。
[0016] この構成によると、プログラム変換装置は、更新処理命令群の演算式を用いて、次 のブロックを格納する選択対象データを決定する場合に、これまでに格納されて!ヽな い選択対象データとなるように、前記複数の選択パラメータを更新することができる。 これにより、生成された秘密保持プログラムは、複数の選択パラメータを用いた演算 式により次に実行するべきブロックを確実に決定することができるので、オリジナルプ ログラムと同等の機能を提供することができる。
[0017] ここで、前記選択処理命令群生成手段は、未実行である選択対象データを示す識 別子を、常に取得する選択処理命令群を生成するとしてもよい。
この構成〖こよると、プログラム変換装置にて生成された秘密保持プログラムは、未実 行であるブロックを含む選択対象データを、常に取得することができる。また、秘密保 持プログラムは、選択処理命令群により、常に異なる選択対象データを次に実行す べき選択対象データとしているので、不正解析者は、正しい実行順序を特定すること が困難となる。
[0018] ここで、前記選択処理命令群生成手段は、未実行である選択対象データを示す識 別子を、前記複数の選択対象データのそれぞれにつ!、て実行済であるか否かを示 す管理情報を用いて取得する選択処理命令群を生成するとしてもよ ヽ。
この構成〖こよると、プログラム変換装置にて生成された秘密保持プログラムは、管理 情報を用いて、未実行であるブロックを含む選択対象データを、常に取得することが できる。
[0019] ここで、前記複数の選択パラメータは、第 1から第 nの選択パラメータであり、前記管 理情報は、前記複数の選択対象データのそれぞれに対して、現時点における実行 済若しくは未実行の 、ずれかの状態を示す配列テーブルであり、前記選択対象デ ータの個数は、前記ブロックの個数以上力 なる所定の数であり、前記選択処理命 令群生成手段は、前記配列テーブルと、前記第 1から第 nの選択パラメータのそれぞ れに対して、 Pi X第 iの選択パラメータ (iは 1以上 n以下の整数)を算出し、算出した 結果それぞれを加算し、加算結果に、前記所定の数をモジュロ値 Nとするモジュロ演 算を施し、次に実行すべきブロックを含む選択対象データを示す仮の選択識別子を 算出する前記演算式と、前記算出式にて算出された前記仮の選択識別子が示す選 択対象データが、前記配列テーブルにおいて未実行であることを示す場合には、前 記仮の選択識別子を次に実行すべきブロックを含む選択対象データを示す真の選 択識別子とし、実行済であることを示す場合には、未実行である選択対象データを取 得するまで予め決められた選択順序に基づき仮の選択識別子の取得を行う取得プロ グラム命令群とを生成し、前記選択処理命令群は、前記配列テーブルと、前記演算 式と、前記取得プログラム命令群とを含み、 Piとモジュロ値 Nとは互いに素であるとし てもよい。
[0020] この構成によると、プログラム変換装置にて生成された秘密保持プログラムは、配列 テーブルを用いて、未実行であるブロックを含む選択対象データを確実に取得する ことができる。
ここで、前記更新処理命令群生成手段は、第 j (jは 2以上 n以下の整数)の選択パラ メータに格納されて 、る値を第 j - 1の選択パラメータへ格納し、前記選択処理命令 群にて取得された前記真の選択識別子を第 nの変数へ格納する前記更新処理命令 群を生成するとしてもよい。
[0021] この構成によると、プログラム変換装置にて生成された秘密保持プログラムは、選択 パラメータの更新の際には、常に、選択パラメータの値に、過去に処理された選択対 象データを示す選択識別子、又は前記演算式に過去に代入された 1以上の選択パ ラメータの値のうち少なくとも 1の選択パラメータの値を反映させているので、複数の 選択パラメータに格納される値は特定されに《なる。
[0022] ここで、前記演算式は、 1つの選択パラメータを示すインデックスを用いて、前記複 数の選択パラメータ力 前記 1つのパラメータを取得する第 1取得プログラム命令群 であり、前記管理情報は、前記複数の選択対象データのそれぞれに対して、現時点 における実行済若しくは未実行のいずれかの状態を示す配列テーブルであり、前記 選択処理命令群生成手段は、前記第 1取得プログラム命令群と、前記配列テーブル と、前記配列テーブルのうち未実行である 1つ以上の選択対象データを示す選択識 別子の配列順序に基づ 、て、前記取得プログラム命令群にて取得されたパラメータ の値にて示される順序に配置された選択識別子を取得する第 2取得プログラム命令 群とを生成し、前記選択処理命令群は、前記第 1取得プログラム命令群と、前記配列 テーブルと、前記第 2取得プログラム命令群とを含むとしてもよ 、。
[0023] この構成によると、プログラム変換装置にて生成された秘密保持プログラムは、イン デッタスを用いて、次に実行する選択対象データを示す選択識別子を取得すること ができる。
ここで、前記更新処理命令群生成手段は、前記インデックスの値をインクリメントす る前記更新処理命令群を生成するとしてもよ ヽ。
[0024] この構成によると、プログラム変換装置にて生成された秘密保持プログラムは、イン デッタスの更新をする。不正解析者が、ある 1のブロックを知ったとしても、インデック スの値が分力 ないため、次に実行すべきブロックが特定されることはない。そのため 、不正解析者がオリジナルプログラムの解析を容易にすることができな 、。
ここで、前記選択対象データの個数は、前記ブロックの個数以上力 なる所定の数 であり、前記複数の選択パラメータは、第 1から第 nのパラメータであり、前記管理情 報は、前記複数の選択対象データのそれぞれに対して、現時点における実行済若し くは未実行のいずれかの状態を示す配列テーブルであり、前記選択処理命令群生 成手段は、前記配列テーブルと、前記第 1から第 nの選択パラメータのそれぞれに対 して、 PiX第 iの選択パラメータ (iは 1以上 n以下の整数)を算出し、算出した結果そ れぞれを加算し、加算結果に、前記所定の数をモジュロ値 Nとするモジュロ演算を施 し、次に実行すべきブロックを含む選択対象データを示す値を算出する前記演算式 と、前記配列テーブルと同一のテーブルテーブル内において、未実行である 1っ以 上の選択対象データを示す選択識別子の配列順序に基づ!/、て、前記演算式にて算 出された前記値にて示される順序に配置された選択識別子を取得する取得プロダラ ム命令群とを生成し、前記選択処理命令群は、前記配列テーブルと、前記演算式と 、前記取得プログラム命令群とを含むとしてもよい。
[0025] この構成によると、プログラム変換装置にて生成された秘密保持プログラムは、未実 行であるブロックを含む選択対象データを確実に取得することができる。また、秘密 保持プログラムは、選択処理命令群により、常に異なる選択対象データを次に実行 すべき選択対象データとしているので、不正解析者は、正しい実行順序を特定する ことが困難となる。
ここで、前記選択対象データの個数は、前記ブロックの個数以上力 なる所定の数 であり、前記秘密保持プログラム生成手段は、さらに、前記複数のブロックのそれぞ れが選択対象データに含まれた後、ブロックを含まない 1つ以上の選択対象データ に、 1つ以上のプログラム命令を含む偽装ブロックを挿入するとしてもよい。
[0026] この構成によると、プログラム変換装置にて生成された秘密保持プログラムは、偽装 ブロックを含むので、不正解析者の解析を困難にすることができる。
また、本発明は、処理順序が定まった複数の選択対象データを処理することにより 、秘匿すべき秘密処理を実行する秘密処理装置であって、複数の選択パラメータの それぞれに値を代入する前処理実行手段と、前記複数の選択パラメータを用いた演 算式に基づ ヽて、次に処理される選択対象データを示す選択識別子を取得する選 択処理実行手段と、選択パラメータの値に、過去に処理された選択対象データを示 す選択識別子、又は前記選択パラメータに過去に代入された 1つ以上の選択パラメ ータの値のうち少なくとも 1つの選択パラメータの値を反映させる更新処理実行手段 と、前記選択処理実行手段にて取得された選択識別子が示す選択対象データを処 理する選択対象データ実行手段とを備え、前記秘密保持プログラムの終了とみなす まで、前記選択処理実行手段と、更新処理命令実行手段と、選択対象データ実行手 段とによる処理を繰り返すことを特徴とする。
[0027] この構成によると、秘密処理装置は、演算式の前記複数の選択パラメータを更新す る際に、選択パラメータの値に、過去に処理された選択対象データを示す選択識別 子、又は前記演算式に過去に代入された 1以上の選択パラメータの値のうち少なくと も 1の選択パラメータの値を反映させている。従来は、次に実行すべきブロックを決定 する際には、複数の固定値が格納された配列を用いていたが、本発明の秘密処理 装置は、次に実行すべき選択対象データを決定した後、常に、演算式に用いる選択 ノ メータを更新するので、複数の選択パラメータに格納される値は特定されに《な る。そのため、不正解析者が秘密処理の解析を容易にすることができない。
[0028] ここで、前記複数の選択対象データのそれぞれは、 1個以上のデータからなるとし てもよい。
この構成によると、秘密処理装置は、選択対象データをデータとして扱うことができ る。
ここで、前記秘密処理は、秘匿すべき秘密情報を用いる代わりに、所定の処理を施 して前記秘密情報を算出する処理であり、前記選択処理実行手段は、前記複数の 選択パラメータを用いる演算式により前記選択識別子を算出し、前記更新処理実行 手段は、前記選択識別子にて示される選択対象データの値に基づいて、前記複数 の選択パラメータを更新し、前記秘密処理装置は、さらに、更新した複数の選択パラ メータを用いた前記所定の処理により、前記秘密情報と同一の値を算出する変遷処 理実行手段を備えるとしてもよい。
[0029] この構成によると、秘密処理装置は、秘密情報と同一の値を算出する方法を隠匿し ているので、不正解析者は、秘密情報を解析することが困難となる。
ここで、前記秘密処理は、外部装置により 1つ以上のブロックに分割されたオリジナ ルプログラムを実行する処理であり、前記ブロックは 1つ以上のプログラム命令を含み
、前記複数の選択対象データのそれぞれは、異なるブロックを含むとしてもよい。
[0030] この構成〖こよると、秘密処理装置は、選択対象データをオリジナルプログラムから分 割されたブロックとして扱うことができる。
ここで、前記複数の選択パラメータは、第 1から第 nの選択パラメータであり、前記更 新処理実行手段は、前記複数の選択対象データのそれぞれに対して、第 j l (jは 2 以上 n以下の整数)の選択パラメータに格納されている値を第 jの選択パラメータへ格 納し、定数値を第 1の選択パラメータに格納し、前記定数値は、前記演算式を用いて
、次に実行される選択対象データを示す選択識別子が算出されるように、前記外部 装置が前記秘密保持プログラム生成時に予め設定した値であるとしてもよい。
[0031] この構成によると、秘密処理装置は、前記演算式に過去に代入された 1以上の選 択パラメータの値のうち少なくとも 1の選択パラメータの値を反映させて前記複数の選 択パラメータの値を更新することができる。
ここで、前記選択対象データの個数は、前記ブロックの個数以上力 なる所定の数 であり、前記演算式は、前記第 1から第 nの選択パラメータのそれぞれに対して、 Pi X 第 iの選択パラメータ (iは 1以上 n以下の整数)を算出し、算出した結果それぞれを加 算し、加算結果に、前記所定の数をモジュロ値 Nとするモジュロ演算を施し、選択識 別子を算出し、 Piとモジュロ値 Nとは、互いに素であるとしてもよい。
[0032] この構成〖こよると、秘密処理装置は、演算式により、選択対象データを確実に決定 することができる。
ここで、前記選択処理実行手段は、未実行である選択対象データを示す識別子を 、常に取得するとしてもよい。
この構成〖こよると、秘密処理装置は、未実行であるブロックを含む選択対象データ を、常に取得することができる。また、秘密処理装置にて実行される秘密処理は、常 に異なる選択対象データを次に実行すべき選択対象データとしているので、不正解 析者は、正しい実行順序を特定することが困難となる。
[0033] ここで、前記選択処理実行手段は、未実行である選択対象データを示す識別子を 、前記複数の選択対象データのそれぞれにつ!、て実行済であるか否かを示す管理 情報を用いて取得するとしてもよ 、。
この構成〖こよると、秘密処理装置は、管理情報を用いて、未実行であるブロックを含 む選択対象データを、常に取得することができる。
[0034] ここで、前記複数の選択パラメータは、第 1から第 nの選択パラメータであり、前記選 択対象データの個数は、前記ブロックの個数以上力 なる所定の数であり、前記管 理情報は、前記複数の選択対象データのそれぞれに対して、現時点における実行 済若しくは未実行の!/、ずれの状態を示す配列テーブルであり、前記選択処理実行 手段は、前記配列テーブルを保持し、前記演算式は、前記第 1から第 nの選択パラメ ータのそれぞれに対して、 Pi X第 iの選択パラメータ (iは 1以上 n以下の整数)を算出 し、算出した結果それぞれを加算し、加算結果に、前記所定の数をモジュロ値 Nとす るモジュロ演算を施し、次に実行すべきブロックを含む選択対象データを示す仮の選 択識別子を算出する演算式であり、前記選択処理実行手段は、前記算出式にて算 出された前記仮の選択識別子が示す選択対象データが、前記配列テーブルにお ヽ て未実行であることを示す場合には、前記仮の選択識別子を次に実行すべきブロッ クを含む選択対象データを示す真の選択識別子とし、実行済であることを示す場合 には、未実行である選択対象データを取得するまで予め決められた選択順序に基づ き仮の選択識別子の取得を行 、、 Piとモジュロ値 Nとは互いに素であるとしてもょ 、。
[0035] この構成〖こよると、秘密処理装置は、配列テーブルを用いて、未実行であるブロック を含む選択対象データを確実に取得することができる。
ここで、前記更新処理実行手段は、第 j (jは 2以上 n以下の整数)の選択パラメータ に格納されて 、る値を第 j 1の選択パラメータへ格納し、前記選択処理実行手段に て取得された前記真の選択識別子を第 nの変数へ格納するとしてもよい。
[0036] この構成によると、秘密処理装置は、選択パラメータの更新の際には、常に、選択 パラメータの値に、過去に処理された選択対象データを示す選択識別子、又は前記 演算式に過去に代入された 1以上の選択パラメータの値のうち少なくとも 1の選択パ ラメータの値を反映させて 、るので、複数の選択パラメータに格納される値は特定さ れにくくなる。
ここで、前記管理情報は、前記複数の選択対象データのそれぞれに対して、現時 点における実行済若しくは未実行の 、ずれの状態を示す配列テーブルであり、前記 選択処理実行手段は、前記配列テーブルを保持し、 1つの選択パラメータを示すィ ンデッタスを用いて、前記複数の選択パラメータ力 前記 1の選択パラメータを取得 する前記演算式を実行する第 1取得部と、前記配列テーブルのうち未実行である 1つ 以上の選択対象データを示す選択識別子の配列順序に基づ!/ヽて、前記第 1取得部 にて取得された選択パラメータの値にて示される順序に配置された選択識別子を取 得する第 2取得部とを含むとしてもよ 、。 [0037] この構成〖こよると、秘密処理装置は、インデックスを用いて、次に実行する選択対象 データを示す選択識別子を取得することができる。
ここで、前記更新処理実行手段は、前記インデックスの値をインクリメントするとして ちょい。
この構成〖こよると、秘密処理装置は、インデックスの更新をする。不正解析者が、あ る 1のブロックを知ったとしても、インデックスの値が分からないため、次に実行すべき ブロックが特定されることはない。そのため、不正解析者がオリジナルプログラムの解 析を容易にすることができな 、。
[0038] ここで、前記選択対象データの個数は、前記ブロックの個数以上力 なる所定の数 であり、前記複数の選択パラメータは、第 1から第 nのパラメータであり、前記管理情 報は、前記複数の選択対象データのそれぞれに対して、現時点における実行済若し くは未実行の 、ずれの状態を示す配列テーブルであり、前記選択処理実行手段は、 前記配列テーブルを保持し、前記演算式は、前記第 1から第 nの選択パラメータのそ れぞれに対して、 PiX第 iの選択パラメータ (iは 1以上 n以下の整数)を算出し、算出 した結果それぞれを加算し、加算結果に、前記所定の数をモジュロ値 Nとするモジュ 口演算を施し、次に実行すべきブロックを含む選択対象データを示す仮の選択識別 子を算出する演算式であり、前記選択処理実行手段は、前記配列テーブルと同一の テーブルテーブル内にぉ ヽて、未実行である 1つ以上の選択対象データを示す選択 識別子の配列順序に基づいて、前記演算式にて算出された前記値にて示される順 序に配置された選択識別子を取得するとしてもよ ヽ。
[0039] この構成〖こよると、秘密処理装置は、未実行であるブロックを含む選択対象データ を確実に取得することができる。また、秘密処理装置にて実行される秘密処理は、常 に異なる選択対象データを次に実行すべき選択対象データとしているので、不正解 析者は、正しい実行順序を特定することが困難となる。
ここで、前記秘密処理は、前記外部装置により前記オリジナルプログラムから生成さ れた秘密保持プログラムを実行する処理であり、前記選択対象データの個数は、前 記ブロックの個数以上からなる所定の数であり、ブロックを含まない 1つ以上の選択対 象データには、 1つ以上のプログラム命令を含む偽装ブロックが含まれ、前記秘密保 持プログラムは、前記オリジナルプログラムより分割された各ブロックと、 1つ以上の偽 装ブロックとを含むとしてもよ 、。
[0040] この構成〖こよると、秘密処理装置にて実行される秘密保持プログラムは、偽装プロ ックを含むので、不正解析者の解析を困難にすることができる。
図面の簡単な説明
[0041] [図 1]秘密保持システム 1の構成を示すブロック図である。
[図 2]秘密保持プログラム 100の構造を示す図である。
[図 3]秘密保持プログラム 100の具体的なプログラムを示す図である。
[図 4]秘密保持プログラム 100を正常系で実行した場合の処理の動作を示す流れ図 である。
[図 5]プログラム難読ィ匕装置 10の構成を示すブロック図である。
[図 6]秘密保持プログラム生成部 203の構成を示すブロック図である。
[図 7]プログラム難読ィ匕装置 10の動作概要を示す流れ図である。
[図 8]選択対象データの生成処理の動作を示す流れ図である。図 9に続く。
[図 9]選択対象データの生成処理の動作を示す流れ図である。図 8から続く。
[図 10]秘密保持システム 2の構成を示すブロック図である。
[図 11]秘密保持プログラム 300の構造を示す図である。
[図 12]秘密保持プログラム 300を正常系で実行した場合の処理の動作を示す流れ 図である。
[図 13]プログラム難読ィ匕装置 30の構成を示すブロック図である。
[図 14]プログラム難読ィ匕装置 30の動作概要を示す流れ図である。
[図 15]秘密保持システム 3の構成を示すブロック図である。
[図 16]秘密保持プログラム 500の構造を示す図である。
[図 17]難読対象プログラムのコントロールフローを示す図である。
[図 18]秘密保持プログラム 500の各ブロックを模式的に記述した図である。
[図 19]秘密保持プログラム 500の具体的なプログラムを示す図である。
[図 20]秘密保持プログラム 500の各ブロックを C言語で記述した具体例を示す図であ る。 [図 21]秘密処理装置 60の構成を示すブロック図である。
[図 22]管理情報テーブル T700のデータ構造の一例を示す図である。
[図 23]制御部 700の構成を示すブロック図である。
[図 24]秘密処理装置 60の動作を示す流れ図である。
[図 25]プログラム難読ィ匕装置 50の構成を示すブロック図である。
[図 26]配置順序決定部 804の構成を示すブロック図である。
圆 27]プログラム難読ィ匕装置 50の動作概要を示す流れ図である。
[図 28]配置決定処理の動作を示す流れ図である。
圆 29]初期値算出処理の動作を示す流れ図である。
圆 30]機能提供命令群 1〜3の実行順序を示す図である。
[図 31]選択処理部 722bの構成を示すブロック図である。
圆 32]選択識別子取得処理の動作を示す流れ図である。
[図 33]難読ィ匕対象プログラムのコントロールフローを示す図である。
[図 34]プログラム難読ィ匕装置 50cの構成を示すブロック図である。
[図 35]図 33に示すコントロールフローを、生成した 3つの機能提供命令群に置き換え たコントロールフローを示す図である。
[図 36]各機能提供命令群を展開したプログラムのコントロールフローを示す図である
[図 37]配置順序決定部 804cの構成を示すブロック図である。
[図 38]秘密保持プログラム 1800の構造を示す図である。
[図 39]配置順序決定部 804dの動作を示す流れ図である。
[図 40]秘密保持プログラム 500eの各ブロックを C言語で記述した具体例を示す図で ある。
[図 41]秘密保持プログラム 2000の構造を示す図である。
[図 42]秘密保持プログラム 2000の動作の具体例を示す流れ図である。
[図 43]プログラム難読ィ匕装置 1010の構成を示すブロック図である。
[図 44]配置決定処理の動作を示す流れ図である。
[図 45]秘密保持プログラム 2200の構造を示す図である。 [図 46]秘密保持プログラム 2200の動作の具体例を示す流れ図である。
[図 47]プログラム難読ィ匕装置 3010の構成を示すブロック図である。
[図 48]配置決定処理の動作を示す流れ図である。
符号の説明
1 秘密保持システム
10 プログラム難読ィ匕装置
20 プログラム実行装置
100 秘密保持プログラム
200 入力部
201 機能提供命令群生成部
202 偽装機能提供命令群生成部
203 秘密保持プログラム生成部
2 秘密保持システム
30 プログラム難読ィ匕装置
40 プログラム実行装置
300 秘密保持プログラム
400 入力部
401 機能提供命令群生成部
402 変遷処理命令群生成部
403 秘密保持プログラム生成部
3 秘密保持システム
50 プログラム難読ィ匕装置
60 秘密処理装置
500 秘密保持プログラム
700 制御部
701 n己' 1思 ρβ
702 第 1プログラム記憶部
703 第 2プログラム記憶部 704 管理情報保持部
705 選択パラメータ群保持部
800 プログラム記憶部
801 入力部
802 機能提供命令群生成部
803 偽装機能提供命令群生成部
804 配置順序決定部
805 管理命令群生成部
806 秘密保持プログラム生成部
807 出力部
1010 プログラム難読ィ匕装置
1020 秘密処理装置
2000 秘密保持プログラム
2200 秘密保持プログラム
3010 プログラム難読ィ匕装置
3020 秘密処理装置
発明を実施するための最良の形態
[0043] 1.第 1の実施の形態
以下、本発明に係る第 1の実施の形態としての秘密保持プログラム 100及びプログ ラム難読ィ匕装置 10について、図面を参照して説明する。
1. 1 秘密保持システム 1の概要
秘密保持システム 1は、図 1に示すように、プログラム難読化装置 10と、プログラム 実行装置 20とから構成されて ヽる。
[0044] プログラム難読ィ匕装置 10は、実行順序を秘密にしたい難読ィ匕対象プログラムから 秘密保持プログラム 100を生成し、生成した秘密保持プログラム 100をプログラム実 行装置 20へ配布する。
プログラム実行装置 20は、プログラム難読ィ匕装置 10から配布された秘密保持プロ グラム 100を実行する。 [0045] ここで、難読化対象プログラムは、命令群 A、命令群 B、命令群 Cの 3つの命令群か ら構成されており、命令群 A、 B、 Cの順に実行することにより正しく動作するものとす る。
1. 2 秘密保持プログラム 100の構造
ここでは、プログラム難読ィ匕装置 10にて生成され、プログラム実行装置 20にて実行 される秘密保持プログラム 100のプログラム構造について説明する。
[0046] 秘密保持プログラム 100は、秘密の要素を使用して処理を行うプログラムであり、プ ログラムに含まれるプログラム命令群がどのような実行順序で実行されるかを、不正 解析者に解析されたくないプログラムである。例えば、ウォーターマーク検出プロダラ ムゃ、非特許文献 1で述べられている方法で、秘密情報を扱うプログラム命令を別の プログラム命令群に置き換えて、それらを分散して配置したプログラムである。後者に ついては、置き換えたプログラム命令群を不正解析者が収集し、正しい順番で実行 すれば秘密情報の値が算出できるので、実行経路を分力り難くしたい。
[0047] 秘密保持プログラム 100は、おおまかにはプログラムに含まれる複数の選択対象デ ータ 140〜 146がどのような実行順序で実行されるかが解析困難なプログラムである 。なお、選択対象データ 140〜146には、正常系の実行時には実行されることのな い選択対象データも含まれている。実行されることのない選択対象データは、正しい 実行順序を知らな ヽ不正解析者が、考えうる実行順序の組み合わせ数を多くするた めに組み込まれている。ここで、正常系の実行とは、デバッガ等を用いてプログラム力 ゥンタや選択パラメータを強制的に変更するなどの特別な操作を行わないで処理を することである。秘密保持プログラム 100は、図 2に示すように、前処理命令群 110、 選択処理命令群 120、変遷処理命令群 130、選択対象データ 140、 141、 · · ·、 146 から構成され、これらが図 2に示す順番に配置されている。
[0048] 秘密保持プログラム 100は、呼出元のプログラムから、 32ビットの入力値 inl、 in2、 in3、および、このプログラムが提供する機能の処理を行う際に使用するパラメータを 受け取る。
秘密保持プログラム 100は、選択処理命令群 120での処理に用いる複数の選択パ ラメータの各値 (ここでは、 3つの値)を保持する 32ビットの第 1、第 2及び第 3の選択 パラメータ用変数と、選択識別子を保持する 32ビットの選択識別子用変数を用いて 処理を行う。ここで、選択パラメータは、選択対象データ 140、 141、 · · ·、 146から 1 の選択対象を決定する際に、使用されるパラメータであり、選択識別子は、選択対象 データを一意に識別する識別子である。
[0049] ここでは、秘密保持プログラム 100が実際に使用される際に呼出元のプログラムか ら受け取る入力値 inl、in2、in3は値「1」、「2」、「3」であるとする。本実施の形態で 提供する秘密保持プログラム 100は、呼出元のプログラム力も受け取る値を用いれば 、(選択対象主要命令群を含む)選択対象データを正 ヽ順番に実行できるプロダラ ムであって、呼出元のプログラム力 受け取る値を知ることができな 、不正解析者に とっては、(選択対象主要命令群を含む)選択対象データの実行順序を知ることが困 難なプログラムである。
[0050] 1. 2. 1 前処理命令群 110
前処理命令群 110は、選択処理命令群 120で用 、る選択パラメータ群の初期値を 算出するプログラム命令群である。ここで、選択パラメータ群は、第 1、第 2及び第 3の 選択パラメータ用変数力もなる。
前処理命令群 110は、秘密保持プログラム 100が起動された際に、最初に実行さ れるプログラム命令群である。
[0051] 前処理命令群 110は、呼び出し元のプログラムから 32ビットの入力値 inl、 in2、 in 3を受け取り、受け取った値を選択パラメータ群の初期値として選択パラメータ用変数 に格納する第 1の前処理プログラム命令群と、選択処理命令群 120に分岐する第 2 の前処理プログラム命令群とからなり、これらを順に行う。
具体的には、第 1の前処理プログラム命令群は、第 1〜3の選択パラメータ用変数 にそれぞれ、 inl、 in2、 in3の値を格納する。正常系の実行時には、第 1の前処理プ ログラム命令群は、入力値 inl、in2、in3として、それぞれ値「1」、「2」、「3」を受け取 り、第 1〜3の選択パラメータ用変数にそれぞれ値「1」、「2」、「3」を格納する処理を 行う。
[0052] 第 2の前処理プログラム命令群は、例えば、 C言語で記述されるプログラムにお 、て 選択処理命令群 120の先頭にラベル「label 120 :」が挿入されている場合には、プ ログラム命令「goto label— 120;」で表されるプログラム命令である。
なお、前処理命令群 110の直後に選択処理命令群 120が配置されている場合に は、プログラム命令「goto label— 120;」がなくても構わな!/ヽ。この場合、前処理命 令群 110は、第 1の前処理プログラム命令群のみ力も構成されることになる。
[0053] 1. 2. 2 選択処理命令群 120
選択処理命令群 120は、選択パラメータ群に基づき、選択対象データ 140〜146 から 1つを選択し選択識別子とするプログラム命令群である。
選択処理命令群 120は、選択パラメータ群を用いて、選択識別子を算出する第 1の 選択処理プログラム命令群と、変遷処理命令群 130に分岐する第 2の選択処理プロ グラム命令群力 なり、これらを順に行う。なお、選択識別子は後述の変遷処理命令 群で使用する値である。
[0054] 第 1の選択処理プログラム命令群について、具体例を用いて、以下に説明する。第 1の選択処理プログラム命令群は、 pi X (第 1の選択パラメータ用変数) +p2 X (第 2 の選択パラメータ用変数) +p3 X (第 3の選択パラメータ用変数) mod NNを算出 し、算出した値を選択識別子用変数に格納するプログラム命令の集まりである。 NN は選択対象データの数とする。また、 pl、 p2、 p3は、それぞれ NNと互いに素な素数 であって、 NNを法とした場合にそれぞれ異なる値となる数とする。なお、 NNを素数 とし、 pl、 p2、 p3をそれぞれ NN未満の互いに異なる素数としてもよい。ここで演算 子「X」は掛け算を表す。ここでは、 pl、 p2、 p2、 NNをそれぞれ、値「2」、「3」、「5」、 「7」とし、式 1「2 X (第 1の選択パラメータ用変数) + 3 X (第 2の選択パラメータ用変 数) + 5 X (第 3の選択パラメータ用変数) MOD 7」を算出するプログラム命令群で あるとする。
[0055] なお、変遷処理命令群 130に分岐するプログラム命令群については、前処理命令 群 110で述べた第 2の前処理プログラム命令群と同様で、分岐先が変遷処理命令群 130になったものである。
1. 2. 3 変遷処理命令群 130
変遷処理命令群 130は、選択処理命令群 120で算出した選択識別子に基づき、 いずれかの選択対象データ 140〜 146に分岐する処理を行うプログラム命令群であ る。
[0056] 具体的には、選択識別子用変数の値が、 0、 1、 · · ·、 6の場合にそれぞれ、選択対 象データ 140、 141、 · · ·、 146への分岐を行うプログラム命令群である。
例えば、秘密保持プログラム 100が記述されるプログラムが C言語のプログラムとし 、選択対象データ 140、 141、 · · ·、 146の先頭に、それぞれラベル「label— 140 :」、 「label— 141 :」、 · · ·、「label— 146 :」があるとすると、変遷処理命令群 130は以下 のようなプログラム命令となる。
[0057] 「
switch (選択識別子用変数) {
case 0 : goto label― 140 ;
case 1 : goto label― 141; case 6: goto label― 146; J
1. 2. 4 選択対象データ 140〜146
選択対象データ 140〜146は、変遷処理命令群 130により分岐してきた際に、実 行されるプログラム命令群である。
[0058] 選択対象データ 140〜146は、それぞれ、選択対象主要命令群 150〜156、更新 処理命令群 160〜166、分岐命令群 170〜176からなり、これらは図 2に示す順番 に配置されている。各命令群は、 1以上のプログラム命令力もなるプログラム命令群 である。
ここでは、選択対象データ 140の構成内容について説明する。なお、選択対象デ ータ 141〜146については、選択対象データ 140の構成内容と同様であるため、説 明は省略する。
[0059] ( 1 )選択対象主要命令群 150
選択対象主要命令群 150は、このプログラムが提供する機能 (例えばウォーターマ ーク検出の機能)の処理の一部を行うプログラム命令群である力、あるいは、提供す る機能とは無関係であり、正常系での実行時 (以降、正常系の実行時)には実行され ない命令群である。
[0060] 本実施例では、正常系の実行時には、選択対象主要命令群 152、 154、 156の順 番で実行されることで、この秘密保持プログラムが提供する機能の処理を行う。すな わち、選択対象主要命令群 152、 154、 156は、難読化対象プログラムが提供する 機能の処理の一部を含むプログラム命令群であり、選択対象主要命令群 152、 154 、 156のそれぞれは、順に命令群 A、 B、 Cと同一のものである。
[0061] また、選択対象主要命令群 150、 151、 153、 155は、提供する機能とは無関係な 処理が含まれるプログラム命令群である。以降の説明では、選択対象主要命令群 15 2、 154, 156の命令群であって、秘密保持プログラムが提供する機能の一部である 命令群をそれぞれ機能提供命令群 1〜3と呼ぶ。また、選択対象主要命令群 150、 1 51、 153、 155に含まれる正常系の実行時には実行されない命令群を偽装機能提 供命令群と呼ぶ。
[0062] 本実施例では、デバッガ等を用いてプログラムカウンタや選択パラメータを強制的 に変更するなどの特別な操作を行わない正常系での実行時 (以降、正常系の実行 時)には、前処理命令群 110で選択パラメータ用変数 1〜3にそれぞれ初期値「1」、「 2」、「3」が格納されて、以降説明する処理に乗っ取って、選択対象主要命令群 152 、 154、 156が順番に実行されることとなる。正確には、途中、更新処理命令群などの 処理が行われている。
[0063] (2)更新処理命令群 160
更新処理命令群 160は、選択パラメータ群の値の更新を行うプログラム命令群であ る。
更新処理命令群 160は、選択パラメータ群の値の更新に用いる定数値を予め有し ている。更新処理命令群 160は、正当な選択パラメータ群を受け取った場合には、 受け取った選択パラメータ群と定数値とを用いて、選択処理命令群 120が次処理とし て正当な選択対象を選択することができる新たな選択パラメータ群を生成する。
[0064] ここで、生成方法の一例を以下に示す。
更新処理命令群 160は、第 2の選択パラメータ用変数の値を第 3の選択パラメータ 用変数に格納し、第 1の選択パラメータ用変数の値を第 2の選択パラメータ用変数に 格納し、選択パラメータ用変数 1に予め有している定数値を代入して、新たな選択パ ラメータを生成する。
[0065] 定数値は、これらの第 1〜第 3の選択パラメータ用変数の値「(定数値)」、「x」、「y」 を選択処理命令群 120の式 1に代入して得られる選択識別子が、これまでに選択さ れた 1以上の選択対象データを示さない値である。もし、これが、これまでに選択され た 1の選択対象データになる値であるとすると、当該選択対象データが連続して無限 ループを行う処理となってしまうからである。
[0066] ここで、更新処理命令群 160〜166のそれぞれが有する定数値の具体例を、以下 に示す。
秘密保持プログラム 100は、上述したように、選択対象主要命令群 152、 154、 15 6の順番で実行されることで、この秘密保持プログラムが提供する機能の処理を行う。
[0067] 選択対象主要命令群 152が実行された後、更新処理命令群 162は、第 2の選択パ ラメータ用変数の値「2」を第 3の選択パラメータ用変数に格納し、第 1の選択パラメ一 タ用変数の値「1」を第 2の選択パラメータ用変数に格納する。このとき、更新処理命 令群 162が有する定数値 Aを「6」とすることで、選択処理命令群 120は、次の正当な 処理として、選択対象データ 144を選択することができる。
[0068] 次に、選択対象主要命令群 154が実行された後、更新処理命令群 164は、第 2の 選択パラメータ用変数の値「1」を第 3の選択パラメータ用変数に格納し、第 1の選択 ノ メータ用変数の値「6」を第 2の選択パラメータ用変数に格納する。このとき、更新 処理命令群 164が有する定数値 Bを「2」とすることで、選択処理命令群 120は、次の 正当な処理として、選択対象データ 146を選択することができる。
[0069] 次に、選択対象主要命令群 156が実行された後、更新処理命令群 166は、第 2の 選択パラメータ用変数の値「6」を第 3の選択パラメータ用変数に格納し、第 1の選択 ノ メータ用変数の値「2」を第 2の選択パラメータ用変数に格納する。このとき、更新 処理命令群 164が有する定数値 Bを「0」とすることで、選択処理命令群 120は、これ までに実行された選択対象データ 142、 144、 146以外の選択対象データを指定す ることがでさる。 [0070] 正常系の動作では実行されることない、選択対象データ 140、 141、 143、 145の 更新処理命令群 160、 161、 163、 165には、値「0」から「6」のうち未使用である値を 重複しないように、選択する。ここでは、更新処理命令群 160、 161、 163、 165のそ れぞれには、値「1」、「3」、「4」、「5」とする。
(3)分岐命令群 170
分岐命令群 170は、選択処理命令群 120へ分岐するプログラム命令群や、プログ ラム呼出元に制御を戻す処理のプログラム命令群である。
[0071] 1. 2. 5 秘密保持プログラム 100の具体例
秘密保持プログラム 100の具体例として、 C言語にて記述した秘密保持プログラム 1 00aを図 3に示す。ここで、演算子「*」は掛け算を表す。
プログラム命令群 11 Oaは前処理命令群 110に対応し、プログラム命令群 120aは 選択処理命令群 120に対応し、プログラム命令群 130aは変遷処理命令群 130に対 応している。また、プログラム命令群 140a、 142a, 143a, 146aのそれぞれは、選択 対象データ 140、 142、 143、 146と対応して!/ヽる。
[0072] プログラム命令群 150a、 152a, 153a, 156aのそれぞれは、選択対象主要命令群 150、 152、 153、 156と対応して!/ヽる。プログラム命令群 160a、 162a, 163a, 166 aのそれぞれは、更新処理命令群 160、 162、 163、 166と対応している。また、プロ グラム命令群 170a、 172a, 173a, 176aのそれぞれは、分岐命令群 170、 172、 17 3、 176と対応している。なお、選択対象データ 141、 144、 145に対応する具体例は 、図面の都合上記述していない。
[0073] 1. 3 秘密保持プログラム 100の実行
プログラム実行装置 20が、秘密保持プログラム 100を正常系で実行した場合の処 理について、図 4に示す流れ図を用いて説明する。
秘密保持プログラム 100は、前処理命令群 110の処理を行う(ステップ S5)。具体 的には、前処理命令群 110は、入力値 inl、 in2、 in3として、それぞれ値「1」、「2」、「 3」を受け取り、第 1〜3の選択パラメータ用変数にそれぞれ値「1」、「2」、「3」を格納 する処理を行い、選択処理命令群 120へ分岐する。
[0074] 次に、秘密保持プログラム 100は、受け取った入力値「1」、「2」、「3」を用いて、選 択処理命令群 120の処理を行う(ステップ S10)。具体的には、選択処理命令群 120 は、式 1「2 X (第 1の選択パラメータ用変数( = 1) ) + 3 X (第 2の選択パラメータ用変 数( = 2) ) + 5 X (第 3の選択パラメータ用変数( = 3) ) MOD 7」により値「2」を算 出し、算出した値「2」を選択識別子用変数に格納し、変遷処理命令群 130へ分岐す る。
[0075] 秘密保持プログラム 100は、選択識別子用変数( = 2)を用いて、変遷処理命令群 130の処理を行う(ステップ S15)。具体的には、変遷処理命令群 130は、選択処理 命令群 120で算出した選択識別子「2」に基づいて、選択対象データ 142に分岐す る。
秘密保持プログラム 100は、変遷処理命令群 130の分岐命令に従って、選択対象 データ 142の選択対象主要命令群 152の処理を行う(ステップ S20)。具体的には、 選択対象主要命令群 152は、難読化対象プログラムにおける命令群 Aを実行する。
[0076] 次に、秘密保持プログラム 100は、更新処理命令群 162の処理を行う (ステップ S2 5)。具体的には、更新処理命令群 162は、第 2の選択パラメータ用変数の値を第 3 の選択パラメータ用変数に格納し、第 1の選択パラメータ用変数の値を第 2の選択パ ラメータ用変数に格納し、第 1の選択パラメータ用変数に定数値 A (=「6」)を代入す る処理を行うプログラム命令群である。ここでは、第 1〜第 3の選択パラメータ用変数 のそれぞれは初期値「1」、「2」、「3」であるので、更新処理命令群 162は、第 1〜第 3 の選択パラメータ用変数のそれぞれに値「定数値 A( = 6)」、「1」、「2」を代入する。
[0077] 次に、秘密保持プログラム 100は、分岐命令群 172の処理を行う (ステップ S30)。
具体的には、分岐命令群 172は、選択処理命令群 120へ分岐する。
次に、秘密保持プログラム 100は、更新された選択パラメータ群 (値「6」、「1」、「2」 )を用いて、選択処理命令群 120の処理を行う (ステップ S35)。具体的には、選択処 理命令群 120は、式 1「2 X (第 1の選択パラメータ用変数( = 6) ) + 3 X (第 2の選択 パラメータ用変数( = 1) ) + 5 X (第 3の選択パラメータ用変数( = 2) ) MOD 7」に より値「4」を算出し、算出した値「4」を選択識別子用変数に格納し、変遷処理命令群 130へ分岐する。
[0078] 秘密保持プログラム 100は、選択識別子用変数(=4)を用いて、変遷処理命令群 130の処理を行う(ステップ S40)。具体的には、変遷処理命令群 130は、選択処理 命令群 120で算出した選択識別子「4」に基づいて、選択対象データ 144に分岐す る。
秘密保持プログラム 100は、変遷処理命令群 130の分岐命令に従って、選択対象 データ 144の選択対象主要命令群 154の処理を行う(ステップ S45)。具体的には、 選択対象主要命令群 154は、難読化対象プログラムにおける命令群 Bを実行する。
[0079] 次に、秘密保持プログラム 100は、更新処理命令群 164の処理を行う(ステップ S5 0)。具体的には、更新処理命令群 164は、第 2の選択パラメータ用変数の値を第 3 の選択パラメータ用変数に格納し、第 1の選択パラメータ用変数の値を第 2の選択パ ラメータ用変数に格納し、第 1の選択パラメータ用変数に定数値 B (=「2」)を代入す る処理を行うプログラム命令群である。ここでは、第 1〜第 3の選択パラメータ用変数 のそれぞれは初期値「6」、「1」、「2」であるので、更新処理命令群 164は、第 1〜第 3 の選択パラメータ用変数のそれぞれに値「定数値 B ( = 2)」、「6」、「1」を代入する。
[0080] 次に、秘密保持プログラム 100は、分岐命令群 174の処理を行う(ステップ S55)。
具体的には、分岐命令群 174は、選択処理命令群 120へ分岐する。
次に、秘密保持プログラム 100は、更新された選択パラメータ群 (値「2」、「6」、「1」 )を用いて、選択処理命令群 120の処理を行う (ステップ S60)。具体的には、選択処 理命令群 120は、式 1「2 X (第 1の選択パラメータ用変数( = 2) ) + 3 X (第 2の選択 パラメータ用変数( = 6) ) + 5 X (第 3の選択パラメータ用変数( = 1) ) MOD 7」に より値「6」を算出し、算出した値「6」を選択識別子用変数に格納し、変遷処理命令群 130へ分岐する。
[0081] 秘密保持プログラム 100は、選択識別子用変数( = 6)を用いて、変遷処理命令群 130の処理を行う(ステップ S65)。具体的には、変遷処理命令群 130は、選択処理 命令群 120で算出した選択識別子「6」に基づいて、選択対象データ 146に分岐す る。
秘密保持プログラム 100は、変遷処理命令群 130の分岐命令に従って、選択対象 データ 146の選択対象主要命令群 156の処理を行う(ステップ S70)。具体的には、 選択対象主要命令群 156は、難読化対象プログラムにおける命令群 Cを実行する。 [0082] 次に、秘密保持プログラム 100は、更新処理命令群 166の処理を行う (ステップ S7 5)。具体的には、更新処理命令群 166は、第 2の選択パラメータ用変数の値を第 3 の選択パラメータ用変数に格納し、第 1の選択パラメータ用変数の値を第 2の選択パ ラメータ用変数に格納し、第 1の選択パラメータ用変数に定数値 C (=「0」)を代入す る処理を行うプログラム命令群である。ここでは、第 1〜第 3の選択パラメータ用変数 のそれぞれは初期値「2」、「6」、「1」であるので、更新処理命令群 164は、第 1〜第 3 の選択パラメータ用変数のそれぞれに値「定数値 C ( = 0)」、「2」、「6」を代入する。
[0083] 次に、秘密保持プログラム 100は、分岐命令群 176の処理を行う(ステップ S80)。
具体的には、分岐命令群 176は、呼出元のプログラムへ制御を返す処理を行う(選 択対象データ 146は、最後に実行される選択対象データなので、選択処理命令群 1 20に分岐する必要はない)。例えば、 C言語のプログラムでは return文がこの処理 に対応する。
[0084] なお、ここでは、動作の主体を秘密保持プログラム 100としている力 実際には、プ ログラム実行装置 20が秘密保持プログラム 100を実行することにより、上記の動作が 実現できる。つまり、動作の主体を、秘密保持プログラム 100からプログラム実行装置 20へと置き換えてもよい。
1. 4 プログラム難読化装置 10
ここでは、実行順序を隠蔽した 、難読ィ匕対象プログラム力も秘密保持プログラム 10 0を生成するプログラム難読化装置 10につ ヽて述べる。秘密保持プログラム 100〖こ おいて、選択対象主要命令群 150〜156に含まれる機能提供命令群および偽装機 能提供命令群以外の各部は、どのような難読化対象プログラムに対しても共通して 用いることができる。ここでは、機能提供命令群の生成、偽装機能提供命令群の生 成について中心に述べる。
[0085] プログラム難読ィ匕装置 10は、図 5に示すように、入力部 200、機能提供命令群生成 部 201と、偽装機能提供命令群生成部 202と、秘密保持プログラム生成部 203とか ら構成されている。
プログラム難読化装置 10は、具体的には、マイクロプロセッサ、 ROM、 RAM、ノヽ ードディスクユニット、ディスプレイユニット、キーボード、マウスなどから構成されるコン ピュータシステムである。前記 RAM又は前記ハードディスクユニットには、コンビユー タプログラムが記憶されている。ここで、コンピュータプログラムは、所定の機能を達成 するために、コンピュータに対する指令を示す命令コードが複数個組み合わされて 構成されたものである。前記マイクロプロセッサ力 前記コンピュータプログラムに従つ て動作することにより、プログラム難読ィ匕装置 10は、その機能を達成する。つまり、前 記マイクロプロセッサは、前記コンピュータプログラムに含まれる各命令を 1個ずつ読 み出し、読み出した命令を解読し、解読結果に従って動作する。
[0086] 1. 4. 1 入力部 200
難読化対象のプログラムと、秘密保持プログラム 100を正常系にて実行する際、秘 密保持プログラム 100に与える 3つの初期値 (ここでは、「1」、「2」、「3」)を受け付け る。
1. 4. 2 機能提供命令群生成部 201
機能提供命令群生成部 201は、入力部 200にて受け付けた難読ィ匕対象プログラム を 1以上のプログラム命令力 なる複数のブロックに分割して複数の機能提供命令群 を生成する。なお、難読化対象プログラムに無条件飛び越し、条件飛び越しが含ま れる場合には、飛び越しを行うプログラム命令と飛び越し先のプログラム命令は同じ ブロックに含まれるように分割を行う。なお、コンパイラに関する用語は被特許文献 2 、 3に述べられている。
[0087] ここでは、分割した各部に含まれる命令数が出来るだけ均等になるように 3つのプロ ックに分割し、 3つの機能提供命令群を生成する。生成した機能提供命令群は、元と なったプログラム命令群が難読ィ匕対象プログラムにおいて始まりの方にあった順に機 能提供命令群 1〜3とする。
1. 4. 3 偽装機能提供命令群生成部 202
偽装機能提供命令群生成部 202は、難読化対象プログラムが記述されて!ヽるプロ グラミング言語で記述された 1以上のプログラム命令をランダムに組み合わせた偽装 機能提供命令群を複数個生成する。
[0088] なお、難読化対象プログラムに含まれて!/、るプログラム命令のみを用いてランダム あるいは手動で偽装機能提供命令群を生成しても構わな ヽ。このよう〖こすることで、 偽装機能提供命令群と難読化対象プログラムに元から含まれている命令とを区別す ることを困難にすることができ、解析を困難にすることができる。また、 C言語、 Java ( 登録商標)言語などのコンパイル処理を行うプログラミング言語にぉ ヽては、偽装機 能提供命令群生成部 202は、コンパイルが通るように難読化対象プログラムで使わ れている変数を用いて偽装機能提供命令群を生成する。または、難読化対象プログ ラムで使われて 、な 、変数を偽装機能提供命令群に含める場合には、偽装機能提 供命令群生成部 202は、難読ィ匕後のプログラムに、そのような変数の宣言を追加す る。なお、 C言語に関する用語、変数の宣言の仕方などについては、公知のプロダラ ミング言語 (C言語)の仕様であるので、ここでの説明は省略する。 Java (登録商標) に関する用語は、変数の宣言の仕方などについては、公知のプログラミング言語 Cia va (登録商標))の仕様であるので、ここでの説明は省略する。ここでは、偽装機能提 供命令群生成部 202は、 4つの偽装機能提供命令群を生成する。
[0089] 1. 4. 4 秘密保持プログラム生成部 203
秘密保持プログラム生成部 203は、複数の機能提供命令群、及び複数の偽装機 能提供命令群を用いて、前処理命令群 110、選択処理命令群 120、変遷処理命令 群 130、選択対象データ 140、 141、 · · ·、 146を生成することにより、秘密保持プロ グラム 100を生成する。
[0090] 秘密保持プログラム生成部 203は、図 6に示すように、プログラム記憶部 210、位置 記憶部 211、ブロック選択部 212、ブロック配置部 213、決定部 214、及び挿入部 21 5を有している。
プログラム記憶部 210は、生成された各命令群及び選択対象データを記憶する領 域を有している。
[0091] 位置記憶部 211は、各選択対象主要命令群が配置された位置を示す情報を記憶 するための領域を有している。例えば、値「2」が位置記憶部 211に格納されている場 合には、選択対象データ 142には、既に、 1の機能提供命令群、又は 1の偽装機能 提供命令群が挿入されて 、ることを示す。
ブロック選択部 212は、難読対象プログラムから、次に配置すべきブロック (機能提 供命令群)を選択する。 [0092] ブロック配置部 213は、式 1を用いて、選択された前記ブロックの配置位置を算出し 、前記中間プログラム内において、算出した前記配置位置に、選択された前記ブロッ クを配置する。
決定部 214は、位置記憶部 211に記憶されて ヽる前記配置位置以外の配置位置 が算出されるように、前記変数に代入すべき代入値を決定する。
[0093] 挿入部 215は、決定された代入値を前記変数に代入するプログラム命令群(更新 処理命令群)を生成し、配置された前記ブロックの直後に、生成した前記プログラム 命令群を挿入する。
(1)前処理命令群 110の生成
秘密保持プログラム生成部 203は、呼び出し元のプログラムから 32ビットの入力値 i nl、 in2、 in3を受け取り、受け取った値を選択パラメータ群の初期値として選択パラ メータ用変数に格納する第 1の前処理プログラム命令群と、選択処理命令群 120に 分岐する第 2の前処理プログラム命令群とからなり、これらを順に行う前処理命令群 1 10を生成する。秘密保持プログラム生成部 203は、生成した前処理命令群 110をプ ログラム記憶部 210に格納する。
[0094] (2)選択処理命令群 120の生成
秘密保持プログラム生成部 203は、選択パラメータ群を用いて、選択識別子を算出 する第 1の選択処理プログラム命令群と、変遷処理命令群 130に分岐する第 2の選 択処理プログラム命令群からなり、これらを順に行う選択処理命令群 120を生成する ここでは、秘密保持プログラム生成部 203は、第 1の選択処理プログラム命令群とし て、式 1「2 X (第 1の選択パラメータ用変数) + 3 X (第 2の選択パラメータ用変数) + 5 X (第 3の選択パラメータ用変数) MOD 7」を算出するプログラム命令群を生成 する。秘密保持プログラム生成部 203は、生成した選択処理命令群 120をプログラム 記憶部 210に格納する。
[0095] (3)変遷処理命令群 130の生成
秘密保持プログラム生成部 203は、選択処理命令群 120で算出した選択識別子に 基づき、選択対象データ 140〜146のうちいずれかの選択対象データに分岐する処 理を行う変遷処理命令群 130を生成する。
具体的には、秘密保持プログラム生成部 203は、機能提供命令群生成部 201にて 生成された複数の機能提供命令群の個数 (ここでは、 3個)と、偽装機能提供命令群 生成部 202にて生成された複数の偽装機能提供命令群の個数 (ここでは、 4個)とを 取得し、その合計値を算出する。秘密保持プログラム生成部 203は、算出した合計 値 (ここでは、 7)と同数のラベル名を生成する。秘密保持プログラム生成部 203は、 選択処理命令群 120に含まれる式 1が取り得る値のそれぞれに対して、分岐先として 、生成したラベル名を対応付けることにより、変遷処理命令群 130を生成する。秘密 保持プログラム生成部 203は、生成した変遷処理命令群 130をプログラム記憶部 21 0に格納する。
[0096] (4)選択対象データ 140、 141、 · · ·、 146の生成
秘密保持プログラム生成部 203は、 3つの初期値と、式 1と、生成した複数の機能提 供命令群及び複数の偽装機能提供命令群とを用いて、複数の機能提供命令群の個 数と、機能提供命令群の個数との合計値と同数の選択対象データを生成する。 以下、具体例を用いて、選択対象データの生成について説明する。
[0097] 秘密保持プログラム生成部 203は、生成した各ラベル名のみ力もなる選択対象デ ータを生成する。ここでは、秘密保持プログラム生成部 203は、 7個の選択対象デー タ 140〜146を生成する。秘密保持プログラム生成部 203は、生成した各ラベル名の み力もなる選択対象データそれぞれをプログラム記憶部 210に格納する。
秘密保持プログラム生成部 203は、機能提供命令群 1を機能提供命令群生成部 2 01から取得する。秘密保持プログラム生成部 203は、入力部 200にて受け取った 3 つの初期値と、式 1とを用いて、取得した機能提供命令群 1を挿入する選択対象デ ータを決定する。ここでは、 3つの初期値(「1」、「2」、「3」)と式 1とから値「2」が算出 されるので、秘密保持プログラム生成部 203は、機能提供命令群 1を、プログラム記 憶部 210に格納されている選択対象データ 142に挿入する。秘密保持プログラム生 成部 203は、位置記憶部 211に「2」を格納する。
[0098] 秘密保持プログラム生成部 203は、選択対象データ 142に挿入する更新処理命令 群 162を生成する。ここでは、秘密保持プログラム生成部 203は、第 2の選択パラメ ータ用変数の値「2」を第 3の選択パラメータ用変数に格納し、第 1の選択パラメータ 用変数の値「1」を第 2の選択パラメータ用変数に格納する。秘密保持プログラム生成 部 203は、第 1〜第 3の選択パラメータ用変数の値「(定数値 A)」、「1」、「2」を式 1に 代入して得られる値が、これまでに選択された 1以上の選択対象データを示さな!/ヽ値 となるように、位置記憶部 211に格納されている 1つ以上の値を用いて、定数値 Aとし て、「6」を取得する。なお、取得方法については後述する。秘密保持プログラム生成 部 203は、取得した定数値 A (=「6」)を含み、選択パラメータ群の値の更新を行う更 新処理命令群 162を生成し、生成した更新処理命令群をプログラム記憶部 210に格 納されている選択対象データ 142に挿入する。
[0099] 秘密保持プログラム生成部 203は、選択対象データ 142に挿入する分岐命令群 1 72を生成し、生成した分岐命令群 172を選択対象データ 142に挿入する。ここでは 、秘密保持プログラム生成部 203は、選択処理命令群 120へ分岐する分岐命令群 1 72を生成し、生成した分岐命令群 172をプログラム記憶部 210に格納されている選 択対象データ 142に挿入する。これにより、秘密保持プログラムを構成する選択対象 データ 142が生成されることになる。
[0100] 秘密保持プログラム生成部 203は、機能提供命令群 2を機能提供命令群生成部 2 01から取得する。秘密保持プログラム生成部 203は、選択パラメータ群(「定数値 A ( = 6)」、「1」、「2」)と、式 1とを用いて、取得した機能提供命令群 2を挿入する選択対 象データを決定する。ここでは、 3つの初期値(「6」、「1」、「2」)と式 1とから値「4」が 算出されるので、秘密保持プログラム生成部 203は、機能提供命令群 2をプログラム 記憶部 210に格納されて ヽる選択対象データ 144に挿入する。秘密保持プログラム 生成部 203は、位置記憶部 211に「4」を格納する。このとき、位置記憶部 211には、 値「2」、「4」が格納されている。
[0101] 秘密保持プログラム生成部 203は、選択対象データ 144に挿入する更新処理命令 群 164を生成する。ここでは、秘密保持プログラム生成部 203は、第 2の選択パラメ ータ用変数の値「1」を第 3の選択パラメータ用変数に格納し、第 1の選択パラメータ 用変数の値「6」を第 2の選択パラメータ用変数に格納する。秘密保持プログラム生成 部 203は、定数値 Bとして、第 1〜第 3の選択パラメータ用変数の値「(定数値 B)」、「 6」、 「1」を式 1に代入して得られる値が、これまでに選択された 1以上の選択対象デ ータを示さな 、値となるように、位置記憶部 211に格納されて 、る 1つ以上の値を用 いて、定数値 Bとして、「2」を取得する。秘密保持プログラム生成部 203は、取得した 定数値 B (=「2」)を含み、選択パラメータ群の値の更新を行う更新処理命令群 164 を生成し、生成した更新処理命令群 164をプログラム記憶部 210に格納されて!、る 選択対象データ 144に挿入する。
[0102] 秘密保持プログラム生成部 203は、選択対象データ 144に挿入する分岐命令群 1 74を生成する。ここでは、秘密保持プログラム生成部 203は、選択処理命令群 120 へ分岐する分岐命令群 174を生成し、生成した分岐命令群 174をプログラム記憶部 210に格納されている選択対象データ 144に挿入する。これにより、秘密保持プログ ラムを構成する選択対象データ 144が生成されることになる。
[0103] 秘密保持プログラム生成部 203は、機能提供命令群 3を機能提供命令群生成部 2 01から取得する。秘密保持プログラム生成部 203は、選択パラメータ群(「定数値 B ( = 2)」、 「6」、 「1」)と、式 1とを用いて、取得した機能提供命令群 3を挿入する選択対 象データを決定する。ここでは、 3つの初期値(「2」、 「6」、 「1」)と式 1とから値「6」が 算出されるので、秘密保持プログラム生成部 203は、機能提供命令群 3をプログラム 記憶部 210に格納されて ヽる選択対象データ 146に挿入する。秘密保持プログラム 生成部 203は、位置記憶部 211に「6」を格納する。このとき、位置記憶部 211には、 値「2」、 「4」、 「6」が格納されている。
[0104] 秘密保持プログラム生成部 203は、選択対象データ 146に挿入する更新処理命令 群 166を生成する。ここでは、秘密保持プログラム生成部 203は、第 2の選択パラメ ータ用変数の値「6」を第 3の選択パラメータ用変数に格納し、第 1の選択パラメータ 用変数の値「2」を第 2の選択パラメータ用変数に格納する。秘密保持プログラム生成 部 203は、定数値 Cとして、第 1〜第 3の選択パラメータ用変数の値「(定数値 C)」、 「 2」、 「6」を式 1に代入して得られる値が、これまでに選択された 1以上の選択対象デ ータを示さな 、値となるように、位置記憶部 211に格納されて 、る 1つ以上の値を用 いて、定数値 Cとして、「0」を取得する。秘密保持プログラム生成部 203は、取得した 定数値 C (=「0」)を含み、選択パラメータ群の値の更新を行う更新処理命令群 166 を生成し、生成した更新処理命令群 166をプログラム記憶部 210に格納されている 選択対象データ 146に挿入する。
[0105] 秘密保持プログラム生成部 203は、選択対象データ 146に挿入する分岐命令群 1 76を生成する。ここでは、秘密保持プログラム生成部 203は、呼出元のプログラムへ 制御を返す処理を行う分岐命令群 176を生成し、生成した分岐命令群 176をプログ ラム記憶部 210に格納されている選択対象データ 146に挿入する。これにより、秘密 保持プログラムを構成する選択対象データ 146が生成されることになる。なお、最後 の機能提供命令群 3 (選択対象主要命令群 156)自体が return文で終わっている場 合には、改めて return文を追加する必要はな 、。
[0106] 次に、秘密保持プログラム生成部 203は、機能提供命令群、又は偽装機能提供命 令群が挿入されていない選択対象データ 140を取得する。秘密保持プログラム生成 部 203は、取得した選択対象データ 140に、選択対象データに挿入されていない 1 以上の偽装機能提供命令群のうち 1の偽装機能提供命令群を挿入する。秘密保持 プログラム生成部 203は、「0」〜「6」のうち定数値として使用されて 、な 、値 (ここで は、「1」)を含み、選択パラメータ群の値の更新を行う更新処理命令群 160を生成し 、生成した更新処理命令群 160を選択対象データ 140に挿入する。
[0107] 秘密保持プログラム生成部 203は、選択対象データ 140に挿入する分岐命令群 1 70を生成する。ここでは、秘密保持プログラム生成部 203は、選択処理命令群 120 へ分岐する分岐命令群 170を生成し、生成した分岐命令群 170を選択対象データ 1 40に挿入する。これにより、秘密保持プログラムを構成する選択対象データ 140が生 成されること〖こなる。
[0108] 選択対象データ 141、 143、 145の生成については、選択対象データ 140の生成 と同様であるので、ここでの説明は省略する。
ここで、機能提供命令群の挿入時における定数値の取得方法にっ 、て説明する。 なお、選択対象データの個数を m個とする。
秘密保持プログラム生成部 203は、「0」から「m— 1」までの整数のうちランダムに 1 の整数「n」を選択し、第 1〜第 3の選択パラメータ用変数の値をそれぞれ、「n」、「第 1の選択パラメータ用変数の値」、「第 2の選択パラメータ用変数の値」として、式 1に 代入して値を算出する。算出した値が位置記憶部 211に存在しない場合には、秘密 保持プログラム生成部 203は、選択した整数「n」を定数値とする。算出した値が位置 記憶部 211に存在する場合には、秘密保持プログラム生成部 203は、「0」から「m— 1」までの整数のうちランダムに 1の整数「n」を、再度選択し、上記の動作を、式 1が位 置記憶部 211に存在しな 、値を算出するまで繰り返す。
[0109] 秘密保持プログラム生成部 203は、全ての機能提供命令群の挿入が終了すると、 複数の偽装機能提供命令群それぞれに、「0」から「m—l」までの整数のうち未使用 である整数を割り当てる。
なお、整数「n」は「0」から「m— 1」までの整数力も選択されたが、これに限定されな い。選択する整数は、 0以上の整数であればよい。この場合、偽装機能提供命令群 の挿入先についても、上記にて示す定数値の算出方法を用 、て決定する。
[0110] (5)秘密保持プログラム 100の生成
秘密保持プログラム生成部 203は、プログラム記憶部 210に格納して 、る前処理命 令群 110、選択処理命令群 120、変遷処理命令群 130、及び選択対象データ 140、 141、 · · ·、 146を図 2に示す順番に配置することにより、秘密保持プログラム 100を 生成する。
[0111] 1. 4. 5 プログラム難読化装置 10の動作
(1)動作概要
ここでは、プログラム難読ィ匕装置 10の動作概要について、図 7にて示す流れ図を用 いて説明する。
プログラム難読ィ匕装置 10の入力部 200は、難読化対象プログラムと、秘密保持プロ グラム 100を正常系にて実行する際、秘密保持プログラムに与える 3つの初期値 (こ こでは、「1」、「2」、「3」)を受け付ける(ステップ S 100)。
[0112] 機能提供命令群生成部 201は、入力部 200にて受け付けた難読ィ匕対象プログラム を 1以上のプログラム命令力 なる複数のブロックに分割して複数の機能提供命令群 を生成する(ステップ S 105)。
偽装機能提供命令群生成部 202は、難読化対象プログラムが記述されて!ヽるプロ グラミング言語で記述された 1以上のプログラム命令をランダムに組み合わせた偽装 機能提供命令群を複数個生成する (ステップ S110)。
[0113] 秘密保持プログラム生成部 203は、呼び出し元のプログラムから 32ビットの入力値 i nl、 in2、 in3を受け取り、受け取った値を選択パラメータ群の初期値として選択パラ メータ用変数に格納する第 1の前処理プログラム命令群と、選択処理命令群に分岐 する第 2の前処理プログラム命令群とからなり、これらを順に行う前処理命令群を生 成する(ステップ S 115)。
[0114] 秘密保持プログラム生成部 203は、選択パラメータ群を用いて、選択識別子を算出 する第 1の選択処理プログラム命令群と、変遷処理命令群に分岐する第 2の選択処 理プログラム命令群からなり、これらを順に行う選択処理命令群を生成する (ステップ S120)。ここでは、秘密保持プログラム生成部 203は、第 1の選択処理プログラム命 令群として、式 1「2 X (第 1の選択パラメータ用変数) + 3 X (第 2の選択パラメータ用 変数) + 5 X (第 3の選択パラメータ用変数) MOD 7」を算出するプログラム命令群 を生成する。
[0115] 秘密保持プログラム生成部 203は、選択処理命令群で算出した選択識別子に基 づき、複数の選択対象データのうち ヽずれかの選択対象データに分岐する処理を行 う変遷処理命令群を生成する (ステップ S 125)。具体的には、秘密保持プログラム生 成部 203は、機能提供命令群生成部 201にて生成された複数の機能提供命令群の 個数 (m個)と、偽装機能提供命令群生成部 202にて生成された複数の偽装機能提 供命令群の個数 (n個)とを取得し、その合計値を算出する。秘密保持プログラム生 成部 203は、算出した合計値 (ここでは、 7)と同数のラベル名を生成する。秘密保持 プログラム生成部 203は、選択処理命令群 120に含まれる式 1が取り得る値のそれ ぞれに対して、分岐先として、生成したラベル名を対応付けることにより、変遷処理命 令群を生成する。
[0116] 秘密保持プログラム生成部 203は、 3つの初期値と、式 1と、生成した複数の機能提 供命令群及び複数の偽装機能提供命令群とを用いて、複数の機能提供命令群の個 数と、機能提供命令群の個数との合計値と同数の選択対象データを生成する (ステ ップ S 130)。
秘密保持プログラム生成部 203は、生成した前処理命令群、選択処理命令群、変 遷処理命令群、及び複数の選択対象データを、順番に配置することにより、秘密保 持プログラムを生成する (ステップ S 135)。
[0117] (2)選択対象データの生成処理
ここでは、図 7のステップ S130にて示す選択対象データの生成処理の動作につい て、図 8及び図 9にて示す流れ図を用いて説明する。
秘密保持プログラム生成部 203は、生成した各ラベル名のみからなる選択対象デ ータを生成する(ステップ S 200)。
[0118] 秘密保持プログラム生成部 203は、カウンタ iに 1を設定する(ステップ S205)。ここ で、カウンタ iは、現在着目している機能提供命令群が何番目に実行されるべきであ るかを表す。
秘密保持プログラム生成部 203は、実行順序 i番目の機能提供命令群を機能提供 命令群生成部 201から取得する。秘密保持プログラム生成部 203は、取得した実行 順序 i番目の機能提供命令群を挿入する選択対象データを、選択パラメータ群及び 式 1を用いて、決定する。なお、 iが 1である場合には、秘密保持プログラム生成部 20 3は、 3つの初期値力もなる選択パラメータ群及び式 1を用いて、選択対象データを 決定し、 iが 2以上である場合には、秘密保持プログラム生成部 203は、更新された選 択パラメータ群及び式 1を用いて、選択対象データを決定する。秘密保持プログラム 生成部 203は、決定した選択対象データに、実行順序 i番目の機能提供命令群を揷 入する(ステップ S 210)。
[0119] 秘密保持プログラム生成部 203は、第 2の選択パラメータ用変数の値を第 3の選択 ノ メータ用変数に格納し、第 1の選択パラメータ用変数の値を第 2の選択パラメータ 用変数に格納する。秘密保持プログラム生成部 203は、第 1〜第 3の選択パラメータ 用変数の値「定数値」、「1」、「2」を式 1に代入して得られる値が、これまでに選択さ れた 1以上の選択対象データを示さない値となるように、定数値を取得する (ステップ S215)。
[0120] 秘密保持プログラム生成部 203は、取得した定数値を含み、選択パラメータ群の値 の更新を行う更新処理命令群を生成し、生成した更新処理命令群を選択対象デー タに揷入する(ステップ S220)。 秘密保持プログラム生成部 203は、カウンタ iの値が、機能提供命令群の個数 mと 一致する力否かを判定する (ステップ S 225)。
[0121] 一致しないと判定する場合 (ステップ S225における「NO」)、秘密保持プログラム 生成部 203は、選択処理命令群へ分岐する分岐命令群を生成し、生成した分岐命 令群を選択対象データに挿入する (ステップ S230)。
一致すると判定する場合 (ステップ S225における「YES」 )、秘密保持プログラム生 成部 203は、呼出元のプログラムへ制御を返す処理を行う分岐命令群を生成し、生 成した分岐命令群を選択対象データに挿入する (ステップ S235)。
[0122] 秘密保持プログラム生成部 203は、カウンタ iに値「1」を加算する (ステップ S240)。
秘密保持プログラム生成部 203は、カウンタ iが機能提供命令群の個数より大きい か否かを判定する(ステップ S243)。
大きくないと判定する場合には (ステップ S243における「NO」)、秘密保持プロダラ ム生成部 203は、ステップ S210〖こ戻り、再度、処理を繰り返す。
[0123] 大きいと判定する場合には (ステップ S243における「YES」)、秘密保持プログラム 生成部 203は、偽装機能提供命令群の個数 nの間、ステップ S245からステップ S27 5を繰り返す。
秘密保持プログラム生成部 203は、機能提供命令群も偽装機能提供命令群も挿入 されて!/ヽな ヽ選択対象データ、つまりラベル名のみが含まれる選択対象データを 1つ 取得する(ステップ S 250)。
[0124] 秘密保持プログラム生成部 203は、選択対象データに挿入されて!ヽな ヽ偽装機能 提供命令群を 1つ取得し、取得した偽装機能提供命令群を、ステップ S250にて取得 した選択対象データに挿入する (ステップ S255)。
秘密保持プログラム生成部 203は、定数値として使用されて 、な 、値を取得し (ス テツプ S260)、取得した定数値を含み、選択パラメータ群の値の更新を行う更新処 理命令群を生成し、生成した更新処理命令群を選択対象データに挿入する (ステツ プ S265)。
[0125] 秘密保持プログラム生成部 203は、選択処理命令群へ分岐する分岐命令群を生 成し、生成した分岐命令群を選択対象データに挿入する (ステップ S270)。 秘密保持プログラム生成部 203は、偽装機能提供命令群の個数 nまでの間、ステツ プ S250力らステップ S270を繰り返すと、処理を終了する(ステップ S275)。
1. 5 変形例
なお、本発明を上記第 1の実施の形態に基づいて説明してきたが、本発明は、上 記の実施の形態に限定されないのはもちろんである。以下のような場合も本発明に 含まれる。
[0126] (1)上記第 1の実施の形態では、選択識別子を算出する算出式として式 1を用いた 力 これに限定されない。選択識別子を算出する算出式は、選択パラメータ用変数を 用いる他の式であっても構わな 、。
また、選択識別子用変数に初期値を設定しておき、選択識別子用変数を用いた式 であっても構わない。また、選択処理命令群に、選択処理命令群が呼び出された回 数を数えるカウンター用変数を設けておき、カウンター用変数をも用いた式であって も構わない。
[0127] また、カウンター用変数は、選択処理命令群以外でカウンターの値を上げる処理を 行ってもよい。
(2)上記第 1の実施の形態において、最後の機能提供命令群 3を含む選択対象デ ータ 146に、更新処理命令群 166を含めなくてもよい。
(3)上記第 1の実施の形態において、機能提供命令群の数を 3つとしたが、これに 限定されない。機能提供命令群の数は、幾つであってもよい。
[0128] (4)上記第 1の実施の形態において、選択パラメータの数を 3としたが、これに限定 されな 、。選択パラメータの数は複数個であればょ 、。
この場合の式 1は、「pl X (第 1の選択パラメータ用変数) +P2 X (第 2の選択パラメ ータ用変数) + · · · + pn X (第 nの選択パラメータ用変数) MOD NN」となる(nは 2以上の整数)。なお、 pl、 p2、 · · ·、 pnは互いに素である素数であり、 NNを選択対 象データの数とする。また、選択パラメータの更新時には、第 i 1のパラメータに格 納されている値を第 iのパラメータに格納する。このとき、第 nのパラメータ、第 n— 1の パラメータ、 · · ·、第 2のパラメータの順に格納する。また、第 1のパラメータには、実行 した選択対象主要命令群が有する定数値を格納する。ここで、 iは 2以上 n以下の整 数である。
[0129] また、入力値の初期値を「1」、「2」、「3」としたがこの値でなくてもよい。
また、入力値等を 32ビットの値とした力 32ビットより短いビット数であってもよいし、 32ビットより長!、ビット数であってもよ!/ヽ。
(5)上記第 1の実施の形態において、選択対象データ 140〜146に分岐命令群 1 70〜175がある構成を、各選択対象データに選択処理命令群と変遷処理命令群を 持つ構成としても構わない。
[0130] (6)上記第 1の実施の形態において、選択情報パラメータの初期値は、秘密保持 プログラムに与えられた値としている構成を、前処理部等で、秘密保持プログラム外 のプログラムやプログラムを実行する機器が有する機能を用いて決定する値としても よい。
(7)秘密保持プログラムが秘密情報を持つ場合に、秘密情報の値を選択パラメータ 用変数、選択識別子用変数を用いて算出する処理に置き換えても構わない。
[0131] (8)上記第 1の実施の形態のプログラム難読ィ匕装置 10において、選択対象データ の数や選択パラメータの数は、必ずしも固定の値である必要はなぐ別の値であって ちょい。
また、これらの値を、プログラム難読ィ匕装置に入力として与えてもよい。
(9)上記第 1の実施の形態において、ブロックの分割の分割方法として、ここでは簡 単な方法について説明した力 この方法に限定するものではなぐブロックの分割の 仕方に応じた制御構造の解析を行 ヽ、ブロックの分割の仕方に応じた機能提供命令 群を生成すればよい。なお、制御構造の解析については、公知であるため説明は省 略する。
[0132] (10)上記第 1の実施の形態において、プログラム難読ィ匕装置 10は、初期値、定数 値の決定後、機能提供命令群を挿入する選択対象データを決定したが、これに限定 されない。プログラム難読ィ匕装置 10は、機能提供命令群の配置を決めた後に、初期 値、定数値を決めてもよい。
(11)上記第 1の実施の形態において、プログラム難読ィ匕装置 10は、ラベル名のみ からなる複数の選択対象データのそれぞれに、選択対象主要命令群、更新処理命 令群、及び分岐命令群を挿入した後に、前処理命令群、選択処理命令群、変遷処 理命令群、及び複数の選択対象データの配置を決定して秘密保持プログラムを生 成したが、これに限定されない。
[0133] プログラム難読化装置 10は、前処理命令群、選択処理命令群、変遷処理命令群、 及びラベル名のみ力 なる複数の選択対象データの配置を決定し、その後、ラベル 名のみからなる複数の選択対象データのそれぞれに、選択対象主要命令群、更新 処理命令群、及び分岐命令群を挿入して秘密保持プログラムを生成してもよ ヽ。
(12)上記実施の形態及び上記変形例をそれぞれ組み合わせるとしてもよ!/、。
[0134] 1. 6 まとめ
上記第 1の実施の形態にて示す秘密保持プログラム 100は、選択対象主要命令群 152、 154、 156は実際の実行順序とは無関係にバラバラな位置に配置されるため、 実行順序の解析が困難である。
また、選択対象主要命令群 152、 154、 156には、他の選択対象主要命令群への 直接的な分岐命令が含まれていないので、実行順序の解析が困難である。
[0135] また、次にどの選択対象データに分岐するかを決定する処理を行う選択処理命令 群は、選択パラメータの値によっては、全ての選択対象主要命令群に分岐する可能 性があるプログラム命令であるため、実行順序の解析が困難である。さらに、選択対 象データ 140〜146には正常系の実行時には実行されることのない選択対象データ 140、 141、 143、 145が含まれるため、解析がより困難である。
[0136] 更に、本実施の形態では、複数の選択パラメータを用いて、選択対象データ 140 〜 146の実行順序を決定している。よって、もし、不正解析者が実行順序の一部をた またま知っていたとしても、それ以外の部分の実行順序を知ることが困難になる。この ことをより具体的に説明する。例えば、秘密保持プログラムがウォーターマーク検出す るアルゴリズムであった場合にぉ 、て、不正解析者が一般的なウォーターマーク処理 に詳しぐ一般的なウォーターマーク検出アルゴリズムのどのような処理で含まれるか を知っていることが考えられる。このような場合、多数の選択対象データの中から、実 行されそうな選択対象データを見つけ出すことが考えられる。このとき、もし、選択処 理命令群が 1つの選択パラメータに基づいて実行順序を決める処理であれば、不正 解析者はその 1つだけの選択パラメータの値を知ることができる。これを行うには、実 行されそうな選択対象データに分岐するには、変遷処理命令群がどのような選択識 別子を使っているかを逆算し、さらに、そのような選択識別子をもたらすには、選択処 理命令群がどのような選択パラメータに用いて処理を行つたかを逆算すればよい。以 降は、選択パラメータの値の変化、選択処理命令群の処理を追跡することで実行順 序を知ることが出来る。
[0137] しかし、本手法のように複数の選択パラメータを用いるのであれば、たまたま、実行 されそうな選択対象データを 1つ見つけ出しても、選択識別子カゝら選択パラメータを 逆算することはできない。
さらに、不正解析者が、たまたま、連続して実行される選択対象データが分かる場 合が考えられる。このような場合に、不正解析者は、選択処理命令群の式 1に対する 入出力の組をより多く知ることができるようになるので、式 1に用いる選択パラメータ用 の変数の数を多くすることが、解析を困難にすることになる。
[0138] 更に、本実施例では、選択対象データに選択パラメータを更新する処理がある。よ つて、不正解析者が秘密保持プログラムと、秘密保持プログラムに与えられる入力値 とを知っていたとしても、選択パラメータの値がどのように変わっていくかを、順に解析 して!/、かなければ、実際に選択対象が実行される順番を解析することができな 、。 また、従来、例えば、 Switch文を用いて、実行順序を決定する場合、あるブロック の最後に、次の実行すべきブロックを示す値 (Switch文にて用いられる値)が直接 記述されている。本実施の形態では、 3つの値力もなる選択パラメータ群を用いて選 択処理命令群を実行することにより、次に実行する選択対象データが決定される。こ のとき、正当な 3つの初期値から、まず、 1番目に実行される機能提供命令群が決定 される。次に、更新処理命令群により更新された選択パラメータ群(1回目の更新選 択パラメータ群)から、 2番目に実行される機能提供命令群が決定される。 n番目に実 行される機能提供命令群は、 3つの初期値力 なる選択パラメータ群、 1回目の更新 選択パラメータ群、…、(n— 1)回目の選択パラメータ群を、順次用いて選択処理命 令群を実行することにより、決定される。ここで、 nは 1以上の整数である。より詳細に は、更新処理命令群を正当な順序で実行することにより、正当に更新された選択パラ メータ群を生成し、生成した選択パラメータ群を用いて択処理命令群を実行すること により、 n番目に実行される機能提供命令群が決定される。本実施の形態では、選択 ノ メータ群を順次更新することにより、 Switch文にて用いられる値を取得すること ができる。つまり、本実施の形態では、 Switch文にて用いられる値をプログラム上で は隠匿し、選択パラメータ群を順次更新することにより取得している。このように、隠匿 した 、情報を、 V、くつかの他の情報から取得することを分割秘密による難読ィ匕と!/ ヽ 、本実施の形態における更新処理命令群が、分割秘密に相当している。
[0139] 2.第 2の実施の形態
以下、本発明に係る第 2の実施の形態としての秘密保持プログラム 300及びプログ ラム難読ィ匕装置 30について、図面を参照して説明する。
2. 1 秘密保持システム 2の概要
秘密保持システム 2は、図 10に示すように、プログラム難読化装置 30と、プログラム 実行装置 40とから構成されて 、る。
[0140] プログラム難読ィ匕装置 30は、実行順序を秘密にしたい難読ィ匕対象プログラムから 秘密保持プログラム 300を生成し、生成した秘密保持プログラム 300をプログラム実 行装置 40へ配布する。
プログラム実行装置 40は、プログラム難読ィ匕装置 30から配布された秘密保持プロ グラム 300を実行する。
[0141] ここで、難読化対象プログラムは、命令群 A、命令群 B、命令群 Cの 3つの命令群か ら構成されており、命令群 A、 B、 Cの順に実行することにより正しく動作するものとす る。
2. 2 秘密保持プログラム 300の構造
ここでは、プログラム難読ィ匕装置 30にて生成され、プログラム実行装置 40にて実行 される秘密保持プログラム 300のプログラム構造について説明する。
[0142] 秘密保持プログラム 300は、 2以上の秘密情報を用いて処理を行うプログラムであ る。秘密情報は、不正解析者に対して解析されたくない情報である。例えば、秘密保 持プログラム 300は、秘密情報である複数のサブ鍵を用いて暗号処理を行うプロダラ ムである。このようなプログラムにお 、て複数の秘密情報を隠蔽した 、と 、う要求があ る。ここでは、命令群 A、 B、 Cのそれぞれ力 秘密情報を有しているものとする。
[0143] 秘密保持プログラム 300は、前処理命令群 310、選択処理命令群 320、主要処理 命令群 340、選択対象データ 350〜356からなり、これらが図 11に示す順番に配置 されている。
秘密保持プログラム 300は、呼出元のプログラムから、選択パラメータ群の初期値と なる 32ビットの入力値 inl、 in2、 in3および秘密情報を用いた処理で使用するパラメ ータを受け取り、秘密情報を用いた処理を行うプログラム命令群である。秘密保持プ ログラムの処理では、選択処理命令群 320での処理に用いる複数の選択パラメータ の各値 (ここでは、 3つの値)を保持する 32ビットの変数である第 1〜第 3の選択パラメ ータ用変数、選択識別子を保持する 32ビットの変数である選択識別子用変数、また 変遷処理命令群 390〜392で算出される秘密情報を格納する 32ビットの変数である 秘密情報用変数を用いる。ここで、選択パラメータは、選択対象データ 140、 141、 · • ·、 146から 1の選択対象を決定する際に、使用されるノ メータであり、選択識別子 は、選択対象データを一意に識別する識別子である。
[0144] ここでは、秘密保持プログラムが実際に使用される際に呼出元のプログラム力 受 け取る入力値 inl、 in2、 in3は値「1」、「2」、「3」であるとする。
秘密保持プログラム 300は 2以上の秘密情報を用いた処理を行うプログラム命令群 であり、本実施例では命令群 A、 B、 Cのそれぞれが有する秘密情報を、第 1〜第 3の 秘密情報とし、それぞれの値を「100」、「200」、「300」とする。
[0145] 2. 2. 1 前処理命令群 310
前処理命令群 310は、後述の選択処理命令群 320で用いる選択パラメータ群の初 期値を算出するプログラム命令群である。ここで、選択パラメータ群は、第 1、第 2及 び第 3の選択パラメータ用変数力 なる。
前処理命令群 310の処理は、上記第 1の実施の形態にて示す前処理命令群 110 と同様のほぼ同様の処理である力 前処理命令群 110の最後は、選択処理命令群 1 20分岐するプログラム命令群であるのに対し、前処理命令群 310の最後は、主要処 理命令群 340へ分岐するプログラム命令群である点が異なる。
[0146] 2. 2. 2 選択処理命令群 320 選択処理命令群 320は、選択パラメータ群に基づき、選択対象データ 350〜356 から 1つを選択し選択識別子とするプログラム命令群である。
選択処理命令群 320の処理は、選択処理命令群 120と同様とほぼ同等の処理で ある力 選択処理命令群 320はサブルーチンである点で異なる。
[0147] 具体的には、選択処理命令群 120は、当該命令群の処理の最後で変遷処理命令 群へ分岐するプログラム命令を有するのに対し、選択処理命令群 320はプログラム 関数であり、選択処理命令群 320の最後ではこの関数を呼び出した呼出元に分岐 する点が異なる。
なお、ここでは、選択処理命令群 120と同様に、式 1を用いて選択識別子を算出す るちのとする。
[0148] 2. 2. 3 選択対象データ 350〜356
選択対象データ 350〜356は、更新処理命令群にて読み出されるデータである。 具体的には、選択対象データ 350〜356は、例えば、配列データであって、 C言語 の場合は、以下のような配列である。
Γ
variable— 140 [7] = { 1、 2、 3、 4、 5、 6、 7} ;
J
この配列は、後述の変遷処理命令群 390〜392にて用いられる配列であり、この配 列と前処理命令群 310で選択パラメータに設定する初期値に依存して変遷処理命 令群 390〜392がどのようなプログラム命令群になるかが決まる。
[0149] 2. 2. 4 主要処理命令群 340
主要処理命令群 340は、秘密情報を用いて処理を行うプログラム命令群である。 主要処理命令群 340は、機能提供命令群 360〜362、選択処理命令群呼出命令 370〜372、更新処理命令群 380〜382、及び変遷処理命令群 390〜392力もなる プログラム命令群であり、各命令群は、図 11に示す位置に配置されている。
[0150] (1)機能提供命令群 360〜362
機能提供命令群 360は、秘密情報を用いた処理を行うプログラム命令群である。秘 密情報の値を用いるプログラム命令は、秘密情報用変数を用いた処理として記述さ れている。つまり、秘密情報が予め秘密情報用変数に変換されている。もし、秘密情 報用変数の値が第 1の秘密情報の値「100」であれば、機能提供命令群 360は、本 来の処理を行うプログラム命令群である。
[0151] 機能提供命令群 361も同様なプログラム命令群であり、秘密情報用変数に格納さ れた値が秘密情報 2の値が「200」であれば、機能提供命令群 361は、本来の処理 を行うプログラム命令群である。
機能提供命令群 362も同様なプログラム命令群であり、秘密情報用変数に格納さ れた値が秘密情報 3の値が「300」であれば、機能提供命令群 362は、本来の処理 を行うプログラム命令群である。
[0152] なお、各機能提供命令群に含まれる秘密情報は、予め秘密情報用変数に変換さ れている。
(2)選択処理命令群呼出命令 370〜372
選択処理命令群呼出命令 370〜372は、選択処理命令群 320を呼び出すプログ ラム命令群である。
[0153] (3)更新処理命令群 380〜382
更新処理命令群 380は、選択識別子に対応する選択対象データの値を読み出す 処理を行って、読み出した値を用いて選択パラメータ群の値を更新する処理を行うプ ログラム命令群である。
具体的には、更新処理命令群 380は、まず、選択識別子用変数の値が、 0、 1、 · · · 、 6の場合にそれぞれ、選択対象データ 350、 351、 · · ·、 356に格納されている値を
BJCみ出す。
[0154] 次に、更新処理命令群 380は、読み出した値に基づき、選択パラメータ群の更新を 行う。ここでは、更新処理命令群 380は、第 2の選択パラメータの値を第 3の選択パラ メータに格納し、第 1の選択パラメータの値を第 2の選択パラメータに格納し、第 1の 選択パラメータに読み出した値を格納する。
例えば、 C言語のプログラム命令で、更新処理を記載すると
Γ
(第 3の選択パラメータ変数) = (第 2の選択パラメータ変数); (第 2の選択パラメータ変数) = (第 1の選択パラメータ変数);
(第 1の選択パラメータ変数) = variable— 140 [ (選択識別子用変数) ] ;」 で表されるプログラム命令群になる。
[0155] なお、更新処理命令群 381〜382は、更新処理命令群 380と同様の構成であるの で、ここでの説明は省略する。
(4)変遷処理命令群 390〜392
変遷処理命令群 390〜392は、選択パラメータ変数の値に基づ ヽて秘密情報用 変数の値を決定する処理である。
[0156] 具体的には、変遷処理命令群 390〜392は、選択パラメータ変数に格納する値( 秘密情報)を算出し、算出した値を秘密情報用変数に格納するプログラム命令群で ある。
以下に、変遷処理命令群 390〜392の動作の詳細について説明する。 (4 1)変遷処理命令群 390
変遷処理命令群 390は、第 1〜第 3選択パラメータ用変数を用いた演算を行い、第
1の秘密情報の値を算出し、算出した値を秘密情報用変数に格納する処理を行うプ ログラム命令である。
[0157] 例えば、変遷処理命令群 390は、 P4、 P5、 P6を互い〖こ素な素数とし、「P4 X (第 1 の選択パラメータ用変数) +P5 X (第 2の選択パラメータ用変数) +P6 X (第 3の選 択パラメータ用変数) + (定数 1)」を算出し、算出した値を秘密情報用変数に格納す る処理を行うプログラム命令群である。なお演算子「X」は掛け算を表す。ここでは、 P 4、 P5、 P6をそれぞれ値「2」、「3」、「5」、とした場合、式 2「2 X (第 1の選択パラメ一 タ用変数) + 3 X (第 2の選択パラメータ用変数) + 5 X (第 3の選択パラメータ用変数 ) + (定数 1)」を算出し、算出した値を秘密情報用変数に格納する処理である。
[0158] 以下、定数 1について説明する。
秘密保持プログラム 300では、変遷処理命令群 390が実行されるまでには、前処 理命令群 310、選択処理命令群呼出命令 370、選択処理命令群 320、更新処理命 令群 380が、この順序で実行されている。なお、前処理命令群 310、選択処理命令 群呼出命令 370、選択処理命令群 320、及び更新処理命令群 380を実行する際に は、呼出元のプログラム力も受け取る入力値 inl、 in2、 in3の値をそれぞれ値「1」、「 2」、「3」として実行する。その他の呼出元のプログラム力も受ける入力値は任意の値 であってよい。
[0159] このとき、選択処理命令群 320は、式 1「2 X (第 1の選択パラメータ用変数( = 1) )
+ 3 X (第 2の選択パラメータ用変数( = 2) ) + 5 X (第 3の選択パラメータ用変数(= 3) ) MOD 7」により選択識別子の値は「2」となり、更新処理命令群 380が選択対 象データ 350〜356から取得する値は「3」となり、第 1〜第 3の選択パラメータ変数の 更新後の値は、「3」、「1」、「2」となる。
[0160] 定数 1は、このようにして得られた第 1〜第 3の選択パラメータ変数の値を式 2に代 入して得られる秘密情報用変数の値が、第 1の秘密情報の値「100」になるように、予 め設定された値であり、ここでは、 81となる。
(4 2)変遷処理命令群 391
同様に、変遷処理命令群 392は、 Γ2 Χ (第 1の選択パラメータ用変数) + 3 X (第 2 の選択パラメータ用変数) + 5 X (第 3の選択パラメータ用変数) + (定数 2)」からなる 命令群である。
[0161] 以下、定数 2の値について説明する。
秘密保持プログラム 300では、変遷処理命令群 391が実行されるまでには、前処 理命令群 310、選択処理命令群呼出命令 370、選択処理命令群 320、更新処理命 令群 380、変遷処理命令群 390、機能提供命令群 360、選択処理命令群呼出命令 371、選択処理命令群 320、更新処理命令群 381が、この順序で実行されている。
[0162] このとき、更新処理命令群 381にて取得される第 1〜第 3の選択パラメータ変数の 値は、「6」、「3」、「1」となる。上記と同様の方法にて定数 2を算出すると、値「174」と なる。
(4 3)変遷処理命令群 392
同様に、変遷処理命令群 392は、 Γ2 Χ (第 1の選択パラメータ用変数) + 3 X (第 2 の選択パラメータ用変数) + 5 X (第 3の選択パラメータ用変数) + (定数 3)」からなる 命令群である。
[0163] 秘密保持プログラム 300では、変遷処理命令群 392が実行されるまでには、前処 理命令群 310、選択処理命令群呼出命令 370、選択処理命令群 320、更新処理命 令群 380、変遷処理命令群 390、機能提供命令群 360、選択処理命令群呼出命令 371、選択処理命令群 320、更新処理命令群 381、変遷処理命令群 391、機能提 供命令群 361、選択処理命令群呼出命令 372、選択処理命令群 320、及び更新処 理命令群 382、力 この順序で実行されている。
[0164] このとき、更新処理命令群 382にて取得される第 1〜第 3の選択パラメータ変数の 値は、「6」、「6」、「3」となる。上記と同様の方法にて定数 3を算出すると、値「255」と なる。
2. 3 秘密保持プログラム 300の実行
プログラム実行装置 40が、秘密保持プログラム 300を正常系で実行した場合の処 理について、図 12に示す流れ図を用いて説明する。
[0165] 秘密保持プログラム 300は、前処理命令群 310の処理を行う(ステップ S300)。具 体的には、前処理命令群 310は、入力値 inl、 in2、 in3として、それぞれ値「1」、「2」 、「3」を受け取り、第 1〜3の選択パラメータ用変数にそれぞれ値「1」、「2」、「3」を格 納する処理を行! \選択処理命令群呼出命令 370へ分岐する。
[0166] 次に、秘密保持プログラム 300は、選択処理命令群呼出命令 370の処理を行う (ス テツプ S305)。具体的には、選択処理命令群呼出命令 370は、選択処理命令群 32 0の呼出を行う。
次に、秘密保持プログラム 300は、受け取った入力値「1」、「2」、「3」を用いて、選 択処理命令群 320の処理を行う(ステップ S310)。具体的には、選択処理命令群 32 0は、式 1「2 X (第 1の選択パラメータ用変数( = 1) ) + 3 X (第 2の選択パラメータ用 変数( = 2) ) + 5 X (第 3の選択パラメータ用変数( = 3) ) MOD 7」により値「2」を 算出し、算出した値「2」を選択識別子用変数に格納する。
[0167] 秘密保持プログラム 300は、更新処理命令群 380の処理を行う(ステップ S315)。
具体的には、更新処理命令群 380は、選択識別子用変数の値「2」により、選択対象 データ 352の値「3」を読み出す。更新処理命令群 380は、第 2の選択パラメータの値 「2」を第 3の選択パラメータに格納し、第 1の選択パラメータの値「1」を第 2の選択パ ラメータに格納し、第 1の選択パラメータに読み出した値「3」を格納する。 [0168] 秘密保持プログラム 300は、更新処理命令群 380にて生成した選択パラメータ群( 第 1〜第 3の選択パラメータ)を用いて変遷処理命令群 390の処理を行う(ステップ S 320)。具体的には、変遷処理命令群 390は、式 2「2 X (第 1の選択パラメータ用変 数) + 3 X (第 2の選択パラメータ用変数) + 5 X (第 3の選択パラメータ用変数) + (定 数 1)」を用いて、秘密情報用変数に格納する値を算出し、算出した値を秘密情報変 数に格納する。なお、ここでは、秘密情報変数には「100」が格納される。
[0169] 秘密保持プログラム 300は、秘密情報変数に格納された値に基づ 、て、機能提供 命令群 360の処理を行う(ステップ S325)。具体的には、機能提供命令群 360は、 難読化対象プログラムにおける命令群 Aを実行する。
次に、秘密保持プログラム 300は、選択処理命令群呼出命令 371の処理を行う (ス テツプ S330)。具体的には、選択処理命令群呼出命令 371は、選択処理命令群 32 0の呼出を行う。
[0170] 次に、秘密保持プログラム 300は、第 1〜第 3の選択パラメータの値「3」、「1」、「2」 を用いて、選択処理命令群 320の処理を行う (ステップ S335)。具体的には、選択処 理命令群 320は、式 1「2 X (第 1の選択パラメータ用変数( = 3) ) + 3 X (第 2の選択 パラメータ用変数( = 1) ) + 5 X (第 3の選択パラメータ用変数( = 2) ) MOD 7」に より値「5」を算出し、算出した値「5」を選択識別子用変数に格納する。
[0171] 秘密保持プログラム 300は、更新処理命令群 381の処理を行う(ステップ S340)。
具体的には、更新処理命令群 381は、選択識別子用変数の値「5」により、選択対象 データ 355の値「6」を読み出す。更新処理命令群 381は、第 2の選択パラメータの値 「1」を第 3の選択パラメータに格納し、第 1の選択パラメータの値「3」を第 2の選択パ ラメータに格納し、第 1の選択パラメータに読み出した値「6」を格納する。
[0172] 秘密保持プログラム 300は、更新処理命令群 381にて生成した選択パラメータ群( 第 1〜第 3の選択パラメータ)を用いて変遷処理命令群 391の処理を行う(ステップ S 345)。具体的には、変遷処理命令群 391は、式 2「2 X (第 1の選択パラメータ用変 数) + 3 X (第 2の選択パラメータ用変数) + 5 X (第 3の選択パラメータ用変数) + (定 数 2)」を用いて、秘密情報用変数に格納する値を算出し、算出した値を秘密情報変 数に格納する。なお、ここでは、秘密情報変数には「200」が格納される。 [0173] 秘密保持プログラム 300は、秘密情報変数に格納された値に基づ 、て、機能提供 命令群 361の処理を行う(ステップ S350)。具体的には、機能提供命令群 361は、 難読化対象プログラムにおける命令群 Bを実行する。
次に、秘密保持プログラム 300は、選択処理命令群呼出命令 372の処理を行う (ス テツプ S355)。具体的には、選択処理命令群呼出命令 372は、選択処理命令群 32 0の呼出を行う。
[0174] 次に、秘密保持プログラム 300は、第 1〜第 3の選択パラメータの値「6」、 「3」、 「1」 を用いて、選択処理命令群 320の処理を行う (ステップ S360)。具体的には、選択処 理命令群 320は、式 1「2 X (第 1の選択パラメータ用変数( = 6) ) + 3 X (第 2の選択 パラメータ用変数( = 3) ) + 5 X (第 3の選択パラメータ用変数( = 1) ) MOD 7」に より値「5」を算出し、算出した値「5」を選択識別子用変数に格納する。
[0175] 秘密保持プログラム 300は、更新処理命令群 382の処理を行う(ステップ S365)。
具体的には、更新処理命令群 382は、選択識別子用変数の値「5」により、選択対象 データ 355の値「6」を読み出す。更新処理命令群 382は、第 2の選択パラメータの値 「3」を第 3の選択パラメータに格納し、第 1の選択パラメータの値「6」を第 2の選択パ ラメータに格納し、第 1の選択パラメータに読み出した値「6」を格納する。
[0176] 秘密保持プログラム 300は、更新処理命令群 382にて生成した選択パラメータ群( 第 1〜第 3の選択パラメータ)を用いて変遷処理命令群 392の処理を行う(ステップ S 370)。具体的には、変遷処理命令群 392は、式 2「2 X (第 1の選択パラメータ用変 数) + 3 X (第 2の選択パラメータ用変数) + 5 X (第 3の選択パラメータ用変数) + (定 数 3)」を用いて、秘密情報用変数に格納する値を算出し、算出した値を秘密情報変 数に格納する。なお、ここでは、秘密情報変数には「300」が格納される。
[0177] 秘密保持プログラム 300は、秘密情報変数に格納された値に基づ 、て、機能提供 命令群 362の処理を行う(ステップ S375)。具体的には、機能提供命令群 362は、 難読化対象プログラムにおける命令群 Cを実行する。
2. 4 プログラム難読化装置 30
ここでは、実行順序を隠蔽した 、難読ィ匕対象プログラム力も秘密保持プログラム 30 0を生成するプログラム難読ィ匕装置 30につ 、て述べる。秘密保持プログラム 300に おいて、機能提供命令群 360〜362、変遷処理命令群 390〜392以外の各部は、 どのような難読ィ匕対象プログラムに対しても共通して用いることができる。ここでは、機 能提供命令群、変更処理命令群の生成について中心に述べる。
[0178] プログラム難読ィ匕装置 30は、図 13に示すように、入力部 400と、機能提供命令群 生成部 401と、変遷処理命令群生成部 402と、秘密保持プログラム生成部 403とか ら構成されている。
プログラム難読化装置 30は、具体的には、マイクロプロセッサ、 ROM、 RAM、ノヽ ードディスクユニット、ディスプレイユニット、キーボード、マウスなどから構成されるコン ピュータシステムである。前記 RAM又は前記ハードディスクユニットには、コンビユー タプログラムが記憶されている。ここで、コンピュータプログラムは、所定の機能を達成 するために、コンピュータに対する指令を示す命令コードが複数個組み合わされて 構成されたものである。前記マイクロプロセッサ力 前記コンピュータプログラムに従つ て動作することにより、プログラム難読ィ匕装置 30は、その機能を達成する。つまり、前 記マイクロプロセッサは、前記コンピュータプログラムに含まれる各命令を 1個ずつ読 み出し、読み出した命令を解読し、解読結果に従って動作する。
[0179] 2. 4. 1 入力部 400
難読化対象のプログラムと、秘密保持プログラム 300を正常系にて実行する際、秘 密保持プログラム 300に与える 3つの初期値 (ここでは、「1」、「2」、「3」)と、秘密情報 の位置を示す位置情報 (ここでは、 3個の秘密情報「100」、「200」、「300」が出現す る位置を示す情報)とを受け付ける。
[0180] 2. 4. 2 機能提供命令群生成部 401
機能提供命令群生成部 401は、入力部 400にて受け付けた難読ィ匕対象プログラム を 1以上のプログラム命令力 なる複数のブロックに分割し機能提供命令群を生成す る。なお、難読化対象プログラムに無条件飛び越し、条件飛び越しが含まれる場合に は、飛び越しを行うプログラム命令と飛び越し先のプログラム命令は同じブロックに含 まれるように分割を行う。また、秘密情報の値を用いた処理を行うプログラム命令は、 それぞれ異なるブロックに含まれるようにブロックを構成する。
[0181] ここでは、難読ィ匕対象プログラムが 3つの秘密情報の値を用いた処理であるとし、分 割した各部に含まれる命令数が出来るだけ均等になるように 3つのブロックに分割し 、 3つの機能提供命令群を生成する。生成した機能提供命令群は、元となったプログ ラム命令群が難読ィ匕対象プログラムにおいて始まりの方にあった順に機能提供命令 群 1〜3とする。
2. 4. 3 変遷処理命令群生成部 402
変遷処理命令群生成部 402は、定数が未決定である式 2を含む変遷処理命令群 を、機能提供命令群生成部 401にて生成した機能提供命令群の個数分生成する。
[0182] ここでは、変遷処理命令群生成部 402は、定数が未決定である式 2を含む変遷処 理命令群を 3個生成する。
2. 4. 4 秘密保持プログラム生成部 403
秘密保持プログラム生成部 403は、複数の機能提供命令群、及び機能提供命令 群と同数の変遷処理命令群を用いて、前処理命令群 310、選択処理命令群 320、 選択処理命令群呼出命令 370〜372、更新処理命令群 380〜382、及び選択対象 データ 350〜351を生成することにより秘密保持プログラム 300を生成する。
[0183] 秘密保持プログラム生成部 403は、図 13に示すように、プログラム記憶部 410を有 している。
プログラム記憶部 410は、生成された各命令群及び選択対象データを記憶する領 域を有している。
秘密保持プログラム生成部 403は、機能提供命令群生成部 401にて生成された複 数の機能提供命令群を取得し、取得した複数の機能提供命令群をプログラム記憶 部 410に格納する。
[0184] 秘密保持プログラム生成部 403は、変遷処理命令群生成部 402にて生成された、 機能提供命令群の個数と同数の変遷処理命令群を取得し、取得した複数の変遷処 理命令群をプログラム記憶部 410に格納する。
(1)前処理命令群 310の生成
秘密保持プログラム生成部 403は、呼び出し元のプログラムから 32ビットの入力値 i nl、 in2、 in3を受け取り、受け取った値を選択パラメータ群の初期値として選択パラ メータ用変数に格納する第 1の前処理プログラム命令群と、選択処理命令群呼出命 令に分岐する第 2の前処理プログラム命令群とからなり、これらを順に行う前処理命 令群 310を生成する。
[0185] 秘密保持プログラム生成部 403は、生成した前処理命令群 310をプログラム記憶 部 410へ格納する。
(2)選択処理命令群 320の生成
秘密保持プログラム生成部 403は、選択パラメータ群に基づき、選択対象データ 3 50〜356から 1つを選択し選択識別子とする選択処理命令群 320を生成する。
[0186] なお、選択処理命令群 320の処理は、選択処理命令群 120と同様とほぼ同等の処 理である力 選択処理命令群 320はサブルーチンである点で異なる。具体的には、 選択処理命令群 120は、当該命令群の処理の最後で変遷処理命令群へ分岐する プログラム命令を有するのに対し、選択処理命令群 320はプログラム関数であり、選 択処理命令群 320の最後ではこの関数を呼び出した呼出元に分岐する点が異なる 。ここでは、選択処理命令群 120と同様に、式 1を用いて選択識別子を算出するもの とする。
[0187] 秘密保持プログラム生成部 403は、生成した選択処理命令群 320をプログラム記 憶部 410へ格納する。
(3)選択処理命令群呼出命令 370〜372の生成
秘密保持プログラム生成部 403は、選択処理命令群 320を呼び出す選択処理命 令群呼出命令 370〜372を生成する。
[0188] 秘密保持プログラム生成部 403は、生成した選択処理命令群呼出命令 370〜372 をプログラム記憶部 410へ格納する。
(4)更新処理命令群 380〜382の生成
秘密保持プログラム生成部 403は、選択識別子に対応する選択対象データの値を 読み出す処理を行って、読み出した値を用いて選択パラメータ群の値を更新する処 理を行う更新処理命令群 380〜382を生成する。
[0189] 秘密保持プログラム生成部 403は、生成した更新処理命令群 380〜382をプログ ラム記憶部 410へ格納する。
(5)選択対象データ 350〜351の生成 秘密保持プログラム生成部 403は、更新処理命令群 380〜382にて読み出される データである選択対象データ 350〜356を生成する。秘密保持プログラム生成部 40 3は、生成した選択対象データ 350〜356をプログラム記憶部 410へ格納する。
[0190] 具体的には、選択対象データ 350〜356は、例えば、配列データであって、 C言語 の場合は、以下のような配列である。
Γ
variable— 140 [7] = { 1、 2、 3、 4、 5、 6、 7} ;
J
秘密保持プログラム生成部 403による上記動作により、本発明における選択対象 データをデータとして扱うことができる。
[0191] (6)秘密保持プログラム 300の生成
秘密保持プログラム生成部 403は、プログラム記憶部 410にて記憶されて 、る前処 理命令群 310、選択処理命令群 320、機能提供命令群 360〜362、選択処理命令 群呼出命令 370〜372、更新処理命令群 380〜382、変遷処理命令群 390〜392 及び選択対象データ 350〜356を、図 11に示す順番に配置することにより、変遷処 理命令群 390〜392に含まれる各定数が未決定である秘密保持プログラム 300aを 生成する。
[0192] 次に、秘密保持プログラム生成部 403は、入力部 400にて受け取った初期値(「1」 、「2」、「3」)を用いて、生成した秘密保持プログラム 300aを、更新処理命令群 380 による処理まで実行する。その後、秘密保持プログラム生成部 403は、変遷処理命 令群 390の実行時に、入力部 400にて受け取った秘密情報「100」を用いて、定数 1 を決定し、決定した定数 1を、変遷処理命令群 390に含まれる式 2へ代入する。
[0193] 秘密保持プログラム生成部 403は、次に、更新処理命令群 381による処理まで実 行する。その後、秘密保持プログラム生成部 403は、変遷処理命令群 391の実行時 に、入力部 400にて受け取った秘密情報「200」を用いて、定数 2を決定し、決定した 定数 2を、変遷処理命令群 391に含まれる式 2へ代入する。
秘密保持プログラム生成部 403は、次に、更新処理命令群 382による処理まで実 行する。その後、秘密保持プログラム生成部 403は、変遷処理命令群 392の実行時 に、入力部 400にて受け取った秘密情報「300」を用いて、定数 3を決定し、決定した 定数 3を、変遷処理命令群 392に含まれる式 2へ代入する。
[0194] これにより、秘密保持プログラム生成部 403は、変遷処理命令群 390〜392に含ま れる各定数が決定された秘密保持プログラム 300を生成することができる。
秘密保持プログラム生成部 403は、選択処理命令群呼出命令 370〜372、更新処 理命令群 380〜382、変遷処理命令群 390〜392を配置し、各定数を決定し、対応 する変遷処理命令群の式 2へ代入することにより、各命令群を適切な配置位置へ挿 人することができる。
[0195] 秘密保持プログラム生成部 403は、入力部 400にて受け取った位置情報に基づい て、秘密情報を秘密情報用変数へと変換する。これにより、生成する秘密保持プログ ラムを、秘匿すべき秘密情報を予め変換した秘密変数を用いる処理とすることができ る。
2. 4. 5 プログラム難読化装置 30の動作
ここでは、プログラム難読ィ匕装置 30の動作について、図 14にて示す流れ図を用い て説明する。
[0196] プログラム難読ィ匕装置 30の入力部 400は、難読化対象プログラムと、秘密保持プロ グラム 300を正常系にて実行する際、秘密保持プログラムに与える 3つの初期値 (こ こでは、「1」、「2」、「3」)と、秘密情報の位置を示す位置情報 (ここでは、 3個の秘密 情報「100」、「200」、「300」の位置を示す情報)とを受け付ける(ステップ S400)。
[0197] 機能提供命令群生成部 401は、入力部 400にて受け付けた難読ィ匕対象プログラム を 1以上のプログラム命令力 なる複数のブロックに分割して複数の機能提供命令群 (ここでは、機能提供命令群 360〜362)を生成する (ステップ S405)。
変遷処理命令群生成部 402は、定数が未決定である式 2を含む変遷処理命令群 を、ステップ S405にて生成した機能提供命令群の個数分生成する (ステップ S410) 。ここでは、変遷処理命令群生成部 402は、定数が未決定である式 2を含む変遷処 理命令群 390〜392を生成する。
[0198] 秘密保持プログラム生成部 403は、前処理命令群 310を生成する (ステップ S415) 秘密保持プログラム生成部 403は、選択処理命令群 320を生成する (ステップ S42 0)。
秘密保持プログラム生成部 403は、生成した機能提供命令群の数と同数の選択処 理命令群呼出命令 370〜372を生成する (ステップ S425)。
[0199] 秘密保持プログラム生成部 403は、生成した機能提供命令群の数と同数の更新処 理命令群 380〜382を生成する(ステップ S430)。
秘密保持プログラム生成部 403は、選択対象データ 350〜356を生成する (ステツ プ S435)。
秘密保持プログラム生成部 403は、生成した前処理命令群 310、選択処理命令群 320、機能提供命令群 360〜362、選択処理命令群呼出命令 370〜 372、更新処 理命令群 380〜382、変遷処理命令群 390〜392及び選択対象データ 350〜356 の配置を決定し、秘密保持プログラム 300aを生成する(ステップ S440)。
[0200] 秘密保持プログラム生成部 403は、ステップ S400にて受け取った 3つの初期値、 及び 3つの秘密情報と、秘密保持プログラム 300aとを用いて、未決定である各定数 を決定、及び各秘密情報を秘密情報用変数へと変換し、秘密保持プログラム 300を 生成する(ステップ S445)。
2. 5 変形例
なお、本発明を上記第 2の実施の形態に基づいて説明してきたが、本発明は、上 記の実施の形態に限定されないのはもちろんである。以下のような場合も本発明に 含まれる。
[0201] (1)上記第 2の実施の形態では、秘密情報を算出する算出式として式 2を用いたが 、これに限定されない。秘密情報を算出する算出式は、選択パラメータ用変数を用い る他の式であっても構わな!/、。
(2)上記第 2の実施の形態では、第 1の実施の形態と同様に、選択識別子を算出 する算出式として式 1を用いたが、これに限定されない。選択識別子を算出する算出 式は、選択パラメータ用変数を用いる他の式であっても構わな 、。
[0202] また、選択識別子用変数に初期値を設定しておき、選択識別子用変数を用いた式 であっても構わない。また、選択処理命令群に、選択処理命令群が呼び出された回 数を数えるカウンター用変数を設けておき、カウンター用変数をも用いた式であって も構わない。
また、カウンター用変数は、選択処理命令群以外でカウンターの値を上げる処理を 行ってもよい。
[0203] (3)上記第 2の実施の形態において、機能提供命令群の数を 3つとしたが、これに 限定されない。機能提供命令群の数は、幾つであってもよい。
(4)上記第 2の実施の形態において、選択パラメータの数を 3としたが、これに限定 されな 、。選択パラメータの数は複数個であればょ 、。
この場合の式 2は、「pl X (第 1の選択パラメータ用変数) +p2 X (第 2の選択パラメ ータ用変数) + · · · +pn X (第 nの選択パラメータ用変数) +定数値」となる (nは 2以 上の整数)。なお、 pl、 ρ2、 · · ·、 pnは互いに素である素数である。また、選択パラメ ータの更新時には、第 i 1のパラメータに格納されている値を第 iのパラメータに格納 する。このとき、第 nのパラメータ、第 n— 1のパラメータ、 · · ·、第 2のパラメータの順に 格納する。また、第 1のパラメータには、選択識別子に対応する選択対象データから 読み出した値を格納する。ここで、 iは 2以上 n以下の整数である。
[0204] また、入力値の初期値を「1」、「2」、「3」としたがこの値でなくてもよい。
また、入力値等を 32ビットの値とした力 32ビットより短いビット数であってもよいし、 32ビットより長!、ビット数であってもよ!/ヽ。
(5)上記第 2の実施の形態において、選択情報パラメータの初期値は、秘密保持 プログラムに与えられた値としている構成を、前処理部等で、秘密保持プログラム外 のプログラムやプログラムを実行する機器が有する機能を用いて決定する値としても よい。
[0205] (6)秘密保持プログラムが秘密情報を持つ場合に、秘密情報の値を選択パラメータ 用変数、選択識別子用変数を用いて算出する処理に置き換えても構わない。
(7)上記第 2の実施の形態のプログラム難読ィ匕装置 30において、選択対象データ の数や選択パラメータの数は、必ずしも固定の値である必要はなぐ別の値であって ちょい。
[0206] また、これらの値を、プログラム難読ィ匕装置に入力として与えてもよい。 (8)上記第 2の実施の形態において、ブロックの分割の分割方法として、ここでは簡 単な方法について説明した力 この方法に限定するものではなぐブロックの分割の 仕方に応じた制御構造の解析を行 ヽ、ブロックの分割の仕方に応じた機能提供命令 群を生成すればよい。なお、制御構造の解析については、コンパイラの分野で公知 であるため説明は省略する。
[0207] (9)上記第 2実施の形態において、プログラム難読ィ匕装置 30は、式 2における各定 数を決定した後に、秘密情報を秘密情報用変数に変換したが、これに限定されない 。プログラム難読ィ匕装置 30は、複数の機能提供命令群の生成時に、秘密情報を秘 密情報用変数に変換してもよい。つまり、プログラム難読ィ匕装置 30は、式 2における 各定数を決定する前に、秘密情報を秘密情報用変数に変換してもよい。この場合、 プログラム難読ィ匕装置 30は、各秘密情報を、一時的に記憶し、式 2における各定数 を決定する際には、一時的に記憶している秘密情報を用いる。
[0208] (10)上記実施の形態及び上記変形例をそれぞれ組み合わせるとしてもよ!/、。
2. 6 まとめ
上記第 2の実施の形態では、選択対象の実行順序が、選択パラメータの初期値に よって決定するので、プログラムのみを見て選択パラメータの初期値を知らな 、不正 解析者に対し、選択対象データの実行順序の解析を困難にすることが出来る。
[0209] 更に、第 2の実施の形態では、更新処理命令群に選択パラメータを更新する処理 がある。よって、不正解析者が秘密保持プログラムと、秘密保持プログラムに与えられ る入力値とを知って 、たとしても、選択パラメータの値がどのように変わって!/ヽくかを、 順に解析して ヽかなければ、実際に選択対象が実行される順番を解析することがで きない。
3.第 3の実施の形態
以下、本発明に係る第 3の実施の形態としての秘密保持プログラム 500、プログラム 難読化装置 50及び秘密処理装置 60について、図面を参照して説明する。
[0210] 非特許文献 2及び第 1の実施の形態の難読化手法では、正しい手順においては、 各ブロックが 1度ずつしか実行されない。このことを不正解析者が知っていた場合、 効率的な解析を行うことが可能となる。 例えば、第 1の実施の形態において、プログラムの正しい初期値の組み合わせを知 らない不正解析者が、初期値の組み合わせを「0」、 「0」、 「0」と仮定した場合、秘密 保持プログラム 100は、まず、式 1を実行すると選択識別子「0」を取得し、選択対象 データ 143へ分岐する。そして、更新処理命令群 163を実行することにより、各選択 ノ ラメータの値はそれぞれ、「1」、 「0」、 「0」となる。秘密保持プログラム 100は、さら に、更新された値「1」、 「0」、 「0」を用いて、式 1を実行すると選択識別子「2」を取得 し、選択対象データ 142へ分岐する。そして、更新処理命令群 162を実行することに より、各選択パラメータの値はそれぞれ、「6」、 「1」、 「0」となる。秘密保持プログラム 1 00は、さら〖こ、更新された値「6」、 「1」、 「0」を用いて、式 1を実行すると選択識別子「 1」を取得し、各選択パラメータは、「3」、 「6」、 「1」に更新される。秘密保持プログラム 100は、値「3」、 「6」、 「1」を用いて、式 1を実行すると選択識別子「1」を取得すること になる。これは、選択対象データ 141が 2回実行されることになる。
[0211] もし、不正解析者が同じブロックが重複して実行されることがないことを知っていた ならば、この時点で選択対象データ 141が重複して実行される初期値の組み合わせ を「0」、 「0」、 「0」と仮定する実行手順は間違いであったことを知ることができる。この 場合、その後のプログラムの解析を続けてウォーターマーク除去ツールを作成するま でもなぐこの仮定が間違っていたことが分かり、効率的な解析を行うことが出来る。 すなわち、上記全数攻撃に力かる時間を短くすることができる。
[0212] そこで、本実施の形態では、どのような初期値の組み合わせを用いても、同じブロッ クが重複して実行されることない秘密保持システム 3を提供する。
3. 1 秘密保持システム 3の概要
秘密保持システム 3は、図 15に示すように、プログラム難読化装置 50と、秘密処理 装置 60とから構成されて 、る。
[0213] プログラム難読ィ匕装置 50は、実行順序を隠蔽した ヽ難読化対象プログラムから秘 密保持プログラム 500を生成し、生成した秘密保持プログラム 500を秘密処理装置 6 0へ配布する。
秘密処理装置 60は、プログラム難読ィ匕装置 50から配布された秘密保持プログラム 500を実行する。 [0214] 3. 2 秘密保持プログラム 500の構造
秘密保持プログラム 500の構造について説明する。秘密保持プログラム 500は、プ ログラムに含まれるプログラム命令群がどのような実行順序で実行されるかを、不正 解析者に解析されな ヽように、難読化されたプログラムである。
秘密保持プログラム 500は、図 16に示すように、前処理命令群 510、選択処理命 令群 520、管理情報更新命令群 525、変遷処理命令群 530、選択対象データ 540、 541、 · · ·、 546力らなり、これらが図 16に示す順番に配置されている。
[0215] また、選択対象データ 540〜546はそれぞれ、選択対象主要命令群 550〜556、 更新処理命令群 560〜566、分岐命令群 570〜576力らなり、これらは図 16に示す 順番に配置されている。各命令部は、 1以上のプログラム命令力もなるプログラム命 令群である。選択対象主要命令群 550〜556は、このプログラムが提供する機能 (例 えばウォーターマーク検出の機能)の処理の一部を示すプログラム命令群であるか、 あるいは、提供する機能とは無関係で正常系の実行時には実行されない命令群であ る。ここで、正常系とは、デバッガ等を用いてプログラムカウンタや選択パラメータを強 制的に変更するなどの特別な操作を行わずに秘密保持プログラム 500を実行する場 合のことをいう。
[0216] 難読対象プログラムは、例えば、図 17に示すコントロールフローのプログラムを実 行するプログラムである。ここで、図 17における第 1機能提供命令群 601、第 2機能 提供命令群 602、第 3機能提供命令群 603は、プログラム命令の集合であり、図 17 に示すフローで実行された場合に適切な結果を出力する命令群である。しかしなが ら、これをそのままの順番で実行すると解析が容易となるため、秘密保持プログラム 5 00においてはこの実行順序を解析されに《する難読ィ匕が施されている。すなわち、 秘密保持プログラム 500は複数の選択対象データ 540〜546のいずれかに第 1機能 提供命令群 601、第 2機能提供命令群 602、第 3機能提供命令群 603が含まれるよ うに難読ィ匕されている。
[0217] ここでは、選択対象データ 545、 546、 543に、それぞれ第 1機能提供命令群 601 、第 2機能提供命令群 602、第 3機能提供命令群 603が含まれているものとし、正常 系の実行時には、選択対象データ 545、 546、 543が順に選択されて実行されるも のとして説明を続ける。また、第 1〜第 3機能提供命令群が割り当てられていない選 択対象データ 540、 541、 542、 544は、正常系では実行されることのない選択対象 データである。これらは、正しい実行順序を知らない不正解析者が全数攻撃により解 析を行う際には実行される場合がある選択対象データであり、不正解析者が第 1〜 第 3の機能提供命令群を得に《するために組み込まれている。以下では、このような 命令群を偽装機能提供命令群と呼ぶ。
[0218] ここで、秘密保持プログラム 500のコントロールフローの一例を、図 18に示す。秘密 保持プログラム 500は、このコントロールフローにて示すように、まず、前処理命令群 510、選択処理命令群 520、管理情報更新命令群 525、変遷処理命令群 530を順 次実行し、その後、変遷処理命令群 530に基づいて、選択対象データ 540〜546の 何れかが実行される。秘密保持プログラム 500は、この処理を、選択対象データ 543 が実行されるまで、繰り返す。秘密保持プログラム 500は、変遷処理命令群 130が何 らかの分岐を行うことは分力ゝつても、選択対象データが実行される順番は分からな ヽ ような構造になっている。
[0219] ここで、秘密保持プログラム 500の具体例として C言語にて記述した秘密保持プロ グラム 500aを、図 19に示す。
プログラム命令群 510aは前処理命令群 510に対応し、プログラム命令群 520aは 選択処理命令群 520に対応し、プログラム命令群 525aは管理情報更新命令群 525 に対応し、プログラム命令群 530aは変遷処理命令群 530に対応している。また、プ ログラム命令群 540a、 543a, 545a, 546aのそれぞれは、選択対象データ 540、 54
3、 545、 546と対応して!/ヽる。
[0220] プログラム命令群 550a、 553a, 555a, 556aのそれぞれは、選択対象主要命令群 550、 553、 555、 556と対応して!/ヽる。プログラム命令群 560a、 563a, 565a, 566 aのそれぞれは、更新処理命令群 560、 563、 565、 566と対応して!/ヽる。また、プロ グラム命令群 570a、 573a, 575a, 576aのそれぞれは、分岐命令群 570、 573、 57
4、 576と対応している。なお、選択対象データ 541、 542、 544に対応する具体例は 、図面の都合上記述していない。
[0221] また、図 20において、図 19に示すプログラムの処理の流れを具体的に示す。 秘密保持プログラム 500は、呼出元のプログラムから、入力値 in— 1、 in— 2および 、このプログラムが提供する機能の処理を行う際に使用するパラメータを受け取り、こ のプログラムが提供する機能の前処理を行うプログラム命令群である。ここで、入力 値 in— 1および in— 2は、選択処理命令群 520での処理に用いる選択パラメータ CP —1および CP— 2の初期値であるものとする。本実施の形態においては、選択対象 データの数が 7つであるため、 in— 1および in— 2は、 7未満の非負整数であるものと して説明する。
[0222] ここで、秘密保持プログラム 500は、選択パラメータ CP— 1、 CP— 2を示す変数とし て「cp— 1」、「cp— 2」を、選択識別子 swVarを示す変数として「sv」を用いて!/、るもの とする。なお、選択パラメータは、選択対象データ 540、 541、 · · ·、 546から 1の選択 対象を決定する際に、使用されるパラメータであり、選択識別子は、選択対象データ を一意に識別する識別子であり、次に実行すべき選択対象データを特定する情報で ある。
[0223] 以下、図 18の各ブロックと、図 20の各ブロックとの対応関係を説明する。
図 20おいては、図 18の前処理命令群 510は、ブロック 650に記載の「cp— l = l ; c p— 2 = 2 ;tb [7] =0 ;」に相当する。選択処理命令群 520は、ブロック 651に記載の「 label A: sv= (cp_l +cp_2 * 2) %7 ; while (tb [sv] = = 1) {sv= ( + + sv) %7 山に相当する。また、管理情報更新命令群 525は、ブロック 652に記載の「tb [sv] = 1 ;」に相当し、変遷処理命令群 530は、ブロック 653に記載の「switch (sv)」に相 当し、選択対象データ 540〜546は選択対象データ 660〜666に相当して!/、る。
[0224] また、図 16に示す更新処理命令群 560〜566は、選択対象データ 660〜666に 含まれるそれぞれの「cp—l = Cp2 ; cp2—SV;」に相当する。また、第 1〜第 3機能提 供命令群のそれぞれは、「a = b = 2 ;」、「a * b;」、 [a—一 ;]に相当し、それぞれは選 択対象データ 665、 666、 663に含まれている。したがって、偽装機能提供命令群は 、選択対象データ 660、 661、 662, 664に含まれる「a= 1、 a= 2 ;」「a * =b ;b + = a;」「b——; J「a = b/a」である。
[0225] また、分岐命令群 570〜572及び 574〜586は、「goto label A;」に相当し、分 岐命令群 573は、「return;」に相当する。 それぞれの命令群の具体的な動作については以下で詳しく説明する。
3. 2. 1 前処理命令群 510
前処理命令群 510は、選択処理命令群 520で用いる選択パラメータ群の初期値を 算出するプログラム命令群である。
[0226] 前処理命令群 510は、秘密保持プログラム 500が起動された際に、最初に実行さ れるプログラム命令群である。
前処理命令群 510は、具体的には、呼び出し元のプログラム力 入力値 in— 1、 in —2を受け取り、受け取った値を選択パラメータ群の初期値として選択パラメータ CP — 1〜CP— 2に格納する命令群と、選択対象データの個数と同数の管理情報の初 期ィ匕命令とからなるプログラム命令群である。ここで、管理情報のそれぞれは、選択 対象データと対応しており、対応する選択対象データが実行されたか否かを管理し ている。
[0227] ここでは、前処理命令群 510は、選択パラメータ CP— 1〜CP— 2にそれぞれ、 in— 1、 in— 2の値を格納する処理を行う。また、正常系の実行時には、入力値 in— 1、 in — 2として値「1」、「2」が与えられるものとする。
前処理命令群 510は、管理情報の初期化として、秘密処理装置 60が有する管理 情報を初期化する。ここでは、管理情報は、 6個の配列からなり、前処理命令群 510 は、これら全ての値に未実行を示す「0」を代入することにより、管理情報の初期化を 行っている。
[0228] ここで、前処理命令群 510は、図 20におけるブロック 650に記載の「cp— l =in— 1 ; cp— 2 = in— 2; tb [7] = 0;」に相当する。
3. 2. 2 選択処理命令群 520
選択処理命令群 520は、選択パラメータ群を用いて、選択識別子を算出するプロ グラム命令群である。
[0229] 以下、選択処理命令群 520が選択識別子を算出する処理について説明する。なお 、以下の説明では、選択対象データの数を NNという記号で表す。
まず、選択処理命令群 520は、値 NNと、値 NNと互いに素な整数である pi及び p2 とを用いた式 3「pl X (選択パラメータ CP_1) +p2 X (選択パラメータ CP_2) mo d NN」により、仮の選択識別子を算出する。ここで演算子「X」は掛け算を表す。ま た、 piと NNと互いに素とは piと NNの最大公約数が 1であることを示す。ここでは、 p
1、 p2、及び NNをそれぞれ、「1」、「2」、及び「7」とする。
[0230] 次に、選択処理命令群 520は、式 3の結果を仮の選択識別子 swVarとして選択識 別子用変数 svに格納する。続いて、選択処理命令群 520は、 svが示す選択対象デ ータが既に実行されている力否力判断する。
svが示す選択対照データが未実行であると判断する場合には、選択処理命令群 5
20は、 svの値を変更せず、選択識別子の値を現在の svの値に決定する。
[0231] svが示す選択対象データが既に実行されて!、ると判断する場合は、選択処理命令 群 520は、算出した値以降で直近の未実行の選択対象データを検索する。ここで、 算出した値以降の全ての選択対象データが既に実行済みであった場合には、選択 処理命令群 520は、最初の選択対象データから順に未実行の選択対象データを検 索する。
選択処理命令群 520は、検索により見つかった選択対象データの番号を選択識別 子用変数 svに格納する。このような処理を行うことにより、算出した値に対応する選択 対象データが既に実行されている場合でも、未実行の選択対象データが常に選択さ れることとなり、正常系の実行時であるカゝ否かに関わらず、常に異なる対象データが 実行されることとなる。
[0232] ここで、選択処理命令群 520は、図 20におけるブロック 651に記載の「sv= (cp— 1
+ cp— 2 * 2) % 7; while (tb [sv] = = 1 ) { sv = ( + + sv) % 7; }」に相当する。
3. 2. 3 管理情報更新命令群 525
管理情報更新命令群 525は、選択処理命令群 520で選択した選択対象データに 対応する管理情報を、「実行済み」を示す状態に更新するプログラム命令群である。 具体的には、図 20におけるブロック 652に記載の「tb [sv] = 1;」に相当する。
[0233] 例えば、選択処理命令群 520の動作の結果、選択識別子用変数 svの値が「5」に なった場合には、管理情報更新命令群 525は、選択対象データ 545に対応する管 理情報 tb [5]の値を、未実行を示す「0」から実行済みを示す「 1」へと更新する。
3. 2. 4 変遷処理命令群 530 変遷処理命令群 530は、選択処理命令群 520で選択した選択識別子に基づき、 いずれかの選択対象データ 540〜546に分岐する処理を行うプログラム命令群であ る。具体的には、選択識別子用変数 svの値が、 0、 1、 · · ·、 6の場合にそれぞれ、選 択対象データ 540、 541、 · · ·、 546への分岐を行うプログラム命令群である。
[0234] 具体例として、秘密保持プログラム 500が記述されるプログラムが C言語のプロダラ ムであり、選択対象データ 540、 541、 · · ·、 546の先頭に、それぞれラベル「label— 140 :」、「label— 141 :」、 · · ·、「label— 146 :」が記述されている場合には、変遷処 理命令群 530は以下のようなプログラム命令となる。
[0235] 「
switcn (sv) t
case 0 : goto label― 140 ;
case 1 : goto label― 141; case 6: goto label― 146;
J
3. 2. 5 選択対象データ 540〜546
選択対象データ 540〜546は、変遷処理命令群 530により分岐してきた際に、実 行されるプログラム命令群である。
[0236] 選択対象データ 540〜546は、それぞれ、選択対象主要命令群 550〜556、更新 処理命令群 560〜566、分岐命令群 570〜576からなるプログラム命令群である。 選択対象主要命令群 550〜556は、各選択対象データにおいて行うべき処理を示 すプログラム命令群である。具体的には、例えば、選択対象データ 660に記載の「a
= l ;b = 2 ;」がこれに当たる。
[0237] 更新処理命令群 560〜566は、選択パラメータ群に含まれる各値の更新を行うプロ グラム命令群である。ここでは、一例として、選択パラメータ変数 cp— 2に格納されて いる値を選択パラメータ変数 cp— 1に代入し、選択パラメータ変数 cp— 2に、選択識 別子用変数 svの値を代入している。具体的には、図 20における選択対象データ 66 0〜666のそれぞれに含まれる「cp— 1 = cp2 ; cp_2 = sv;」がこれに当たる。
[0238] 分岐命令群 570〜576は、それぞれ選択対象データ 540〜546の外にある選択処 理命令群 520へ分岐するプログラム命令群、及びプログラム呼出元に制御を戻す処 理のプログラム命令群の 、ずれかである。
ここで、最後に実行されるべき第 3機能提供命令群を含む選択対象データ 543の 分岐命令群 573は、プログラム呼び出し元に制御を戻す処理のプログラム命令群で あり、他の選択対象データに含まれる分岐命令群は、選択処理命令群 120へ分岐 するプログラム命令群である。具体的には、図 20における選択対象データ 660〜66 6のそれぞれに含まれる「goto label A;」、又は「return」がこれに当たる。
[0239] 3. 3 秘密処理装置 60
ここでは、秘密保持プログラム 500を実行する秘密処理装置 60につ ヽて述べる。 秘密処理装置 60は、図 21に示すように、制御部 700と記憶部 701とから構成され ている。
秘密処理装置 60は、具体的には、マイクロプロセッサ、 ROM、 RAM,ハードデイス クユニット、ディスプレイユニット、キーボード、マウスなどから構成されるコンピュータ システムである。前記 RAM又は前記ハードディスクユニットには、コンピュータプログ ラムが記憶されている。ここで、コンピュータプログラムは、所定の機能を達成するた めに、コンピュータに対する指令を示す命令コードが複数個組み合わされて構成さ れたものである。前記マイクロプロセッサ力 前記コンピュータプログラムに従って動 作することにより、秘密処理装置 60は、その機能を達成する。つまり、前記マイクロプ 口セッサは、前記コンピュータプログラムに含まれる各命令を 1個ずつ読み出し、読み 出した命令を解読し、解読結果に従って動作する。
[0240] 3. 3. 1 記憶部 701
記憶部 701は、図 21に示すように、第 1プログラム記憶部 702、第 2プログラム記憶 部 703、管理情報保持部 704、及び選択パラメータ群保持部 705を有している。
(1)第 1プログラム記憶部 702
第 1プログラム記憶部 702は、秘密保持プログラムに含まれる複数の選択対象デー タを記憶している。ここで、選択対象データは、秘密情報を用いた処理の手順を示す 情報であり、具体的にはプログラム命令の集合等である。これらの選択対象データは
、制御部 700からの指示に応じていずれかが選択され、秘密処理装置 60により選択 された選択対象データに示される手順が実行される。また、選択対象データは、秘密 情報を用いた演算の正し 、手順を分割したもの、又は正常系では実行されることの な 、偽装の秘密情報を用いた演算を含むものである。
[0241] なお、ここでは、第 1プログラム記憶部 702には、選択対象データ 540、 541、 · · ·、 546の計 7つが記憶されているとする力 この数が 7つに限られるものではないことは 言うまでもない。
(2)第 2プログラム記憶部 703
第 2プログラム記憶部 703は、秘密保持プログラムに含まれる複数の選択対象デー タ以外のプログラム命令を記憶して 、る。
[0242] 具体的には、第 2プログラム記憶部 703は、秘密保持プログラム 500に含まれる前 処理命令群 510、選択処理命令群 520、管理情報更新命令群 525、変遷処理命令 群 530を記憶している。
(3)管理情報保持部 704
管理情報保持部 704は、各選択対象データのそれぞれに対して、選択対象データ の実行及び未実行の情報を管理する管理情報を保持している。
[0243] 管理情報保持部 704は、図 22に示すように、管理情報テーブル T700を有してい る。
管理情報テーブル T700は、選択対象データの個数からなり、選択対象データの それぞれに対応する管理情報を記憶する領域を有している。
管理情報テーブル T700に含まれる管理情報 710〜716のそれぞれは、順に、選 択対象データ 540〜546に対応している。
[0244] 管理情報 710〜716格納される初期値は、未実行であることを示す値「0」である。
選択対象データが制御部 700により選択されると、対応する管理情報は、制御部 7 00により値「0」から実行済であることを示す値「 1」へと更新される。
(4)選択パラメータ群保持部 705
選択パラメータ群保持部 705は、選択パラメータ CP 1、 CP 2からなる選択パラ メータ群を保持する。
[0245] 3. 3. 2 制御部 700
制御部 700は、秘密処理装置 60全体の動作を制御し、秘密情報を用いた処理 (秘 密保持プログラム)を解析が困難になるように実行する。
制御部 700は、図 23に示すように、全体処理部 720、前処理部 721、選択処理部 722、管理情報更新部 723、変遷処理部 724、及び更新処理部 725を有している。
[0246] なお、制御部 700は、これらの構成要素を別個の構成として備えるのではなぐ制 御部 700が随時これらの構成要素それぞれの機能を果たすものとしてもよい。
(1)前処理部 721
前処理部 721は、秘密保持プログラムが起動された際に、最初に動作する。
前処理部 721は、第 2プログラム記憶部 703から前処理命令群に含まれる 1以上の プログラム命令を、全体処理部 720を介して、読み出し、読み出した 1以上のプロダラ ム命令を秘密保持プログラムの構造に基づ 、て、順次実行する。
[0247] 具体的には、前処理部 721は、まず、呼出元のプログラム力 の入力値 in— 1、 in —2を、選択パラメータ CP— 1及び CP— 2の初期値として取得し、取得した選択パラ メータ CP— 1及び CP— 2を、全体処理部 720を介して選択パラメータ群保持部 705 へ格納する。次に、前処理部 721は、管理情報保持部 704の初期化を行う。つまり、 管理情報テーブル T700に含まれる各管理情報の値を「0」に設定する。
[0248] (2)選択処理部 722
選択処理部 722は、選択パラメータを用いて選択識別子 swVarを決定する。
選択処理部 722は、第 2プログラム記憶部 703から選択処理命令群に含まれる以 上のプログラム命令を、全体処理部 720を介して、読み出し、読み出した 1以上のプ ログラム命令を秘密保持プログラムの構造に基づ 、て、順次実行する。
[0249] 具体的には、選択処理部 722は、選択パラメータ群保持部 705に格納されている 選択パラメータ CP— 1及び CP— 2と、選択処理命令群に含まれる式 3とを用いて、仮 の選択識別子を算出する。選択処理部 722は、管理情報テーブル T700を用いて、 算出した仮の選択識別子に対応する選択対象データが実行済であるカゝ否かを判定 する。 実行済であると判定する場合には、選択処理部 722は、未実行の選択対象データ を示す識別子を取得し、取得した値を選択識別子 swVarとする。
[0250] 未実行であると判定する場合には、選択処理部 722は、算出した仮の選択識別子 を、選択識別子 swVarとする。
このような処理を行うことにより、選択処理部 722は、選択識別子 swVarとして、常 に未実行の選択対象データに対応する値を取得することができる。すなわち、選択 ノ ラメータの初期値がどのような値であっても同一の選択対象データが重複して実行 されることはなくなるため、不正解析者による解析を困難にすることができる。
[0251] (3)管理情報更新部 723
管理情報更新部 723は、選択処理部 722にて選択された選択対象データに対応 する管理情報を更新する。
管理情報更新部 723は、第 2プログラム記憶部 703から管理情報命令群に含まれ る以上のプログラム命令を、全体処理部 720を介して、読み出し、読み出した 1以上 のプログラム命令を秘密保持プログラムの構造に基づ 、て、順次実行する。
[0252] 具体的には、管理情報更新部 723は、管理情報テーブル T700に含まれる複数の 管理情報のうち、選択処理部 722にて取得された選択識別子 swVarに対応する管 理情報を、値「0」から値「1」へと更新する。
例えば、図 22において、選択処理部 722が選択識別子 swVarの値を「5」とした場 合には、管理情報更新部 723は、選択対象データ 545に対応する管理情報 715の 値を「1」に更新する。
[0253] (4)変遷処理部 724
変遷処理部 724は、選択処理部 722で選択された選択識別子 swVarに基づき、 複数の選択対象データのうち、分岐先の選択対象データを決定し、決定した選択対 象データに含まれる選択対象主要命令群を実行する。
変遷処理部 724は、第 2プログラム記憶部 703から変遷処理命令群に含まれる以 上のプログラム命令を、全体処理部 720を介して、読み出し、読み出したプログラム 命令を秘密保持プログラムの構造に基づ 、て、順次実行する。
[0254] 具体的には、変遷処理部 724は、選択処理部 722で選択された選択識別子 swVa rに基づき、複数の選択対象データのうち、分岐先の選択対象データを決定する。 変遷処理部 724は、決定した選択対象データに含まれる選択対象主要命令群を、 全体処理部 720を介して、読み出し、読み出した選択対象主要命令群を実行する。
(5)更新処理部 725
更新処理部 725は、選択された選択対象データに含まれる選択対象主要命令群 が実行された後に、選択パラメータの値を更新する処理を行う。
[0255] 更新処理部 725は、選択された選択対象データに含まれる更新処理命令群を、全 体処理部 720を介して第 1プログラム記憶部 702から、読み出し、読み出した更新処 理命令群を実行する。
具体的には、更新処理部 725は、選択パラメータ群保持部 705に格納されている 選択パラメータ CP_1及び CP_2と、選択識別子とを用いて、選択パラメータ CP_ 1及び CP— 2の更新を行う。更新方法については、上述しているので、ここでの説明 は省略する。
[0256] (6)全体処理部 720
全体処理部 720は、制御部 700に含まれる各構成部の動作の制御を行う。
全体処理部 720は、秘密保持プログラムの実行開始時には、前処理部 721、選択 処理部 722、管理情報更新部 723、変遷処理部 724、更新処理部 725の順に動作 するように制御する。
[0257] 全体処理部 720は、選択対象データに含まれる分岐命令群に基づ!/、て、秘密保 持プログラムの終了の制御、及び選択処理部 722、管理情報更新部 723、変遷処理 部 724、更新処理部 725の順に動作するように制御の ヽずれかを行う。
具体的には、全体処理部 720は、選択された選択対象データに含まれる分岐命令 群を、全体処理部 720を介して第 1プログラム記憶部 702から、読み出す。
[0258] 全体処理部 720は、読み出した分岐命令群力 選択処理命令群への分岐を示す プログラム命令群である場合には、選択処理部 722、管理情報更新部 723、変遷処 理部 724、更新処理部 725の順に動作するように制御する。
全体処理部 720は、読み出した分岐命令群力 プログラム呼出元に制御を戻す処 理のプログラム命令群である場合には、全体処理部 720は、秘密保持プログラムを 終了し、秘密保持プログラムの呼び出し元に制御を戻す。
[0259] 3. 3. 3 秘密処理装置 60の動作
ここでは、秘密処理装置 60の動作を、図 24にて示す流れ図を用いて説明する。 秘密処理装置 60の前処理部 721は、呼出元のプログラム若しくは外部装置等から の入力値 in— 1、 in— 2を、選択パラメータ CP— 1及び CP— 2の初期値として取得し 、取得した選択パラメータ CP_1及び CP_2を、全体処理部 720を介して選択パラ メータ群保持部 705へ格納し、管理情報保持部 704の管理情報テーブル T700の初 期化を行う(ステップ S 500)。
[0260] また、前処理部 721は、必要であれば、記憶部 701上に第 1プログラム記憶部 702 、第 2プログラム記憶部 703、管理情報保持部 704、選択パラメータ群保持部 705〖こ 用いる領域を確保し、各領域に記憶される値の初期化を行う。
選択処理部 722は、選択パラメータ群保持部 705に格納されている選択パラメータ CP— 1及び CP— 2と、選択処理命令群に含まれる式 3とを用いて、仮の選択識別子 を算出する (ステップ S505)。
[0261] 選択処理部 722は、管理情報テーブル T700を用いて、算出した仮の選択識別子 に対応する選択対象データが実行済であるか否かを判定する (ステップ S510)。 実行済であると判定する場合には (ステップ S510における「YES」)、選択処理部 7 22は、仮の選択識別子を更新する (ステップ S515)。ここで、ステップ S510および S 515の具体例は、図 20におけるブロック 651に含まれる「while(tb[sv] = = l){sv=( + +sv)%7 ;」等である。この例では、 tb[sv]の値が 1 (実行済みを示す)である限り、 s Vをインクリメントしていくことにより、未実行の選択対象データに相当する選択識別子 を探索している。
[0262] 未実行であると判定する場合には (ステップ S510における「NO」)、選択処理部 72 2は、算出した仮の選択識別子を、選択識別子 swVarとする。管理情報更新部 723 は、管理情報テーブル T700に含まれる複数の管理情報のうち、選択識別子 swVar に対応する管理情報を、値「0」力も値「 1」へと更新する (ステップ S520)。
変遷処理部 724は、選択識別子 swVarに基づき、複数の選択対象データのうち、 分岐先の選択対象データを取得し、取得した選択対象データに含まれる選択対象 主要命令群を実行する (ステップ S525)。
[0263] 更新処理部 725は、選択パラメータ群保持部 705に格納されている選択パラメータ
CP— 1及び CP— 2と、選択識別子とを用いて、選択パラメータ CP— 1及び CP— 2の 更新を行う(ステップ S530)。
全体処理部 720は、選択された選択対象データに含まれる分岐命令群がプロダラ ムの終了を示すか否かを判断する(ステップ S535)。
[0264] 分岐命令群がプログラムの終了を示すと判断する場合には (ステップ S535におけ る「YES」)、全体処理部 720は、秘密保持プログラムを終了し、秘密保持プログラム の呼び出し元に制御を戻す。
分岐命令群がプログラムの終了を示さないと判断する場合には (ステップ S535に おける「NO」)、つまり、分岐命令群が、選択処理命令群への分岐を示すと判断する 場合には、全体処理部 720は、ステップ S505へ戻る。
[0265] ステップ S535は、具体的には、選択された選択対象データに含まれる分岐命令群 が選択処理命令群に分岐する命令群 (例えば、 goto文)である場合には、判断結果 を「NO」とし、分岐命令群がプログラムの終了を示す命令群 (例えば、 return文)で ある場合には、判断結果を「YES」とする。
3. 4 プログラム難読化装置 50
ここでは、実行順序を隠蔽したい難読ィ匕対象プログラムから、秘密保持プログラム 5 00を生成するプログラム難読ィ匕装置 50について述べる。
[0266] プログラム難読ィ匕装置 50は、図 25に示すように、プログラム記憶部 800、入力部 8 01、機能提供命令群生成部 802、偽装機能提供命令群生成部 803、配置順序決定 部 804、管理命令群生成部 805、秘密保持プログラム生成部 806、及び出力部 807 から構成されている。
プログラム難読化装置 50は、具体的には、マイクロプロセッサ、 ROM、 RAM、ノヽ ードディスクユニット、ディスプレイユニット、キーボード、マウスなどから構成されるコン ピュータシステムである。前記 RAM又は前記ハードディスクユニットには、コンビユー タプログラムが記憶されている。ここで、コンピュータプログラムは、所定の機能を達成 するために、コンピュータに対する指令を示す命令コードが複数個組み合わされて 構成されたものである。前記マイクロプロセッサ力 前記コンピュータプログラムに従つ て動作することにより、プログラム難読ィ匕装置 50は、その機能を達成する。つまり、前 記マイクロプロセッサは、前記コンピュータプログラムに含まれる各命令を 1個ずつ読 み出し、読み出した命令を解読し、解読結果に従って動作する。
[0267] 3. 4. 1 プログラム記憶部 800
プログラム記憶部 800は、当該装置で生成した各命令群、及び選択対象データを 記憶するための領域を有して 、る。
3. 4. 2 入力部 801
入力部 801は、難読ィ匕対象となるプログラム、及び生成した秘密保持プログラムに 与える 2つの初期値を受け付ける。
[0268] 3. 4. 3 機能提供命令群生成部 802
機能提供命令群生成部 802は、入力部 801にて受け付けた難読ィ匕対象プログラム を 1以上のプログラム命令力もなる複数のブロックに分割する。機能提供命令群生成 部 802は、分割した各ブロックを、機能提供命令群とする。これにより、機能提供命令 群生成部 802は、入力部 801にて受け付けた難読ィ匕対象プログラム力も複数の機能 提供命令群を生成することができる。
[0269] 機能提供命令群生成部 802は、複数のブロックに分割する際に、難読化対象プロ グラムに条件飛び越しを行うプログラム命令が含まれる場合には、機能提供命令群 生成部 802は、その条件飛び越しを行うプログラム命令と複数ある飛び越し先のプロ グラム命令とが全て同じブロックに含まれるように分割を行う。このように分割すること で、機能提供命令群生成部 802は、一つのブロックからの分岐先を必ず一つのプロ ックにすることが出来る。
[0270] また、入力プログラムに無条件飛び越しを行うプログラム命令がある場合には、機能 提供命令群生成部 802は、その無条件飛越を行うプログラム命令と飛び越し先のプ ログラム命令とは同じブロックになるように分割を行う。このように分割することで、機 能提供命令群生成部 802は、一つのブロックに対する分岐元を必ず一つのブロック にすることが出来る。
[0271] ここで、「条件飛び越しを行う命令」とは、所定の条件に従ってプログラム命令を飛 ばすような命令であり、具体的には、「if (a= =0) goto labelA;」等であるこの場 合、変数 aがゼロであるという条件が満たされた場合に、 labelAへとプログラム命令の 飛び越しを行う。また、「無条件飛び越しを行う命令」とは、常にプログラム命令を飛ば す命令であり、具体的には「goto labelA;」等である。この場合、特に変数の値等に 関わらず、常に labelAへの飛び越しが行われる。
[0272] ここでは、機能提供命令群生成部 802は、 3つの機能提供命令群に分割したものと する。この場合におけるコントロールフローグラフは、図 17と同様になる。すなわち、 前述したように飛び越し命令の飛び越し元と飛び越し先とが 1つのブロックに含まれ るよう分割しているので、生成されるブロックのコントロールフローグラフは、分岐のな いコントロールフローとなる。ここでは、コントロールフローの始点となるブロックから順 番に、各ブロックを構成するプログラム命令群を第 1、第 2及び第 3機能提供命令群と する。
[0273] 3. 4. 4 偽装機能提供命令群生成部 803
偽装機能提供命令群生成部 803は、入力部 801にて受け付けた難読化対象プロ グラムを元に、複数の偽装機能提供命令群を生成する。
偽装機能提供命令群生成部 803は、例えば、難読化対象プログラムが記述されて いるプログラミング言語のプログラム命令をランダムに組み合わせた偽装機能提供命 令群を生成する。
[0274] なお、難読化対象プログラムに含まれて!/、るプログラム命令のみを用いてランダム あるいは手動で偽装機能提供命令群を生成しても構わないし、入力プログラム内に ない命令を適当に生成しても構わない。また、プログラミング言語力 C言語、 Java ( 登録商標)言語などのコンパイル処理を行うプログラミング言語である場合には、コン パイルが通るように入力プログラムで使われて ヽる変数を用いて偽装機能提供命令 群を生成する。また、入力プログラムで使われていない変数を偽装機能提供命令群 に含める場合には、難読ィ匕後のプログラムにそのような変数の宣言を追加することに よりコンノィルに失敗しないようにする。
[0275] ここでは、偽装機能提供命令群生成部 803は、 4つの偽装機能提供命令群を生成 したものとして説明を続ける。 3. 4. 5 管理命令群生成部 805
管理命令群生成部 805、秘密保持プログラム 500のうち、難読ィ匕対象プログラムに 依存しないプログラム命令群を生成する。すなわち、図 16の秘密保持プログラム 500 を例にすると、難読化対象プログラムに依存して変化するのは、難読化対象プロダラ ムの手順を分割したものである選択対象主命令群である 150〜 156であるため、管 理命令群生成部 805は、その他の命令群を生成する。
[0276] 具体的には、管理命令群生成部 805は、前処理命令群 510、選択処理命令群 52 0、管理情報更新命令群 525、変遷処理命令群 530、 1個の更新処理命令群、分岐 先が選択処理命令群を示すプログラム命令群からなる第 1の分岐命令群、及びプロ グラム呼出元に制御を戻す処理のプログラム命令群力 なる第 2の分岐命令群を生 成する。
このとき、管理命令群生成部 805は、機能提供命令群生成部 802にて生成された 複数の機能提供命令群の個数 (ここでは、 3個)と、偽装機能提供命令群生成部 803 にて生成された複数の偽装機能提供命令群の個数 (ここでは、 4個)とを取得し、そ の合計値を算出する。管理命令群生成部 805は、算出した合計値 (ここでは、 7)と同 数のラベル名を生成する。管理命令群生成部 805は、選択処理命令群 520に含ま れる式 3が取り得る値のそれぞれに対して、分岐先として、生成したラベル名を対応 付けることにより、変遷処理命令群 530を生成する。
[0277] 管理命令群生成部 805は、生成した各ラベル名のみ力もなる選択対象データを生 成する。ここでは、管理命令群生成部 805は、 7個の選択対象データ 540〜546を 生成する。
ここで、管理命令群生成部 805は、生成した前処理命令群 510、選択処理命令群 520、管理情報更新命令群 525、変遷処理命令群 530、 1個の更新処理命令群、第 1の分岐命令群、及び第 2の分岐命令群をプログラム記憶部 800へ格納する。
[0278] また、管理命令群生成部 805は、生成した各ラベル名のみからなる選択対象デー タ 540〜546をもプログラム記憶部 800へ格納する。
3. 4. 6 配置順序決定部 804
配置順序決定部 804は、生成した機能提供命令群 (ここでは、 3つの機能提供命 令群)、および偽装機能提供命令群 (ここでは、 4つの偽装機能提供命令群)をどの ような順序で選択対象主要命令群 550〜556に割り当てるのかを決定する。具体的 には、配置順序決定部 804は、選択対象主要命令群 550〜556のいずれに第 1〜 第 3機能提供命令群を配置するかを決め、残り 4つの選択対象主要命令群のいずれ に偽装機能提供命令群を配置するかを決める。
[0279] 配置順序決定部 804は、上述した式 3を予め記憶している。ここでは、式 3における pl、 p2、及び NNをそれぞれ、「1」、「2」、及び「7」とする。
なお、ここでは、後述する管理命令群生成部 805にてラベル名からなる選択対象 主要命令群 550〜556が生成されて!、るものとする。
配置順序決定部 804は、入力部 801にて受け付けた 2つの選択パラメータの初期 値と、予め記憶している式 3を用いて、実際にどのような順序で選択識別子が算出さ れるのかを確認することにより、機能提供命令群および偽装機能提供命令群が配置 されるべき選択対象主要命令群を決定する。
[0280] なお、入力部 801にて 2つの初期値として、選択パラメータ CP— 1 (= 1)、 CP— 2 (
= 2)を受け付けたものとする。以下に配置の決定方法の一例について説明する。 配置順序決定部 804は、図 26に示すように、制御部 850、選択処理部 851、管理 情報更新部 852、更新処理部 853及び管理情報保持部 854を備えている。以下、 配置順序決定部 804の各構成要素についての詳細を説明する。
[0281] (1)管理情報保持部 854
管理情報保持部 854は、管理情報テーブル T800を有している。管理情報テープ ル T800のデータ構造は、管理情報保持部 704が有する管理情報テーブル T700の データ構造と同様であるので、ここでの説明は省略する。
なお、ここでは、管理情報テーブル T800に格納される値「1」は、対応する選択対 象データには、機能提供命令群が配置されていることを示し、値「0」は、対応する選 択対象データには、機能提供命令群が配置されていないことを示す。
[0282] また、管理情報テーブル T800の各管理情報の初期値は「0」である。
これにより、機能提供命令群が配置された位置 (配置された選択対象データ)を記 '隐することができる。 (2)制御部 850
制御部 850は、選択パラメータ群を記憶するパラメータ記憶領域を有して!/、る。
[0283] 制御部 850は、入力部 801にて受け付けた選択パラメータの初期値 CP— 1及び C P— 2 (ここでは、それぞれ「1」、「2」)をパラメータ記憶領域に記憶する。
制御部 850は、選択処理部 851、管理情報更新部 852、及び更新処理部 853の 動作を制御する。
制御部 850は、後述する選択処理部 851が有する式 3が取り得る値、つまり、式 3に て取り得る選択識別子の値それぞれと、プログラム記憶部 800にて記憶されて 、る選 択対象データとの対応付けを行う。
[0284] 制御部 850は、生成された第 i番目の機能提供命令群を機能提供命令群生成部 8 02から取得する。制御部 850は、取得した第潘目の機能提供命令群を、選択処理 部 851にて取得された選択識別子に基づいて、プログラム記憶部 800にて記憶され 、対応する選択対象データへ挿入する。ここで、 iは 1以上 m以下の整数である。また 、制御部 850は、第 i番目の機能提供命令群と、挿入先の選択対象データとの対応 付けを一時的に記憶して 、る。
[0285] 制御部 850は、生成された複数の偽装機能提供命令群のうち選択対象データに挿 入されていない 1の偽装機能提供命令群を偽装機能提供命令群生成部 803から取 得する。制御部 850は、取得した偽装機能提供命令群を、第 i機能提供命令群、又 は偽装機能提供命令群が挿入されて!ヽな ヽ 1の選択対象データに挿入する。制御 部 850は、この動作を、全ての偽装機能提供命令群に対して行う。
[0286] これにより、制御部 850は、各選択対象データに、第 i機能提供命令群、又は偽装 機能提供命令群が挿入することができる。
制御部 850による第 i番目の機能提供命令群を取得する動作により、配置対象とな る機能提供命令群を選択することができる。
(3)選択処理部 851
選択処理部 851は、上述した式 3を予め記憶している。
[0287] 選択処理部 851は、ノ メータ記憶領域に記憶されている選択パラメータ CP— 1、 及び CP— 2を取得する。 選択処理部 851は、取得した CP— 1及び CP— 2と、予め記憶している式 3とを用い て、仮の選択識別子を算出する。選択処理部 851は、管理情報テーブル T800を用 いて、算出した仮の選択識別子に対応する選択対象データが配置済である力否か を判定する。
[0288] 配置済であると判定する場合には、選択処理部 851は、未配置の選択対象データ を示す識別子を取得し、取得した値を選択識別子 swVarとする。
未配置であると判定する場合には、選択処理部 851は、算出した仮の選択識別子 を、選択識別子 swVarとする。
選択処理部 851の動作と、制御部 850による第 i番目の機能提供命令群を選択処 理部 851にて取得された選択識別子に基づき選択対象データに挿入する動作と〖こ より、機能提供命令群を適切な配置先へ配置することができる。
[0289] (4)管理情報更新部 852
管理情報更新部 852は、管理情報テーブル T800に含まれる複数の管理情報のう ち、選択処理部 851にて取得された選択識別子 swVarに対応する管理情報を、値「 0」から値「1」へと更新する。
(5)更新処理部 853
更新処理部 853は、ノ メータ記憶領域にて記憶されている選択パラメータ群と、 選択処理部 851にて取得された選択識別子とを用いて、選択パラメータ CP— 1及び CP— 2の更新を行う。なお、更新方法は、上述しているので、ここでの説明は省略す る。
[0290] 更新処理部 853は、更新した選択パラメータ群を、制御部 850のパラメータ記憶領 域へ上書きする。
3. 4. 7 秘密保持プログラム生成部 806
秘密保持プログラム生成部 806は、プログラム記憶部 800にて記憶されて 、る更新 処理命令群を、選択対象データのそれぞれに対して、選択対象主要命令群の次に 位置するように挿入する。これにより、秘密保持プログラム生成部 806は、選択対象 データのそれぞれに対して、更新処理命令群 560〜566を生成することができる。管 理命令群生成部 805による更新処理命令群の生成の動作と、秘密保持プログラム生 成部 806による上記動作とにより、更新処理命令群 560〜566を適切な配置先へ挿 人することができる。
[0291] 秘密保持プログラム生成部 806は、第 m番目の機能提供命令群 (つまり、正常系に て最後に実行される機能提供命令群)が挿入された選択対象データに対して、管理 命令群生成部 805にて生成された第 2の分岐命令群を、更新処理命令群の次に位 置するように挿入する。このとき、秘密保持プログラム生成部 806は、第 m番目の機 能提供命令群の最後にプログラム呼出元に制御を戻す処理のプログラム命令が含ま れている場合には、そのプログラム命令を削除する、若しくは、第 2の分岐命令群を 挿入しない。
[0292] 秘密保持プログラム生成部 806は、他の選択対象データに対して、管理命令群生 成部 805にて生成された第 1の分岐命令群を、更新処理命令群の次に位置するよう に挿入する。これにより、秘密保持プログラム生成部 806は、選択対象データ 540〜 546を生成することができる。
秘密保持プログラム生成部 806は、プログラム記憶部 800にて記憶されて 、る各命 令群を配置し、秘密保持プログラム 500を生成する。すなわち、管理命令群生成部 8 05は、生成した各命令群を図 16に示す順序に配置する。
[0293] 3. 4. 8 出力部 807
出力部 807は、生成した秘密保持プログラムを、秘密処理装置 60へ出力する。
3. 4. 9 プログラム難読化装置 50の動作
(1)動作概要
ここでは、プログラム難読ィ匕装置 50の動作概要について、図 27に示す流れ図を用 いて説明する。
[0294] 入力部 801は、難読ィ匕対象となるプログラム、及び生成した秘密保持プログラムに 与える 2つの初期値を受け付ける (ステップ S600)。
機能提供命令群生成部 802は、入力部 801にて受け付けた難読ィ匕対象プログラム を 1以上のプログラム命令力もなる複数のブロックに分割する (ステップ S605)。 偽装機能提供命令群生成部 803は、入力部 801にて受け付けた難読化対象プロ グラムを元に、複数の偽装機能提供命令群を生成する (ステップ S610)。 [0295] 管理命令群生成部 805は、前処理命令群 510、選択処理命令群 520、管理情報 更新命令群 525、変遷処理命令群 530、 1個の更新処理命令群、分岐先が選択処 理命令群を示すプログラム命令群からなる第 1の分岐命令群、及びプログラム呼出 元に制御を戻す処理のプログラム命令群からなる第 2の分岐命令群、及びラベル名 のみからなる複数の選択対象データを生成する (ステップ S615)。なお、選択対象デ ータの個数は、機能提供命令群の個数と偽装機能提供命令群の個数の合計値と同 一である。
[0296] 配置順序決定部 804は、選択パラメータ群と、予め記憶して 、る式 3を用いて、機 能提供命令群および偽装機能提供命令群の配置先を決定する (ステップ S620)。 秘密保持プログラム生成部 806は、管理命令群生成部 805にて生成された更新処 理命令群を用いて、選択対象データのそれぞれに対する更新処理命令群 560〜56 6を生成する。秘密保持プログラム生成部 806は、第 1及び第 2の分岐命令群を用い て、選択対象データ 540〜546を生成する。秘密保持プログラム生成部 806は、生 成された各命令群を配置し、秘密保持プログラム 500を生成する (ステップ S625)。
[0297] 出力部 807は、生成した秘密保持プログラムを、秘密処理装置 60へ出力する (ステ ップ S 630)。
(2)配置決定処理
ここでは、図 27のステップ S620にて示す配置決定処理の動作について、図 28に 示す流れ図を用いて説明する。
[0298] 制御部 850は、カウンタ iに「1」を設定し、選択パラメータ群の初期値をパラメータ記 憶領域へ格納する。制御部 850は、選択識別子の値それぞれと、プログラム記憶部 800にて記憶されている選択対象データとの対応付けを行う(ステップ S700)。ここ で、カウンタ iは、現在着目している機能提供命令群が何番目に実行されるべきであ るカゝを表す。すなわち、ここでは、第 1の機能提供命令群カゝら順番に配置順序を決定 していく。
[0299] 選択処理部 851は、ノ メータ記憶領域に記憶されている選択パラメータ CP_1、 及び CP— 2を取得する。選択処理部 851は、取得した CP— 1及び CP— 2と、予め 記憶している式 3とを用いて、仮の選択識別子を算出する (ステップ S705)。例えば、 選択パラメータ CP— 1〜CP— 2の値が「1」、「2」である場合には、式 3の値は「1 X 1 + 2 X 2 MOD 7 = 5」になる。
[0300] 選択処理部 851は、管理情報テーブル T800を用いて、算出した仮の選択識別子 に対応する管理情報の値力 S「 1」であるか否かを判定する (ステップ S 710)。
「1」あると判定する場合には (ステップ S710における「YES」)、選択処理部 851は 、仮の選択識別子を更新し (ステップ S715)、ステップ S710へ戻る。具体的には、選 択処理部 851は、算出した仮の選択識別子が「5」であり、値「5」に対応する管理情 報の値が「1」である場合には、仮の選択識別子「5」以降の直近に値「6」を仮の選択 識別子とする。
[0301] 「1」でないと判定する場合には (ステップ S710における「NO」)、選択処理部 851 は、算出した仮の選択識別子を、選択識別子 swVarとし、制御部 850は、第 i番目の 機能提供命令群を、選択処理部 851にて取得された選択識別子 swVarに基づ ヽて 、対応する選択対象データへ挿入する (ステップ S 720)。例えば cont = 1 で、選 択識別子の値が「5」であった場合には、第 1機能提供命令群が、選択対象データ 54 5に配置されることとなる。
[0302] 管理情報更新部 852は、管理情報テーブル T800に含まれる複数の管理情報のう ち、選択処理部 851にて取得された選択識別子 swVarに対応する管理情報を、値「 0」から値「1」へと更新する (ステップ S725)。例えば、選択識別子の値が「5」であつ た場合には、管理情報保持部 854の管理情報テーブル T800において、選択対象 データ 545に対応する管理情報を未配置力も配置済みに変える。
[0303] 更新処理部 853は、パラメータ記憶領域にて記憶されている選択パラメータ群と、 選択処理部 851にて取得された選択識別子とを用いて、選択パラメータ CP— 1及び CP— 2の更新を行う。更新処理部 853は、更新した選択パラメータ群を、制御部 850 のパラメータ記憶領域へ上書きする (ステップ S730)。例えば、選択パラメータの値 力 S「l」「2」で選択識別子の値が「5」であった場合は、選択パラメータの値を「2」、 「5」 にする。
[0304] 制御部 850は、カウンタ iに値「1」をカ卩算する(ステップ S735)。
制御部 850は、カウンタ iが機能提供命令群の個数より大きいか否かを判定する (ス テツプ S 740)。
大きくないと判定する場合には (ステップ S740における「NO」)、制御部 850は、ス テツプ S705に戻り、選択処理部 851の動作を制御する。
[0305] 大きいと判定する場合には (ステップ S740における「YES」)、制御部 850は、複数 の偽装機能提供命令群のそれぞれに対して、機能提供命令群が挿入されて!ヽな ヽ 1以上の選択対象データの何れかが配置先となるように、配置先を決定する (ステツ プ S745)。例えば、選択対象データ 540、 541、 542、 544が未実行であれば、偽装 機能提供命令群を配置する位置をそれらに決定し、各偽装提供命令群を挿入する。
[0306] 3. 5 まとめ
第 3の実施の形態における秘密処理装置 60の選択処理部 722、及び秘密保持プ ログラム 500の選択処理命令群 520では、複数の選択対象データのうち、未実行の 選択対象データの中からのみ、次に選択する選択対象データを決定している。これ により、秘密処理装置 60や秘密保持プログラム 500が同じ選択対象データを重複し て実行することがな 、ことを知って 、る不正解析者が、選択パラメータ群の初期値を 変えての全数探索を行ったとしても、 Vヽずれの初期値を代入した場合にも選択対象 データが重複して選ばれることはないため、効率的に解析を行うことが困難になる。
[0307] プログラム難読ィ匕装置 50は、難読化対象プログラムを、秘密処理装置 60にて実行 される秘密保持プログラムへと変換することができる。これにより、同じプログラム命令 群を重複して実行することのな 、ことを知って 、る不正解析者が、変換後のプロダラ ムに対して、選択パラメータ群の初期値を変えての全数探索を行ったとしても、重複 する力否かに基づいて効率的に間違った初期値を見つけ出していくことができない。 そのため、入力プログラムを、不正な解析を効率的に短時間で行うことを阻止できる プログラムへと変換することができるという効果がある。
[0308] 3. 6 変形例 1
上記にて示すプログラム難読ィ匕装置 50は、配置順序決定部 804を、以下に示す配 置順序決定部 804a (図示せず)に置き換えてもよ 、。
他の構成要素については、上記と同様であるためここでの説明は省略する。
なお、本変形例 1では、プログラム難読ィ匕装置 50は、難読ィ匕対象プログラムのみを 、入力部 801にて受け付ける。
[0309] 3. 6. 1 配置順序決定部 804a
配置順序決定部 804と配置順序決定部 804aとの違いは、前者は、選択パラメータ 用の初期値を決めてから機能提供命令群を配置する位置を決定する方法であった のに対し、後者は 1番〜 p番目(pは選択パラメータの数)までの機能提供命令群を配 置する位置を決めて力 選択パラメータ用変数の初期値を決定し、 p+ 1番目以降の 機能提供命令群を配置する位置を決定することである。
[0310] 配置順序決定部 804aは、制御部 850a、選択処理部 851a、管理情報更新部 852 a、更新処理部 853a及び管理情報保持部 854aを備えている。以下、配置順序決定 部 804aの各構成要素についての詳細を説明する。
(1)管理情報保持部 854a
管理情報保持部 854aは、管理情報保持部 854と同様であるためここでの説明は 省略する。なお、以降において必要であれば、管理情報テーブル T800を用いて説 明する。
[0311] (2)制御部 850a
制御部 850aは、選択パラメータの個数 p (ここでは、 2個)を予め記憶している。 制御部 850aは、選択パラメータ群を記憶するパラメータ記憶領域を有して 、る。 制御部 850aは、後述する選択処理部 851aが有する式 3が取り得る値、つまり、式 3にて取り得る選択識別子の値それぞれと、プログラム記憶部 800にて記憶されて ヽ る選択対象データとの対応付けを行う。
[0312] 制御部 850aは、 1〜 番目の機能提供命令群を配置する位置を、ランダムに設定 する。例えば、制御部 850aは、選択対象データ 540〜546のいずれに第 1の機能提 供命令群を配置する力を乱数を用いて決定し、次に、第 1の機能提供命令群が配置 されて!/ヽな!、選択対象データの!/、ずれに第 2の機能提供命令群を配置するかを乱 数を用いて決定する。以下、同様に機能提供命令群が配置されていない選択対象 データのいずれに機能提供命令群 Κ (Κ= 3 · · ·πι)を配置するかを乱数を用いて決 定する。
[0313] 制御部 850aは、第 1〜 番目の機能提供命令群それぞれの配置先に対応する管 理情報の値を「0」から「1」へと更新する。制御部 850aは、更新された管理情報テー ブル T800と、第 l〜p番目の機能提供命令群それぞれの配置先に係る情報と、選択 識別子を算出する算出式とを用いて、 P個の初期値を算出する。制御部 850aは、算 出した p個の初期値を、表示部(図示せず)を用いて表示することにより、ユーザに通 知する。
[0314] 制御部 850aは、算出した p個の初期値をパラメータ記憶領域に格納する。
制御部 850aは、選択処理部 851、管理情報更新部 852、及び更新処理部 853の 動作を制御する。
制御部 850aは、第 i番目の機能提供命令群を、選択処理部 851aにて取得された 選択識別子に基づいて、対応する選択対象データへ挿入する。ここで、 iは (P + 1) 以上 m以下の整数であり、 mは機能提供命令群の個数である。また、制御部 850aは 、第 i番目の機能提供命令群と、挿入先の選択対象データとの対応付けを一時的に 記憶している。なお、選択処理部 851aについては後述する。
[0315] 制御部 850aは、機能提供命令群が挿入されていない 1以上の選択対象データの それぞれに対して、生成された複数の偽装機能提供命令群のうち 1の偽装機能提供 命令群を挿入する。ここで、 1度挿入された偽装機能提供命令群は、他の選択対象 データには挿入されない。
<初期値算出方法の具体例 >
初期値算出方法の具体例を以下に示す。ここでは、選択パラメータ数 p = 2とし、選 択対象データ 540〜546、式 3を用いる。また、第 1番目の機能提供命令群は、選択 対象データ 545に配置され、第 2の機能提供命令群は、選択対象データ 546に配置 されているとする。
[0316] 制御部 850aは、まず、選択対象データ 545の処理が終了した時点での選択パラメ 一タの値 CP— 1及び CP— 2を取得する。以下にその取得について説明する。選択 対象データ 545の更新処理命令群 165は、「cp— l = cp— 2 ; cp— 2 = sv;」であるた め、選択パラメータ CP— 1 (プログラム中の変数 cp— 1に相当)には、選択パラメータ CP— 2に設定されている値が代入される。そして、選択パラメータ CP— 2 (プログラム 中の変数 cp— 2に相当)には、選択識別子の値 (プログラム中の変数 svに相当)の値 が代入される。なお、この時点での選択識別子は第 1の機能提供命令群が配置され る選択対象データ 545の識別子 (すなわち、 5)である。その後、上記のように値が代 入された選択パラメータを用いて、選択識別子が計算しなおされる。ここまでをまとめ ると、第 1の選択パラメータの値は選択パラメータ CP— 2の初期値となり、第 2の選択 パラメータの値は、第 1の機能提供命令群が配置された選択対象データの識別子と なる。本変形例 1では、第 2の機能提供命令群を配置する位置を選択対象データ 54 6としているので、式 3により算出される仮の選択識別情報は、「5」又は「6」となる。な ぜなら、式 3の値が「6」であれば未実行の選択対象データ 546が選択され、式 3の値 が「5」であれば選択済みの選択対象データ 545は選択されずに、それ以降の直近 にある未実行の選択対象データ 546が選択されるからである。
[0317] ここで、式 3の値力 「5」であるためには、「I X (選択パラメータ CP— 1) + 2 X 5 M OD 7 = 5」である必要があり、これを解くと選択パラメータ CP— 1の値が「2」となる 。同様に、式の値が「6」であるためには、「I X (選択パラメータ CP— 1) + 2 X 5 M OD7 =6」である必要があり、これを解くと選択パラメータ CP_1の値が「3」となる。 一般に piと NNとが互いに素であるとき、全ての自然数 Aに対して、「pl XY MOD NN = A」を満たす Yが存在する。よって、選択パラメータ CP_1の値を決定す ることがでさる。
[0318] よって、選択パラメータ CP— 2の初期値は「2」または「3」のいずれかになる。制御 部 850aは、選択パラメータ CP— 2の初期値は「2」または「3」の 、ずれかを選択する 以下では、制御部 850aは、選択パラメータ CP— 2の初期値として「2」を選択したも のとして説明を続ける。
[0319] 次に、制御部 850aは、選択パラメータ CP_1の初期値を決定する。
第 1の機能提供命令群を配置した選択対象データ 545が選択されるためには、式 3 によって算出される仮の選択識別子が「5」である必要がある。なお、この時点では全 選択対象データが未実行であるため、式の値が選択対象データ 545を直接示す「5」 以外の値を取ることはできない。よって「1 X (選択パラメータ CP— 1) + 2 X (選択パ ラメータ CP 2) MOD 7 = 5」である必要がある。さらに、選択パラメータ CP 2 の初期値は先ほど算出した通り「2」であり、管理情報更新命令群 125が最初に実行 される時点では、選択パラメータ CP— 2の値は、その初期値である。この値を、式 3に 代入すると、「I X (選択パラメータ CP_1) + 2 X 2 MOD 7 = 5」となる。これを解 くと選択パラメータ CP_1の値は「1」となる。この時点では、選択パラメータ CP_1の 値は初期値のままであるので、選択パラメータ CP— 1の初期値が「1」となる
これにより、第 1及び第 2の選択パラメータの初期値「1」、「2」が算出されることにな る。
[0320] (3)選択処理部 85 la
選択処理部 851aは、選択処理部 851と同様であるため、ここでの説明は省略する
(4)管理情報更新部 852a
管理情報更新部 852aは、管理情報更新部 852と同様であるため、ここでの説明は 省略する。
[0321] (5)更新処理部 853a
更新処理部 853aは、更新処理部 853と同様であるため、ここでの説明は省略する
3. 6. 2 変形例 1のプログラム難読ィ匕装置の動作
(1)動作概要
変形例 1のプログラム難読ィ匕装置の動作は、図 27にて示すステップ S615と、配置 決定処理 (ステップ S620)との間に、初期値算出処理を追加することで、秘密保持プ ログラムを生成することができる。
[0322] (2)初期値算出処理
ここでは、初期値算出処理の動作について、図 29にて示す流れ図を用いて説明す る。
制御部 850aは、第 l〜p番目の機能提供命令群を配置する位置を、ランダムに設 定する(ステップ S 800)。
制御部 850aは、第 1〜 番目の機能提供命令群それぞれの配置先に対応する管 理情報の値を「0」から「 1」へと更新する (ステップ S805)。 [0323] 制御部 850aは、 j =p〜lまでの間、ステップ S815力らステップ S825を繰り返す( ステップ S810)。
制御部 850aは、第 jの選択パラメータの初期値を算出し (ステップ S815)、算出し た第 jの選択パラメータの初期値をパラメータ記憶領域へ格納する (ステップ S820)。
[0324] 繰り返しの終了後、制御部 850aは、算出した第 l〜pの選択パラメータの初期値を 表示する(ステップ S 830)。
3. 6. 2 変形例 1の効果
本変形例 1のプログラム難読ィ匕装置は、難読ィ匕対象プログラムを第 1の実施の形態 に示したような秘密保持プログラムへと変換することができる。これにより、同じプログ ラム命令群を重複して実行することのないことを知っている不正解析者が、変換後の 秘密保持プログラムに対して、選択パラメータ群の初期値を変えての全数探索を行 つたとしても、重複するか否かに基づいて効率的に間違った初期値を見つけ出して いくことができない。そのため、難読化対象プログラムを、不正な解析を効率的に短 時間で行うことを阻止できるプログラムへと変換することができるという効果がある。
[0325] なお、本変形例 1のプログラム難読ィ匕装置は、第 l〜pの機能提供命令群の配置先 を決定した後、配置決定処理にて、再度、第 l〜pの機能提供命令群の配置先を決 定している。この場合、予め決定した配置先の選択識別子が算出されるように、各選 択パラメータの初期値が算出されているので、配置決定処理にて決定された第 l〜p の機能提供命令群の配置先は、予め決定した配置先と同じになる。
[0326] ここで、本変形例 1のプログラム難読ィ匕装置は、第 l〜pの機能提供命令群の配置 先を決定した後、配置決定処理にて、再度、第 l〜pの機能提供命令群の配置先を 決定しなくてもよい。この場合、制御部 850aは、第 l〜pの機能提供命令群を順次実 行した後の、各選択パラメータの値を算出し、算出した各値をパラメータ記憶領域へ 格納し、それ以降における選択処理部 851、管理情報更新部 852、及び更新処理 部 853の動作を制御する。このとき、図 28に示す配置決定処理を実行する際には、 ステップ S600を i=p+ lに変更する。これにより、プログラム難読ィ匕装置は、すでに 配置先が決定している第 l〜pの機能提供命令群に対する位置決定処理を省略して 、配置決定処理にて、第 p + 1以降の機能提供命令群の配置先を決定することがで きる。
[0327] 3. 7 変形例 2
変形例 2では、機能提供命令群 1〜3を図 30に示す順序で実行する秘密処理装置 について説明する。すなわち、この秘密処理装置は正常系の実行時に同じ選択対 象データの手順を重複して実行することがある秘密処理装置である。変形例 2の秘 密処理装置は、第 3の実施の形態の選択処理部 722を、図 31に図示する選択処理 部 722bに置き換えることにより実現される。
[0328] 3. 7. 1 選択処理部 722b
選択処理部 722bは、選択対象データの選択が行われた回数をカウントするカウン タを有し、カウンタの値に応じて、選択識別子の決定方法を変化させる。
以下、第 3の実施の形態と同様の選択識別子の決定方法、すなわち、未実行の選 択対対象データを示す選択識別子が得られるまで選択識別子の更新を行う決定方 法を「第一の決定方法」と呼ぶ。また、選択識別子の値を、 A回目(B= l、 2、 · · · 6) に決定した選択識別子の値と同一のものとする決定方法をする「第二の決定方法」と 呼ぶ。
[0329] 以下、選択処理部 722bは、図 31に示すように決定方法保持部 750b、選択履歴 保持部 751b、カウンタ 752b、制御部 753bを有している。
(1)決定方法保持部 750b
決定方法保持部 750bは、図 31に示すように、決定方法テーブル T1000を有して いる。
[0330] 決定方法テーブル T1000は、選択回数と決定方法とからなる組を 1以上記憶する ための領域を有している。
選択回数は、選択対象データの選択回数を示し、決定方法は、その回数の場合に おける選択識別子の決定方法を示して ヽる。
値「0」が決定方法に設定されている場合には、選択識別子の決定方法が第一の 決定方法であることを示し、値「0」以外の値「A」が決定方法に設定されて!、る場合 には、選択識別子の決定方法が第二の決定方法であることを示す。値「A」が設定さ れている場合には、 A回目に選択された値と同一の選択識別子を取得することを示 す。
[0331] 例えば、選択回数と決定方法とからなる組が、「1、 0」である場合には、 1回目に選 択する選択対象データを決定する選択識別子は、第一の決定方法を用いて決定さ れることを表している。また、選択回数と決定方法とからなる組が、「3、 1」である場合 には、 3回目に選択する選択対象データを決定する選択識別子は、第二の決定方法 を用いて決定され、 1回目に決定された値と同一の選択識別子とすることを表してい る。
[0332] (2)選択履歴保持部 75 lb
選択履歴保持部 751bは、過去に決定された選択識別子を、決定された時点にお けるカウンタの値と対応付けて保持して 、る。
(3)カウンタ 752b
カウンタ 752bは、現在行おうとしているの選択対象データの選択が何回目の選択 であるのかをカウントする。カウンタ 752bの初期値は 1であり、選択を行うたびにカウ ンタ 752bの値をインクリメントする。
[0333] (4)制御部 753b
制御部 753bは、カウンタ 752bの値と、決定方法テーブル T1000とを用いて、選択 識別子の決定方法を決定する。具体的には、カウンタ 752bの値が「1」である場合に は、制御部 753bは、決定方法テーブル T1000の選択回数力「l」に対応する決定 方法「0」を取得する。制御部 753bは、取得した決定方法力「0」であるので、選択識 別子の決定方法は、第一の決定方法であると決定する。なお、取得した決定方法の 値が「0」以外である場合には、制御部 753bは、選択識別子の決定方法は、第二の 決定方法であると決定する。
[0334] 制御部 753bは、決定した決定方法が第一の決定方法である場合には、選択処理 命令群 520を実行する場合と同様の処理により選択識別子を選択する。
制御部 753bは、決定した決定方法が第二の決定方法である場合には、取得した 値「A」を用いて、 A回目に決定された選択識別子を選択履歴保持部 751bから取得 する。
制御部 753bは、カウンタ 752bが示す値と決定された選択識別子とを選択履歴保 持部 751bに格納する。制御部 753bはカウンタ 1340の値を 1カウントアップする。
[0335] 3. 7. 2 秘密処理装置の動作
変形例 2における秘密処理装置の動作は、図 24にて示すステップ S 500に、カウン タ 752bのカウンタ countに初期値「1」を設定する処理を追加する。
その後、以下に示す識別子算出処理を行い、その後、ステップ S520以降を行う。 ステップ S535における判断力 「YES」の場合には処理を終了し、「NO」である場合 には、識別子算出処理に戻る。
[0336] 以下に、識別子算出処理の動作について、図 32にて示す流れ図を用いて説明す る。
なお、ここでは、選択パラメータの数が 2個であるとし、選択識別子を算出する式は 、式 3を用いる。また、必要があれば、第 3の実施の形態にて示す構成部を用いて説 明する。
制御部 753bは、カウンタ 752bの値と、決定方法テーブル T1000とを用いて、選択 識別子の決定方法を決定する (ステップ S850)。
[0337] 制御部 753bは、決定した決定方法が第一の決定方法であるか否かを判断する (ス テツプ S855)
第一の決定方法であると判断する場合には (ステップ S855における「YES」)、制 御部 753bは、選択パラメータ群保持部 705に格納されている選択パラメータ CP— 1 及び CP— 2と、選択処理命令群に含まれる式 3とを用いて、仮の選択識別子を算出 する(ステップ S860)。
[0338] 制御部 753bは、管理情報テーブル T700を用いて、算出した仮の選択識別子に 対応する選択対象データが実行済である力否かを判定する (ステップ S865)。
制御部 753bは、実行済であると判定する場合には (ステップ S865における「YES 」)、制御部 753bは、仮の選択識別子を更新する (ステップ S870)。
未実行であると判定する場合には (ステップ S865における「NO」)、制御部 753b は、カウンタ 752bが示す値と決定された選択識別子とを選択履歴保持部 751bに格 納し (ステップ S880)、カウンタ 1340の値 countをインクリメントする(ステップ S885) [0339] 第二の決定方法であると判断する場合には (ステップ S855における「NO」)、制御 部 753bは、決定方法テーブル T1000か取得した決定方法の値「A」を用いて、 A回 目に決定された選択識別子を選択履歴保持部 751bから取得し (ステップ S875)、ス テツプ S880以降の動作を行う。
3. 7. 3 変形例 2の効果
変形例 2における選択処理部 722bは、図 31にて示す決定方法テーブル T1000 では、 3、 4、 6番目に実行する選択対象データを選択する際に、選択済みの選択対 象データから 1つを選択している。よって、難読化対象プログラムが同じ選択対象デ ータを重複して実行することを知って 、る不正解析者が、選択パラメータ群の初期値 を変えての全数探索を行ったとしても、 Vヽずれの初期値を代入した場合にも選択対 象データが重複して選ばれ、効率的に間違った初期値を見つけ出していくことができ ない。そのため、難読化対象プログラムを、不正な解析を効率的に短時間で行うこと を阻止できるプログラムへと変換することができるという効果がある。
[0340] 3. 8 変形例 3
ここでは、ループを有し、ループ内のプログラム命令群が実行される回数が固定の 回数である難読ィ匕対象プログラム力 秘密保持プログラムを生成するプログラム難読 化装置 50cである。本変形例 3では、一例として、難読ィ匕対象プログラムのコントロー ルフローを図 33に示す。このプログラムにはループ構造が 2箇所あり、それぞれのル ープ内のプログラム命令が実行される回数は 2回である。
[0341] 以下、図 33に示す難読化対象プログラムを用いて説明する。
3. 8. 1 プログラム難読ィ匕装置 50c
プログラム難読ィ匕装置 50cは、図 34にて示すように、プログラム記憶部 800c、入力 部 801c、機能提供命令群生成部 802c、偽装機能提供命令群生成部 803c、配置 順序決定部 804c、管理命令群生成部 805c、秘密保持プログラム生成部 806c、出 力部 807、及び選択処理命令群生成部 808cから構成されて ヽる。
[0342] プログラム難読化装置 50cは、具体的には、マイクロプロセッサ、 ROM、 RAM,ノヽ ードディスクユニット、ディスプレイユニット、キーボード、マウスなどから構成されるコン ピュータシステムである。前記 RAM又は前記ハードディスクユニットには、コンビユー タプログラムが記憶されている。ここで、コンピュータプログラムは、所定の機能を達成 するために、コンピュータに対する指令を示す命令コードが複数個組み合わされて 構成されたものである。前記マイクロプロセッサ力 前記コンピュータプログラムに従つ て動作することにより、プログラム難読ィ匕装置 50cは、その機能を達成する。つまり、 前記マイクロプロセッサは、前記コンピュータプログラムに含まれる各命令を 1個ずつ 読み出し、読み出した命令を解読し、解読結果に従って動作する。
[0343] なお、プログラム難読ィ匕装置 50cは、難読ィ匕対象プログラムから 3つの機能提供命 令群を取得するものとする。また、プログラム難読ィ匕装置 50cで生成される秘密保持 プログラムの構造は、上記にて示す秘密保持プログラム 500の構造と同一であるもの とし、以下の説明において、必要であれば、秘密保持プログラム 500で用いた符号を 用いて説明する。
[0344] (1)プログラム記憶部 800c
プログラム記憶部 800cは、上記第 3の実施の形態にて示すプログラム記憶部 800 と同様であるため、説明は省略する。
(2)入力部 801c
入力部 801cは、上記第 3の実施の形態にて示す入力部 801と同様であるため、説 明は省略する。
[0345] なお、入力部 801cが受け取る難読ィ匕対象プログラムは、ループを有し、ループ内 のプログラム命令群が実行される回数が予め定められているプログラムである。
(3)機能提供命令群生成部 802c
機能提供命令群生成部 802c、入力部 801cにて受け取った難読化対象プログラム から、複数の機能提供命令群を生成する。
[0346] 機能提供命令群生成部 802cは、例えば、入力部 801cが図 33に示す難読化対象 プログラムを受け取ると、ループ内に存在する 2つのプログラム命令群(ここでは、ステ ップ S905で実行されるプログラム命令群 1と、ステップ S925で実行されるプログラム 命令群 2)のそれぞれに対して、上記にて示す機能提供命令群生成部 802と同様に 動作を行って、複数の機能提供命令群を生成する。ここでは、機能提供命令群生成 部 802cは、プログラム命令群 1を分割して 2つの機能提供命令群 (以下、機能提供 命令群 1、 2という。)を生成し、プログラム命令群 2から、 1つの機能提供命令群 (以下 、機能提供命令群 3という。)を生成する。
[0347] 図 33に示すコントロールフローを、生成した 3つの機能提供命令群に置き換えたコ ントロールフローを、図 35に示す。
ステップ S905で実行されるプログラム命令群 1が、ステップ S906で実行される機 能提供命令群 1と、ステップ S907で実行される機能提供命令群 2とに置き換わり、ス テツプ S925で実行されるプログラム命令群 2が、ステップ S926で実行される機能提 供命令群 3に置き換わっている。なお、プログラム命令群 2と機能提供命令群 3とは同 一のものである。
[0348] (4)偽装機能提供命令群生成部 803c
偽装機能提供命令群生成部 803cは、上記にて示す偽装機能提供命令群生成部 803と同様であるため、説明は省略する。
(5)選択処理命令群生成部 808c
選択処理命令群生成部 808cは、変形例 2に示した選択処理部 722bをコンビユー タ等に実現させるプログラム命令群を生成する。
[0349] 選択処理命令群生成部 808cは、まず、決定方法保持部 750bが有する決定方法 テーブル T1000を生成する。
選択処理命令群生成部 808cは、図 35にて示すコントロールフローから、ループを 展開したプログラムのコントロールフローを生成する。具体的には、図 35において、 ループ内のプログラム命令である第 1及び第 2機能提供命令群をループが実行され る回数分すなわち、 2回展開し、第 3機能提供命令群も同様に 2回展開する。図 36に 各機能提供命令群を展開したプログラムのコントロールフローを示す。
[0350] 次に、選択処理命令群生成部 808cは、ループを展開したプログラムのコントロー ルフローを元に、決定方法保持部 750bに保持する決定方法を生成する。
図 36のコントロールフローにおいて、ステップ S950〜S975はそれぞれ、 1〜6番 目に実行されるブロックである。このコントロールフローにおいて 3番目に実行される 機能提供命令群 1は 1番目に実行される機能提供命令群 1と同じである。よって、選 択処理命令群生成部 808cは、決定方法テーブル T1000の選択回数「3」に対応す る決定方法には値「1」を設定する。同様に、選択処理命令群生成部 808cは、決定 方法テーブル T1000の選択回数「4」、「6」のそれぞれに対応する決定方法には値「 2」、「5」を設定する。
[0351] また、図 36のコントロールフロー上では存在しないが、ループを展開した後のコント ロールフロー上でも一度しか現れないブロックを選択する際の選択識別子の決定方 法は、未配置の選択対象データより選択するという決定方法とする。
このようにして、選択処理命令群生成部 808cは、決定方法保持部 750bにて保持 する決定方法テーブル T1000を生成する。具体的には、選択処理命令群生成部 80 8cは、コンピュータ上に、決定方法テーブル T1000のデータ構造を持たせるような プログラム命令群を生成する。これにより、 e回目の選択識別子が、未実行の選択対 象データを示す選択識別子となる決定方法を用いる場合には「e、 0」の組を持ち、 f 回目に決定した選択識別子と同一のものとする場合には「e、 f」の組を持つような決 定方法テーブル T1000が実現できる。
[0352] また、選択処理命令群生成部 808cは、さらに、選択履歴保持部 75 lb、カウンタ 75 2bおよび制御部 753bをコンピュータ上に実現するプログラム命令群も生成する。こ こで、選択履歴保持部 75 lbを実現するプログラム命令群は、選択識別子をカウンタ の値と対応付けて記憶するような命令群である。カウンタ 752bを実現するプログラム 命令群は、初期値を「1」とし、 1インクリメントするカウンタを示す命令群である。また、 制御部 753bを実現する命令群は、変形例 2にて説明した動作を実現するプログラム 命令群である。以下において、カウンタ示す命令群及び、制御部 753bを実現する命 令群をあわせて決定方法制御命令群と!/、う。
[0353] これにより、選択処理命令群生成部 808cは、選択処理部 722bを動作させるため のプログラム命令群を生成することができる。
選択処理命令群生成部 808cは、生成した各命令群をプログラム記憶部 800cへ格 納する。
(6)配置順序決定部 804c
配置順序決定部 804cは、生成した機能提供命令群 (ここでは、 3つの機能提供命 令群)、および偽装機能提供命令群 (ここでは、 4つの偽装機能提供命令群)をどの ような順序で選択対象主要命令群 550〜556に割り当てるのかを決定する。具体的 には、配置順序決定部 804cは、選択対象主要命令群 550〜556のいずれに第 1〜 第 3機能提供命令群を配置するかを決め、残り 4つの選択対象主要命令群のいずれ に偽装機能提供命令群を配置するかを決める。
[0354] 配置順序決定部 804cは、上述した式 3を予め記憶している。ここでは、式 3におけ る pl、p2、及び NNをそれぞれ、「1」、「2」、及び「7」とする。
配置順序決定部 804cは、入力部 801cにて受け付けた 2つの選択パラメータの初 期値と、予め記憶している式 3を用いて、実際にどのような順序で選択識別子が算出 されるのかを確認することにより、機能提供命令群および偽装機能提供命令群が配 置されるべき選択対象主要命令群を決定する。
[0355] なお、入力部 801cにて 2つの初期値として、選択パラメータ CP— 1 ( = 1)、 CP— 2
( = 2)を受け付けたものとする。以下に配置の決定方法の一例について説明する。 配置順序決定部 804cは、図 37に示すように、制御部 850c、選択処理部 851c、 管理情報更新部 852c、更新処理部 853c及び管理情報保持部 854cを備えている。 以下、配置順序決定部 804cの各構成要素についての詳細を説明する。
[0356] <管理情報保持部 854c >
管理情報保持部 854cは、管理情報保持部 854と同様であるので、説明は省略す る。なお、以降において必要であれば、管理情報テーブル T800を用いて説明する。 これにより、機能提供命令群が配置された位置 (配置された選択対象データ)を記 '隐することができる。
[0357] <制御部 850c >
制御部 850cは、選択パラメータ群を記憶するパラメータ記憶領域を有して 、る。 制御部 850cは、入力部 801cにて受け付けた選択パラメータの初期値 CP— 1及び CP— 2 (ここでは、それぞれ「1」、「2」)をパラメータ記憶領域に記憶する。
制御部 850cは、選択処理部 851c、管理情報更新部 852c、及び更新処理部 853 cの動作を制御する。
[0358] 制御部 850cは、後述する選択処理部 851cが有する式 3が取り得る値、つまり、式 3にて取り得る選択識別子の値それぞれと、プログラム記憶部 800cにて記憶されて V、る選択対象データとの対応付けを行う。
制御部 850cは、生成された第 i番目の機能提供命令群を機能提供命令群生成部 802cから取得する。制御部 850cは、取得した第潘目の機能提供命令群を、選択 処理部 851cにて取得された選択識別子に基づいて、プログラム記憶部 800cにて記 憶され、対応する選択対象データへ挿入する。ここで、 iは 1以上 m以下の整数である 。また、制御部 850cは、第 i番目の機能提供命令群と、挿入先の選択対象データと の対応付けを一時的に記憶して 、る。
[0359] 制御部 850cは、生成された複数の偽装機能提供命令群のうち選択対象データに 挿入されていない 1の偽装機能提供命令群を偽装機能提供命令群生成部 803から 取得する。制御部 850cは、取得した偽装機能提供命令群を、第 i機能提供命令群、 又は偽装機能提供命令群が挿入されていない 1の選択対象データに挿入する。制 御部 850cは、この動作を、全ての偽装機能提供命令群に対して行う。
[0360] これにより、制御部 850cは、各選択対象データに、第 i機能提供命令群、又は偽装 機能提供命令群が挿入することができる。
制御部 850cによる第 i番目の機能提供命令群を取得する動作により、配置対象と なる機能提供命令群を選択することができる。
<選択処理部 851c >
選択処理部 851cは、上述した式 3を予め記憶している。
[0361] 選択処理部 851cは、図 36にて示すコントロールフロー及び選択処理命令群生成 部 808cにて生成された選択処理部 722bを動作させるためのプログラム命令群に基 づいて、各機能提供命令群の配置先を決定する。
選択処理部 851cは、図 36にて示すコントロールフローにより、 t回目に実行される 第 iの機能提供命令群を取得する。ここで、 tは、 1以上 6以下の整数であり、 iは 1以上 3以下の整数である。
[0362] 選択処理部 851cは、選択処理命令群生成部 808cにて生成された決定方法テー ブル T1000を用いて、選択回数「t」に対応する決定方法を取得する。
決定方法が「0」である場合には、選択処理部 851cは、上記にて示す選択処理部 8 51と同様の動作により、選択識別子 swVarを取得する。選択処理部 851cは、取得 した選択識別子 swVarと、第 iの機能提供命令群とを対応付ける。これにより、制御部
850cは、第 iの機能提供命令群を、対応する選択識別子 swVarにて示される選択対 象データに挿入することができる。
[0363] 決定方法が「0」以外の値である場合には、選択処理部 851cは、 t+ 1回目に実行 される第 jの機能提供命令群を取得し、上記の動作を行う。
選択処理部 851cの動作と、制御部 850cによる第 i番目の機能提供命令群を選択 処理部 851cにて取得された選択識別子に基づき選択対象データに挿入する動作と により、機能提供命令群を適切な配置先へ配置することができる。
[0364] <管理情報更新部 852c >
管理情報更新部 852cは、管理情報更新部 852と同様であるので、説明は省略す る。
く更新処理部 853c >
更新処理部 853cは、更新処理部 853と同様であるため、説明は省略する。
[0365] (7)管理命令群生成部 805c
管理命令群生成部 805cは、上記にて示す管理命令群生成部 805と同様であるた め説明は省略する。
(8)秘密保持プログラム生成部 806c
秘密保持プログラム生成部 806cは、プログラム記憶部 800cにて記憶されて 、る各 命令群を配置し、秘密保持プログラムを生成する。すなわち、管理命令群生成部 80 5cが生成した命令群と、選択処理命令群生成部 808cが生成した命令群と、配置順 序決定部 804cにて生成された選択対象データとを図 38のような順序に配置し、秘 密保持プログラム 1800を生成する。管理命令群生成部 805cによる更新処理命令群 の生成の動作と、秘密保持プログラム生成部 806cによる上記動作とにより、各命令 群を適切な配置位置へ挿入することができる。
[0366] なお、選択処理命令群生成部 808cが生成する決定方法制御命令群 580以外の 他の命令群の位置については、特に明示していないが、例えば前処理命令群 510 の中等に含ませることで、実行開始時に必要な領域を確保したり、決定方法保持部 7 50bを例えばメモリ上に生成したりすることができる。 さらに、秘密保持プログラム生成部 806cは、選択対象主要命令群 550〜556に対 し、機能提供命令群生成部 802cが生成した複数の機能提供命令群および偽装機 能提供命令群生成部 803cが生成した複数の偽装機能提供命令群を、配置順序決 定部 804cが決定した順序に対応するように配置する。
[0367] (9)出力部 807c
出力部 807cは、上記にて示す出力部 807と同様であるので、説明は省略する。
3. 8. 2 プログラム難読ィ匕装置 50cの動作
ここでは、プログラム難読ィ匕装置 50cの動作にっ 、て説明する。
プログラム難読ィ匕装置 50cの動作は、基本的には、プログラム難読ィ匕装置 50と同 様である。以下に、図 27にて示す流れ図を用いて、プログラム難読ィ匕装置 50の動作 と異なる点を中心に説明する。
[0368] ステップ S620は、配置順序決定部 804cにより実行される。
また、図 27にて示す流れ図において、選択処理命令群生成部 808cが動作するス テツプを加える。選択処理命令群生成部 808cを動作させるステップは、配置順序決 定部 804cによる配置順序を決定する前、つまりステップ S620より前であれば、どの 位置でもよい。
[0369] 3. 8. 3 変形例 3の効果
本変形例 3のプログラム難読ィ匕装置 50cは、難読ィ匕対象プログラムを第 3の実施の 形態にて示すような秘密保持プログラムへと変換することができる。ここで、第 3の実 施の形態にて示すプログラム難読ィ匕装置 50とは異なり、ループのあるプログラムで難 読ィ匕することができるため、より多種の入力プログラムに対して、難読化を施すことが できる。
[0370] 3. 9 変形例 4
変形例 4にて示すプログラム難読ィ匕装置は、第 3の実施の形態のプログラム難読ィ匕 装置によるプログラムの難読ィ匕に加え、さらに、定数を含むプログラム命令を、その定 数を含まないプログラム命令に置き換える難読ィ匕を追加する装置である。
3. 9. 1 変形例 4のプログラム難読化装置
ここで、プログラム難読ィ匕装置は、機能提供命令群を構成するプログラム命令に含 まれる第一の定数を「(第 1の選択パラメータ) + (第 2の選択パラメータ) + (第二の定 数)」に置き換える。例えば、機能提供命令群 1にプログラム命令「b = a+ 30」が含ま れており、機能提供命令群 1が実行される際の第 1及び第 2選択パラメータそれぞれ の値が「1」、「2」である場合に、「b = a + 30」を「b = a+ (選択パラメータ CP_l) + ( 選択パラメータ CP— 2) + 27」に置き換える。
[0371] 以下、このような変換を行うプログラム難読ィ匕装置を説明する。
変形例 4では、第 3の実施の形態で示す配置順序決定部 804の変わりに配置順序 決定部 804d (図示せず)を用いる。配置順序決定部 804dは、第 3の実施の形態で 説明した構成要素に加え、プログラム命令変更部 810dを有する。
プログラム命令変更部 810dは、上述したように入力プログラム中の定数を「(第 1の 選択パラメータ) + (第 2の選択パラメータ) + (第二の定数)」に置き換える処理を行う 。具体的には、配置順序決定部 804dが現在見ている各機能提供命令群について、 定数を含むプログラム命令が含まれて ヽる場合に、パラメータ記憶領域に格納されて いる第 1及び第 2の選択パラメータを取得する。プログラム命令変更部 810dは、取得 した第 1及び第 2の選択パラメータを用いて、その定数を「(第 1の選択パラメータ) + ( 第 2の選択パラメータ) + (第二の定数)」に置き換えていく処理を行う。
[0372] ここで、第二の定数は、第一の定数力 第 1及び第 2の選択パラメータのそれぞれ の値を減算することにより算出される。
3. 9. 2 動作
以下、変形例 4のプログラム難読ィ匕装置の動作を、配置順序決定部 804dの処理の 流れを中心に図 39を用いて説明する。なお、変形例 4のプログラム難読ィ匕装置の動 作は、配置順序決定部 804dの動作以外は第 3の実施の形態と同様である。
[0373] 配置順序決定部 804dは、カウンタ countに「1」を設定し、ノ メータ記憶領域に選 択パラメータ群の初期値を格納する (ステップ S 1000)。
配置順序決定部 804dは、パラメータ記憶領域に記憶されて 、る選択パラメータ CP —1、及び CP— 2を取得する。配置順序決定部 804dは、取得した CP— 1及び CP— 2と、予め記憶している式 3とを用いて、仮の選択識別子を算出する (ステップ S1005
) o [0374] 配置順序決定部 804dは、第 count番目の機能提供命令群の配置先を決定する( ステップ S1010)。具体的には。配置順序決定部 804dは、図 28にて示すステップ S 710、 S715、 S720を行う。
配置順序決定部 804dは、第 count番目の機能提供命令群に定数を含むプロダラ ム命令が存在するか否かを判断する(ステップ S1015)。
[0375] 存在すると判断する場合には (ステップ S1015における「YES」)、配置順序決定部 804dは、定数を含むプログラム命令を取得し、取得したプログラム命令に含まれる定 数及びパラメータ記憶領域に格納されている第 1及び第 2の選択パラメータを用いて 第二の定数を算出する (ステップ S 1020)。配置順序決定部 804dは、取得したプロ グラム命令に含まれる定数を、第 1及び第 2の選択パラメータと、算出した第二の定 数とに置き換える (ステップ S1025)。例えば、配置順序決定部 804dは、「b = a+ 30 」を「b = a+ (選択パラメータ 1) + (選択パラメータ 2) + 27」に置き換える。なお、配 置順序決定部 804dは、ステップ S1020及び S1025の動作を、第 count番目の機 能提供命令群に存在する定数を含むプログラム命令全てに対して行う。
[0376] 配置順序決定部 804dは、パラメータ記憶領域にて記憶されている選択パラメータ 群と、選択処理部 851にて取得された選択識別子とを用いて、選択パラメータ CP— 1及び CP— 2の更新を行い、更新した選択パラメータ群を、パラメータ記憶領域へ上 書きする(ステップ S 1030)。
配置順序決定部 804dは、管理情報テーブル T800に含まれる複数の管理情報の うち、取得された選択識別子 swVarに対応する管理情報を、値「0」から値「1」へと更 新する (ステップ S 1035)。
[0377] 配置順序決定部 804dは、カウンタ countに値「1」を加算する (ステップ S1040)。
配置順序決定部 804dは、カウンタ countが機能提供命令群の個数より大き 、か否 かを判定する(ステップ S 1045)。
大きくないと判定する場合には (ステップ S1045における「NO」)、配置順序決定部 804diま、ステップ S1005に戻る。
[0378] 大きいと判定する場合には (ステップ S 1045における「YES」)、配置順序決定部 8 04dは、複数の偽装機能提供命令群のそれぞれに対して、機能提供命令群が挿入 されて 、な ヽ 1以上の選択対象データの何れかが配置先となるように、配置先を決定 する(ステップ S 1050)。
第 count番目の機能提供命令群に定数を含むプログラム命令が存在しないと判断 する場合には (ステップ S1015における「NO」)、配置順序決定部 804dは、ステップ S 1030以降を行う。
[0379] なお、ここでは、定数を置き換える置換式を「(選択パラメータ 1) + (選択パラメータ 2) + (第二の定数)」としているが、他の式であっても構わない。その場合は式「(置換 式) = (第一の定数)」から第二の定数を求める式を作成し、その式を用いて、第二の 定数を算出してもよい。また、置換式は固定である必要はなぐ置き換えを行うたびに
Figure imgf000104_0001
ヽても構わな 、。
[0380] また、なお、説明に用いた難読ィ匕対象プログラムは一例であって、そのコントロール フローやループの回数、その他の制御構造はこれに限るものではない。
3. 9. 3 変形例 4の効果
本変形例 4のような変換を行えば、第 3の実施の形態で行った難読化に加え、生成 されたプログラム中の定数の値を直接見ることが出来なくなり、さらに解析が困難にな る。特に、秘密情報である鍵の値等を本変形例 4によって、直接見ることが出来なく することで、秘密情報の値の解析を困難にすることが出来る。
[0381] 3. 10 その他の変形例
なお、本発明を上記第 3の実施の形態、及び変形例 1〜4に基づいて説明してきた 1S 本発明は、上記の実施の形態に限定されないのはもちろんである。以下のような 場合も本発明に含まれる。
(1)上記第 3の実施の形態において、選択識別子の算出式を「I X (選択パラメータ CP— 1) + 2 X (選択パラメータ CP— 2) MOD 7」としている力 これに限定されな い。何らかの形で選択識別子の候補を算出できる式であれば他の式であっても構わ ない。
[0382] (2)上記第 3の実施の形態において、選択パラメータ群の更新処理 (更新処理命令 群)を、選択対象データ 540〜 546に埋め込まれているが(例えば、図 20における選 択対象データ 660の「cp—l = cp— 2 ; cp— 2 = sv;」など)、これに限定されない。秘 密保持プログラムは、更新処理命令群を選択対象データ 540〜546の実行後に参 照する構成でもよい。
[0383] (3)また、図 20では、図 24にて示すステップ S535における判断は明示的には行つ ておらず、正常系の実行において最後に実行される選択対象データ 543の実行後 に処理を終了する構成としている力 これに限定されない。秘密保持プログラムは、 実行された選択対象データが処理の最後に実行すべき選択対象データであるかの 判断処理を選択対象データカゝら独立した形で実行してもよい。
[0384] (4)さらに、上記第 3の実施の形態では、選択パラメータを更新することにより間接 的に選択対象識別子を更新しているが、これに限定されない。秘密保持プログラム は、選択識別子を直接更新する構成としてもよい。この場合は、図 24にて示すステツ プ S530において選択識別子の更新を行い、ステップ S535における判断結果が「N 0」である場合には、ステップ S510へ戻る。
[0385] (5)上記第 3の実施の形態では、秘密保持プログラムは、選択パラメータの初期値 として、呼び出し元力 の入力値を格納した力 これに限定されない。秘密保持プロ グラムは、ネットワーク上の他の機器から取得する値を選択パラメータの初期値に代 入する構成でもよ ヽし、プログラム実行装置が保持する他のプログラムを実行した結 果得られる出力値を選択パラメータの初期値に代入する構成でもよい
(6)上記第 3の実施の形態において、プログラム難読ィ匕装置は、難読化対象プログ ラムを、秘密保持プログラムに変換する際に、入力部にて選択パラメータの初期値を 受け取つたが、これに限定されない。プログラム難読ィ匕装置は、選択パラメータの初 期値は定められて 、るものとし、予め記憶して 、てもよ 、。
[0386] (7)上記第 3の実施の形態では、機能提供命令群が 3つ、偽装機能提供命令群が 4つの場合を示したが必ずしもこの数である必要はな 、。機能提供命令群は複数個 、偽装機能提供命令群は 1個以上であればよい。
(8)上記第 3の実施の形態では、選択対象部の数、選択パラメータの数、選択識別 子の計算式を、固定して秘密保持プログラムを生成する場合について述べたが、こ れらの値や式を必ずしも固定の値である必要はなぐ別の値や式であってもよい。こ れらの値や式は、例えば、プログラム難読ィ匕装置に入力として与えられる構成であつ てもよ!/ヽし、全数攻撃を用いて攻撃を行う際の全数に基づ ヽて決定する構成であつ てもよい。なお、入力として与えられる構成である場合には、生成される秘密保持プロ グラム 500が正しくコンピュータ上で動作することを保証するためには、選択識別子 の計算式は、その計算結果が常に選択対象データの数以下であるような式が望まし い。また、この式は不正解析者による解析を困難にするため、選択パラメータの値に 応じて算出される値が大きく変動するような式が望ましい。
[0387] また、選択パラメータの初期値は、難読ィ匕対象となるプログラム毎にランダムな値で あるとしてもよい。これにより、仮に不正解析者が正しい選択パラメータの初期値を得 ることができたとしても、他のプログラムに対してはその初期値を適用することができ なくなる。
(9)上記第 3の実施の形態では、ブロックの分割は、簡単な方法について説明した 力 この方法に限定するものではなぐブロックの分割の仕方に応じた制御構造の解 析を行 ヽ、ブロックの分割の仕方に応じた機能提供命令群を生成すればょ ヽ。
[0388] (10)上記第 3の実施の形態では、秘密処理装置 60を上述の通りプログラムを用い たプログラム実行装置の形で実現している力 S、これに限られるものではなくハードゥエ ァ的な実装を行ってもよい。
(11)上記第 3の実施の形態において、秘密処理装置 60は、図 24のステップ S535 の判断結果により、処理の終了又は継続の判断を行っている力 これに限定されな い。
[0389] 秘密処理装置 60は、図 24のステップ S535にて示す判断の代わりに、分割後ブロ ックの個数と同一の選択処理データが選択されたか否かを判断してもよい。
この場合の、秘密保持プログラム 500eの具体例を図 40の流れ図にて示す。図 40 にて示すプログラムの流れ図は、図 18の各ブロックを C言語で記述した具体例である 図 40〖こおける値「i」は、選択対象データの選択回数を示す。ブロック 651eに含ま れる条件式「if (i > 3) then return;」により、秘密保持プログラム 500eの終 了、及び処理の継続が制御されている。つまり、選択回数が 3より大きい場合には、 秘密処理装置 60は、秘密保持プログラム 500eの実行を終了し、 3以下の場合には、 秘密保持プログラム 500eの実行を継続する。ここで、条件式に含まれる値「3」は分 割後ブロックの数と同一の値である。
[0390] また、選択対象データに含まれる分岐命令群は、選択処理命令群に分岐する分岐 命令に統一されている。
これにより、正常系の実行において最後に実行される選択対象データを、見つけ出 すことは困難になる。
また、条件式「if (i > 3) then return;」に含まれる値を、分割後ブロックの数 と同一とすることで、正条系の動作において最後に実行される選択対象データ (例え ば、第 3の機能提供命令群)を実行後に、常に秘密保持プログラム 500eの動作が終 了することが保証されて ヽる。
[0391] (12)上記第 3の実施の形態において、選択パラメータの数を 2としたが、これに限 定されな ヽ。選択パラメータの数は複数個であればょ 、。
この場合の式 3は、「pl X (第 1の選択パラメータ用変数) +p2 X (第 2の選択パラメ ータ用変数) + · · · +pn X (第 nの選択パラメータ用変数) mod NN」となる(nは 2 以上の整数)。なお、 NNと pl、 ρ2、 · · ·、 pnとは互いに素である整数である。また、 選択パラメータの更新時には、第 iのパラメータに格納されている値を第 i- 1のパラメ ータに格納する。このとき、第 1のパラメータ、第 2のパラメータ、 · · ·、第 n— 1のパラメ ータの順に格納する。また、第 nのパラメータには、選択対象データの選択に使用し た選択識別子の値を格納する。ここで、 iは 2以上 n以下の整数である。
[0392] (13)上記第 3の実施の形態において、プログラム難読ィ匕装置 50は、ラベル名のみ からなる複数の選択対象データのそれぞれに、選択対象主要命令群、更新処理命 令群、及び分岐命令群を挿入した後に、前処理命令群、選択処理命令群、変遷処 理命令群、及び複数の選択対象データの配置を決定して秘密保持プログラムを生 成したが、これに限定されない。
[0393] プログラム難読化装置 50は、前処理命令群、選択処理命令群、変遷処理命令群、 及びラベル名のみ力 なる複数の選択対象データの配置先を決定して、その後、ラ ベル名のみからなる複数の選択対象データのそれぞれに、選択対象主要命令群、 更新処理命令群、及び分岐命令群を挿入して秘密保持プログラムを生成してもよ ヽ (14)上記実施の形態及び上記変形例をそれぞれ組み合わせるとしてもよい。
[0394] 4.第 4の実施の形態
以下、本発明に係る第 4の実施の形態としての秘密保持プログラム 2000、プロダラ ム難読化装置 1010及び秘密処理装置 1020について、図面を参照して説明する。 なお、システムの構成は、第 3の実施の形態にて示す構成と同様であるため、説明 は省略する。
[0395] 秘密処理装置 1020は、第 3の実施の形態にて示す秘密処理装置 60と同様に、秘 密情報を用いた装置である。
秘密処理装置 1020と、第 3の実施の形態にて示す秘密処理装置 60とは、構成要 素は同じであるが、各部の処理がそれぞれ異なっている。以下では、各部の処理の 説明が中心となるため、説明を簡単にするために、コンピュータ上で実行されることで 秘密処理装置を実現する秘密保持プログラム 2000の説明をもって、秘密処理装置 の説明に替える。ここで、秘密処理装置 1020の構成と秘密保持プログラム 2000の 各部との対応関係は第 3の実施の形態と同様である。
[0396] 4. 1 秘密保持プログラム 2000
秘密保持プログラム 2000の全体構成図を図 41に示す。以下では秘密保持プログ ラム 2000の詳細について、図 41を参照しながら説明していく。ここで、第 3の実施の 形態の秘密保持プログラム 500と同様の部分については、同一の符号を付け、説明 を省略する。
[0397] 秘密保持プログラム 2000は、第 3の実施の形態にて示す秘密保持プログラム 500 と同様、プログラムに含まれるプログラム命令群がどのような実行順序で実行されるか を、不正解析者に解析されないように、難読化されたプログラムである。
秘密保持プログラム 2000は、第 3の実施の形態と同様の管理情報更新命令群 52 5、変遷処理命令群 530と、第 3の実施の形態と異なる前処理命令群 2010、選択処 理命令群 2020、選択対象データ 2040、 2041、 · · ·、 2046とを備え、これら力 S図 41 に示す順番に配置されている。各部の具体的な説明は後述する。
[0398] 選択対象データ 2040〜2046はそれぞれ、第 3の実施の形態と同様の選択対象 主要命令群 550〜556、第 3の実施の形態と異なる更新処理命令群 2060〜2066 と分岐命令群 2070〜2076と力 なり、これらは図 41に示す順番に配置されている。 各部は 1以上のプログラム命令力もなるプログラム命令群である。
秘密保持プログラム 2000は、呼出元のプログラムから、 3つの入力値 in— 1、 in— 2 、 in— 3および、このプログラムが提供する機能の処理を行う際に使用するパラメータ を受け取り、このプログラムが提供する機能の処理を行うプログラム命令群である。な お、 in— k(kはインデックス)は(7— k)未満の非負整数である。なお、選択対象デー タをここでは、 2040〜2046の 7つとしている力 これに限らない。選択対象データの 個数を n+ 1個としてもよい。ここで、 nは自然数である。このとき、 in— kは(n+ 1— k) 未満の非負整数である。また、入力値の個数は、 in— 1、 in— 2、 in— 3の 3つとして いるが、これに限らない。 m (mは n+ 1以下の自然数)個であってもよい。
[0399] 秘密保持プログラム 2000の処理では、選択処理命令群 2020での処理に用いる 選択パラメータ群の選択パラメータ CP_1、 CP_2、 CP_3と選択パラメータインデ ックス CPIと、選択識別子を保持する選択識別子用変数を用いる。
ここでは、秘密保持プログラム 2000が正常系の実行時に呼出元のプログラムから 受け取る入力値 in— 1、 in— 2、 in— 3は値「2」、「4」、「3」であるとする。本実施の形 態で提供する秘密保持プログラム 2000は、呼出元のプログラム力も受け取る値を用 Vヽれば、(選択対象主要命令群を含む)選択対象データを正 ヽ順番に実行できる プログラムであって、呼出元のプログラムから受け取る値を知ることができな 、不正解 析者にとっては、(選択対象主要命令群を含む)選択対象データの実行順序を知る ことが困難なプログラムである。
[0400] 4. 1. 1 前処理命令群 2010
前処理命令群 2010は、選択処理命令群 2020で用いる選択パラメータ群を設定 するプログラム命令群である。なお、選択パラメータ群は、選択パラメータ CP_1、選 択パラメータ CP— 2、選択パラメータ CP— 3と、選択パラメータインデックス CPIから なる。これらの選択パラメータ CP— 1〜CP— 3は、非負整数値であり、選択パラメ一 タインデックス CPIは自然数である。
[0401] 前処理命令群 2010は、秘密保持プログラム 2000が起動された際に、最初に実行 されるプログラム命令群である。呼び出し元のプログラムカゝら入力値 in— 1、 in— 2、 i n— 3を受け取り、受け取った 3つの値それぞれを選択パラメータ群の選択パラメータ CP— 1、選択パラメータ CP— 2、選択パラメータ CP— 3にそれぞれ格納し、選択パラ メータ群の選択パラメータインデックス CPIを値「1」に設定するプログラム命令群を含 む。正常系の実行時には、 in— 1、 in— 2、 in— 3は値「2」、「4」、「3」であり、選択パ ラメータ CP— 1〜CP— 3にそれぞれ値「2」、「4」、「3」を格納する処理を行う。なお、 選択パラメータは、入力値 in_l、 in_2、 · · ·の個数 (本実施の形態では 3個)だけ 存在する。
[0402] 4. 1. 2 選択処理命令群 2020
選択処理命令群 2020は、選択パラメータ群を用いて、選択識別子を算出するプロ グラム命令群を含む。なお、選択識別子は、第 3の実施の形態と同様、変遷処理命 令群の実行時に使用する値である。
選択処理命令群が選択識別子を算出する処理では、まず、選択パラメータ群の選 択パラメータインデックス CPIに対し、選択パラメータ群の選択パラメータ CP_CPIを 選択する(すなわち、 CPI= 1の場合には、選択パラメータ CP— 1を選択する)。
[0403] 次に、秘密処理装置 1020が有する管理情報を用いて、未実行の選択対象データ の中で CP— CPI番目の選択対象データを選択する。選択した選択対象データの番 号を選択識別子用変数に格納する。ここで、選択対象データの番号は 1からではなく 、 0から順に数える。例えば、選択対象データ 2040が未実行であり、 CP_CPI = 0 である場合は、選択対象データ 2040を選択し、選択識別子用変数には 0が格納さ れる。
[0404] 4. 1. 3 選択対象データ 2040〜2046
選択対象データ 2040〜2046は、変遷処理命令群 530による分岐後に、いずれか が実行されるプログラム命令群である。
選択対象データ 2040〜2046は、それぞれ、第 3の実施の形態と同様の選択対象 主要命令群 150〜156と、第 3の実施の形態と異なる更新処理命令群 2060〜206 6と分岐命令群 2070〜2076とを含むプログラム命令群である。
[0405] 本実施の形態では、正常系での実行時には、選択対象主要命令群 552、 555、 55 4の順番で実行されることで、この秘密保持プログラムが提供する機能の処理を行う。 すなわち、選択対象主要命令群 552、 555、 554のそれぞれには、第 1〜第 3の機能 提供命令群が入る。また、選択対象主要命令群 550、 551、 553、 556には、偽装機 能提供命令群が入る。
[0406] (1)更新処理命令群 2060〜2066
更新処理命令群 2060〜2066は、次回の選択時に用いる選択パラメータ群の値 の更新を行うプログラム命令群である。具体的には、更新処理命令群 2060〜2066 は、選択パラメータインデックス CPIをインクリメントする。これにより、選択処理命令群 2020は、選択時に用いる選択パラメータを直接指定する。
[0407] (2)分岐命令群 2070〜2076
分岐命令群 2070〜 6は、それぞれ選択対象データ 2040〜2046の外にある 選択処理命令群 2020へ分岐するプログラム命令群、及びプログラム呼出元に制御 を戻す処理のプログラム命令群の何れかからなる。
第 3の機能提供命令群を含む選択対象データ 2044に含まれる分岐命令群 2074 は、プログラム呼び出し元に制御を戻す処理のプログラム命令群であり、他の選択対 象データに含まれる選択対象外への分岐命令群は、選択処理命令群 2020へ分岐 するプログラム命令群である。
[0408] 4. 1. 4 動作
(1)秘密保持プログラム 2000の実行時の動作
ここでは、秘密保持プログラム 2000を実行した場合の秘密処理装置 1020の動作 と秘密処理装置 60の動作との異なる点を、図 24を用いて説明する。
秘密処理装置 1020の動作は、図 24〖こ示すステップ S500、ステップ S505、ステツ プ S530の動作を以下の動作に変更する。
[0409] 本実施の形態では、ステップ S500を、選択パラメータの初期値を、機能提供命令 群の数と同じだけ取得、選択パラメータインデックス CPIの値の初期化、及び前処理 の実行を行うように変更する。
本実施の形態では、ステップ S505を、選択識別子を、選択パラメータインデックス CPIが示す番号を持つ選択パラメータを選択することにより選択するように変更する。 例えば、選択パラメータインデックス CPIが「1」の場合は選択パラメータ CP— 1を選 択する。
[0410] 本実施の形態では、ステップ S530を、選択パラメータインデックス CPIの値をインク リメントするように変更する。
(2)動作の具体例
以下、本実施の形態における秘密保持プログラム 2000の動作の具体例を、図 42 を用いて説明する。
[0411] ここでは、上述したように、選択対象主要命令群 552、 555、 554のそれぞれに、第 1〜第 3の機能提供命令群が含まれ、選択対象主要命令群 550、 551、 553、 556 には、偽装機能提供命令群が含まれており、正常系での実行時には、選択対象主 要命令群 552、 555、 554の順番で実行されることで、この秘密保持プログラムが提 供する機能の処理を行う。
[0412] 秘密保持プログラム 2000は、前処理命令群 2010の処理を行う(ステップ S2000) 。具体的には、秘密保持プログラム 2000の前処理命令群 2010は、呼出元のプログ ラムから、入力値 inl、 in2、 in3として、それぞれ値「2」、「4」、「3」を受け取り、第 1〜 3の選択パラメータ用変数にそれぞれ値「2」、「4」、「3」を格納する処理、及び選択 パラメータインデックス CPIを値「1」に初期化する処理を行い、選択処理命令群 202 0へ分岐する。
[0413] 秘密保持プログラム 2000は、選択処理命令群 2020の処理を行う(ステップ S200 5)。具体的には、選択処理命令群 2020は、選択パラメータインデックス CPIに格納 されている値に基づいて、 1つの選択パラメータを取得する。選択処理命令群 2020 は、取得した選択パラメータに基づいて、複数の選択対象データうち 1の選択対象デ ータを選択する。ここでは、選択パラメータインデックス CPIは 1であるため、選択処理 命令群 2020は、選択パラメータ CP— 1 (= 2)を取得する。選択処理命令群 2020は 、秘密処理装置 1020が有する管理情報により、未実行の選択対象データ(2040、 2 041、 2042、 2043、 2044、 2045、 2046)の中で、 CP— 1 ( = 2)番目〖こ配置された 選択対象データ 2042を選択する。選択処理命令群 2020は、選択識別子用変数に 値「2」を格納する。 [0414] 秘密保持プログラム 2000は、管理情報更新命令群 525の処理を行う(ステップ S2
010)。具体的には、管理情報更新命令群 525は、選択識別子用変数「2」に対応す る選択対象データ 2042の管理情報を実行済みに更新する。
秘密保持プログラム 2000は、変遷処理命令群 530の処理を行う(ステップ S2015)
。具体的には、変遷処理命令群 530は、選択識別子用変数「2」に対応する選択対 象データ 2042に分岐する処理を行う。
[0415] 秘密保持プログラム 2000は、選択対象データ 2042に含まれる選択対象主要命令 群 552の処理を行う(ステップ S2020)である。具体的には、選択対象データ 2042は
、このプログラムが提供する機能の一部である第 1機能提供命令群に相当する処理 を行う。
秘密保持プログラム 2000は、更新処理命令群 2062の処理を行う(ステップ S202 5)。具体的には、更新処理命令群 2062は、選択パラメータ群の選択パラメータイン デッタス CPIをインクリメントする。ここでは、選択パラメータインデックス CPIの値が「1 」であったものが「2」になる。
[0416] 秘密保持プログラム 2000は、分岐命令群 2072の処理を行う(ステップ S2030)。
具体的には、分岐命令群 2072は、選択処理命令群 2020へ分岐する処理を行う。 秘密保持プログラム 2000は、選択処理命令群 2020の処理を行う(ステップ S203 5)。具体的には、選択パラメータインデックス CPIに格納された値は「2」であるため、 選択処理命令群 2020は、選択パラメータ CP— 2 (=4)を取得する。選択処理命令 群 2020は、秘密処理装置 1020が有する管理情報により、未実行の選択対象デー タ(2040、 2041、 2043、 2044、 2045、 2046)の中で、 CP— 2 (=4)番目〖こ配置さ れた選択対象データ 2045を選択する。選択処理命令群 2020は、選択識別子用変 数に値「5」を格納する。
[0417] 秘密保持プログラム 2000は、管理情報更新命令群 525の処理を行う(ステップ S2 040)。具体的には、管理情報更新命令群 525は、選択識別子用変数「5」に対応す る選択対象データ 2045の管理情報を実行済みに更新する。
秘密保持プログラム 2000は、変遷処理命令群 530の処理を行う(ステップ S2045) 。具体的には、変遷処理命令群 530は、選択識別子用変数「5」に対応する選択対 象データ 2045に分岐する処理を行う。
[0418] 秘密保持プログラム 2000は、選択対象データ 2045に含まれる選択対象主要命令 群 555の処理を行う(ステップ S2050)。具体的には、選択対象データ 2045は、この プログラムが提供する機能の一部である第 2機能提供命令群に相当する処理を行う 秘密保持プログラム 2000は、更新処理命令群 2065の処理を行う(ステップ S205 5)。具体的には、更新処理命令群 2065は、選択パラメータ群の選択パラメータイン デッタス CPIをインクリメントする。ここでは、選択パラメータインデックスの値力「2」で あったものが「3」になる。
[0419] 秘密保持プログラム 2000は、分岐命令群 2075の処理を行う(ステップ S2060)。
具体的には、分岐命令群 2075は、選択処理命令群 2020へ分岐する処理を行う。 秘密保持プログラム 2000は、選択処理命令群 2020の処理を行う(ステップ S206 5)。具体的には、選択パラメータインデックス CPIに格納された値は「3」であるため、 選択処理命令群 2020は、選択パラメータ CP— 3 ( = 3)を取得する。選択処理命令 群 2020は、秘密処理装置 1020が有する管理情報により、未実行の選択対象デー タ(2040、 2041、 2043、 2044、 2046)の中で、 CP— 3 ( = 3)番目に配置された選 択対象データ 2044を選択する。選択処理命令群 2020は、選択識別子用変数に値 「4」を格納する。
[0420] 秘密保持プログラム 2000は、管理情報更新命令群 525の処理を行う(ステップ S2 070)。具体的には、管理情報更新命令群 525は、選択識別子用変数「4」に対応す る選択対象データ 2044の管理情報を実行済みに更新する。
秘密保持プログラム 2000は、変遷処理命令群 530の処理を行う(ステップ S2075) 。具体的には、変遷処理命令群 530は、選択識別子用変数「4」に対応する選択対 象データ 2044に分岐する処理を行う。
[0421] 秘密保持プログラム 2000は、選択対象データ 2044に含まれる選択対象主要命令 群 554の処理を行う(ステップ S2080)。具体的には、選択対象データ 2044は、この プログラムが提供する機能の一部である第 3機能提供命令群に相当する処理を行う 秘密保持プログラム 2000は、更新処理命令群 2064の処理を行う(ステップ S208 5)。具体的には、更新処理命令群 2064は、選択パラメータ群の選択パラメータイン デッタス CPIをインクリメントする。ここでは、選択パラメータインデックスの値力 「3」で あったものが「4」になる。
[0422] 秘密保持プログラム 2000は、分岐命令群 2074の処理を行う(ステップ S2090)。
具体的には、分岐命令群 2074は、秘密保持プログラム 2000の呼び出し元に分岐 する処理を行う。
4. 2 プログラム難読ィ匕装置 1010
プログラム難読ィ匕装置 1010は、図 43にて示すように、プログラム記憶部 800f、入 力部 801f、機能提供命令群生成部 802f、偽装機能提供命令群生成部 803f、配置 順序決定部 804f、管理命令群生成部 805f、秘密保持プログラム生成部 806f、及 び出力部 807fから構成されて ヽる。
[0423] プログラム難読化装置 1010は、具体的には、マイクロプロセッサ、 ROM、 RAM、 ハードディスクユニット、ディスプレイユニット、キーボード、マウスなどから構成される コンピュータシステムである。前記 RAM又は前記ハードディスクユニットには、コンビ ユータブログラムが記憶されている。ここで、コンピュータプログラムは、所定の機能を 達成するために、コンピュータに対する指令を示す命令コードが複数個組み合わさ れて構成されたものである。前記マイクロプロセッサ力 前記コンピュータプログラム に従って動作することにより、プログラム難読ィ匕装置 1010は、その機能を達成する。 つまり、前記マイクロプロセッサは、前記コンピュータプログラムに含まれる各命令を 1 個ずつ読み出し、読み出した命令を解読し、解読結果に従って動作する。
[0424] なお、プログラム記憶部 800f、入力部 801f、機能提供命令群生成部 802f、偽装 機能提供命令群生成部 803f、管理命令群生成部 805f、秘密保持プログラム生成 部 806f、及び出力部 807fのそれぞれは、第 3の実施の形態にて示すプログラム記 憶部 800、入力部 801、機能提供命令群生成部 802、偽装機能提供命令群生成部 803、管理命令群生成部 805、秘密保持プログラム生成部 806、及び出力部 807と 同様であるため、説明は省略する。
[0425] 配置順序決定部 804と、配置順序決定部 804fとの違いは、前者は選択パラメータ の初期値と選択識別子を求めるための計算式を用いて選択識別子を算出したが、後 者は選択パラメータの初期値を用い、計算式を用いな 、ことである。
以下、配置順序決定部 804fにつ 、て説明する。
また、配置順序決定部 804fは、図示していないが、制御部 850f、選択処理部 851 f、管理情報更新部 852f、更新処理部 853f、及び管理情報保持部 854fを有してい る。これら構成要素の接続関係は、図 26にて示す配置順序決定部 804の構成要素 の接続関係と同じである。
[0426] 配置順序決定部 804fは、選択パラメータの初期値を用いて、実際にどのような順 序で選択識別子が算出されるのかを確認することにより、機能提供命令群および偽 装機能提供命令群が配置されるべき選択対象主要命令群を決定する。
なお、本実施の形態では、第 3の実施の形態と同様に、入力部 801fにて選択パラ メータの初期値を受け付けるものとし、選択パラメータ CP— 1〜CP— 3の初期値は「 2」、「4」、「3」であるとする。
[0427] (1)管理情報保持部 854f
管理情報保持部 854fは、管理情報保持部 854と同様であるため、説明は省略す る。なお、以降、必要であれば、管理情報テーブル T800を用いて説明する。
これにより、機能提供命令群が配置された位置 (配置された選択対象データ)を記 '隐することができる。
[0428] (2)制御部 850f
制御部 850fは、選択パラメータ群を記憶するパラメータ記憶領域を有して 、る。 制御部 850fは、入力部 801fにて受け付けた選択パラメータの初期値 CP— 1、 CP —2、及び CP— 3 (ここでは、それぞれ「2」、「4」、「3」)をパラメータ記憶領域に記憶 する。
[0429] また、処理開始時には、制御部 850fは、選択パラメータインデックス CPIに初期値「 1」を設定し、パラメータ記憶領域に記憶する。
制御部 850fは、選択処理部 851f、管理情報更新部 852f、及び更新処理部 853f の動作を制御する。
制御部 850fは、選択識別子の値それぞれと、プログラム記憶部 800fにて記憶され て ヽる選択対象データとの対応付けを行う。
[0430] 制御部 850fは、生成された第 i番目の機能提供命令群を機能提供命令群生成部 8 02fから取得する。制御部 850fは、取得した第潘目の機能提供命令群を、選択処 理部 85 Ifにて取得された選択識別子に基づいて、プログラム記憶部 800fにて記憶 され、対応する選択対象データへ挿入する。ここで、 iは 1以上 m以下の整数である。 また、制御部 850fは、第 i番目の機能提供命令群と、挿入先の選択対象データとの 対応付けを一時的に記憶して 、る。
[0431] 制御部 850fは、生成された複数の偽装機能提供命令群のうち選択対象データに 挿入されていない 1の偽装機能提供命令群を偽装機能提供命令群生成部 803fから 取得する。制御部 850fは、取得した偽装機能提供命令群を、第 i機能提供命令群、 又は偽装機能提供命令群が挿入されていない 1の選択対象データに挿入する。制 御部 850fは、この動作を、全ての偽装機能提供命令群に対して行う。
[0432] これにより、制御部 850fは、各選択対象データに、第 i機能提供命令群、又は偽装 機能提供命令群が挿入することができる。
制御部 850fによる第 i番目の機能提供命令群を取得する動作により、配置対象と なる機能提供命令群を選択することができる。
(3)選択処理部 85 If
選択処理部 85 Ifは、パラメータ記憶領域に記憶されて 、る選択パラメータインデッ タス CPIを取得し、取得した CPIに基づいて、選択パラメータ CP— kを取得する。ここ で、 kは 1以上 3以下の数である。
[0433] 選択処理部 851fは、取得した CP— kの値と管理情報テーブル T800を用いて、選 択識別子を取得する。
選択識別子の取得方法について、以下に説明する。
選択処理部 851fは、管理情報テーブル T800にお 、て値が「0」であるものを上位 力も順に、 0番目、 1番目、 · · · ·とし、取得した CP— kの値と一致する管理情報を取 得する。選択処理部 851fは、取得した管理情報に対応する選択対象データの選択 識別子を取得する。
[0434] 選択処理部 851fの動作と、制御部 850fによる第 i番目の機能提供命令群を選択 処理部 851fにて取得された選択識別子に基づき選択対象データに挿入する動作と により、機能提供命令群を適切な配置先へ配置することができる。
(4)管理情報更新部 852f
管理情報更新部 852fは、管理情報更新部 852と同様であるので、説明は省略す る。
[0435] (5)更新処理部 853f
更新処理部 853fは、パラメータ記憶領域にて記憶されて 、る選択パラメータインデ ックス CPIを更新する。つまり、ノ メータ記憶領域にて記憶されている選択パラメ一 タインデックス CPIに 1をインクリメントする。
4. 3 プログラム難読ィ匕装置 1010の動作
プログラム難読ィ匕装置 1010の動作は、図 27にて示すステップ S620の処理を、以 下に示す配置決定処理に置き換えることで、秘密保持プログラムを生成する。
[0436] 4. 3. 1 配置決定処理
ここでは、配置決定処理の動作について、図 44に示す流れ図を用いて説明する。 制御部 850fは、カウンタ iに「1」、選択パラメータインデックス CPIに初期値「1」を設 定し、選択パラメータインデックス CPI及び選択パラメータ CP_1、 CP_2、 CP_3 の各初期値「2」、「4」、「3」をパラメータ記憶領域へ格納する。制御部 850fは、選択 識別子の値それぞれと、選択対象データとの対応付けを行う (ステップ S2500)。ここ で、カウンタ iは、現在着目している機能提供命令群が何番目に実行されるべきであ るカゝを表す。すなわち、ここでは、第 1の機能提供命令群カゝら順番に配置順序を決定 していく。
[0437] 選択処理部 851fは、選択パラメータインデックス CPIを取得し、取得した CPIに基 づいて、選択パラメータ CP— kを取得する。選択処理部 851fは、取得した CP— kの 値と管理情報テーブル T800を用いて、選択識別子を取得する (ステップ S 2505)。 ここで、 kは 1以上 3以下の数である。例えば、選択処理部 851fは、選択パラメ一タイ ンデッタス CPIが「1」である場合には、選択パラメータ CP— 1 (= 2)を取得し、取得し た CP_1と管理情報テーブル T800とを用いて、選択識別子「2」を取得する。
[0438] 制御部 850fは、第 i番目の機能提供命令群を、選択処理部 85 Ifにて取得された 選択識別子に基づいて、対応する選択対象データへ挿入する (ステップ S2510)。 例えば cont = 1で、選択識別子の値が「2」であった場合には、第 1機能提供命令 群が、選択対象データ 542に配置されることとなる。
管理情報更新部 852fは、管理情報テーブル T800に含まれる複数の管理情報の うち、選択処理部 851fにて取得された選択識別子に対応する管理情報を、値「0」か ら値「1」へと更新する (ステップ S2515)。例えば、選択識別子の値が「2」であった場 合には、管理情報保持部 854fの管理情報テーブル T800において、選択対象デー タ 542に対応する管理情報を未配置力も配置済みに変える。
[0439] 更新処理部 853fは、パラメータ記憶領域にて記憶されている選択パラメータインデ ックス CPIに 1をインクリメントして、選択パラメータインデックス CPIの値を更新し、更 新結果をパラメータ記憶領域へ上書きする (ステップ S2520)。
制御部 850fは、カウンタ iに値「1」を加算する(ステップ S2525)。
制御部 850fは、カウンタ iが機能提供命令群の個数より大きいか否かを判定する( ステップ S2530)。
[0440] 大きくないと判定する場合には (ステップ S2530における「NO」)、制御部 850fは、 ステップ S2505に戻り、選択処理部 85 Ifの動作を制御する。
大きいと判定する場合には (ステップ S2530における「YES」)、制御部 850fは、複 数の偽装機能提供命令群のそれぞれに対して、機能提供命令群が挿入されて ヽな い 1以上の選択対象データの何れかが配置先となるように、配置先を決定する (ステ ップ S2535)。例えば、選択対象データ 540、 541、 542、 544力未実行であれば、 偽装機能提供命令群を配置する位置をそれらに決定し、各偽装提供命令群を挿入 する。
[0441] 4. 4 変形例
(1)上記第 4の実施の形態では、秘密保持プログラムは、選択パラメータの初期値 として、呼び出し元力 の入力値を格納した力 これに限定されない。秘密保持プロ グラムは、ネットワーク上の他の機器から取得する値を選択パラメータの初期値に代 入する構成でもよ ヽし、プログラム実行装置が保持する他のプログラムを実行した結 果得られる出力値を選択パラメータの初期値に代入する構成でもよい (2)上記第 4の実施の形態では、機能提供命令群が 3つ、偽装機能提供命令群が 4つの場合を示したが必ずしもこの数である必要はな 、。機能提供命令群は複数個 、偽装機能提供命令群は 1個以上であればよい。
[0442] (3)上記第 4の実施の形態では、秘密処理装置 1020を上述の通りプログラムを用 いたプログラム実行装置の形で実現している力 これに限られるものではなくハードウ エア的な実装を行ってもょ 、。
(4)上記実施の形態及び上記変形例をそれぞれ組み合わせるとしてもよ!/、。
4. 5 第 4の実施の形態の効果
本実施の形態では、選択処理命令群 2020では選択対象データのうち、未実行の 選択対象データの中からのみ、次に選択する選択対象データを決定している。よつ て、難読化対象データが同じ選択対象データを重複して実行することがないことを知 つて 、る不正解析者が、選択パラメータ群の初期値を変えての全数探索を行ったと しても、 V、ずれの初期値を代入した場合にも選択対象データが重複して選ばれること はなぐ重複する力否かに基づいて効率的に間違った初期値を見つけ出していくこと が困難になる。
[0443] また、本実施の形態では、機能提供命令群の数と同じだけの入力値を用意し、各 入力値に対応する選択対象データを選択している。このような実装による効果を、具 体例を交えながら、以下に述べる。上述した例では機能提供命令群の数は 3つであ るため、入力値 in— 1、 in— 2、 in— 3により、選択対象データを選択している。本実 施の形態の秘密保持プログラム 2000では、始めに 6以下の非負整数 in— 1 (7種類 存在)を用いて、 7種類の選択対象データ 2040〜2046のいずれかを選択する。ここ で、括弧内の" 7種類存在"は、不正解析者が設定しうる in— 1の値が 7種類存在する という意味である。次に 5以下の非負整数 in— 2 (6種類存在)を用いて、 6種類の未 実行の選択対象データ(選択対象データ 2040〜2046から in— 1で選択された選択 対象データを除いたもの)のいずれかを選択する。さらに 4以下の非負整数 in— 3 (5 種類存在)を用いて、 5種類の未実行の選択対象データ (選択対象データ 2040〜2 046から in— 1及び in— 2で選択された選択対象データを除 ヽたもの)を選択する。 このように一意に選択対象データを選択することにより、入力値に対して選択対象デ ータの選択するバリエーションが減らず、攻撃者が全数攻撃するときの組合せ数を減 らすことがない。
[0444] 5.第 5の実施の形態
以下、本発明に係る第 5の実施の形態としての秘密保持プログラム 2200、プロダラ ム難読化装置 3010及び秘密処理装置 3020について、図面を参照して説明する。 なお、システムの構成は、第 3の実施の形態にて示す構成と同様であるため、説明 は省略する。
[0445] 秘密処理装置 1020は、第 3の実施の形態にて示す秘密処理装置 60と同様に、秘 密情報を用いた装置である。
秘密処理装置 3020と、第 3の実施の形態にて示す秘密処理装置 60とは、構成要 素は同じであるが、各部の処理がそれぞれ異なっている。以下では、各部の処理の 説明が中心となるため、説明を簡単にするために、コンピュータ上で実行されることで 秘密処理装置を実現する秘密保持プログラム 2200の説明をもって、秘密処理装置 の説明に替える。ここで、秘密処理装置 3020の構成と秘密保持プログラム 2200の 各部との対応関係は第 3の実施の形態と同様である。
[0446] 5. 1 秘密保持プログラム 2200
秘密保持プログラム 2200の全体構成図を図 45に示す。以下では秘密保持プログ ラム 2200の詳細について、図 45を参照しながら説明していく。ここで、第 3の実施の 形態の秘密保持プログラム 500と同様の部分については、同一の符号を付け、説明 を省略する。
[0447] 秘密保持プログラム 2200は、第 3実施の形態の秘密保持プログラム 500と同様、プ ログラムに含まれるプログラム命令群がどのような実行順序で実行されるかを、不正 解析者に解析されたくな ヽプログラムである。
秘密保持プログラム 2200は、管理情報更新命令群 525、変遷処理命令群 530と、 第 3の実施の形態と異なる前処理命令群 2210、選択処理命令群 2220、選択対象 データ 2240、 2241、 · · ·、 2246とを含み、これらが図 45に示す順番に配置されて いる。
[0448] 選択対象データ 2240〜2246はそれぞれ、第 3の実施の形態と同様の選択対象 主要命令群 550〜556、第 3の実施の形態と異なる更新処理命令群 2260〜2266 と分岐命令群 2270〜2276と、とからなり、これらは図 45に示す順番に配置されてい る。各命令群は 1以上のプログラム命令力もなるプログラム命令群である。
秘密保持プログラム 2200は、呼出元のプログラムから、 2つの入力値 in— 1、 in— 2 および、このプログラムが提供する機能の処理を行う際に使用するパラメータを受け 取り、このプログラムが提供する機能の処理を行うプログラム命令群である。なお、 in —k (kはインデックス)は(7— k)未満の非負整数である。なお、選択対象データをこ こでは、 2240〜2246の 7つとしている力 これに限らない。選択対象データの個数 を n+ 1個としてもよい。ここで、 nは自然数である。このとき、 in— kは(n+ 1— k)未満 の非負整数である。また、入力値 in— 1、 in— 2の数は 2つとしている力 これに限ら ない。 m (mは n+ 1以下の自然数)個であってもよい。
[0449] 秘密保持プログラム 2200の処理では、後述の選択処理命令群 2220での処理に 用いる選択パラメータ群の選択パラメータ CP— 1、 CP— 2とモジュラス値 NNと、後述 の選択識別子を保持する選択識別子用変数を用いる。
ここでは、秘密保持プログラム 2200が正常系の実行時に呼出元のプログラムから 受け取る入力値 in— 1、 in— 2は値「2」、「4」であるとする。本実施の形態で提供する 秘密保持プログラム 2200は、呼出元のプログラム力も受け取る値を用いれば、(選択 対象主要命令群を含む)選択対象データを正 、順番に実行できるプログラムであ つて、呼出元のプログラム力 受け取る値を知ることができな 、不正解析者にとって は、(選択対象主要命令群を含む)選択対象データの実行順序を知ることが困難な プログラムである。
[0450] 5. 1. 1 前処理命令群 2210
前処理命令群 2210は、選択処理命令群 2220で用いる選択パラメータ群を設定 するプログラム命令群である。なお、選択パラメータ群は、選択パラメータ CP_1、選 択パラメータ CP— 2と、モジュラス値 NNカゝらなる。これらの選択パラメータ CP— 1、 C P— 2は、非負整数値であり、モジュラス値 NNは自然数である。
[0451] 前処理命令群 2210は、秘密保持プログラム 2200が起動された際に、最初に実行 されるプログラム命令群である。呼び出し元のプログラム力 入力値 in l、in 2を 受け取り、前処理命令群 2210は、受け取った値を選択パラメータ群の選択パラメ一 タ CP_1、選択パラメータ CP_2にそれぞれ格納し、選択パラメータ群のモジュラス 値 NNを 7に設定するプログラム命令群と、選択処理命令群 2220に分岐するプログ ラム命令群とからなり、これらは順に行われるプログラム命令群である。正常系の実行 時には、 in— 1、 in— 2は値「2」、「4」であり、前処理命令群 2210は、選択パラメータ CP— 1、 CP— 2にそれぞれ値「2」、「4」を格納する処理を行う。なお、選択パラメ一 タは、入力値 in_l、 in_2、 · · ·の個数 (本実施の形態では 2個)だけ存在する。また 、本実施の形態では、モジュラス値の初期値は選択対象データの数に合わせて 7と している。
[0452] 5. 1. 2 選択処理命令群 2220
選択処理命令群 2220は、選択パラメータ群を用いて、選択識別子を算出するプロ グラム命令群と、変遷処理命令群 530に分岐するプログラム命令群からなり、これら は順に行われるプログラム命令群である。なお、選択識別子は、第 3の実施の形態と 同様に変遷処理命令群 530で使用する値である。
[0453] 選択処理命令群 2220が選択識別子を算出する処理では、まず、選択パラメータ 群の選択パラメータ CP— 1、 CP— 2とモジュラス値 NNに対し、 pl、 p2を NNと互い に素な整数とし、式 20「pl X (選択パラメータ CP_1) +p2 X (選択パラメータ CP_ 2) mod NN」を算出し、算出結果を INDに設定する。以降の説明において、 IND は選択識別子を示す。ここで、 piと NNと互いに素とは piと NNの最大公約数が 1で あることを示す。また、演算子「X」は掛け算を表す。次に、秘密処理装置 3020が有 する管理情報を用いて、未実行の選択対象データの中で IND番目の選択対象デー タを選択する。選択した選択対象データの番号を選択識別子用変数に格納する。こ こで、選択対象データの番号は 1からではなぐ 0から順に数える。したがって、もし、 選択対象データ 2240が未実行であり、 IND=0である場合は、選択対象データ 224 0を選択し、選択識別子用変数は 0となる。
[0454] 本実施の形態では、 pl、 p2をそれぞれ、値「1」、「2」とし、式 20を「1 X (選択パラメ ータ CP— 1) + 2 X (選択パラメータ CP— 2) mod NN」とする。
5. 1. 3 選択対象データ 2240〜2246 選択対象データ 2240〜2246は、変遷処理命令群 530により分岐してきた際に、 実行されるプログラム命令群である。
[0455] 選択対象データ 2240〜2246は、それぞれ、第 3の実施の形態と同様の選択対象 主要命令群 550〜556と、第 3の実施の形態と異なる更新処理命令群 2260〜226 6と分岐命令群 2270〜2276と力 なるプログラム命令群である。
本実施例では、正常系での実行時には、選択対象主要命令群 553、 555、 554の 順番で実行されることで、この秘密保持プログラムが提供する機能の処理を行う。す なわち、選択対象主要命令群 553、 555、 554のそれぞれには、第 3の実施の形態 における第 1機能提供命令群、第 2機能提供命令群、及び第 3機能提供命令群が入 り、選択対象主要命令群 550、 551、 552、 556には第 3の実施の形態と同様の偽装 機能提供命令群が入るものとする。
[0456] (1)更新処理命令群 2260〜2266
更新処理命令群 2260〜2266は、選択パラメータ群の値の更新を行うプログラム 命令群である。選択パラメータ CP— 2の値を選択パラメータ CP— 1に代入し、選択 ノ メータ CP— 2に、選択識別子用変数に格納されている値を代入し、選択パラメ一 タ群のモジュラス値をデクリメントする。なお、ここでは選択パラメータの数が 2つであ る力 m個の場合は、選択パラメータ CP_mの値を選択パラメータ CP_(m— 1)に 代入し、選択パラメータ CP— (m—1)の値を選択パラメータ CP— (m— 2)に代入し、 · · ·、選択パラメータ CP— 2の値を選択パラメータ CP— 1に代入し、選択パラメータ C P— mに、選択識別子用変数に格納されている値を代入し、モジュラス値をデクリメン トする。また、モジュラス値をデクリメントした場合には、デクリメントされたモジュラス値 は、 pl、 p2と互いに素になる必要はない。
[0457] (2)分岐命令群 2270〜2276
分岐命令群 2270〜2276は、それぞれ選択対象データ 2240〜2246の外にある 選択処理命令群 520へ分岐するプログラム命令群や、プログラム呼出元に制御を戻 す処理のプログラム命令群である。第 3機能提供命令群を含む選択対象データ 224 4に含まれる分岐命令群 2274は、プログラムの呼出元に制御を戻す処理のプロダラ ム命令群であり、他の選択対象データに含まれる分岐命令群は、選択処理命令群 5 20へ分岐するプログラム命令群である。
[0458] 5. 1. 4 動作
ここでは、秘密保持プログラム 2200を実行した場合の秘密処理装置 3020の動作 と、秘密処理装置 60の動作との異なる点を、図 24を用いて説明する。
秘密処理装置 3020の動作は、図 24〖こ示すステップ S500、ステップ S505、ステツ プ S530の動作を以下の動作に変更する。
[0459] 本実施の形態では、ステップ S500を、選択パラメータの初期化お呼び前処理の実 行にカロえ、モジュラス値 NNの初期化も行うように変更する。ここで、モジュラス値の初 期値は選択対象データの数と同一とする。
本実施の形態では、ステップ S505を、選択パラメータ群に含まれるモジュラス値 N Nを取得し、式 20と、取得したモジュラス値 NNとを用いて選択識別子を算出するよう に変更する。なお、ここでの NNは選択対象データの数ではなぐモジュラス値である
[0460] 本実施の形態では、ステップ S530を、選択パラメータの更新に加え、モジュラス値 NNをデクリメントするように変更する。
(2)動作の具体例
以下、本実施の形態における秘密保持プログラム 2200の動作の具体例を、図 46 を用いて説明する。
[0461] ここでは、上述したように、選択対象主要命令群 553、 555、 554のそれぞれに、第 1〜第 3の機能提供命令群が含まれ、選択対象主要命令群 550、 551、 552、 556 には、偽装機能提供命令群が含まれており、正常系での実行時には、選択対象主 要命令群 553、 555、 554の順番で実行されることで、この秘密保持プログラムが提 供する機能の処理を行う。
[0462] 秘密保持プログラム 2200は、前処理命令群 2210の処理を行う(ステップ S3000) 。具体的には、前処理命令群 2210は、選択パラメータ CP— 1、 CP— 2のそれぞれ に、値「2」、「4」を格納し、モジュラス値 NNに値「7」を設定する。
秘密保持プログラム 2200は、選択処理命令群 2220の処理を行う(ステップ S300 5)。具体的には、選択処理命令群 2220は、式 20、選択パラメータ CP— 1 (= 2)、 C P— 2 ( = 4)、及びモジュラス値 NN ( = 7)を用いて、値 INDを算出する。ここでは、算 出される値 INDは、「1 X 2 + 2 X 4 mod 7 = 3」となる。秘密処理装置 3020が有す る管理情報より、未実行の選択対象データ(2240、 2241、 2242、 2243、 2244、 2 245、 2246)の中で 3番目の選択対象データ 2243を選択する。選択識別子用変数 の値は「3」となる。
[0463] 秘密保持プログラム 2200は、管理情報更新命令群 525の処理を行う(ステップ S3 010)。具体的には、管理情報更新命令群 525は、選択識別子用変数「3」に対応す る選択対象データ 2243の管理情報を実行済みに更新する。
秘密保持プログラム 2200は、変遷処理命令群 530の処理を行う(ステップ S3015) 。具体的には、変遷処理命令群 530は、選択識別子変数「3」に対応する選択対象 データ 2243に分岐する処理を行う。
[0464] 秘密保持プログラム 2200は、選択対象データ 2243に含まれる選択対象主要命令 群 553の処理を行う(ステップ S3020)。具体的には、選択対象データ 2243は、プロ グラムが提供する機能の一部である第 1機能提供命令群に相当する処理を行う。 秘密保持プログラム 2200は、更新処理命令群 2263の処理を行う(ステップ S302 5)。具体的には、更新処理命令群 2263は、選択パラメータ CP— 2の値を選択パラ メータ CP— 1に代入し、選択パラメータ CP— 2に、選択識別子用変数の値を代入す る。ここでは、選択パラメータ CP— 1、 CP— 2のそれぞれの値が「2」、 「4」であったも の力 「4」、 「3」になる。さらに、モジュラス値 NNをデクリメントする。ここでは、モジュ ラス値 NNが「7」であったものが「6」になる。
[0465] 秘密保持プログラム 2200は、分岐命令群 2273の処理を行う(ステップ S3030)。
具体的には、分岐命令群 2273は、選択処理命令群 2220へ分岐する処理を行う。 秘密保持プログラム 2200は、選択処理命令群 2220の処理を行う(ステップ S303 5)。具体的には、選択処理命令群 2220は、式 20、選択パラメータ CP— 1 ( =4)、 C P— 2 ( = 3)、及びモジュラス値 NN ( = 6)を用いて、値 INDを算出する。ここでは、算 出される値 INDは、「1 X 4 + 2 X 3 mod 6=4」となる。秘密処理装置 3020が有す る管理情報より、未実行の選択対象データ(2240、 2241、 2242、 2244、 2245、 2 246)の中で 4番目の選択対象データ 2245を選択する。選択識別子用変数の値は「 5」となる。
[0466] 秘密保持プログラム 2200は、管理情報更新命令群 525の処理を行う(ステップ S3 040)。具体的には、管理情報更新命令群 525は、選択識別子用変数「5」に対応す る選択対象データ 2245の管理情報を実行済みに更新する。
秘密保持プログラム 2200は、変遷処理命令群 530の処理を行う(ステップ S3045) 。具体的には、変遷処理命令群 530は、選択識別子変数「5」に対応する選択対象 データ 2245に分岐する処理を行う。
[0467] 秘密保持プログラム 2200は、選択対象データ 2245に含まれる選択対象主要命令 群 555の処理を行う(ステップ S3050)。具体的には、選択対象データ 2245は、プロ グラムが提供する機能の一部である第 2機能提供命令群に相当する処理を行う。 秘密保持プログラム 2200は、更新処理命令群 2265の処理を行う(ステップ S305 5)。具体的には、更新処理命令群 2265は、選択パラメータ CP— 2の値を選択パラ メータ CP— 1に代入し、選択パラメータ CP— 2に、選択識別子用変数の値を代入す る。ここでは、選択パラメータ CP— 1、 CP— 2のそれぞれの値が「4」、「3」であったも の力 「3」、「5」になる。さらに、モジュラス値 NNをデクリメントする。ここでは、モジュ ラス値 NNが「6」であったものが「5」になる。
[0468] 秘密保持プログラム 2200は、分岐命令群 2275の処理を行う(ステップ S3060)。
具体的には、分岐命令群 2275は、選択処理命令群 2220へ分岐する処理を行う。 秘密保持プログラム 2200は、選択処理命令群 2220の処理を行う(ステップ S306 5)。具体的には、選択処理命令群 2220は、式 20、選択パラメータ CP— 1 (= 3)、 C P— 2 ( = 5)、及びモジュラス値 NN ( = 5)を用いて、値 INDを算出する。ここでは、算 出される値 INDは、「1 X 3 + 2 X 5 mod 5 = 3」となる。秘密処理装置 3020が有す る管理情報より、未実行の選択対象データ(2240、 2241、 2242、 2244、 2246)の 中で 3番目の選択対象データ 2244を選択する。選択識別子用変数の値は「4」とな る。
[0469] 秘密保持プログラム 2200は、管理情報更新命令群 525の処理を行う(ステップ S3 070)。具体的には、管理情報更新命令群 525は、選択識別子用変数「4」に対応す る選択対象データ 2244の管理情報を実行済みに更新する。 秘密保持プログラム 2200は、変遷処理命令群 530の処理を行う(ステップ S3075) 。具体的には、変遷処理命令群 530は、選択識別子変数「4」に対応する選択対象 データ 2244に分岐する処理を行う。
[0470] 秘密保持プログラム 2200は、選択対象データ 2244に含まれる選択対象主要命令 群 554の処理を行う(ステップ S3080)。具体的には、選択対象データ 2244は、プロ グラムが提供する機能の一部である第 3機能提供命令群に相当する処理を行う。 秘密保持プログラム 2200は、更新処理命令群 2264の処理を行う(ステップ S308 5)。具体的には、更新処理命令群 2264は、選択パラメータ CP— 2の値を選択パラ メータ CP— 1に代入し、選択パラメータ CP— 2に、選択識別子用変数の値を代入す る。ここでは、選択パラメータ CP— 1、 CP— 2のそれぞれの値が「3」、「5」であったも の力 「5」、「4」になる。さらに、モジュラス値 NNをデクリメントする。ここでは、モジュ ラス値 NNが「5」であったものが「4」になる。
[0471] 秘密保持プログラム 2200は、分岐命令群 2274の処理を行う(ステップ S3090)。
具体的には、分岐命令群 2274は、秘密保持プログラム 2200の呼び出し元に分岐 する処理を行う。
4. 2 プログラム難読ィ匕装置 3010
プログラム難読ィ匕装置 3010は、図 47にて示すように、プログラム記憶部 800g、入 力部 801g、機能提供命令群生成部 802g、偽装機能提供命令群生成部 803g、配 置順序決定部 804g、管理命令群生成部 805g、秘密保持プログラム生成部 806g、 及び出力部 807gから構成されて ヽる。
[0472] プログラム難読化装置 3010は、具体的には、マイクロプロセッサ、 ROM、 RAM、 ハードディスクユニット、ディスプレイユニット、キーボード、マウスなどから構成される コンピュータシステムである。前記 RAM又は前記ハードディスクユニットには、コンビ ユータブログラムが記憶されている。ここで、コンピュータプログラムは、所定の機能を 達成するために、コンピュータに対する指令を示す命令コードが複数個組み合わさ れて構成されたものである。前記マイクロプロセッサ力 前記コンピュータプログラム に従って動作することにより、プログラム難読ィ匕装置 3010は、その機能を達成する。 つまり、前記マイクロプロセッサは、前記コンピュータプログラムに含まれる各命令を 1 個ずつ読み出し、読み出した命令を解読し、解読結果に従って動作する。
[0473] なお、プログラム記憶部 800g、入力部 801g、機能提供命令群生成部 802g、偽装 機能提供命令群生成部 803g、管理命令群生成部 805g、秘密保持プログラム生成 部 806g、及び出力部 807gのそれぞれは、第 3の実施の形態にて示すプログラム記 憶部 800、入力部 801、機能提供命令群生成部 802、偽装機能提供命令群生成部 803、管理命令群生成部 805、秘密保持プログラム生成部 806、及び出力部 807と 同様であるため、説明は省略する。
[0474] 配置順序決定部 804と、配置順序決定部 804gとの違いは、選択識別子を求める ための計算式が異なることと、後者にぉ 、て計算式のモジュラス値が変化して 、くこと である。
以下、配置順序決定部 804gについて説明する。
また、配置順序決定部 804gは、図示していないが、制御部 850g、選択処理部 85 lg、管理情報更新部 852g、更新処理部 853g、及び管理情報保持部 854gを有し ている。これら構成要素の接続関係は、図 26にて示す配置順序決定部 804の構成 要素の接続関係と同じである。
[0475] 配置順序決定部 804gは、選択パラメータの初期値と選択識別子の計算式を用い て、実際にどのような順序で選択識別子が算出されるのかを確認することにより、機 能提供命令群および偽装機能提供命令群が配置されるべき選択対象主要命令群を 決定する。なお、本実施の形態では、入力部 801gにて選択パラメータの初期値を受 け付けるものとし、選択パラメータ CP— 1〜CP— 2の初期値は「2」、「4」であるとする
[0476] (1)管理情報保持部 854g
管理情報保持部 854gは、管理情報保持部 854と同様であるため、説明は省略す る。なお、以降、必要であれば、管理情報テーブル T800を用いて説明する。
これにより、機能提供命令群が配置された位置 (配置された選択対象データ)を記 '隐することができる。
[0477] (2)制御部 850g
制御部 850gは、選択パラメータ群を記憶するパラメータ記憶領域を有して!/、る。 制御部 850gは、入力部 801gにて受け付けた選択パラメータの初期値 CP— 1、及 び CP— 2 (ここでは、それぞれ「2」、「4」)をパラメータ記憶領域に記憶する。
また、処理開始時には、制御部 850gは、モジュラス値 NNに初期値「7」を設定し、 パラメータ記憶領域に記憶する。
[0478] 制御部 850gは、選択処理部 851g、管理情報更新部 852g、及び更新処理部 853 gの動作を制御する。
制御部 850gは、選択処理部 851gが有する式 20が取り得る値、つまり、式 20にて 取り得る選択識別子の値それぞれと、プログラム記憶部 800gにて記憶されて 、る選 択対象データとの対応付けを行う。
[0479] 制御部 850gは、生成された第 i番目の機能提供命令群を機能提供命令群生成部 802gから取得する。制御部 850gは、取得した第潘目の機能提供命令群を、選択 処理部 85 lgにて取得された選択識別子に基づいて、プログラム記憶部 800gにて記 憶され、対応する選択対象データへ挿入する。ここで、 iは 1以上 m以下の整数である 。また、制御部 850gは、第 i番目の機能提供命令群と、挿入先の選択対象データと の対応付けを一時的に記憶して 、る。
[0480] 制御部 850gは、生成された複数の偽装機能提供命令群のうち選択対象データに 挿入されていない 1の偽装機能提供命令群を偽装機能提供命令群生成部 803gか ら取得する。制御部 850gは、取得した偽装機能提供命令群を、第 i機能提供命令群 、又は偽装機能提供命令群が挿入されていない 1の選択対象データに挿入する。制 御部 850gは、この動作を、全ての偽装機能提供命令群に対して行う。
[0481] これにより、制御部 850gは、各選択対象データに、第 i機能提供命令群、又は偽装 機能提供命令群が挿入することができる。
制御部 850gによる第 i番目の機能提供命令群を取得する動作により、配置対象と なる機能提供命令群を選択することができる。
(3)選択処理部 85 lg
選択処理部 851gは、パラメータ記憶領域に記憶されている選択パラメータ CP— 1 、 CP— 2、及びモジュラス値 NNを取得し、取得した各値と、式 20とを用いて、値 IND を算出する。 [0482] 選択処理部 851gは、算出した値 INDと管理情報テーブル T800を用いて、選択識 別子を取得する。
選択識別子の取得方法について、以下に説明する。
選択処理部 851gは、管理情報テーブル T800にお 、て値が「0」であるものを上位 力も順に、 0番目、 1番目、 · · · ·とし、算出した INDの値と一致する管理情報を取得 する。選択処理部 851gは、取得した管理情報に対応する選択対象データの選択識 別子を取得する。
[0483] 選択処理部 851の動作と、制御部 850による第 i番目の機能提供命令群を選択処 理部 851にて取得された選択識別子に基づき選択対象データに挿入する動作と〖こ より、機能提供命令群を適切な配置先へ配置することができる。
(4)管理情報更新部 852g
管理情報更新部 852gは、管理情報更新部 852と同様であるので、説明は省略す る。
[0484] (5)更新処理部 853g
更新処理部 853gは、パラメータ記憶領域にて記憶されて 、る選択パラメータ CP— 1、 CP— 2、及びモジュラス値 NNを更新する。
ここでは、更新処理部 853gは、選択パラメータ CP— 2の値を選択パラメータ CP— 1に代入し、選択パラメータ CP— 2に、選択識別子用変数の値を代入し、それぞれに 選択パラメータの値を更新する。更新処理部 853gは、更新した選択パラメータ CP— 1及び CP— 2を、制御部 850gのパラメータ記憶領域へ上書きする。更新処理部 853 gは、モジュラス値 NNの値をデクリメントし、その結果を、制御部 850gのパラメータ記 憶領域へ上書きする。
[0485] 5. 3 プログラム難読ィ匕装置 3010の動作
プログラム難読ィ匕装置 3010の動作は、図 27にて示すステップ S620の処理を、以 下に示す配置決定処理に置き換えることで、秘密保持プログラムを生成する。
5. 3. 1 配置決定処理
ここでは、配置決定処理の動作について、図 48に示す流れ図を用いて説明する。
[0486] 制御部 850gは、カウンタ iに「1」、モジュラス値 NNに初期値「7」を設定し、選択パ ラメータ群に含まれる選択パラメータ CP— 1、 CP— 2及び、モジュラス値 NNの各初 期値「2」、「4」、「7」をパラメータ記憶領域へ格納する。制御部 850gは、選択識別子 の値それぞれと、選択対象データとの対応付けを行う(ステップ S3500)。ここで、力 ゥンタ iは、現在着目している機能提供命令群が何番目に実行されるべきであるかを 表す。すなわち、ここでは、第 1の機能提供命令群カゝら順番に配置順序を決定してい
<o
[0487] 選択処理部 851g、パラメータ記憶領域に記憶されている選択パラメータ CP— 1、 CP— 2、及びモジュラス値 NNを取得し、取得した各値と、式 20とを用いて、値 IND を算出する。選択処理部 85 lgは、算出した値 INDと管理情報テーブル T800を用 いて、選択識別子を取得する (ステップ S3505)。例えば、選択パラメータ CP_1〜 CP— 2の値が「2」、「4」であり、モジュラス値 NN力「7」である場合には、式 20の値は 「1 X 2 + 2 X 4 MOD 7 = 3」になる。選択処理部 85 lgは、管理情報テーブル T80 0より、未実行の選択対象データ(2240、 2241, 2242, 2243, 2244, 2245, 224 6)の中で 3番目の選択対象データ 2243を選択する。選択識別子用変数の値は「3」 となる。ここで、「未実行」とは、機能提供命令群が選択対象データに配置されていな いことを示す。また、「実行済」とは、機能提供命令群が選択対象データに配置済で あることを示す。
[0488] 制御部 850gは、第 i番目の機能提供命令群を、選択処理部 85 lgにて取得された 選択識別子に基づいて、対応する選択対象データへ挿入する (ステップ S3510)。 例えば cont = 1で、選択識別子の値が「3」であった場合には、第 1機能提供命令 群が、選択対象データ 543に配置されることとなる。
管理情報更新部 852gは、管理情報テーブル T800に含まれる複数の管理情報の うち、選択処理部 851gにて取得された選択識別子に対応する管理情報を、値「0」か ら値「1」へと更新する (ステップ S3515)。例えば、選択識別子の値が「3」であった場 合には、管理情報保持部 854gの管理情報テーブル T800において、選択対象デー タ 543に対応する管理情報を未配置力も配置済みに変える。
[0489] 更新処理部 853gは、パラメータ記憶領域にて記憶されている選択パラメータ CP— 1及び CP— 2を更新し、更新結果をパラメータ記憶領域へ上書きする (ステップ S35 20)。更新方法は、上述しているのでここでの説明は省略する。例えば、選択パラメ ータ CP— 1及び CP— 2のそれぞれの値が「2」、「4」で選択識別子の値が「3」であつ た場合は、選択パラメータ CP— 1及び CP— 2のそれぞれの値を「4」、「3」にする。
[0490] 更新処理部 853gは、モジュラス値 NNをデクリメントし、その結果をパラメータ記憶 領域へ上書きする (ステップ S3525)。
制御部 850gは、カウンタ iに値「1」を加算する(ステップ S3530)。
制御部 850gは、カウンタ iが機能提供命令群の個数より大きいか否かを判定する( ステップ S3535)。
[0491] 大きくないと判定する場合には (ステップ S3535における「NO」)、制御部 850gは 、ステップ S3505に戻り、選択処理部 85 lgの動作を制御する。
大きいと判定する場合には (ステップ S3535における「YES」)、制御部 850gは、複 数の偽装機能提供命令群のそれぞれに対して、機能提供命令群が挿入されて ヽな い 1以上の選択対象データの何れかが配置先となるように、配置先を決定する (ステ ップ S3540)。例えば、選択対象データ 540、 541、 542、 544が未実行であれば、 偽装機能提供命令群を配置する位置をそれらに決定し、各偽装提供命令群を挿入 する。
[0492] 5. 4 変形例
(1)上記第 5の実施の形態では、秘密保持プログラムは、選択パラメータの初期値 として、呼び出し元力 の入力値を格納した力 これに限定されない。秘密保持プロ グラムは、ネットワーク上の他の機器から取得する値を選択パラメータの初期値に代 入する構成でもよ ヽし、プログラム実行装置が保持する他のプログラムを実行した結 果得られる出力値を選択パラメータの初期値に代入する構成でもよい
(2)上記第 5の実施の形態では、機能提供命令群が 3つ、偽装機能提供命令群が 4つの場合を示したが必ずしもこの数である必要はな 、。機能提供命令群は複数個 、偽装機能提供命令群は 1個以上であればよい。
[0493] (3)上記第 5の実施の形態では、秘密処理装置 3020を上述の通りプログラムを用 いたプログラム実行装置の形で実現している力 これに限られるものではなくハードウ エア的な実装を行ってもょ 、。 (4)上記実施の形態及び上記変形例をそれぞれ組み合わせるとしてもよ!/、。
5. 5 第 5の実施の形態の効果
本実施の形態では、選択処理命令群 2220では選択対象データのうち、未実行の 選択対象データの中からのみ、次に選択する選択対象データを決定している。よつ て、難読化対象データが同じ選択対象データを重複して実行することがないことを知 つて 、る不正解析者が、選択パラメータ群の初期値を変えての全数探索を行ったと しても、 V、ずれの初期値を代入した場合にも選択対象データが重複して選ばれること はなぐ重複する力否かに基づいて効率的に間違った初期値を見つけ出していくこと が困難になる。
[0494] また、本実施の形態では、入力値 in— 1、 in— 2により、一意に選択対象データを選 択していく。その理由を以下で述べる。始めに 6以下の非負整数 in— 1 (7種類存在) を用いて、 7種類の選択対象データ 2240〜2246のいずれかを選択する。次に 5以 下の非負整数 in— 2 (6種類存在)を用いて、 6種類の未実行の選択対象データ (選 択対象データ 2240〜2246から in— 1で選択された選択対象データを除いたもの) のいずれかを選択する。入力の in— k (k= l、 2)の取りうる種類と、選択対象データ の選択しうる種類が同じであるため、これらの選択は in— 1、 in— 2を用いて一意に決 定する。したがって、入力値 in— 1、 in— 2により、一意に選択対象データを選択する 。このように一意に選択対象データを選択することにより、入力値に対して選択対象 データの選択するバリエーションが減らず、攻撃者が全数攻撃するときの組合せの数 を減らすことがない。
[0495] 6.変形例
上記に説明した実施の形態は、本発明の実施の一例であり、本発明はこの実施の 形態に何ら限定されるものではなぐその旨を逸脱しな 、範囲にぉ 、て種々なる態様 で実施し得るものである。例えば、以下のような場合も本発明に含まれる。
(1)上記第 3の実施の形態の選択処理命令群が選択識別子を算出する処理で使 用する式は、式 3「pl X (選択パラメータ CP_1) +p2 X (選択パラメータ CP_2) mod NN」としている力 これに限らない。例えば、この式は、選択パラメータ CP— 1 の値を固定したときに、選択パラメータ CP— 2の値と式の計算結果が 1対 1となる条 件を満たせばよい。式 3では、選択パラメータ CP— 2が NN未満の値であれば、 p2と NNが互いに素であるため、取りうる選択パラメータ CP— 2が NN種類存在すれば、 それに対応して、 p2 X (選択パラメータ CP— 2) mod NNも NN種類存在する。
[0496] また、第 5の実施の形態においても同様に、選択識別子の算出式を、式 20としてい る力 これに限らない。例えば、この式は、選択パラメータ CP— 1の値を固定したとき に、選択パラメータ CP— 2の値と式の計算結果が 1対 1となる条件を満たせばよい。
(2)各実施の形態の動作にお!、て、選択対象主要命令群と変遷処理命令群は順 番を入れ替えてもよい。また、第 3の実施の形態において、更新処理命令群 560〜5 66は、選択対象データ 540〜546に含まれる構成となっている力 管理情報更新命 令群 525の後にひとつだけ配置する構成であっても構わない。また、選択処理命令 群 520、管理情報更新命令群 525、変遷処理命令群 530の 3つの命令群はそれぞ れ一つである構成だが、各選択対象データに含まれる分岐命令群 570から 576のぞ れぞれの代わりに前記 3つの命令群を配置する構成であっても構わな 、。
[0497] また、第 4及び第 5の実施の形態においても同様である。
(3)各命令群は、必ずしも独立した命令群である必要はなぐ複数の命令群が提供 する機能を組み合わせた手段とする構成であっても構わない。
(4)第 3、第 4及び第 5の実施の形態では、実行済みの選択対象データに相当する 選択識別子が算出された場合、未実行の選択識別子に対応する直近の値を算出す るという方法を取っているが、この計算方法に限られるものではない。例えば、選択識 別子をランダムに計算し、対応する選択対象データが実行されているか否かの確認 を繰り返していく計算方法などでもよい。このよう〖こすると、不正解析者による解析は より困難となる。
[0498] (5)上記各実施の形態および変形例における、機能提供命令群、偽装機能提供 命令群、管理命令群の生成順序は上述した順序に限るものではない。各ステップは 、生成した各命令群を用いて秘密保持プログラムを生成するステップまでに終了して いれば、どのような順序で実行されても構わない。例えば、偽装機能提供命令群と機 能提供命令群の生成順序を逆にするなどしても構わない。
[0499] (6)各実施の形態の説明にて挙げた数値は全て一例であり、その数値に限るもの ではない。例えば、選択対象データの数や初期値の数をより増やしてもよいし、初期 値の数値を別のものとしてもよ 、。
初期値の数を増やすことで解析をさらに困難にすることができる。
(7)第 1の実施の形態において、秘密保持プログラムは、 1以上の偽装機能提供命 令群を含むとしたが、これに限定されない。
[0500] 秘密保持プログラムは、偽装機能提供命令群を含まなくてもよ!、。
また、第 3、第 4及び第 5の実施の形態においても同様に、秘密保持プログラムは、 偽装機能提供命令群を含まなくてもよ ヽ。
(8)上記の各実施の形態の秘密処理装置や秘密保持プログラムでは、いずれもプ ログラムを分割して生成した命令群を選択対象データとして ヽたが、これに限られる ものではなぐ何らかの順序をもって使用された場合に正当な結果を得られるような 情報であればどのようなものでも構わない。具体的な例としては、複数の暗号鍵によ り順序をもった多重の暗号ィ匕を行うような場合には、その暗号鍵それぞれを選択対象 データとして扱うことなどが考えられる。また、秘密保持プログラムについても同様で ある。
[0501] (9)上記の各実施の形態の秘密処理装置や秘密保持プログラムでは、 Vヽずれも選 択パラメータの初期値を受け取り、内部でその値を更新していく構成を取っているが 、これに限られるものではない。具体的には、秘密処理装置等の外部で選択パラメ一 タの値を更新し、秘密処理装置等は更新後の値を受け取るようにしてもよい。また、 予め秘密処理装置による処理が終了するまでに用いる選択パラメータの全てを配列 によるデータとして受け取って、それに従った動作をするとしてもよい。また、秘密保 持プログラムにつ ヽても同様である。
[0502] (10)第 1の実施の形態において、選択識別子の算出方法として、第 3の実施の形 態にて示す方法、第 4の実施の形態にて示す方法、及び第 5の実施の形態にて示す 方法の何れかを用いてもょ 、。
(11)上記第 1の実施の形態において、プログラム難読ィ匕装置 10は、ブロックの配 置位置に対応する値を、式 1を用いて算出したが、これに限定されない。
[0503] プログラム難読ィ匕装置 10は、ブロックを配置するアドレスを算出する算出式を用い てもよい。このとき、プログラム実行装置 20は、前記算出式を用いて、次に実行する ブロックのアドレスを算出する。
なお、第 3、第 4、及び第 5の実施の形態においても同様に、プログラム難読化装置 は、ブロックを配置するアドレスを算出する算出式を用 、てもよ 、。
[0504] (12)本発明における「変数」は、特定の言語における変数に限定されるのではなく 、レジスタ、キャッシュ、 RAM、 HDD,その他の書き換え可能なメモリに記憶した内 容、及びそれらのメモリに記載された値によって指定された位置に記憶された内容で あってもよい。
(13)上記第 1の実施の形態において、更新処理命令群は、選択対象主要命令群 の直後に配置されたが、これに限定されない。選択対象主要命令群の中に挿入して ちょい。
[0505] ここでは、選択主要命令群に含まれる 1以上のプログラム命令群のうち最後に位置 するプログラム命令群の直後に更新処理命令群を配置することも、選択対象主要命 令群の中に挿入するという。
選択主要命令群に含まれる 1以上のプログラム命令群のうち最後に位置するプログ ラム命令群の直後に更新処理命令群が挿入されることは、選択対象主要命令群の 直後に配置されることと同等である。
[0506] (14)上記実施の形態において、選択パラメータの更新を行う場合に、選択パラメ ータに、前回算出された選択識別子そのものを代入したが、これに限定されない。 算出された選択識別子に演算を施して、その演算結果を用いて選択パラメータの 更新を行ってもよい。例えば、 A= (算出された選択識別子の値) + 1とし、 Aの値を 選択パラメータに代入してもよい。他の例として、 A= (算出された選択識別子の値) X 3とし、 Aの値を選択パラメータに代入してもよい。
[0507] または、 2つ前に選択された選択対象データ等、過去の何れかの時点で処理され た選択対象データを示す選択識別子の値を代入してもよい。すなわち、過去に選択 された選択対象データを示す選択識別子が反映されるのであればどのような代入の 仕方でもよい。ここで、過去の何れかの時点で処理された選択対象データを示す選 択識別子とは、現在選択されて!、る選択対象データを示す選択識別子をも含む。 [0508] 例えば、前回算出された選択対象データを示す選択識別子と、 2回以上過去に算 出された選択対象データを示す選択識別子を用いて、選択パラメータを更新してもよ い。具体的には、 A= (前回算出された選択識別子) + (2回前に算出された選択識 別子)とし、 Aの値を選択パラメータに代入してもよい。
(15)本発明における命令群とは、 1以上の命令力もなるものとする。つまり、本発明 における命令群は、 1の命令力 なる場合も含まれる。
[0509] (16)上記第 1の実施の形態において、複数の選択パラメータ全てを用いて、選択 識別子を算出したが、これに限定されない。
複数の選択パラメータのうち 1以上の選択パラメータを用いて選択識別子を算出し てもよい。例えば、 3つの選択パラメータ A、 B、 Cのうち、ある選択識別子を算出する 際には、選択パラメータ A、 Bを用い、他の選択識別子を算出する際には、選択パラ メータ A、 Cを用いてもよい。
[0510] なお、第 2の実施の形態、第 3の実施の形態、第 4の実施の形態、及び第 5に実施 の形態においても同様に、複数の選択パラメータのうち 1以上の選択パラメータを用
V、て選択識別子を算出してもよ!/、。
(17)上記第 2の実施の形態において、各選択対象データには 1のデータが格納さ れていたが、これに限定されない。
[0511] 各選択対象データに格納されるデータの個数は、 1以上であればよい。
(18)上記第 2の実施の形態において、選択パラメータの更新の際に、選択識別子 の値を更新対象の選択パラメータに代入したが、これに限定されな 、。
選択識別子の値に演算を施して、その演算結果を更新対象の選択パラメータに代 入してもよい。例えば、選択識別子の値に、定数を加算し、加算結果を更新対象の 選択パラメータに代入する。
[0512] なお、第 3の実施の形態、第 4の実施の形態、及び第 5に実施の形態においても同 様に、選択識別子の値に演算を施して、その演算結果を更新対象の選択パラメータ に代入してもよい。
また、第 2の実施の形態において、プログラム難読ィ匕装置は、秘密保持プログラム を生成する際に、秘密情報を秘密情報用変数へ変換したがこれに限定されな ヽ。 [0513] 秘密情報用変数を含む演算式に変換してもよ!ヽ。例えば、秘密情報を、秘密情報 用変数と定数との和の演算式に変換してもよい。
(19)上記の各装置を構成する構成要素の一部または全部は、 1個のシステム LSI (Large Scale Integration:大規模集積回路)から構成されているとしてもよい。 システム LSIは、複数の構成部を 1個のチップ上に集積して製造された超多機能 LSI であり、具体的には、マイクロプロセッサ、 ROM、 RAMなどを含んで構成されるコン ピュータシステムである。前記 RAMには、コンピュータプログラムが記憶されている。 前記マイクロプロセッサ力 前記コンピュータプログラムにしたがって動作することによ り、システム LSIは、その機能を達成する。なお、ここでは、システム LSIとした力 集 積度の違いにより、 IC、 LSI,スーパー LSI、ウルトラ LSIと呼称されることもある。また 、集積回路化の手法は LSIに限るものではなぐ専用回路又は汎用プロセサで実現 してもよい。 LSI製造後に、プログラムすることが可能な FPGA(Field Programmab le Gate Array)や、 LSI内部の回路セルの接続や設定を再構成可能なリコンフィ ギュラブノレ ·プロセッサーを利用しても良 、。
[0514] さらには、半導体技術の進歩又は派生する別技術により LSIに置き換わる集積回 路化の技術が登場すれば、当然、その技術を用いて構成要素の集積ィ匕を行ってもよ い。バイオ技術の適応等が可能性としてありえる。
(20)上記の各装置を構成する構成要素の一部または全部は、各装置に脱着可能 な ICカードまたは単体のモジュール力も構成されて 、るとしてもよ 、。前記 ICカード または前記モジュールは、マイクロプロセッサ、 ROM, RAMなどから構成されるコン ピュータシステムである。前記 ICカードまたは前記モジュールは、上記の超多機能 L SIを含むとしてもよい。マイクロプロセッサが、コンピュータプログラムにしたがって動 作することにより、前記 ICカードまたは前記モジュールは、その機能を達成する。この ICカードまたはこのモジュールは、耐タンパ性を有するとしてもよ!/、。
[0515] (21)本発明は、上記に示す方法であるとしてもよい。また、これらの方法をコンビュ ータにより実現するコンピュータプログラムであるとしてもよいし、前記コンピュータプ ログラム力 なるディジタル信号であるとしてもよい。
(22)また、本発明は、前記コンピュータプログラムまたは前記ディジタル信号をコン ピュータ読み取り可能な記録媒体、例えば、フレキシブルディスク、ハードディスク、 C D—ROMゝ MO、 DVDゝ DVD— ROMゝ DVD— RAMゝ BD (Blu—ray Disc)、半 導体メモリなどに記録したものとしてもよい。また、これらの記録媒体に記録されてい る前記ディジタル信号であるとしてもょ ヽ。
[0516] (23)また、本発明は、前記コンピュータプログラムまたは前記ディジタル信号を、電 気通信回線、無線または有線通信回線、インターネットを代表とするネットワーク、デ ータ放送等を経由して伝送するものとしてもよい。
(24)また、本発明は、マイクロプロセッサとメモリを備えたコンピュータシステムであ つて、前記メモリは、上記コンピュータプログラムを記憶しており、前記マイクロプロセ ッサは、前記コンピュータプログラムにしたがって動作するとしてもよい。
[0517] (25)また、前記プログラムまたは前記ディジタル信号を前記記録媒体に記録して 移送することにより、または前記プログラムまたは前記ディジタル信号を前記ネットヮ 一ク等を経由して移送すること〖こより、独立した他のコンピュータシステムにより実施 するとしてちょい。
(26)これらの実施の形態及び変形例の組合せであってもよ!/、。
産業上の利用可能性
[0518] 本発明にかかる秘密処理装置、秘密保持プログラムは、暗号鍵などの秘密情報を 扱う処理を行う場合に不正解析者による攻撃を困難にすることができるため、不正解 析者に漏洩すると不利益を招くような秘密情報を用いた処理を行う装置等の分野で 有用である。
また、本発明にかかるプログラム難読ィ匕装置は、暗号鍵などの秘密情報を扱うプロ グラムを、より解析が困難な形に変換することができるので、不正解析者に漏洩する と不利益を招くような秘密情報を用いた処理を行うソフトウェア等の分野において有 用である。
[0519] また、上記にて示したプログラム難読ィ匕装置は、電器機器製造産業において、経営 的に、また継続的及び反復的に、製造し、販売することができる。

Claims

請求の範囲
[1] オリジナルプログラム力も秘密保持プログラムを生成するプログラム変換装置であつ て、
オリジナルプログラムを取得するプログラム取得手段と、
所定の順序で処理することにより、前記オリジナルプログラムと同一の実行結果を 出力し、異なる選択識別子が対応付けられる複数の選択対象データを生成する選択 対象データ生成手段と、
複数の選択パラメータそれぞれに値を代入する前処理命令群を生成する前処理命 令群生成手段と、
前記複数の選択パラメータを用いた演算式に基づいて、次に処理される選択対象 データを示す選択識別子を取得する命令群を含む選択処理命令群を生成する選択 処理命令群生成手段と、
選択パラメータの値に、過去に処理された選択対象データを示す選択識別子、又 は前記選択パラメータに過去に代入された 1つ以上の選択パラメータの値のうち少な くとも 1つの選択パラメータの値を反映させる更新処理命令群を生成する更新処理命 令群生成手段と、
前記前処理命令群と前記処理選択命令群と前記更新処理命令群と前記複数の選 択対象データとを含み、前記処理選択命令群を実行する処理と、前記選択処理命 令群により取得される選択識別子が示す選択対象データを処理する処理と、前記選 択対象データが処理されると前記更新処理命令群を実行する処理とを繰り返す秘密 保持プログラムを生成する秘密保持プログラム生成手段と
を備えることを特徴とするプログラム変換装置。
[2] 前記所定の順序は、前記複数の選択パラメータに所定の初期値を与えて、前記選 択処理命令群及び前記更新処理命令群の実行を繰り返すことにより、順次算出され る選択識別子の順序である
ことを特徴とする請求項 1に記載のプログラム変換装置。
[3] 前記複数の選択対象データのそれぞれは、 1個以上のデータからなる
ことを特徴とする請求項 2に記載のプログラム変換装置。
[4] 前記オリジナルプログラムは、秘匿すべき秘密情報を有し、
前記選択処理命令群生成手段は、
前記複数の選択パラメータを用いる第 1の演算式により前記選択識別子を算出す る命令群からなる選択処理命令群を生成し、
前記更新処理命令群生成手段は、
算出された前記選択識別子にて示される選択対象データの値に基づいて、前記複 数の選択パラメータを更新する更新処理命令群を生成し、
前記プログラム変換装置は、さら〖こ、
更新した複数の選択パラメータを用いた第 2の演算式により、前記秘密情報と同一 の値を算出する変遷処理命令群を生成する変遷処理命令群生成手段を備え、 前記秘密保持プログラム生成手段は、
生成された変遷処理命令群を、前記更新処理命令群の配置位置と、前記秘密情 報の配置位置との間へ配置し、及び前記秘密情報を前記変遷処理命令群で算出す る処理に置換する
ことを特徴とする請求項 3に記載のプログラム変換装置。
[5] プログラム変換装置は、さらに、
前記オリジナルプログラムを、 1つ以上のブロックに分割する分割手段を備え、 前記複数の選択対象データのそれぞれは、異なるブロックを含む
ことを特徴とする請求項 2に記載のプログラム変換装置。
[6] 前記複数の選択パラメータは、第 1から第 nの選択パラメータであり、
前記更新処理命令群生成手段は、
前記複数の選択対象データのそれぞれに対して、第 j 1 (jは 2以上 n以下の整数) の選択パラメータに格納されて ヽる値を第 jの選択パラメータへ格納し、定数値を第 1 の選択パラメータに格納する更新処理命令群を生成する
ことを特徴とする請求項 5に記載のプログラム変換装置。
[7] 前記選択対象データの個数は、前記ブロックの個数以上力 なる所定の数であり、 前記演算式は、
前記第 1から第 nの選択パラメータのそれぞれに対して、 Pi X第 iの選択パラメータ( iは 1以上 n以下の整数)を算出し、算出した結果それぞれを加算し、加算結果に、前 記所定の数をモジュロ値 Nとするモジュロ演算を施し、選択識別子を算出し、
Piとモジュロ値 Nとは、互いに素である
であることを特徴とする請求項 6に記載のプログラム変換装置。
[8] 選択対象データ生成手段は、
現時点までに前記演算式にて算出された選択識別子それぞれを記憶する記憶部 と、
1つのブロックに対して、 1つの値を選択し、第 j l (jは 2以上 n以下の整数)の選択 ノ メータに格納されている値を第 jの選択パラメータへ格納し、選択した値を第 1の 選択パラメータに格納して、前記演算式を実行する実行部と、
算出された算出値と同一の選択識別子が前記記憶部に記憶されている力否かを 判断する判断部と、
判断結果が否定的である場合には、前記選択された 1つの値を、前記 1つのブロッ クに対する前記定数値と決定し、前記 1つのブロックを算出された算出値が示す選択 対象データに格納する格納部と、
判断結果が肯定的である場合には、前記定数値が決定され、 1つのブロックが選択 対象データに格納されるまでの間、前記実行部と前記判断部とによる処理を繰り返 すように制御する繰返制御部とを備え、
前記選択対象データ生成手段による処理は、全てのブロックに対して実行される ことを特徴とする請求項 5に記載のプログラム変換装置。
[9] 前記選択処理命令群生成手段は、
未実行である選択対象データを示す識別子を、常に取得する選択処理命令群を 生成する
ことを特徴とする請求項 5に記載のプログラム変換装置。
[10] 前記選択処理命令群生成手段は、
未実行である選択対象データを示す識別子を、前記複数の選択対象データのそ れぞれにつ 、て実行済である力否かを示す管理情報を用いて取得する選択処理命 令群を生成する ことを特徴とする請求項 9に記載のプログラム変換装置。
[11] 前記複数の選択パラメータは、第 1から第 nの選択パラメータであり、
前記管理情報は、前記複数の選択対象データのそれぞれに対して、現時点にお ける実行済若しくは未実行のいずれかの状態を示す配列テーブルであり、
前記選択対象データの個数は、前記ブロックの個数以上力 なる所定の数であり、 前記選択処理命令群生成手段は、
前記配列テーブルと、
前記第 1から第 nの選択パラメータのそれぞれに対して、 Pi X第 iの選択パラメータ( iは 1以上 n以下の整数)を算出し、算出した結果それぞれを加算し、加算結果に、前 記所定の数をモジュロ値 Nとするモジュロ演算を施し、次に実行すべきブロックを含 む選択対象データを示す仮の選択識別子を算出する前記演算式と、
前記算出式にて算出された前記仮の選択識別子が示す選択対象データが、前記 配列テーブルにお ヽて未実行であることを示す場合には、前記仮の選択識別子を次 に実行すべきブロックを含む選択対象データを示す真の選択識別子とし、実行済で あることを示す場合には、未実行である選択対象データを取得するまで予め決めら れた選択順序に基づき仮の選択識別子の取得を行う取得プログラム命令群とを生成 し、
前記選択処理命令群は、前記配列テーブルと、前記演算式と、前記取得プロダラ ム命令群とを含み、
Piとモジュロ値 Nとは互いに素である
ことを特徴とする請求項 10に記載のプログラム変換装置。
[12] 前記更新処理命令群生成手段は、
第 j (jは 2以上 n以下の整数)の選択パラメータに格納されて 、る値を第 j 1の選択 パラメータへ格納し、前記選択処理命令群にて取得された前記真の選択識別子を第 nの変数へ格納する前記更新処理命令群を生成する
ことを特徴とする請求項 11に記載のプログラム変換装置。
[13] 前記演算式は、 1つの選択パラメータを示すインデックスを用いて、前記複数の選 択パラメータから前記 1つのパラメータを取得する第 1取得プログラム命令群であり、 前記管理情報は、前記複数の選択対象データのそれぞれに対して、現時点にお ける実行済若しくは未実行のいずれかの状態を示す配列テーブルであり、
前記選択処理命令群生成手段は、
前記第 1取得プログラム命令群と、
前記配列テーブルと、
前記配列テーブルのうち未実行である 1つ以上の選択対象データを示す選択識別 子の配列順序に基づ 、て、前記取得プログラム命令群にて取得されたパラメータの 値にて示される順序に配置された選択識別子を取得する第 2取得プログラム命令群 とを生成し、
前記選択処理命令群は、前記第 1取得プログラム命令群と、前記配列テーブルと、 前記第 2取得プログラム命令群とを含む
ことを特徴とする請求項 10に記載のプログラム変換装置。
[14] 前記更新処理命令群生成手段は、
前記インデックスの値をインクリメントする前記更新処理命令群を生成する ことを特徴とする請求項 13に記載のプログラム変換装置。
[15] 前記選択対象データの個数は、前記ブロックの個数以上力 なる所定の数であり、 前記複数の選択パラメータは、第 1から第 nのノ ラメータであり、
前記管理情報は、前記複数の選択対象データのそれぞれに対して、現時点にお ける実行済若しくは未実行のいずれかの状態を示す配列テーブルであり、
前記選択処理命令群生成手段は、
前記配列テーブルと、
前記第 1から第 nの選択パラメータのそれぞれに対して、 Pi X第 iの選択パラメータ( iは 1以上 n以下の整数)を算出し、算出した結果それぞれを加算し、加算結果に、前 記所定の数をモジュロ値 Nとするモジュロ演算を施し、次に実行すべきブロックを含 む選択対象データを示す値を算出する前記演算式と、
前記配列テーブルと同一のテーブルテーブル内において、未実行である 1つ以上 の選択対象データを示す選択識別子の配列順序に基づいて、前記演算式にて算出 された前記値にて示される順序に配置された選択識別子を取得する取得プログラム 命令群とを生成し、
前記選択処理命令群は、前記配列テーブルと、前記演算式と、前記取得プロダラ ム命令群とを含む
ことを特徴とする請求項 10に記載のプログラム変換装置。
[16] 前記選択対象データの個数は、前記ブロックの個数以上力 なる所定の数であり、 前記秘密保持プログラム生成手段は、さら〖こ、
前記複数のブロックのそれぞれが選択対象データに含まれた後、ブロックを含まな い 1つ以上の選択対象データに、 1つ以上のプログラム命令を含む偽装ブロックを揷 入する
ことを特徴とする請求項 5に記載のプログラム変換装置。
[17] 処理順序が定まった複数の選択対象データを処理することにより、秘匿すべき秘密 処理を実行する秘密処理装置であって、
複数の選択パラメータのそれぞれに値を代入する前処理実行手段と、 前記複数の選択パラメータを用いた演算式に基づいて、次に処理される選択対象 データを示す選択識別子を取得する選択処理実行手段と、
選択パラメータの値に、過去に処理された選択対象データを示す選択識別子、又 は前記選択パラメータに過去に代入された 1つ以上の選択パラメータの値のうち少な くとも 1つの選択パラメータの値を反映させる更新処理実行手段と、
前記選択処理実行手段にて取得された選択識別子が示す選択対象データを処理 する選択対象データ実行手段とを備え、
前記秘密保持プログラムの終了とみなすまで、前記選択処理実行手段と、更新処 理命令実行手段と、選択対象データ実行手段とによる処理を繰り返す
ことを特徴とする秘密処理装置。
[18] 前記複数の選択対象データのそれぞれは、 1個以上のデータからなる
ことを特徴とする請求項 17に記載の秘密処理装置。
[19] 前記秘密処理は、秘匿すべき秘密情報を用いる代わりに、所定の処理を施して前 記秘密情報を算出する処理であり、
前記選択処理実行手段は、 前記複数の選択パラメータを用いる演算式により前記選択識別子を算出し、 前記更新処理実行手段は、
前記選択識別子にて示される選択対象データの値に基づ!、て、前記複数の選択 パラメータを更新し、
前記秘密処理装置は、さらに、
更新した複数の選択パラメータを用いた前記所定の処理により、前記秘密情報と同 一の値を算出する変遷処理実行手段を備える
ことを特徴とする請求項 18に記載の秘密処理装置。
[20] 前記秘密処理は、外部装置により 1つ以上のブロックに分割されたオリジナルプロ グラムを実行する処理であり、
前記ブロックは 1つ以上のプログラム命令を含み、
前記複数の選択対象データのそれぞれは、異なるブロックを含む
ことを特徴とする請求項 17に記載の秘密処理装置。
[21] 前記複数の選択パラメータは、第 1から第 nの選択パラメータであり、
前記更新処理実行手段は、
前記複数の選択対象データのそれぞれに対して、第 j 1 (jは 2以上 n以下の整数) の選択パラメータに格納されて ヽる値を第 jの選択パラメータへ格納し、定数値を第 1 の選択パラメータに格納し、
前記定数値は、前記演算式を用いて、次に実行される選択対象データを示す選択 識別子が算出されるように、前記外部装置が前記秘密保持プログラム生成時に予め 設定した値である
ことを特徴とする請求項 20に記載の秘密処理装置。
[22] 前記選択対象データの個数は、前記ブロックの個数以上力 なる所定の数であり、 前記演算式は、
前記第 1から第 nの選択パラメータのそれぞれに対して、 Pi X第 iの選択パラメータ( iは 1以上 n以下の整数)を算出し、算出した結果それぞれを加算し、加算結果に、前 記所定の数をモジュロ値 Nとするモジュロ演算を施し、選択識別子を算出し、
Piとモジュロ値 Nとは、互いに素である であることを特徴とする請求項 21に記載の秘密処理装置。
[23] 前記選択処理実行手段は、
未実行である選択対象データを示す識別子を、常に取得する
ことを特徴とする請求項 20に記載の秘密処理装置。
[24] 前記選択処理実行手段は、
未実行である選択対象データを示す識別子を、前記複数の選択対象データのそ れぞれについて実行済である力否かを示す管理情報を用いて取得する
ことを特徴とする請求項 23に記載の秘密処理装置。
[25] 前記複数の選択パラメータは、第 1から第 nの選択パラメータであり、
前記選択対象データの個数は、前記ブロックの個数以上力 なる所定の数であり、 前記管理情報は、前記複数の選択対象データのそれぞれに対して、現時点にお ける実行済若しくは未実行の 、ずれの状態を示す配列テーブルであり、
前記選択処理実行手段は、
前記配列テーブルを保持し、
前記演算式は、前記第 1から第 nの選択パラメータのそれぞれに対して、 PiX第 iの 選択パラメータ (iは 1以上 n以下の整数)を算出し、算出した結果それぞれを加算し、 加算結果に、前記所定の数をモジュロ値 Nとするモジュロ演算を施し、次に実行すベ きブロックを含む選択対象データを示す仮の選択識別子を算出する演算式であり、 前記選択処理実行手段は、
前記算出式にて算出された前記仮の選択識別子が示す選択対象データが、前記 配列テーブルにお ヽて未実行であることを示す場合には、前記仮の選択識別子を次 に実行すべきブロックを含む選択対象データを示す真の選択識別子とし、実行済で あることを示す場合には、未実行である選択対象データを取得するまで予め決めら れた選択順序に基づき仮の選択識別子の取得を行い、
Piとモジュロ値 Nとは互いに素である
ことを特徴とする請求項 24に記載の秘密処理装置。
[26] 前記更新処理実行手段は、
第 j (jは 2以上 n以下の整数)の選択パラメータに格納されて 、る値を第 j 1の選択 パラメータへ格納し、前記選択処理実行手段にて取得された前記真の選択識別子を 第 nの変数へ格納する
ことを特徴とする請求項 25に記載の秘密処理装置。
[27] 前記管理情報は、前記複数の選択対象データのそれぞれに対して、現時点にお ける実行済若しくは未実行の 、ずれの状態を示す配列テーブルであり、
前記選択処理実行手段は、
前記配列テーブルを保持し、
1つの選択パラメータを示すインデックスを用いて、前記複数の選択パラメータから 前記 1の選択パラメータを取得する前記演算式を実行する第 1取得部と、
前記配列テーブルのうち未実行である 1つ以上の選択対象データを示す選択識別 子の配列順序に基づ 、て、前記第 1取得部にて取得された選択パラメータの値にて 示される順序に配置された選択識別子を取得する第 2取得部とを含む
ことを特徴とする請求項 24に記載の秘密処理装置。
[28] 前記更新処理実行手段は、
前記インデックスの値をインクリメントする
ことを特徴とする請求項 27に記載の秘密処理装置。
[29] 前記選択対象データの個数は、前記ブロックの個数以上からなる所定の数であり、 前記複数の選択パラメータは、第 1から第 nのノ ラメータであり、
前記管理情報は、前記複数の選択対象データのそれぞれに対して、現時点にお ける実行済若しくは未実行の 、ずれの状態を示す配列テーブルであり、
前記選択処理実行手段は、
前記配列テーブルを保持し、
前記演算式は、前記第 1から第 nの選択パラメータのそれぞれに対して、 PiX第 iの 選択パラメータ (iは 1以上 n以下の整数)を算出し、算出した結果それぞれを加算し、 加算結果に、前記所定の数をモジュロ値 Nとするモジュロ演算を施し、次に実行すベ きブロックを含む選択対象データを示す仮の選択識別子を算出する演算式であり、 前記選択処理実行手段は、
前記配列テーブルと同一のテーブルテーブル内において、未実行である 1つ以上 の選択対象データを示す選択識別子の配列順序に基づいて、前記演算式にて算出 された前記値にて示される順序に配置された選択識別子を取得する
ことを特徴とする請求項 24に記載の秘密処理装置。
[30] 前記秘密処理は、前記外部装置により前記オリジナルプログラムから生成された秘 密保持プログラムを実行する処理であり、
前記選択対象データの個数は、前記ブロックの個数以上力 なる所定の数であり、 ブロックを含まない 1つ以上の選択対象データには、 1つ以上のプログラム命令を 含む偽装ブロックが含まれ、
前記秘密保持プログラムは、前記オリジナルプログラムより分割された各ブロックと、 1つ以上の偽装ブロックとを含む
ことを特徴とする請求項 20に記載の秘密処理装置。
[31] オリジナルプログラム力 秘密保持プログラムを生成するプログラム変換装置で用 V、られる変換方法であって、
オリジナルプログラムを取得するプログラム取得ステップと、
所定の順序で処理することにより、前記オリジナルプログラムと同一の実行結果を 出力し、異なる選択識別子が対応付けられる複数の選択対象データを生成する選択 対象データ生成ステップと、
複数の選択パラメータそれぞれに値を代入する前処理命令群を生成する前処理命 令群生成ステップと、
前記複数の選択パラメータを用いた演算式に基づいて、次に処理される選択対象 データを示す選択識別子を取得する命令群を含む選択処理命令群を生成する選択 処理命令群生成ステップと、
選択パラメータの値に、過去に処理された選択対象データを示す選択識別子、又 は前記選択パラメータに過去に代入された 1つ以上の選択パラメータの値のうち少な くとも 1つの選択パラメータの値を反映させる更新処理命令群を生成する更新処理命 令群生成ステップと、
前記前処理命令群と前記処理選択命令群と前記更新処理命令群と前記複数の選 択対象データとを含み、前記処理選択命令群を実行する処理と、前記選択処理命 令群により取得される選択識別子が示す選択対象データを処理する処理と、前記選 択対象データが処理されると前記更新処理命令群を実行する処理とを繰り返す秘密 保持プログラムを生成する秘密保持プログラム生成ステップと
を含むことを特徴とする変換方法。
[32] オリジナルプログラム力 秘密保持プログラムを生成するプログラム変換装置で用 V、られる変換プログラムであって、
オリジナルプログラムを取得するプログラム取得ステップと、
所定の順序で処理することにより、前記オリジナルプログラムと同一の実行結果を 出力し、異なる選択識別子が対応付けられる複数の選択対象データを生成する選択 対象データ生成ステップと、
複数の選択パラメータそれぞれに値を代入する前処理命令群を生成する前処理命 令群生成ステップと、
前記複数の選択パラメータを用いた演算式に基づいて、次に処理される選択対象 データを示す選択識別子を取得する命令群を含む選択処理命令群を生成する選択 処理命令群生成ステップと、
選択パラメータの値に、過去に処理された選択対象データを示す選択識別子、又 は前記選択パラメータに過去に代入された 1つ以上の選択パラメータの値のうち少な くとも 1つの選択パラメータの値を反映させる更新処理命令群を生成する更新処理命 令群生成ステップと、
前記前処理命令群と前記処理選択命令群と前記更新処理命令群と前記複数の選 択対象データとを含み、前記処理選択命令群を実行する処理と、前記選択処理命 令群により取得される選択識別子が示す選択対象データを処理する処理と、前記選 択対象データが処理されると前記更新処理命令群を実行する処理とを繰り返す秘密 保持プログラムを生成する秘密保持プログラム生成ステップと
を含むことを特徴とする変換プログラム。
[33] 前記変換プログラムは、コンピュータ読み取り可能な記録媒体に記録されていること を特徴とする請求項 32に記載の変換プログラム。
[34] 処理順序が定まった複数の選択対象データを処理することにより、秘匿すべき秘密 処理を実行する秘密処理装置で用いられる秘密処理方法であって、 複数の選択パラメータのそれぞれに値を代入する前処理実行ステップと、 前記複数の選択パラメータを用いた演算式に基づいて、次に処理される選択対象 データを示す選択識別子を取得する選択処理実行ステップと、
選択パラメータの値に、過去に処理された選択対象データを示す選択識別子、又 は前記選択パラメータに過去に代入された 1つ以上の選択パラメータの値のうち少な くとも 1つの選択パラメータの値を反映させる更新処理実行ステップと、
前記選択処理実行ステップにて取得された選択識別子が示す選択対象データを 処理する選択対象データ実行ステップと
を含むことを特徴とする秘密処理方法。
[35] 実行順序が定まった複数の選択対象データを含み、解析が困難な秘密保持プログ ラムを実行する秘密処理装置で用いられる秘密処理プログラムであって、
複数の選択パラメータのそれぞれに値を代入する前処理実行ステップと、 前記複数の選択パラメータを用いた演算式に基づいて、次に処理される選択対象 データを示す選択識別子を取得する選択処理実行ステップと、
選択パラメータの値に、過去に処理された選択対象データを示す選択識別子、又 は前記選択パラメータに過去に代入された 1つ以上の選択パラメータの値のうち少な くとも 1つの選択パラメータの値を反映させる更新処理実行ステップと、
前記選択処理実行ステップにて取得された選択識別子が示す選択対象データを 処理する選択対象データ実行ステップと
を含むことを特徴とする秘密処理プログラム。
[36] 前記秘密処理プログラムは、コンピュータ読み取り可能な記録媒体に記録されてい ることを特徴とする請求項 35に記載の秘密処理プログラム。
[37] オリジナルプログラム力 秘密保持プログラムを生成するプログラム変換装置の集 積回路であって、
オリジナルプログラムを取得するプログラム取得手段と、
所定の順序で処理することにより、前記オリジナルプログラムと同一の実行結果を 出力し、異なる選択識別子が対応付けられる複数の選択対象データを生成する選択 対象データ生成手段と、
複数の選択パラメータそれぞれに値を代入する前処理命令群を生成する前処理命 令群生成手段と、
前記複数の選択パラメータを用いた演算式に基づいて、次に処理される選択対象 データを示す選択識別子を取得する命令群を含む選択処理命令群を生成する選択 処理命令群生成手段と、
選択パラメータの値に、過去に処理された選択対象データを示す選択識別子、又 は前記選択パラメータに過去に代入された 1つ以上の選択パラメータの値のうち少な くとも 1つの選択パラメータの値を反映させる更新処理命令群を生成する更新処理命 令群生成手段と、
前記前処理命令群と前記処理選択命令群と前記更新処理命令群と前記複数の選 択対象データとを含み、前記処理選択命令群を実行する処理と、前記選択処理命 令群により取得される選択識別子が示す選択対象データを処理する処理と、前記選 択対象データが処理されると前記更新処理命令群を実行する処理とを繰り返す秘密 保持プログラムを生成する秘密保持プログラム生成手段と
を備えることを特徴とする集積回路。
処理順序が定まった複数の選択対象データを処理することにより、秘匿すべき秘密 処理を実行する秘密処理装置の集積回路であって、
複数の選択パラメータのそれぞれに値を代入する前処理実行手段と、
前記複数の選択パラメータを用いた演算式に基づいて、次に処理される選択対象 データを示す選択識別子を取得する選択処理実行手段と、
選択パラメータの値に、過去に処理された選択対象データを示す選択識別子、又 は前記選択パラメータに過去に代入された 1つ以上の選択パラメータの値のうち少な くとも 1つの選択パラメータの値を反映させる更新処理実行手段と、
前記選択処理実行手段にて取得された選択識別子が示す選択対象データを処理 する選択対象データ実行手段とを備え、
前記秘密保持プログラムの終了とみなすまで、前記選択処理実行手段と、更新処 理命令実行手段と、選択対象データ実行手段とを繰り返す ことを特徴とする集積回路。
PCT/JP2006/308454 2005-04-21 2006-04-21 プログラム変換装置及び秘密保持プログラム WO2006115217A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US11/918,785 US20090217008A1 (en) 2005-04-21 2006-04-21 Program conversion device, and secret keeping program
JP2007514686A JP4235243B2 (ja) 2005-04-21 2006-04-21 プログラム変換装置及び秘密保持プログラム

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
JP2005-124115 2005-04-21
JP2005124115 2005-04-21
JP2005379128 2005-12-28
JP2005-379128 2005-12-28

Publications (1)

Publication Number Publication Date
WO2006115217A1 true WO2006115217A1 (ja) 2006-11-02

Family

ID=37214832

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2006/308454 WO2006115217A1 (ja) 2005-04-21 2006-04-21 プログラム変換装置及び秘密保持プログラム

Country Status (3)

Country Link
US (1) US20090217008A1 (ja)
JP (1) JP4235243B2 (ja)
WO (1) WO2006115217A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009230717A (ja) * 2008-03-25 2009-10-08 Panasonic Corp 処理装置、難読化装置、プログラムおよび集積回路

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006115219A1 (ja) * 2005-04-21 2006-11-02 Matsushita Electric Industrial Co., Ltd. プログラム難読化装置及び難読化方法
EP2388730A1 (en) * 2010-05-17 2011-11-23 Nagravision S.A. Method for generating software code
US20130097431A1 (en) * 2011-10-18 2013-04-18 Paul Marion Hriljac Systems and methods of source software code modification
FR3011354A1 (fr) * 2013-10-01 2015-04-03 Commissariat Energie Atomique Procede d'execution par un microprocesseur d'un code binaire polymorphique d'une fonction predeterminee
US9600672B1 (en) * 2014-12-04 2017-03-21 Amazon Technologies, Inc. Dynamic function switching
US20160328539A1 (en) * 2015-05-05 2016-11-10 Nxp B.V. Obscuring Software Code With Split Variables
US11079909B2 (en) * 2016-12-23 2021-08-03 Salesforce.Com, Inc. Macro building tool with an information pane and a macro building pane for compiling an ordered macro and determining data dependency

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002514333A (ja) * 1997-06-09 2002-05-14 インタートラスト テクノロジーズ コーポレイション ソフトウェアセキュリティを増強するための混乱化技術
WO2006001365A1 (ja) * 2004-06-28 2006-01-05 Matsushita Electric Industrial Co., Ltd. プログラム生成装置、プログラムテスト装置、プログラム実行装置、及び情報処理システム

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5517614A (en) * 1992-05-29 1996-05-14 Kabushiki Kaisha Toshiba Data compression/encryption processing apparatus
US6061449A (en) * 1997-10-10 2000-05-09 General Instrument Corporation Secure processor with external memory using block chaining and block re-ordering
JP3824121B2 (ja) * 1999-04-01 2006-09-20 株式会社日立製作所 暗号データの復号化処理方法および装置
US7430670B1 (en) * 1999-07-29 2008-09-30 Intertrust Technologies Corp. Software self-defense systems and methods
US6973187B2 (en) * 2000-01-31 2005-12-06 Vdg, Inc. Block encryption method and schemes for data confidentiality and integrity protection
JP2002244989A (ja) * 2001-02-20 2002-08-30 Nec Corp デバイスドライバ作動方法
CA2348355A1 (en) * 2001-05-24 2002-11-24 Cloakware Corporation General scheme of using encodings in computations
US7305704B2 (en) * 2002-03-16 2007-12-04 Trustedflow Systems, Inc. Management of trusted flow system
US7383443B2 (en) * 2002-06-27 2008-06-03 Microsoft Corporation System and method for obfuscating code using instruction replacement scheme
JP2004265194A (ja) * 2003-03-03 2004-09-24 Matsushita Electric Ind Co Ltd 情報処理装置、および情報処理方法
US7346160B2 (en) * 2003-04-23 2008-03-18 Michaelsen David L Randomization-based encryption apparatus and method
WO2005107138A1 (fr) * 2004-03-29 2005-11-10 Stmicroelectronics Sa Processeur d'execution d'un algorithme de type aes
US7885405B1 (en) * 2004-06-04 2011-02-08 GlobalFoundries, Inc. Multi-gigabit per second concurrent encryption in block cipher modes
US7330982B1 (en) * 2004-06-14 2008-02-12 Avaya Technology Corp. Secured automated process for signed, encrypted or validated content generation
JP4549303B2 (ja) * 2005-02-07 2010-09-22 株式会社ソニー・コンピュータエンタテインメント パイプラインを用いてメッセージ認証コードを提供する方法および装置

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002514333A (ja) * 1997-06-09 2002-05-14 インタートラスト テクノロジーズ コーポレイション ソフトウェアセキュリティを増強するための混乱化技術
WO2006001365A1 (ja) * 2004-06-28 2006-01-05 Matsushita Electric Industrial Co., Ltd. プログラム生成装置、プログラムテスト装置、プログラム実行装置、及び情報処理システム

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
KAMOSHIDA A., MATSUMOTO T., INOUE S.: "Tamper-resistant, Software no Kosei Shuho ni Kansuru Kosatsu", IEICE TECHNICAL REPORT, vol. 97, no. 461, 19 December 1997 (1997-12-19), pages 69 - 78, XP002997757 *
MONDEN A.: "Software Protection no Gijutsu Doko (first part) - Software Tantai deno Tamper-resistant-ka Gijutsu-", JOHO SHORI, vol. 46, no. 4, 15 April 2005 (2005-04-15), pages 431 - 437, XP003004653 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009230717A (ja) * 2008-03-25 2009-10-08 Panasonic Corp 処理装置、難読化装置、プログラムおよび集積回路

Also Published As

Publication number Publication date
JPWO2006115217A1 (ja) 2008-12-18
US20090217008A1 (en) 2009-08-27
JP4235243B2 (ja) 2009-03-11

Similar Documents

Publication Publication Date Title
WO2006115217A1 (ja) プログラム変換装置及び秘密保持プログラム
US9659157B2 (en) Systems and methods for watermarking software and other media
US7051208B2 (en) Technique for producing through watermarking highly tamper-resistant executable code and resulting “watermarked” code so formed
Qu et al. Hiding signatures in graph coloring solutions
JP4914080B2 (ja) メタデータを符号化する方法およびシステム
Chatzikonstantinou et al. Evaluation of cryptography usage in android applications
US9659181B2 (en) System, apparatus and method for license key permutation
US20140165210A1 (en) Software watermarking techniques
JP2014178716A (ja) 不確定性ランダム値発生器
KR20070086517A (ko) 컴퓨터 프로그램 코드에 정보를 삽입하고 검출하는 방법 및이 방법을 수행하는 컴퓨터 판독가능 매체
JP2004088598A (ja) 電子透かし埋め込み装置、電子透かし解析装置、電子透かし埋め込み方法、電子透かし解析方法及びプログラム
JP6533583B2 (ja) モデル結託防止用透かし
Anckaert et al. Steganography for executables and code transformation signatures
US20140136584A1 (en) Method and Apparatus for Generating Random Numbers
CA2359862A1 (en) Using identifiers and counters for controlled optimization compilation
KR20180131960A (ko) 블록체인 기반 블록 검증 방법
JP2003224555A (ja) 識別情報符号化装置及び識別情報符号化方法、識別情報埋込装置及び識別情報埋込方法、並びにプログラム
JP3651777B2 (ja) 電子透かしシステム、電子透かし解析装置、電子透かし解析方法及び記録媒体
CN100565541C (zh) 程序变换装置和变换方法
CN116235169A (zh) 文本数据的数字水印
Anckaert et al. Covert communication through executables
CN114254400B (zh) 基于动态影子栈的栈缓冲区溢出攻击防御方法及系统
Yu et al. Hiding circuit topology from unbounded reverse engineers
KR100958784B1 (ko) 응용 프로그램 다형화 방법 및 그 장치
AU2022353195A1 (en) Process for embedding a digital watermark in tokenised data

Legal Events

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

Ref document number: 200680022462.7

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 2007514686

Country of ref document: JP

NENP Non-entry into the national phase

Ref country code: DE

NENP Non-entry into the national phase

Ref country code: RU

122 Ep: pct application non-entry in european phase

Ref document number: 06732212

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 11918785

Country of ref document: US