Security method and apparatus based on homomorphic encryption
Through the public key switching algorithm and solution switching algorithm to convert ciphertext, the problem of circuit bootstrap overhead in homomorphic encryption technology is solved, the computing efficiency is improved and the storage overhead is reduced, and efficient homomorphic computing is achieved.
Patent Information
- Application Number
- PCT/CN2023/099246
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-06-08
- Publication Date
- 2024-12-12
AI Technical Summary
In the existing homomorphic encryption technology, the calculation overhead of circuit bootstrap in the hierarchical homomorphic computing mode is large, resulting in low computing efficiency and the key size occupies a large storage space, resulting in high storage overhead.
Through the public key switching algorithm and solution switching algorithm, the LWE ciphertext at level 2 is converted into RLWE' ciphertext at level 1, and the RGSW ciphertext is obtained through splicing operations, reducing the calculation overhead and key size of the privacy key switching algorithm , reduce the overhead of circuit bootstrap.
It effectively reduces the overhead of circuit bootstrap in the hierarchical homomorphic computing mode, improves computing efficiency, reduces storage overhead, and improves computing performance.
Smart Images

Figure CN2023099246_12122024_PF_FP_ABST
Abstract
Description
A security method and device based on homomorphic encryption Technical Field
[0001] The present application relates to the technical field of cryptography, and in particular to a security method and device based on homomorphic encryption. Background Art
[0002] Homomorphic encryption allows for direct homomorphic computation on ciphertext, and the decrypted ciphertext yields the same result as if the plaintext had been directly computed. A typical example of homomorphic computation is the hierarchical homomorphic computation model based on the fully homomorphic encryption scheme over the torus (TFHE), which consists of three levels: level 0, level 1, and level 2. The transition from level 0 to level 2 involves a functional bootstrapping (FBS) process to reduce ciphertext noise. The homomorphic message ciphertexts at levels 0 and 2 are in the form of learning with errors (LWE). A private key switching algorithm is required to convert the LWE ciphertext at level 2 into the Gentry Sahai Water's ring version (RGSW) ciphertext at level 1 for hierarchical homomorphic computation at level 1. The transformation from the LWE ciphertext at level 0 to the RGSW ciphertext at level 2 is called circuit bootstrapping.
[0003] However, the computational overhead of circuit bootstrapping is relatively large, resulting in relatively low computational efficiency.
[0004] Summary of the Invention
[0005] The embodiments of the present application provide a security method and device based on homomorphic encryption, which can reduce the overhead of circuit bootstrapping in a hierarchical homomorphic computing mode and improve computing efficiency.
[0006] To achieve the above objectives, this application adopts the following technical solutions:
[0007] In a first aspect, a security method based on homomorphic encryption is provided, the method comprising: obtaining a level-2 false learning hypothesis (LWE) ciphertext; converting the level-2 LWE ciphertext into a level-1 first ring false learning hypothesis (RLWE') ciphertext by performing a public key switching (PubKS) algorithm and a concatenation operation; and calculating the first RLWE' ciphertext by performing a scheme switching (SS) algorithm to obtain a level-1 first RGSW ciphertext.
[0008] Based on the method described in the first aspect, it can be seen that since the RGSW ciphertext is obtained by concatenating two RLWE' ciphertexts, the overhead of the private key switching algorithm lies in the need to calculate the two RLWE' ciphertexts separately, resulting in relatively high overhead. In response, a single RLWE' ciphertext, such as the first RLWE' ciphertext, is calculated using the public key switching algorithm. This first RLWE' ciphertext is then expanded into an RGSW ciphertext, such as the first RGSW ciphertext, using the scheme switching algorithm. This ciphertext has a smaller key size and lower overhead than calculating the two RLWE' ciphertexts separately. Therefore, the circuit bootstrapping overhead in the hierarchical homomorphic computing mode can be reduced, thereby improving computational efficiency.
[0009] In one possible design, the LWE ciphertexts of level 2 are l LWE ciphertexts, where l is an integer greater than 1. The LWE ciphertexts of level 2 are converted into first RLWE' ciphertexts of level 1 by executing a public key switching algorithm and a splicing operation, including: executing the public key switching algorithm l times to convert each of the l LWE ciphertexts into a corresponding first RLWE ciphertext, for a total of l first RLWE ciphertexts; and splicing the l first RLWE ciphertexts into a first RLWE' ciphertext.
[0010] For example, by executing the public key switching algorithm, each of the l LWE ciphertexts is converted into a corresponding first RLWE ciphertext as shown below:
[0011] Among them, f0 is the calculation function of the public key switching algorithm, is the key of level 2, sk is the key of level 1, is the i-th LWE ciphertext among l LWE ciphertexts, v i is the i-th component of the gadget vector, m is the plaintext, RLWE sk (v i m) is the i-th first RLWE ciphertext.
[0012] Optionally, the method described in the first aspect may further include: receiving a key of a public key switching algorithm, where the key of the public key switching algorithm is the key used when performing the public key switching algorithm. The key of the public key switching algorithm is the RLWE' ciphertext obtained by homomorphically encrypting the key of level 2 using the key of level 1. That is, the use of the public key switching algorithm can be flexibly indicated by dynamically configuring the key of the public key switching algorithm, but it is not limited. For example, the public key switching algorithm can also be used by default.
[0013] Optionally, calculating the first RGSW ciphertext of level 1 from the first RLWE' ciphertext by executing a scheme switching algorithm includes: calculating a corresponding second RLWE' ciphertext from the first RLWE' ciphertext by executing the scheme switching algorithm, and concatenating the first RLWE' ciphertext and the second RLWE' ciphertext into the first RGSW ciphertext. The plaintext corresponding to the second RLWE' ciphertext is related to the homomorphic encryption key of the first RLWE' ciphertext. For example, the plaintext corresponding to the second RLWE' ciphertext can be obtained by multiplying the plaintext of the homomorphic encryption key of the first RLWE' ciphertext and the message plaintext.
[0014] For example, calculating the first RGSW ciphertext of level 1 from the first RLWE' ciphertext by executing a scheme switching algorithm is expressed as follows: SS RLWE′→RGSW :RLWE′ sk (m)→RGSW sk (m);
[0015] where sk is the key of level 1, RLWE′ sk (m) is the first RLWE' ciphertext, m is the plaintext, and RGSW sk (m) is the first RGSW ciphertext of level 1.
[0016] It can be understood that the cost of calculating the RGSW ciphertext through the public key switching algorithm and the scheme switching algorithm is the cost of (lnt + l 2 ) scalar multiplications. Where n is the polynomial dimension, l is the number of RLWE ciphertexts, and t is the dimension of the gadget decomposition. lnt is the cost of executing the public key switching algorithm l times, and l 2 is the cost of executing the scheme switching algorithm once. However, in the prior art, the cost of calculating the RGSW ciphertext through the private key switching algorithm is the cost of (2lnt + 2lt) scalar multiplications, where (n + 1)t is the cost of executing the private key switching algorithm once, and a total of 2l times of the private key switching algorithm need to be executed. Usually, l < t, so the cost of executing the public key switching algorithm l times and the scheme switching algorithm once is less than the cost of executing the private key switching algorithm 2l times.
[0017] It can also be understood that the key size required to implement the LWE to RGSW conversion through the calculation of the public key switching algorithm and the scheme switching algorithm is (nt + 1) RLWE, where nt is the overhead of executing the public key switching algorithm once, and 1 is the overhead of executing the scheme switching algorithm once. However, in the prior art, the key size required to implement the LWE to RGSW conversion through the calculation of the private key switching algorithm is (2nt + 2t) RLWE, i.e., the overhead of executing the private key switching algorithm. Obviously, the key size overhead is also smaller.
[0018] Optionally, the method described in the first aspect may further include receiving a first key of the scheme switching algorithm, wherein the first key is a key used when obtaining a level 1 RGSW ciphertext by executing the scheme switching algorithm. In other words, the scheme switching algorithm can be flexibly indicated by dynamically configuring the first key of the scheme switching algorithm, but this is not limited to this. For example, the scheme switching algorithm may be used by default.
[0019] In one possible design, the method described in the first aspect may further include: obtaining a third RLWE' ciphertext, and calculating the third RLWE' ciphertext by executing a scheme switching algorithm to obtain a second RGSW ciphertext. The third RLWE' ciphertext is the RLWE' ciphertext obtained by homomorphically encrypting the level 0 key plaintext using the level 2 key; the second RGSW ciphertext is the RGSW ciphertext obtained by homomorphically encrypting the level 0 key plaintext using the level 2 key, and the second RGSW ciphertext is the bootstrap key used for the outer product operation in the function bootstrapping from level 0 to level 2.
[0020] It can be understood that in the hierarchical homomorphic computing mode, the second RGSW ciphertext can be used as the bootstrap key to perform function bootstrapping. The second RGSW ciphertext consists of two RLWE' ciphertexts, so two RLWE' ciphertexts need to be stored in real time during the bootstrapping process. However, due to the large size of the RLWE' ciphertext, the storage overhead is very large, such as hundreds of megabytes or even gigabytes (related to the dimension n, modulus q, etc.). To this end, a scheme switching algorithm can be used to dynamically calculate the function bootstrap key, such as the second RGSW ciphertext, so that only one RLWE' ciphertext, such as the third RLWE' ciphertext, can be stored during the bootstrapping process, thereby reducing storage overhead, such as at least reducing storage overhead by 50%.
[0021] Optionally, the third RLWE' ciphertext is calculated by executing the scheme switching algorithm to obtain the second RGSW ciphertext, that is, the function bootstrap key from level 0 to level 2, including: calculating the third RLWE' ciphertext by executing the scheme switching algorithm to obtain a corresponding fourth RLWE' ciphertext, wherein the plaintext corresponding to the fourth RLWE' ciphertext is related to the homomorphic encryption key of the third RLWE' ciphertext; and splicing the third RLWE' ciphertext and the fourth RLWE' ciphertext into the second RGSW ciphertext.
[0022] For example, by executing the scheme switching algorithm to calculate the third RLWE' ciphertext, the obtained level 0 RGSW ciphertext is expressed as follows:
[0023] in, is the second RGSW ciphertext, is the key for level 2, is the third RLWE' ciphertext, sk i is the key of level 0 and n is the polynomial dimension.
[0024] In one possible design, the method described in the first aspect may further include receiving a second key for a scheme switching algorithm, where the second key is a key used when executing the scheme switching algorithm to obtain a bootstrap key in a function bootstrap, i.e., a second RGSW ciphertext. In other words, the scheme switching algorithm can be flexibly indicated by dynamically configuring the second key, but this is not a limitation. For example, the scheme switching algorithm may be used by default.
[0025] In a second aspect, a security method based on homomorphic encryption is provided. The method includes: obtaining a third ring error learning hypothesis (RLWE') ciphertext, calculating the third RLWE' ciphertext by executing a scheme switching algorithm, and obtaining a second RGSW ciphertext. The third RLWE' ciphertext is the RLWE' ciphertext obtained by homomorphically encrypting a level 0 key plaintext using a level 2 key; the second RGSW ciphertext is the RGSW ciphertext obtained by homomorphically encrypting the level 0 key plaintext using a level 2 key, and the second RGSW ciphertext is the bootstrap key used for the outer product operation in the function bootstrapping from level 0 to level 2.
[0026] In one possible design, calculating the third RLWE' ciphertext by executing the scheme switching algorithm to obtain the second RGSW ciphertext includes: calculating the third RLWE' ciphertext by executing the scheme switching algorithm to obtain a corresponding fourth RLWE' ciphertext, and concatenating the third RLWE' ciphertext and the fourth RLWE' ciphertext into the second RGSW ciphertext. The plaintext corresponding to the fourth RLWE' ciphertext is related to the homomorphic encryption key of the third RLWE' ciphertext. For example, the plaintext corresponding to the fourth RLWE' ciphertext can be obtained by multiplying the plaintext of the homomorphic encryption key (i.e., the level 2 key) of the third RLWE' ciphertext with the plaintext of the level 0 key.
[0027] For example, by executing the scheme switching algorithm to calculate the third RLWE' ciphertext, the second RGSW ciphertext is expressed as follows:
[0028] in, is the second RGSW ciphertext, is the key for level 2, is the third RLWE' ciphertext, sk i is the key of level 0 and n is the polynomial dimension.
[0029] Optionally, the method described in the second aspect may further include: receiving a second key of the scheme switching algorithm, wherein the second key is a key used when obtaining a bootstrap key in function bootstrapping by executing the scheme switching algorithm, that is, a second RGSW ciphertext.
[0030] In one possible design scheme, the method described in the second aspect may also include: obtaining the error learning hypothesis LWE ciphertext of level 2; converting the LWE ciphertext of level 2 into the first RLWE' ciphertext of level 1 by executing the public key switching algorithm and splicing operation; calculating the first RLWE' ciphertext by executing the scheme switching algorithm to obtain the first RGSW ciphertext of level 1.
[0031] Optionally, the LWE ciphertext of level 2 is l LWE ciphertexts, where l is an integer greater than 1. The LWE ciphertext of level 2 is converted into the first RLWE' ciphertext of level 1 by executing a public key switching algorithm and a splicing operation, including: executing the public key switching algorithm l times to convert each of the l LWE ciphertexts into a corresponding first RLWE ciphertext, for a total of l first RLWE ciphertexts; and splicing the l first RLWE ciphertexts into a first RLWE' ciphertext.
[0032] For example, by executing the public key switching algorithm, each of the l LWE ciphertexts is converted into a corresponding first RLWE ciphertext as shown below:
[0033] Among them, f0 is the calculation function of the public key switching algorithm, is the key of level 2, sk is the key of level 1, is the i-th LWE ciphertext among l LWE ciphertexts, v i is the i-th component of the gadget vector, m is the plaintext, RLWE sk (v i m) is the i-th first RLWE ciphertext.
[0034] Optionally, the method of the second aspect may further include receiving a key of a public key switching algorithm, wherein the key of the public key switching algorithm is a key used when executing the public key switching algorithm. The key of the public key switching algorithm is an RLWE' ciphertext obtained by homomorphically encrypting the level 2 key using the level 1 key.
[0035] Optionally, calculating the first RLWE' ciphertext by executing the scheme switching algorithm to obtain a first RGSW ciphertext of level 1 includes: calculating the first RLWE' ciphertext by executing the scheme switching algorithm to obtain a corresponding second RLWE' ciphertext, and concatenating the first RLWE' ciphertext and the second RLWE' ciphertext into the first RGSW ciphertext, wherein the plaintext corresponding to the second RLWE' ciphertext is related to the homomorphic encryption key of the first RLWE' ciphertext.
[0036] For example, by executing the scheme switching algorithm to calculate the first RLWE' ciphertext, the first RGSW ciphertext of level 1 is obtained as follows: SS RLWE′→RGSW :RLWE′ sk (m)→RGSW sk (m);
[0037] Where sk is the key of level 1, RLWE′ sk (m) is the first RLWE' ciphertext, m is the plaintext, RGSW sk (m) is the first RGSW ciphertext of level 1.
[0038] Optionally, the method described in the second aspect may further include: receiving a first key of the scheme switching algorithm, wherein the first key is a key used when obtaining a first RGSW ciphertext of level 1 by executing the scheme switching algorithm.
[0039] In addition, the technical effects of the method described in the second aspect can refer to the technical effects of the method described in the first aspect, and will not be repeated here.
[0040] In a third aspect, a security device is provided. The security device includes: a module for executing the method described in the first or second aspect, such as a transceiver module and a processing module. For example, the transceiver module is configured to perform the transceiver function of the security device, and the processing module is configured to perform functions other than the transceiver function of the security device.
[0041] Optionally, the transceiver module may include a sending module and a receiving module, wherein the sending module is used to implement the sending function of the security device described in the third aspect, and the receiving module is used to implement the receiving function of the security device described in the third aspect.
[0042] Optionally, the security device described in the third aspect may further include a storage module, wherein the storage module stores a program or instruction. When the processing module executes the program or instruction, the security device may execute the method described in the first aspect or the second aspect.
[0043] It can be understood that the security device described in the third aspect can be a terminal, or a network device, or other device that can perform homomorphic encryption tasks, or a chip (system) or other parts or components that can be set in a terminal, or a network device, or other device that can perform homomorphic encryption tasks, or a device that includes a terminal or network device. This application does not limit this.
[0044] In addition, the technical effects of the safety device described in the third aspect can refer to the technical effects of the method described in the first aspect, and will not be repeated here.
[0045] In a fourth aspect, a security device is provided, comprising: a processor configured to execute the method described in the first aspect or the second aspect.
[0046] In one possible design solution, the security device described in the fourth aspect may further include a transceiver. The transceiver may be a transceiver circuit or an interface circuit. The transceiver may be used to enable the security device described in the fourth aspect to communicate with other devices.
[0047] In one possible design, the security device described in the fourth aspect may further include a memory. The memory may be integrated with the processor or provided separately. The memory may be used to store the computer program and / or data involved in the method described in the first aspect.
[0048] In an embodiment of the present application, the security device described in the fourth aspect may be a terminal or a network device, or a chip (system) or other parts or components that can be set in the terminal or network device, or a device that includes the terminal, or the network device, or the homomorphic encryption module.
[0049] In addition, the technical effects of the safety device described in the fourth aspect can refer to the technical effects of the method described in the first aspect, and will not be repeated here.
[0050] In a fifth aspect, a security device is provided, comprising: a processor coupled to a memory, the processor being configured to execute a computer program stored in the memory, so that the security device executes the method described in the first aspect or the second aspect.
[0051] In one possible design solution, the security device described in the fifth aspect may further include a transceiver. The transceiver may be a transceiver circuit or an interface circuit. The transceiver may be used to enable the security device described in the fifth aspect to communicate with other devices.
[0052] In an embodiment of the present application, the security device described in the fifth aspect may be a terminal or a network device, or a chip (system) or other parts or components that can be set in the terminal or network device, or a device that includes the terminal, or the network device, or a device with homomorphic encryption capabilities.
[0053] In addition, the technical effects of the safety device described in the fifth aspect can refer to the technical effects of the method described in the first aspect, and will not be repeated here.
[0054] In a sixth aspect, a security device is provided, comprising: a processor and a memory; the memory is used to store a computer program, and when the processor executes the computer program, the security device executes the method described in the first aspect or the second aspect.
[0055] In one possible design solution, the security device described in the sixth aspect may further include a transceiver. The transceiver may be a transceiver circuit or an interface circuit. The transceiver may be used to enable the security device described in the sixth aspect to communicate with other devices.
[0056] In an embodiment of the present application, the security device described in the sixth aspect may be a terminal or a network device, or a chip (system) or other parts or components that can be set in the terminal or network device, or a device that includes the terminal or network device.
[0057] In addition, the technical effects of the safety device described in the sixth aspect can refer to the technical effects of the method described in the first aspect, and will not be repeated here.
[0058] In a seventh aspect, a computer-readable storage medium is provided, comprising: a computer program or instructions; when the computer program or instructions are run on a computer, the computer is caused to execute the method described in the first aspect or the second aspect.
[0059] In an eighth aspect, a computer program product is provided, comprising a computer program or instructions, which, when executed on a computer, causes the computer to execute the method described in the first or second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 is a schematic diagram of the ciphertext form;
[0061] Figure 2 is a schematic diagram of the architecture of the homomorphic encryption scheme;
[0062] FIG3 is a schematic diagram of the process of the homomorphic encryption scheme;
[0063] Figure 4 is a schematic diagram of the structure of the ciphertext in the homomorphic encryption scheme;
[0064] FIG5 is a schematic diagram of the architecture of the hierarchical homomorphic computing model;
[0065] FIG6 is a schematic diagram of the architecture of a security system provided in an embodiment of the present application;
[0066] FIG7 is a flowchart of a security method based on homomorphic encryption according to an embodiment of the present application;
[0067] FIG8 is a schematic diagram of the architecture of the hierarchical homomorphic computing mode according to an embodiment of the present application;
[0068] FIG9 is a second flow chart of a security method based on homomorphic encryption provided in an embodiment of the present application;
[0069] FIG10 is a second schematic diagram of the architecture of the hierarchical homomorphic computing mode in an embodiment of the present application;
[0070] FIG11 is a third flow chart of a security method based on homomorphic encryption provided in an embodiment of the present application;
[0071] FIG12 is a third schematic diagram of the architecture of the hierarchical homomorphic computing mode in an embodiment of the present application;
[0072] FIG13 is a first structural diagram of a safety device provided in an embodiment of the present application;
[0073] FIG14 is a second structural diagram of the safety device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0074] For ease of understanding, the technical terms involved in the embodiments of this application are first introduced below.
[0075] 1. Ciphertext:
[0076] There are many forms of ciphertext, such as LWE ciphertext, ring learning with errors assumption (RLWE) ciphertext, and RGSW ciphertext. The ciphertext and ciphertext forms of LWE, RLWE, and RGSW are shown in Figure 1 and are described below.
[0077] LWE:
[0078] Define the plaintext message as m, and define positive integers n and q, the LWE encryption of m∈Z is a vector such that b=-a·sk+m+e. Where a is an n-dimensional vector, The key sk is an n-dimensional vector sampled from the key distribution χ (e.g., Gaussian distribution). The error e is sampled from the error distribution χ′ (e.g., Gaussian distribution). The dimensions of b, m, and e are all 1.
[0079] RLWE:
[0080] RLWE is R q The ring version of LWE. q The RLWE encryption is a pair b=-a·sk+m+e. Among them, vector a is The key sk is sampled from the key distribution χ (such as Gaussian distribution), and each coefficient e of the error e is i It is sampled from the error distribution χ′ (such as Gaussian distribution).
[0081] RGSW:
[0082] If the message is m, then m∈R q The RGSW encryption can be expressed as: RGSW sk (m) = (RLWE′ sk (sk·m),RLWE′ sk (m)), sk is the key, and the identifier RLWE' refers to the concept of gadget RLWE, for example, it is defined as RLWE′ sk (m) = (RLWE sk (v0·m),RLWE sk (v1·m),…,RLWE sk (v l-1 ·m)), where v=(v0,v1,…,v l-1 ) is the gadget vector.
[0083] 2. Gadget product:
[0084] The gadget product is R×RLWE′→RLWE, which is defined as follows:
[0085] Among them, t∈R, (t0,t1,…,t l-1 ) is the gadget decomposition of t corresponding to the gadget vector v, that is, ∑ i v i t i = t. B = max{t i} is the gadget basis, l is the gadget length. The noise variance of the gadget product is is the noise variance of the input RLWE' ciphertext, and N is the polynomial dimension.
[0086] 3. External product:
[0087] The definition of the outer product can be as shown in the following formula 2: RLWE(m1)⊙RGSW(m2)=a⊙RLWE′ sk (sk·m2)+b⊙RLWE′ sk (m2) = RLWE sk (a·sk·m2+b·m2)=RLWE sk (m1·m2+e1·m2); (2)
[0088] Among them, RLWE sk (m1)=(a,b). If m2 has a small norm, such as binary, then the noise term e1·m2 will be small enough. In this way, the output of the outer product is the RLWE encryption of m1·m2, and its noise variance is upper bounded by in, represents the noise variance of the gadget product result of the input RGSW ciphertext, represents the noise variance of the input RLWE ciphertext.
[0089] 4. Public key switching algorithm:
[0090] The public key switching algorithm refers to the homomorphic calculation of a given public function while switching the key.
[0091] For example, let f be the common Lipschitz morphism: And, the public key switching key is PubKS key =RLWE′ sk′ (sk i),i∈[1,n],sk i is the i-th item of the LWE key. The public key switching key is n RLWE' ciphertexts, which contain nt RLWE ciphertexts in total. t represents the dimension of the gadget decomposition (t is defined to distinguish it from l below, indicating that the specific parameters selected in different algorithms are different to avoid confusion).
[0092] Then, the LWE to RLWE public key switching algorithm is as shown in Equation 2:
[0093] The specific definition is as shown in the following formula 3:
[0094] Among them, the input includes: ciphertext LWE sk (m)=(a i ,b), the key sk corresponding to the ciphertext, the function f, and the public key switching key RLWE′ sk′ (sk i ). Homomorphic computation refers to the homomorphic computation of function f while performing public key switching. Output includes: ciphertext RLWE sk′ (f(m)), the corresponding key is sk′, that is, the key is switched from sk to sk′, and the function f is calculated.
[0095] 5. Public key switching algorithm:
[0096] Privacy key switching refers to computing a given privacy function while switching keys.
[0097] For example, define a private Lipschitz morphism f: And, the privacy key switching key PrivKS key Includes: RLWE' sk′ (f(sk i )),i∈[1,n] and RLWE′ sk′ (f(1)),sk i is the i-th item of the LWE key.
[0098] Then, the LWE to RLWE privacy key switching algorithm is as shown in Equation 4 below:
[0099] [Corrected 10.10.2023 according to Rule 91] The specific definition is as shown in the following formula 5:
[0100] 6. Scheme switching algorithm:
[0101] The scheme switching algorithm is to calculate the RGSW ciphertext by Gadget RLWE ciphertext. For example, define the scheme switching key SS key =RLWE′ sk (sk 2 ), is an RLWE' ciphertext, containing l RLWE ciphertexts, where l represents the dimension of gadget decomposition (l is defined to distinguish it from the above t, indicating that the specific parameters in different algorithms are different to avoid confusion).
[0102] The scheme switching algorithm is shown in Equation 6: RLWE′→RGSW :RLWE′ sk (m)→RGSW sk (m); (6)
[0103] Specifically, for each RLWE with noise e′ sk (v i ·m)=(a i ,b i ),i∈[0,l-1], that is, l RLWE sk (v i m) can be assembled into a RLWE′ sk (m)), then the other components RLWE′ of the RGSW ciphertext are calculated by the above formula 6 sk (sk·m), RLWE′ sk The calculation of the i-th RLWE ciphertext in (sk·m) is specifically expressed as shown in the following formula 7: (a i ⊙RLWE′ sk (sk 2 )+(b i ,0))=RLWE sk ((a i ·sk 2 )+b i ·sk)=RLWE sk ((a i ·sk+b i )·sk)=RLWE sk (v i ·sk·m+e i ·sk); (7)
[0104] Thus, RLWE′ sk (sk·m) and RLWE′ sk (m) are assembled together to obtain the RGSW ciphertext as shown in Equation 8: RLWE′→RGSW (RLWE′ sk (m)):=(RLWE′ sk (sk·m),RLWE′ sk(m)); (8)
[0105] 4. Homomorphic encryption:
[0106] Homomorphic encryption, such as fully homomorphic encryption (FHE), is a cryptographic technique that allows computations to be performed on ciphertext, with the decrypted result being identical to the plaintext. This means that even in an encrypted state, data can still be processed and manipulated without revealing the original data. TFHE is a currently more practical FHE scheme and a Boolean fully homomorphic encryption algorithm. TFHE currently has the lowest bootstrapping latency among fully homomorphic encryption schemes, with a gate bootstrapping time of only approximately 13 milliseconds.
[0107] Homomorphic encryption schemes typically consist of four parts: key generation, homomorphic encryption, homomorphic evaluation, and homomorphic decryption, which are introduced below.
[0108] Key generation:
[0109] As shown in Figure 2, the key generator can input the key material into the key generator to obtain the public key (pk) output by the key generator, that is, the homomorphic encryption key, such as K enc , private key (secret key, sk), that is, the homomorphic decryption key, such as K dec , and homomorphic evaluation key (evk), or homomorphic computation key, such as K eval As shown in FIG3 , the key generator may send the homomorphic encryption key to the homomorphic encryptor, send the homomorphic decryption key to the homomorphic decryption method, and send the homomorphic computation key to the homomorphic computation.
[0110] Homomorphic encryption:
[0111] As shown in Figure 2, the homomorphic encryption party can use the homomorphic encryption key to encrypt a single bit of plaintext data, such as m∈{0,1}, into ciphertext data, which can be expressed as c=E pk (m), if multiple bits of plaintext data, such as m1, m2, ... m l , l is an integer greater than 1, then the corresponding multiple bits of ciphertext data can be expressed as c=E pk (m1,m2,…m lAs shown in Figure 3, the homomorphic encryption party can send the ciphertext data to the homomorphic computing party, such as c1.
[0112] It can be understood that the ciphertext data can be expressed in different forms. For example, as shown in FIG4 , in a fully homomorphic encryption scheme over the torus (TFHE), the ciphertext data can be expressed in the form of b=[a·s+m+e] Q .in, is a uniformly distributed random matrix. s is a key, such as a homomorphic encryption key, and s∈R Q , the positive integer n is the polynomial dimension, m is the plaintext data. e is the noise, and e∈χ, the noise distribution χ=χ(n) is The noise distribution can be selected as a discrete Gaussian distribution, and the noise upper limit |χ|≤B. The ring polynomial whose modulus is a prime number modulus Q, that is, the ciphertext data can also be called ciphertext data in RLWE form.
[0113] Homomorphic computation:
[0114] As shown in Figure 2, the homomorphic computing party can use the homomorphic computing key to perform homomorphic computing on a single bit of ciphertext data. If the homomorphic computing function is C f , or function f, to get the ciphertext result For example, for multiple bits of ciphertext data, the corresponding ciphertext result is As shown in Figure 3, the homomorphic computing party can send the ciphertext result to the homomorphic decryption party.
[0115] It can be understood that, as shown in Figure 4, b=[a·s+m+e] Q , for the homomorphic computing party, ciphertext a and b are known parameters, and the rest are unknown parameters.
[0116] Homomorphic decryption:
[0117] As shown in Figure 2, the homomorphic decryption party can use the homomorphic decryption key to decrypt the ciphertext result into the plaintext result f(m). For example, for a ciphertext result of multiple bits, the corresponding plaintext result f(m1,m2,…m l ). At this time, if the plaintext data is directly calculated by function f, the result is also f(m), and the two are consistent.
[0118] As can be seen, homomorphic encryption adds a random "noise" component to the ciphertext data, namely the e mentioned above. Performing homomorphic calculations on the ciphertext data will cause this noise to grow. For example, when multiple ciphertext data are superimposed together for homomorphic calculation, the noise inherent in each ciphertext data will be superimposed and amplified, possibly reaching exponential expansion, and a cross term will appear where the noise is multiplied by the ciphertext data. If only a relatively simple homomorphic calculation is performed on the ciphertext data, that is, the noise is still within the controllable range (critical value), then decryption can still restore the ciphertext data to the plaintext result. However, if the homomorphic calculation is too complex, that is, the noise may exceed the controllable range, destroying or even overwriting the original plaintext data, resulting in decryption failure.
[0119] 2. Bootstrapping:
[0120] The core operation of homomorphic encryption schemes is bootstrapping, a concept defined by Gentry in his 2009 FHE solution. The purpose of bootstrapping is to refresh the ciphertext data, reduce its noise level, and prevent excessive noise expansion during homomorphic computation, which can lead to decryption failures. The bootstrapping process is often the most time-consuming part of homomorphic encryption schemes. To enable homomorphic computation on circuits of arbitrary depth, TFHE introduces two bootstrapping operations to reduce noise and transform the ciphertext: gate / function bootstrapping and circuit bootstrapping. These are described below.
[0121] Gate Bootstrap:
[0122] Gate bootstrapping refers to the process of performing a bootstrapping operation on each binary gate during homomorphic computation. The core of gate bootstrapping is blind rotation, which involves rotating a polynomial using the ciphertext. This can be implemented using n CMUX gates, which are constructed using the outer product of RLWE and RGSW. This allows the bootstrap input to be a noisy homomorphic message ciphertext, while the bootstrap output can be a less noisy homomorphic message ciphertext, effectively reducing the noise to a low level. This is described in detail below.
[0123] [Corrected 10.10.2023 according to Rule 91] Specifically, the homomorphic ciphertext with high noise after homomorphic calculation is c = (b, a), and its corresponding homomorphic encryption and decryption keys are (pk, sk). The new homomorphic encryption key pk' can be used to re-encrypt b in the homomorphic ciphertext c, that is, RLWE.Enc(X -b), denoted as the initial value of the blindly rotated accumulator ACC. The initial value of ACC is input to the first CMUX gate, which is then rotated by a rotation component to obtain the ACC output by the first CMUX gate. The ACC output of the first CMUX gate is then input to the second CMUX gate, forming an iteration. The calculation process of the i-th CMUX gate can be shown in Equation 9 below:
[0124] Among them, X a[i] is the i-th rotation component of the blind rotation, i∈[1,n], and n is the polynomial dimension of a.
[0125] ACC⊙BK i is the outer product of the i-th RLWE and RGSW. ACC is the homomorphic ciphertext in RLWE form. BK i The homomorphic ciphertext in RGSW format can be specifically the ciphertext obtained by homomorphically encrypting the original homomorphic decryption key sk using the new homomorphic encryption key pk'. It can be understood that based on the characteristics of homomorphic computing, the bootstrapped high-noise homomorphic ciphertext (b, a) is multiplied by its corresponding decryption key (1, sk), that is, the high-noise homomorphic ciphertext is homomorphically decrypted, ultimately obtaining a low-noise homomorphic ciphertext, thus achieving noise suppression.
[0126] After n CMUX gates are iteratively updated, sample extraction, key switching, and modulus switching are performed to obtain the bootstrapped low-noise homomorphic ciphertext, denoted as LWE.Enc(m).
[0127] Function bootstrapping:
[0128] If the computation is done on binary gates, function bootstrapping can also be called gate bootstrapping. The core operation of function bootstrapping is also blind rotation, which is composed of multiple CMUX gates. A CMUX gate is constructed by the outer product of the RLWE ciphertext and the RGSW ciphertext. This is described in detail below.
[0129] Define the test polynomial testP encoded by the LUT function f, and the bootstrap key as Among them, sk i It is the i-th item of the LWE key (such as a private key) and is a level 0 key. For details, please refer to the relevant introduction below and will not be repeated here. is the key of level 2. For details, please refer to the relevant introduction below and will not be repeated here. The function bootstrap can be expressed as:
[0130] Specifically, the homomorphic ciphertext with high noise after homomorphic calculation is c = (b, a), and its corresponding homomorphic encryption and decryption keys are (pk, sk). You can also use the new homomorphic encryption key pk' to re-homomorphically encrypt b in the homomorphic ciphertext c, that is, RLWE.Enc(X -b The initial value of ACC can be recorded as ACC=(0,X -b ·testP), input the initial value of ACC into the first CMUX gate, rotate it by a rotation component through the first CMUX gate, and obtain the ACC output by the first CMUX gate. The ACC output by the first CMUX gate is then input into the second CMUX gate to form an iteration. The calculation process of the i-th CMUX gate can be shown as follows:
[0131] Among them, X a[i] is the i-th rotation component of the blind rotation, i∈[1,n], and n is the polynomial dimension of a. is the outer product of the i-th RLWE and RGSW. ACC is the homomorphic ciphertext in RLWE form. It is a homomorphic ciphertext in RGSW form.
[0132] After n CMUX gates are iteratively updated, and then through operations such as sample extraction, the bootstrapped low-noise homomorphic ciphertext can be obtained, which is recorded as
[0133] Circuit bootstrap:
[0134] Circuit bootstrapping is performed after each homomorphic computation using a larger homomorphic computation circuit algorithm (e.g., det-WFA, TBSR) to reduce noise and transform the ciphertext for the next homomorphic computation. The input of the circuit bootstrapping is the noisy TLWE or LWE ciphertext, and the output is the noisy TRGSW or RGSW ciphertext.
[0135] Taking TFHE as an example, TFHE provides a hierarchical homomorphic computing model that can efficiently compute multi-input lookup tables (LUTs), bit sequence representations (BSRs), weighted finite automata (WFAs), and other functions through hierarchical circuits. The inputs and outputs of hierarchical homomorphic computations have different ciphertext forms. To achieve composability, circuit bootstrapping is required to simultaneously transform the ciphertext form while refreshing the noise.
[0136] As shown in Figure 5, to ensure security and operational correctness, TFHE's hierarchical homomorphic computing model spans three levels: level 0, level 1, and level 2. Each level sets different parameters, such as the homomorphic key.
[0137] The dimension n of level 0 is relatively low, such as n=635, and the ciphertext modulus q is relatively small, such as 32 bits, but the noise is relatively large, such as σ 2 ≈2 -30 , σ represents level 0 noise. Level 0 calculations are relatively fast, but generally allow relatively limited linear operations. In the embodiments of the present application, level 0 variables are represented by underscores.
[0138] Level 1 has a medium dimension n, such as n = 1024, and a relatively small ciphertext modulus q, such as 32 bits, but also relatively large noise, such as σ 2 ≈2 -50 , σ represents the noise of level 1. Level 1 calculation is also faster and can allow relatively high depth. For example, the above-mentioned LUT, BSR, WFA, etc. can all be executed at level 1.
[0139] The dimension n of level 2 is medium, such as n = 2048, the ciphertext modulus q is relatively large, such as 64 bits, but the noise is relatively small, such as Indicates level 1 noise. Level 2 calculations are slower. Level 2 variables are overlined.
[0140] The circuit bootstrap spans three levels, such as the operation from level 0 to level 2 and from level 2 to level 1 (dashed arrows in Figure 5). The circuit bootstrap key includes: 1 function bootstrap key, such as sk i is the i-th item of the LWE key sk at level 0, i∈[1,n], n is the polynomial dimension; and the circuit bootstrapping key also includes: 2 privacy key switching keys, such as and RLWE′ sk (f 0,1 (1)). Here, function f0 is the identity function, function f1(x) = sk·x, sk is the RLWE key of level 1, Is a level 2 LWE key The jth term of , j∈[1,n], n is the polynomial dimension. Thus, the circuit bootstrap: CBS LWE→RGSW :LWE sk (m)→RGSW sk (m) may include the following two steps:
[0141] Step 1: Function bootstrapping (level 0 to level 2).
[0142] Function bootstrapping can be expressed as shown in the following formula 11:
[0143] Among them, the level 0 ciphertext is bootstrapped by the function to obtain the level 2 ciphertext sk is the key of level 0, is the level 2 key. l is equivalent to breaking a large number into smaller numbers, i.e., l LWE ciphertexts. Function bootstrapping can simultaneously compute a function while denoising and refreshing the ciphertext. Furthermore, in function bootstrapping, if a gate is computed, it is also called gate bootstrapping.
[0144] Step 2: Privacy key switching (e.g., level 2 to level 1).
[0145] Privacy key switching can be expressed as shown in the following equations 12-14: RGSW sk (m) = (RLWE′ sk (sk·m),RLWE′ sk (m)); (14)
[0146] Among them, the ciphertext of level 2 is converted into the ciphertext of level 1 after the privacy key is switched. The input of privacy key switching is LWE ciphertext, and the output is RGSW ciphertext. Specifically, privacy key switching involves: 1) changing the ciphertext form and computing the function f0 (identity function) and the function f1 (message m multiplied by the key sk); 2) concatenating one RLWE ciphertext into one RLWE' ciphertext, and then concatenating two RLWE's into one RGSW ciphertext.
[0147] As mentioned above, in the TFHE hierarchical homomorphic computing mode, circuit bootstrapping is the most computationally complex and memory-intensive process, accounting for over 90% of the total computation time and exhibiting low efficiency. Furthermore, the bootstrapping key size can occupy hundreds of megabytes or even gigabytes of memory (depending on the dimension n, modulus q, and other factors). This large key size results in significant storage overhead during the bootstrapping process.
[0148] In response to the above problems, the embodiments of the present application propose the following technical solutions, which will be described below in conjunction with the accompanying drawings.
[0149] The technical solutions of the embodiments of the present application can be applied to various communication systems, such as wireless network (Wi-Fi) systems, vehicle to everything (V2X) communication systems, device to device (D2D) communication systems, Internet of Vehicles communication systems, fourth generation (4G) mobile communication systems, such as LTE systems, world-wide interoperability for microwave access (WiMAX) communication systems, fifth generation (5G) systems, such as new radio (NR) systems, and future communication systems. The technical solutions of the embodiments of the present application can also be applied to other potential industries, such as genetics, health care, national security, education, social security, commercial financial analysis and other industries, for scenarios where privacy protection is required during computing, such as cloud computing, outsourced computing, machine learning, and privacy data processing.
[0150] In the embodiment of the present application, "indication" may include direct indication and indirect indication, and may also include explicit indication and implicit indication. The information indicated by a certain information (such as the first information, the second information, or the third information below) is called information to be indicated. In the specific implementation process, there are many ways to indicate the information to be indicated, such as but not limited to, the information to be indicated can be directly indicated, such as the information to be indicated itself or the index of the information to be indicated. The information to be indicated can also be indirectly indicated by indicating other information, wherein the other information and the information to be indicated have an association relationship. It is also possible to indicate only a part of the information to be indicated, while the other parts of the information to be indicated are known or agreed in advance. For example, the indication of specific information can be achieved by means of the arrangement order of each piece of information agreed in advance (such as specified in the protocol), thereby reducing the indication overhead to a certain extent. At the same time, the common parts of each piece of information can be identified and indicated uniformly to reduce the indication overhead caused by indicating the same information separately.
[0151] In addition, the specific indication method can also be various existing indication methods, such as but not limited to the above-mentioned indication methods and various combinations thereof. The specific details of the various indication methods can be referred to the prior art and will not be repeated herein. As can be seen from the above, for example, when it is necessary to indicate multiple information of the same type, there may be a situation where the indication methods for different information are different. In the specific implementation process, the required indication method can be selected according to specific needs. The embodiment of the present application does not limit the selected indication method. In this way, the indication method involved in the embodiment of the present application should be understood to cover various methods that can enable the party to be indicated to obtain the information to be indicated.
[0152] It should be understood that the information to be indicated can be sent as a whole or divided into multiple sub-information and sent separately, and the sending period and / or sending time of these sub-information can be the same or different. The specific sending method is not limited in the embodiments of this application. The sending period and / or sending time of these sub-information can be predefined, for example, predefined according to a protocol, or can be configured by the transmitting device by sending configuration information to the receiving device.
[0153] "Pre-definition" or "pre-configuration" can be implemented by pre-saving corresponding codes, tables or other methods that can be used to indicate relevant information in the device, and the embodiments of the present application do not limit the specific implementation method. Among them, "saving" can mean saving in one or more memories. The one or more memories can be set separately or integrated in an encoder or decoder, a processor, or a communication device. The one or more memories can also be partially set separately and partially integrated in a decoder, a processor, or a communication device. The type of memory can be any form of storage medium, and the embodiments of the present application do not limit this.
[0154] The "protocol" involved in the embodiments of the present application may refer to a protocol family in the communication field, a standard protocol with a similar protocol family frame structure, or a related protocol used in future communication systems. The embodiments of the present application do not make specific limitations on this.
[0155] In the embodiments of the present application, descriptions such as "when...", "in the case of...", "if" and "if" all mean that the device will perform corresponding processing under certain objective circumstances. It does not limit the time, nor does it require the device to perform judgment actions when implemented, nor does it mean that there are other limitations.
[0156] In the description of the embodiments of the present application, unless otherwise specified, " / " indicates that the objects associated with each other are in an "or" relationship. For example, A / B can represent A or B. "And / or" in the embodiments of the present application is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, in the description of the embodiments of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with basically the same functions and effects. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit differences. At the same time, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way for easy understanding.
[0157] The network architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field will know that with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0158] To facilitate understanding of the embodiments of the present application, the encryption system applicable to the embodiments of the present application is first described in detail using the encryption system shown in Figure 6 as an example. For example, Figure 6 is a schematic diagram of the architecture of an encryption system applicable to the homomorphic encryption-based security method provided in the embodiments of the present application.
[0159] As shown in FIG6 , the encryption system may include at least one of the following: a key generator, a homomorphic encryption party, a homomorphic calculation party, or a homomorphic decryption party.
[0160] At least one of the above items may be provided in the same security device, or may be provided in different security devices, without specific limitation. The security device may be a terminal, a network device, or another device with homomorphic encryption capabilities, or a chip within a terminal, a network device, or another device with homomorphic encryption capabilities, or a device that includes a terminal, a network device, or another device with homomorphic encryption capabilities.
[0161] The terminal may be a terminal with transceiver functions, or a chip or chip system that can be set in the terminal. The terminal may also be called user equipment (UE), access terminal, subscriber unit, user station, mobile station (MS), mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user device. The terminal in the embodiments of the present application can be a mobile phone, a cellular phone, a smart phone, a tablet computer, a wireless data card, a personal digital assistant (PDA), a wireless modem, a handset, a laptop computer, a machine type communication (MTC) terminal, a computer with wireless transceiver function, a virtual reality (VR) terminal, an augmented reality (AR) terminal, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, a vehicle-mounted terminal, a road side unit (RSU) with terminal function, etc. The terminal of the present application may also be an on-board module, on-board module, on-board component, on-board chip or on-board unit built into the vehicle as one or more components or units.
[0162] The network device may be a device in an access network (AN), such as an access network device, or may be referred to as a radio access network device (RAN), which is used to provide network access services to a terminal. For example, the RAN device may include: a next-generation mobile communication system, such as a 6G access network device, such as a 6G base station, or in a next-generation mobile communication system, the network device may also have other naming methods, all of which are included in the protection scope of the embodiments of the present application, and the present application does not impose any restrictions on this. Alternatively, the RAN device may also include 5G, such as a gNB in a new radio (NR) system, or one or a group of antenna panels (including multiple antenna panels) of a base station in 5G, or a network node constituting a gNB, a transmission and reception point (TRP or transmission point, TP) or a transmission measurement function (TMF), such as a baseband unit (BBU), a centralized unit (CU) or a distributed unit (DU), an RSU with base station functions, or a wired access gateway, or a 5G core network element. Alternatively, RAN devices may also include access points (APs) in wireless fidelity (WiFi) systems, wireless relay nodes, wireless backhaul nodes, various forms of macro base stations, micro base stations (also known as small stations), relay stations, access points, wearable devices, vehicle-mounted devices, and the like.
[0163] Alternatively, the network device may also be a device in the core network (CN), such as a user plane function (UPF) network element, an authentication server function (AUSF) network element, an access and mobility management function (AMF) network element, a session management function (SMF) network element, a policy control function (PCF) network element, a unified data management (UDM) network element, an application function (AF), etc., without specific limitation.
[0164] The following will specifically explain the security method based on homomorphic encryption provided in the embodiment of the present application with reference to Figures 7-12.
[0165] For example, Figure 7 is a flowchart of a security method based on homomorphic encryption provided by an embodiment of the present application. The security method based on homomorphic encryption can be executed by the device in the security system shown in Figure 6.
[0166] As shown in Figure 7, the security method based on homomorphic encryption includes the following steps:
[0167] S701: Obtain level 2 LWE ciphertext.
[0168] The LWE ciphertext at level 2 can be l LWE ciphertexts, where l is an integer greater than 1. The homomorphic computing party can obtain l LWE ciphertexts by bootstrapping the functions from level 0 to level 2. For details, please refer to the relevant introduction above and will not be repeated here.
[0169] S702 , converting the LWE ciphertext of level 2 into the first ring error learning hypothesis RLWE′ ciphertext of level 1 by executing a public key switching algorithm and a concatenation operation.
[0170] The homomorphic computing party may convert each of the l LWE ciphertexts into a corresponding first RLWE ciphertext by executing the public key switching algorithm l times, for a total of l first RLWE ciphertexts. Then, the homomorphic computing party may concatenate the l first RLWE ciphertexts into a first RLWE' ciphertext.
[0171] For example, in conjunction with FIG8 , the execution process of S702 can also be expressed as the following formula 15:
[0172] Where f0 can be the calculation function of the public key switching algorithm, can be a level 2 key, sk can be a level 1 key, It can be the i-th LWE ciphertext among l LWE ciphertexts, v i It can be the i-th component of the gadget vector, m is the plaintext or message plaintext, RLWE sk (v i m) may be the i-th first RLWE ciphertext.
[0173] It can be seen that the public key switching algorithm can transform the LWE ciphertext of level 2 into the RLWE' ciphertext of level 1. The public key switching algorithm can change the form of the ciphertext while computing the function f0 (identity function). In addition, the public key switching algorithm can be executed l times by the homomorphic computing party to obtain the RLWE' ciphertext from the level 2 LWE ciphertext.
[0174] It can be understood that the specific principles of the public key switching algorithm can also refer to the relevant introduction in the above "4. Public Key Switching Algorithm", which will not be repeated here.
[0175] S703 , calculating a first RLWE′ ciphertext by executing a scheme switching algorithm to obtain a first RGSW ciphertext of level 1.
[0176] The homomorphic computing party may calculate the first RLWE' ciphertext by executing the scheme switching algorithm to obtain a corresponding second RLWE' ciphertext. The homomorphic computing party may concatenate the first RLWE' ciphertext and the second RLWE' ciphertext into a first RGSW ciphertext.
[0177] The plaintext corresponding to the second RLWE' ciphertext is related to the homomorphic encryption key of the first RLWE' ciphertext. For example, the plaintext corresponding to the second RLWE' ciphertext can be obtained by multiplying the homomorphic encryption key plaintext of the first RLWE' ciphertext with the message plaintext.
[0178] For example, in combination with FIG8 , the execution process of S703 can also be expressed as the following formula 16: SS RLWE′→RGSW :RLWE′ sk (m)→RGSW sk (m); (16)
[0179] Among them, sk can be the key of level 1, or the homomorphic encryption key of the first RLWE' ciphertext, and the first RLWE' ciphertext can be RLWE' sk (m), m can be plain text or message plain text, the plain text corresponding to the second RLWE' ciphertext can be sk·m, and the second RLWE' ciphertext can be RLWE' sk (sk·m), RGSW sk (m) may be the first RGSW ciphertext of level 1.
[0180] In addition, the specific principles of the scheme switching algorithm can also be referred to the relevant introduction in the above "6. Scheme Switching Algorithm", which will not be repeated here.
[0181] It can be understood that the cost of the RGSW ciphertext calculated by the public key switching algorithm and the scheme switching algorithm is (lnt+l 2 ) scalar multiplication overhead. Where n is the polynomial dimension, l is the number of RLWE ciphertexts, and t is the dimension of gadget decomposition. lnt is the overhead of executing the public key switching algorithm l times, l2 It is the overhead for executing the scheme switching algorithm once. However, in the prior art, the overhead for calculating the RGSW ciphertext through the private key switching algorithm is the overhead of (2lnt + 2lt) scalar multiplications, where (n + 1)t is the overhead for executing the private key switching algorithm once, and a total of 2l times of the private key switching algorithm need to be executed. Usually, l < t. Therefore, the overhead for executing l times of the public key switching algorithm and once of the scheme switching algorithm is less than the overhead for executing 2l times of the private key switching algorithm.
[0182] It can also be understood that through the calculation of the public key switching algorithm and the scheme switching algorithm, the key size for realizing the conversion from LWE to RGSW is (nt + l) RLWEs, where nt is the overhead for executing l times of the public key switching algorithm, and l is the overhead for executing once of the scheme switching algorithm. However, in the prior art, through the calculation of the private switching algorithm, the key size for realizing the conversion from LWE to RGSW is (2nt + 2t) RLWEs, that is, the overhead for executing the private key switching algorithm. Obviously, the key size overhead of the embodiments of the present application is also smaller.
[0183] In addition, for the specific principle of the private key switching algorithm, reference can also be made to the relevant introduction in the above "5. Private Key Switching Algorithm", and details are not described herein again.
[0184] In summary, since the RGSW ciphertext is obtained by splicing 2 RLWE' ciphertexts, the overhead of the private key switching algorithm lies in the need to calculate 2 RLWE' ciphertexts separately, resulting in a relatively large overhead. In this regard, by calculating 1 RLWE' ciphertext through the public key switching algorithm, such as the first RLWE' ciphertext, and then expanding the first RLWE' ciphertext into the RGSW ciphertext, such as the first RGSW ciphertext, through the scheme switching algorithm, its key size is smaller, and the calculation overhead is also smaller than calculating 2 RLWE' ciphertexts separately. Therefore, it can reduce the overhead of circuit bootstrapping in the hierarchical homomorphic computing mode and improve the operation efficiency.
[0185] In a possible design solution, in combination with the method shown in FIG. above, the method may further include: receiving the key of the public key switching algorithm.
[0186] The key of the public key switching algorithm may be the key used when executing the public key switching algorithm. For example, it is the RLWE' ciphertext obtained by homomorphically encrypting the key of level 2 with the key of level 1, and specifically may be the above PubKS key =RLWE′ sk′ (sk i ), and sk can be replaced with sk' can be replaced with sk, and specifically reference can also be made to the relevant introduction in the above "4. Public Key Switching Algorithm", and details are not described herein again.
[0187] The homomorphic computing party can obtain the key of the public key switching algorithm from the key generator. For example, the key generator actively sends the key of the public key switching algorithm to the homomorphic computing party, or the key generator can respond to the request of the homomorphic computing party and send the key of the public key switching algorithm to the homomorphic computing party. Accordingly, the homomorphic computing party receives the key of the public key switching algorithm from the key generator. Alternatively, the key generator can also send the key of the public key switching algorithm to an intermediate third-party device in advance, and the homomorphic computing party can also obtain the key of the public key switching algorithm from the third-party device. In other words, the homomorphic computing party can flexibly indicate the use of the public key switching algorithm by dynamically configuring the key of the public key switching algorithm, but it is not limited. For example, the homomorphic computing party can also use the public key switching algorithm by default.
[0188] In one possible design, in combination with the method shown in FIG. 7 , the method may further include: receiving a first key of a scheme switching algorithm.
[0189] The first key may be the key used when obtaining the level 1 RGSW ciphertext by executing the scheme switching algorithm, such as the SS key =RLWE′ sk (sk 2 ), please refer to the relevant introduction in the above "6. Scheme Switching Algorithm" for details, which will not be repeated here.
[0190] Similarly, the homomorphic computing party may also obtain the first key from the key generator. For example, the key generator actively sends the first key to the homomorphic computing party, or the key generator may respond to the request of the homomorphic computing party and send the first key to the homomorphic computing party. Accordingly, the homomorphic computing party receives the first key from the key generator. Alternatively, the key generator may also send the first key to an intermediate third-party device in advance, and the homomorphic computing party may also obtain the first key from the third-party device. In other words, the homomorphic computing party can flexibly indicate the use of the scheme switching algorithm by dynamically configuring the first key, but it is not limited. For example, the homomorphic computing party may also use the scheme switching algorithm by default.
[0191] For example, Figure 8 is a second flow chart of a security method based on homomorphic encryption provided in an embodiment of the present application. The security method based on homomorphic encryption can be executed by the device in the security system shown in Figure 6.
[0192] As shown in Figure 9, the security method based on homomorphic encryption includes the following steps:
[0193] S901: Obtain the third RLWE' ciphertext.
[0194] Among them, the third RLWE' ciphertext can be the RLWE' ciphertext obtained by homomorphically encrypting the level 0 key plaintext using the level 2 key. For details, please refer to the relevant introduction in the above "1. Ciphertext" and "2. Bootstrapping", which will not be repeated here.
[0195] S902 : Calculate a third RLWE′ ciphertext by executing a scheme switching algorithm to obtain a second RGSW ciphertext.
[0196] The second RGSW ciphertext can be the RGSW ciphertext obtained by homomorphically encrypting the level 0 key plaintext using the level 2 key. The second RGSW ciphertext is the bootstrap key used for the outer product operation in the function bootstrapping from level 0 to level 2. For details, please refer to the relevant introductions in the above "1. Ciphertext" and "2. Bootstrapping", which will not be repeated here.
[0197] The homomorphic computing party can calculate the third RLWE' ciphertext by executing the scheme switching algorithm to obtain a corresponding fourth RLWE' ciphertext. The homomorphic computing party can concatenate the third RLWE' ciphertext and the fourth RLWE' ciphertext into a second RGSW ciphertext.
[0198] The plaintext corresponding to the fourth RLWE' ciphertext is related to the homomorphic encryption key of the third RLWE' ciphertext. For example, the plaintext corresponding to the fourth RLWE' ciphertext can be obtained by multiplying the plaintext of the homomorphic encryption key (i.e., the level 2 key) of the third RLWE' ciphertext with the plaintext of the level 0 key.
[0199] For example, in conjunction with FIG10 , the execution process of S902 can also be expressed as the following formula 17:
[0200] in, For the third RLWE' ciphertext, is the second RGSW ciphertext, is the key of level 2, or the homomorphic encryption key of the third RLWE' ciphertext, sk i is the key of level 0, n is the polynomial dimension, and the plaintext corresponding to the fourth RLWE' ciphertext can be The fourth RLWE' ciphertext can be
[0201] In addition, the specific principles of the scheme switching algorithm can also be referred to the relevant introduction in the above "6. Scheme Switching Algorithm", which will not be repeated here.
[0202] It can be understood that in the hierarchical homomorphic computing mode, the second RGSW ciphertext can be used as the bootstrap key to perform function bootstrapping. The second RGSW ciphertext consists of two RLWE' ciphertexts, so two RLWE' ciphertexts need to be stored in real time during the bootstrapping process. However, due to the large size of the RLWE' ciphertext, the storage overhead is very large, such as hundreds of megabytes or even gigabytes (related to the dimension n, modulus q, etc.). To this end, a scheme switching algorithm can be used to dynamically calculate the function bootstrap key, such as the second RGSW ciphertext, so that only one RLWE' ciphertext, such as the third RLWE' ciphertext, can be stored during the bootstrapping process, thereby reducing storage overhead, such as at least reducing storage overhead by 50%.
[0203] In addition, the specific principle of the outer product operation involved in the second RGSW ciphertext can also refer to the relevant introduction in the above "2. Bootstrapping", which will not be repeated here.
[0204] In one possible design, in combination with the method shown in FIG. 9 , the method may further include: receiving a second key of a scheme switching algorithm.
[0205] Among them, the second key is the key used when obtaining the second RGSW ciphertext (i.e., the function bootstrap key) by executing the scheme switching algorithm, as mentioned above For details, please refer to the relevant introduction in the above "6. Scheme Switching Algorithm", which will not be repeated here.
[0206] For example, the homomorphic computing party can obtain the second key from the key generator. For example, the key generator actively sends the second key to the homomorphic computing party, or the key generator can respond to the request of the homomorphic computing party and send the second key to the homomorphic computing party. Correspondingly, the homomorphic computing party receives the second key from the key generator. Alternatively, the key generator can also send the second key to an intermediate third-party device in advance, and the homomorphic computing party can also obtain the second key from the third-party device. In other words, the homomorphic computing party can flexibly indicate the use of the scheme switching algorithm by dynamically configuring the second key, but it is not limited. For example, the homomorphic computing party can also use the scheme switching algorithm by default.
[0207] For example, Figure 11 is a flowchart of a security method based on homomorphic encryption provided in an embodiment of the present application. The security method based on homomorphic encryption can be executed by the device in the security system shown in Figure 6.
[0208] As shown in Figures 11 and 12, the security method based on homomorphic encryption includes the following steps:
[0209] S1101: Obtain the third RLWE' ciphertext.
[0210] S1102 , calculating a third RLWE′ ciphertext by executing a scheme switching algorithm to obtain a second RGSW ciphertext, ie, a function bootstrapping key in circuit bootstrapping.
[0211] The specific implementation of S1101-S1102 can also be referred to the relevant description of Figure 9 above, and will not be repeated here. In addition, using the second RGSW ciphertext to perform function bootstrapping on the level 0 LWE ciphertext can obtain the following level 2 LWE ciphertext. The specific implementation can also be referred to the relevant description of "2. Bootstrapping" above, and will not be repeated here.
[0212] S1103: Obtain level 2 LWE ciphertext.
[0213] S1104 , converting the LWE ciphertext of level 2 into the first ring error learning hypothesis RLWE′ ciphertext of level 1 by executing a public key switching algorithm and a concatenation operation.
[0214] S1105 , calculating a first RLWE′ ciphertext by executing a scheme switching algorithm to obtain a first RGSW ciphertext of level 1.
[0215] The specific implementation of S1103-S1105 can also refer to the relevant introduction of Figure 7 above, which will not be repeated here.
[0216] It can be understood that the above method embodiment takes the execution of the above method by a homomorphic computing party as an example. The homomorphic computing party can also be replaced by any other possible device or entity, such as a key generation party, a homomorphic encryption party, etc., without limitation.
[0217] The above describes in detail the security method based on homomorphic encryption provided by the embodiment of the present application in conjunction with Figures 7 to 12. The following describes in detail the security device for executing the security method based on homomorphic encryption provided by the embodiment of the present application in conjunction with Figures 13 and 14.
[0218] Figure 13 is a structural diagram of a security device according to an embodiment of the present application. As shown in Figure 13 , the security device 1300 includes a transceiver module 1301 and a processing module 1302. For ease of illustration, Figure 13 only shows the main components of the security device.
[0219] The security device 1300 can be used in the security system shown in Figure 6 to perform the functions of the above method. For example, the transceiver module 1301 is used to perform the transceiver function of the security device 1300, and the processing module 1302 is used to perform other functions of the security device 1300 in addition to the transceiver function.
[0220] In some embodiments, the transceiver module 1301 is used to obtain the level 2 error learning hypothesis LWE ciphertext; the processing module 1302 is used to convert the level 2 LWE ciphertext into the first ring error learning hypothesis RLWE' ciphertext of level 1 by executing the public key switching algorithm and the splicing operation; the processing module 1302 is also used to calculate the first RLWE' ciphertext by executing the scheme switching algorithm to obtain the first RGSW ciphertext of level 1.
[0221] In one possible design, the level 2 LWE ciphertexts are l LWE ciphertexts, where l is an integer greater than 1. The processing module 1302 is further configured to convert each of the l LWE ciphertexts into a corresponding first RLWE ciphertext by executing the public key switching algorithm l times, for a total of l first RLWE ciphertexts. The processing module 1302 is further configured to concatenate the l first RLWE ciphertexts into a first RLWE' ciphertext.
[0222] For example, by executing the public key switching algorithm, each of the l LWE ciphertexts is converted into a corresponding first RLWE ciphertext as shown below:
[0223] Among them, f0 is the calculation function of the public key switching algorithm, is the key of level 2, sk is the key of level 1, is the i-th LWE ciphertext among l LWE ciphertexts, v i is the i-th component of the gadget vector, m is the message plaintext, RLWE sk (v i m) is the i-th first RLWE ciphertext.
[0224] Optionally, the transceiver module 1301 is further configured to receive a key for a public key switching algorithm, wherein the key for the public key switching algorithm is a key used when executing the public key switching algorithm. The key for the public key switching algorithm is the RLWE' ciphertext obtained by homomorphically encrypting the level 2 key using the level 1 key.
[0225] Optionally, processing module 1302 is further configured to calculate the first RLWE' ciphertext by executing the scheme switching algorithm to obtain a corresponding second RLWE' ciphertext; processing module 1302 is further configured to concatenate the first RLWE' ciphertext and the second RLWE' ciphertext into a first RGSW ciphertext. The plaintext corresponding to the second RLWE' ciphertext is related to the homomorphic encryption key of the first RLWE' ciphertext.
[0226] For example, by executing the scheme switching algorithm to calculate the first RLWE' ciphertext, the first RGSW ciphertext of level 1 is obtained as follows: SS RLWE′→RGSW :RLWE′sk (m)→RGSW sk (m);
[0227] Where sk is the key of level 1, RLWE′ sk (m) is the first RLWE' ciphertext, m is the message plaintext, RGSW sk (m) is the RGSW ciphertext of level 1.
[0228] Optionally, the transceiver module 1301 is further configured to receive a first key of the scheme switching algorithm, where the first key is a key used when obtaining a level 1 RGSW ciphertext by executing the scheme switching algorithm.
[0229] In one possible design, transceiver module 1301 is further configured to obtain a third RLWE' ciphertext, and processing module 1302 is further configured to calculate the third RLWE' ciphertext by executing a scheme switching algorithm to obtain a second RGSW ciphertext. The third RLWE' ciphertext is the RLWE' ciphertext obtained by homomorphically encrypting the level 0 key plaintext using a level 2 key; the second RGSW ciphertext is the RGSW ciphertext obtained by homomorphically encrypting the level 0 key plaintext using a level 2 key. The second RGSW ciphertext is the bootstrap key used for the outer product operation in the bootstrapping of functions from level 0 to level 2.
[0230] Optionally, processing module 1302 is further configured to calculate the third RLWE' ciphertext by executing the scheme switching algorithm to obtain a corresponding fourth RLWE' ciphertext; processing module 1302 is further configured to concatenate the third RLWE' ciphertext and the fourth RLWE' ciphertext into a second RGSW ciphertext. The plaintext corresponding to the fourth RLWE' ciphertext is related to the homomorphic encryption key of the third RLWE' ciphertext.
[0231] For example, by executing the scheme switching algorithm to calculate the third RLWE' ciphertext, the second RGSW ciphertext is expressed as follows:
[0232] in, is the second RGSW ciphertext, is the key for level 2, is the third RLWE' ciphertext, sk i is the key of level 0 and n is the polynomial dimension.
[0233] In one possible design, the transceiver module 1301 is further configured to receive a second key of the scheme switching algorithm, where the second key is a key used when obtaining a second RGSW ciphertext by executing the scheme switching algorithm.
[0234] In some other embodiments, the transceiver module 1301 is configured to obtain a third ring error learning hypothesis RLWE' ciphertext, and the processing module 1302 is configured to calculate the third RLWE' ciphertext by executing a scheme switching algorithm to obtain a second RGSW ciphertext. The third RLWE' ciphertext is the RLWE' ciphertext obtained by homomorphically encrypting the level 0 key plaintext using a level 2 key; the second RGSW ciphertext is the RGSW ciphertext obtained by homomorphically encrypting the level 0 key plaintext using a level 2 key. The second RGSW ciphertext is the bootstrap key used for the outer product operation in the function bootstrapping from level 0 to level 2.
[0235] In one possible design, processing module 1302 is further configured to calculate a third RLWE' ciphertext by executing a scheme switching algorithm to obtain a corresponding fourth RLWE' ciphertext. Processing module 1302 is further configured to concatenate the third RLWE' ciphertext and the fourth RLWE' ciphertext into a second RGSW ciphertext. The plaintext corresponding to the fourth RLWE' ciphertext is related to the homomorphic encryption key of the third RLWE' ciphertext.
[0236] For example, by executing the scheme switching algorithm to calculate the third RLWE' ciphertext, the second RGSW ciphertext is expressed as follows:
[0237] in, is the second RGSW ciphertext, is the key for level 2, is the third RLWE' ciphertext, sk i is the key of level 0 and n is the polynomial dimension.
[0238] Optionally, the transceiver module 1301 is further configured to receive a second key of the scheme switching algorithm, where the second key is a key used when obtaining a second RGSW ciphertext by executing the scheme switching algorithm.
[0239] In one possible design scheme, the transceiver module 1301 is also used to obtain the level 2 error learning hypothesis LWE ciphertext; the processing module 1302 is also used to convert the level 2 LWE ciphertext into the first RLWE' ciphertext of level 1 by executing the public key switching algorithm and splicing operation; the processing module 1302 is also used to calculate the first RLWE' ciphertext by executing the scheme switching algorithm to obtain the first RGSW ciphertext of level 1.
[0240] Optionally, the LWE ciphertext of level 2 is l LWE ciphertexts, where l is an integer greater than 1. The processing module 1302 is further used to convert each of the l LWE ciphertexts into a corresponding first RLWE ciphertext by executing the public key switching algorithm l times, for a total of l first RLWE ciphertexts; the processing module 1302 is further used to splice the l first RLWE ciphertexts into a first RLWE' ciphertext.
[0241] For example, by executing the public key switching algorithm, each of the l LWE ciphertexts is converted into a corresponding first RLWE ciphertext as shown below:
[0242] Among them, f0 is the calculation function of the public key switching algorithm, is the key of level 2, sk is the key of level 1, is the i-th LWE ciphertext among l LWE ciphertexts, v i is the i-th component of the gadget vector, m is the plaintext, RLWE sk (v i m) is the i-th first RLWE ciphertext.
[0243] Optionally, the transceiver module 1301 is further configured to receive a key for a public key switching algorithm, wherein the key for the public key switching algorithm is a key used when executing the public key switching algorithm. The key for the public key switching algorithm is the RLWE' ciphertext obtained by homomorphically encrypting the level 2 key using the level 1 key.
[0244] Optionally, the processing module 1302 is further configured to calculate the first RLWE' ciphertext by executing the scheme switching algorithm to obtain a corresponding second RLWE' ciphertext. The processing module 1302 is further configured to concatenate the first RLWE' ciphertext and the second RLWE' ciphertext into a first RGSW ciphertext.
[0245] The plaintext corresponding to the second RLWE' ciphertext is related to the homomorphic encryption key of the first RLWE' ciphertext.
[0246] For example, by executing the scheme switching algorithm to calculate the first RLWE' ciphertext, the first RGSW ciphertext of level 1 is obtained as follows: SS RLWE′→RGSW :RLWE′ sk (m)→RGSW sk (m);
[0247] Where sk is the key of level 1, RLWE′ sk (m) is the first RLWE' ciphertext, m is the plaintext, RGSW sk (m) is the first RGSW ciphertext of level 1.
[0248] Optionally, the transceiver module 1301 is further configured to receive a first key of the scheme switching algorithm, where the first key is a key used when obtaining a first RGSW ciphertext of level 1 by executing the scheme switching algorithm.
[0249] Optionally, the transceiver module 1301 may include a sending module (not shown in FIG13 ) and a receiving module (not shown in FIG13 ). The sending module is used to implement the sending function of the security device 1300 , and the receiving module is used to implement the receiving function of the security device 1300 .
[0250] Optionally, the security device 1300 may further include a storage module (not shown in FIG. 13 ) storing a program or instruction. When the processing module 1302 executes the program or instruction, the security device 1300 may perform the functions of the above method.
[0251] It can be understood that the security device 1300 can be a network device, a chip (system) or other parts or components that can be set in the network device, or a device that includes a network device. This application does not limit this.
[0252] In addition, the technical effects of the security device 1300 can refer to the technical effects of the security method based on homomorphic encryption shown in Figure 6, and will not be repeated here.
[0253] FIG14 is a second structural diagram of a security device provided in an embodiment of the present application. For example, the security device may be a network device, or a chip (system) or other component or assembly that can be provided in a network device. As shown in FIG14 , the security device 1400 may include a processor 1401. Optionally, the security device 1400 may further include a memory 1402 and / or a transceiver 1403. The processor 1401 is coupled to the memory 1402 and the transceiver 1403, for example, by a communication bus.
[0254] The following is a detailed introduction to the various components of the safety device 1400 with reference to FIG14 :
[0255] The processor 1401 is the control center of the security device 1400 and can be a single processor or a collective term for multiple processing elements. For example, the processor 1401 can be one or more central processing units (CPUs), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application, such as one or more digital signal processors (DSPs) or one or more field programmable gate arrays (FPGAs).
[0256] Optionally, the processor 1401 can execute various functions of the security device 1400 by running or executing software programs stored in the memory 1402 and calling data stored in the memory 1402, such as executing the homomorphic encryption-based security method shown in Figures 7-12 above.
[0257] In a specific implementation, as an embodiment, the processor 1401 may include one or more CPUs, such as CPU0 and CPU1 shown in FIG14 .
[0258] In a specific implementation, as an embodiment, the security device 1400 may also include multiple processors, such as processor 1401 and processor 1404 shown in Figure 14. Each of these processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here can refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0259] The memory 1402 is used to store the software program for executing the solution of the present application, and the execution is controlled by the processor 1401. The specific implementation method can refer to the above method embodiment and will not be repeated here.
[0260] Alternatively, the memory 1402 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including a compact disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 1402 may be integrated with the processor 1401 or exist independently and be coupled to the processor 1401 via an interface circuit (not shown in FIG. 14 ) of the security device 1400, which is not specifically limited in this embodiment of the present application.
[0261] Transceiver 1403 is used for communication with other security devices. For example, if security device 1400 is a terminal, transceiver 1403 can be used to communicate with a network device or another terminal device. For another example, if security device 1400 is a network device, transceiver 1403 can be used to communicate with a terminal or another network device.
[0262] Optionally, the transceiver 1403 may include a receiver and a transmitter (not shown separately in FIG14 ), wherein the receiver is used to implement a receiving function, and the transmitter is used to implement a sending function.
[0263] Optionally, the transceiver 1403 can be integrated with the processor 1401, or can exist independently and be coupled to the processor 1401 through the interface circuit of the security device 1400 (not shown in Figure 14), which is not specifically limited in the embodiment of the present application.
[0264] It is understood that the structure of the safety device 1400 shown in FIG. 14 does not constitute a limitation on the safety device, and an actual safety device may include more or fewer components than shown, or a combination of certain components, or a different arrangement of components.
[0265] In addition, the technical effects of the safety device 1400 can refer to the technical effects of the methods described in the above method embodiments, and will not be repeated here.
[0266] It should be understood that the processor in the embodiments of the present application may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0267] It should also be understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0268] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer program are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (such as infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state drive.
[0269] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0270] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0271] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0272] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0273] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0274] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0275] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0276] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A security method based on homomorphic encryption, characterized in that: The method comprises: Get level 2 error learning hypothesis LWE ciphertext; The level 2 LWE ciphertext is converted into the level 1 first ring error learning hypothesis RLWE' ciphertext by executing a public key switching algorithm and a concatenation operation; The first RLWE' ciphertext is calculated by executing the scheme switching algorithm to obtain the first RGSW ciphertext of level 1.
2. The method according to claim 1, characterized in that The LWE ciphertext of level 2 is l LWE ciphertexts, where l is an integer greater than 1, and the LWE ciphertext of level 2 is converted into the first RLWE' ciphertext of level 1 by executing a public key switching algorithm and a concatenation operation, including: By executing the public key switching algorithm l times, each LWE ciphertext in the l LWE ciphertexts is converted into a corresponding first RLWE ciphertext, a total of l first RLWE ciphertexts; The l first RLWE ciphertexts are concatenated into the first RLWE' ciphertext.
3. The method according to claim 2, characterized in that The conversion of each of the l LWE ciphertexts into a corresponding first RLWE ciphertext by executing the public key switching algorithm is expressed as follows: Wherein, f0 is the calculation function of the public key switching algorithm, is the key of level 2, sk is the key of level 1, is the i-th LWE ciphertext among the l LWE ciphertexts, v i is the i-th component of the gadget vector, m is the plain text, RLWE sk (v i m) is the i-th first RLWE ciphertext.
4. The method according to claim 2 or 3, characterized in that: The method further comprises: A key of the public key switching algorithm is received, wherein the key of the public key switching algorithm is a key used when executing the public key switching algorithm.
5. The method according to claim 4, characterized in that The key of the public key switching algorithm is the RLWE' ciphertext obtained by homomorphically encrypting the level 2 key using the level 1 key.
6. The method according to any one of claims 2 to 5, characterized in that: The step of calculating the first RLWE' ciphertext by executing the scheme switching algorithm to obtain the first RGSW ciphertext of level 1 includes: Calculating a first RLWE' ciphertext by executing the scheme switching algorithm to obtain a corresponding second RLWE' ciphertext, wherein the plaintext corresponding to the second RLWE' ciphertext is related to the homomorphic encryption key of the first RLWE' ciphertext; The first RLWE' ciphertext and the second RLWE' ciphertext are concatenated into the first RGSW ciphertext.
7. The method according to claim 6, characterized in that The first RLWE' ciphertext is calculated by executing the scheme switching algorithm to obtain the first RGSW ciphertext of level 1, which is expressed as follows: SS RLWE′→RGSW :RLWE′ sk (m)→RGSW sk (m); Where sk is the key of level 1, RLWE′ sk (m) is the first RLWE' ciphertext, m is the plaintext, RGSW sk (m) is the first RGSW ciphertext of level 1.
8. The method according to claim 6 or 7, characterized in that: The method further comprises: A first key of the scheme switching algorithm is received, wherein the first key is a key used when obtaining a first RGSW ciphertext of level 1 by executing the scheme switching algorithm.
9. The method according to any one of claims 1 to 8, characterized in that The method comprises: Obtain a third RLWE' ciphertext, wherein the third RLWE' ciphertext is the RLWE' ciphertext obtained by homomorphically encrypting the key plaintext of level 0 using the key of level 2; The third RLWE' ciphertext is calculated by executing the scheme switching algorithm to obtain the second RGSW ciphertext, wherein the second RGSW ciphertext is the RGSW ciphertext obtained by homomorphically encrypting the level 0 key plaintext using the level 2 key, and the second RGSW ciphertext is the bootstrap key used for the outer product operation in the function bootstrapping from level 0 to level 2.
10. The method according to claim 9, characterized in that The step of calculating the third RLWE' ciphertext by executing the scheme switching algorithm to obtain the second RGSW ciphertext includes: Calculating a third RLWE' ciphertext by executing the scheme switching algorithm to obtain a corresponding fourth RLWE' ciphertext, wherein the plaintext corresponding to the fourth RLWE' ciphertext is related to the homomorphic encryption key of the third RLWE' ciphertext; The third RLWE' ciphertext and the fourth RLWE' ciphertext are concatenated into the second RGSW ciphertext.
11. The method according to claim 9 or 10, characterized in that: The third RLWE' ciphertext is calculated by executing the scheme switching algorithm to obtain the second RGSW ciphertext, which is expressed as follows: in, For the second RGSW ciphertext, is the key for level 2, is the third RLWE' ciphertext, sk i is the key of level 0, and n is the polynomial dimension.
12. The method according to any one of claims 9 to 11, characterized in that: The method further comprises: A second key of the scheme switching algorithm is received, wherein the second key is a key used when the second RGSW ciphertext is obtained by executing the scheme switching algorithm.
13. A security method based on homomorphic encryption, characterized in that: The method comprises: Obtain a third ring error learning hypothesis RLWE' ciphertext, wherein the third RLWE' ciphertext is the RLWE' ciphertext obtained by homomorphically encrypting the key plaintext of level 0 using the key of level 2; The third RLWE' ciphertext is calculated by executing the scheme switching algorithm to obtain the second RGSW ciphertext, wherein the second RGSW ciphertext is the RGSW ciphertext obtained by homomorphically encrypting the level 0 key plaintext using the level 2 key, and the second RGSW ciphertext is the bootstrap key used for the outer product operation in the function bootstrapping from level 0 to level 2.
14. The method according to claim 13, characterized in that The step of calculating the third RLWE' ciphertext by executing the scheme switching algorithm to obtain the second RGSW ciphertext includes: Calculating a third RLWE' ciphertext by executing the scheme switching algorithm to obtain a corresponding fourth RLWE' ciphertext, wherein the plaintext corresponding to the fourth RLWE' ciphertext is related to the homomorphic encryption key of the third RLWE' ciphertext; The third RLWE' ciphertext and the fourth RLWE' ciphertext are concatenated into the second RGSW ciphertext.
15. The method according to claim 13 or 14, characterized in that The third RLWE' ciphertext is calculated by executing the scheme switching algorithm to obtain the second RGSW ciphertext, which is expressed as follows: in, For the second RGSW ciphertext, is the key for level 2, is the third RLWE' ciphertext, sk i is the key of level 0, and n is the polynomial dimension.
16. The method according to any one of claims 13 to 15, characterized in that The method further comprises: A second key of the scheme switching algorithm is received, wherein the second key is a key used when the second RGSW ciphertext is obtained by executing the scheme switching algorithm.
17. The method according to any one of claims 13 to 16, characterized in that The method comprises: Get level 2 error learning hypothesis LWE ciphertext; Converting the LWE ciphertext of level 2 into a first RLWE' ciphertext of level 1 by executing a public key switching algorithm and a concatenation operation; The first RLWE' ciphertext is calculated by executing the scheme switching algorithm to obtain the first RGSW ciphertext of level 1.
18. The method according to claim 17, characterized in that The LWE ciphertext of level 2 is l LWE ciphertexts, where l is an integer greater than 1, and the LWE ciphertext of level 2 is converted into the first RLWE' ciphertext of level 1 by executing a public key switching algorithm and a concatenation operation, including: By executing the public key switching algorithm l times, each LWE ciphertext in the l LWE ciphertexts is converted into a corresponding first RLWE ciphertext, a total of l first RLWE ciphertexts; The l first RLWE ciphertexts are concatenated into the first RLWE' ciphertext.
19. The method according to claim 18, characterized in that The conversion of each of the l LWE ciphertexts into a corresponding first RLWE ciphertext by executing the public key switching algorithm is expressed as follows: Wherein, f0 is the calculation function of the public key switching algorithm, is the key of level 2, sk is the key of level 1, is the i-th LWE ciphertext among the l LWE ciphertexts, v i is the i-th component of the gadget vector, m is the plain text, RLWE sk (v i m) is the i-th first RLWE ciphertext.
20. The method according to claim 18 or 19, characterized in that The method further comprises: A key of the public key switching algorithm is received, wherein the key of the public key switching algorithm is a key used when executing the public key switching algorithm.
21. The method according to claim 20, characterized in that The key of the public key switching algorithm is the RLWE' ciphertext obtained by homomorphically encrypting the level 2 key using the level 1 key.
22. The method according to any one of claims 18 to 21, characterized in that The step of calculating the first RLWE' ciphertext by executing the scheme switching algorithm to obtain the first RGSW ciphertext of level 1 includes: Calculating a first RLWE' ciphertext by executing the scheme switching algorithm to obtain a corresponding second RLWE' ciphertext, wherein the plaintext corresponding to the second RLWE' ciphertext is related to the homomorphic encryption key of the first RLWE' ciphertext; The first RLWE' ciphertext and the second RLWE' ciphertext are concatenated into the first RGSW ciphertext.
23. The method according to claim 22, characterized in that The first RLWE' ciphertext is calculated by executing the scheme switching algorithm to obtain the first RGSW ciphertext of level 1, which is expressed as follows: SS RLWE′→RGSW :RLWE′ sk (m)→RGSW sk (m); Where sk is the key of level 1, RLWE′ sk (m) is the first RLWE' ciphertext, m is the plaintext, RGSW sk (m) is the first RGSW ciphertext of level 1.
24. The method according to claim 22 or 23, characterized in that The method further comprises: A first key of the scheme switching algorithm is received, wherein the first key is a key used when obtaining a first RGSW ciphertext of level 1 by executing the scheme switching algorithm.
25. A safety device, characterized in that: The apparatus comprises: a module for executing the method according to any one of claims 1-24.
26. A safety device, characterized in that: The security device comprises: a processor and a memory; the memory is used to store computer instructions, and when the processor executes the instructions, the security device executes the method according to any one of claims 1-24.
27. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises a computer program or instructions, and when the computer program or instructions are executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 24.
28. A computer program product, characterized in that The computer program product comprises: a computer program or instructions, and when the computer program or instructions are run on a computer, the computer is caused to perform the method according to any one of claims 1 to 24.
Citation Information
Patent Citations
Fully-homomorphic encryption method and device and computer readable storage medium
CN108718231A
Homomorphic encryption bootstrap method and device, processor, system on chip and computing equipment
CN115834020A
Homomorphic encryption apparatus and method
US20230171085A1
