WO2021129470A1 - Polynomial-based system and method for fully homomorphic encryption of binary data - Google Patents
Polynomial-based system and method for fully homomorphic encryption of binary data Download PDFInfo
- Publication number
- WO2021129470A1 WO2021129470A1 PCT/CN2020/136646 CN2020136646W WO2021129470A1 WO 2021129470 A1 WO2021129470 A1 WO 2021129470A1 CN 2020136646 W CN2020136646 W CN 2020136646W WO 2021129470 A1 WO2021129470 A1 WO 2021129470A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- ciphertext
- binary
- byte
- unit
- plaintext
- 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.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/008—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols involving homomorphic encryption
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/08—Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/08—Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
- H04L9/0861—Generation of secret information including derivation or calculation of cryptographic keys or passwords
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/50—Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate
Definitions
- the invention relates to a technology in the field of information security, in particular to a system and method for binary data encryption and decryption and ciphertext operation processing based on a polynomial fully homomorphic encryption technology based on coefficient mapping transformation.
- cloud applications When users use cloud applications to process their own important data, it is easy to cause user data leakage due to factors such as hacker attacks or application administrators. The fundamental reason is that cloud applications can only perform data operations and processing on unencrypted plaintext data. In contrast, fully homomorphic encryption technology can completely protect data privacy without affecting data operations. At the bottom of the computer and communication system, whether it is storage or transmission, all data is expressed in binary form.
- the present invention proposes a binary data encryption system and method based on a polynomial complete homomorphism, which can directly encrypt and decrypt binary values, and supports various operations and processing of binary ciphertexts.
- the data is always kept in ciphertext state during transmission, storage and calculation, so that once the user keeps the key by himself, only the encrypted data is delivered to the cloud application, and the cloud application can still process the data normally and get the correct processing As a result, the scope of adaptation and application scenarios have been greatly expanded.
- the present invention relates to a binary data encryption system based on polynomial complete homomorphism, including: a split and merge unit, an encryption and decryption unit, a binary conversion unit, a logic operation unit and a control unit, wherein: the split and merge unit 1 receives all plaintext or All ciphertexts are split into single-byte component plaintexts or component ciphertexts or 2Receive single-byte component plaintexts or component ciphertexts and merge them into corresponding all plaintexts or all ciphertexts; the binary/decimal ciphertext is received by the binary conversion unit And output the ten/binary ciphertext; the logic operation unit executes the logic operation on the input single or a pair of ciphertexts according to the instructions of the control unit.
- the control unit is combined with the split and merge unit, the encryption unit, the binary conversion unit and the logic operation unit. Transmit encryption parameters; the encryption and decryption unit performs fully homomorphic encryption/decryption according to the input single-byte plaintext/ciphertext and the encryption parameters from the control unit, and outputs single-byte ciphertext/plaintext.
- the logical operation includes: AND operation (AND), OR operation (OR), exclusive OR operation (XOR), NOT operation (NOT) or a combination thereof.
- the described system is further provided with a shift unit connected to the control unit, which realizes a left shift by n bits ( ⁇ n) or a right shift by n bits (>>n) by receiving a shift instruction from the control unit.
- Figure 1 is a schematic diagram of a binary number encryption, ciphertext operation, and decryption process
- Figure 2 is a schematic diagram of the exclusive OR operation process
- Figure 3 is a schematic diagram of the AND operation flow
- Figure 4 is a schematic diagram of the OR operation process
- Figure 5 is a schematic diagram of a non-operation flow
- Figure 6 is a schematic diagram of a left shift operation flow
- Figure 7 is a schematic diagram of the right shift operation flow.
- This embodiment takes a binary number as an example.
- i ⁇ I [0,7] ⁇ ;
- i ⁇ I [0,7] ⁇ , each component of the ciphertext expression represents a binary number, so: [a i ⁇ f(x i )] ⁇ y i mod2 ⁇ 0,1 ⁇ , in order to save the space occupied by the ciphertext, the function argument is set to an integer, that is, x i ⁇ Z.
- this embodiment relates to a binary encryption method, and the specific steps are as follows:
- This embodiment relates to a homomorphic number conversion method, and the specific steps include:
- i-1) Take a ciphertext C with a value between 0 and 255, which is the decimal value range of one byte, as input;
- This embodiment relates to a homomorphic logic calculation method, and the specific steps include:
- the final result can be obtained by performing the operation byte by byte and then combining the results in the original order.
- the final result can be obtained by performing the operation byte by byte and then combining the results in the original order.
- the final result can be obtained by performing the operation byte by byte and then combining the results in the original order.
- This embodiment relates to a method for calculating homomorphic displacement of a single-byte binary ciphertext, and the specific steps include left shift and right shift:
- the above encryption/decryption and fully homomorphic operations are implemented in the hardware environment of a notebook computer, a CPU Intel i5-7200U octa-core 2.5GHz, and a memory of 8GB through golang version 1.12.5, and the obtained private key size: ⁇ 1KB ,
- the time taken to load the private key is: 1ms
- the dictionary size is: 45MB
- the speaking time to load the dictionary is: 227ms.
- the logic calculation method is carried out.
- the specific steps include the time spent by the XOR operation: 265ms, the size of the result ciphertext is unchanged; the time spent by the AND operation: 4812ms, the size of the result ciphertext is unchanged; the time spent by the OR operation: 4819ms, As a result, the size of the ciphertext remains unchanged.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Complex Calculations (AREA)
Abstract
Description
本发明涉及的是一种信息安全领域的技术,具体是一种基于系数映射变换的多项式完全同态加密技术针对二进制数据的加密解密和密文运算处理系统及方法。The invention relates to a technology in the field of information security, in particular to a system and method for binary data encryption and decryption and ciphertext operation processing based on a polynomial fully homomorphic encryption technology based on coefficient mapping transformation.
用户使用云端应用处理其自身的重要数据时,由于黑客攻击或应用管理员人为原因等因素,很容易造成用户数据泄露。根本原因在于云端应用在进行数据运算和处理时,只能针对未加密的明文数据进行,相比之下完全同态加密技术能够在不影响数据运算的同时完整的保护数据隐私。在计算机和通讯系统的底层,无论是存储还是传输,所有数据都以二进制方式表达。When users use cloud applications to process their own important data, it is easy to cause user data leakage due to factors such as hacker attacks or application administrators. The fundamental reason is that cloud applications can only perform data operations and processing on unencrypted plaintext data. In contrast, fully homomorphic encryption technology can completely protect data privacy without affecting data operations. At the bottom of the computer and communication system, whether it is storage or transmission, all data is expressed in binary form.
发明内容Summary of the invention
本发明针对现有技术存在的上述不足,提出一种基于多项式完全同态的二进制数据加密系统及方法,能够直接针对二进制数值进行加密解密,并且支持二进制密文的各种运算处理,通过二进制形式的数据在传输、存储和运算过程中始终保持密文状态,从而实现一旦用户自己保管密钥,而仅将加密的数据交付给云端应用,而云端应用照样可以正常进行数据处理,得到正确的处理结果,从而极大地扩展了适应范围和应用场景。Aiming at the above-mentioned shortcomings in the prior art, the present invention proposes a binary data encryption system and method based on a polynomial complete homomorphism, which can directly encrypt and decrypt binary values, and supports various operations and processing of binary ciphertexts. The data is always kept in ciphertext state during transmission, storage and calculation, so that once the user keeps the key by himself, only the encrypted data is delivered to the cloud application, and the cloud application can still process the data normally and get the correct processing As a result, the scope of adaptation and application scenarios have been greatly expanded.
本发明是通过以下技术方案实现的:The present invention is realized through the following technical solutions:
本发明涉及一种基于多项式完全同态的二进制数据加密系统,包括:分拆合并单元、加解密单元、进制转换单元、逻辑运算单元和控制单元,其中:分拆合并单元①接收全部明文或全部密文并分拆为单字节的分量明文或分量密文或②接收单字节分量明文或分量密文并合并为对应全部明文或全部密文;进制转换单元接收二/十进制密文并输出十/二进制密文;逻辑运算单元根据控制单元指令,对输入的单个或一对密文执行逻辑运算,控制单元分别与分拆合并单元、加密单元、进制转换单元和逻辑运算单元并传输加密参数;加解密单元根据输入的单字节明文/密文以及来自控制单元的加密参数进行全同态加密/解密并输出单字节密文/明文。The present invention relates to a binary data encryption system based on polynomial complete homomorphism, including: a split and merge unit, an encryption and decryption unit, a binary conversion unit, a logic operation unit and a control unit, wherein: the split and merge unit ① receives all plaintext or All ciphertexts are split into single-byte component plaintexts or component ciphertexts or ②Receive single-byte component plaintexts or component ciphertexts and merge them into corresponding all plaintexts or all ciphertexts; the binary/decimal ciphertext is received by the binary conversion unit And output the ten/binary ciphertext; the logic operation unit executes the logic operation on the input single or a pair of ciphertexts according to the instructions of the control unit. The control unit is combined with the split and merge unit, the encryption unit, the binary conversion unit and the logic operation unit. Transmit encryption parameters; the encryption and decryption unit performs fully homomorphic encryption/decryption according to the input single-byte plaintext/ciphertext and the encryption parameters from the control unit, and outputs single-byte ciphertext/plaintext.
所述的逻辑运算包括:与运算(AND)、或运算(OR)、异或运算(XOR)、非运算(NOT)或其组合。The logical operation includes: AND operation (AND), OR operation (OR), exclusive OR operation (XOR), NOT operation (NOT) or a combination thereof.
所述的系统中进一步设有与控制单元相连的移位单元,通过接收来自控制单元的移位指令实现左移n位(<<n)或右移n位(>>n)。The described system is further provided with a shift unit connected to the control unit, which realizes a left shift by n bits (<<n) or a right shift by n bits (>>n) by receiving a shift instruction from the control unit.
图1为二进制数的加密、密文运算、解密流程示意图;Figure 1 is a schematic diagram of a binary number encryption, ciphertext operation, and decryption process;
图2为异或运算流程示意图;Figure 2 is a schematic diagram of the exclusive OR operation process;
图3为与运算流程示意图;Figure 3 is a schematic diagram of the AND operation flow;
图4为或运算流程示意图;Figure 4 is a schematic diagram of the OR operation process;
图5为非运算流程示意图;Figure 5 is a schematic diagram of a non-operation flow;
图6为左移运算流程示意图;Figure 6 is a schematic diagram of a left shift operation flow;
图7为右移运算流程示意图。Figure 7 is a schematic diagram of the right shift operation flow.
本实施例以二进制数为例,该二进制明文为: 2P=([a i·f(x i)]·y i),i∈I=[0,7],其中:算子[]为取整运算,即为取距离最近的整数,[a i·f(x i)]∈Z;f()是函数密钥部分,针对每一个分量均相同;x i是函数f()的自变量且x i∈R;a i为多项式系数且a i∈R;y i是多项式密钥部分且y i∈Z,每个分量y i取值不同,其中R为实数域,Z为整数域。 This embodiment takes a binary number as an example. The binary plaintext is: 2 P=([a i ·f(x i )]·y i ), i∈I=[0,7], where: the operator [] is Rounding operation is to take the nearest integer, [a i ·f(x i )] ∈ Z; f() is the function key part, which is the same for each component; x i is the self of function f() Variable and x i ∈ R; a i is a polynomial coefficient and a i ∈ R; y i is a polynomial key part and y i ∈ Z, each component y i takes a different value, where R is the real number domain and Z is the integer domain .
对应上述二进制明文的密文为 2C=(A,X),A={a i|i∈I=[0,7]},X={x i|i∈I=[0,7]};密钥为K=(f,Y),Y={y i|i∈I=[0,7]},该密文表达式的每个分量代表了一位二进制数,因此有:[a i·f(x i)]·y imod2∈{0,1},为了节约密文的占用空间,将函数自变量部分设为整数,即x i∈Z。 The ciphertext corresponding to the above binary plaintext is 2 C=(A,X), A={a i |i∈I=[0,7]}, X={x i |i∈I=[0,7]} ; The key is K=(f,Y), Y={y i |i∈I=[0,7]}, each component of the ciphertext expression represents a binary number, so: [a i ·f(x i )]·y i mod2∈{0,1}, in order to save the space occupied by the ciphertext, the function argument is set to an integer, that is, x i ∈Z.
如图1所示,本实施例涉及一种二进制加密方法,具体步骤如下:As shown in Figure 1, this embodiment relates to a binary encryption method, and the specific steps are as follows:
1)按8位一个字节,将输入明文P拆分为字节序列:P=(P 1,P 2,...,P n),其中P i=(b i0,b i1,...,b i7),b ij={0,1},i∈[1,n],j∈[0,7],亦即任一字节P i由8位二进制变量b ij构成; 1) Split the input plaintext P into byte sequences according to 8 bits and one byte: P = (P 1 ,P 2 ,...,P n ), where P i =(b i0 ,b i1 ,... ., b i7), b ij = {0,1}, i∈ [1, n], j∈ [0,7], i.e. P i either byte consists of 8-bit binary variable b ij;
2)逐字节地对字节序列调用加密函数进行加密:字节P i=(b i0,b i1,...,b i7)作为输入,针对每一个分量b ij,在函数密钥的定义域内随机产生整数x ij以及随机整数m j,计算得到密钥系数 于是第i个明文部分第j位二进制数的值b ij=a ij·f(x ij)·y jmod2; 2) a sequence of bytes, byte by byte encrypted encryption function calls: byte P i = (b i0, b i1, ..., b i7) as input, for each component b ij, the function key Randomly generate integer x ij and random integer m j in the domain, and calculate the key coefficient Therefore, the value of the j-th binary number of the i-th plaintext part is b ij = a ij · f(x ij ) · y j mod2;
3)重复步骤2)直到遍历字节序列中P i所有的字节,得到分量密文C i=(C i0,C i1,...C i7),其中C i=(A i,X i),A i={a ij|j=[0,7]},X i={x ij|j=[0,7]};进一步重复遍历明文P的所有字节,得到全部密文C=(C 1,C 2,...,C n),其中的各个分量密文C i均按与明文P一致的顺序排列。 3) Repeat Step 2) down through all the bytes in the byte sequence P i, to give the component the ciphertext C i = (C i0, C i1, ... C i7), where C i = (A i, X i ), a i = {a ij | j = [0,7]}, X i = {x ij | j = [0,7]}; further iterate across all bytes of plaintext P, the ciphertext C = get all (C 1 , C 2 ,..., C n ), the ciphertext C i of each component is arranged in the same order as the plaintext P.
本实施例涉及上述加密的解密方法,即根据二进制的密文C=(C 1,C 2,...,C n),按密文中的顺序拆分为多个分量组成的序列,逐字节地对分量序列调用解密函数进行解密:对任一字节分量密文C i=(A i,X i),A i={a ij|j=[0,7]},X i={x ij|j=[0,7]},调用密钥K,逐位进行解密,即分量密文C i的第j位为b ij=a ij·f(x ij)·y jmod2,重复解密得到分量明文P i=(b i0,b i1,...,b i7),进而得到组合后的全部明文P=(P 1,P 2,...,P n)。 This embodiment relates to the above-mentioned encryption and decryption method, that is, according to the binary ciphertext C=(C 1 , C 2 ,..., C n ), the ciphertext is split into a sequence of multiple components according to the order in the ciphertext, verbatim section call sequence for decryption function decrypts components: component of either byte ciphertext C i = (a i, X i), a i = {a ij | j = [0,7]}, X i = { x ij |j=[0,7]}, call the key K, and decrypt it bit by bit, that is, the j-th bit of the component ciphertext C i is b ij =a ij ·f(x ij )·y j mod2, repeat Decryption obtains the component plaintext P i = (b i0 , b i1 ,..., b i7 ), and then obtains all the combined plain text P = (P 1 , P 2 ,..., P n ).
本实施例涉及一种同态进制转换方法,具体步骤包括:This embodiment relates to a homomorphic number conversion method, and the specific steps include:
i)十进制转换至二进制下的分量密文,具体包括:i) The component ciphertext converted from decimal to binary, including:
i-0)设置合理的同态比较运算精度,针对大于等于2的密文可以正确返回大于0的比较结果,对于小于0的密文正确返回小于0的比较结果,而对于0和1则返回不可比较的结果;i-0) Set a reasonable homomorphic comparison operation accuracy, for the ciphertext greater than or equal to 2, the comparison result greater than 0 can be correctly returned, for the ciphertext less than 0, the comparison result less than 0 is correctly returned, and for 0 and 1 it is returned. Incomparable results;
i-1)将一个取值介于0~255之间的密文C,即为一个字节的十进制取值范围,作为输入;i-1) Take a ciphertext C with a value between 0 and 255, which is the decimal value range of one byte, as input;
i-2)设置循环变量i=7,计算输入密文C减去27=128对应的密文C128,得到差的密文C7,比较C7是否大于0;i-2) Set the loop variable i=7, calculate the input ciphertext C minus the ciphertext C128 corresponding to 27=128, get the bad ciphertext C7, and compare whether C7 is greater than 0;
i-3)当C7>0,则二进制密文的第i+1位为1的密文形态,并且将C替换为C7,循环变量i减小1,当i>0时回到第i-2)步;否则,二进制密文的第i+1位为0的密文形态,C不变,循环变量i减小1,当i>0时回到第i-2)步;i-3) When C7>0, then the i+1th bit of the binary ciphertext is the ciphertext form of 1, and replace C with C7, the loop variable i decreases by 1, and when i>0, it returns to the i-th- 2) Step; otherwise, the ciphertext form where the i+1 bit of the binary ciphertext is 0, C remains unchanged, and the loop variable i decreases by 1. When i>0, return to step i-2);
i-4)循环变量i=0,则将当前的密文C,通过转换,赋值给二进制密文的第0位,转换方式为:设y 1'=β 1·f(x 1')·y 1,y 2'=β 2·f(x 2')·y 1,则当前密文为: i-4) The loop variable i=0, the current ciphertext C is assigned to the 0th bit of the binary ciphertext through conversion. The conversion method is: set y 1 '=β 1 ·f(x 1 ')· y 1 ,y 2 '=β 2 ·f(x 2 ')·y 1 , then the current ciphertext is:
本实施例涉及一种同态逻辑计算方法,具体步骤包括:This embodiment relates to a homomorphic logic calculation method, and the specific steps include:
①单字节二进制密文异或运算A XOR B=C,密文C A=(A A,X A),密文C B=(A B,X B),通过对A和B逐位地进行同态加法运算,即计算b Aj=a Aj·f(x Aj)·z j,b Bj=a Bj·f(x Bj)·z j的和,得b Cj=[a Aj·f(x Aj)+a Bj·f(x Bj)]·z j=[a Cj·f(x Cj)]·z j,其中的加法运算与实数形态下密文相同,结果C的系数a Cj和自变量x Cj基于运算支持函数G计算得到;通过遍历CA和CB的所有位,即操作下标j从0变到7,得到最后的结果密文C C=(b C0,b C1,...,b C7),即实现异或运算结果的密文。 ①Single-byte binary ciphertext exclusive OR operation A XOR B=C, ciphertext C A =(A A ,X A ), ciphertext C B =(A B ,X B ), by bit by bit of A and B Perform a homomorphic addition operation, that is, calculate the sum of b Aj = a Aj · f(x Aj ) · z j , b Bj = a Bj · f(x Bj ) · z j , and get b Cj = [a Aj · f( x Aj )+a Bj ·f(x Bj )]·z j =[a Cj ·f(x Cj )]·z j , where the addition operation is the same as the ciphertext in the real number form, and the coefficients a Cj and The argument x Cj is calculated based on the operation support function G; by traversing all the bits of CA and CB, that is, the operation index j changes from 0 to 7, and the final result ciphertext C C = (b C0 ,b C1 ,... .,b C7 ), the ciphertext that realizes the result of the exclusive OR operation.
优选地,针对任意多字节的情况,由异或运算的性质可知,只要逐字节进行运算,再将 结果按原顺序组合即可得到最终结果。Preferably, for any multi-byte case, it can be known from the nature of the XOR operation that as long as the operation is performed byte by byte, and the results are combined in the original order, the final result can be obtained.
②单字节二进制密文与运算A AND B,具体步骤包括:②Single-byte binary ciphertext and operation A AND B, the specific steps include:
1)根据二进制密文A和B,先在二进制下计算C=A XOR B;1) According to the binary ciphertexts A and B, first calculate C=A XOR B in binary;
2)将二进制密文A、B、C转换至十进制下并计算D=(A+B-C)/2;2) Convert the binary ciphertext A, B, C to decimal and calculate D=(A+B-C)/2;
3)将十进制密文D转换至二进制下,即得到最终D=A AND B的结果。3) Convert the decimal ciphertext D to binary, and get the final result D=A AND B.
优选地,针对任意多字节的情况,由与运算的性质可知,只要逐字节进行运算,再将结果按原顺序组合即可得到最终结果。Preferably, for any multi-byte case, it can be known from the nature of the AND operation that the final result can be obtained by performing the operation byte by byte and then combining the results in the original order.
③单字节二进制密文或运算A OR B,具体步骤包括:③Single-byte binary ciphertext or operation A OR B, the specific steps include:
1)根据二进制密文A和B,先在二进制下计算C=A XOR B;1) According to the binary ciphertexts A and B, first calculate C=A XOR B in binary;
2)将二进制密文A、B、C转换至十进制下并计算D=(A+B+C)/2;2) Convert the binary ciphertext A, B, C to decimal and calculate D=(A+B+C)/2;
3)将十进制密文D转换至二进制下,即得到最终D=A OR B的结果。3) Convert the decimal ciphertext D to binary to get the final result D=A OR B.
优选地,针对任意多字节的情况,由或运算的性质可知,只要逐字节进行运算,再将结果按原顺序组合即可得到最终结果。Preferably, for any multi-byte case, it can be known from the nature of the OR operation that the final result can be obtained by performing the operation byte by byte and then combining the results in the original order.
④单字节二进制密文非运算NOT A,具体步骤包括:④Single-byte binary ciphertext non-operation NOT A, the specific steps include:
4.1)根据二进制单字节密文A,先使用二进制方式加密255得到单位密文E,单位密文E的每一位的密文取值均为1;4.1) According to the binary single-byte ciphertext A, first use the binary method to encrypt 255 to obtain the unit ciphertext E, and the value of each ciphertext of the unit ciphertext E is 1;
4.2)计算F=A XOR E,即F=NOT A。4.2) Calculate F=A XOR E, that is, F=NOT A.
优选地,针对任意多字节的情况,由非运算的性质可知,只要逐字节进行运算,再将结果按原顺序组合即可得到最终结果。Preferably, for any multi-byte case, it can be known from the nature of non-operation that the final result can be obtained by performing the operation byte by byte and then combining the results in the original order.
本实施例涉及一种单字节二进制密文同态位移计算方法,具体步骤包括左移和右移:This embodiment relates to a method for calculating homomorphic displacement of a single-byte binary ciphertext, and the specific steps include left shift and right shift:
①左移n位:将二进制密文A转换到十进制密文B,计算C=B·2 n,再将十进制密文C转换到二进制密文D,即为A左移n位的结果密文。 ①Left shift by n bits: Convert binary ciphertext A to decimal ciphertext B, calculate C=B·2 n , then convert decimal ciphertext C to binary ciphertext D, which is the result ciphertext of A left shift by n bits .
②右移n位:将二进制密文A转换到十进制密文B,计算C=[B÷2 n],即同态取整操作后,再将十进制密文C转换到二进制密文D,即为A左移n位的结果密文。 ②Right shift n bits: Convert binary ciphertext A to decimal ciphertext B, calculate C=[B÷2 n ], that is, after homomorphic rounding operation, then convert decimal ciphertext C to binary ciphertext D, namely The ciphertext of the result of shifting A to the left by n bits.
当使用一台不能确保安全性的服务器上运行一个受保护的java程序,获得运算结果。用户既不希望程序运算结果被可能存在的攻击者通过监控服务器内存等方式非法窃取,也不希望这段java程序被攻击者复制后使用逆向工程分析程序逻辑和数据处理流程时,可以通过在该不安全设备上安装加密虚拟机,执行加密后的java程序获得加密的运行结果。这个场景下,由于java程序编译后的形式是二进制的,输入输出数据也是二进制的,因此需要上述二进制密文处理方法和系统来处理。本实施例在笔记本电脑,CPU Intel i5-7200U八核2.5GHz,内存8GB的硬件环境下通过golang version 1.12.5语言实施上述加/解密及全同态操作,其中得到的私钥 大小:<1KB,加载私钥所花时间为:1ms,字典大小为:45MB,加载字典说话时间为:227ms。When a protected java program is run on a server that cannot ensure security, the result of the operation is obtained. Users do not want the results of the program calculations to be illegally stolen by possible attackers by monitoring server memory, nor do they want this java program to be copied by the attacker and use reverse engineering to analyze the program logic and data processing flow. Install an encrypted virtual machine on the insecure device, and execute the encrypted java program to obtain the encrypted running result. In this scenario, since the compiled form of the java program is binary, and the input and output data are also binary, the above-mentioned binary ciphertext processing method and system are needed to process. In this embodiment, the above encryption/decryption and fully homomorphic operations are implemented in the hardware environment of a notebook computer, a CPU Intel i5-7200U octa-core 2.5GHz, and a memory of 8GB through golang version 1.12.5, and the obtained private key size: <1KB , The time taken to load the private key is: 1ms, the dictionary size is: 45MB, and the speaking time to load the dictionary is: 227ms.
本实施例基于上述方法对一个整数加密所得二进制密文大小:<1KB,加密数据得到二进制密文所花时间:<1ns;对其解密二进制密文得到原始数据所花时间:<1ns。In this embodiment, the size of the binary ciphertext obtained by encrypting an integer based on the above method: <1KB, the time taken to obtain the binary ciphertext from the encrypted data: <1ns; the time taken to decrypt the binary ciphertext to obtain the original data: <1ns.
在此基础上进行十进制加法运算所花时间:30ms,二进制转十进制所花时间:1280ms,十进制转二进制所花时间:715ms。On this basis, the time taken for decimal addition operation: 30ms, the time taken for binary conversion to decimal: 1280ms, the time taken for decimal conversion to binary: 715ms.
在此基础上进行逻辑计算方法,具体步骤包括XOR运算所花时间:265ms,结果密文大小不变;AND运算所花时间:4812ms,结果密文大小不变;OR运算所花时间:4819ms,结果密文大小不变。On this basis, the logic calculation method is carried out. The specific steps include the time spent by the XOR operation: 265ms, the size of the result ciphertext is unchanged; the time spent by the AND operation: 4812ms, the size of the result ciphertext is unchanged; the time spent by the OR operation: 4819ms, As a result, the size of the ciphertext remains unchanged.
上述具体实施可由本领域技术人员在不背离本发明原理和宗旨的前提下以不同的方式对其进行局部调整,本发明的保护范围以权利要求书为准且不由上述具体实施所限,在其范围内的各个实现方案均受本发明之约束。The above-mentioned specific implementations can be locally adjusted in different ways by those skilled in the art without departing from the principle and purpose of the present invention. The protection scope of the present invention is subject to the claims and is not limited by the above-mentioned specific implementations. All implementation schemes within the scope are bound by the present invention.
Claims (7)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201911334126.1A CN113098675B (en) | 2019-12-23 | 2019-12-23 | Binary data encryption system and method based on polynomial complete homomorphism |
| CN201911334126.1 | 2019-12-23 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2021129470A1 true WO2021129470A1 (en) | 2021-07-01 |
Family
ID=76573668
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2020/136646 Ceased WO2021129470A1 (en) | 2019-12-23 | 2020-12-16 | Polynomial-based system and method for fully homomorphic encryption of binary data |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN113098675B (en) |
| WO (1) | WO2021129470A1 (en) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115580390A (en) * | 2022-08-24 | 2023-01-06 | 京信数据科技有限公司 | Multi-scene mode calculation method and system under safe multi-party calculation |
| CN116132020A (en) * | 2023-03-29 | 2023-05-16 | 芯安微众(上海)微电子技术有限公司 | Single byte data encryption and decryption algorithm |
| CN117319041A (en) * | 2023-10-07 | 2023-12-29 | 南京邮电大学 | A method for encrypted transmission of network communication data |
| CN117675320A (en) * | 2023-11-30 | 2024-03-08 | 黑塔之契科技(上海)有限公司 | Data encryption and decryption method, electronic equipment and medium |
| CN118797692A (en) * | 2024-09-13 | 2024-10-18 | 济宁春蕾农业科技有限公司 | A tea refining production traceability method and system |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115103357B (en) * | 2022-08-26 | 2022-11-25 | 汉仪科技(深圳)有限公司 | 5G communication encryption system based on FPGA |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103973439A (en) * | 2014-05-08 | 2014-08-06 | 华中科技大学 | Multivariable public key encryption method |
| US20150039912A1 (en) * | 2013-08-01 | 2015-02-05 | Visa International Service Association | Homomorphic Database Operations Apparatuses, Methods and Systems |
| CN108809619A (en) * | 2017-04-27 | 2018-11-13 | 郑珂威 | Precision controlling and cumulative errors removing method for complete homomorphic cryptography |
| CN109412786A (en) * | 2018-11-14 | 2019-03-01 | 沈阳航空航天大学 | A kind of integer ciphertext arithmetic operation method based on homomorphic cryptography |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103259643B (en) * | 2012-08-14 | 2016-06-15 | 苏州大学 | Matrix fully homomorphic encryption method |
| CN103425934A (en) * | 2013-07-31 | 2013-12-04 | 北京华易互动科技有限公司 | Homomorphic decryption storage method based on MySQL database |
| JP6173904B2 (en) * | 2013-12-13 | 2017-08-02 | 株式会社東芝 | Common key encryption device and program, and common key decryption device and program |
| CN106452723B (en) * | 2016-12-13 | 2017-05-31 | 深圳市全同态科技有限公司 | Fully homomorphic encryption processing method based on modular operation |
-
2019
- 2019-12-23 CN CN201911334126.1A patent/CN113098675B/en active Active
-
2020
- 2020-12-16 WO PCT/CN2020/136646 patent/WO2021129470A1/en not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20150039912A1 (en) * | 2013-08-01 | 2015-02-05 | Visa International Service Association | Homomorphic Database Operations Apparatuses, Methods and Systems |
| CN103973439A (en) * | 2014-05-08 | 2014-08-06 | 华中科技大学 | Multivariable public key encryption method |
| CN108809619A (en) * | 2017-04-27 | 2018-11-13 | 郑珂威 | Precision controlling and cumulative errors removing method for complete homomorphic cryptography |
| CN109412786A (en) * | 2018-11-14 | 2019-03-01 | 沈阳航空航天大学 | A kind of integer ciphertext arithmetic operation method based on homomorphic cryptography |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115580390A (en) * | 2022-08-24 | 2023-01-06 | 京信数据科技有限公司 | Multi-scene mode calculation method and system under safe multi-party calculation |
| CN115580390B (en) * | 2022-08-24 | 2023-08-25 | 京信数据科技有限公司 | Multi-scene mode calculation method and system under safe multi-party calculation |
| CN116132020A (en) * | 2023-03-29 | 2023-05-16 | 芯安微众(上海)微电子技术有限公司 | Single byte data encryption and decryption algorithm |
| CN117319041A (en) * | 2023-10-07 | 2023-12-29 | 南京邮电大学 | A method for encrypted transmission of network communication data |
| CN117319041B (en) * | 2023-10-07 | 2024-05-24 | 南京邮电大学 | A network communication data encryption transmission method |
| CN117675320A (en) * | 2023-11-30 | 2024-03-08 | 黑塔之契科技(上海)有限公司 | Data encryption and decryption method, electronic equipment and medium |
| CN118797692A (en) * | 2024-09-13 | 2024-10-18 | 济宁春蕾农业科技有限公司 | A tea refining production traceability method and system |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113098675A (en) | 2021-07-09 |
| CN113098675B (en) | 2023-04-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2021129470A1 (en) | Polynomial-based system and method for fully homomorphic encryption of binary data | |
| US8121294B2 (en) | System and method for a derivation function for key per page | |
| CN108629027B (en) | Block chain-based user database reconstruction method, device, equipment and medium | |
| CN103748827B (en) | System and method for wireless data protection | |
| US7899190B2 (en) | Security countermeasures for power analysis attacks | |
| US6189095B1 (en) | Symmetric block cipher using multiple stages with modified type-1 and type-3 feistel networks | |
| US20090279697A1 (en) | Ciphertext key chaining | |
| US20070263861A1 (en) | Keystream encryption device, method, and program | |
| CN112287377A (en) | Model training method based on federal learning, computer equipment and storage medium | |
| WO2019114122A1 (en) | Encryption method for login information, device, electronic device, and medium | |
| CN103119888A (en) | Apparatus and method for block cipher processing in an insecure environment | |
| JP3794457B2 (en) | Data encryption / decryption method | |
| CN114826590B (en) | A packet mode encryption method, decryption method, device and equipment thereof | |
| CN113407966B (en) | Searchable public key encryption method and system with key update and ciphertext sharing functions | |
| US7894608B2 (en) | Secure approach to send data from one system to another | |
| JP2017187724A (en) | Encryption device, encryption method, decryption device, and decryption method | |
| EP3667647A1 (en) | Encryption device, encryption method, decryption device, and decryption method | |
| WO2016088453A1 (en) | Encryption apparatus, decryption apparatus, cryptography processing system, encryption method, decryption method, encryption program, and decryption program | |
| US8804953B2 (en) | Extensive ciphertext feedback | |
| CN108063760B (en) | Method and system for block encryption and method for block decryption | |
| CN115811398A (en) | Dynamic S-box-based block cipher algorithm, device, system and storage medium | |
| Muhammed et al. | A hybrid approach to cloud data security using ChaCha20 and ECDH for secure encryption and key exchange | |
| CN114765529A (en) | Homomorphic encryption storage method and device for distributed data, electronic equipment and computer readable medium | |
| US8774402B2 (en) | Encryption/decryption apparatus and method using AES rijndael algorithm | |
| CN117221878B (en) | A method and device for information security management based on wireless network equipment |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20905030 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 20905030 Country of ref document: EP Kind code of ref document: A1 |