CN109412786B - Integer cipher text arithmetic operation method based on homomorphic encryption - Google Patents
Integer cipher text arithmetic operation method based on homomorphic encryption Download PDFInfo
- Publication number
- CN109412786B CN109412786B CN201811355108.7A CN201811355108A CN109412786B CN 109412786 B CN109412786 B CN 109412786B CN 201811355108 A CN201811355108 A CN 201811355108A CN 109412786 B CN109412786 B CN 109412786B
- Authority
- CN
- China
- Prior art keywords
- homomorphic
- ciphertext
- polynomial
- calculation
- complement
- 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
Links
- 238000000034 method Methods 0.000 title claims description 25
- 238000004364 calculation method Methods 0.000 claims abstract description 51
- 230000000295 complement effect Effects 0.000 claims abstract description 49
- 239000013598 vector Substances 0.000 claims description 23
- 239000000654 additive Substances 0.000 claims description 5
- 230000000996 additive effect Effects 0.000 claims description 5
- 239000012467 final product Substances 0.000 claims description 2
- 230000001186 cumulative effect Effects 0.000 claims 1
- 230000009467 reduction Effects 0.000 abstract description 6
- 230000008569 process Effects 0.000 description 13
- 238000006243 chemical reaction Methods 0.000 description 5
- 230000008901 benefit Effects 0.000 description 4
- 238000010801 machine learning Methods 0.000 description 2
- 239000000047 product Substances 0.000 description 2
- 230000002776 aggregation Effects 0.000 description 1
- 238000004220 aggregation Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000009827 uniform distribution Methods 0.000 description 1
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
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Complex Calculations (AREA)
Abstract
本发明提供一种基于同态加密的整数密文算术运算的同态计算方法,包括求补同态计算、加法减法同态计算、乘法同态计算和除法同态计算。参考了计算机中二进制整数的求补、加减乘除运算规则,并将这个规则转换成只包含逻辑与、异或运算的布尔多项式。在乘法和除法中需要根据特殊位的信息做出不同的计算去修正最终计算的结果。因此我们修改了布尔多项式的形式,让其表示不同的运算结果,即布尔多项式包括本层全部的输入和互斥的计算分支。再将布尔多项式转换成能适用密文计算的同态多项式,并证明了同态多项式的安全性,符合语义安全的要求。实现了整数同态算术运算的多比特并行操作,改善同态运算的算法效率,减少降噪操作的频度,提升了运算效率。The present invention provides a homomorphic calculation method based on homomorphic encryption for integer ciphertext arithmetic operation, including complementary homomorphic calculation, addition and subtraction homomorphic calculation, multiplication homomorphic calculation and division homomorphic calculation. Referring to the rules of complement, addition, subtraction, multiplication and division of binary integers in the computer, this rule is converted into a Boolean polynomial that only contains logical AND and XOR operations. In multiplication and division, different calculations need to be made according to the information of special bits to correct the final calculation result. Therefore, we modify the form of the Boolean polynomial to express different operation results, that is, the Boolean polynomial includes all the inputs of this layer and mutually exclusive calculation branches. Then the Boolean polynomial is converted into a homomorphic polynomial suitable for ciphertext calculation, and the security of the homomorphic polynomial is proved, which meets the requirements of semantic security. The multi-bit parallel operation of integer homomorphic arithmetic operation is realized, the algorithm efficiency of homomorphic operation is improved, the frequency of noise reduction operation is reduced, and the operation efficiency is improved.
Description
技术领域:Technical field:
本发明属于密码学技术领域,涉及一种基于同态加密的整数密文算术 运算方法。The invention belongs to the technical field of cryptography, and relates to an integer ciphertext arithmetic operation method based on homomorphic encryption.
背景技术:Background technique:
本专利涉及的密文算术运算是基于同态加密的整数密文算数运算。这 种同态计算的优点是在密文中可实现明文空间中的相关运算,对得到的密 文计算结果解密后,恰可得到明文做相应运算的正确结果。下面将介绍算 术运算同态计算的一些相关方案。The ciphertext arithmetic operation involved in this patent is an integer ciphertext arithmetic operation based on homomorphic encryption. The advantage of this homomorphic calculation is that the correlation operation in the plaintext space can be realized in the ciphertext, and after decrypting the obtained ciphertext calculation result, the correct result of the corresponding operation in the plaintext can be obtained. In the following, some related schemes for homomorphic computation of arithmetic operations will be introduced.
Gentry等人提出了一个复杂电路的同态计算,通过使用BGV方案,实 现一个完整的AES-128位的同态计算。该方案使用批处理技术、密钥转换 和模数转换技术,以获得有效的分层实现。Chen Y.等人提出了一种基于BGV 方案的密文整数算法和同态数据聚合算法。该方案利用Helib同态加密运 算库实现无符号整数的同态加、减、乘、除运算。然而,这些方案没有优 化整数算法在密文中的自举和模转换操作,实验结果存在局限性。Gentry et al. proposed a homomorphic calculation of a complex circuit, by using the BGV scheme, to achieve a complete AES-128-bit homomorphic calculation. The scheme uses batching techniques, key conversion and analog-to-digital conversion techniques for an efficient hierarchical implementation. Chen Y. et al. proposed a ciphertext integer algorithm and homomorphic data aggregation algorithm based on BGV scheme. The scheme uses the Helib homomorphic encryption operation library to realize the homomorphic addition, subtraction, multiplication and division of unsigned integers. However, these schemes do not optimize the bootstrapping and modulo conversion operations of integer algorithms in ciphertext, and the experimental results are limited.
Gentry等人从2009年起提出一系列全同态加密方案,包括理想格上的 同态加密、整数上的同态加密,以及基于LWE的更简单快速的RLWE全同态 加密方法等等。这些同态加密方案的密文运算涉及噪音,噪音超过一定的 上限会使解密失败。因而必须频繁进行降噪算法,每进行一次加法或乘法 运算,都需要对其输入的密文运行降噪算法,从而保证其运算过程的全同 态特性。这种频繁的降噪操作,极大地降低了算法的运行效率,削弱了同 态加密方案的实用性。Gentry et al. proposed a series of fully homomorphic encryption schemes since 2009, including homomorphic encryption on ideal lattices, homomorphic encryption on integers, and a simpler and faster RLWE fully homomorphic encryption method based on LWE, etc. The ciphertext operations of these homomorphic encryption schemes involve noise, and if the noise exceeds a certain upper limit, decryption will fail. Therefore, the noise reduction algorithm must be carried out frequently. Every time an addition or multiplication operation is performed, the noise reduction algorithm needs to be run on the input ciphertext, so as to ensure the fully homomorphic characteristics of the operation process. This frequent noise reduction operation greatly reduces the operating efficiency of the algorithm and weakens the practicability of the homomorphic encryption scheme.
发明内容:Invention content:
鉴于上述同态加密密文算术运算存在的问题,本发明构造了一种整数 算数运算的同态计算方案,该方案包括补码运算的同态计算、加法运算的 同态计算、减法运算的同态计算、乘法运算的同态计算和除法运算的同态 计算。我们提出的方法不再局限于某一位明文对应的密文之间的操作,而 可以实现多个密文序列之间,即多个密文向量间的操作。不仅如此,本方 案还在一定程度上优化了运算流程,能够减少降噪操作的频度,提升算法效率。In view of the problems existing in the above-mentioned homomorphic encryption ciphertext arithmetic operation, the present invention constructs a homomorphic calculation scheme for integer arithmetic operation, which includes the homomorphic calculation of complement operation, the homomorphic calculation of addition operation, and the homomorphic calculation of subtraction operation. Homomorphic computation for multiplication, homomorphic computation for division, and homomorphic computation for division. The method we propose is no longer limited to the operation between ciphertexts corresponding to a certain plaintext, but can realize operations between multiple ciphertext sequences, that is, between multiple ciphertext vectors. Not only that, this solution also optimizes the operation process to a certain extent, which can reduce the frequency of noise reduction operations and improve the efficiency of the algorithm.
本发明的技术特点及有益效果:Technical characteristics and beneficial effects of the present invention:
我们参考了计算机中二进制整数的求补、加、减、乘、除运算规则, 并将这个规则转换成只包含逻辑与、异或运算的布尔多项式。在乘法和除 法中需要根据特殊位的信息做出不同的计算、去修正最终计算的结果;因 此,我们修改了布尔多项式的形式,让其表示不同的运算结果,即布尔多 项式包括本层全部的输入和互斥的计算分支;然后将布尔多项式转换成能 够适用于密文计算的同态多项式。本方案中的同态多项式经过安全性论证, 符合语义安全的要求。We refer to the rules of complement, addition, subtraction, multiplication, and division of binary integers in the computer, and convert this rule into a Boolean polynomial that only contains logical AND and XOR operations. In multiplication and division, different calculations need to be made according to the information of special bits to correct the final calculation result; therefore, we modify the form of the Boolean polynomial to express different operation results, that is, the Boolean polynomial includes all the Input and mutually exclusive computation branches; then transform the Boolean polynomial into a homomorphic polynomial suitable for ciphertext computation. The homomorphic polynomial in this scheme has been proved by security and meets the requirements of semantic security.
本方案实现了整数同态算术运算的多比特并行操作,改善了同态运算 的算法效率;本方案优化了相关的同态运算流程,能够减少降噪操作的频 度,提升了运算效率。This scheme realizes the multi-bit parallel operation of integer homomorphic arithmetic operation, and improves the algorithm efficiency of homomorphic operation; this scheme optimizes the related homomorphic operation process, which can reduce the frequency of noise reduction operation and improve the operation efficiency.
本发明方案可用于电子计票、密文检索、加密机器学习等领域。The solution of the invention can be used in the fields of electronic vote counting, ciphertext retrieval, encrypted machine learning and the like.
具体实施方式:Detailed ways:
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合实施 例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例 仅仅用以解释本发明,并不用于限定本发明。In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention.
本分发明提供了一种基于同态加密的整数密文算术运算方法,将传统 计算设备中的算法转换到密文情况下进行的密文算术运算,包括,补码运 算的同态计算、加法运算的同态计算、减法运算的同态计算、乘法运算的 同态计算和除法运算的同态计算,具体如下:The present invention provides an integer ciphertext arithmetic operation method based on homomorphic encryption, which converts an algorithm in a traditional computing device into an ciphertext arithmetic operation performed under the condition of ciphertext, including homomorphic calculation of complement arithmetic, addition The homomorphic calculation of operation, the homomorphic calculation of subtraction operation, the homomorphic calculation of multiplication operation and the homomorphic calculation of division operation are as follows:
在CPU的算术运算单元中,二进制的加、减、乘、除运算是通过补码 的加法和移位实现的。简单的一位全加器可以通过(逻辑异或)求和,用 ∧(逻辑与)求进位。在下面介绍的二进制整数运算都会以和作 为输入,都为补码,和是和原码的负数的补码。我们用密文向量表示加密后的其中ai=Enc(ai),0≤i≤n, 表示加密后的其中密文 向量表示加密后的 密文向 量表示加密后的其中 and是证书算数运算的同态计算的输入。n足够大,我们不考虑 运算之间的溢出。In the arithmetic operation unit of the CPU, the binary addition, subtraction, multiplication, and division operations are realized by addition and shifting of complement. A simple one-bit full adder can be (logical XOR) sum, use ∧ (logical AND) for carry. The binary integer operations described below will all start with and as input, both complement, and Yes and The complement of the negative number of the original code. We use the ciphertext vector means encrypted where a i =Enc(a i ), 0≤i≤n, means encrypted in Ciphertext vector means encrypted Ciphertext vector means encrypted in and is the input to the homomorphic computation of certificate arithmetic operations. n is large enough that we do not consider overflow between operations.
(1)补码运算的同态计算(1) Homomorphic calculation of complement operation
原码到补码的转换规则是,如果原码是正数,原码与补码相同,如果 原码是负数,将原码的最高位记为符号位置1,最高位之后的有效位取反, 然后加1。假设一个二进制整数原码最高位an为符号位, an-1…a0为有效位(为了方便表示,下文仍然用和表示二进制整数的 补码,即用和表示运算的输入),默认 初始进位c-1=0,那么求二进制的补码的迭代公式:The conversion rule of the original code to the complement code is that if the original code is a positive number, the original code is the same as the complement code. If the original code is a negative number, the highest bit of the original code is recorded as the symbol position 1, and the significant bits after the highest bit are inverted. Then add 1. Assume a binary integer source code The highest bit an is the sign bit, and a n -1 ...a 0 is the significant bit (for convenience of representation, the following is still used and Represents the complement of a binary integer, i.e. and Indicates the input of the operation), the default initial carry c -1 = 0, then find the two's complement The iterative formula of :
上述公式中ci=ai∨ci-1,在同态加密中只有逻辑异或的同态运算 (加法同态)和逻辑与∧的同态运算(乘法同态)。因此ci的迭代公式转换成 只有异或和与∧的公式,转换成的迭代公式为 由于c-1=0,ci可以表示为如下多项式:In the above formula, c i =a i ∨c i-1 , in homomorphic encryption there is only logical XOR The homomorphic operation (additive homomorphism) and the homomorphic operation of logical AND ∧ (multiplicative homomorphism). So the iterative formula for c i converts to only XOR The formula of sum and ∧ is converted into iterative formula as Since c -1 = 0, c i can be expressed as the following polynomial:
其中集合,是子集的长度。我们用密文向量表示加密后的其中αi=Enc(ai),0≤i≤n-1, αn=Enc(e)。求补的同态多项式可以写成:in gather, is the length of the subset. We use the ciphertext vector means encrypted where α i =Enc(a i ), 0≤i≤n-1, α n =Enc(e). The complementary homomorphic polynomial can be written as:
其中x0是同态加密中一个最大的奇数公钥。是求补同态多项式产生的密文 进位,满足表示求得的密文补码,满足 where x 0 is one of the largest odd public keys in homomorphic encryption. is the ciphertext carry generated by the complementary homomorphic polynomial, satisfying Indicates the complement of the obtained ciphertext, satisfying
(2)加法和减法运算的同态计算(2) Homomorphic calculation of addition and subtraction operations
二进补码加法运算从低位到高位依次计算结果和进位,把进位加到高 位的结果上,不断迭代可以求得补码加法的结果。假设二进制整数补码和an和为和的符号位。初始进 位为c-1=0,求得的和为那么每一位的和和 进位可以写成如下布尔迭代公式:The two's complement addition operation calculates the result and the carry from the low order to the high order, and adds the carry to the result of the high order. The result of the two's complement addition can be obtained by continuous iteration. Assume two's complement integer and an and for and sign bit. The initial carry is c -1 = 0, and the obtained sum is Then the sum of each The sum and carry can be written as the following Boolean iteration formula:
转换成密文下的加法同态多项式:Converted to an additive homomorphic polynomial in the ciphertext:
其中是在密文同态多项式运算过程中产生的密文进位,满足初始进位为为密文同态多项式产生的第i位的密文和,最终 得到的结果为满足 in is the ciphertext carry generated during the ciphertext homomorphic polynomial operation, satisfying The initial carry is is the ciphertext sum of the i-th bit generated by the ciphertext homomorphic polynomial, and the final result is Satisfy
二进制减法运算是通过加法运算得到的,假设有一个二进制整数补码和an和为和的符号位。计算 转换成(此处的右上角的*表示的two’s complement,即 取负数以后的补码),利用加法计算。求即用求补电路计算 位,得到再把符号位取反,即因 此,减法操作与加法操作有相同的公式和计算次数。因此,密文下减法同 态计算只需要用加法即可求出结果。A binary subtraction operation is obtained by an addition operation, assuming a two's complement integer and an and for and sign bit. calculate convert to (The * in the upper right corner here means the two's complement of Take the complement after the negative number), and use addition to calculate. beg Complementary circuit calculation bit, get the sign bit negate, that is Therefore, the subtraction operation has the same formula and number of calculations as the addition operation. Therefore, the subtractive homomorphic calculation under the ciphertext only needs to use addition The result can be obtained.
(3)乘法运算的同态计算(3) Homomorphic calculation of multiplication operation
乘法计算是基于Booth′s算法完成的。该算法将两个有符号数乘以二进 制补码表示法。设置被乘数和乘数Booth的算法检查乘数的相邻比 特对的有符号二进制补码表示,包括低于最低有效位的隐含位,我们用表示累加器。乘法运算的基本算法步骤:The multiplication calculation is done based on Booth's algorithm. This algorithm multiplies two signed numbers in two's complement notation. set multiplicand and multiplier Booth's algorithm to check the multiplier The signed two's complement representation of adjacent bit pairs of , including the implied bits below the least significant bit, we use Represents an accumulator. The basic algorithm steps of the multiplication operation:
1.初始化和的值。1. Initialization and value of .
·算术左移(n+1)位。 · Arithmetic shift left by (n+1) bits.
·算术左移(n+1)位。 · Arithmetic shift left by (n+1) bits.
·用0填充最高有效n位。右边部分用填充。最后LSB填充 为0。 · Pad the most significant n bits with 0s. right part filling. The last LSB is padded with 0.
2.的最低的2位用来决定累加器的运算方式。2. The least significant 2 bits are used to determine the accumulator operation method.
·如果算术右移1位。·if Arithmetic shift right by 1 bit.
·如果算术右移1位。·if Arithmetic shift right by 1 bit.
·如果算术右移1位。·if Arithmetic shift right by 1 bit.
重复第二步n-1次.删除的最低有效位。根据第二步提到的技术,我们可 以总结一个判断选择布尔多项式:Repeat the second step n-1 times. Delete the least significant bit of . According to the technique mentioned in the second step, we can summarize a judgment selection Boolean polynomial:
使用表示每一步的累加器乘法运算的布尔公式如下所示:use Accumulator representing each step The Boolean formula for multiplication is as follows:
其中>>算术右移。我们使用加法同态合成法同态转换以上的布尔公式到同 态多项式:Where >> Arithmetic right shift. We use additive homomorphism to homomorphically convert the above Boolean formula to a homomorphic polynomial:
和表示和的密文向量,r=<r0,…,rn-1>是噪音向量, 乘法运算的同态多项式为: and express and The ciphertext vector of , r=<r 0 , ..., r n-1 > is the noise vector, The homomorphic polynomial for the multiplication operation is:
其中~>>表示密文向量右移,当右移一个密文槽,的最高有效 分量被填充为原始的最高有效分量。最终的有效的密文结果乘积。where ~>> means the ciphertext vector is shifted to the right, when Shift right one ciphertext slot, The most significant component of is padded with the original most significant component. final Product of valid ciphertext results.
(4)除法运算的同态计算(4) Homomorphic calculation of division operation
除法是最复杂的基本算术运算。对于使用加法器电路进行算术运算的 简单计算机来说,使用传统的长除法(称为非还原除法)的变种提供了更简 单和更快的速度。该方法只需要对每个商位进行一次决策和加减法运算, 减减后不需要恢复步长。我们设置被除数和除数是的Two’s Complement,是余数,是商。具体算法如下所示Division is the most complex basic arithmetic operation. For simple computers that use adder circuits for arithmetic operations, a variant that uses traditional long division (called nonreductive division) provides simpler and faster speed. This method only needs to perform one decision and addition and subtraction operations for each quotient, and does not need to restore the step size after subtraction and subtraction. We set the dividend and divisor Yes Two's Complement, is the remainder, is a business. The specific algorithm is as follows
1.初始化和的值。1. Initialization and value of .
·算术左移n位。 · Arithmetic shift left by n bits.
·算术左移n位。 · Arithmetic shift left by n bits.
·算术右移n位。 · Arithmetic shift right n bits.
·填充n个0。· Fill n zeros.
2.根据的最低有效位执行下面的操作。2. According to The least significant bits perform the following operations.
·如果用1填充的最低有效位,逻辑左移1位。·if fill with 1 The least significant bit of , logically shifted left by 1 bit.
·如果用0填充的最低有效位,逻辑左移1位。·if pad with 0 The least significant bit of , logically shifted left by 1 bit.
3.重复第二部n-1次。3. Repeat the second part n-1 times.
4.转换(假设)。4. Convert (assuming ).
· ·
·取反 ·Negate
·求差 ·Seeking difference
5.最终的余数商位奇数,余数的范围是如 果余数是负数,需要做一次余数转换:和根据以上的算法我们可以写出除法的Boolean判断多项式(JCBP)5. The final remainder Quotient odd, remainder The range is If the remainder is negative, a remainder conversion is required: and According to the above algorithm, we can write the Boolean judgment polynomial of division (JCBP)
使用表示每次迭代余数的中间结果,除法的布尔多项式为:use Representing the intermediate result of the remainder of each iteration, the Boolean polynomial for division is:
其中是的最低有效位,最后执行校正和我们转换除法的Boolean判断多项式到同态多项式为:in Yes LSB of the least significant bit, the correction is performed last and We convert the Boolean judgment polynomial of division to a homomorphic polynomial as:
其中和表示和的密文向量。除法的同态多项式为:in and express and ciphertext vector. The homomorphic polynomial for division is:
其中表示的密文向量,表示的 密文向量,运算表示最终,我们 校正密文向量和 in express ciphertext vector, express ciphertext vector, Operational representation Finally, we correct the ciphertext vector and
和为除法同态运算最终的密文结果。 and The final ciphertext result for the division homomorphic operation.
本发明的安全性:Safety of the present invention:
整数算术运算的同态计算时是构建在DGHV及其变种上,因此其安全性 依赖于加密算法本身。在DGHV原始方案中,其安全性依赖于近似GCD困难 性假设保证了,单纯依靠因数分解很难直接从公钥恢复出私钥。以及增强 解密电路,保证密文结果不会泄露乘法或者加法的运算次数。加密电路对 明文的重新随机化掩盖了明文的信息。并通过哈希剩余引理证明的电路的 隐私性。之后对原始整数同态加密的改进方案,也同时继承了这一安全性。在整数基本运算同态运算中,求补运算的输入是经过对整数的原码加密的 密文和初始进位的密文加密算法本身的安全性保 证了加密后的每一个密文都无限接近于均匀分布(哈希剩余引理),唯一可 能泄露明文信息的是初始进位根据加密电路,包含的三个部 分,明文部分、公钥随机子序列、随机噪音三个部分。随机噪音部分保证 了密文中的噪音是随机的,公钥随机子序列保证了密文除以密钥所得的商 的随机性。这两部分的随机性保证了密文的随机性。因此即使知道了是0的密文,也无法从其中找出任何关于密钥的任何信息。在求补运算过程中, 是通过不断迭代运算,i-1位运算的进位作为求解i位补码其中一个输 入每一个输入的密文都参与了计算,即每个 密文被计算的概率都相同,因此计算过程中,密文的输入或者密文产生的 中间结果不会泄露任何信息。同样整数加法和减法同态计算与整数求补同 态计算类似(整数密文求补是特殊的整数密文加法运算),因此具有相同 的安全性。The homomorphic calculation of integer arithmetic operations is built on DGHV and its variants, so its security depends on the encryption algorithm itself. In the original DGHV scheme, its security depends on the assumption of approximate GCD difficulty, and it is difficult to directly recover the private key from the public key by simply relying on factorization. And enhance the decryption circuit to ensure that the ciphertext result will not reveal the number of operations of multiplication or addition. The re-randomization of the plaintext by the encryption circuit masks the information of the plaintext. And the privacy of the circuit proved by the Hash Remainder Lemma. Later improvements to the original integer homomorphic encryption also inherited this security. In the homomorphic operation of the basic operation of integers, the input of the complement operation is the ciphertext encrypted by the original code of the integer. and the ciphertext of the initial carry The security of the encryption algorithm itself ensures that each encrypted ciphertext is infinitely close to a uniform distribution (hash residual lemma), and the only thing that may leak the plaintext information is the initial carry According to the encryption circuit, it consists of three parts, the plaintext part, the public key random subsequence, and the random noise. The random noise part ensures that the noise in the ciphertext is random, and the random subsequence of the public key ensures the randomness of the quotient obtained by dividing the ciphertext by the key. The randomness of these two parts ensures the randomness of the ciphertext. So even knowing is the ciphertext of 0, and no information about the key can be found from it. In the process of the complement operation, it is through continuous iterative operation, the carry of the i-1 bit operation as one of the inputs to solve for i-bit complement Each input ciphertext participates in the calculation, that is, the probability of each ciphertext being calculated is the same, so during the calculation process, the input of the ciphertext or the intermediate result generated by the ciphertext will not reveal any information. Similarly, the homomorphic computation of integer addition and subtraction is similar to the homomorphic computation of integer complement (integer ciphertext complement is a special integer ciphertext addition operation), so it has the same security.
整数乘法同态计算过程涉及到了求补同态计算,加法同态计算。但是 并不表示整数乘法同态计算不会泄露任何信息。因为在乘法计算过程中需 要判断移位后的部分积与被乘数还是相加。存在判断的过 程是否是安全的是我们分析的重点。判断密文使用密文向量加上附加位 Enc(0)之后的最后两个密文和作为判断依据。像密文求补一样,我们 知道乘数密文附加位的密文,但是同样不会泄露信息。那么在 密文状态下判断最后密文过程中使用的公式(8),该公式的的加 法同态隐藏了的信息,隐藏了与部分积相加的是还是在这个过程中,不会泄露乘数最后两位的明文信息,我们 用2r,给运算的结果添加扰动,用模x0抹除运算过程中留下的痕迹。因为和都在参与了运算,每一个选择计算的分支也同时被计算,因 此被计算的概率相同,不会因为计算过程的偏好泄露信息。The process of integer multiplication homomorphic calculation involves complementary homomorphic calculation and addition homomorphic calculation. But that doesn't mean that the integer multiplication homomorphic computation doesn't leak any information. Because in the multiplication process, it is necessary to judge the shifted partial product with the multiplicand still add up. Whether the process of existential judgment is safe is the focus of our analysis. Judging ciphertext using ciphertext vector Add the last two ciphertexts after the additional bit Enc(0) and as a basis for judgment. Like ciphertext complement, we know that the multiplier ciphertext has additional bits ciphertext, but also does not reveal information. Then in the ciphertext state, the formula (8) used in the process of judging the final ciphertext, the formula The additive homomorphism of is hidden Information, hidden and partial product adding up is still In the process, the multiplier is not leaked last two The plaintext information of , we use 2r to add disturbance to the result of the operation, and use modulo x 0 to erase the traces left in the operation process. because and All are participating in the calculation, and each branch selected for calculation is also calculated at the same time, so the probability of being calculated is the same, and information will not be leaked due to the preference of the calculation process.
我们定义一个窃听不可区分性试验来猜测该实验 对任何攻击者A,以及任何安全参数λ,同态加密 ε=(Gen,Enc,Dec,Evalute)都适用。We define a wiretap indistinguishability test to guess This experiment is applicable to any attacker A, and any security parameter λ, homomorphic encryption ε=(Gen, Enc, Dec, Evalute).
窃听不可区分试验 eavesdropping indistinguishable test
(1).给定输入1λ给攻击者A,A输出一个结果 (1). Given an input of 1 λ to the attacker A, A outputs a result
(2).运行Gen(1λ)生成一个密钥k,选择两个随机比特b1和b2, b1←{0,-1},b2←{0,-1}。通过计算c为 挑战密文。(2). Run Gen(1 λ ) to generate a key k, select two random bits b 1 and b 2 , b 1 ←{0,-1}, b 2 ←{0,-1}. via caculation c is the challenge ciphertext.
(3).A输出两个比特b′1和b′2.(3).A outputs two bits b' 1 and b' 2 .
(4).该实验输出被定义为:如果 则成功,否则失败。(4). The experimental output is defined as: if success, otherwise fail.
根据同态加密本身是符合语义安全的,假设存在一个攻击者B存在∈的优势 能够恢复出密钥,转化成攻击者A下的优势为∈/4。对于所有多项式时间的 攻击者A,存在一个可忽略的函数negl(λ)=∈/4使得:According to the homomorphic encryption itself is semantically secure, it is assumed that there is an attacker B with the advantage of ∈ and can recover the key, which translates into the advantage of the attacker A as ∈/4. For all polynomial-time attackers A, there exists a negligible function negl(λ) = ∈/4 such that:
即使攻击者A知道c是明文消息运算的结果,仍然无法判断是从加密而来, 还是加密而来。自然也无法知道的结果。整数密文除法与乘法 虽然判断位不同但是相同的判断过程,因此也不会泄露信息。因此整数密 文除法也是安全的。Even if the attacker A knows that c is the result of the operation of the plaintext message, he still cannot judge whether it is from the plaintext message. encrypted, or Encrypted. nature can't know the result of. Integer ciphertext division and multiplication have different judgment bits but the same judgment process, so no information is leaked. Therefore integer ciphertext division is also safe.
本发明的噪音Noise of the present invention
在整数基本运算部分我们得出了n位整数求补、加、减、乘、除五种运 算的迭代公式需要计算的最大次数和最大项数(公式1,4,8,11)。具体如下 表1所示,In the basic operation of integers, we have obtained the maximum number of times and the maximum number of items to be calculated in the iterative formulas for the five operations of n-bit integer complement, addition, subtraction, multiplication, and division (formulas 1, 4, 8, and 11). The details are shown in Table 1 below.
表1.迭代公式的最大深度和项数Table 1. Maximum depth and number of terms for iterative formulas
整数乘法和除法的迭代公式的项数太大,这个不讨论具体值。通过表1 我们可以得出在求补、加法和减法的计算次数是乘法与密文除法运 算中计算次数位同态多项式f的噪音可以由每个输入所含的噪 音2ρ′、多项式次数d和该多项式的l1范数表示log d表示 同态多项式层数。整数算术运算的同态多项式的系数都为1,因此我们可以 用同态多项式的项数表示我们设置同态加密中的噪音长度为ρ′整数基 本运算的同态计算的噪音上限如表2所示:The iterative formulas for integer multiplication and division have too many terms to discuss specific values. From Table 1, we can conclude that the number of computations in complement, addition and subtraction is The number of counts in multiplication and ciphertext division operations The noise of a homomorphic polynomial f can be determined by the noise 2 ρ′ contained in each input, the polynomial degree d and the l 1 norm of the polynomial express log d represents the number of levels of homomorphic polynomials. The coefficients of the homomorphic polynomials of integer arithmetic operations are all 1, so we can express by the number of terms of the homomorphic polynomial We set the noise length in homomorphic encryption as the upper limit of the noise of the homomorphic calculation of the ρ′ integer basic operation as shown in Table 2:
表2.最大噪音大小Table 2. Maximum noise level
我们提出的整数算术运算的同态计算是参考计算机中二进制补码算术 运算规则,包括求补、加、减、乘、除运算,并将运算规则转换成只包含 逻辑与、异或运算的布尔多项式。乘法与除法需要不断地执行加减运算, 得到需要根据特殊位选择不同分支的结果。因此我们提出了判断包含所有 分支的布尔多项式(JCBP)。然后通过对密文的加法和乘法将JCBP转化为 判断同态多项式(JCHP),解决了密文无法直接做判断的问题;本发明可以为电子计票,密文检索,加密机器学习等提供基础的密文运算的支持;利 用本发明可以解决密文统计的基本数量特征的计算,比如平均值,相似度 和线性拟合等等。可进帮助密文统计进一步实现对密文文档的其他操作。The homomorphic calculation of integer arithmetic operations proposed by us refers to the two's complement arithmetic operation rules in computers, including complement, addition, subtraction, multiplication, and division operations, and converts the operation rules into Boolean operations that only contain logical AND and XOR operations. polynomial. Multiplication and division need to continuously perform addition and subtraction operations to obtain results that require different branches to be selected according to special bits. Therefore, we propose a Boolean polynomial (JCBP) that judges all branches. Then, the JCBP is transformed into a Judgment Homomorphic Polynomial (JCHP) through the addition and multiplication of the ciphertext, which solves the problem that the ciphertext cannot be directly judged; the invention can provide a basis for electronic vote counting, ciphertext retrieval, encrypted machine learning, etc. The ciphertext operation is supported by the present invention; the calculation of basic quantitative characteristics of ciphertext statistics, such as average value, similarity and linear fitting, can be solved by the present invention. It can help ciphertext statistics to further realize other operations on ciphertext documents.
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811355108.7A CN109412786B (en) | 2018-11-14 | 2018-11-14 | Integer cipher text arithmetic operation method based on homomorphic encryption |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811355108.7A CN109412786B (en) | 2018-11-14 | 2018-11-14 | Integer cipher text arithmetic operation method based on homomorphic encryption |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109412786A CN109412786A (en) | 2019-03-01 |
CN109412786B true CN109412786B (en) | 2022-09-06 |
Family
ID=65473120
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811355108.7A Active CN109412786B (en) | 2018-11-14 | 2018-11-14 | Integer cipher text arithmetic operation method based on homomorphic encryption |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109412786B (en) |
Families Citing this family (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111079934B (en) * | 2019-11-18 | 2022-09-27 | 华中科技大学 | Number Theoretical Transformation Unit and Method Applied to Error Learning Encryption Algorithm in Ring Domain |
CN113098675B (en) * | 2019-12-23 | 2023-04-18 | 郑珂威 | Binary data encryption system and method based on polynomial complete homomorphism |
US11671239B2 (en) | 2020-05-08 | 2023-06-06 | Samsung Electronics Co., Ltd. | Encryption method and apparatus based on homomorphic encryption using odd function property |
CN111371545B (en) * | 2020-05-27 | 2020-09-11 | 支付宝(杭州)信息技术有限公司 | Encryption method and system based on privacy protection |
CN112543091B (en) * | 2020-10-26 | 2022-10-14 | 中国人民武装警察部队工程大学 | Multi-key Fully Homomorphic Encryption with Fixed Ciphertext Length |
CN112653686B (en) * | 2020-12-17 | 2022-08-09 | 中国科学院电工研究所 | CAN bus message authentication method based on MAC encryption |
EP4050471A1 (en) * | 2021-02-26 | 2022-08-31 | Zama SAS | Encrypted scalar multiplication |
CN113849840B (en) * | 2021-10-13 | 2023-06-09 | 福建师范大学 | Encryption data statistical analysis method based on authenticatable encryption counter |
CN114063978A (en) * | 2021-10-27 | 2022-02-18 | 华控清交信息科技(北京)有限公司 | Data processing method and device and data processing device |
CN115001649A (en) * | 2022-04-15 | 2022-09-02 | 支付宝(杭州)信息技术有限公司 | Batch encryption method, related device, system, equipment, medium and program product |
CN114553394B (en) * | 2022-04-22 | 2022-08-16 | 哈尔滨工业大学(深圳)(哈尔滨工业大学深圳科技创新研究院) | Complementary code arithmetic unit and arithmetic method based on multi-key fully homomorphic scheme |
CN117478305B (en) * | 2023-12-28 | 2024-04-16 | 粤港澳大湾区数字经济研究院(福田) | Fully homomorphic encryption method, system, terminal and medium based on two-party security cooperation |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106452723B (en) * | 2016-12-13 | 2017-05-31 | 深圳市全同态科技有限公司 | Fully homomorphic encryption processing method based on modular operation |
CN107359979B (en) * | 2017-07-25 | 2019-11-01 | 西安电子科技大学 | Symmetrical full homomorphic cryptography method based on Representation theorem |
CN108282328B (en) * | 2018-02-02 | 2021-03-12 | 沈阳航空航天大学 | A statistical method of ciphertext based on homomorphic encryption |
-
2018
- 2018-11-14 CN CN201811355108.7A patent/CN109412786B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN109412786A (en) | 2019-03-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109412786B (en) | Integer cipher text arithmetic operation method based on homomorphic encryption | |
Sahari et al. | A pseudo-random numbers generator based on a novel 3D chaotic map with an application to color image encryption | |
CN107147484B (en) | Floating point number fully homomorphic encryption method facing privacy protection | |
CN109039640B (en) | An encryption and decryption hardware system and method based on RSA cryptographic algorithm | |
CN104283669B (en) | Re-encryption depth optimization method in full homomorphic cryptography | |
CN111444518A (en) | Security processor and method of operation, method of encrypting or decrypting data | |
Sangavi et al. | An exquisite multiple image encryption harnessing multi-scroll Lu–Chen and Chua chaotic systems employing domino strategy | |
Li et al. | Privacy preserving via multi-key homomorphic encryption in cloud computing | |
CN111682932B (en) | Single-round image encryption method based on mixed chaotic mapping | |
CN111368317B (en) | A computer data encryption system and method | |
JP2007187908A (en) | Modular exponentiation calculation device and method having tolerance to side-channel attack | |
JP4616169B2 (en) | Apparatus, method and program for calculating conversion parameter in Montgomery modular multiplication | |
Pandey et al. | Improved cryptanalysis of a ElGamal cryptosystem based on matrices over group rings | |
Latoui et al. | A two-parameter extended logistic chaotic map for modern image cryptosystems | |
Babenko et al. | Euclidean division method for the homomorphic scheme ckks | |
CN113114461A (en) | N-time public key compression method for integer homomorphic encryption | |
JP2018092010A (en) | Encryption device and encryption method, encryption program, key generation device, key generation method, and key generation program | |
You et al. | Secure two-party computation approach for ntruencrypt | |
Cao et al. | Image encryption algorithm based on an improved ML neuron model and DNA dynamic coding | |
Anshel et al. | Defeating the Hart et al, Beullens-Blackburn, Kotov-Menshov-Ushakov, and Merz-Petit Attacks on WalnutDSA (TM) | |
Varghese et al. | A Novel Method for Mapping Plaintext Characters to Elliptic Curve Affine points over Prime Field and Pseudorandom Number Generation | |
Song et al. | Grover on SPEEDY | |
Poniszewska-Marańda et al. | Code-based encryption algorithms for generating and verifying digital signature | |
CN115333740B (en) | An asymmetric encryption and signature method that can resist quantum computer attacks | |
Wilhelm | Aspects of hardware methodologies for the NTRU public-key cryptosystem |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |