[go: up one dir, main page]

CN100591007C - Encryption and decryption method - Google Patents

Encryption and decryption method Download PDF

Info

Publication number
CN100591007C
CN100591007C CN200710184824A CN200710184824A CN100591007C CN 100591007 C CN100591007 C CN 100591007C CN 200710184824 A CN200710184824 A CN 200710184824A CN 200710184824 A CN200710184824 A CN 200710184824A CN 100591007 C CN100591007 C CN 100591007C
Authority
CN
China
Prior art keywords
data
data block
encryption
block
decryption
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.)
Active
Application number
CN200710184824A
Other languages
Chinese (zh)
Other versions
CN101159548A (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.)
Via Technologies Inc
Original Assignee
Via Technologies Inc
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 Via Technologies Inc filed Critical Via Technologies Inc
Priority to CN200710184824A priority Critical patent/CN100591007C/en
Publication of CN101159548A publication Critical patent/CN101159548A/en
Application granted granted Critical
Publication of CN100591007C publication Critical patent/CN100591007C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Storage Device Security (AREA)

Abstract

An encryption method. First, a plurality of soldier blocks are selected from a plurality of data blocks constituting data. A plurality of data blocks are selected from the remaining data blocks. And then, encrypting a first data block in the selected data blocks according to at least one of the soldier blocks to obtain a first ciphertext, and encrypting a second data block in the selected data blocks according to at least one of the soldier blocks to obtain a second ciphertext. The generated ciphertext may be used as a pioneer block in an encryption process for a subsequent data block.

Description

加密与解密方法 Encryption and Decryption Methods

技术领域 technical field

本发明是有关于一种加密与解密方法,且特别有关于一种利用数据自身内容进行加密与解密的方法。The present invention relates to an encryption and decryption method, and in particular to a method for encrypting and decrypting by utilizing the content of data itself.

背景技术 Background technique

在密码学中,大部分都是采用对称(Symmetric)或非对称(Asymmetric)加/解密的机制。举例来说,对称加/解密算法包括RC4、DES与AES算法。在对称加/解密算法中,加密数据与解密数据时是使用同一个金钥(Key)。非对称加/解密算法包括RSA算法。在非对称加/解密算法中,加密数据与解密数据时是使用不同的金钥(公钥与私钥)。对于对称与非对称加/解密算法而言,如何传递金钥将形成安全上的重要考虑。非对称加/解密算法虽然可以比对称加/解密算法拥有较佳的安全性,然而,其相对的复杂度也提升。In cryptography, most of them adopt symmetric (Symmetric) or asymmetric (Asymmetric) encryption/decryption mechanism. For example, symmetric encryption/decryption algorithms include RC4, DES and AES algorithms. In the symmetric encryption/decryption algorithm, the same key (Key) is used when encrypting data and decrypting data. Asymmetric encryption/decryption algorithms include the RSA algorithm. In the asymmetric encryption/decryption algorithm, different keys (public key and private key) are used to encrypt data and decrypt data. For symmetric and asymmetric encryption/decryption algorithms, how to transfer the key will form an important security consideration. Although the asymmetric encryption/decryption algorithm has better security than the symmetric encryption/decryption algorithm, its relative complexity is also increased.

在一些加/解密算法,如替换(Substitution)加/解密算法中,加密数据与解密数据时可以不使用金钥。图1显示一替换加/解密算法的示意图。如图1所示,在依据加/解密算法产生的密文中,一个字母将会被另外一个字母替换。举例来说,A被V替换、B被G替换、C被S替换、D被Q替换等等。对于替换加/解密算法而言,密文非常容易通过频繁地分析而破解,其具有较低的安全性。In some encryption/decryption algorithms, such as the substitution (Substitution) encryption/decryption algorithm, a key may not be used when encrypting data and decrypting data. Figure 1 shows a schematic diagram of an alternative encryption/decryption algorithm. As shown in Figure 1, in the ciphertext generated according to the encryption/decryption algorithm, one letter will be replaced by another letter. For example, A is replaced by V, B by G, C by S, D by Q, etc. For alternative encryption/decryption algorithms, the ciphertext is very easy to break through frequent analysis, which has low security.

发明内容 Contents of the invention

有鉴于此,本发明提供加密与解密方法。In view of this, the present invention provides encryption and decryption methods.

本发明实施例的加密方法。首先,分割数据以产生多个数据区块。于组成数据的多个数据区块中选择多个第一数据区块。由剩余的数据区块中选择第二数据区块。之后,由第一数据区块中选择至少一者。依据选定的第一数据区块对于第二数据区块进行加密,从而得到第一密文。The encryption method of the embodiment of the present invention. First, divide the data to generate multiple data blocks. A plurality of first data blocks are selected among the plurality of data blocks constituting the data. A second data block is selected from the remaining data blocks. Afterwards, at least one of the first data blocks is selected. Encrypt the second data block according to the selected first data block, so as to obtain the first ciphertext.

本发明实施例的解密方法。首先,于组成数据的多个数据区块中选择第一数据区块。由剩余的数据区块中选择第二数据区块。之后,依据第一数据区块对于第二数据区块进行解密,从而得到第一平文。The decryption method of the embodiment of the present invention. Firstly, the first data block is selected from the plurality of data blocks constituting the data. A second data block is selected from the remaining data blocks. Afterwards, the second data block is decrypted according to the first data block, so as to obtain the first plaintext.

在一些实施例中,产生的密文可以在后续数据区块的加密程序中作为尖兵区块。In some embodiments, the generated ciphertext can be used as a spearhead block in the encryption procedure of subsequent data blocks.

本发明上述方法可以通过程序码方式收录于物理媒体中。当程序码被机器加载且执行时,机器变成用以实行本发明的装置。The above-mentioned method of the present invention can be recorded in a physical medium by way of program code. When the program code is loaded and executed by the machine, the machine becomes a device for implementing the present invention.

为使本发明的上述目的、特征和优点能更明显易懂,下文特举实施例,并配合所附图示,详细说明如下。In order to make the above-mentioned objects, features and advantages of the present invention more comprehensible, the following specific examples will be described in detail with reference to the accompanying drawings.

附图说明 Description of drawings

图1为一示意图是显示一替换加/解密算法。FIG. 1 is a schematic diagram showing an alternative encryption/decryption algorithm.

图2为一流程图是显示依据本发明实施例的加密方法。FIG. 2 is a flowchart showing an encryption method according to an embodiment of the present invention.

图3为一流程图是显示依据本发明实施例的解密方法。FIG. 3 is a flowchart showing a decryption method according to an embodiment of the present invention.

图4A显示当尖兵区块的数目为1且数据区块的加密是对于数据区块进行XOR运算的加密例子。FIG. 4A shows an example of encryption where the number of spike blocks is 1 and the encryption of the data block is an XOR operation performed on the data block.

图4B显示图4A中尖兵区块的数目为1且数据区块的加密是对于数据区块进行XOR运算的密文的解密例子。FIG. 4B shows an example of decryption of the ciphertext in which the number of the pioneer block in FIG. 4A is 1 and the encryption of the data block is an XOR operation performed on the data block.

图5A显示当尖兵区块的数目为2且数据区块的加密是对于数据区块进行XOR运算的加密例子。FIG. 5A shows an example of encryption where the number of vanguard blocks is 2 and the encryption of the data block is an XOR operation performed on the data block.

图5B显示图5A中尖兵区块的数目为2且数据区块的加密是对于数据区块进行XOR运算的密文的解密例子。FIG. 5B shows an example of decryption of the ciphertext in which the number of pioneer blocks in FIG. 5A is 2 and the encryption of the data block is an XOR operation performed on the data block.

[主要元件标号说明][Description of main component labels]

S210、S220、...、S280~操作步骤;S210, S220, ..., S280~operation steps;

S310、S320、...、S380~操作步骤。S310, S320, ..., S380~operation steps.

具体实施方式 Detailed ways

图2显示依据本发明实施例的加密方法。在此实施例中,数据可以依据自身内容进行加密。Fig. 2 shows an encryption method according to an embodiment of the present invention. In this embodiment, the data can be encrypted according to its content.

如步骤S210,将数据分割为多个数据区块。值得注意的是,每一数据区块可以具有相同的长度,如1位(Bit)、1字节(Byte)、或其它尺寸。在一些实施例中,每一数据区块亦可以具有不相同的长度。如步骤S220,由数据区块中选择一个或是多个数据区块,以作为尖兵(Sentry)区块。注意的是,尖兵区块是用以当作其它数据区块进行加密时的金钥。在一些实施例中,尖兵区块可以与原始的数据区块相同,或是将原始的数据区块事先进行处理。举例来说,对于数据区块进行逻辑运算,如XOR、AND、OR、及NOT等,或是依据加/解密算法,如替换加/解密算法、对称加/解密算法、或非对称加/解密算法加密数据区块。In step S210, the data is divided into multiple data blocks. It should be noted that each data block can have the same length, such as 1 bit (Bit), 1 byte (Byte), or other sizes. In some embodiments, each data block may also have a different length. In step S220, one or more data blocks are selected from the data blocks as Sentry blocks. Note that the vanguard block is used as a key for encryption of other data blocks. In some embodiments, the vanguard block may be the same as the original data block, or the original data block may be processed in advance. For example, perform logical operations on data blocks, such as XOR, AND, OR, and NOT, or based on encryption/decryption algorithms, such as replacement encryption/decryption algorithms, symmetric encryption/decryption algorithms, or asymmetric encryption/decryption algorithms Algorithms encrypt data blocks.

如步骤S230,由剩余的数据区块中选择至少一数据区块。如步骤S240,由尖兵区块中选择至少一者,且如步骤S250,依据选定的尖兵区块对于选定的数据区块进行加密,从而得到密文。值得注意的是,将数据区块进行加密可以依据尖兵区块对于数据区块进行逻辑运算,或是依据加/解密算法,如替换加/解密算法、对称加/解密算法、或非对称加/解密算法加密数据区块。In step S230, at least one data block is selected from the remaining data blocks. In step S240, at least one of the pioneer blocks is selected, and in step S250, the selected data block is encrypted according to the selected pioneer block, so as to obtain ciphertext. It is worth noting that the encryption of the data block can be based on the logical operation of the data block based on the pioneer block, or based on the encryption/decryption algorithm, such as the replacement encryption/decryption algorithm, the symmetric encryption/decryption algorithm, or the asymmetric encryption/decryption algorithm. The decryption algorithm encrypts the data block.

如步骤S260,判断相应数据的加密作业是否结束。必须注意的是,在一些实施例中,当所有数据的数据区块都被选择过之后,则相应数据的加密作业结束。在一些实施例中,当数据中既定数目的数据区块被选择过之后,则相应数据的加密作业结束。若相应数据的加密作业结束(步骤S260的是),结束流程。若相应数据的加密作业尚未结束(步骤S260的否),如步骤S270,判断是否须将步骤S250产生的密文设为尖兵区块。必须说明的是,密文可以选择是否要在后续数据区块的加密程序中作为尖兵区块,以增加加密程序的型态与复杂度。若产生的密文不需设为尖兵区块(步骤S270的否),流程回到步骤S230,重新由尚未选择过的剩余数据区块中选择至少一数据区块,以进行加密程序。若产生的密文需要设为尖兵区块(步骤S270的是),如步骤S280,将密文设为尖兵区块,且流程回到步骤S230,重新由尚未选择过的剩余数据区块中选择至少一数据区块,以进行加密程序。In step S260, it is determined whether the encryption operation of the corresponding data is finished. It should be noted that, in some embodiments, when all the data blocks of the data are selected, the encryption operation of the corresponding data ends. In some embodiments, when a predetermined number of data blocks in the data are selected, the encryption operation of the corresponding data ends. If the encryption operation of the corresponding data is completed (Yes in step S260), the process ends. If the encryption operation of the corresponding data has not been completed (No in step S260), as in step S270, it is judged whether the ciphertext generated in step S250 must be set as a pioneer block. It must be noted that the ciphertext can choose whether to be used as a pioneer block in the encryption program of the subsequent data block, so as to increase the type and complexity of the encryption program. If the generated ciphertext does not need to be set as a pioneer block (No in step S270), the process returns to step S230, and at least one data block is selected again from the remaining data blocks that have not been selected to perform the encryption process. If the generated ciphertext needs to be set as a pioneer block (yes in step S270), as in step S280, the ciphertext is set as a pioneer block, and the process returns to step S230, and is selected from the remaining data blocks that have not yet been selected. At least one data block is used for encryption procedure.

必须提醒的是,在加密程序中尖兵区块的选定及其顺序、数据区块选定的顺序以及相关信息将会被记录,以提供数据解密参用。It must be reminded that in the encryption program, the selection and sequence of the leading block, the sequence of data block selection and related information will be recorded to provide data decryption reference.

图3显示依据本发明实施例的解密方法。在此实施例中,数据可以依据自身内容进行解密。Fig. 3 shows a decryption method according to an embodiment of the present invention. In this embodiment, the data can be decrypted according to its own content.

如步骤S310,将数据分割为多个数据区块。值得注意的是,每一数据区块可以具有相同的长度,如1位、1字节、或其它尺寸。在一些实施例中,每一数据区块亦可以具有不相同的长度。如步骤S320,由数据区块中选择一个或是多个数据区块,以作为尖兵区块。注意的是,尖兵区块是用以当作其它数据区块进行解密时的金钥。在一些实施例中,尖兵区块可以与原始的数据区块相同,或是将原始的数据区块事先进行处理。举例来说,对于数据区块进行逻辑运算,如XOR、AND、OR、及NOT等,或是依据加/解密算法,如替换加/解密算法、对称加/解密算法、或非对称加/解密算法加密数据区块。In step S310, the data is divided into multiple data blocks. It should be noted that each data block can have the same length, such as 1 bit, 1 byte, or other sizes. In some embodiments, each data block may also have a different length. In step S320, one or more data blocks are selected from the data blocks as the vanguard blocks. Note that the vanguard block is used as the key for decrypting other data blocks. In some embodiments, the vanguard block may be the same as the original data block, or the original data block may be processed in advance. For example, perform logical operations on data blocks, such as XOR, AND, OR, and NOT, or based on encryption/decryption algorithms, such as replacement encryption/decryption algorithms, symmetric encryption/decryption algorithms, or asymmetric encryption/decryption algorithms Algorithms encrypt data blocks.

如步骤S330,由剩余的数据区块中选择至少一数据区块。如步骤S340,由尖兵区块中选择至少一者,且如步骤S350,依据选定的尖兵区块对于选定的数据区块进行解密,从而得到一平文。值得注意的是,将数据区块进行解密可以依据尖兵区块对于数据区块进行逻辑运算,或是依据加/解密算法,如替换加/解密算法、对称加/解密算法、或非对称加/解密算法解密数据区块。In step S330, at least one data block is selected from the remaining data blocks. In step S340, at least one of the vanguard blocks is selected, and in step S350, the selected data block is decrypted according to the selected vanguard block, so as to obtain a plaintext. It is worth noting that the decryption of the data block can be based on the logical operation of the data block based on the pioneer block, or based on the encryption/decryption algorithm, such as the replacement encryption/decryption algorithm, the symmetric encryption/decryption algorithm, or the asymmetric encryption/decryption algorithm. The decryption algorithm decrypts the data block.

如步骤S360,判断相应数据的解密作业是否结束。必须注意的是,在一些实施例中,当所有数据的数据区块都被选择过之后,则相应数据的解密作业结束。在一些实施例中,当数据中既定数目的数据区块被选择过之后,则相应数据的解密作业结束。若相应数据的解密作业结束(步骤S360的是),结束流程。若相应数据的解密作业尚未结束(步骤S360的否),如步骤S370,判断是否须将步骤S350产生的平文设为尖兵区块。若产生的平文不需设为尖兵区块(步骤S370的否),流程回到步骤S330,重新由尚未选择过的剩余数据区块中选择至少一数据区块,以进行解密程序。若产生的平文需要设为尖兵区块(步骤S370的是),如步骤S380,将平文设为尖兵区块,且流程回到步骤S330,重新由尚未选择过的剩余数据区块中选择至少一数据区块,以进行解密程序。In step S360, it is determined whether the decryption operation of the corresponding data is finished. It should be noted that, in some embodiments, when all the data blocks of the data are selected, the decryption operation of the corresponding data ends. In some embodiments, when a predetermined number of data blocks in the data are selected, the decryption operation of the corresponding data ends. If the decryption operation of the corresponding data is completed (Yes in step S360), the process ends. If the decryption operation of the corresponding data has not been completed (No in step S360), as in step S370, it is judged whether the plaintext generated in step S350 should be set as a pioneer block. If the generated plaintext does not need to be set as a pioneer block (No in step S370), the process returns to step S330, and at least one data block is selected again from the remaining data blocks that have not been selected to perform the decryption process. If the generated plaintext needs to be set as a pioneer block (yes in step S370), as in step S380, the plaintext is set as a pioneer block, and the process returns to step S330, and at least one is selected from the remaining data blocks that have not yet been selected. Data block for decryption procedure.

接下来,提出例子进行说明。Next, an example is presented for illustration.

图4A显示当尖兵区块的数目为1且数据区块的加密是对于数据区块进行XOR运算的加密例子。如图4A所示,其中平文的数据区块为X1、X2、X3、...、Xn,密文的数据区块为Y1、Y2、Y3、...、Yn。在此例子中,X1被选定为尖兵区块,且尖兵区块与原始数据区块的内容相同,因此Y1=X1。接着,数据区块X2被选择,且依据尖兵区块Y1加密为密文

Figure C20071018482400071
密文Y2被设为尖兵区块。之后,数据区块X3被选择,且依据尖兵区块Y2加密为密文
Figure C20071018482400072
密文Y3被设为尖兵区块。上述程序重复,直至数据区块Xn被选择,且依据尖兵区块Yn-1加密为密文
Figure C20071018482400073
图4B显示图4A中尖兵区块的数目为1且数据区块的加密是对于数据区块进行XOR运算的密文的解密例子。如图4B所示,其中密文的数据区块为Y1、Y2、Y3、...、Yn,平文的数据区块为X1、X2、X3、...、Xn。在此例子中,Y1被选定为尖兵区块,且尖兵区块与原始数据区块的内容相同,因此X1=Y1。接着,数据区块Y2被选择,且依据尖兵区块X1解密为平文
Figure C20071018482400081
平文X2被设为尖兵区块。之后,数据区块Y3被选择,且依据尖兵区块X2解密为平文平文X3被设为尖兵区块。上述程序重复,直至数据区块Yn被选择,且依据尖兵区块Xn-1解密为平文
Figure C20071018482400083
FIG. 4A shows an example of encryption where the number of spike blocks is 1 and the encryption of the data block is an XOR operation performed on the data block. As shown in FIG. 4A , the plaintext data blocks are X1, X2, X3, . . . , Xn, and the ciphertext data blocks are Y1, Y2, Y3, . . . , Yn. In this example, X1 is selected as the vanguard block, and the content of the vanguard block is the same as that of the original data block, so Y1=X1. Next, the data block X2 is selected and encrypted into ciphertext according to the pioneer block Y1
Figure C20071018482400071
The ciphertext Y2 is set as the vanguard block. After that, the data block X3 is selected and encrypted into ciphertext according to the pioneer block Y2
Figure C20071018482400072
Ciphertext Y3 is set as the vanguard block. The above procedure is repeated until the data block Xn is selected and encrypted into ciphertext according to the pioneer block Yn-1
Figure C20071018482400073
FIG. 4B shows an example of decryption of the ciphertext in which the number of the pioneer block in FIG. 4A is 1 and the encryption of the data block is an XOR operation performed on the data block. As shown in FIG. 4B , the data blocks of the ciphertext are Y1, Y2, Y3, . . . , Yn, and the data blocks of the plaintext are X1, X2, X3, . . . , Xn. In this example, Y1 is selected as the vanguard block, and the content of the vanguard block is the same as that of the original data block, so X1=Y1. Next, the data block Y2 is selected and decrypted into plain text according to the pioneer block X1
Figure C20071018482400081
Pingwen X2 is set as the vanguard block. After that, the data block Y3 is selected and decrypted into plaintext according to the pioneer block X2 Pingwen X3 is set as the vanguard block. The above procedure is repeated until the data block Yn is selected and decrypted into plain text according to the pioneer block Xn-1
Figure C20071018482400083

图5A显示当尖兵区块的数目为2且数据区块的加密是对于数据区块进行XOR运算的加密例子。如图5A所示,其中平文的数据区块为X1、X2、X3、...、Xn,密文的数据区块为Y1、Y2、Y3、...、Yn。在此例子中,X1与Xn同时被选为定为尖兵区块,且尖兵区块与原始数据区块的内容相同,因此Y1=X1且Yn=Xn。值得注意的是,相应数据的加密作业可以分别由两端展开。数据区块X2被选择,且依据尖兵区块Y1加密为密文

Figure C20071018482400084
密文Y2被设为尖兵区块。另一方面,数据区块Xn-1被选择,且依据尖兵区块Yn加密为密文
Figure C20071018482400085
密文Yn-1被设为尖兵区块。上述程序重复,直至所有平文数据区块被选择且加密。图5B显示图5A中尖兵区块的数目为2且数据区块的加密是对于数据区块进行XOR运算的密文的解密例子。如图5B所示,其中密文的数据区块为Y1、Y2、Y3、...、Yn,平文的数据区块为X1、X2、X3、...、Xn。在此例子中,Y1与Yn同时被选为定为尖兵区块,且尖兵区块与原始数据区块的内容相同,因此X1=Y1且Xn=Yn。类似地,相应数据的解密作业可以分别由两端展开。数据区块Y2被选择,且依据尖兵区块X1解密为平文平文X2被设为尖兵区块。另一方面,数据区块Yn-1被选择,且依据尖兵区块Xn解密为平文
Figure C20071018482400087
平文Xn-1被设为尖兵区块。上述程序重复,直至所有密文数据区块被选择且解密。FIG. 5A shows an example of encryption where the number of vanguard blocks is 2 and the encryption of the data block is an XOR operation performed on the data block. As shown in FIG. 5A , the plaintext data blocks are X1, X2, X3, . . . , Xn, and the ciphertext data blocks are Y1, Y2, Y3, . . . , Yn. In this example, X1 and Xn are selected as the pioneer block at the same time, and the contents of the pioneer block and the original data block are the same, so Y1=X1 and Yn=Xn. It is worth noting that the encryption operation of the corresponding data can be carried out by both ends. The data block X2 is selected and encrypted into ciphertext according to the pioneer block Y1
Figure C20071018482400084
The ciphertext Y2 is set as the vanguard block. On the other hand, the data block Xn-1 is selected and encrypted into ciphertext according to the pioneer block Yn
Figure C20071018482400085
The ciphertext Yn-1 is set as the vanguard block. The above procedure is repeated until all plaintext data blocks are selected and encrypted. FIG. 5B shows an example of decryption of the ciphertext in which the number of pioneer blocks in FIG. 5A is 2 and the encryption of the data block is an XOR operation performed on the data block. As shown in FIG. 5B , the data blocks of the ciphertext are Y1, Y2, Y3, . . . , Yn, and the data blocks of the plaintext are X1, X2, X3, . . . , Xn. In this example, Y1 and Yn are selected as the pioneer block at the same time, and the contents of the pioneer block and the original data block are the same, so X1=Y1 and Xn=Yn. Similarly, the decryption operation of the corresponding data can be carried out by both ends respectively. The data block Y2 is selected and decrypted into plain text according to the pioneer block X1 Pingwen X2 is set as the vanguard block. On the other hand, the data block Yn-1 is selected and decrypted into plaintext according to the pioneer block Xn
Figure C20071018482400087
Plain text Xn-1 is set as the vanguard block. The above procedure is repeated until all ciphertext data blocks are selected and decrypted.

本发明的方法,或特定型态或其部分,可以以程序码的型态包含于物理媒体,如软盘、光盘片、硬盘、或是任何其它机器可读取(如计算机可读取)储存媒体,其中,当程序码被机器,如计算机加载且执行时,此机器变成用以实现本发明的装置。本发明的方法与装置也可以以程序码型态通过一些传送媒体,如电线或电缆、光纤、或是任何传输型态进行传送,其中,当程序码被机器,如计算机接收、加载且执行时,此机器变成用以实现本发明的装置。当在一般用途处理器实作时,程序码结合处理器提供一操作类似于应用特定逻辑电路的独特装置。The method of the present invention, or a specific form or part thereof, may be contained in a physical medium in the form of program code, such as a floppy disk, an optical disk, a hard disk, or any other machine-readable (such as computer-readable) storage medium , wherein, when the program code is loaded and executed by a machine, such as a computer, the machine becomes a device for implementing the present invention. The method and device of the present invention can also be transmitted in the form of program code through some transmission media, such as wires or cables, optical fibers, or any transmission mode, wherein when the program code is received, loaded and executed by a machine, such as a computer , this machine becomes the apparatus for realizing the present invention. When implemented on a general-purpose processor, the program code combines with the processor to provide a unique device that operates similarly to application-specific logic circuits.

虽然本发明已以较佳实施例揭露如上,然其并非用以限定本发明,任何本领域技术人员,在不脱离本发明的精神和范围内,当可做些许更动与润饰,因此本发明的保护范围当视所附的权利要求范围所界定者为准。Although the present invention has been disclosed above with preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art may make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the present invention The scope of protection shall prevail as defined by the appended claims.

Claims (10)

1.一种加密方法,包括下列步骤:1. An encryption method comprising the following steps: 分割数据以产生多个数据区块;Split data to generate multiple data blocks; 由所述多个数据区块中选择多个第一数据区块;selecting a plurality of first data blocks from the plurality of data blocks; 由剩余的所述多个数据区块中选择第二数据区块;selecting a second data block from the remaining plurality of data blocks; 由所述多个第一数据区块中选择至少一者;以及selecting at least one of the plurality of first data blocks; and 依据选定的该第一数据区块对于该第二数据区块进行加密,从而得到第一密文,Encrypting the second data block according to the selected first data block to obtain a first ciphertext, 在加密程序中第一数据区块的选定及其顺序、数据区块选定的顺序以及相关信息将会被记录,以提供数据解密参用。In the encryption process, the selection and sequence of the first data block, the sequence of data block selection and related information will be recorded to provide data decryption reference. 2.根据权利要求1所述的加密方法,还包括下列步骤:2. The encryption method according to claim 1, further comprising the following steps: 由剩余的所述多个数据区块中选择第三数据区块;以及selecting a third data block from the remaining plurality of data blocks; and 依据该第一密文对于该第三数据区块进行加密,从而得到第二密文。Encrypt the third data block according to the first ciphertext to obtain a second ciphertext. 3.根据权利要求1所述的加密方法,还包括在该第二数据区块加密之前,对于该第一数据区块进行逻辑运算。3. The encryption method according to claim 1, further comprising performing a logical operation on the first data block before encrypting the second data block. 4.根据权利要求1所述的加密方法,还包括在该第二数据区块加密之前,对于该第一数据区块依据加/解密算法加密该第一数据区块。4. The encryption method according to claim 1, further comprising encrypting the first data block according to an encryption/decryption algorithm before encrypting the second data block. 5.根据权利要求1所述的加密方法,其中依据该第一数据区块对于该第二数据区块进行加密是对于该第二数据区块进行逻辑运算。5. The encryption method according to claim 1, wherein encrypting the second data block according to the first data block is performing a logic operation on the second data block. 6.根据权利要求1所述的加密方法,其中依据该第一数据区块对于该第二数据区块进行加密是依据加/解密算法加密该第二数据区块。6. The encryption method according to claim 1, wherein encrypting the second data block according to the first data block is encrypting the second data block according to an encryption/decryption algorithm. 7.一种与权利要求1的加密方法对应的解密方法,包括下列步骤:7. A decryption method corresponding to the encryption method of claim 1, comprising the following steps: 于组成数据的多个数据区块中选择第一数据区块;selecting a first data block among a plurality of data blocks constituting the data; 由剩余的所述多个数据区块中选择第二数据区块;以及selecting a second data block from the remaining plurality of data blocks; and 依据该第一数据区块对于该第二数据区块进行解密,从而得到第一平文。Decrypt the second data block according to the first data block, so as to obtain the first plaintext. 8.根据权利要求7所述的解密方法,还包括下列步骤:8. The decryption method according to claim 7, further comprising the steps of: 由剩余的所述多个数据区块中选择第三数据区块;以及selecting a third data block from the remaining plurality of data blocks; and 依据该第一平文对于该第三数据区块进行解密,从而得到第二平文。Decrypt the third data block according to the first plaintext to obtain a second plaintext. 9.根据权利要求7所述的解密方法,还包括在该第二数据区块解密之前,对于该第一数据区块进行逻辑运算。9. The decryption method according to claim 7, further comprising performing a logical operation on the first data block before decrypting the second data block. 10.根据权利要求7所述的解密方法,还包括在该第二数据区块解密之前,对于该第一数据区块依据加/解密算法解密该第一数据区块。10. The decryption method according to claim 7, further comprising decrypting the first data block according to an encryption/decryption algorithm before decrypting the second data block.
CN200710184824A 2007-10-30 2007-10-30 Encryption and decryption method Active CN100591007C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200710184824A CN100591007C (en) 2007-10-30 2007-10-30 Encryption and decryption method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200710184824A CN100591007C (en) 2007-10-30 2007-10-30 Encryption and decryption method

Publications (2)

Publication Number Publication Date
CN101159548A CN101159548A (en) 2008-04-09
CN100591007C true CN100591007C (en) 2010-02-17

Family

ID=39307484

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200710184824A Active CN100591007C (en) 2007-10-30 2007-10-30 Encryption and decryption method

Country Status (1)

Country Link
CN (1) CN100591007C (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1347225A (en) * 2000-10-09 2002-05-01 杨高雄 Methods of Making Right Security Controls
CN1426645A (en) * 2000-04-25 2003-06-25 格姆普拉斯公司 Method for calculating cryptographic key control datum
WO2004102869A1 (en) * 2003-05-13 2004-11-25 Diseño De Sistemas En Silicio, S.A. Des algorithm-based encryption method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1426645A (en) * 2000-04-25 2003-06-25 格姆普拉斯公司 Method for calculating cryptographic key control datum
CN1347225A (en) * 2000-10-09 2002-05-01 杨高雄 Methods of Making Right Security Controls
WO2004102869A1 (en) * 2003-05-13 2004-11-25 Diseño De Sistemas En Silicio, S.A. Des algorithm-based encryption method

Also Published As

Publication number Publication date
CN101159548A (en) 2008-04-09

Similar Documents

Publication Publication Date Title
CN107086915B (en) Data transmission method, data sending end and data receiving end
CN105406969B (en) Data encryption device and method
CN102710414B (en) Randomized document block encryption method
CN102402670A (en) File encryption and decryption method
CN102752101A (en) Hierarchical data encryption/decryption apparatus and method thereof
US8467526B2 (en) Key evolution method and system of block ciphering
CN109861810A (en) A data encryption method and decryption method based on chaotic block encryption algorithm
CN106878013A (en) Method and device for encrypting and decrypting files
US20170272243A1 (en) Encryption apparatus, decryption apparatus, cryptography processing system, encryption method, decryption method, encryption program, and decryption program
CN103095449A (en) Dynamic encryption and decryption method based on stream ciphers
US9391770B2 (en) Method of cryption
KR101905689B1 (en) Calculating apparatus for encrypting message by public key and method thereof
JP5992651B2 (en) ENCRYPTION METHOD, PROGRAM, AND SYSTEM
US11764945B2 (en) Data processing device, method, and computer program
Aggarwal Comparison of RC6, modified RC6 & enhancement of RC6
CN100591007C (en) Encryption and decryption method
CN114826562B (en) Data encryption method, device, electronic device and storage medium
CN106130717A (en) A kind of file storage decryption method and device
Amalarethinam et al. A new key generation technique using GA for enhancing data security in cloud environment
CN111294199B (en) Encryption and decryption system, encryption device, decryption device and encryption and decryption method
Gligoroski et al. On the importance of the key separation principle for different modes of operation
WO2021044465A1 (en) Encrypting device, decrypting device, computer program, encryption method, decryption method, and data structure
US20090103718A1 (en) Encryption and decryption methods
JP4287397B2 (en) Ciphertext generation apparatus, ciphertext decryption apparatus, ciphertext generation program, and ciphertext decryption program
EP1655883B1 (en) Information-processing apparatus, information-processing method, and recording medium

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