[go: up one dir, main page]

CN100353274C - A device for encrypting and protecting a program with a protection bit code - Google Patents

A device for encrypting and protecting a program with a protection bit code Download PDF

Info

Publication number
CN100353274C
CN100353274C CNB2004100018213A CN200410001821A CN100353274C CN 100353274 C CN100353274 C CN 100353274C CN B2004100018213 A CNB2004100018213 A CN B2004100018213A CN 200410001821 A CN200410001821 A CN 200410001821A CN 100353274 C CN100353274 C CN 100353274C
Authority
CN
China
Prior art keywords
program
bit code
protection bit
protection
insertion position
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CNB2004100018213A
Other languages
Chinese (zh)
Other versions
CN1641514A (en
Inventor
梁伯嵩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sunplus Technology Co Ltd
Original Assignee
Sunplus Technology 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 Sunplus Technology Co Ltd filed Critical Sunplus Technology Co Ltd
Priority to CNB2004100018213A priority Critical patent/CN100353274C/en
Publication of CN1641514A publication Critical patent/CN1641514A/en
Application granted granted Critical
Publication of CN100353274C publication Critical patent/CN100353274C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Storage Device Security (AREA)

Abstract

The invention provides a device for encrypting and protecting a program by using a protection bit code, wherein the program comprises a plurality of instructions P (P is a positive integer), and the device comprises a protection bit code generating device, a first protection bit code position generating device and a protection bit code inserting device. The protection bit code generating device generates a plurality of protection bit codes according to a plurality of instructions of the program, wherein the plurality of instructions have a plurality of bits I (I is a positive integer); the first protection bit code position generating device generates a plurality of inserting positions N (N is a positive integer) of the plurality of protection bit codes according to the processor state when the program is executed; the protection bit code inserting device inserts the plurality of protection bit codes into the N-1 th bit and the N-th bit of the plurality of instructions of the program respectively according to the inserting position N generated by the first protection bit code position generating device to generate an encrypted program.

Description

以保护位元码对-程序进行加密保护的装置A device for encrypting and protecting a program with a protected bit code

技术领域technical field

本发明是关于处理器资料保护技术,尤指一种以保护位元码对一程序进行加密保护的装置。The invention relates to processor data protection technology, in particular to a device for encrypting and protecting a program with protection bit codes.

背景技术Background technique

在这重视智财权的时代,厂商为了保护其辛苦开发的程序、资料等相关的智慧财产,会于离线(off-line)时将该等资料、程序先进行一加密(encrypting)处理,再将加密后的资料予以储存至一非挥发性储存器或其他储存媒体,他人即使拿到存有该加密资料的非挥发性储存器或其他储存媒体,由于无法知道该加密处理的过程及处理方法,亦无法正确去还原该等资料、程序,由此而达到保护的目的。In this era where intellectual property rights are valued, in order to protect the intellectual property related to the programs and data developed by the manufacturers, they will first encrypt the data and programs when they are offline (off-line), and then encrypt them. The encrypted data is stored in a non-volatile storage or other storage media. Even if others get the non-volatile storage or other storage media with the encrypted data, since they cannot know the encryption process and processing method, It is also impossible to restore the data and programs correctly, so as to achieve the purpose of protection.

针对此种资料保护方式,于;美国USP6,408,073号专利公告中,使用一虚拟乱数产生器(Pseudo Random Generator)及依据一初始值(seed1/seed2),来对只读储存器(Read Only Memory,ROM)的资料(ROMdata)进行编码以产生编码资料(Encoded data),然而此种资料保护方式因使用乱数做加密处理的参数,需有同步的乱数产生器用以进行解码。需要非常多的乱数的样型(pattern),才能有效防止他人还原该等资料、程序,这意味著编码及解码的虚拟乱数产生器需要相当复杂的电路,此会增加许多成本。若使用较简单的编码及解码的虚拟乱数产生器,虽然可节省成本,但却容易被他人还原该等资料、程序,因此,公知处理器的条件指令处理方法设计仍有诸多缺失而有予以改进的必要。For this kind of data protection method, in; USP6,408,073 patent announcement, use a virtual random number generator (Pseudo Random Generator) and according to an initial value (seed1/seed2), come to read-only memory (Read Only Memory) , ROM) to encode the data (ROMdata) to generate encoded data (Encoded data), but this data protection method requires a synchronous random number generator for decoding due to the use of random numbers as encryption parameters. A lot of random number patterns are needed to effectively prevent others from restoring the data and programs, which means that the virtual random number generator for encoding and decoding requires a rather complicated circuit, which will increase a lot of cost. If a virtual random number generator with simpler encoding and decoding is used, although it can save costs, it is easy to restore the data and programs by others. Therefore, the design of the conditional instruction processing method of the known processor still has many deficiencies and has been improved. necessary.

发明内容Contents of the invention

本发明的目的在于提供一种以保护位元码对一程序进行加密保护的装置,以避免公知技术使用复杂的虚拟乱数产生器,而达可节省成本的目的。同时,由于保护位元码的产生及去除硬件相当简易,以减少加密处理时间,而增进整体系统效率。The purpose of the present invention is to provide a device for encrypting and protecting a program with a protection bit code, so as to avoid the use of a complicated virtual random number generator in the known technology and achieve the purpose of saving costs. At the same time, since the generation and removal of the protection bit code is relatively simple, the encryption processing time is reduced and the overall system efficiency is improved.

依据本发明的一特色,提出一种以保护位元码对一程序进行加密保护的装置,该程序具有复数个指令,每一指令具有I位元,该I为正整数,该装置包含:According to a feature of the present invention, a device for encrypting and protecting a program with a protection bit code is proposed. The program has a plurality of instructions, and each instruction has I bits, and the I is a positive integer. The device includes:

一保护位元码产生装置,依据该程序的复数个指令以产生对应的复数个保护位元码,每一保护位元码具有P个位元,该P为正整数;A protection bit code generating device, according to the plurality of instructions of the program to generate a corresponding plurality of protection bit codes, each protection bit code has P bits, and the P is a positive integer;

一第一保护位元码位置产生装置,其依据执行该程序时处理器状态以产生每一保护位元码的插入位置N,该N为正整数,其中,该第一保护位元码位置产生装置包含:A first protected bit code position generating device, which generates the insertion position N of each protected bit code according to the state of the processor when executing the program, where N is a positive integer, wherein the first protected bit code position is generated The device contains:

一位置状态暂存器,用以指示该处理器存取资料区段或是存取程序区段;a location status register, used to instruct the processor to access data segments or access program segments;

一程序状态暂存器,用以指示该处理器所处状态;a program state register, used to indicate the state of the processor;

复数个插入位置产生装置,依据其预定的功能以产生插入位置;以及a plurality of insertion position generating devices to generate insertion positions according to their predetermined functions; and

一多工器,其具有复数个输入端,以耦合至该复数个插入位置产生装置的输出端,并依据该位置状态暂存器及该程序状态暂存器,由复数个输入端中选择一插入位置以做为输出;以及A multiplexer, which has a plurality of input terminals to be coupled to the output terminals of the plurality of insertion position generating devices, and selects one of the plurality of input terminals according to the position state register and the program state register insert position as output; and

一保护位元码插入装置,依据该第一保护位元码位置产生装置所产生的插入位置N,分别将每一保护位元码插入该程序对应指令第N-1位元与第N位元之中,以产生一加密程序。A protection bit code insertion device, according to the insertion position N generated by the first protection bit code position generating device, respectively inserts each protection bit code into the N-1th bit and the Nth bit of the corresponding instruction of the program Among them, an encryption program is generated.

依据本发明的另一特色,提出一种对一加密程序进行解密的装置,该加密程序将保护位元码插置于原始程序中而加密,该加密程序具有复数指令,该装置包含:According to another feature of the present invention, a device for decrypting an encrypted program is proposed. The encrypted program is encrypted by inserting a protection bit code into the original program. The encrypted program has multiple instructions. The device includes:

一第二保护位元码位置产生装置,其依据执行该程序时处理器状态以产生该复数个保护位元码的插入位置,其中该第二保护位元码位置产生装置包含:A second protection bit code position generation device, which generates the insertion positions of the plurality of protection bit codes according to the state of the processor when executing the program, wherein the second protection bit code position generation device includes:

一位置状态暂存器,用以指示该处理器存取资料区段或是存取程序区段;a location status register, used to instruct the processor to access data segments or access program segments;

一程序状态暂存器,用以指示该处理器所处的状态;a program status register, used to indicate the status of the processor;

复数个插入位置产生装置,依据其预定的功能以产生插入位置;以及a plurality of insertion position generating devices to generate insertion positions according to their predetermined functions; and

一多工器,其具有复数个输入端,以耦合至该复数个插入位置产生装置的输出端,并依据该位置状态暂存器及该程序状态暂存器,由复数个输入端中选择一插入位置以做为输出;以及A multiplexer, which has a plurality of input terminals to be coupled to the output terminals of the plurality of insertion position generating devices, and selects one of the plurality of input terminals according to the position state register and the program state register insert position as output; and

一保护位元码去除装置,输入该程序,并依据该第二保护位元码位置产生装置所产生的插入位置N,以将该程序对应指令的第N位元去除。A protection bit code removal device inputs the program, and removes the Nth bit of the corresponding instruction of the program according to the insertion position N generated by the second protection bit code position generation device.

依据本发明的又一特色,提出一种对一加密程序进行解密的装置,该加密程序将两组保护位元码插置于原始程序中而加密,该加密程序具有复数指令,其中一个字组可包含二个加密指令,该装置包含:According to another feature of the present invention, a device for decrypting an encrypted program is proposed. The encrypted program inserts two sets of protection bit codes into the original program for encryption. The encrypted program has multiple instructions, one of which is Can contain two encryption instructions, the device contains:

一第三保护位元码位置产生装置,其依据执行该程序时处理器状态以产生该复数个保护位元码的第三插入位置,其中该第三保护位元码位置产生装置包含:A third protected bit code position generating device, which generates the third insertion position of the plurality of protected bit codes according to the state of the processor when executing the program, wherein the third protected bit code position generating device includes:

一位置状态暂存器,用以指示该处理器存取资料区段或是存取程序区段;a location status register, used to instruct the processor to access data segments or access program segments;

一程序状态暂存器,用以指示该处理器所处的状态;a program status register, used to indicate the status of the processor;

复数个插入位置产生装置,依据其预定的功能以产生插入位置;以及a plurality of insertion position generating devices to generate insertion positions according to their predetermined functions; and

一多工器,其具有复数个输入端,以耦合至该复数个插入位置产生装置的输出端,并依据该位置状态暂存器及该程序状态暂存器,由复数个输入端中选择一插入位置以做为输出;A multiplexer, which has a plurality of input terminals to be coupled to the output terminals of the plurality of insertion position generating devices, and selects one of the plurality of input terminals according to the position state register and the program state register insert position as output;

一第四保护位元码位置产生装置,其依据执行该程序时处理器状态以产生该复数个保护位元码的第四插入位置,其中该第四保护位元码位置产生装置包含:A fourth protection bit code position generation device, which generates the fourth insertion position of the plurality of protection bit codes according to the state of the processor when executing the program, wherein the fourth protection bit code position generation device includes:

一位置状态暂存器,用以指示该处理器存取资料区段或是存取程序区段;a location status register, used to instruct the processor to access data segments or access program segments;

一程序状态暂存器,用以指示该处理器所处的状态;a program status register, used to indicate the status of the processor;

复数个插入位置产生装置,依据其预定的功能以产生插入位置;以及a plurality of insertion position generating devices to generate insertion positions according to their predetermined functions; and

一多工器,其具有复数个输入端,以耦合至该复数个插入位置产生装置的输出端,并依据该位置状态暂存器及该程序状态暂存器,由复数个输入端中选择一插入位置以做为输出;以及A multiplexer, which has a plurality of input terminals to be coupled to the output terminals of the plurality of insertion position generating devices, and selects one of the plurality of input terminals according to the position state register and the program state register insert position as output; and

一第三保护位元码去除装置,输入该加密程序的低半字组,并依据该第三保护位元码位置产生装置所产生的该第三插入位置N1,以将该程序对应指令的第0位元至K-1位元的第N1位元去除;以及A third protection bit code removing device, input the low half word group of the encryption program, and according to the third insertion position N1 generated by the third protection bit code position generating device, to correspond the program to the first bit of the instruction the removal of the N1-th bit from bit 0 to bit K-1; and

一第四保护位元码去除装置,输入该加密程序的高半字组,并依据该第四保护位元码位置产生装置所产生的第四插入位置N2,以将该程序对应指令的第K位元至2K-1位元的第N2位元去除。A fourth protection bit code removal device, input the upper half word group of the encrypted program, and according to the fourth insertion position N2 produced by the fourth protection bit code position generating device, to correspond the program to the Kth instruction The N2th bit of bits to 2K-1 bits is removed.

依据本发明的再一特色,提出一种以保护位元码对一程序进行加密保护的方法,该程序具有复数个指令,每一指令具有I位元,该I为正整数,该方法包含下列步骤:According to another characteristic of the present invention, a method for encrypting and protecting a program with a protection bit code is proposed, the program has a plurality of instructions, each instruction has I bits, and the I is a positive integer, the method includes the following step:

一保护位元码产生步骤,依据该程序复数个指令以产生对应的复数个保护位元码,每一保护位元码具有P个位元,该P为正整数;A protection bit code generating step, generating a plurality of corresponding protection bit codes according to the plurality of instructions of the program, each protection bit code has P bits, and the P is a positive integer;

一第一保护位元码位置产生步骤,其依据执行该程序时处理器状态以产生每一保护位元码的插入位置N,该N为正整数,其中一位置状态旗标用以指示该处理器存取资料区段或是存取程序区段,一程序状态旗标用以指示该处理器所处的状态,该第一保护位元码位置产生步骤还包含下列步骤:A first protection bit code position generating step, which generates the insertion position N of each protection bit code according to the state of the processor when executing the program, where N is a positive integer, wherein a position status flag is used to indicate the processing The device accesses the data segment or accesses the program segment, and a program status flag is used to indicate the status of the processor. The step of generating the first protection bit code position also includes the following steps:

复数个插入位置产生步骤,依据其预定的功能以产生插入位置;以及a plurality of insertion position generating steps to generate insertion positions according to their predetermined functions; and

一多工步骤,依据该位置状态旗标及该程序状态旗标,由复数个插入位置产生步骤的输出,选择一插入位置以做为输出;以及a multiplexing step, according to the position state flag and the program state flag, the output of the step is generated from a plurality of insertion positions, and an insertion position is selected as the output; and

一保护位元码插入步骤,依据该第一保护位元码位置产生步骤所产生的插入位置N,分别将每一保护位元码插入该程序对应指令的第N-1位元与第N位元之中,以产生一加密程序。A protection bit code insertion step, according to the insertion position N generated by the first protection bit code position generation step, respectively inserting each protection bit code into the N-1th bit and the Nth bit of the corresponding instruction of the program Among the elements, an encryption program is generated.

依据本发明的还一特色,提出一种对一加密程序进行解密的方法,该加密程序将保护位元码插置于原始程序中而加密,该加密程序具有复数指令,每一指令具有I位元,每一保护位元码具有P个位元,该方法包含下列步骤:According to another characteristic of the present invention, a method for decrypting an encrypted program is proposed. The encrypted program is encrypted by inserting the protection bit code into the original program. The encrypted program has a plurality of instructions, and each instruction has 1 bit Yuan, each protection bit code has P bits, and this method comprises the following steps:

一第二保护位元码位置产生步骤,其依据执行该程序时处理器状态以产生该复数个保护位元码的插入位置,其中,一位置状态旗标用以指示该处理器存取资料区段或是存取程序区段,一程序状态旗标用以指示该处理器所处的状态,该第二保护位元码位置产生步骤还包含下列步骤:A second protection bit code position generation step, which generates the insertion positions of the plurality of protection bit codes according to the state of the processor when executing the program, wherein a position status flag is used to instruct the processor to access the data area A segment or an access program segment, a program state flag is used to indicate the state of the processor, and the step of generating the second protection bit code position also includes the following steps:

复数个插入位置产生步骤,依据其预定的功能以产生插入位置;以及a plurality of insertion position generating steps to generate insertion positions according to their predetermined functions; and

一多工步骤,依据该位置状态旗标及该程序状态旗标,由复数个插入位置产生步骤的输出,选择一插入位置以做为输出;以及a multiplexing step, according to the position state flag and the program state flag, the output of the step is generated from a plurality of insertion positions, and an insertion position is selected as the output; and

一保护位元码去除步骤,输入该程序,并依据该第二保护位元码位置产生步骤所产生的插入位置N,以将该程序对应指令的第N位元去除。A protection bit code removal step, inputting the program, and removing the Nth bit of the corresponding instruction of the program according to the insertion position N generated by the second protection bit code position generation step.

依据本发明的又一特色,提出一种对一加密程序进行解密的方法,该加密程序将两组保护位元码插置于原始程序中而加密,该加密程序具有复数的指令,其中一个字组可包含二个加密指令,该方法包含下列步骤:According to yet another feature of the present invention, a method for decrypting an encrypted program is proposed. The encrypted program inserts two sets of protection bit codes into the original program for encryption. The encrypted program has a plurality of instructions, one of which is A group may contain two encryption instructions, the method includes the following steps:

一第三保护位元码位置产生步骤,其依据执行该程序时处理器状态以产生该复数个保护位元码的第三插入位置,其中,一位置状态旗标用以指示该处理器存取资料区段或是存取程序区段,一程序状态旗标用以指示该处理器所处的状态,该第三保护位元码位置产生步骤还包含下列步骤:A third protection bit code position generation step, which generates the third insertion position of the plurality of protection bit codes according to the state of the processor when executing the program, wherein a position status flag is used to indicate the processor access In the data segment or the access program segment, a program status flag is used to indicate the status of the processor, and the step of generating the third protection bit code position also includes the following steps:

复数个插入位置产生步骤,依据其预定的功能以产生插入位置;以及a plurality of insertion position generating steps to generate insertion positions according to their predetermined functions; and

一多工步骤,依据该位置状态旗标及该程序状态旗标,由复数个插入位置产生步骤的输出,选择一插入位置以做为输出;A multiplexing step, according to the position state flag and the program state flag, the output of the step is generated from a plurality of insertion positions, and an insertion position is selected as the output;

一第四保护位元码位置产生步骤,其依据执行该程序时处理器状态以产生该复数个保护位元码的第四插入位置,其中,一位置状态旗标用以指示该处理器存取资料区段或是存取程序区段,一程序状态旗标用以指示该处理器所处的状态,该第四保护位元码位置产生步骤还包含下列步骤:A fourth protection bit code position generation step, which generates the fourth insertion position of the plurality of protection bit codes according to the state of the processor when executing the program, wherein a position status flag is used to indicate the processor access In the data section or the access program section, a program state flag is used to indicate the state of the processor, and the step of generating the fourth protection bit code position also includes the following steps:

复数个插入位置产生步骤,依据其预定的功能以产生插入位置;以及a plurality of insertion position generating steps to generate insertion positions according to their predetermined functions; and

一多工步骤,依据该位置状态旗标及该程序状态旗标,由复数个插入位置产生步骤的输出,选择一插入位置以做为输出;以及a multiplexing step, according to the position state flag and the program state flag, the output of the step is generated from a plurality of insertion positions, and an insertion position is selected as the output; and

一第三保护位元码去除步骤,输入该加密程序的低半字组,并依据该第三保护位元码位置产生步骤所产生的第三插入位置N1,以将该程序对应指令的第0位元至K-1位元的第N1位元去除;以及A third protection bit code removal step, inputting the low half word group of the encryption program, and according to the third insertion position N1 generated by the third protection bit code position generation step, to correspond the program to the 0th of the instruction N1 bit removal of bits to K-1 bits; and

一第四保护位元码去除步骤,输入该加密程序的高半字组,并依据该第四保护位元码位置产生步骤所产生的第四插入位置N2,以将该程序对应指令的第K位元至2K-1位元的笫N2位元去除。A fourth protection bit code removal step, inputting the upper half word group of the encryption program, and according to the fourth insertion position N2 produced by the fourth protection bit code position generation step, to correspond the program to the Kth instruction Bits N2 to 2K-1 bits are removed.

附图说明Description of drawings

图1:本发明以保护位元码对一程序进行加密保护装置方块图。Fig. 1: A block diagram of a device for encrypting and protecting a program with a protected bit code according to the present invention.

图2:本发明第二保护位元码位置产生装置的电路图。Fig. 2: The circuit diagram of the second protection bit code position generating device of the present invention.

图3-图4:本发明第二保护位元码位置产生装置所产生插入位置的示意图。FIG. 3-FIG. 4: Schematic diagrams of insertion positions generated by the second protection bit code position generating device of the present invention.

图5:本发明保护位元码去除装置的电路图。Fig. 5: The circuit diagram of the protection bit code removing device of the present invention.

图6:本发明以保护位元码对一程序进行加密保护的装置另一实施例方块图Fig. 6: The block diagram of another embodiment of the device for encrypting and protecting a program with the protection bit code of the present invention

具体实施方式Detailed ways

图1显示本发明以保护位元码对一程序进行加密保护装置的方块图,其包含一保护位元码产生装置110、一第一保护位元码位置产生装置120、一保护位元码插入装置130、一第二保护位元码位置产生装置210及一保护位元码去除装置220。而被加密的程序具有复数的指令,每一个指令具有I个位元(I为正整数),而保护位元码具有P个位元(P正整数),在本实施例中,I为31位元,P为1位元,即I+P为32位元,亦可I为32位元,P为1位元。Fig. 1 shows the block diagram that the present invention carries out encryption protection device to a program with protection bit code, and it comprises a protection bit code generation device 110, a first protection bit code position generation device 120, a protection bit code insertion The device 130 , a second protection bit code position generation device 210 and a protection bit code removal device 220 . And the encrypted program has complex instructions, each instruction has I bit (I is a positive integer), and the protection bit code has P bits (P positive integer), in the present embodiment, I is 31 Bit, P is 1 bit, that is, I+P is 32 bits, or I is 32 bits, and P is 1 bit.

该保护位元码产生装置110依据该程序的每一个指令以分别产生相对应的保护位元码,该保护位元码可为同位检查位元(Parity bit)、错误更正码(Error Correction Code、ECC)或是指令执行时处理器模式的指示位元。The protection bit code generator 110 generates a corresponding protection bit code according to each instruction of the program, and the protection bit code can be a parity check bit (Parity bit), an error correction code (Error Correction Code, ECC) or an indication bit of the processor mode when the instruction is executed.

该第一保护位元码位置产生装置120依据执行该程序时的处理器状态以产生每一保护位元码的插入位置N(N为正整数)。该保护位元码插入装置130是依据该第一保护位元码位置产生装置120所产生的插入位置N,分别将每一保护位元码插入该程序对应指令的第N-1与第N位元之中,以产生一加密程序。The first protected bitcode position generator 120 generates the insertion position N (N is a positive integer) of each protected bitcode according to the state of the processor when the program is executed. The protection bit code inserting device 130 is based on the insertion position N generated by the first protection bit code position generating device 120, respectively inserting each protection bit code into the N-1th and Nth bits of the corresponding instruction of the program Among the elements, an encryption program is generated.

该第二保护位元码位置产生装置210依据执行该程序时处理器状态以产生该每一保护位元码的插入位置。该保护位元码去除装置220输入一加密程序,该加密程序是将保护位元码插置于原始程序中而予以加密,并依据该第二保护位元码位置产生装置210所产生的每一插入位置N,以将该加密程序的每一指令中的保护位元码去除。The second protection bit code position generating device 210 generates the insertion position of each protection bit code according to the state of the processor when the program is executed. This protection bit code removing device 220 inputs an encryption program, and this encryption program is to insert the protection bit code into the original program and be encrypted, and according to each position generated by the second protection bit code position generation device 210 Insert position N to remove the protection bit code in each instruction of the encrypted program.

该第一保护位元码位置产生装置120及该第二保护位元码位置产生装置210是依据执行该程序时处理器状态以产生插入位置,图2为其电路图。每一第一及第二保护位元码位置产生装置包含一存取状态暂存器(AccessStatus Register、ASR)310、一程序状态暂存器(Program Status Register、PSR)320、一多工器330及复数个插入位置产生装置340-380。The first protected bitcode position generating device 120 and the second protected bitcode position generating device 210 generate insertion positions according to the state of the processor when the program is executed. FIG. 2 is a circuit diagram thereof. Each first and second protection bit code position generating device includes an access status register (AccessStatus Register, ASR) 310, a program status register (Program Status Register, PSR) 320, a multiplexer 330 And a plurality of insertion position generating devices 340-380.

该存取状态暂存器(ASR)310为1位元,其值为1时,代表处理器存取资料区段,其值为0时,代表处理器存取程序区段。该程序状态暂存器(PSR)320为3位元,其值为1xx时,代表处理器重置后进入自动开机执行BIOS程序状态;其值为01x时,代表处理器处在作业系统核心(OS Kernel)状态;其值为001时,代表处理器处在一特殊认证程序状态;其值为000时,代表处理器处在一个一般使用者程序状态。The access status register (ASR) 310 is 1 bit. When the value is 1, it means the processor accesses the data segment, and when the value is 0, it means the processor accesses the program segment. The program state temporary register (PSR) 320 is 3 bits, and when its value is 1xx, it means that the processor enters the state of automatically booting to execute the BIOS program after being reset; when its value is 01x, it means that the processor is in the core of the operating system ( OS Kernel) state; when its value is 001, it represents that the processor is in a special authentication program state; when its value is 000, it represents that the processor is in a general user program state.

图2中的PPG_Mode讯号是用来选择该多工器330的输出讯号PBP与输入讯号之间的关系。该PPG_Mode讯号是由该存取状态暂存器(ASR)310及该程序状态暂存器(PSR)320所组合而成,亦即PPG_Mode={ASR,PSR[2:0])。当处理器存取资料区段时,该存取状态暂存器(ASR)310的值为1,PPG_Mode=1xxx,该多工器330会选择插入位置产生装置380输出做为该多工器330的输出讯号PBP。而当处理器重置后,进入自动开机执行BIOS程序状态时,该存取状态暂存器(ASR)310的值为0,该程序状态暂存器(PSR)320的值为1xx,该多工器330会选择插入位置产生装置340输出做为该多工器330的输出讯号PBP。The PPG_Mode signal in FIG. 2 is used to select the relationship between the output signal PBP and the input signal of the multiplexer 330 . The PPG_Mode signal is composed of the access status register (ASR) 310 and the program status register (PSR) 320 , that is, PPG_Mode={ASR,PSR[2:0]). When the processor accesses the data segment, the value of the access status register (ASR) 310 is 1, PPG_Mode=1xxx, and the multiplexer 330 will select the output of the insertion position generating device 380 as the multiplexer 330 The output signal PBP. And after the processor is reset, when entering the state of automatically booting to execute the BIOS program, the value of the access status register (ASR) 310 is 0, the value of the program status register (PSR) 320 is 1xx, the number of The multiplexer 330 will select the output of the insertion position generator 340 as the output signal PBP of the multiplexer 330 .

该复数个插入位置产生装置340-380是依据其预定的功能以产生插入位置。其中,该插入位置产生装置380可为一空装置,以表示无插入位置,其输出讯号为000000b。该插入位置产生装置340是将一给定值x经由模数运算以产生插入位置,亦即,F1(x)=(x mod 32)。该插入位置产生装置350将一第一给定值减去经由模数运算的一第二给定值,以产生插入位置,亦即,F2(x)=31-(x mod 32)。The plurality of insertion position generating devices 340-380 generate insertion positions according to their predetermined functions. Wherein, the insertion position generating device 380 can be an empty device, which means there is no insertion position, and its output signal is 000000b. The insertion position generating device 340 generates the insertion position through a modulus operation of a given value x, that is, F1(x)=(x mod 32). The inserting position generating device 350 subtracts a second given value through a modulus operation from a first given value to generate the inserting position, that is, F2(x)=31−(x mod 32).

该插入位置产生装置360将一第一给定值与该处理器的部分位址线值结合后,再经由模数运算,以产生插入位置,亦即,F3(x,a)=[(x+{a[0],a[1],a[2],a[3],a[4]})mod 32]。该插入位置产生装置370将一给定值x[4:0]反置,以产生插入位置,亦即,F4(x)={x[0],x[1],x[2],x[3],x[4]}。该插入位置产生装置亦可将该存取状态暂存器(ASR)310与该程序状态暂存器(PSR)320结合后,以产生插入位置,或是将该位置状态暂存器与该程序状态暂存器结合后,再经由模数运算,以产生插入位置。The insertion position generation device 360 combines a first given value with the partial address line value of the processor, and then undergoes a modulus operation to generate an insertion position, that is, F3(x, a)=[(x+ {a[0], a[1], a[2], a[3], a[4]}) mod 32]. The insertion position generator 370 inverts a given value x[4:0] to generate the insertion position, that is, F4(x)={x[0], x[1], x[2], x [3],x[4]}. The insertion position generator can also combine the access status register (ASR) 310 with the program status register (PSR) 320 to generate the insertion position, or combine the position status register with the program After the state registers are combined, the insertion position is generated through a modulus operation.

图2中的K1、K2、K3及K4分别对该复数个插入位置产生装置340-380提供一给定值,其可先予以烧录至一硬件电路,亦可为暂存器,而由系统去设定。如此,可对不同程序及处理器所处状态产生不同的保护位元码插入位置。K1, K2, K3 and K4 among Fig. 2 provide a given value respectively to this plurality of insertion position generating devices 340-380, and it can burn into a hardware circuit earlier, also can be register, and by the system Go to settings. In this way, different protection bit code insertion positions can be generated for different programs and states of the processor.

图3显示K1=K2=K3=K4=3时,该复数个插入位置产生装置340、350及380所产生不同的保护位元码插入位置。其中,F1(x)=(x mod 32)=3,代表处理器重置后,进入自动开机执行BIOS程序状态时,其保护位元码插入位置为位元3。F2(x)=[31-(x mod 32)]=28,代表处理器处在作业系统核心(OS Kernel)状态时,其保护位元码插入位置为位元28。F4(x)={x[0],x[1],x[2],x[3],x[4]}={11000b}=24,代表处理器处在一个一般使用者程序状态时,其保护位元码插入位置为位元24。FIG. 3 shows that when K1=K2=K3=K4=3, the multiple insertion position generators 340, 350 and 380 generate different protection bit code insertion positions. Among them, F1(x)=(x mod 32)=3, which means that after the processor is reset and enters the state of automatically booting to execute the BIOS program, the protection bit code insertion position is bit 3. F2(x)=[31-(x mod 32)]=28, which means that when the processor is in the operating system kernel (OS Kernel) state, its protection bit code insertion position is bit 28. F4(x)={x[0], x[1], x[2], x[3], x[4]}={11000b}=24, which means that the processor is in a general user program state , the insertion position of the protection bit code is bit 24.

图4显示K3=3时,该插入位置产生装置360所产生不同的保护位元码插入位置。F3(x,a)=(x+{a[0],a[1],a[2],a[3],a[4]})mod 32=(3+{a[0],a[1],a[2],a[3],a[4]})mod 32。代表处理器处在一个认证程序时,其保护位元码插入位置将会呈现如图4所示的变化,而使得该认证程序码难以盗取或解译。FIG. 4 shows that when K3=3, the insertion position generation device 360 generates different protection bit code insertion positions. F3(x,a)=(x+{a[0],a[1],a[2],a[3],a[4]}) mod 32=(3+{a[0],a[ 1], a[2], a[3], a[4]}) mod 32. It means that when the processor is in an authentication program, the insertion position of the protection bit code will change as shown in FIG. 4 , making the authentication program code difficult to steal or decipher.

该多工器330的输出讯号PBP(P-bit Bit Position)为由6个位元所组成,其中PBP[5]的布林值代表PBP[4:0]中是否为保护位元码插入位置。当PBP[5:0]=0xxxxxb时,表示PBP[4:0]无保护位元码插入位置。当PBP[5:0]=100101b时,表示PBP[4:0]为保护位元码插入位置,且该保护位元码插入位置在00101b=5的位置。由于该复数个插入位置产生装置340-370均会产生保护位元码插入位置,故其输出讯号会与一高电位组合,而形成该多工器330的输出讯号PBP[5:0],其中,该高电位形成PBP[5](即PBP[5]=1),以表示PBP[4:0]为保护位元码插入位置。而该复数个插入位置产生装置380为一空装置,以表示无插入位置,故其输出讯号为000000b,表示PBP[4:0]无保护位元码插入位置。The output signal PBP (P-bit Bit Position) of the multiplexer 330 is composed of 6 bits, wherein the Bollinger value of PBP[5] represents whether PBP[4:0] is the protection bit code insertion position . When PBP[5:0]=0xxxxxb, it indicates the insertion position of PBP[4:0] unprotected bit code. When PBP[5:0]=100101b, it means that PBP[4:0] is the protection bit code insertion position, and the protection bit code insertion position is at the position of 00101b=5. Since the plurality of insertion position generating devices 340-370 all generate protection bit code insertion positions, their output signals will be combined with a high potential to form the output signal PBP[5:0] of the multiplexer 330, wherein , the high potential forms PBP[5] (that is, PBP[5]=1), to indicate that PBP[4:0] is the insertion position of the protection bit code. The plurality of insertion position generators 380 is an empty device, indicating that there is no insertion position, so its output signal is 000000b, indicating that PBP[4:0] has no protection bit code insertion position.

图5为该保护位元码去除装置220的电路图,其主要包含多工器510、520及530。其输入端540输入一32位元的加密程序,该加密程序将保护位元码插置于原始程序中而予以加密,并依据该第二保护位元码位置产生装置210所产生的复数个插入位置PBP[4:0],以将该加密程序的复数指令中的保护位元码去除。当PBP[5]=0时,表示PBP[4:0]无保护位元码插入位置,故该多工器510则将输入端540直接输出。当PBP[5]=1时,表示PBP[4:0]为保护位元码插入位置,该多工器520依据该PBP[4:0]讯号,而输出该保护位元码,该多工器530依据该PBP[4:0]讯号,输出不具有该保护位元码的指令,该保护位元码与该不具有该保护位元码的指令又组合成一32位元字组,而该多工器510因PBP[5]=1,则将其接输出。FIG. 5 is a circuit diagram of the protection bit code removing device 220 , which mainly includes multiplexers 510 , 520 and 530 . Its input terminal 540 inputs a 32-bit encryption program, the encryption program inserts the protection bit code into the original program to be encrypted, and according to the plurality of insertions generated by the second protection bit code position generating device 210 Position PBP[4:0] to remove the protection bit code in the complex instruction of the encrypted program. When PBP[5]=0, it means that PBP[4:0] has no protection bit code insertion position, so the multiplexer 510 directly outputs the input terminal 540 . When PBP[5]=1, it means PBP[4:0] is the insertion position of the protection bit code, the multiplexer 520 outputs the protection bit code according to the PBP[4:0] signal, the multiplexer The device 530 outputs the command without the protection bit code according to the PBP[4:0] signal, and the protection bit code and the command without the protection bit code are combined into a 32-byte word group, and the Since PBP[5]=1, the multiplexer 510 connects it to output.

于本实施例中,该保护位元码产生装置110、第一保护位元码位置产生装置120、及保护位元码插入装置130可以使用硬件予以实现,亦可以使用软件离线处理,而产生一加密程序。该保护位元码去除装置220及该第二保护位元码位置产生装置210可与一处理器核心结合,该保护位元码去除装置220输入该加密程序,并依据该第二保护位元码位置产生装置210所产生的复数个插入位置N,以将该加密程序的复数个指令中的保护位元码去除。如此,该处理器核心可正确执行该解密后的程序,而加密的程序则不必担心轻易被他人所破解,而达到保护的目的。In this embodiment, the protection bit code generation device 110, the first protection bit code position generation device 120, and the protection bit code insertion device 130 can be implemented using hardware, or can be processed offline using software to generate a encryption program. The protection bit code removal device 220 and the second protection bit code position generation device 210 can be combined with a processor core, the protection bit code removal device 220 inputs the encryption program, and according to the second protection bit code The plurality of insertion positions N generated by the position generating device 210 is used to remove the protection bit codes in the plurality of instructions of the encrypted program. In this way, the processor core can correctly execute the decrypted program, and the encrypted program does not need to worry about being easily cracked by others, thus achieving the purpose of protection.

图6为本发明的另一实施例,是对将两组保护位元码插置于原始程序中的加密程序进行解密的装置,该加密程序具有复数的指令,其中一个字组可包含二个加密指令,每一加密指令为16位元。该装置包含一第三保护位元码位置产生装置610、一第四保护位元码位置产生装置620、一第三保护位元码去除装置630及一第四保护位元码去除装置640。Fig. 6 is another embodiment of the present invention, which is a device for decrypting an encrypted program that inserts two groups of protection bit codes into the original program. The encrypted program has multiple instructions, and one word group can contain two Encrypted instructions, each encrypted instruction is 16 bits. The device includes a third protected bit code position generating device 610 , a fourth protected bit code position generating device 620 , a third protected bit code removing device 630 and a fourth protected bit code removing device 640 .

该第三保护位元码位置产生装置610及第四保护位元码位置产生装置620分别依据执行该程序时的处理器状态以产生每一保护位元码的第三插入位置PBP1[4:0]及第四插入位置PBP2[4:0]。The third protected bit code position generating device 610 and the fourth protected bit code position generating device 620 respectively generate the third insertion position PBP1[4:0 of each protected bit code according to the state of the processor when the program is executed. ] and the fourth insertion position PBP2[4:0].

该第三保护位元码去除装置630输入该加密程序的低半字组(low halfword),并依据该第三保护位元码位置产生装置630所产生的每一第三插入位置PBP1[4:0],以将该程序复数指令的第0至15位元的第PBP1[4:0]位元去除。该第四保护位元码去除装置640输入该加密程序的高半字组(high half word),并依据该第四保护位元码位置产生装置所产生的每一第四插入位置PBP2[4:0],以将该程序对应指令的第16至31位元的第PBP2[4:0]位元去除。The third protection bit code removing device 630 inputs the low half word group (low halfword) of the encryption program, and according to each third insertion position PBP1[4: 0] to remove the PBP1[4:0] bits of the 0 to 15 bits of the complex instruction of the program. The fourth protection bit code removal device 640 inputs the high half word group (high half word) of the encryption program, and according to each fourth insertion position PBP2 [4: 0] to remove the PBP2[4:0] bits of the 16th to 31st bits of the instruction corresponding to the program.

由上述说明可知,本发明的技术仅需简易的硬件即可达成加密及解密的功能,无需像公知技术使用复杂的虚拟乱数产生器,而可节省成本,同时,保护位元码的产生及去除硬件相当简易,并不会如公知技术一般会增加加密及解密处理时间,而远较公知技术需花费的加密及解密处理时间为少,故其执行效能远较公知技术更好。It can be seen from the above description that the technology of the present invention can achieve the functions of encryption and decryption only with simple hardware, and does not need to use a complicated virtual random number generator like the known technology, which can save costs, and at the same time, protect the generation and removal of bit codes. The hardware is quite simple, and does not increase the processing time of encryption and decryption as in the known technology, but is far less than the time spent in the processing of encryption and decryption in the known technology, so its execution performance is much better than that of the known technology.

应注意的是,上述诸多实施例仅是为了便于说明而举例而已,本发明所主张的权利范围自应以申请专利范围所述为准,而非仅限于上述实施例。It should be noted that the above-mentioned embodiments are only examples for convenience of description, and the scope of rights claimed by the present invention should be determined by the scope of the patent application, rather than limited to the above-mentioned embodiments.

Claims (48)

1.一种以保护位元码对一程序进行加密保护的装置,该程序具有复数个指令,每一指令具有I位元,该I为正整数,该装置包含:1. A device for encrypting and protecting a program with a protection bit code, the program has a plurality of instructions, each instruction has I bits, and the I is a positive integer, the device includes: 一保护位元码产生装置,依据该程序的复数个指令以产生对应的复数个保护位元码,每一保护位元码具有P个位元,该P为正整数;A protection bit code generating device, according to the plurality of instructions of the program to generate a corresponding plurality of protection bit codes, each protection bit code has P bits, and the P is a positive integer; 一第一保护位元码位置产生装置,其依据执行该程序时处理器状态以产生每一保护位元码的插入位置N,该N为正整数,其中,该第一保护位元码位置产生装置包含:A first protected bit code position generating device, which generates the insertion position N of each protected bit code according to the state of the processor when executing the program, where N is a positive integer, wherein the first protected bit code position is generated The device contains: 一位置状态暂存器,用以指示该处理器存取资料区段或是存取程序区段;a location status register, used to instruct the processor to access data segments or access program segments; 一程序状态暂存器,用以指示该处理器所处状态;a program state register, used to indicate the state of the processor; 复数个插入位置产生装置,依据其预定的功能以产生插入位置;以及a plurality of insertion position generating devices to generate insertion positions according to their predetermined functions; and 一多工器,其具有复数个输入端,以耦合至该复数个插入位置产生装置的输出端,并依据该位置状态暂存器及该程序状态暂存器,由复数个输入端中选择一插入位置以做为输出;以及A multiplexer, which has a plurality of input terminals to be coupled to the output terminals of the plurality of insertion position generating devices, and selects one of the plurality of input terminals according to the position state register and the program state register insert position as output; and 一保护位元码插入装置,依据该第一保护位元码位置产生装置所产生的插入位置N,分别将每一保护位元码插入该程序对应指令第N-1位元与第N位元之中,以产生一加密程序。A protection bit code insertion device, according to the insertion position N generated by the first protection bit code position generating device, respectively inserts each protection bit code into the N-1th bit and the Nth bit of the corresponding instruction of the program Among them, an encryption program is generated. 2.如权利要求1所述的以保护位元码对一程序进行加密保护的装置,其特征在于,还包含:2. The device for encrypting and protecting a program with a protection bit code as claimed in claim 1, further comprising: 一第二保护位元码位置产生装置,其依据执行该程序时处理器状态以产生该每一保护位元码的前述插入位置N,其中,该第二保护位元码位置产生装置包含:A second protection bit code position generating device, which generates the aforementioned insertion position N of each protection bit code according to the state of the processor when executing the program, wherein the second protection bit code position generating device includes: 一位置状态暂存器,用以指示该处理器存取资料区段或是存取程序区段;a location status register, used to instruct the processor to access data segments or access program segments; 一程序状态暂存器,用以指示该处理器所处状态;a program state register, used to indicate the state of the processor; 复数个插入位置产生装置,依据其预定的功能以产生插入位置;以及a plurality of insertion position generating devices to generate insertion positions according to their predetermined functions; and 一多工器,其具有复数个输入端,以耦合至该复数个插入位置产生装置的输出端,并依据该位置状态暂存器及该程序状态暂存器,由复数个输入端中选择一插入位置以做为输出;以及A multiplexer, which has a plurality of input terminals to be coupled to the output terminals of the plurality of insertion position generating devices, and selects one of the plurality of input terminals according to the position state register and the program state register insert position as output; and 一保护位元码去除装置,输入该程序,并依据该第二保护位元码位置产生装置所产生的插入位置N,以将该程序的对应指令第N位元去除。A protection bit code removal device inputs the program, and removes the Nth bit of the corresponding instruction of the program according to the insertion position N generated by the second protection bit code position generation device. 3.如权利要求2所述的以保护位元码对一程序进行加密保护的装置,其特征在于,其中该第一保护位元码位置产生装置的复数个插入位置产生装置及该第二保护位元码位置产生装置的复数个插入位置产生装置可为一空装置,以表示无前述插入位置。3. The device for encrypting and protecting a program with a protection bit code as claimed in claim 2, wherein the plurality of insertion position generating devices of the first protection bit code position generating device and the second protection The plurality of inserting position generating means of the bit code position generating means may be an empty device to indicate that there is no aforementioned inserting position. 4.如权利要求2所述的以保护位元码对一程序进行加密保护的装置,其特征在于,其中该第一保护位元码位置产生装置的复数个插入位置产生装置及该第二保护位元码位置产生装置的复数个插入位置产生装置可将一给定值经由函数运算以产生该插入位置。4. The device for encrypting and protecting a program with a protection bit code as claimed in claim 2, wherein the plurality of insertion position generating devices of the first protection bit code position generating device and the second protection The plurality of insertion position generating devices of the bit code position generating device can generate the insertion position by performing a function operation on a given value. 5.如权利要求2所述的以保护位元码对一程序进行加密保护的装置,其特征在于,其中该第一保护位元码位置产生装置的复数个插入位置产生装置及该第二保护位元码位置产生装置的复数个插入位置产生装置可将一第一给定值减去经由函数运算的一第二给定值,以产生该插入位置。5. The device for encrypting and protecting a program with a protection bit code as claimed in claim 2, wherein the plurality of insertion position generating devices of the first protection bit code position generating device and the second protection The plurality of inserting position generating devices of the bit code position generating device can subtract a second given value through function operation from a first given value to generate the inserting position. 6.如权利要求2所述的以保护位元码对一程序进行加密保护的装置,其特征在于,其中该第一保护位元码位置产生装置的复数个插入位置产生装置及该第二保护位元码位置产生装置的复数个插入位置产生装置可将一第一给定值与该处理器部分位址值结合后,再经由函数运算,以产生该插入位置。6. The device for encrypting and protecting a program with a protection bit code as claimed in claim 2, wherein the plurality of insertion position generating devices of the first protection bit code position generating device and the second protection The plurality of inserting position generating devices of the bit code position generating device can combine a first given value with the address value of the processor part, and then perform a function operation to generate the inserting position. 7.如权利要求2所述的以保护位元码对一程序进行加密保护的装置,其特征在于,其中该第一保护位元码位置产生装置的复数个插入位置产生装置可将该第一保护位元码位置产生装置的位置状态暂存器与该第一保护位元码位置产生装置的程序状态暂存器结合后,以产生该插入位置,该第二保护位元码位置产生装置的复数个插入位置产生装置可将该第二保护位元码位置产生装置的位置状态暂存器与该第二保护位元码位置产生装置的程序状态暂存器结合后,以产生该插入位置。7. The device for encrypting and protecting a program with a protection bit code as claimed in claim 2, wherein the plurality of insertion position generating devices of the first protection bit code position generating device can use the first After the position status register of the protected bit code position generating device is combined with the program status register of the first protected bit code position generating device, to generate the insertion position, the second protected bit code position generating device A plurality of insertion position generators can combine the position status register of the second protected bit code position generator with the program status register of the second protected bit code position generator to generate the insertion position. 8.如权利要求2所述的以保护位元码对一程序进行加密保护的装置,其特征在于,其中该第一保护位元码位置产生装置的复数个插入位置产生装置可将该第一保护位元码位置产生装置的位置状态暂存器与该第一保护位元码位置产生装置的程序状态暂存器结合后,再经由函数运算,以产生该插入位置,该第二保护位元码位置产生装置的复数个插入位置产生装置可将该第二保护位元码位置产生装置的位置状态暂存器与该第二保护位元码位置产生装置的程序状态暂存器结合后,再经由函数运算,以产生插入位置。8. The device for encrypting and protecting a program with a protection bit code as claimed in claim 2, wherein the plurality of insertion position generating devices of the first protection bit code position generating device can use the first After combining the position status register of the protected bit code position generating device with the program status register of the first protected bit code position generating device, the insertion position and the second protected bit are generated through function operations. A plurality of insertion position generating devices of the code position generating device can combine the position status register of the second protected bit code position generating device with the program state register of the second protected bit code position generating device, and then Through the function operation, to generate the insertion position. 9.如权利要求2所述的以保护位元码对一程序进行加密保护的装置,其特征在于,其中该保护位元码去除装置还可依据该第二保护位元码位置产生装置所产生的前述插入位置N,而将该程序对应指令的第N位元移至最高位元处。9. The device for encrypting and protecting a program with a protection bit code as claimed in claim 2, wherein the protection bit code removal device can also be generated according to the second protection bit code position generation device The aforementioned insertion position N, and the Nth bit of the corresponding instruction of the program is moved to the highest bit. 10.如权利要求2所述的以保护位元码对一程序进行加密保护的装置,其特征在于,其中该保护位元码去除装置还可依据该第二保护位元码位置产生装置所产生的插入位置N,而将该程序对应指令的第N位元移至最低位元处。10. The device for encrypting and protecting a program with a protection bit code as claimed in claim 2, wherein the protection bit code removal device can also be generated according to the second protection bit code position generation device The insertion position N of the program, and the Nth bit of the corresponding instruction of the program is moved to the lowest bit. 11.如权利要求2所述的以保护位元码对一程序进行加密保护的装置,其特征在于,其中该保护位元码去除装置还可依据该第二保护位元码位置产生装置所产生的插入位置N,而将该程序的对应指令直接输出。11. The device for encrypting and protecting a program with a protection bit code as claimed in claim 2, wherein the protection bit code removal device can also be generated according to the second protection bit code position generation device The insertion position N of the program, and the corresponding instruction of the program is output directly. 12.如权利要求2所述的以保护位元码对一程序进行加密保护的装置,其特征在于,其中I+P=32。12. The device for encrypting and protecting a program with a protection bit code as claimed in claim 2, wherein I+P=32. 13.如权利要求3所述的以保护位元码对一程序进行加密保护的装置,其特征在于,其中I=32。13. The device for encrypting and protecting a program with a protection bit code as claimed in claim 3, wherein I=32. 14.一种对一加密程序进行解密的装置,该加密程序将保护位元码插置于原始程序中而加密,该加密程序具有复数指令,每一指令具有I位元,每一保护位元码具有P个位元,该装置包含:14. A device for decrypting an encrypted program, the encrypted program is encrypted by inserting a protection bit code into the original program, the encrypted program has a plurality of instructions, each instruction has 1 bit, and each protection bit The code has P bits, which means contains: 一第二保护位元码位置产生装置,其依据执行该程序时处理器状态以产生该复数个保护位元码的插入位置,其中该第二保护位元码位置产生装置包含:A second protection bit code position generation device, which generates the insertion positions of the plurality of protection bit codes according to the state of the processor when executing the program, wherein the second protection bit code position generation device includes: 一位置状态暂存器,用以指示该处理器存取资料区段或是存取程序区段;a location status register, used to instruct the processor to access data segments or access program segments; 一程序状态暂存器,用以指示该处理器所处的状态;a program status register, used to indicate the status of the processor; 复数个插入位置产生装置,依据其预定的功能以产生插入位置;以及a plurality of insertion position generating devices to generate insertion positions according to their predetermined functions; and 一多工器,其具有复数个输入端,以耦合至该复数个插入位置产生装置的输出端,并依据该位置状态暂存器及该程序状态暂存器,由复数个输入端中选择一插入位置以做为输出;以及A multiplexer, which has a plurality of input terminals to be coupled to the output terminals of the plurality of insertion position generating devices, and selects one of the plurality of input terminals according to the position state register and the program state register insert position as output; and 一保护位元码去除装置,输入该程序,并依据该第二保护位元码位置产生装置所产生的插入位置N,以将该程序对应指令的第N位元去除。A protection bit code removal device inputs the program, and removes the Nth bit of the corresponding instruction of the program according to the insertion position N generated by the second protection bit code position generation device. 15.如权利要求14所述的对一加密程序进行解密的装置,其特征在于,其中该复数个插入位置产生装置可为一空装置,以表示无该插入位置。15. The device for decrypting an encrypted program as claimed in claim 14, wherein the plurality of inserting position generating means can be a null device to indicate that there is no inserting position. 16.如权利要求14所述的对一加密程序进行解密的装置,其特征在于,其中该复数个插入位置产生装置可将一给定值经由函数运算以产生该插入位置。16 . The device for decrypting an encrypted program as claimed in claim 14 , wherein the plurality of insertion position generators can generate the insertion position by performing a function operation on a given value. 17.如权利要求14所述的对一加密程序进行解密的装置,其特征在于,其中该复数个插入位置产生装置可将一第一给定值减去经由函数运算的一第二给定值,以产生该插入位置。17. The device for decrypting an encrypted program as claimed in claim 14, wherein the plurality of insertion position generators can subtract a first given value from a second given value through function operation , to generate the insertion position. 18.如权利要求14所述的对一加密程序进行解密的装置,其特征在于,其中该复数个插入位置产生装置可将一第一给定值与该处理器的部分位址值结合后,再经由函数运算,以产生该插入位置。18. The device for decrypting an encrypted program as claimed in claim 14, wherein the plurality of insertion position generating devices can combine a first given value with a partial address value of the processor, The insertion position is then generated through function operation. 19.如权利要求14所述的对一加密程序进行解密的装置,其特征在于,其中该复数个插入位置产生装置可将该位置状态暂存器与该程序状态暂存器结合后,以产生该插入位置。19. The device for decrypting an encrypted program as claimed in claim 14, wherein the plurality of insertion position generating devices can combine the position status register with the program status register to generate The insertion position. 20.如权利要求14所述的对一加密程序进行解密的装置,其特征在于,其中该复数个插入位置产生装置可将该位置状态暂存器与该程序状态暂存器结合后,再经由函数运算,以产生该插入位置。20. The device for decrypting an encrypted program as claimed in claim 14, wherein the plurality of insertion position generating devices can combine the position state register with the program state register, and then pass Function operation to produce the insertion position. 21.如权利要求14所述的对一加密程序进行解密的装置,其特征在于,其中I+P=32。21. The device for decrypting an encrypted program as claimed in claim 14, wherein I+P=32. 22.如权利要求14所述的对一加密程序进行解密的装置,其特征在于,其中I=32。22. The device for decrypting an encrypted program as claimed in claim 14, wherein I=32. 23.一种对一加密程序进行解密的装置,该加密程序将两组保护位元码插置于原始程序中而加密,该加密程序具有复数指令,其中一个字组可包含二个加密指令,该装置包含:23. A device for decrypting an encrypted program. The encrypted program encrypts two sets of protection bit codes by inserting them into the original program. The encrypted program has multiple instructions, wherein one block can contain two encrypted instructions, The unit contains: 一第三保护位元码位置产生装置,其依据执行该程序时处理器状态以产生该复数个保护位元码的第三插入位置,其中该第三保护位元码位置产生装置包含:A third protected bit code position generating device, which generates the third insertion position of the plurality of protected bit codes according to the state of the processor when executing the program, wherein the third protected bit code position generating device includes: 一位置状态暂存器,用以指示该处理器存取资料区段或是存取程序区段;a location status register, used to instruct the processor to access data segments or access program segments; 一程序状态暂存器,用以指示该处理器所处的状态;a program status register, used to indicate the status of the processor; 复数个插入位置产生装置,依据其预定的功能以产生插入位置;以及a plurality of insertion position generating devices to generate insertion positions according to their predetermined functions; and 一多工器,其具有复数个输入端,以耦合至该复数个插入位置产生装置的输出端,并依据该位置状态暂存器及该程序状态暂存器,由复数个输入端中选择一插入位置以做为输出;A multiplexer, which has a plurality of input terminals to be coupled to the output terminals of the plurality of insertion position generating devices, and selects one of the plurality of input terminals according to the position state register and the program state register insert position as output; 一第四保护位元码位置产生装置,其依据执行该程序时处理器状态以产生该复数个保护位元码的第四插入位置,其中该第四保护位元码位置产生装置包含:A fourth protection bit code position generation device, which generates the fourth insertion position of the plurality of protection bit codes according to the state of the processor when executing the program, wherein the fourth protection bit code position generation device includes: 一位置状态暂存器,用以指示该处理器存取资料区段或是存取程序区段;a location status register, used to instruct the processor to access data segments or access program segments; 一程序状态暂存器,用以指示该处理器所处的状态;a program status register, used to indicate the status of the processor; 复数个插入位置产生装置,依据其预定的功能以产生插入位置;以及a plurality of insertion position generating devices to generate insertion positions according to their predetermined functions; and 一多工器,其具有复数个输入端,以耦合至该复数个插入位置产生装置的输出端,并依据该位置状态暂存器及该程序状态暂存器,由复数个输入端中选择一插入位置以做为输出;以及A multiplexer, which has a plurality of input terminals to be coupled to the output terminals of the plurality of insertion position generating devices, and selects one of the plurality of input terminals according to the position state register and the program state register insert position as output; and 一第三保护位元码去除装置,输入该加密程序的低半字组,并依据该第三保护位元码位置产生装置所产生的该第三插入位置N1,以将该程序对应指令的第0位元至K-1位元的第N1位元去除;以及A third protection bit code removing device, input the low half word group of the encryption program, and according to the third insertion position N1 generated by the third protection bit code position generating device, to correspond the program to the first bit of the instruction the removal of the N1-th bit from bit 0 to bit K-1; and 一第四保护位元码去除装置,输入该加密程序的高半字组,并依据该第四保护位元码位置产生装置所产生的第四插入位置N2,以将该程序对应指令的第K位元至2K-1位元的第N2位元去除。A fourth protection bit code removal device, input the upper half word group of the encrypted program, and according to the fourth insertion position N2 produced by the fourth protection bit code position generating device, to correspond the program to the Kth instruction The N2th bit of bits to 2K-1 bits is removed. 24.如权利要求23所述的对一加密程序进行解密的装置,其特征在于,其中K=16。24. The device for decrypting an encrypted program according to claim 23, wherein K=16. 25.一种以保护位元码对一程序进行加密保护的方法,该程序具有复数个指令,每一指令具有I位元,该I为正整数,该方法包含下列步骤:25. A method for encrypting and protecting a program with a protection bit code, the program has a plurality of instructions, each instruction has I bits, and the I is a positive integer, the method comprises the following steps: 一保护位元码产生步骤,依据该程序复数个指令以产生对应的复数个保护位元码,每一保护位元码具有P个位元,该P为正整数;A protection bit code generating step, generating a plurality of corresponding protection bit codes according to the plurality of instructions of the program, each protection bit code has P bits, and the P is a positive integer; 一第一保护位元码位置产生步骤,其依据执行该程序时处理器状态以产生每一保护位元码的插入位置N,该N为正整数,其中一位置状态旗标用以指示该处理器存取资料区段或是存取程序区段,一程序状态旗标用以指示该处理器所处的状态,该第一保护位元码位置产生步骤还包含下列步骤:A first protection bit code position generating step, which generates the insertion position N of each protection bit code according to the state of the processor when executing the program, where N is a positive integer, wherein a position status flag is used to indicate the processing The device accesses the data segment or accesses the program segment, and a program status flag is used to indicate the status of the processor. The step of generating the first protection bit code position also includes the following steps: 复数个插入位置产生步骤,依据其预定的功能以产生插入位置;以及a plurality of insertion position generating steps to generate insertion positions according to their predetermined functions; and 一多工步骤,依据该位置状态旗标及该程序状态旗标,由复数个插入位置产生步骤的输出,选择一插入位置以做为输出;以及a multiplexing step, according to the position state flag and the program state flag, the output of the step is generated from a plurality of insertion positions, and an insertion position is selected as the output; and 一保护位元码插入步骤,依据该第一保护位元码位置产生步骤所产生的插入位置N,分别将每一保护位元码插入该程序对应指令的第N-1位元与第N位元之中,以产生一加密程序。A protection bit code insertion step, according to the insertion position N generated by the first protection bit code position generation step, respectively inserting each protection bit code into the N-1th bit and the Nth bit of the corresponding instruction of the program Among the elements, an encryption program is generated. 26.如权利要求25所述的以保护位元码对一程序进行加密保护的方法,其特征在于,其还包含下列步骤:26. The method for encrypting and protecting a program with a protection bit code as claimed in claim 25, further comprising the following steps: 一第二保护位元码位置产生步骤,其依据执行该程序时处理器状态以产生每一保护位元码的插入位置N,其中一位置状态旗标用以指示该处理器存取资料区段或是存取程序区段,一程序状态旗标用以指示该处理器所处的状态,该第二保护位元码位置产生步骤还包含下列步骤:A second protection bit code position generation step, which generates the insertion position N of each protection bit code according to the state of the processor when executing the program, wherein a position status flag is used to indicate that the processor accesses the data segment Or for accessing the program segment, a program state flag is used to indicate the state of the processor, and the step of generating the second protection bit code position also includes the following steps: 复数个插入位置产生步骤,依据其预定的功能以产生插入位置;以及a plurality of insertion position generating steps to generate insertion positions according to their predetermined functions; and 一多工步骤,依据该位置状态旗标及该程序状态旗标,由复数个插入位置产生步骤的输出,选择一插入位置以做为输出;以及a multiplexing step, according to the position state flag and the program state flag, the output of the step is generated from a plurality of insertion positions, and an insertion position is selected as the output; and 一保护位元码去除步骤,输入该程序,并依据该第二保护位元码位置产生步骤所产生的插入位置N,以将该程序对应指令的第N位元去除。A protection bit code removal step, inputting the program, and removing the Nth bit of the corresponding instruction of the program according to the insertion position N generated by the second protection bit code position generation step. 27.如权利要求26所述的以保护位元码对一程序进行加密保护的方法,其特征在于,其中该第一保护位元码位置产生步骤的复数个插入位置产生步骤及该第二保护位元码位置产生步骤的复数个插入位置产生步骤可为一空步骤,以表示无前述插入位置。27. The method for encrypting and protecting a program with a protection bit code as claimed in claim 26, wherein the plurality of insertion position generation steps of the first protection bit code position generation step and the second protection The plurality of insertion position generation steps of the bit code position generation step may be an empty step to indicate that there is no aforementioned insertion position. 28.如权利要求26所述的以保护位元码对一程序进行加密保护的方法,其特征在于,其中该第一保护位元码位置产生步骤的复数个插入位置产生步骤及该第二保护位元码位置产生步骤的复数个插入位置产生步骤可将一给定值经由函数运算以产生该插入位置。28. The method for encrypting and protecting a program with a protection bit code as claimed in claim 26, wherein the plurality of insertion position generation steps of the first protection bit code position generation step and the second protection The plurality of insertion position generation steps of the bit code position generation step can generate the insertion position by performing a function operation on a given value. 29.如权利要求26所述的以保护位元码对一程序进行加密保护的方法,其特征在于,其中该第一保护位元码位置产生步骤的复数个插入位置产生步骤及该第二保护位元码位置产生步骤的复数个插入位置产生步骤可将一第一给定值减去经由函数运算的一第二给定值,以产生该插入位置。29. The method for encrypting and protecting a program with a protection bit code as claimed in claim 26, wherein the plurality of insertion position generation steps of the first protection bit code position generation step and the second protection The plurality of inserting position generating steps of the bit code position generating step can subtract a second given value through function operation from a first given value to generate the inserting position. 30.如权利要求26所述的以保护位元码对一程序进行加密保护的方法,其特征在于,其中该第一保护位元码位置产生步骤的复数个插入位置产生步骤及该第二保护位元码位置产生步骤的复数个插入位置产生步骤可将一第一给定值与该处理器的部分位址值结合后,再经由函数运算,以产生该插入位置。30. The method for encrypting and protecting a program with a protection bit code as claimed in claim 26, wherein the plurality of insertion position generation steps of the first protection bit code position generation step and the second protection The plurality of inserting position generating steps of the bit code position generating step can combine a first given value with a part of the address value of the processor, and then perform function operation to generate the inserting position. 31.如权利要求26所述的以保护位元码对一程序进行加密保护的方法,其特征在于,其中该第一保护位元码位置产生步骤的复数个插入位置产生步骤可将该第一保护位元码位置产生步骤的位置状态旗标与该第一保护位元码位置产生步骤的程序状态旗标结合后,以产生该插入位置,该第二保护位元码位置产生步骤的复数个插入位置产生步骤可将该第二保护位元码位置产生步骤的位置状态旗标与该第二保护位元码位置产生步骤的程序状态旗标结合后,以产生该插入位置。31. The method for encrypting and protecting a program with a protection bit code as claimed in claim 26, wherein the plurality of insertion position generation steps of the first protection bit code position generation step can use the first After the position status flag of the protection bit code position generation step is combined with the program status flag of the first protection bit code position generation step to generate the insertion position, the plurality of the second protection bit code position generation steps The insertion position generating step can combine the position status flag of the second protection bit code position generation step with the program status flag of the second protection bit code position generation step to generate the insertion position. 32.如权利要求26所述的以保护位元码对一程序进行加密保护的方法,其特征在于,其中该第一保护位元码位置产生步骤的复数个插入位置产生步骤可将该第一保护位元码位置产生步骤的位置状态旗标与该第一保护位元码位置产生步骤的程序状态旗标结合后,再经由函数运算,以产生该插入位置,该第二保护位元码位置产生步骤的复数个插入位置产生步骤可将该第二保护位元码位置产生步骤的位置状态旗标与该第二保护位元码位置产生步骤的程序状态旗标结合后,经由函数运算,以产生该插入位置。32. The method for encrypting and protecting a program with a protection bit code as claimed in claim 26, wherein the plurality of insertion position generation steps of the first protection bit code position generation step can use the first After the position status flag of the protection bit code position generation step is combined with the program status flag of the first protection bit code position generation step, the insertion position and the second protection bit code position are generated through function operation. The plurality of insertion position generating steps in the generating step can be combined with the position status flag of the second protected bit code position generating step and the program status flag of the second protected bit code position generating step, through function operation, to Generate the insertion position. 33.如权利要求26所述的以保护位元码对一程序进行加密保护的方法,其特征在于,其中该保护位元码去除步骤还可依据该第二保护位元码位置产生步骤所产生的前述插入位置N,而将该程序对应指令的第N位元移至最高位元处。33. The method for encrypting and protecting a program with a protection bit code as claimed in claim 26, wherein the step of removing the protection bit code can also be generated according to the second position generation step of the protection bit code The aforementioned insertion position N, and the Nth bit of the corresponding instruction of the program is moved to the highest bit. 34.如权利要求26所述的以保护位元码对一程序进行加密保护的方法,其特征在于,其中该保护位元码去除步骤还可依据该第二保护位元码位置产生步骤所产生的前述插入位置N,而将该程序对应指令的第N位元移至最低位元处。34. The method for encrypting and protecting a program with a protection bit code as claimed in claim 26, wherein the step of removing the protection bit code can also be generated according to the second position generation step of the protection bit code The aforementioned insertion position N of the program, and the Nth bit of the corresponding instruction of the program is moved to the lowest bit. 35.如权利要求26所述的以保护位元码对一程序进行加密保护的方法,其特征在于,其中该保护位元码去除步骤还可依据该第二保护位元码位置产生步骤所产生的前述插入位置N,而将该程序对应指令直接输出。35. The method for encrypting and protecting a program with a protection bit code as claimed in claim 26, wherein the step of removing the protection bit code can also be generated according to the second position generation step of the protection bit code The aforementioned insertion position N, and the corresponding instructions of the program are directly output. 36.如权利要求26所述的以保护位元码对一程序进行加密保护的方法,其特征在于,其中I+P=32。36. The method for encrypting and protecting a program with a protection bit code as claimed in claim 26, wherein I+P=32. 37.如权利要求26所述的以保护位元码对一程序进行加密保护的方法,其特征在于,其中I=32。37. The method for encrypting and protecting a program with a protection bit code as claimed in claim 26, wherein I=32. 38.一种对一加密程序进行解密的方法,该加密程序将保护位元码插置于原始程序中而加密,该加密程序具有复数指令,每一指令具有I位元,每一保护位元码具有P个位元,该方法包含下列步骤:38. A method of decrypting an encrypted program encrypted by inserting a protection bit code into an original program, the encrypted program having a plurality of instructions, each instruction having 1 bit, each protection bit The code has P bits, and the method comprises the following steps: 一第二保护位元码位置产生步骤,其依据执行该程序时处理器状态以产生该复数个保护位元码的插入位置,其中,一位置状态旗标用以指示该处理器存取资料区段或是存取程序区段,一程序状态旗标用以指示该处理器所处的状态,该第二保护位元码位置产生步骤还包含下列步骤:A second protection bit code position generation step, which generates the insertion positions of the plurality of protection bit codes according to the state of the processor when executing the program, wherein a position status flag is used to indicate that the processor accesses the data area A segment or an access program segment, a program state flag is used to indicate the state of the processor, and the step of generating the second protection bit code position also includes the following steps: 复数个插入位置产生步骤,依据其预定的功能以产生插入位置;以及a plurality of insertion position generating steps to generate insertion positions according to their predetermined functions; and 一多工步骤,依据该位置状态旗标及该程序状态旗标,由复数个插入位置产生步骤的输出,选择一插入位置以做为输出;以及a multiplexing step, according to the position state flag and the program state flag, the output of the step is generated from a plurality of insertion positions, and an insertion position is selected as the output; and 一保护位元码去除步骤,输入该程序,并依据该第二保护位元码位置产生步骤所产生的插入位置N,以将该程序对应指令的第N位元去除。A protection bit code removal step, inputting the program, and removing the Nth bit of the corresponding instruction of the program according to the insertion position N generated by the second protection bit code position generation step. 39.如权利要求38所述的对一加密程序进行解密的方法,其特征在于,其中该复数个插入位置产生步骤可为一空步骤,以表示无前述插入位置。39. The method for decrypting an encrypted program as claimed in claim 38, wherein the step of generating the plurality of inserting positions can be an empty step to indicate that there is no aforementioned inserting position. 40.如权利要求38所述的对一加密程序进行解密的方法,其特征在于,其中该复数个插入位置产生步骤可将一给定值经由函数运算以产生该插入位置。40. The method for decrypting an encrypted program as claimed in claim 38, wherein the step of generating the plurality of insertion positions can generate the insertion positions by performing a function operation on a given value. 41.如权利要求38所述的对一加密程序进行解密的方法,其特征在于,其中该复数个插入位置产生步骤可将一第一给定值减去经由函数运算的一第二给定值,以产生该插入位置。41. The method for decrypting an encrypted program as claimed in claim 38, wherein the plurality of insertion position generation steps can be a first given value minus a second given value via function operation , to generate the insertion position. 42.如权利要求38所述的对一加密程序进行解密的方法,其特征在于,其中,该复数个插入位置产生步骤可将一第一给定值与该处理器的部分位址值结合后,再经由函数运算,以产生该插入位置。42. The method for decrypting an encrypted program as claimed in claim 38, wherein the step of generating the plurality of insertion positions can combine a first given value with a partial address value of the processor , and then through function operations to generate the insertion position. 43.如权利要求38所述的对一加密程序进行解密的方法,其特征在于,其中该复数个插入位置产生步骤可将该位置状态旗标与该程序状态旗标结合后,以产生该插入位置。43. The method for decrypting an encrypted program as claimed in claim 38, wherein the plurality of insertion position generation steps can combine the position state flag with the program state flag to generate the insertion position Location. 44.如权利要求38所述的对一加密程序进行解密的方法,其特征在于,其中该复数个插入位置产生步骤可将该位置状态旗标与该程序状态旗标结合后,再经由函数运算,以产生该插入位置。44. The method for decrypting an encrypted program as claimed in claim 38, wherein the step of generating the plurality of insertion positions can combine the position state flag with the program state flag, and then perform a function operation , to generate the insertion position. 45.如权利要求38所述的对一加密程序进行解密的方法,其特征在于,其中I+P=32。45. The method for decrypting an encrypted program as claimed in claim 38, wherein I+P=32. 46.如权利要求38所述的对一加密程序进行解密的方法,其特征在于,其中I=32。46. The method for decrypting an encrypted program as claimed in claim 38, wherein I=32. 47.一种对一加密程序进行解密的方法,该加密程序将两组保护位元码插置于原始程序中而加密,该加密程序具有复数的指令,其中一个字组可包含二个加密指令,该方法包含下列步骤:47. A method for decrypting an encrypted program. The encrypted program is encrypted by inserting two sets of protection bit codes into the original program. The encrypted program has a plurality of instructions, wherein one block can contain two encrypted instructions , the method includes the following steps: 一第三保护位元码位置产生步骤,其依据执行该程序时处理器状态以产生该复数个保护位元码的第三插入位置,其中,一位置状态旗标用以指示该处理器存取资料区段或是存取程序区段,一程序状态旗标用以指示该处理器所处的状态,该第三保护位元码位置产生步骤还包含下列步骤:A third protection bit code position generation step, which generates the third insertion position of the plurality of protection bit codes according to the state of the processor when executing the program, wherein a position status flag is used to indicate the processor access In the data segment or the access program segment, a program status flag is used to indicate the status of the processor, and the step of generating the third protection bit code position also includes the following steps: 复数个插入位置产生步骤,依据其预定的功能以产生插入位置;以及a plurality of insertion position generating steps to generate insertion positions according to their predetermined functions; and 一多工步骤,依据该位置状态旗标及该程序状态旗标,由复数个插入位置产生步骤的输出,选择一插入位置以做为输出;A multiplexing step, according to the position state flag and the program state flag, the output of the step is generated from a plurality of insertion positions, and an insertion position is selected as the output; 一第四保护位元码位置产生步骤,其依据执行该程序时处理器状态以产生该复数个保护位元码的第四插入位置,其中,一位置状态旗标用以指示该处理器存取资料区段或是存取程序区段,一程序状态旗标用以指示该处理器所处的状态,该第四保护位元码位置产生步骤还包含下列步骤:A fourth protection bit code position generation step, which generates the fourth insertion position of the plurality of protection bit codes according to the state of the processor when executing the program, wherein a position status flag is used to indicate the processor access In the data section or the access program section, a program state flag is used to indicate the state of the processor, and the step of generating the fourth protection bit code position also includes the following steps: 复数个插入位置产生步骤,依据其预定的功能以产生插入位置;以及a plurality of insertion position generating steps to generate insertion positions according to their predetermined functions; and 一多工步骤,依据该位置状态旗标及该程序状态旗标,由复数个插入位置产生步骤的输出,选择一插入位置以做为输出;以及a multiplexing step, according to the position state flag and the program state flag, the output of the step is generated from a plurality of insertion positions, and an insertion position is selected as the output; and 一第三保护位元码去除步骤,输入该加密程序的低半字组,并依据该第三保护位元码位置产生步骤所产生的第三插入位置N1,以将该程序对应指令的第0位元至K-1位元的第N1位元去除;以及A third protection bit code removal step, inputting the low half word group of the encryption program, and according to the third insertion position N1 generated by the third protection bit code position generation step, to correspond the program to the 0th of the instruction N1 bit removal of bits to K-1 bits; and 一第四保护位元码去除步骤,输入该加密程序的高半字组,并依据该第四保护位元码位置产生步骤所产生的第四插入位置N2,以将该程序对应指令的第K位元至2K-1位元的笫N2位元去除。A fourth protection bit code removal step, inputting the upper half word group of the encryption program, and according to the fourth insertion position N2 produced by the fourth protection bit code position generation step, to correspond the program to the Kth instruction Bits N2 to 2K-1 bits are removed. 48.如权利要求47所述的对一加密程序进行解密的方法,其特征在于,其中K=16。48. The method for decrypting an encrypted program as claimed in claim 47, wherein K=16.
CNB2004100018213A 2004-01-14 2004-01-14 A device for encrypting and protecting a program with a protection bit code Expired - Fee Related CN100353274C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2004100018213A CN100353274C (en) 2004-01-14 2004-01-14 A device for encrypting and protecting a program with a protection bit code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2004100018213A CN100353274C (en) 2004-01-14 2004-01-14 A device for encrypting and protecting a program with a protection bit code

Publications (2)

Publication Number Publication Date
CN1641514A CN1641514A (en) 2005-07-20
CN100353274C true CN100353274C (en) 2007-12-05

Family

ID=34867207

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2004100018213A Expired - Fee Related CN100353274C (en) 2004-01-14 2004-01-14 A device for encrypting and protecting a program with a protection bit code

Country Status (1)

Country Link
CN (1) CN100353274C (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5515307A (en) * 1994-08-04 1996-05-07 Bell Communications Research, Inc. Pseudo-random generator
CN1180466A (en) * 1996-03-04 1998-04-29 诺基亚电信公司 Improving security of packet-mode transmission in mobile communication system
CN1216653A (en) * 1996-03-18 1999-05-12 株式会社东芝 encoding device and decoding device
US6104811A (en) * 1996-08-16 2000-08-15 Telcordia Technologies, Inc. Cryptographically secure pseudo-random bit generator for fast and secure encryption

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5515307A (en) * 1994-08-04 1996-05-07 Bell Communications Research, Inc. Pseudo-random generator
CN1180466A (en) * 1996-03-04 1998-04-29 诺基亚电信公司 Improving security of packet-mode transmission in mobile communication system
CN1216653A (en) * 1996-03-18 1999-05-12 株式会社东芝 encoding device and decoding device
US6104811A (en) * 1996-08-16 2000-08-15 Telcordia Technologies, Inc. Cryptographically secure pseudo-random bit generator for fast and secure encryption

Also Published As

Publication number Publication date
CN1641514A (en) 2005-07-20

Similar Documents

Publication Publication Date Title
US20070101158A1 (en) Security region in a non-volatile memory
CN102163268B (en) The term of execution verifying software code the method and apparatus of integrality
EP4116830A1 (en) Memory integrity
KR101216995B1 (en) A code encryption and decryption device against reverse engineering based on indexed table and the method thereof
WO2017112282A1 (en) Memory integrity with error detection and correction
JP2008530663A (en) Microprocessor data security method and system
CN111008407B (en) Cryptographic circuitry for performing virtual cryptographic operations
US10797857B2 (en) Data interleaving scheme for an external memory of a secure microcontroller
CN112069551A (en) Electronic circuit
JP2023130311A (en) Method for protecting electronic computer against side-channel attacks, and electronic computer
CN1307563C (en) Encryption device, encryption system, decryption device and a semiconductor system
CN102306253B (en) Microprocessor, security method and method for revoking first password
TWI249666B (en) Device using parity check bit to carry out data encryption protection and method thereof
CN100353274C (en) A device for encrypting and protecting a program with a protection bit code
TWI221966B (en) Device for encrypting/protecting program with protection bit codes
Zeh et al. RISC-V cryptographic extension proposals volume I: Scalar & entropy source instructions
KR20180059217A (en) Apparatus and method for secure processing of memory data
AU2021100948A4 (en) Enhancing cyber security using high speed hybrid authentication technique
EP3907633B1 (en) System and method for obfuscating opcode commands in a semiconductor device
CN111291389B (en) Method and system for protecting full life cycle of computer core program
CN114237492A (en) Non-volatile memory protection method and device
US11651086B2 (en) Method for executing a computer program by means of an electronic apparatus
JP2008135893A (en) Encryption device and program for creating encrypted document attached with disposable encryption key
US12088722B2 (en) Method for executing a computer program by means of an electronic apparatus
CN119989430B (en) An encryption and decryption circuit system and method based on RISC-V architecture

Legal Events

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

Granted publication date: 20071205

Termination date: 20150114

EXPY Termination of patent right or utility model