CN117992989B - Decryption method, system, device and storage medium - Google Patents
Decryption method, system, device and storage medium Download PDFInfo
- Publication number
- CN117992989B CN117992989B CN202410371501.4A CN202410371501A CN117992989B CN 117992989 B CN117992989 B CN 117992989B CN 202410371501 A CN202410371501 A CN 202410371501A CN 117992989 B CN117992989 B CN 117992989B
- Authority
- CN
- China
- Prior art keywords
- key
- public key
- conversion
- preset
- ciphertext
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 112
- 238000006243 chemical reaction Methods 0.000 claims abstract description 303
- 230000008569 process Effects 0.000 claims abstract description 65
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 40
- 230000006870 function Effects 0.000 claims description 102
- 238000004364 calculation method Methods 0.000 claims description 24
- 238000004590 computer program Methods 0.000 claims description 10
- 230000001131 transforming effect Effects 0.000 claims description 4
- 238000005516 engineering process Methods 0.000 abstract description 18
- 238000012545 processing Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 5
- 238000011084 recovery Methods 0.000 description 5
- 230000009471 action Effects 0.000 description 3
- 230000006872 improvement Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000007667 floating Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000001737 promoting effect Effects 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
Landscapes
- Storage Device Security (AREA)
Abstract
The application discloses a decryption method, a decryption system, a decryption device and a storage medium, and relates to the field of data security. The method is used for solving the problem that the encryption of the data is in danger of being cracked. In the scheme, a second public key meeting preset conditions is searched according to the first public key; calculating a conversion key according to the first public key and the second public key; and decrypting the first ciphertext according to the conversion key, a preset homomorphic decryption function and a second private key corresponding to the second public key to obtain a plaintext. According to the application, the second public key is searched by using the preset condition, and the conversion secret key is calculated to bypass the public key encryption algorithm, so that unauthorized access to the first ciphertext is achieved, a certain security hole exists in the current encryption technology, the encryption technology is continuously improved and perfected, and data leakage in the application process is prevented.
Description
Technical Field
The present application relates to the field of data security, and in particular, to a decryption method, system, device, and storage medium.
Background
With the rapid development of information technology, the importance of information security becomes more and more non-negligible. While there are many sophisticated data encryption algorithms currently available for securing data transmissions, with the increasing sophistication of attacker attack techniques, encrypted data is still facing a threat of hacking by an attacker. Therefore, there is an urgent need to develop new decryption methods to evaluate and reveal the potential vulnerabilities and security vulnerabilities of current encryption systems, pushing encryption technology to continue to improve and perfect to address the evolving security challenges.
Disclosure of Invention
The application aims to provide a decryption method, a system, a device and a storage medium, wherein a second public key is searched by using preset conditions, and a conversion key is calculated to bypass a public key encryption algorithm, so that unauthorized access to a first ciphertext is achieved, a certain security hole exists in the current encryption technology, the encryption technology is promoted to be continuously improved and perfected, and data leakage in the application process is prevented.
In a first aspect, the present application provides a decryption method, including:
Searching a second public key meeting preset conditions according to a first public key, wherein the first public key is a public key generated by using a preset homomorphic encryption key generation function;
Calculating a conversion key according to the first public key and the second public key;
Decrypting the first ciphertext according to the conversion key, a preset homomorphic decryption function and a second private key corresponding to the second public key to obtain a plaintext;
the first ciphertext is obtained by encrypting the plaintext according to the first public key, a first private key corresponding to the first public key and a preset homomorphic encryption function.
In one embodiment, retrieving a second public key satisfying a preset condition from the first public key includes:
pre-constructing a key set, wherein the key set comprises a plurality of different keys, and the keys comprise a public key and a private key;
Determining a preset public key from the key set in a preset mode;
judging whether the preset public key and the first public key meet preset conditions or not;
and if so, determining a preset public key meeting the preset condition as the second public key.
In one embodiment, each key in the set of keys is a key generated at a different time by the preset homomorphic encryption key generation function.
In one embodiment, when the first public key is a public key obtained by using CKKS homomorphic encryption algorithm, the preset condition is: Wherein pk A is the first public key, pk B is the second public key,/> To reverse the second public key,/>And the first preset value is not larger than a preset threshold value.
In one embodiment, when the first public key is a public key obtained by using CKKS homomorphic encryption algorithm, the first public key and the second public key include n parts, n is an integer not less than 2, and the preset condition is that:
;
Wherein pk A1 is the first portion of the first public key, pk A2 is the second portion of the first public key, pk n is the nth portion of the first public key, pk B1 is the first portion of the second public key, pk B2 is the second portion of the second public key, pk Bn is the nth portion of the second public key, To reverse the first portion of the second public key,/>To reverse the second portion of the second public key,/>To reverse the nth portion of the second public key,/>For the second preset value,/>For the third preset value,/>And the second preset value, the third preset value and the fourth preset value are not larger than a preset threshold value.
In one embodiment, computing a conversion key from the first public key and the second public key includes:
calculating the conversion key according to the first public key, the second public key and a first preset formula;
The expression of the first preset formula is: ;
Wherein, For the conversion key.
In one embodiment, computing a conversion key from the first public key and the second public key includes:
calculating the conversion key according to the first public key, the second public key and a second preset formula;
the expression of the second preset formula is: ;
Wherein, For the first part of the conversion key,/>For the second part of the conversion key,Is the nth part of the conversion key.
In one embodiment, computing a conversion key from the first public key and the second public key includes:
and calculating the conversion key according to two random elements used in the process of generating the first public key by using the preset homomorphic encryption key generating function and two random elements used in the process of generating the second public key.
In one embodiment, decrypting the first ciphertext according to the conversion key, a preset homomorphic decryption function, and a second private key corresponding to the second public key to obtain a plaintext includes:
converting the first ciphertext by using the conversion key to obtain a converted ciphertext;
And decrypting the conversion ciphertext according to the conversion secret key, the preset homomorphic decryption function and the second private key to obtain the plaintext.
In one embodiment, decrypting the transformed ciphertext according to the transformed key, the preset homomorphic decryption function, and the second private key to obtain the plaintext includes:
Decrypting the conversion ciphertext according to the preset homomorphic decryption function and the second private key to obtain an intermediate plaintext;
and converting the intermediate plaintext by using the conversion key to obtain the plaintext.
In one embodiment, converting the first ciphertext using the conversion key to obtain a converted ciphertext includes:
And replacing the information with the first public key in the first secret key with the information with the second public key by using the conversion secret key to obtain the conversion secret key.
In one embodiment, decrypting the transformed ciphertext according to the preset homomorphic decryption function and the second private key to obtain an intermediate plaintext includes:
And converting the information of the second public key in the converted ciphertext except the conversion key into the information of the conversion key or the second private key according to the preset homomorphic decryption function and the second private key, so as to obtain the intermediate plaintext.
In one embodiment, converting the intermediate plaintext using the conversion key to obtain the plaintext includes:
And converting the intermediate plaintext into a sum of the plaintext and an error term by using the conversion key, wherein the error term is not greater than a preset error threshold.
In one embodiment, computing a conversion key from the first public key and the second public key includes:
generating a first partial conversion key and a third partial conversion key according to the second random element and the fourth random element;
Generating a second partial conversion key according to the first random element and the third random element;
The first random element and the second random element are two random elements used in the process of generating the first public key by using the preset homomorphic encryption key generating function, and the third random element and the fourth random element are two random elements used in the process of generating the second public key by using the preset homomorphic encryption key generating function; the conversion key includes the first partial conversion key, the second partial conversion key, and the third partial conversion key.
In one embodiment, converting the first ciphertext using the conversion key to obtain a converted ciphertext includes:
Replacing the information with the first public key in the main body item of the first ciphertext with the information with the second public key by using a first partial conversion key to obtain the main body item of the conversion ciphertext;
Replacing the information with the first public key in the auxiliary item of the first ciphertext with the information with the second public key by using a second partial conversion key to obtain the auxiliary item of the conversion ciphertext;
The main body item of the first ciphertext is a part of the first ciphertext including the plaintext, and the auxiliary item of the first ciphertext is a part of the first ciphertext not including the plaintext.
In one embodiment, replacing information with the first public key in the main item of the first ciphertext with information with the second public key by using a first partial conversion key to obtain a main item of a converted ciphertext, replacing information with the first public key in the auxiliary item of the first ciphertext with information with the second public key by using a second partial conversion key to obtain an auxiliary item of a converted ciphertext, including:
respectively replacing the information with the first public key in the main body item and the auxiliary item of the first ciphertext with the information with the second public key by using a first partial conversion key, a second partial conversion key and a third preset formula to obtain the main body item and the auxiliary item of the conversion ciphertext;
The expression of the third preset formula is:
;
wherein c B is the transformed ciphertext, c B1 is the main item of the transformed ciphertext, c B2 is the auxiliary item of the transformed ciphertext, For the first random element, b A is the second random element,/>For the third random element, b B is the fourth random element, v, e 0、e1 are ciphertext random elements generated during the generation of the first ciphertext,/>Transforming a key for said first part,/>And (3) converting a key for the second part, wherein m A is the plaintext.
In one embodiment, decrypting the transformed ciphertext according to the preset homomorphic decryption function and the second private key to obtain an intermediate plaintext includes:
according to the preset homomorphic decryption function and the second private key, converting information of a second public key except the conversion key in the conversion ciphertext into information of the conversion key or the second private key by using a fourth preset formula, and obtaining the intermediate plaintext;
the expression of the fourth preset formula is: ;
Wherein, M B is the intermediate plaintext, s B is the second private key, e A is a first key random element generated during the generation of the first public key, e B is a second key random element generated during the generation of the second public key.
In one embodiment, converting the intermediate plaintext using the conversion key to obtain the plaintext includes:
Converting the intermediate plaintext into a sum of the plaintext and an error term using the third partial conversion key and a fifth predetermined formula;
the expression of the fifth preset formula is: ;
Wherein, Transforming the key for said third part,/>For an approximation of the plaintext, m A is the plaintext,Is the error term.
In a second aspect, the present application provides a decryption system comprising:
The searching unit is used for searching a second public key meeting preset conditions according to a first public key, wherein the first public key is a public key generated by using a preset homomorphic encryption key generating function;
a calculation unit configured to calculate a conversion key from the first public key and the second public key;
The decryption unit is used for decrypting the first ciphertext according to the conversion key, a preset homomorphic decryption function and a second private key corresponding to the second public key to obtain a plaintext;
the first ciphertext is obtained by encrypting the plaintext according to the first public key, a first private key corresponding to the first public key and a preset homomorphic encryption function.
In a third aspect, the present application provides a decryption apparatus comprising:
A memory for storing a computer program;
A processor for implementing the steps of the decryption method as described above when storing a computer program.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the decryption method as described above.
The application provides a decryption method, a decryption system, a decryption device and a storage medium, and relates to the field of data security. The method is used for solving the problem that the encryption of the data is in danger of being cracked. In the scheme, a second public key meeting preset conditions is searched according to the first public key; calculating a conversion key according to the first public key and the second public key; and decrypting the first ciphertext according to the conversion key, a preset homomorphic decryption function and a second private key corresponding to the second public key to obtain a plaintext. According to the application, the second public key is searched by using the preset condition, and the conversion secret key is calculated to bypass the public key encryption algorithm, so that unauthorized access to the first ciphertext is achieved, a certain security hole exists in the current encryption technology, the encryption technology is continuously improved and perfected, and data leakage in the application process is prevented.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required in the prior art and the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a homomorphic encryption scheme provided by the present application;
FIG. 2 is a flow chart of a decryption method provided by the present application;
FIG. 3 is a schematic diagram of a homomorphic encryption scheme according to the present application;
FIG. 4 is a flow chart of a homomorphic encryption scheme provided by the present application;
FIG. 5 is a flowchart of a decryption method according to the present application;
FIG. 6 is a schematic diagram of a decryption system according to the present application;
FIG. 7 is a schematic diagram of a decryption device according to the present application;
fig. 8 is a schematic diagram of a computer readable storage medium according to the present application.
Detailed Description
The core of the application is to provide a decryption method, a system, a device and a storage medium, wherein a preset condition is utilized to search a second public key and calculate a conversion key to bypass a public key encryption algorithm, so that unauthorized access to a first ciphertext is achieved, a certain security hole exists in the current encryption technology, the encryption technology is promoted to be continuously improved and perfected, and data leakage in the application process is prevented.
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The homomorphic encryption scheme is shown in fig. 1, specifically, the data processing process is as follows: the first user encrypts plaintext m to obtain a first ciphertext, the encrypted first ciphertext is sent to the second user, the second user carries out homomorphic calculation on the first ciphertext, the calculated first ciphertext is sent to the first user, and the first user decrypts the calculated first ciphertext to obtain m'.
In a first aspect, as shown in fig. 2, the present application provides a decryption method, including:
s11: searching a second public key meeting preset conditions according to a first public key, wherein the first public key is a public key generated by using a preset homomorphic encryption key generation function;
The first public key mentioned in this step is a public key generated using a preset homomorphic encryption key generation function. In particular, homomorphic encryption is a special encryption technique that allows certain operations to be performed on ciphertext without decryption to obtain the result of the operation. In this case, the process of retrieving the second public key satisfying the preset condition using the first public key is to acquire another public key for subsequent arithmetic operation at the time of decryption.
In homomorphic encryption schemes, there are typically two phases: encryption and decryption. In the encryption stage, a plaintext is encrypted into a first ciphertext by a first public key and a preset homomorphic encryption function. In the decryption stage, the ciphertext needs to be decrypted by using the corresponding private key to restore the plaintext. In general, this step is to retrieve the second public key satisfying the condition according to the preset condition, prepare for the next decryption process, and provide the key information required for the subsequent decryption calculation and ciphertext decryption. In particular, by retrieving the second public key using preset conditions, the encryption algorithm of the public key may be bypassed, thereby making it possible to achieve unauthorized access to the first ciphertext.
S12: calculating a conversion key according to the first public key and the second public key;
In this step, it is first necessary to obtain a second public key that was previously retrieved from the first public key. The first public key and the second public key are key information for encrypting and decrypting data, and play a vital role in the decryption process. And calculating the conversion key according to the first public key and the second public key. The conversion key is usually an intermediate variable for performing a specific operation during the decryption process, which may include parameter setting of the decryption algorithm, key agreement, etc., and by calculating the conversion key, it is ensured that the decryption process is performed as intended. The calculated conversion key will play a key role in the subsequent decryption process, such as for initialization of the decryption algorithm, key generation, or other necessary operations to ensure proper decryption of the first ciphertext and to obtain plaintext.
S13: decrypting the first ciphertext according to the conversion key, a preset homomorphic decryption function and a second private key corresponding to the second public key to obtain a plaintext;
The first ciphertext is obtained by encrypting the plaintext according to the first public key, the first private key corresponding to the first public key and a preset homomorphic encryption function.
In S12, a conversion key has been calculated, which is generated from the first public key and the second public key; in the decryption process, a preset homomorphic decryption function is needed, and the preset homomorphic decryption is usually used for decrypting the first ciphertext and ensuring that the decryption result is consistent with the original plaintext, wherein the preset homomorphic decryption function can ensure the integrity and the security of data (the preset homomorphic encryption function and the preset homomorphic decryption function can be set in an initialization stage). In the decryption process, the first ciphertext is decrypted according to the conversion key, a preset homomorphic decryption function and a second private key corresponding to the second public key, and the result of decryption is an original plaintext, namely the content before encryption is restored through the decryption operation.
According to the application, the second public key is searched by using the preset condition, and the conversion secret key is calculated to bypass the public key encryption algorithm, so that unauthorized access to the first ciphertext is achieved, a certain security hole exists in the current encryption technology, the encryption technology is continuously improved and perfected, and data leakage in the application process is prevented.
In one embodiment, retrieving a second public key satisfying a preset condition from the first public key includes: pre-constructing a key set, wherein the key set comprises a plurality of different keys, and the keys comprise a public key and a private key; determining a preset public key from the key set in a preset mode; judging whether the preset public key and the first public key meet preset conditions or not; if so, determining the preset public key meeting the preset condition as a second public key.
In this embodiment, a specific implementation procedure of retrieving a second public key satisfying a preset condition according to a first public key is described, and a key set is first prepared, where the key set includes a plurality of different keys, each key is composed of a public key and a corresponding private key, and these keys are used in subsequent retrieval and judgment processes. In the key set, a preset public key is determined in a preset mode, and the preset public key is used as a candidate second public key for subsequent judgment and comparison. And then, comparing the preset public key with the first public key to judge whether the preset condition is met. If the preset public key and the first public key meet the preset condition, determining the preset public key meeting the preset condition as the second public key, and thus completing the process of searching and determining the second public key.
The preset mode refers to a preset rule, condition or algorithm, which is used for determining the selection of a preset public key or judging whether certain keys meet specific conditions. The preset mode can be various modes, such as random selection: selecting a key in a random manner from a key set as a preset public key; based on the selection of a particular attribute: determining a preset public key according to specific attributes of the key, such as length, type and the like; and (3) selecting according with a certain rule: setting certain rules or algorithms, wherein only the secret keys conforming to the rules can be preset public keys; pre-defined sequential selection: selecting a secret key as a preset public key according to a predefined sequence; selection based on a timestamp or other identification: selecting a preset public key according to a timestamp or other unique identifier generated by the secret key; these are just examples of some of the preset patterns, and in practice, different preset patterns may be designed according to specific application scenarios and requirements. The selection of the preset mode should ensure that the expected result is achieved during the key retrieval and judgment process and meet the requirements of safety and effectiveness.
Through the steps, the process of the embodiment can ensure that a proper public key is used in decryption operation, thereby bypassing a public key encryption algorithm, realizing unauthorized access to the first ciphertext, prompting the current encryption technology to have a certain security hole, and promoting the improvement and perfection of the encryption technology so as to prevent the occurrence of data leakage.
In one embodiment, each key in the set of keys is a key generated at a different time by a preset homomorphic encryption key generation function.
In this embodiment, each key in the key set is generated at different times by presetting homomorphic encryption key generating functions, and this generating method has the advantage that each public key in the key set is identical to the first public key generating method, so that it is easier to find a second public key satisfying the preset condition during searching, and comparison and judgment can be performed under similar conditions and rules. Because the keys are generated at different times, there may be a certain difference, however, by using the same preset homomorphic encryption key generation function, the keys generated at different time points can still maintain a certain consistency, so that the second public key meeting the preset condition is more easily searched in the key set. In addition, by adopting the same generation mode, the retrieval process of the key set can be simplified, and the retrieval algorithm can more easily identify and match the second public key meeting the preset condition because the generation mode is consistent, so that the retrieval efficiency and accuracy are improved.
In one embodiment, when the first public key is a public key obtained using CKKS (Cheon-Kim-Song) homomorphic encryption algorithm, the preset condition is: Wherein pk A is the first public key, pk B is the second public key,/> To reverse the second public key,/>The first preset value is not greater than a preset threshold.
The embodiment describes that when CKKS homomorphic encryption algorithm is used, a specific preset condition is set to ensure the smooth proceeding of the decryption process, and the preset condition requiresSuch a preset conditional design is intended to ensure that the conditional second public key can be accurately retrieved during decryption in order to calculate the conversion key and successfully decrypt the first ciphertext. The CKKS homomorphic encryption algorithm is a homomorphic encryption scheme based on a polynomial ring, aims to support homomorphic operation for floating point numbers, and is suitable for many scenes needing to encrypt and calculate floating point number data.
In one embodiment, computing a conversion key from a first public key and a second public key includes: calculating a conversion key according to the first public key, the second public key and a first preset formula; the expression of the first preset formula is: ; wherein/> To convert the key. Specifically, when CKKS is the homomorphic encryption algorithm and the preset condition is set to the above form, the following is set according to the first preset formula: /(I)。
In one embodiment, when the first public key is a public key obtained by using CKKS homomorphic encryption algorithm, and the first public key and the second public key include n parts, n is an integer not less than 2, and the preset condition is that:
; wherein pk A1 is the first portion of the first public key, pk A2 is the second portion of the first public key, pk An is the nth portion of the first public key, pk B1 is the first portion of the second public key, pk B2 is the second portion of the second public key, pk Bn is the nth portion of the second public key,/> To reverse the first part of the second public key,/>To reverse the second portion of the second public key,/>To reverse the nth portion of the second public key,/>For the second preset value,/>For the third preset value,/>The fourth preset value is the second preset value, and the third preset value and the fourth preset value are not larger than the preset threshold value.
The preset condition is set to the above form when the first public key and the second public key include n parts and the public key obtained using CKKS homomorphic encryption algorithm. The key point here is that a specific mathematical operation, i.e. multiplication and inversion operations, is performed on the combination of the parts of the first public key and the second public key and the product is compared with the respective preset values. If the product of each part satisfies a condition that is not greater than a corresponding preset value, it is determined that the preset public key satisfying the condition is the second public key. The embodiment realizes a safer and controllable decryption method, can effectively ensure the security of the secret key and the correctness of the decryption process, and meets the high requirements on the security and the stability in the encryption and decryption process.
In one embodiment, computing a conversion key from a first public key and a second public key includes: calculating a conversion key according to the first public key, the second public key and a second preset formula; the expression of the second preset formula is: ; wherein/> To transform the first part of the key,/>To transform the second part of the key,/>To convert the nth portion of the key. Specifically, when the homomorphic encryption algorithm is CKKS and the preset condition is set to the above form, the conversion key is calculated according to the second preset formula.
In one embodiment, computing a conversion key from a first public key and a second public key includes: the conversion key is calculated according to two random elements used in the process of generating the first public key by using a preset homomorphic encryption key generating function and two random elements used in the process of generating the second public key.
The specific steps of calculating the conversion key from the first public key and the second public key are described in this embodiment. In this embodiment, the calculation of the conversion key involves a random element used when the first public key and the second public key are generated using a preset homomorphic encryption key generation function. Specifically, the calculation of the conversion key includes the steps of: two random elements used when a first public key is generated by using a preset homomorphic encryption key generation function; two random elements used when a second public key is generated by using a preset homomorphic encryption key generation function; the four random elements are used as input, and a conversion key is generated through a specific calculation or operation mode. By the method, the generation process of the conversion key is closely related to the generation process of the first public key and the second public key, and meanwhile, the randomness and the security of the key are increased by utilizing the random element.
In one embodiment, decrypting the first ciphertext according to the conversion key, a preset homomorphic decryption function, and a second private key corresponding to the second public key to obtain a plaintext includes: converting the first ciphertext by using the conversion key to obtain a converted ciphertext; and decrypting the conversion ciphertext according to the conversion secret key, a preset homomorphic decryption function and the second private key to obtain a plaintext.
The embodiment describes a specific process of decrypting the first ciphertext to obtain the plaintext, and first, the first ciphertext is converted by using the conversion key to obtain the conversion ciphertext, and this step involves performing a specific conversion operation on the first ciphertext by using the conversion key obtained by the previous calculation to generate a new conversion ciphertext. The first ciphertext is converted using the conversion key to construct a new ciphertext that may be more conveniently decrypted by the second private key. Then, the conversion ciphertext is decrypted according to the conversion key, a preset homomorphic decryption function and a second private key to obtain a plaintext, and the step ensures that the conversion ciphertext is correctly decrypted into original plaintext data. Through the combination of the steps, the conversion key and a preset homomorphic decryption function can be effectively utilized, and the ciphertext is decrypted into the plaintext through specific conversion and decryption operations.
In one embodiment, decrypting the transformed ciphertext according to the transformed key, a preset homomorphic decryption function, and a second private key to obtain plaintext includes: decrypting the conversion ciphertext according to a preset homomorphic decryption function and a second private key to obtain an intermediate plaintext; and converting the intermediate plaintext by using the conversion key to obtain the plaintext.
In this embodiment, the conversion ciphertext is decrypted according to the conversion key, the preset homomorphic decryption function and the second private key to obtain the intermediate plaintext, so as to ensure that the conversion ciphertext is correctly decrypted into intermediate plaintext data. And then converting the intermediate plaintext by using the conversion key to obtain a final plaintext, wherein in the step, the intermediate plaintext generates the final plaintext by using the conversion key obtained by the previous calculation through a specific conversion operation. Through the steps, the preset homomorphic decryption function and the conversion key can be effectively utilized, and the ciphertext is decrypted into the final plaintext through specific decryption and conversion operations.
In one embodiment, converting the first ciphertext using the conversion key to obtain a converted ciphertext includes: and replacing the information with the first public key in the first secret key with the information with the second public key by using the conversion secret key to obtain a conversion secret.
The present embodiment describes a process of converting the first ciphertext using the conversion key. Specifically, the process includes replacing information with a first public key in a first ciphertext with information with a second public key, thereby obtaining a transformed ciphertext; this step is a very important loop in the decryption process, and ensures that the second public key information is used in the conversion secret so that the subsequent decryption operation can be successfully completed, and the purpose of this step is to replace the first public key related information used in the original encryption with the second public key related information through the conversion operation, thereby implementing the conversion processing of the first ciphertext, and this conversion operation helps to implement the modification of the first ciphertext, so that the subsequent decryption process can correctly use the second private key to perform the decryption operation, obtain the final plaintext, effectively modify the first ciphertext and ensure the correct decryption process, thereby implementing the decryption and access to the first ciphertext.
In one embodiment, decrypting the transformed ciphertext according to a preset homomorphic decryption function and a second private key to obtain an intermediate plaintext includes: and converting the information of the second public key except the conversion key in the conversion ciphertext into the information with the conversion key or the second private key according to a preset homomorphic decryption function and the second private key to obtain an intermediate plaintext.
In the embodiment, firstly, a conversion ciphertext is decrypted by using a preset homomorphic decryption function and a second private key to obtain an intermediate plaintext; and then, according to a preset homomorphic decryption function and a second private key, converting the information of the second public key except the conversion key in the conversion ciphertext into the information of the conversion key or the second private key, thereby further obtaining an intermediate plaintext. This decryption method essentially consists in processing the second public key information contained in the transformed ciphertext during decryption such that the final intermediate ciphertext no longer contains information encrypted using the first public key, but rather contains information of the transformed key or the second private key. Through the processing, the original public key decryption algorithm can be bypassed, the final intermediate plaintext is directly obtained, the unauthorized access to the first ciphertext is realized, the current encryption technology is prompted to have security holes, and meanwhile, the continuous improvement and perfection of the encryption technology are promoted, so that the situation of data leakage is prevented.
In one embodiment, converting the intermediate plaintext using the conversion key to obtain plaintext includes: and converting the intermediate plaintext into a sum of the plaintext and an error term by using the conversion key, wherein the error term is not greater than a preset error threshold.
In the embodiment, the intermediate plaintext is converted by using the conversion key to obtain the plaintext, wherein the conversion process comprises converting the intermediate plaintext into a sum of the plaintext and an error term, and the error term is not greater than a preset error threshold; this means that in the decryption process, the intermediate plaintext is transformed by using the transformation key to be transformed into the final plaintext, and the transformation manner can bypass the original decryption algorithm, so that the final plaintext is not limited by the original decryption algorithm and the key, thereby realizing the effect of bypassing the decryption algorithm.
In practical implementation, the mathematical relationship between the conversion key and the preset value can be set, so that the error term of the intermediate plaintext after conversion is not greater than the preset error threshold value, the final plaintext is ensured not to be excessively influenced in the conversion process, the original decryption algorithm and key limitation can be bypassed to a certain extent, and unauthorized access to the ciphertext is realized.
In one embodiment, computing a conversion key from a first public key and a second public key includes: generating a first partial conversion key and a third partial conversion key according to the second random element and the fourth random element; generating a second partial conversion key according to the first random element and the third random element; the first random element and the second random element are two random elements used in the process of generating the first public key by using a preset homomorphic encryption key generating function, and the third random element and the fourth random element are two random elements used in the process of generating the second public key by using the preset homomorphic encryption key generating function; the conversion keys include a first partial conversion key, a second partial conversion key, and a third partial conversion key.
The key to this embodiment is that the conversion key is calculated from the first public key and the second public key. First, a first partial conversion key and a third partial conversion key are generated from given second random elements and fourth random elements. The generation of the two-part conversion key is based on a random element employed when the first public key and the second public key are generated using a preset homomorphic encryption key generation function. By this step, it is ensured that the generation process of the conversion key is associated with the generation process of the original public key to maintain logical consistency between keys. A second partial conversion key is then generated from the given first random element and third random element. Similarly, the generation of the two-part conversion key is also based on a random element used when the first public key and the second public key are generated by a preset homomorphic encryption key generation function. Through this step, the integrity and reliability of the conversion key is ensured to support the subsequent decryption operation to proceed smoothly. In summary, the conversion key is composed of a first part, a second part and a third part, wherein each part is generated according to specific random elements so as to ensure the security and effectiveness of the key, and the method for generating the conversion key based on the random elements is helpful to enhance the security of decryption operation and ensure the randomness and unpredictability of key generation.
The conversion key generation method described in the embodiment can effectively support the decoding operation of the ciphertext in the decryption process, and simultaneously ensure the security and reliability of the key. The key generation mode is helpful to improve the security and the credibility of the encryption system, thereby promoting the continuous improvement and perfection of the encryption technology so as to cope with the increasingly complex data security challenges.
In one embodiment, converting the first ciphertext using the conversion key to obtain a converted ciphertext includes: replacing the information with the first public key in the main body item of the first ciphertext with the information with the second public key by using the first partial conversion key to obtain the main body item of the conversion ciphertext; replacing the information with the first public key in the auxiliary item of the first ciphertext with the information with the second public key by using the second partial conversion key to obtain the auxiliary item of the conversion ciphertext; the main body item of the first ciphertext is a part of the first ciphertext including the plaintext, and the auxiliary item of the first ciphertext is a part of the first ciphertext not including the plaintext.
In this embodiment, the conversion ciphertext is decrypted using a preset homomorphic decryption function and a second private key to obtain an intermediate plaintext, so as to decrypt the encrypted conversion ciphertext into the intermediate plaintext. Specifically, replacing information with a first public key in a main body item of a first ciphertext with information with a second public key by using a first partial conversion key to obtain a main body item of a conversion ciphertext; this step involves processing the body portion of the transformed ciphertext to replace key information therein to ensure that subsequent decryption operations proceed successfully. Specifically, the second partial conversion key is used to replace the information with the first public key in the auxiliary item of the first ciphertext with the information with the second public key to obtain the auxiliary item of the converted ciphertext, and the step is to process the auxiliary item of the first ciphertext to ensure that the related information can be matched correctly and support decryption operation. The main body item of the first ciphertext is a part of the first ciphertext, which comprises a plaintext, and the auxiliary item of the first ciphertext is a part of the first ciphertext, which does not comprise the plaintext.
According to the embodiment, the key information in the main body item and the auxiliary item of the converted ciphertext is replaced by processing the main body item and the auxiliary item of the converted ciphertext, so that the decryption operation can be ensured to be correctly carried out when the second public key is used, the public key encryption algorithm can be bypassed in the decryption process, unauthorized access to the ciphertext is realized, and the discovery of potential security holes existing in the current encryption technology is facilitated.
In one embodiment, replacing information with a first public key in a main item of a first ciphertext with information with a second public key using a first partial conversion key to obtain a main item of a converted ciphertext, replacing information with a first public key in an auxiliary item of the first ciphertext with information with a second public key using a second partial conversion key to obtain an auxiliary item of a converted ciphertext, comprising: respectively replacing the information with the first public key in the main body item and the auxiliary item of the first ciphertext with the information with the second public key by using the first partial conversion key, the second partial conversion key and a third preset formula to obtain the main body item and the auxiliary item of the conversion ciphertext;
The expression of the third preset formula is:
; wherein c B is the transformed ciphertext, c B1 is the subject of the transformed ciphertext, c B2 is the auxiliary of the transformed ciphertext,/> Is a first random element, b A is a second random element,/>B B is a fourth random element, v and e 0、e1 are ciphertext random elements generated in the process of generating the first ciphertext,Key conversion for the first part,/>For the second part, the key is transformed and m A is plaintext.
Specifically, the embodiment provides a specific implementation manner of converting the first ciphertext according to the first partial conversion key and the second partial conversion key to obtain the converted ciphertext. The first ciphertext comprises a main body item of the first ciphertext and an auxiliary item of the first ciphertext, and the conversion ciphertext also corresponds to the main body item of the conversion ciphertext corresponding to the main body item of the first ciphertext and the auxiliary item of the conversion ciphertext corresponding to the auxiliary item of the first ciphertext.
In one embodiment, decrypting the transformed ciphertext according to a preset homomorphic decryption function and a second private key to obtain an intermediate plaintext includes: according to a preset homomorphic decryption function and a second private key, converting information of a second public key except a conversion key in the conversion ciphertext into information of the conversion key or the second private key by using a fourth preset formula, and obtaining an intermediate plaintext;
The fourth preset formula has the expression: ;
Wherein, M B is an intermediate plaintext, s B is a second private key, e A is a first key random element generated during generation of the first public key, and e B is a second key random element generated during generation of the second public key.
Specifically, the embodiment provides a specific process of converting information of a second public key except a conversion key in a conversion ciphertext into information of the conversion key or the second private key by using a fourth preset formula according to a preset homomorphic decryption function and the second private key to obtain an intermediate plaintext; and a specific implementation mode of the fourth preset formula is given. The function of decrypting the converted ciphertext to obtain the intermediate plaintext can be realized through the fourth preset formula.
In one embodiment, converting the intermediate plaintext using the conversion key to obtain plaintext includes: converting the intermediate plaintext into a sum of plaintext and an error term by using a third partial conversion key and a fifth preset formula;
The expression of the fifth preset formula is: ; wherein/> Key conversion for third part,/>Is an approximation of plaintext, m A is plaintext,/>Is an error term.
Specifically, the present embodiment gives a specific manner of converting the intermediate plaintext into the sum of the plaintext and the error term using the third partial conversion key and the fifth preset formula; and a specific implementation manner of the fifth preset formula is given. The function of decrypting the converted ciphertext to obtain the intermediate plaintext can be realized through the fifth preset formula. The error term includes a sum of three parts, where each part may be smaller than a certain error threshold, or the error term may be limited to be smaller than a preset error threshold, which is not limited in this embodiment.
In the process of screening the second public key, as long as the second public key and the first public key meet the preset condition, the error term meets the condition of being smaller than the preset error threshold. If an error occurs in the intermediate decryption process, the error term may not be smaller than the preset error threshold, and the step of searching the second public key satisfying the preset condition according to the first public key may be re-entered.
For ease of understanding, referring first to fig. 3, the subscript a is an operation performed by the first user, and the subscript B is an operation performed by the second user. If the plaintext m A is the plaintext of the first user, the first user encrypts the plaintext m A to obtain a corresponding first ciphertext c A. The second user side carries out ciphertext conversion on the first ciphertext to obtain a converted ciphertext c B, then carries out ciphertext decryption on the converted ciphertext to obtain a plaintext m B, and then converts m B into a plaintext m A through plaintext recovery. After plaintext m A performs plaintext calculation, plaintext m A ' is obtained; the first ciphertext c A performs homomorphic calculation to obtain a second ciphertext c A ', the second ciphertext c A ' performs ciphertext decryption to obtain a plaintext m A ', and the second ciphertext c A ' performs ciphertext conversion to obtain a second converted ciphertext c B '; and (3) performing ciphertext decryption on the second converted ciphertext c B ' to obtain a plaintext m B ', and performing plaintext recovery on the plaintext m B ' to obtain a plaintext m A '.
As shown in fig. 4, the homomorphic calculation scheme in the present application specifically includes: key generation, data encoding, plaintext encryption, homomorphic computation, ciphertext conversion, ciphertext decryption, plaintext recovery and plaintext Wen Jiema; wherein the key generation stage comprises two steps of system initialization and key generation; the ciphertext conversion stage comprises two steps of conversion key calculation and ciphertext conversion calculation. The specific description is as follows:
1. Key generation
1.1, Initializing a system: firstly, the system is initialized according to homomorphic encryption algorithm requirements, and parameters para and calculation functions related in each stage are disclosed, wherein the parameters include, but are not limited to, a key generation function KeyGen, a data encoding function Encode, a plaintext encryption function Enc, a homomorphic calculation function Eval, a ciphertext decryption function Dec, a data decoding function Decode and the like.
1.2, Key generation: the system generates a first private key sk A, a first public key pk A and a first homomorphic calculation key ek A for a first user by using a key generation function KeyGen disclosed in the step 1.1 according to homomorphic encryption algorithm requirements;
Generating a second private key sk B, a second public key pk B, and a second homomorphism calculation key ek B for the second user: the method can be generated according to the homomorphic encryption algorithm requirement of the system in the step 1.2; it may also be constructed according to the plaintext recovery calculation requirement, for example, only the requirement is needed to be satisfied formally, but the parameter selection may be flexibly changed, and not necessarily generated according to the algorithm requirement, for example, some parameters may be zero.
2. And (3) data coding:
The first user encodes the Data into a plaintext m A meeting the encryption input requirement by utilizing the Data encoding function Encode disclosed in the step 1.1 according to the homomorphic encryption algorithm requirement.
3. Plaintext encryption:
the first user encrypts the plaintext m A by using the encryption algorithm Enc disclosed in the step 1.1 according to the homomorphic encryption algorithm requirement to output a ciphertext c A.
4. Homomorphism calculation: the first user calculates the ciphertext c A in the step 3 by utilizing the homomorphic calculation function Eval disclosed in the step 1.1 according to the homomorphic encryption algorithm requirement to output a ciphertext c A '. In particular, ciphertext c A ' is also referred to as c A in subsequent steps for ease of processing.
For specific steps of step 5 (ciphertext conversion (specifically including step 5.1, conversion key calculation, and step 5.2, ciphertext conversion calculation)), step 6 (ciphertext decryption) and step 7 (plaintext recovery), and step 8 (plaintext Wen Jiema), please refer to steps S21-S29 in fig. 5.
S21: pre-constructing a key set, wherein the key set comprises a plurality of different keys, and the keys comprise a public key and a private key;
S22: determining a preset public key from the key set in a preset mode;
s23: judging whether the preset public key and the first public key meet preset conditions or not;
s24: if yes, determining a preset public key meeting the preset condition as a second public key;
S25: generating a first partial conversion key and a third partial conversion key according to the second random element and the fourth random element; generating a second partial conversion key according to the first random element and the third random element; the first random element and the second random element are two random elements used in the process of generating the first public key by using a preset homomorphic encryption key generating function, and the third random element and the fourth random element are two random elements used in the process of generating the second public key by using the preset homomorphic encryption key generating function; the conversion key comprises a first partial conversion key, a second partial conversion key and a third partial conversion key;
S26: replacing the information with the first public key in the main body item of the first ciphertext with the information with the second public key by using the first partial conversion key to obtain the main body item of the conversion ciphertext; replacing the information with the first public key in the auxiliary item of the first ciphertext with the information with the second public key by using the second partial conversion key to obtain the auxiliary item of the conversion ciphertext;
S27: according to a preset homomorphic decryption function and a second private key, converting information of a second public key except the conversion key in the conversion ciphertext into information with the conversion key or the second private key, and obtaining an intermediate plaintext;
S28: converting the intermediate plaintext into a sum of plaintext and an error term by using a conversion key, wherein the error term is not greater than a preset error threshold;
S29: and decoding the plaintext to obtain decoded plaintext original data.
In a second aspect, as shown in fig. 6, the present application provides a decryption system comprising:
a search unit 61 for searching for a second public key satisfying a preset condition based on a first public key, the first public key being a public key generated using a preset homomorphic encryption key generation function;
A calculation unit 62 for calculating a conversion key from the first public key and the second public key;
the decryption unit 63 is configured to decrypt the first ciphertext according to the conversion key, a preset homomorphic decryption function, and a second private key corresponding to the second public key, to obtain a plaintext;
The first ciphertext is obtained by encrypting the plaintext according to the first public key, the first private key corresponding to the first public key and a preset homomorphic encryption function.
In one embodiment, the retrieving unit 61 is specifically configured to pre-construct a key set, where the key set includes a plurality of different keys, and the keys include a public key and a private key; determining a preset public key from the key set in a preset mode; judging whether the preset public key and the first public key meet preset conditions or not; if so, determining the preset public key meeting the preset condition as a second public key.
In one embodiment, each key in the set of keys is a key generated at a different time by a preset homomorphic encryption key generation function.
In one embodiment, when the first public key is a public key obtained using CKKS homomorphic encryption algorithm, the preset conditions are: Wherein pk A is the first public key, pk B is the second public key,/> To reverse the second public key,/>The first preset value is not greater than a preset threshold. /(I)
In one embodiment, when the first public key is a public key obtained by using CKKS homomorphic encryption algorithm, and the first public key and the second public key include n parts, n is an integer not less than 2, and the preset condition is that:
;
Where pk A1 is the first portion of the first public key, pk A2 is the second portion of the first public key, pk An is the nth portion of the first public key, pk B1 is the first portion of the second public key, pk B2 is the second portion of the second public key, pk Bn is the nth portion of the second public key, To reverse the first part of the second public key,/>To reverse the second portion of the second public key,/>To reverse the nth portion of the second public key,/>For the second preset value,/>For the third preset value,/>The fourth preset value is the second preset value, and the third preset value and the fourth preset value are not larger than the preset threshold value.
In one embodiment, the calculating unit 62 is specifically configured to calculate the conversion key according to the first public key, the second public key and the first preset formula; the expression of the first preset formula is: ; wherein/> To convert the key.
In one embodiment, the calculating unit 62 is specifically configured to calculate the conversion key according to the first public key, the second public key and the second preset formula; the expression of the second preset formula is: ; wherein/> To transform the first part of the key,/>To transform the second part of the key,/>To convert the nth portion of the key.
In one embodiment, the calculating unit 62 is specifically configured to calculate the conversion key according to two random elements used in the process of generating the first public key using the preset homomorphic encryption key generating function and two random elements used in the process of generating the second public key.
In one embodiment, decryption unit 63 includes:
the ciphertext conversion unit is used for converting the first ciphertext by using the conversion key to obtain a conversion ciphertext;
and the conversion ciphertext decrypting unit is used for decrypting the conversion ciphertext according to the conversion secret key, a preset homomorphic decrypting function and the second private key to obtain a plaintext.
In one embodiment, a transformed ciphertext decryption unit comprises:
the first decryption unit is used for decrypting the conversion ciphertext according to a preset homomorphic decryption function and a second private key to obtain an intermediate plaintext;
and the plaintext conversion unit is used for converting the intermediate plaintext by using the conversion key to obtain the plaintext.
In one embodiment, the ciphertext conversion unit is specifically configured to replace information with the first public key in the first ciphertext with information with the second public key by using the conversion key, to obtain the conversion ciphertext.
In one embodiment, the first decryption unit is specifically configured to convert information of the second public key in the converted ciphertext, except for the conversion key, into information of the conversion key or the second private key according to a preset homomorphic decryption function and the second private key, so as to obtain an intermediate plaintext.
In an embodiment, the plaintext conversion unit is specifically configured to convert the intermediate plaintext into a sum of plaintext and an error term using the conversion key, wherein the error term is not greater than a preset error threshold.
In one embodiment, the calculating unit 62 is specifically configured to generate the first partial conversion key and the third partial conversion key according to the second random element and the fourth random element; generating a second partial conversion key according to the first random element and the third random element; the first random element and the second random element are two random elements used in the process of generating the first public key by using a preset homomorphic encryption key generating function, and the third random element and the fourth random element are two random elements used in the process of generating the second public key by using the preset homomorphic encryption key generating function; the conversion keys include a first partial conversion key, a second partial conversion key, and a third partial conversion key.
In one embodiment, the ciphertext conversion unit is specifically configured to replace information with a first public key in a main item of the first ciphertext with information with a second public key by using a first partial conversion key, so as to obtain a main item of the converted ciphertext; replacing the information with the first public key in the auxiliary item with the information with the second public key by using the second partial conversion key to obtain an auxiliary item of the conversion ciphertext; the main body item of the first ciphertext is a part of the first ciphertext including the plaintext, and the auxiliary item of the first ciphertext is a part of the first ciphertext not including the plaintext.
In one embodiment, the ciphertext conversion unit is specifically configured to replace information with the first public key in the main item and information with the second public key in the auxiliary item of the first ciphertext with the first partial conversion key, the second partial conversion key, and a third preset formula, respectively, to obtain a main item and an auxiliary item of the converted ciphertext;
The expression of the third preset formula is:
;
Wherein c B is the transformed ciphertext, c B1 is the main item of the transformed ciphertext, c B2 is the auxiliary item of the transformed ciphertext, Is a first random element, b A is a second random element,/>As the third random element, b B as the fourth random element, v, e 0、e1 as the ciphertext random element generated during the generation of the first ciphertext,/>Key conversion for the first part,/>For the second part, the key is transformed and m A is plaintext.
In one embodiment, the first decryption unit is specifically configured to convert information of the second public key in the converted ciphertext, except the conversion key, into information of the conversion key or the second private key by using a fourth preset formula according to a preset homomorphic decryption function and the second private key, so as to obtain an intermediate plaintext;
The fourth preset formula has the expression: ;
Wherein, M B is an intermediate plaintext, s B is a second private key, e A is a first key random element generated during generation of the first public key, and e B is a second key random element generated during generation of the second public key.
In one embodiment, the plaintext conversion unit is specifically configured to convert the intermediate plaintext into a sum of plaintext and an error term using the third partial conversion key and a fifth preset formula;
The expression of the fifth preset formula is: ;
Wherein, Key conversion for third part,/>Is an approximation of plaintext, m A is plaintext,Is an error term.
For the description of the decryption system, refer to the above embodiments, and the description of the present application is omitted herein.
In a third aspect, as shown in fig. 7, the present application provides a decryption apparatus, comprising:
A memory 71 for storing a computer program;
a processor 72 for implementing the steps of the decryption method as described above when storing the computer program.
For the description of the decryption device, refer to the above embodiment, and the disclosure is not repeated here.
In a fourth aspect, as shown in fig. 8, the present application provides a computer readable storage medium 81, on which computer readable storage medium 81 a computer program 82 is stored, which computer program 82, when executed by a processor, implements the steps of the decryption method as described above. For the description of the computer-readable storage medium 81, refer to the above embodiments, and the disclosure is not repeated here.
It should also be noted that in this specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (16)
1. A decryption method, comprising:
Searching a second public key meeting preset conditions according to a first public key, wherein the first public key is a public key generated by using a preset homomorphic encryption key generation function;
Calculating a conversion key according to the first public key and the second public key;
Decrypting the first ciphertext according to the conversion key, a preset homomorphic decryption function and a second private key corresponding to the second public key to obtain a plaintext;
the first ciphertext is obtained by encrypting the plaintext according to the first public key, a first private key corresponding to the first public key and a preset homomorphic encryption function;
Retrieving a second public key satisfying a preset condition according to the first public key, including:
pre-constructing a key set, wherein the key set comprises a plurality of different keys, and the keys comprise a public key and a private key;
Determining a preset public key from the key set in a preset mode;
judging whether the preset public key and the first public key meet the preset condition or not;
If yes, determining a preset public key meeting the preset condition as the second public key;
each key in the key set is a key generated by the preset homomorphic encryption key generating function at different time;
Decrypting the first ciphertext according to the conversion key, a preset homomorphic decryption function and a second private key corresponding to the second public key to obtain a plaintext, wherein the decrypting comprises the following steps:
converting the first ciphertext by using the conversion key to obtain a converted ciphertext;
Decrypting the conversion ciphertext according to the preset homomorphic decryption function and the second private key to obtain an intermediate plaintext;
converting the intermediate plaintext by using the conversion key to obtain the plaintext;
Calculating a conversion key from the first public key and the second public key, comprising:
generating a first partial conversion key and a third partial conversion key according to the second random element and the fourth random element;
Generating a second partial conversion key according to the first random element and the third random element;
The first random element and the second random element are two random elements used in the process of generating the first public key by using the preset homomorphic encryption key generating function, and the third random element and the fourth random element are two random elements used in the process of generating the second public key by using the preset homomorphic encryption key generating function; the conversion key includes the first partial conversion key, the second partial conversion key, and the third partial conversion key.
2. The decryption method of claim 1, wherein when the first public key is a public key obtained using CKKS homomorphic encryption algorithm, the preset condition is: Wherein pk A is the first public key, pk B is the second public key,/> To reverse the second public key,/>And the first preset value is not larger than a preset threshold value.
3. The decryption method according to claim 1, wherein when the first public key is a public key obtained using CKKS homomorphic encryption algorithm, the first public key and the second public key each include n parts, n is an integer not less than 2, the preset condition is:
;
Wherein pk A1 is the first portion of the first public key, pk A2 is the second portion of the first public key, pk An is the nth portion of the first public key, pk B1 is the first portion of the second public key, pk B2 is the second portion of the second public key, pk Bn is the nth portion of the second public key, To reverse the first portion of the second public key,/>To reverse the second portion of the second public key,/>To reverse the nth portion of the second public key,/>For the second preset value,/>For the third preset value,/>And the second preset value, the third preset value and the fourth preset value are not larger than a preset threshold value.
4. The decryption method of claim 2, wherein calculating a conversion key from the first public key and the second public key comprises:
calculating the conversion key according to the first public key, the second public key and a first preset formula;
The expression of the first preset formula is: ;
Wherein, For the conversion key.
5. The decryption method of claim 3, wherein calculating a conversion key from the first public key and the second public key comprises:
calculating the conversion key according to the first public key, the second public key and a second preset formula;
the expression of the second preset formula is: ;
Wherein, For the first part of the conversion key,/>For the second part of the conversion key,/>Is the nth part of the conversion key.
6. The decryption method of claim 1, wherein calculating a conversion key from the first public key and the second public key comprises:
and calculating the conversion key according to two random elements used in the process of generating the first public key by using the preset homomorphic encryption key generating function and two random elements used in the process of generating the second public key.
7. The decryption method of claim 1, wherein converting the first ciphertext using the conversion key to obtain a converted ciphertext comprises:
And replacing the information with the first public key in the first secret key with the information with the second public key by using the conversion secret key to obtain the conversion secret key.
8. The decryption method according to claim 1, wherein decrypting the transformed ciphertext according to the predetermined homomorphic decryption function and the second private key to obtain an intermediate plaintext comprises:
And converting the information of the second public key in the converted ciphertext except the conversion key into the information of the conversion key or the second private key according to the preset homomorphic decryption function and the second private key, so as to obtain the intermediate plaintext.
9. The decryption method of claim 1, wherein converting the intermediate plaintext using the conversion key to obtain the plaintext comprises:
And converting the intermediate plaintext into a sum of the plaintext and an error term by using the conversion key, wherein the error term is not greater than a preset error threshold.
10. The decryption method of claim 1, wherein converting the first ciphertext using the conversion key to obtain a converted ciphertext comprises:
Replacing the information with the first public key in the main body item of the first ciphertext with the information with the second public key by using a first partial conversion key to obtain the main body item of the conversion ciphertext;
Replacing the information with the first public key in the auxiliary item of the first ciphertext with the information with the second public key by using a second partial conversion key to obtain the auxiliary item of the conversion ciphertext;
The main body item of the first ciphertext is a part of the first ciphertext including the plaintext, and the auxiliary item of the first ciphertext is a part of the first ciphertext not including the plaintext.
11. The decryption method of claim 10, wherein replacing information with the first public key in the main item of the first ciphertext with information with the second public key with a first partial conversion key, obtaining the main item of the converted ciphertext, replacing information with the first public key in the auxiliary item of the first ciphertext with information with the second public key with a second partial conversion key, obtaining the auxiliary item of the converted ciphertext, comprises:
respectively replacing the information with the first public key in the main body item and the auxiliary item of the first ciphertext with the information with the second public key by using a first partial conversion key, a second partial conversion key and a third preset formula to obtain the main body item and the auxiliary item of the conversion ciphertext;
The expression of the third preset formula is:
;
wherein c B is the transformed ciphertext, c B1 is the main item of the transformed ciphertext, c B2 is the auxiliary item of the transformed ciphertext, For the first random element, b A is the second random element,/>For the third random element, b B is the fourth random element, v, e 0、e1 are ciphertext random elements generated during the generation of the first ciphertext,/>Transforming a key for said first part,/>And (3) converting a key for the second part, wherein m A is the plaintext.
12. The decryption method of claim 11, wherein decrypting the transformed ciphertext according to the predetermined homomorphic decryption function and the second private key to obtain an intermediate plaintext comprises:
according to the preset homomorphic decryption function and the second private key, converting information of a second public key except the conversion key in the conversion ciphertext into information of the conversion key or the second private key by using a fourth preset formula, and obtaining the intermediate plaintext;
the expression of the fourth preset formula is:
;
Wherein, M B is the intermediate plaintext, s B is the second private key, e A is a first key random element generated during the generation of the first public key, e B is a second key random element generated during the generation of the second public key.
13. The decryption method of claim 12, wherein converting the intermediate plaintext using the conversion key to obtain the plaintext comprises:
Converting the intermediate plaintext into a sum of the plaintext and an error term using the third partial conversion key and a fifth predetermined formula;
the expression of the fifth preset formula is:
;
Wherein, Transforming the key for said third part,/>For an approximation of the plaintext, m A is the plaintext,Is the error term.
14. A decryption system, comprising:
The searching unit is used for searching a second public key meeting preset conditions according to a first public key, wherein the first public key is a public key generated by using a preset homomorphic encryption key generating function;
a calculation unit configured to calculate a conversion key from the first public key and the second public key;
The decryption unit is used for decrypting the first ciphertext according to the conversion key, a preset homomorphic decryption function and a second private key corresponding to the second public key to obtain a plaintext;
the first ciphertext is obtained by encrypting the plaintext according to the first public key, a first private key corresponding to the first public key and a preset homomorphic encryption function;
The retrieval unit is specifically configured to pre-construct a key set, where the key set includes a plurality of different keys, and the keys include a public key and a private key; determining a preset public key from the key set in a preset mode; judging whether the preset public key and the first public key meet the preset condition or not; if yes, determining a preset public key meeting the preset condition as the second public key; each key in the key set is a key generated by the preset homomorphic encryption key generating function at different time;
The decryption unit includes:
The ciphertext conversion unit is used for converting the first ciphertext by using the conversion key to obtain a conversion ciphertext;
The first decryption unit is used for decrypting the conversion ciphertext according to the preset homomorphic decryption function and the second private key to obtain an intermediate plaintext;
The plaintext conversion unit is used for converting the intermediate plaintext by using the conversion key to obtain the plaintext;
The computing unit is specifically configured to generate a first partial conversion key and a third partial conversion key according to the second random element and the fourth random element; generating a second partial conversion key according to the first random element and the third random element; the first random element and the second random element are two random elements used in the process of generating the first public key by using the preset homomorphic encryption key generating function, and the third random element and the fourth random element are two random elements used in the process of generating the second public key by using the preset homomorphic encryption key generating function; the conversion key includes the first partial conversion key, the second partial conversion key, and the third partial conversion key.
15. A decryption device, comprising:
A memory for storing a computer program;
Processor for implementing the steps of the decryption method according to any of claims 1-13 when storing a computer program.
16. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the decryption method according to any of claims 1-13.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410371501.4A CN117992989B (en) | 2024-03-29 | 2024-03-29 | Decryption method, system, device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410371501.4A CN117992989B (en) | 2024-03-29 | 2024-03-29 | Decryption method, system, device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117992989A CN117992989A (en) | 2024-05-07 |
CN117992989B true CN117992989B (en) | 2024-06-11 |
Family
ID=90892653
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410371501.4A Active CN117992989B (en) | 2024-03-29 | 2024-03-29 | Decryption method, system, device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117992989B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2016048775A1 (en) * | 2014-09-26 | 2016-03-31 | Thomson Licensing | Xor-homomorphic cryptosystems with fast key generation |
CN108476136A (en) * | 2016-01-18 | 2018-08-31 | 三菱电机株式会社 | Encryption device, ciphertext conversion equipment, encipheror, ciphertext conversion program, encryption method and ciphertext conversion method |
WO2018205549A1 (en) * | 2017-05-09 | 2018-11-15 | 深圳市全同态科技有限公司 | Fully homomorphic encryption-based ciphertext query method and system |
CN112152777A (en) * | 2020-08-18 | 2020-12-29 | 西安交通大学 | Homomorphic cryptographic operation-oriented key conversion method, system, equipment and readable storage medium |
CN112929153A (en) * | 2021-02-23 | 2021-06-08 | 上海麟羿信息科技有限公司 | Data multi-stage encryption system and method based on complete homomorphic encryption |
WO2023282359A1 (en) * | 2021-07-05 | 2023-01-12 | 주식회사 크립토랩 | Method for homomorphic encryption or decryption considering space complexity |
CN116170131A (en) * | 2023-04-20 | 2023-05-26 | 浪潮(北京)电子信息产业有限公司 | Ciphertext processing method, ciphertext processing device, storage medium and trusted execution device |
-
2024
- 2024-03-29 CN CN202410371501.4A patent/CN117992989B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2016048775A1 (en) * | 2014-09-26 | 2016-03-31 | Thomson Licensing | Xor-homomorphic cryptosystems with fast key generation |
CN108476136A (en) * | 2016-01-18 | 2018-08-31 | 三菱电机株式会社 | Encryption device, ciphertext conversion equipment, encipheror, ciphertext conversion program, encryption method and ciphertext conversion method |
WO2018205549A1 (en) * | 2017-05-09 | 2018-11-15 | 深圳市全同态科技有限公司 | Fully homomorphic encryption-based ciphertext query method and system |
CN112152777A (en) * | 2020-08-18 | 2020-12-29 | 西安交通大学 | Homomorphic cryptographic operation-oriented key conversion method, system, equipment and readable storage medium |
CN112929153A (en) * | 2021-02-23 | 2021-06-08 | 上海麟羿信息科技有限公司 | Data multi-stage encryption system and method based on complete homomorphic encryption |
WO2023282359A1 (en) * | 2021-07-05 | 2023-01-12 | 주식회사 크립토랩 | Method for homomorphic encryption or decryption considering space complexity |
CN116170131A (en) * | 2023-04-20 | 2023-05-26 | 浪潮(北京)电子信息产业有限公司 | Ciphertext processing method, ciphertext processing device, storage medium and trusted execution device |
Also Published As
Publication number | Publication date |
---|---|
CN117992989A (en) | 2024-05-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6934963B2 (en) | Data encryption methods and systems | |
JP6413598B2 (en) | Cryptographic processing method, cryptographic processing apparatus, and cryptographic processing program | |
CN106571905B (en) | A kind of numeric type data homomorphism Order Preserving Encryption Method | |
CN107291861B (en) | Encryption graph-oriented approximate shortest distance query method with constraints | |
JP6738062B2 (en) | Ciphertext verification system, method, and recording medium | |
EP2991264B1 (en) | Encrypted text matching system, method and program | |
US10484182B2 (en) | Encrypted text verification system, method, and recording medium | |
CN113098675B (en) | Binary data encryption system and method based on polynomial complete homomorphism | |
US9594918B1 (en) | Computer data protection using tunable key derivation function | |
EP2991265B1 (en) | Encrypted text matching system, method and program | |
CN111159724B (en) | Conditional proxy reconfigurable encryption method for fine-grained strategy | |
CN117992989B (en) | Decryption method, system, device and storage medium | |
US9900146B2 (en) | Encrypted text matching system, method, and computer readable medium | |
KR101978684B1 (en) | Code-based encryption apparatus and method capable of preventing replay attack | |
JP5103407B2 (en) | Encrypted numerical binary conversion system, encrypted numerical binary conversion method, encrypted numerical binary conversion program | |
JP5297918B2 (en) | Encrypted numeric binary conversion system, method and program | |
CN114244552B (en) | Data encryption transmission method and device based on block chain | |
CN114070553B (en) | Private data matching method, system and storage medium | |
CN113452706B (en) | Attribute encryption method and system supporting numerical attribute comparison access strategy | |
US20220417012A1 (en) | Method for performing cryptographic operations in a processing device, corresponding processing device and computer program product | |
CN112217628B (en) | Chaotic encryption method for communication signals | |
CN117499010A (en) | Data processing method and device | |
JP5818768B2 (en) | Mask generation apparatus, information processing apparatus, method thereof, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |