WO2020006692A1 - 一种全同态加密方法、装置和计算机可读存储介质 - Google Patents

一种全同态加密方法、装置和计算机可读存储介质 Download PDF

Info

Publication number
WO2020006692A1
WO2020006692A1 PCT/CN2018/094430 CN2018094430W WO2020006692A1 WO 2020006692 A1 WO2020006692 A1 WO 2020006692A1 CN 2018094430 W CN2018094430 W CN 2018094430W WO 2020006692 A1 WO2020006692 A1 WO 2020006692A1
Authority
WO
WIPO (PCT)
Prior art keywords
homomorphic
mul
fhe
ciphertext
homomorphic encryption
Prior art date
Application number
PCT/CN2018/094430
Other languages
English (en)
French (fr)
Inventor
张鹏
孙小强
谢维信
喻建平
Original Assignee
深圳大学
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 深圳大学 filed Critical 深圳大学
Priority to PCT/CN2018/094430 priority Critical patent/WO2020006692A1/zh
Priority to US17/255,671 priority patent/US20210243005A1/en
Publication of WO2020006692A1 publication Critical patent/WO2020006692A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/008Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols involving homomorphic encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3006Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters
    • H04L9/3026Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters details relating to polynomials generation, e.g. generation of irreducible polynomials
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3093Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy involving Lattices or polynomial equations, e.g. NTRU scheme
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/12Details relating to cryptographic hardware or logic circuitry

Definitions

  • the invention relates to the field of computer encryption, in particular to a method, a device and a computer-readable storage medium for full homomorphic encryption.
  • Full homomorphic encryption allows arbitrary operations on the ciphertext, making the encryption algorithm very flexible.
  • Full homomorphic encryption supports any given function operation, as long as this function can be described by an algorithm, it can be implemented by a computer.
  • the cloud server can calculate the user's ciphertext without knowing the user's private key, and the decryption of the calculation result is equal to the result of the same calculation on the plaintext. This not only implements the data calculation function, but also guarantees the user data security.
  • This special property makes full homomorphic encryption widely applicable, such as secure outsourced computing, ciphertext search, and ciphertext machine learning classification.
  • Brakerski et al. Proposed a hierarchical fully homomorphic encryption scheme that does not require bootstrap operations, also known as the BGV scheme.
  • the BGV scheme uses the key exchange technology to reduce the size of the ciphertext, and reduces the ciphertext noise through the mode exchange technology. It has the security against a known attack 2 ⁇ .
  • the BGV scheme supports parallel processing of multi-bit plaintext.
  • the BGV scheme has higher homomorphic operation efficiency.
  • Helevi constructed a fully homomorphic encryption library HElib in 2013 using Gentry's optimization technology.
  • the key exchange technology and mode exchange technology used in the BGV scheme are described as follows:
  • R Z [x] / ⁇ x n +1> is an integer polynomial ring of modulus x n +1.
  • the elements in R q are represented by polynomials of degree lower than n, and their coefficients are ⁇ (-q + 1) / 2, L, -1,0,1, L, (q-1) / 2 ⁇ .
  • the matrices A, B are generated as follows:
  • Output new ciphertext with dimension n 2 among them Represents the binary decomposition of c 1 from the lowest bit to the highest bit, and satisfies
  • the main objective of the embodiments of the present invention is to provide a fully homomorphic encryption method, device, and computer-readable storage medium, so as to improve the efficiency of multiplicative homomorphism calculation in the full homomorphic encryption method.
  • a first aspect of an embodiment of the present invention provides a full homomorphic encryption method, where the method includes:
  • Step S2 Generate a private key sk and a public key pk according to the prime modulus q j ;
  • Step S3 encrypt the plaintext m according to the public key pk;
  • Step S4 Perform a homomorphic operation on two ciphertexts under the same private key.
  • the homomorphic operation includes a homomorphic addition operation FHE.Add (c ′, c ′′) and a homomorphic multiplication operation FHE.Mul (c ′, c ′′), wherein the process of the homomorphic multiplication FHE.Mul (c ′, c ′′) is as follows:
  • step S4 the process of the homomorphic addition operation FHE.Add (c ′, c ′′) is as follows:
  • step S2 the specific process of generating the private key sk and the public key pk according to the prime modulus q j is as follows:
  • Input parameter params randomly and uniformly generate s ⁇ R 2 , R 2 is an integer polynomial ring of modulus x n +1 and 2, and generate among them
  • the error term e ⁇ , t is the modulus of the plaintext space, Represents the operation of modulo q L-1 .
  • step S3 specifically includes:
  • step S1 is implemented by a prime modulus generating function FHE.Setup (1 ⁇ , L).
  • a second aspect of the embodiments of the present invention provides a fully homomorphic encryption device, which includes at least one processor, a memory, and an interface, and the at least one processor, the memory, and the interface are all connected through a bus;
  • the memory stores computer execution instructions
  • the at least one processor executes computer execution instructions stored in the memory, so that the fully homomorphic encryption device implements the steps of the fully homomorphic encryption method provided by the first aspect of the embodiments of the present invention.
  • a third aspect of the embodiments of the present invention provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the full homomorphism provided by the first aspect of the embodiments of the present invention is implemented Steps of the encryption method.
  • the full homomorphic encryption method of the present invention is mainly embodied in the following two aspects.
  • the present invention first uses a key exchange technology to reduce the multiplication ciphertext size from three ring elements to two ring elements, and then uses modular exchange technology Reduce and subtract the modulus of the ciphertext and decryption noise;
  • the present invention improves the addition homomorphic algorithm FHE.Add to support the operation of three ring elements, so that the key exchange technology and the modular exchange technology are called as little as possible during multiplication homomorphism.
  • FIG. 1 is a flowchart of a full homomorphic encryption method according to an embodiment of the present invention
  • FIG. 2 is a structural block diagram of a fully homomorphic encryption device according to an embodiment of the present invention.
  • the full homomorphic encryption method provided by the embodiment of the present invention mainly includes steps S1 to S4, which will be described in detail below.
  • step S1 is implemented by a prime modulus generating function FHE.Setup (1 ⁇ , L).
  • Step S2 Generate a private key sk and a public key pk according to the prime modulus q j .
  • Input parameter params randomly and uniformly generate s ⁇ R 2 , R 2 is an integer polynomial ring of modulus x n +1 and 2, and generate among them
  • the error term e ⁇ , t is the modulus of the plaintext space, Represents the operation of modulo q L-1 .
  • Step S3 The plaintext m is encrypted according to the public key pk.
  • Step S3 specifically includes:
  • Step S4 Perform a homomorphic operation on two ciphertexts under the same private key.
  • the homomorphic operation includes a homomorphic addition operation FHE.Add (c ′, c ′′) and a homomorphic multiplication operation FHE.Mul (c ′, c ′′).
  • the encrypted cipher text c (c 0 , c 1 , L, c k ) is decrypted by FHE.Dec (c, sk), and the original plain text m can be restored, as follows:
  • RLWE error learning hypothesis on the ring (RLWE) problem.
  • the difficulty of the RLWE problem is determined by the safety parameter ⁇ , parameter m, and prime modulus q.
  • log 2 (q) ⁇ ( ⁇ + 110) /7.2 is required, where phi (m) represents the dimension of the circle polynomial ⁇ m (x). If ⁇ is a constant, q will increase as m increases.
  • the present invention first uses a key exchange technology to reduce the multiplication ciphertext size from three ring elements to two ring elements, and then uses modular exchange technology Reduce and subtract the modulus of the ciphertext and decryption noise;
  • the present invention improves the addition homomorphic algorithm FHE.Add to support the operation of three ring elements, so that the key exchange technology and the modular exchange technology are called as little as possible during multiplication homomorphism.
  • an embodiment of the present invention further provides a fully homomorphic encryption device, which includes at least a processor 210, a memory 220, and an interface 230.
  • the at least one processor 210, the memory 220, and the interface 230 are all connected through a bus. connection;
  • the memory 220 stores computer-executable instructions
  • the at least one processor 210 executes computer execution instructions stored in the memory 220, so that the fully homomorphic encryption device implements the steps of the aforementioned fully homomorphic encryption method.
  • the disclosed apparatus and method may be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the modules is only a logical function division.
  • multiple modules or components may be combined or Can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or modules, and may be electrical, mechanical or other forms.
  • the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, which may be located in one place, or may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the objective of the solution of this embodiment.
  • each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist separately physically, or two or more modules may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or software functional modules.
  • the integrated module When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of the present invention essentially or part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium Including a plurality of instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.
  • the foregoing storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Physics (AREA)
  • Pure & Applied Mathematics (AREA)
  • Algebra (AREA)
  • Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

一种全同态加密方法、装置和计算机可读存储介质,以提高全同态加密方法中的乘法同态计算的效率。所述方法包括:步骤S1:根据输入的安全参数λ和加密层数L生成素模数q j=q j(λ,L)(S1),q jmodn≡1,其中n为2的整数次幂,j=0,1,L,L-1,并且q 0<q 1<L<q L-1;步骤S2:根据素模数q j生成私钥sk及公钥pk(S2);步骤S3:根据公钥pk对明文m进行加密(S3);步骤S4:对同一私钥下的两个密文进行同态运算(S4),所述同态运算包括同态加法运算FHE.Add(c',c")和同态乘法运算FHE.Mul(c',c")。

Description

一种全同态加密方法、装置和计算机可读存储介质 技术领域
本发明涉及计算机加密领域,尤其涉及一种全同态加密方法、装置和计算机可读存储介质。
背景技术
全同态加密允许对密文做任意的运算,使得加密算法具有很强的灵活性。全同态加密支持任意给定的函数运算,只要这个函数可通过算法描述即可用计算机实现。由于全同态加密无需解密便能对密文进行运算,因此云服务器可以在未知用户私钥的情况下对用户密文进行计算,并且计算结果解密后等于对明文做同样计算的结果。这样既实现了数据计算功能,又保证了用户数据安全。这种特殊的性质使得全同态加密具有广泛的应用价值,例如安全外包计算、密文搜索、密文机器学习分类等。
2012年,Brakerski等人提出一种不需要自举运算的分层全同态加密方案,也被称为BGV方案。BGV方案利用密钥交换技术约减密文尺寸,通过模交换技术降低密文噪声,具有抗已知攻击2 λ的安全性。利用单指令多数据技术,BGV方案支持对多比特明文的并行处理。与其它全同态方案相比,BGV方案的同态运算效率较高。基于BGV方案,2013年Helevi利用Gentry的优化技术构造了一种全同态加密库HElib。BGV方案所主要采用的密钥交换技术与模交换技术描述如下:
密钥交换技术
给定密钥s 1,s 2,模数q,矩阵A及
Figure PCTCN2018094430-appb-000001
并且满足
Figure PCTCN2018094430-appb-000002
其中R q=R/<q>=Z q[x]/<x n+1>为模x n+1和q的整多项式环,N为维数,n为2的整数次幂,x n+1在有理数域上不可约,R=Z[x]/<x n+1>为模x n+1的整多项式环,R q中 的元素由次数低于n的多项式表示,其系数在{(-q+1)/2,L,-1,0,1,L,(q-1)/2}中选取。矩阵A,B按如下方法生成:
Figure PCTCN2018094430-appb-000003
执行全同态公钥产生算法生成A,其中
Figure PCTCN2018094430-appb-000004
n 1为s 1的维数,
Figure PCTCN2018094430-appb-000005
表示向上取整。
将B置为A+Powersof2(s 1),即将
Figure PCTCN2018094430-appb-000006
加到A的第一列,输出转换矩阵
Figure PCTCN2018094430-appb-000007
其中
Figure PCTCN2018094430-appb-000008
表示向下取整。
Figure PCTCN2018094430-appb-000009
输出维数为n 2的新密文
Figure PCTCN2018094430-appb-000010
其中
Figure PCTCN2018094430-appb-000011
表示c 1从最低位到最高位的二进制分解,并满足
Figure PCTCN2018094430-appb-000012
模交换技术
假定p,q为两个奇模数,c为密文。新的密文c′近似等于(p/q)·c,并且满足c′=cmod2。若对任意的密钥s有|[<c,s>] q|<q/2-(q/p)·l 1(s),则
|[<c′,s>] p|=|[<c,s>] q|mod2,|[<c′,s>] p|<(p/q)·|[<c′,s>] q|+l 1(s)
其中l 1(s)代表s的l 1范数。原先模q下的c由经模交换技术转换为模p下的c′。
在HElib的乘法同态中,先使用模交换技术对乘法密文的解密噪声进行约减,再利用密钥交换技术对乘法密文的尺寸进行约减。可以看出,模交换技术被实施在三个环元素的乘法密文上,导致乘法同态效率效率低下;另外,在Helib的算法中,每次乘法同态均需密钥交换技术和模交换技术,同样使得乘法同态效率低下。
发明内容
本发明实施例的主要目的在于提供一种全同态加密方法、装置和计算机可读存储介质,以提高全同态加密方法中的乘法同态计算的效率。
为实现上述目的,本发明实施例第一方面提供一种全同态加密方法,所述方法包括:
步骤S1:根据输入的安全参数λ和加密层数L生成素模数q j=q j(λ,L),q jmodn≡1,其中n为2的整数次幂,j=0,1,L,L-1,并且q 0<q 1<L<q L-1
步骤S2:根据素模数q j生成私钥sk及公钥pk;
步骤S3:根据公钥pk对明文m进行加密;
步骤S4:对同一私钥下的两个密文进行同态运算,所述同态运算包括同态加法运算FHE.Add(c′,c″)和同态乘法运算FHE.Mul(c′,c″),其中,所述同态乘法运算FHE.Mul(c′,c″)的过程如下:
给定两个同一私钥下的密文c′=(c′ 0,c′ 1),c″=(c″ 0,c″ 1),按照如下过程计算结果密文c mul=(c mul,0,c mul,1,c mul,2),即
Figure PCTCN2018094430-appb-000013
若c mul的下一步运算为加法同态或者不存在运算,则直接输出c mul
若c mul的下一步运算为乘法同态,则利用前述密钥交换技术将c mul的密文尺寸由三个环元素降为两个环元素,得到的新密文为
Figure PCTCN2018094430-appb-000014
其中:
Figure PCTCN2018094430-appb-000015
其中j∈[0,L-1]。
根据本发明实施例第一方面提供的全同态加密方法,步骤S4中,所述同态加法运算FHE.Add(c′,c″)的过程如下:
给定两个同一私钥下的密文c′=(c′ 0,c′ 1,L,c′ r),c″=(c″ 0,c″ 1,L,c″ k),其中r,k∈{1,2},且r≤k,
若r=1,k=1,则同态加法密文为
Figure PCTCN2018094430-appb-000016
若r=1,k=2,则同态加法密文为
Figure PCTCN2018094430-appb-000017
若r=2,k=2,则同态加法密文为
Figure PCTCN2018094430-appb-000018
其中j∈[0,L-1]。
根据本发明实施例第一方面提供的全同态加密方法,步骤S2中,根据素模数q j生成私钥sk及公钥pk的具体过程如下:
Figure PCTCN2018094430-appb-000019
表示误差分布,
Figure PCTCN2018094430-appb-000020
为模x n+1和q j的整多项式环,令参数params=(q j=0,1,L,L-1,χ),
在密钥生成函数FHE.KeyGen(params)中进行如下运算:
输入参数params,随机均匀生成s∈R 2,R 2为模x n+1和2的整多项式环,生成
Figure PCTCN2018094430-appb-000021
其中
Figure PCTCN2018094430-appb-000022
误差项e∈χ,t为明文空间模数,
Figure PCTCN2018094430-appb-000023
代表模q L-1运算,给定整数p,交换矩阵w L-1=(b L-1,a L-1),其中
Figure PCTCN2018094430-appb-000024
Figure PCTCN2018094430-appb-000025
e L-1∈χ,得到私钥sk=s及公钥pk=(b,a,w L-1)。
根据本发明实施例第一方面提供的全同态加密方法,步骤S3具体包括:
在加密函数FHE.Enc(pk,m)中,给定m∈R t,其中R t为模x n+1和2的整多项式环,随机从χ中选取u和e i,其中i=0,1,按照如下公式生成密文c:
Figure PCTCN2018094430-appb-000026
根据本发明实施例第一方面提供的全同态加密方法,所述方法还包括解密运算FHE.Dec(c,sk),其中,定义密文为c=(c 0,c 1,L,c k),
若k=1,则
Figure PCTCN2018094430-appb-000027
若k=2,则
Figure PCTCN2018094430-appb-000028
根据本发明实施例第一方面提供的全同态加密方法,其特征在于,步骤S1通过素模数生成函数FHE.Setup(1 λ,L)来实现。
本发明实施例第二方面提供一种全同态加密装置,其包括至少一处理器、存储器及接口,所述至少一处理器、存储器及接口均通过总线连接;
所述存储器存储计算机执行指令;
所述至少一个处理器执行所述存储器存储的计算机执行指令,使得所述全同态加密装置实现本发明实施例第一方面提供的全同态加密方法的步骤。
本发明实施例第三方面提供一种计算机可读存储介质,所述计算机可读存 储介质存储有计算机程序,所述计算机程序被处理器执行时实现本发明实施例第一方面提供的全同态加密方法的步骤。
与现有技术相比,本发明的全同态加密方法主要体现在如下两个方面。
首先,为提高乘法同态效率,本发明改进乘法同态算法FHE.Mul中,首先利用密钥交换技术将乘法密文尺寸由三个环元素约减为两个环元素,再利用模交换技术约减乘法密文的模数和解密噪声;
其次,为提高同态运算效率,本发明改进加法同态算法FHE.Add,以支持三个环元素的运算,使得乘法同态时尽可能少地调用密钥交换技术和模交换技术。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的全同态加密方法的流程图;
图2为本发明实施例提供的全同态加密装置的结构框图。
具体实施方式
为使得本发明的发明目的、特征、优点能够更加的明显和易懂,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而非全部实施例。基于本发明中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
如图1所示,本发明实施例提供的全同态加密方法主要包括步骤S1至 S4,下面进行详细说明。
步骤S1:根据输入的安全参数λ和加密层数L生成素模数q j=q j(λ,L),q jmodn≡1,其中n为2的整数次幂,j=0,1,L,L-1,并且q 0<q 1<L<q L-1
需要说明的是,步骤S1通过素模数生成函数FHE.Setup(1 λ,L)来实现。
步骤S2:根据素模数q j生成私钥sk及公钥pk。
具体地,根据素模数q j生成私钥sk及公钥pk的具体过程如下:
Figure PCTCN2018094430-appb-000029
表示误差分布,
Figure PCTCN2018094430-appb-000030
为模x n+1和q j的整多项式环,令参数params=(q j=0,1,L,L-1,χ),
在密钥生成函数FHE.KeyGen(params)中进行如下运算:
输入参数params,随机均匀生成s∈R 2,R 2为模x n+1和2的整多项式环,生成
Figure PCTCN2018094430-appb-000031
其中
Figure PCTCN2018094430-appb-000032
误差项e∈χ,t为明文空间模数,
Figure PCTCN2018094430-appb-000033
代表模q L-1运算,给定整数p,交换矩阵w L-1=(b L-1,a L-1),其中
Figure PCTCN2018094430-appb-000034
Figure PCTCN2018094430-appb-000035
e L-1∈χ,得到私钥sk=s及公钥pk=(b,a,w L-1)。
步骤S3:根据公钥pk对明文m进行加密。
步骤S3具体包括:
在加密函数FHE.Enc(pk,m)中,给定m∈R t,其中R t为模x n+1和2的整多项式环,随机从χ中选取u和e i,其中i=0,1,按照如下公式生成密文c:
Figure PCTCN2018094430-appb-000036
步骤S4:对同一私钥下的两个密文进行同态运算,所述同态运算包括同态加法运算FHE.Add(c′,c″)和同态乘法运算FHE.Mul(c′,c″)。
其中,所述同态乘法运算FHE.Mul(c′,c″)的过程如下:
给定两个同一私钥下的密文c′=(c′ 0,c′ 1),c″=(c″ 0,c″ 1),按照如下过程计算结果密文c mul=(c mul,0,c mul,1,c mul,2),即
Figure PCTCN2018094430-appb-000037
若c mul的下一步运算为加法同态或者不存在运算,则直接输出c mul
若c mul的下一步运算为乘法同态,则利用前述密钥交换技术将c mul的密文尺寸由三个环元素降为两个环元素,得到的新密文为
Figure PCTCN2018094430-appb-000038
其中:
Figure PCTCN2018094430-appb-000039
其中,j∈[0,L-1],
利用前述模交换技术将
Figure PCTCN2018094430-appb-000040
转变为c fresh,其模数由p·q j降为q j,解密噪声也被降低。
其中,所述同态加法运算FHE.Add(c′,c″)的过程如下:
给定两个同一私钥下的密文c′=(c′ 0,c′ 1,L,c′ r),c″=(c″ 0,c″ 1,L,c″ k),其中r,k∈{1,2},且r≤k,
若r=1,k=1,则同态加法密文为
Figure PCTCN2018094430-appb-000041
若r=1,k=2,则同态加法密文为
Figure PCTCN2018094430-appb-000042
若r=2,k=2,则同态加法密文为
Figure PCTCN2018094430-appb-000043
其中j∈[0,L-1]。
加密完成后,对加密的密文c=(c 0,c 1,L,c k)进行解密运算FHE.Dec(c,sk),即可还原出其中的原始明文m,具体如下:
若k=1,则
Figure PCTCN2018094430-appb-000044
若k=2,则
Figure PCTCN2018094430-appb-000045
需要说明的是,上述的全同态加密方法的安全性依赖环上误差学习假设(RLWE)问题。RLWE问题的困难性由安全参数λ,参数m,素模数q决定。为保证所提方案的λ,则要求phi(m)>log 2(q)·(λ+110)/7.2,其中phi(m)表示分圆多项式Φ m(x)的维数。若λ为一常数,q将随着m的增长而增长。例如,令λ=80,若phi(m)=1176,则log 2(q)=44,即m=1247,q=2 44;若phi(m)=2880,则log 2(q)=109,即m=3133,q=2 109
上述的全同态加密方法的优点主要体现在如下两个方面。
首先,为提高乘法同态效率,本发明改进乘法同态算法FHE.Mul中,首先 利用密钥交换技术将乘法密文尺寸由三个环元素约减为两个环元素,再利用模交换技术约减乘法密文的模数和解密噪声;
其次,为提高同态运算效率,本发明改进加法同态算法FHE.Add,以支持三个环元素的运算,使得乘法同态时尽可能少地调用密钥交换技术和模交换技术。
如图2所示,本发明实施例还提供一种全同态加密装置,其包括至少一处理器210、存储器220及接口230,所述至少一处理器210、存储器220及接口230均通过总线连接;
所述存储器220存储计算机执行指令;
所述至少一个处理器210执行所述存储器220存储的计算机执行指令,使得所述全同态加密装置实现上述的全同态加密方法的步骤。
在本申请所提供的实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的 形式实现。
所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
需要说明的是,对于前述的各方法实施例,为了简便描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其它顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定都是本发明所必须的。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其它实施例的相关描述。
以上为对本发明所提供的全同态加密方法、装置和计算机可读存储介质的描述,对于本领域的技术人员,依据本发明实施例的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本发明的限制。

Claims (8)

  1. 一种全同态加密方法,其特征在于,所述方法包括:
    步骤S1:根据输入的安全参数λ和加密层数L生成素模数q j=q j(λ,L),q jmod n≡1,其中n为2的整数次幂,j=0,1,L,L-1,并且q 0<q 1<L<q L-1
    步骤S2:根据素模数q j生成私钥sk及公钥pk;
    步骤S3:根据公钥pk对明文m进行加密;
    步骤S4:对同一私钥下的两个密文进行同态运算,所述同态运算包括同态加法运算FHE.Add(c′,c″)和同态乘法运算FHE.Mul(c′,c″),其中,所述同态乘法运算FHE.Mul(c′,c″)的过程如下:
    给定两个同一私钥下的密文c′=(c′ 0,c′ 1),c″=(c″ 0,c″ 1),按照如下过程计算结果密文c mul=(c mul,0,c mul,1,c mul,2),即
    Figure PCTCN2018094430-appb-100001
    若c mul的下一步运算为加法同态或者不存在运算,则直接输出c mul
    若c mul的下一步运算为乘法同态,则利用前述密钥交换技术将c mul的密文尺寸由三个环元素降为两个环元素,得到的新密文为
    Figure PCTCN2018094430-appb-100002
    其中:
    Figure PCTCN2018094430-appb-100003
    其中j∈[0,L-1]。
  2. 如权利要求1所述全同态加密方法,其特征在于,步骤S4中,所述同态加法运算FHE.Add(c′,c″)的过程如下:
    给定两个同一私钥下的密文c′=(c′ 0,c′ 1,L,c′ r),c″=(c″ 0,c″ 1,L,c″ k),其中r,k∈{1,2},且r≤k,
    若r=1,k=1,则同态加法密文为
    Figure PCTCN2018094430-appb-100004
    若r=1,k=2,则同态加法密文为
    Figure PCTCN2018094430-appb-100005
    若r=2,k=2,则同态加法密文为
    Figure PCTCN2018094430-appb-100006
    其中j∈[0,L-1]。
  3. 如权利要求1所述全同态加密方法,其特征在于,步骤S2中,根据素模数q j生成私钥sk及公钥pk的具体过程如下:
    Figure PCTCN2018094430-appb-100007
    表示误差分布,
    Figure PCTCN2018094430-appb-100008
    为模x n+1和q j的整多项式环,令参数params=(q j=0,1,L,L-1,χ),
    在密钥生成函数FHE.KeyGen(params)中进行如下运算:
    输入参数params,随机均匀生成s∈R 2,R 2为模x n+1和2的整多项式环,生成
    Figure PCTCN2018094430-appb-100009
    其中
    Figure PCTCN2018094430-appb-100010
    误差项e∈χ,t为明文空间模数,
    Figure PCTCN2018094430-appb-100011
    代表模q L-1运算,给定整数p,交换矩阵w L-1=(b L-1,a L-1),其中
    Figure PCTCN2018094430-appb-100012
    Figure PCTCN2018094430-appb-100013
    e L-1∈χ,得到私钥sk=s及公钥pk=(b,a,w L-1)。
  4. 如权利要求3所述全同态加密方法,其特征在于,步骤S3具体包括:
    在加密函数FHE.Enc(pk,m)中,给定m∈R t,其中R t为模x n+1和2的整多项式环,随机从χ中选取u和e i,其中i=0,1,按照如下公式生成密文c:
    Figure PCTCN2018094430-appb-100014
  5. 如权利要求1至4任意一项所述全同态加密方法,其特征在于,所述方法还包括解密运算FHE.Dec(c,sk),其中,定义密文为c=(c 0,c 1,L,c k),
    若k=1,则
    Figure PCTCN2018094430-appb-100015
    若k=2,则
    Figure PCTCN2018094430-appb-100016
  6. 如权利要求1至4任意一项所述全同态加密方法,其特征在于,步骤S1通过素模数生成函数FHE.Setup(1 λ,L)来实现。
  7. 一种全同态加密装置,其特征在于,所述装置包括至少一处理器、存储器及接口,所述至少一处理器、存储器及接口均通过总线连接;
    所述存储器存储计算机执行指令;
    所述至少一个处理器执行所述存储器存储的计算机执行指令,使得所述全同态加密装置实现如权利要求1至6任意一项所述方法的步骤。
  8. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序, 其特征在于,所述计算机程序被处理器执行时实现如权利要求1至6任意一项所述方法的步骤。
PCT/CN2018/094430 2018-07-04 2018-07-04 一种全同态加密方法、装置和计算机可读存储介质 WO2020006692A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/094430 WO2020006692A1 (zh) 2018-07-04 2018-07-04 一种全同态加密方法、装置和计算机可读存储介质
US17/255,671 US20210243005A1 (en) 2018-07-04 2018-07-04 Fully homomorphic encryption method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/094430 WO2020006692A1 (zh) 2018-07-04 2018-07-04 一种全同态加密方法、装置和计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2020006692A1 true WO2020006692A1 (zh) 2020-01-09

Family

ID=69060517

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/094430 WO2020006692A1 (zh) 2018-07-04 2018-07-04 一种全同态加密方法、装置和计算机可读存储介质

Country Status (2)

Country Link
US (1) US20210243005A1 (zh)
WO (1) WO2020006692A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113055172A (zh) * 2021-03-31 2021-06-29 北京金山云网络技术有限公司 一种密钥协商方法、装置、电子设备及存储介质
CN114499822A (zh) * 2021-12-27 2022-05-13 上海海洋大学 一种多源数据的高效外包聚合及指定获取方法
CN115150055A (zh) * 2022-06-12 2022-10-04 中国科学院重庆绿色智能技术研究院 一种基于同态加密的隐私保护岭回归方法
CN115396150A (zh) * 2022-07-25 2022-11-25 支付宝(杭州)信息技术有限公司 数据预处理方法、数据加密方法、装置和设备
CN115510466A (zh) * 2022-09-28 2022-12-23 北京瑞莱智慧科技有限公司 密文预测方法、相关装置及存储介质

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115810208A (zh) * 2021-09-14 2023-03-17 超聚变数字技术有限公司 一种人脸识别方法、设备及系统
CN114465708B (zh) * 2022-03-17 2023-07-21 北京绪方科技有限公司 隐私数据处理方法及装置、系统、电子设备、存储介质
CN114884645B (zh) * 2022-07-11 2022-09-09 华控清交信息科技(北京)有限公司 一种隐私计算方法、装置和可读存储介质
CN115102688B (zh) * 2022-08-24 2022-11-22 北京信安世纪科技股份有限公司 数据处理方法、多项式计算方法及电子设备
KR20240030416A (ko) 2022-08-30 2024-03-07 삼성전자주식회사 동형 암호 연산기 및 그것을 포함하는 스토리지 장치, 그리고 그것의 레벨 구성 방법
CN117118617B (zh) * 2023-10-24 2024-01-09 北京隐算科技有限公司 一种基于模分量同态的分布式门限加解密方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170147835A1 (en) * 2015-11-25 2017-05-25 International Business Machines Corporation Efficient two party oblivious transfer using a leveled fully homomorphic encryption
CN106982113A (zh) * 2017-05-02 2017-07-25 北京邮电大学 基于非交换单群的公钥全同态数据处理方法及装置
CN107104796A (zh) * 2017-05-02 2017-08-29 北京邮电大学 一种基于非交换群上的对称乘法同态加密方法及装置
CN107294697A (zh) * 2017-07-21 2017-10-24 西安电子科技大学 基于明文相似矩阵的对称全同态加密方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170147835A1 (en) * 2015-11-25 2017-05-25 International Business Machines Corporation Efficient two party oblivious transfer using a leveled fully homomorphic encryption
CN106982113A (zh) * 2017-05-02 2017-07-25 北京邮电大学 基于非交换单群的公钥全同态数据处理方法及装置
CN107104796A (zh) * 2017-05-02 2017-08-29 北京邮电大学 一种基于非交换群上的对称乘法同态加密方法及装置
CN107294697A (zh) * 2017-07-21 2017-10-24 西安电子科技大学 基于明文相似矩阵的对称全同态加密方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
SUN, XIAOQIANG ET AL.: "Efficient Identity-Based Leveled Fully Homomorphic Encryption from RLWE", SECURITY AND COMMUNICATION NETWORKS, vol. 9, no. 18, 18 November 2016 (2016-11-18) - December 2016 (2016-12-01), pages 5157 - 5160, XP055669143, ISSN: 1939-0122 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113055172A (zh) * 2021-03-31 2021-06-29 北京金山云网络技术有限公司 一种密钥协商方法、装置、电子设备及存储介质
CN113055172B (zh) * 2021-03-31 2022-11-04 北京金山云网络技术有限公司 一种密钥协商方法、装置、电子设备及存储介质
CN114499822A (zh) * 2021-12-27 2022-05-13 上海海洋大学 一种多源数据的高效外包聚合及指定获取方法
CN114499822B (zh) * 2021-12-27 2024-05-14 上海海洋大学 一种多源数据的高效外包聚合及指定获取方法
CN115150055A (zh) * 2022-06-12 2022-10-04 中国科学院重庆绿色智能技术研究院 一种基于同态加密的隐私保护岭回归方法
CN115150055B (zh) * 2022-06-12 2024-05-24 中国科学院重庆绿色智能技术研究院 一种基于同态加密的隐私保护岭回归方法
CN115396150A (zh) * 2022-07-25 2022-11-25 支付宝(杭州)信息技术有限公司 数据预处理方法、数据加密方法、装置和设备
CN115510466A (zh) * 2022-09-28 2022-12-23 北京瑞莱智慧科技有限公司 密文预测方法、相关装置及存储介质
CN115510466B (zh) * 2022-09-28 2024-03-05 北京瑞莱智慧科技有限公司 密文预测方法、相关装置及存储介质

Also Published As

Publication number Publication date
US20210243005A1 (en) 2021-08-05

Similar Documents

Publication Publication Date Title
WO2020006692A1 (zh) 一种全同态加密方法、装置和计算机可读存储介质
CN108718231B (zh) 一种全同态加密方法、装置和计算机可读存储介质
CN110363030B (zh) 用于执行基于格的密码操作的方法和处理设备
JP7486529B2 (ja) プライベート情報検索に応用される準同型暗号化方法
JP5572610B2 (ja) セキュリティ強化のための転置データ変換
JP2020052393A (ja) 素数モジュロの二重カプセル化に基づく1対多分配鍵管理によるポスト量子非対称鍵暗号化システム
Odelu et al. A secure effective key management scheme for dynamic access control in a large leaf class hierarchy
EP3566385A1 (en) Homomorphic white box system and method for using same
JP2008252299A (ja) 暗号処理システム及び暗号処理方法
WO2009026771A1 (fr) Procédé pour négocier une clé, chiffrer et déchiffrer des informations, signer et authentifier les informations
JPWO2016159357A1 (ja) 秘密計算システム、サーバ装置、秘密計算方法、および、プログラム
Chatterjee et al. Sorting of fully homomorphic encrypted cloud data: Can partitioning be effective?
Sengupta et al. Message mapping and reverse mapping in elliptic curve cryptosystem
US11902432B2 (en) System and method to optimize generation of coprime numbers in cryptographic applications
US20220085999A1 (en) System and method to optimize decryption operations in cryptographic applications
CN110851845A (zh) 一种轻量级单用户多数据的全同态数据封装方法
US20220085998A1 (en) System and method to generate prime numbers in cryptographic applications
CN109040041B (zh) 数据分层加密装置及相关电子装置、存储介质
Ruan et al. An efficient private set intersection protocol for the cloud computing environments
US11895230B2 (en) Information processing apparatus, secure computation method, and program
CN110495134B (zh) 用于为有限域迪菲-赫尔曼选择安全质数的方法和系统
US20210297233A1 (en) System and method for performing a fully homomorphic encryption on a plain text
Ariffin et al. AA β public key cryptosystem-A comparative analysis against RSA and ECC
Best et al. Secure Storage with Deduplication
Al-Kaabi et al. ASurvey ON ENHANCED RSA ALGORITHMS

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: 18925351

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 12.05.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18925351

Country of ref document: EP

Kind code of ref document: A1