Ciphertext processing method and apparatus, storage medium and trusted execution device

Obtain the conversion key through key negotiation and perform homomorphic ciphertext conversion in a trusted execution environment, which solves the problem of inability to perform homomorphic calculations between different users, realizes homomorphic calculations between homomorphic ciphertexts, and reduces Reduces data management burden and improves user experience.

WO2024217038A1PCT designated stage expired Publication Date: 2024-10-24INSPUR (BEIJING) ELECTRONICS INFORMATION IND CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/141188
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-20
Filing Date
2023-12-22
Publication Date
2024-10-24

AI Technical Summary

Technical Problem

Existing homomorphic encryption technology cannot achieve homomorphic calculations between different users, because the homomorphic calculation process is based on the key of the same user, and cannot directly perform homomorphic calculations between homomorphic ciphertexts of different users.

Method used

The conversion key is obtained through key negotiation, and the private key parameters in one user's homomorphic ciphertext are converted into the private key parameters of another user, thereby realizing homomorphic calculations between homomorphic ciphertexts between different users. Specific steps include obtaining the conversion key, constructing the ciphertext conversion relationship, and performing conversion and certification in a trusted execution environment to ensure security.

Benefits of technology

It realizes homomorphic calculations between homomorphic ciphertexts between different users, reduces the calculation and management burden of data ownership users, and improves the user-friendliness and practicality of data sharing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023141188_24102024_PF_FP_ABST
    Figure CN2023141188_24102024_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of homomorphic encryption, and provides a ciphertext processing method and apparatus, a storage medium and trusted execution device. The method comprises: acquiring first homomorphic ciphertext obtained after a first user performs homomorphic encryption on first data, wherein the first homomorphic ciphertext comprises a first user private key parameter; acquiring a conversion key obtained by means of key negotiation between the first user and a second user, and converting the first homomorphic ciphertext by converting the first user private key parameter in the first homomorphic ciphertext into a second user private key parameter by means of the conversion key to obtain converted homomorphic ciphertext, wherein the converted homomorphic ciphertext comprises the second user private key parameter; and sending the converted homomorphic ciphertext to the second user, so that the second user performs homomorphic computation on the converted homomorphic ciphertext and second homomorphic ciphertext obtained after the second user performs homomorphic encryption on second data. The present application can implement homomorphic computation between homomorphic ciphertext of different users.
Need to check novelty before this filing date? Find Prior Art

Description

Ciphertext processing method, device, storage medium and trusted execution device

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on April 20, 2023, with application number 202310425295.6 and application name “Cryptographic Processing Method, Device, Storage Medium and Trusted Execution Device”, all contents of which are incorporated by reference into this application. Technical Field

[0003] The present application relates to the field of homomorphic encryption technology, and in particular to a ciphertext processing method, apparatus, storage medium, and trusted execution device. Background Art

[0004] Homomorphic encryption (HE) involves homomorphically encrypting the original data, performing a specific operation (homomorphic computation) on the resulting ciphertext, and then homomorphically decrypting the result. The resulting plaintext is equivalent to the data obtained by directly performing the same computation on the original plaintext data. As an advanced method with the highest security in privacy computing technology, homomorphic encryption can encrypt data after collection and protect and enhance the privacy and security of the data during subsequent homomorphic computations. However, the above homomorphic computation process is based on the same user, that is, the same user uses the same key for homomorphic encryption. Data encrypted by different users with different keys cannot be directly homomorphically computed.

[0005] Therefore, how to achieve homomorphic computation between homomorphic ciphertexts of different users is a technical problem that needs to be solved urgently by those skilled in the art.

[0006] Summary of the Invention

[0007] In view of this, the purpose of this application is to provide a ciphertext processing method, apparatus, storage medium, and trusted execution device that can implement homomorphic computation between homomorphic ciphertexts of different users. The specific solution is as follows:

[0008] The first aspect of the present application provides a ciphertext processing method, comprising:

[0009] Obtaining a first homomorphic ciphertext obtained by the first user homomorphically encrypting the first data; the first homomorphic ciphertext includes a private key parameter of the first user;

[0010] Obtaining a conversion key obtained by the first user and the second user through key negotiation, and converting the first homomorphic ciphertext by converting the first user's private key parameter in the first homomorphic ciphertext into the second user's private key parameter using the conversion key to obtain a converted homomorphic ciphertext; the converted homomorphic ciphertext includes the second user's private key parameter;

[0011] The converted homomorphic ciphertext is sent to the second user so that the second user can perform homomorphic calculation on the converted homomorphic ciphertext and the second homomorphic ciphertext obtained after the second user homomorphically encrypts the second data.

[0012] In some embodiments of the present application, the conversion key includes a first conversion key of a first user and a second conversion key of a second user; the first conversion key is a first logical operation result of a private key parameter of the first user and an intermediate conversion key, and the second conversion key is a second logical operation result of a private key parameter of the second user and an intermediate conversion key.

[0013] In some embodiments of the present application, the intermediate conversion key is a key determined through key negotiation when the second user sends an authorization request to the first user.

[0014] In some embodiments of the present application, obtaining a conversion key obtained by a first user and a second user through key negotiation includes:

[0015] If the first user and the second user are able to determine the intermediate conversion key through key agreement, obtaining a first conversion key obtained by performing a logical operation on the first user's private key parameter and the intermediate conversion key, and a second conversion key obtained by performing a logical operation on the second user's private key parameter and the intermediate conversion key;

[0016] If the first user and the second user cannot determine the intermediate conversion key through key negotiation, the first user private key parameters are directly obtained as the first conversion key, and the second user private key parameters are directly obtained as the second conversion key.

[0017] In some embodiments of the present application, the intermediate conversion key is the result of a third logical operation of the first private key package and the second private key package; the first private key package is obtained by the first user performing a logical operation on the first user's private key parameter and the random factor, and the second private key package is obtained by the second user performing a logical operation on the second user's private key parameter and the random factor;

[0018] Correspondingly, the first conversion key is a key expression including only the second user private key parameter and the random factor, obtained by performing a logical operation on the first user private key parameter and the third logical operation result;

[0019] The second conversion key is a key expression including only the first user private key parameter and a random factor, obtained by performing a logical operation on the second user private key parameter and the third logical operation result.

[0020] In some embodiments of the present application, the generation formula of the intermediate conversion key is: 12 =F(s1, s2, r1, r2)

[0021] Where F is the key generation function, the logical operation corresponding to F is addition or subtraction, s1 is the first user private key parameter, s2 is the second user private key parameter, and r1 and r2 are random factors.

[0022] In some embodiments of the present application, converting the first homomorphic ciphertext by converting the first user private key parameter in the first homomorphic ciphertext into the second user private key parameter using a conversion key includes:

[0023] Constructing a ciphertext conversion relational expression having an erasable relation with a private key parameter using the first homomorphic ciphertext, the first conversion key, and the second conversion key;

[0024] The first user private key parameter in the first homomorphic ciphertext is converted into a second user private key parameter based on the ciphertext conversion relationship.

[0025] In some embodiments of the present application, after obtaining the conversion key obtained by the first user and the second user through key negotiation, the method further includes:

[0026] Obtain authentication information;

[0027] Determine whether the second user is a user authorized by the first user based on the authentication information. If so, execute the step of converting the first homomorphic ciphertext by converting the first user private key parameter in the first homomorphic ciphertext into the second user private key parameter using the conversion key.

[0028] In some embodiments of the present application, the authentication information is a digital signature obtained by signing the first homomorphic ciphertext using the intermediate conversion key;

[0029] Determining whether the second user is a user authorized by the first user according to the authentication information includes:

[0030] The digital signature is verified using the intermediate conversion key. If the verification passes, it is determined that the second user is a user authorized by the first user.

[0031] In some embodiments of the present application, the conversion key and authentication information are stored in a trusted execution environment in a trusted execution device;

[0032] Obtain conversion keys and authentication information, including:

[0033] Obtain the conversion key and authentication information from the trusted execution environment.

[0034] In some embodiments of the present application, the ciphertext processing method further includes:

[0035] A security authentication information table is constructed in a trusted execution environment, and the conversion key and authentication information are stored in the security authentication information table; the first homomorphic ciphertext and authentication method are also stored in the security authentication information table.

[0036] In some embodiments of the present application, the ciphertext processing method further includes:

[0037] Initialize the trusted execution device according to the basic specifications of the trusted environment to build a trusted execution environment.

[0038] In some embodiments of the present application, the trusted execution environment is divided into a public computing area and a trusted computing area.

[0039] In some embodiments of the present application, the conversion key and authentication information are stored in a trusted computing area.

[0040] In some embodiments of the present application, determining whether the second user is a user authorized by the first user based on the authentication information includes:

[0041] The step of determining whether the second user is a user authorized by the first user according to the authentication information is performed in the trusted computing area.

[0042] In some embodiments of the present application, obtaining a first homomorphic ciphertext obtained by a first user homomorphically encrypting first data includes:

[0043] Obtaining, from the first user, a first homomorphic ciphertext obtained by the first user homomorphically encrypting the first data using a homomorphic encryption algorithm;

[0044] Correspondingly, the second homomorphic ciphertext is obtained by the second user after homomorphically encrypting the second data using a homomorphic encryption algorithm.

[0045] In some embodiments of the present application, the first homomorphic ciphertext is obtained by the first user after homomorphically encrypting the first encoded data of the first data using a homomorphic encryption algorithm; the first encoded data is the encoded data that conforms to the homomorphic encryption input data format obtained after the first user performs an encoding operation on the first data.

[0046] In some embodiments of the present application, after the second user performs homomorphic calculation on the converted homomorphic ciphertext and the second homomorphic ciphertext obtained after the second user homomorphically encrypts the second data, the method further includes:

[0047] The second user performs homomorphic decryption on the ciphertext obtained after the homomorphic calculation to obtain the decrypted plaintext.

[0048] In some embodiments of the present application, after the second user performs homomorphic decryption on the ciphertext obtained after the homomorphic computation to obtain the decrypted plaintext, the following steps are further included:

[0049] The second user performs a decoding operation on the decrypted plaintext to obtain corresponding decoded data; the decoded data is consistent with the result obtained by directly performing the same calculation as the homomorphic calculation on the first data and the second data.

[0050] A second aspect of the present application provides a trusted execution device, which includes a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the aforementioned ciphertext processing method.

[0051] In some embodiments of the present application, a processor is constructed with a trusted execution environment including a public computing area and a trusted computing area.

[0052] A third aspect of the present application provides a ciphertext processing device, comprising:

[0053] A ciphertext acquisition module, configured to obtain a first homomorphic ciphertext obtained by a first user performing homomorphic encryption on the first data; the first homomorphic ciphertext includes a private key parameter of the first user;

[0054] a key acquisition and ciphertext conversion module, configured to obtain a conversion key obtained by the first user and the second user through key negotiation, and convert the first homomorphic ciphertext by converting the first user's private key parameter in the first homomorphic ciphertext into the second user's private key parameter using the conversion key, thereby obtaining a converted homomorphic ciphertext; the converted homomorphic ciphertext includes the second user's private key parameter;

[0055] The ciphertext sending module is used to send the converted homomorphic ciphertext to the second user, so that the second user can perform homomorphic calculation on the converted homomorphic ciphertext and the second homomorphic ciphertext obtained after the second user homomorphically encrypts the second data.

[0056] The fourth aspect of the present application provides a non-volatile computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the aforementioned ciphertext processing method is implemented.

[0057] In this application, the first homomorphic ciphertext obtained after the first user homomorphically encrypts the first data is first obtained; the first homomorphic ciphertext contains the first user's private key parameter; then the conversion key obtained by the first user and the second user through key negotiation is obtained, and the first homomorphic ciphertext is converted by using the conversion key to convert the first user's private key parameter in the first homomorphic ciphertext into the second user's private key parameter to obtain the converted homomorphic ciphertext; the converted homomorphic ciphertext contains the second user's private key parameter; finally, the converted homomorphic ciphertext is sent to the second user, so that the second user can perform homomorphic calculations on the converted homomorphic ciphertext and the second homomorphic ciphertext obtained after the second user homomorphically encrypts the second data. It can be seen that this application converts the homomorphic ciphertext of one user into a homomorphic ciphertext that can be homomorphically calculated by another user through ciphertext conversion, thereby eliminating the need for the data ownership user to perform complex calculations and management, and realizing homomorphic calculations between homomorphic ciphertexts of different users. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.

[0059] FIG1 is a flow chart of a ciphertext processing method provided by this application;

[0060] FIG2 is a schematic diagram of a specific ciphertext processing method provided by this application;

[0061] FIG3 is a schematic diagram of the structure of a ciphertext processing device provided by the present application;

[0062] FIG4 is a structural diagram of a trusted execution device provided by this application. DETAILED DESCRIPTION

[0063] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0064] The homomorphic computing process in existing homomorphic encryption technology is implemented based on the same user, that is, the same user uses the same key for homomorphic encryption. Data encrypted by different users using different keys cannot be directly homomorphically computed. To address the above technical shortcomings, this application provides a ciphertext processing solution that converts one user's homomorphic ciphertext into homomorphic ciphertext that another user can perform homomorphic computing on, thereby eliminating the need for the data owner to perform complex calculations and management, and achieving homomorphic computing between homomorphic ciphertexts of different users.

[0065] FIG1 is a flow chart of a ciphertext processing method provided in an embodiment of the present application. Referring to FIG1 , the ciphertext processing method includes:

[0066] S11: Obtain a first homomorphic ciphertext obtained after the first user homomorphically encrypts the first data; the first homomorphic ciphertext includes a private key parameter of the first user.

[0067] In this embodiment, the first homomorphic ciphertext obtained by the first user after homomorphically encrypting the first data is first obtained. The first homomorphic ciphertext includes the first user's private key parameter. Furthermore, the first homomorphic ciphertext is the ciphertext obtained by the first user after homomorphically encrypting the first data using a homomorphic encryption algorithm. It should be noted that in order to improve the credibility of homomorphic computing, the above-mentioned step S11 and the ciphertext processing steps in the following embodiments can be executed in a trusted execution environment. The trusted execution environment can be provided by a trusted execution device. The trusted execution device here is a computing device independent of the first user and the second user, and mainly provides a trusted execution environment for trusted computing.

[0068] It can be understood that the key pair of homomorphic encryption includes a private key (denoted as sk) and a public key (denoted as pk). The key pair needs to be generated in advance. Specifically, the user public parameter p, private key sk, public key pk and other system public parameters para required in subsequent stages can be generated for the system according to the homomorphic encryption algorithm. Randomly select arrays S, a, e, set the private key of system user U to sk, and public public key pk. Here, the first user is represented as U1, U1's private key sk1 is (1, s1), and U1's private key pk1 is (b, a), where b = -as1 + e, and s1 here is the first user's private key parameter. Similarly, the second user can be represented as U2, and the other parameters are represented in the same way. The first homomorphic ciphertext output after the first user U1 performs an encryption operation on the first data (plaintext m1) according to the homomorphic encryption algorithm is: C1 = v·pk1+(m1+e0, e1) = (-vas1+ve+m1+e0, va+e1)

[0069] Among them, v, e0, and e1 are random factors.

[0070] S12: Obtain a conversion key obtained by the first user and the second user through key negotiation, and convert the first homomorphic ciphertext by converting the first user's private key parameter in the first homomorphic ciphertext into the second user's private key parameter using the conversion key to obtain a converted homomorphic ciphertext; the converted homomorphic ciphertext includes the second user's private key parameter.

[0071] In this embodiment, a conversion key obtained by the first user and the second user through key negotiation is further obtained, and the first homomorphic ciphertext is converted by using the conversion key to convert the first user private key parameter in the first homomorphic ciphertext into the second user private key parameter to obtain the converted homomorphic ciphertext. In a trusted execution environment, the conversion key is obtained and the ciphertext conversion is performed by the trusted execution device. Similarly, the converted homomorphic ciphertext contains the second user private key parameter. Specifically, the second homomorphic ciphertext is obtained by the second user after homomorphically encrypting the second data using the homomorphic encryption algorithm. In this embodiment, the result of the ciphertext conversion is that the converted homomorphic ciphertext does not contain the first user private key parameter, but only contains the second user private key parameter, that is, the first user private key parameter in the first homomorphic ciphertext is converted into the second user private key parameter. In this way, the converted homomorphic ciphertext is equivalent to the data obtained by the second user after homomorphically encrypting the first data, so that homomorphic calculation can be performed.

[0072] In this embodiment, the conversion key includes a first conversion key of the first user and a second conversion key of the second user; the first conversion key is the result of a logical operation between the first user's private key parameter and the intermediate conversion key, and the second conversion key is the result of a logical operation between the second user's private key parameter and the intermediate conversion key. The logical operation can be addition, subtraction, multiplication, division, etc., which is not limited in this embodiment. The intermediate conversion key is represented by tk ij (i, j represent users), for example, the first conversion key can be finally expressed as s1-tk 12 The second conversion key can finally be expressed as s2-tk 12 . Furthermore, the intermediate conversion key is a key determined by key negotiation when the second user sends an authorization request to the first user, that is, the intermediate conversion key is generated during the data authorization use stage. Of course, the intermediate conversion key can also be issued by a third-party organization like the private key. In this way, the intermediate conversion key is a key generated by the third-party organization when the second user sends an authorization request to the first user. The above-mentioned third-party organization can be a trusted organization such as a bank.

[0073] It's important to note that to avoid security risks caused by private key leakage, the first user U1 and the second user U2 do not share their respective private keys during key negotiation to determine the intermediate conversion key. Instead, they further generate a private key package and share the private key package to determine the intermediate conversion key. This avoids directly sharing the private keys. In other words, the intermediate conversion key is the result of a third logical operation between the first and second private key packages. The first private key package is obtained by the first user performing a logical operation on the first user's private key parameters and a random factor, while the second private key package is obtained by the second user performing a logical operation on the second user's private key parameters and a random factor. Based on this, the first conversion key is a key expression consisting solely of the second user's private key parameters and the random factor, obtained by performing a logical operation on the first user's private key parameters and the result of the third logical operation. The second conversion key is a key expression consisting solely of the first user's private key parameters and the random factor, obtained by performing a logical operation on the second user's private key parameters and the result of the third logical operation. In other words, the purpose of performing a logical operation on the first user's private key parameter and the result of the third logical operation is to eliminate the first user's private key parameter, so that the first transformed key contains only the key expression of the second user's private key parameter and the random factor. Similarly, the purpose of performing a logical operation on the second user's private key parameter and the result of the third logical operation is to eliminate the second user's private key parameter, so that the second transformed key contains only the key expression of the first user's private key parameter and the random factor. This is the basis for implementing subsequent ciphertext conversion.

[0074] For example, when the first user U1 authorizes the second user U2 to obtain the decryption, calculation and other usage rights of the ciphertext C1, both parties generate a shared intermediate conversion key tk through a secure form such as key negotiation. 12 , the generation formula of the intermediate conversion key is as follows: tk 12 =F(s1, s2, r1, r2)

[0075] Among them, F is the key generation function, the logical operation corresponding to F is addition or subtraction, and r1 and r2 are random factors.

[0076] When the third logical operation corresponding to F is addition: tk 12 =F(s1,s2,r1,r2)=(s1+r1)+(s2+r2)

[0077] Among them, s1+r1 is the first private key package, s2+r2 is the second private key package, and F here makes the third logical operation result the result of adding s1+r1 and s2+r2.

[0078] In this example, in order to make the first conversion key contain only the second user private key parameter, the key expression of the first conversion key can only be s1-tk 12Similarly, in order to make the second conversion key contain only the first user private key parameter, the key expression of the second conversion key can only be s2-tk 12 This embodiment does not limit the logical operations, as long as the corresponding first conversion key and second conversion key can be obtained. For example, when tk 12 =F'(s1, s2, r1, r2) = (s2 + r2) - (s1 + r1), the key expression of the first conversion key is s1 + tk 12 , the key expression of the second conversion key is s2+tk 12 .

[0079] In this embodiment, if the first user and the second user are able to determine an intermediate conversion key through key negotiation, a first conversion key obtained by performing a logical operation on the first user's private key parameters and the intermediate conversion key, and a second conversion key obtained by performing a logical operation on the second user's private key parameters and the intermediate conversion key, are obtained. If the first user and the second user are unable to determine the intermediate conversion key through key negotiation, the first user's private key parameters are directly obtained as the first conversion key, and the second user's private key parameters are directly obtained as the second conversion key. In a third-party institution architecture, if the first user and the second user are able to determine the intermediate conversion key through key negotiation, the first conversion key and the second conversion key are obtained from the third-party institution; the first conversion key is obtained by the third-party institution performing a logical operation on the first user's private key parameters and the intermediate conversion key, and the second conversion key is obtained by the third-party institution performing a logical operation on the second user's private key parameters and the intermediate conversion key, i.e., the above-described method. If the first user and the second user are unable to determine the intermediate conversion key through key negotiation, the first conversion key and the second conversion key are obtained from the third-party institution; the third-party institution directly uses the first user's private key parameters as the first conversion key and the second user's private key parameters as the second conversion key. That is, when the parties cannot achieve secure key negotiation, the other tk ij When it is 0, the participants share their private keys securely with the trusted execution device.

[0080] On this basis, before performing the ciphertext conversion, it is necessary to first use the first homomorphic ciphertext, the first conversion key and the second conversion key to construct a ciphertext conversion relationship with a private key parameter that can eliminate the relationship, and then convert the first user private key parameter in the first homomorphic ciphertext into the second user private key parameter based on the ciphertext conversion relationship. The ciphertext conversion relationship in this embodiment can be constructed as follows: -vas1+ve+m1+e0+(va+e)(s1-tk 12 )-(va+e)(s2-tk 12 )

[0081] The simplified calculation of the above ciphertext conversion equation is: -vas2+ve+m1+e0+es1+es2

[0082] Considering es=e0+es1+es2 as a noise interference term (negligible), the final transformation is as follows: -vas2+ve+m1+es

[0083] Finally, replace -vas1+ve+m+e0 in C1 with -vas2+ve+m+es to obtain the converted homomorphic ciphertext.

[0084] It should be noted here that for the authorized user group U J (J={j,j+1,...,j+n-1}, n is the number of users in the authorized user group), when using permissions such as decryption and calculation, the conversion key generation function is expanded to: tk 12 =F(s i , s j , s j+1 ,...,s j+n-1 , r j , r j+1 ,...,r j+n-1 )

[0085] For authorized user groups, this embodiment can further design a conversion method between homomorphic ciphertexts encrypted with different keys based on a trusted execution environment, generate a shared conversion key in the data authorization use stage, and securely store the key on a trusted execution device. The conversion key can batch-convert all homomorphic ciphertexts of the same version / security level into homomorphic ciphertexts that can be decrypted / calculated by the authorized user group in the trusted execution environment of the trusted execution device. This greatly reduces the computing and management burden of the data ownership user, while improving the user-friendliness and practicality of data sharing analysis and use.

[0086] S13: Send the converted homomorphic ciphertext to the second user, so that the second user performs homomorphic calculation on the converted homomorphic ciphertext and the second homomorphic ciphertext obtained after the second user homomorphically encrypts the second data.

[0087] In this embodiment, after the ciphertext conversion is performed, the converted homomorphic ciphertext can be sent to the second user so that the second user can perform homomorphic calculation on the converted homomorphic ciphertext and the second homomorphic ciphertext obtained after the second user homomorphically encrypts the second data.

[0088] It can be seen that in the embodiment of the present application, the first homomorphic ciphertext obtained after the first user homomorphically encrypts the first data is first obtained; the first homomorphic ciphertext includes the first user's private key parameter; then the conversion key obtained by the first user and the second user through key negotiation is obtained, and the first homomorphic ciphertext is converted by using the conversion key to convert the first user's private key parameter in the first homomorphic ciphertext into the second user's private key parameter to obtain the converted homomorphic ciphertext; the converted homomorphic ciphertext includes the second user's private key parameter; finally, the converted homomorphic ciphertext is sent to the second user, so that the second user can perform homomorphic calculations on the converted homomorphic ciphertext and the second homomorphic ciphertext obtained after the second user homomorphically encrypts the second data. The embodiment of the present application converts the homomorphic ciphertext of one user into a homomorphic ciphertext that can be homomorphically calculated by another user, thereby eliminating the need for the data ownership user to perform complex calculations and management, and realizing homomorphic calculations between homomorphic ciphertexts of different users.

[0089] FIG2 is a flowchart of a specific ciphertext processing method provided in an embodiment of the present application. Referring to FIG2 , the ciphertext processing method includes:

[0090] S21: Obtain from the first user a first homomorphic ciphertext obtained by the first user homomorphically encrypting the first data using a homomorphic encryption algorithm; the first homomorphic ciphertext includes a private key parameter of the first user.

[0091] In this embodiment, for the specific process of the above-mentioned step S21, please refer to the corresponding content provided in the aforementioned embodiment, and no further details will be given here. It should be added here that before the first user performs homomorphic encryption, it is also necessary to perform an encoding operation on the first data so that the obtained first encoded data conforms to the homomorphic encryption input data format. That is, the first homomorphic ciphertext is obtained by the first user using the homomorphic encryption algorithm to homomorphically encrypt the first encoded data of the first data; the first encoded data is the encoded data that conforms to the homomorphic encryption input data format obtained after the first user performs an encoding operation on the first data. That is, the data of the system user U is encoded into plaintext that meets the encryption input requirements according to the homomorphic encryption algorithm.

[0092] S22: Acquire, from the trusted execution environment in the trusted execution device, the conversion key and authentication information obtained by the first user and the second user through key negotiation.

[0093] In this embodiment, the conversion key and authentication information obtained by the first user and the second user through key negotiation need to be obtained from the trusted execution environment in the trusted execution device. The trusted execution environment is a secure area built in the processor of the trusted execution device through software and hardware methods to ensure that the programs and data loaded therein are protected in terms of confidentiality and integrity. Specifically, the trusted execution device can be initialized according to the basic specifications of the trusted environment to establish the trusted execution environment, and the conversion key and authentication information are stored in the trusted execution environment of the trusted execution device. Furthermore, the trusted execution environment is divided into a public computing area and a trusted computing area, and the conversion key and authentication information are stored in the trusted computing area.

[0094] That is, the trusted execution device is initialized according to the basic specifications of the trusted environment, the public computing area and the trusted computing area are set, and the conversion key is securely stored in the trusted computing area storage device. At the same time, the conversion key, ciphertext, authentication information (signature / version / security level, etc.) are initialized. In this embodiment, a security authentication information table can also be constructed in the trusted execution environment, and the security authentication information table is used to store the conversion key and authentication information. In addition, the security authentication information table also stores the first homomorphic ciphertext and authentication method. The following table is an example of a security authentication information table:

[0095] S23: Determine whether the second user is a user authorized by the first user based on the authentication information. If yes, convert the first homomorphic ciphertext by using the conversion key to convert the first user private key parameter in the first homomorphic ciphertext into the second user private key parameter to obtain the converted homomorphic ciphertext.

[0096] In this embodiment, after obtaining the conversion key and authentication information, the authentication information is used to determine whether the second user is a user authorized by the first user. If so, the first homomorphic ciphertext is converted by using the conversion key to convert the first user's private key parameters in the first homomorphic ciphertext into the second user's private key parameters, thereby obtaining the converted homomorphic ciphertext. The step of determining whether the second user is a user authorized by the first user based on the authentication information is performed in the trusted computing area. In other words, the authenticity of the message is authenticated by the trusted execution environment through a message authentication function. If the authentication passes, the trusted execution environment reads the conversion key and then converts the first user's ciphertext into the second user's ciphertext.

[0097] In this embodiment, the authentication information can be a digital signature obtained by signing the first homomorphic ciphertext using the intermediate conversion key. In this case, the authentication method is signature (as shown in the table above). During verification, the digital signature is verified using the intermediate conversion key. If the verification passes, it is determined that the second user is a user authorized by the first user. After the trusted execution device receives the ciphertext conversion request from the authorized user, it first queries the security authentication information table in the trusted execution environment. If the authentication information (signature) is verified, the ciphertext conversion is executed, otherwise it exits.

[0098] S24: Send the converted homomorphic ciphertext to the second user, so that the second user performs homomorphic calculation on the converted homomorphic ciphertext and the second homomorphic ciphertext obtained after the second user homomorphically encrypts the second data, and performs homomorphic decryption on the ciphertext obtained after the homomorphic calculation to obtain the decrypted plaintext.

[0099] In this embodiment, the specific process of step S24 can be referred to the corresponding content provided in the previous embodiment, and will not be repeated here. It should be added that after obtaining the decrypted plaintext, it is also necessary to perform a decoding operation on the decrypted plaintext to obtain the corresponding decoded data; the decoded data is consistent with the result obtained by directly performing the same calculation as the homomorphic calculation on the first data and the second data.

[0100] As shown in FIG3 , the embodiment of the present application further provides a ciphertext processing device, including:

[0101] The ciphertext acquisition module 11 is configured to obtain a first homomorphic ciphertext obtained by homomorphically encrypting the first data by the first user; the first homomorphic ciphertext includes a private key parameter of the first user;

[0102] The key acquisition and ciphertext conversion module 12 is configured to obtain a conversion key obtained by the first user and the second user through key negotiation, and convert the first homomorphic ciphertext by converting the first user's private key parameter in the first homomorphic ciphertext into the second user's private key parameter using the conversion key to obtain a converted homomorphic ciphertext; the converted homomorphic ciphertext includes the second user's private key parameter;

[0103] The ciphertext sending module 13 is used to send the converted homomorphic ciphertext to the second user, so that the second user can perform homomorphic calculation on the converted homomorphic ciphertext and the second homomorphic ciphertext obtained after the second user homomorphically encrypts the second data.

[0104] It can be seen that in the embodiment of the present application, the first homomorphic ciphertext obtained after the first user homomorphically encrypts the first data is first obtained; the first homomorphic ciphertext contains the first user's private key parameter; then the conversion key obtained by the first user and the second user through key negotiation is obtained, and the first homomorphic ciphertext is converted by using the conversion key to convert the first user's private key parameter in the first homomorphic ciphertext into the second user's private key parameter to obtain the converted homomorphic ciphertext; the converted homomorphic ciphertext contains the second user's private key parameter; finally, the converted homomorphic ciphertext is sent to the second user, so that the second user can perform homomorphic calculations on the converted homomorphic ciphertext and the second homomorphic ciphertext obtained after the second user homomorphically encrypts the second data. The embodiment of the present application converts the homomorphic ciphertext of one user into a homomorphic ciphertext that can be homomorphically calculated by another user through ciphertext conversion, thereby eliminating the need for the data ownership user to perform complex calculations and management, and realizing homomorphic calculations between homomorphic ciphertexts of different users.

[0105] In some specific embodiments, the ciphertext processing apparatus further includes:

[0106] Authentication information acquisition module, used to obtain authentication information;

[0107] An authentication module is used to determine whether the second user is a user authorized by the first user based on the authentication information, and if so, execute the step of converting the first homomorphic ciphertext by converting the first user's private key parameter in the first homomorphic ciphertext into the second user's private key parameter using a conversion key.

[0108] In some specific embodiments, the conversion key in the ciphertext processing device includes a first conversion key of a first user and a second conversion key of a second user; the first conversion key is a first logical operation result of the first user's private key parameter and the intermediate conversion key, and the second conversion key is a second logical operation result of the second user's private key parameter and the intermediate conversion key.

[0109] In some specific embodiments, the intermediate conversion key in the ciphertext processing device is a key determined through key negotiation when the second user sends an authorization request to the first user.

[0110] In some specific embodiments, the ciphertext acquisition module 11 specifically includes:

[0111] a first obtaining unit configured to obtain, if the first user and the second user are able to determine the intermediate conversion key through key agreement, a first conversion key obtained by performing a logical operation on the first user private key parameter and the intermediate conversion key, and a second conversion key obtained by performing a logical operation on the second user private key parameter and the intermediate conversion key;

[0112] The second obtaining unit is configured to directly obtain the first user's private key parameters as the first conversion key and directly obtain the second user's private key parameters as the second conversion key if the first user and the second user cannot determine the intermediate conversion key through key negotiation.

[0113] In some specific embodiments, the intermediate conversion key in the ciphertext processing device is a result of a third logical operation of a first private key package and a second private key package; the first private key package is obtained by the first user performing a logical operation on a first user private key parameter and a random factor, and the second private key package is obtained by the second user performing a logical operation on a second user private key parameter and a random factor;

[0114] Correspondingly, the first conversion key is a key expression including only the second user private key parameter and the random factor, obtained by performing a logical operation on the first user private key parameter and the third logical operation result;

[0115] The second conversion key is a key expression including only the first user private key parameter and a random factor, obtained by performing a logical operation on the second user private key parameter and the third logical operation result.

[0116] In some specific embodiments, the generation formula of the intermediate conversion key in the ciphertext processing device is: 12 =F(s1, s2, r1, r2)

[0117] Where F is the key generation function, the logical operation corresponding to F is addition or subtraction, s1 is the first user private key parameter, s2 is the second user private key parameter, and r1 and r2 are random factors.

[0118] In some specific embodiments, the key acquisition and ciphertext conversion module 12 further includes:

[0119] A relational expression construction submodule, configured to construct a ciphertext conversion relational expression having an eliminateable relation with a private key parameter using the first homomorphic ciphertext, the first conversion key, and the second conversion key;

[0120] The conversion submodule is used to convert the first user private key parameter in the first homomorphic ciphertext into the second user private key parameter based on the ciphertext conversion relationship.

[0121] In some specific embodiments, the authentication information is a digital signature obtained by signing the first homomorphic ciphertext using the intermediate conversion key;

[0122] The authentication module is specifically used to verify the digital signature using the intermediate conversion key. If the verification is successful, it is determined that the second user is a user authorized by the first user.

[0123] In some specific embodiments, the conversion key and authentication information in the cryptographic processing apparatus are stored in a trusted execution environment in a trusted execution device.

[0124] In some specific embodiments, the ciphertext processing apparatus further includes:

[0125] A table construction module is used to construct a security authentication information table in a trusted execution environment and use the security authentication information table to store the conversion key and authentication information; the security authentication information table also stores the first homomorphic ciphertext and the authentication method;

[0126] The initialization module is used to initialize the trusted execution device according to the basic specifications of the trusted environment to build a trusted execution environment.

[0127] In some specific embodiments, the trusted execution environment in the ciphertext processing device is divided into a public computing area and a trusted computing area, and the conversion key and authentication information are stored in the trusted computing area.

[0128] In some specific embodiments, the authentication module is specifically configured to execute, in the trusted computing area, a step of determining, based on the authentication information, whether the second user is a user authorized by the first user.

[0129] In some specific embodiments, the ciphertext acquisition module 11 is further configured to:

[0130] Obtaining, from the first user, a first homomorphic ciphertext obtained by the first user homomorphically encrypting the first data using a homomorphic encryption algorithm;

[0131] Correspondingly, the second homomorphic ciphertext is obtained by the second user after homomorphically encrypting the second data using the homomorphic encryption algorithm;

[0132] The first homomorphic ciphertext is obtained by the first user after homomorphically encrypting the first encoded data of the first data using a homomorphic encryption algorithm; the first encoded data is the encoded data that conforms to the homomorphic encryption input data format obtained after the first user performs an encoding operation on the first data.

[0133] In some specific embodiments, the ciphertext processing apparatus further includes:

[0134] A decryption module, configured for the second user to perform homomorphic decryption on the ciphertext obtained after the homomorphic computation to obtain the decrypted plaintext;

[0135] The decoding module is used for the second user to perform a decoding operation on the decrypted plaintext to obtain corresponding decoded data, and the decoded data is consistent with the result obtained by directly performing the same calculation as the homomorphic calculation on the first data and the second data.

[0136] Furthermore, an embodiment of the present application also provides a trusted execution device. FIG4 is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the diagram should not be considered as any limitation to the scope of application of the present application.

[0137] FIG4 is a schematic diagram of the structure of a trusted execution device 20 provided in an embodiment of the present application. The trusted execution device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement at least the following steps:

[0138] Obtaining a first homomorphic ciphertext obtained by the first user homomorphically encrypting the first data; the first homomorphic ciphertext includes a private key parameter of the first user;

[0139] Obtaining a conversion key obtained by the first user and the second user through key negotiation, and converting the first homomorphic ciphertext by converting the first user's private key parameter in the first homomorphic ciphertext into the second user's private key parameter using the conversion key to obtain a converted homomorphic ciphertext; the converted homomorphic ciphertext includes the second user's private key parameter;

[0140] The converted homomorphic ciphertext is sent to the second user so that the second user can perform homomorphic calculation on the converted homomorphic ciphertext and the second homomorphic ciphertext obtained after the second user homomorphically encrypts the second data.

[0141] It can be seen that the trusted execution device in the embodiment of the present application first obtains the first homomorphic ciphertext obtained after the first user homomorphically encrypts the first data; the first homomorphic ciphertext contains the first user's private key parameter; then obtains the conversion key obtained by the first user and the second user through key negotiation, and converts the first homomorphic ciphertext by using the conversion key to convert the first user's private key parameter in the first homomorphic ciphertext into the second user's private key parameter to obtain the converted homomorphic ciphertext; the converted homomorphic ciphertext contains the second user's private key parameter; finally, the converted homomorphic ciphertext is sent to the second user, so that the second user can perform homomorphic calculation on the converted homomorphic ciphertext and the second homomorphic ciphertext obtained after the second user homomorphically encrypts the second data. The embodiment of the present application integrates the trusted execution technology and the homomorphic encryption technology. The trusted execution device converts the homomorphic ciphertext of one user into a homomorphic ciphertext that can be homomorphically calculated by another user in a secure environment through ciphertext conversion, thereby eliminating the need for the data ownership user to perform complex calculations and management, and realizing homomorphic calculations between homomorphic ciphertexts of different users.

[0142] In some embodiments of the present application, the conversion key includes a first conversion key of a first user and a second conversion key of a second user; the first conversion key is a first logical operation result of a private key parameter of the first user and an intermediate conversion key, and the second conversion key is a second logical operation result of a private key parameter of the second user and an intermediate conversion key.

[0143] In some embodiments of the present application, the intermediate conversion key is a key determined through key negotiation when the second user sends an authorization request to the first user.

[0144] In some embodiments of the present application, obtaining a conversion key obtained by a first user and a second user through key negotiation includes:

[0145] If the first user and the second user are able to determine the intermediate conversion key through key agreement, obtaining a first conversion key obtained by performing a logical operation on the first user's private key parameter and the intermediate conversion key, and a second conversion key obtained by performing a logical operation on the second user's private key parameter and the intermediate conversion key;

[0146] If the first user and the second user cannot determine the intermediate conversion key through key negotiation, the first user private key parameters are directly obtained as the first conversion key, and the second user private key parameters are directly obtained as the second conversion key.

[0147] In some embodiments of the present application, the intermediate conversion key is the result of a third logical operation of the first private key package and the second private key package; the first private key package is obtained by the first user performing a logical operation on the first user's private key parameter and the random factor, and the second private key package is obtained by the second user performing a logical operation on the second user's private key parameter and the random factor;

[0148] Correspondingly, the first conversion key is a key expression including only the second user private key parameter and the random factor, obtained by performing a logical operation on the first user private key parameter and the third logical operation result;

[0149] The second conversion key is a key expression including only the first user private key parameter and a random factor, obtained by performing a logical operation on the second user private key parameter and the third logical operation result.

[0150] In some embodiments of the present application, the generation formula of the intermediate conversion key is: 12 =F(s1, s2, r1, r2)

[0151] Where F is the key generation function, the logical operation corresponding to F is addition or subtraction, s1 is the first user private key parameter, s2 is the second user private key parameter, and r1 and r2 are random factors.

[0152] In some embodiments of the present application, converting the first homomorphic ciphertext by converting the first user private key parameter in the first homomorphic ciphertext into the second user private key parameter using a conversion key includes:

[0153] Constructing a ciphertext conversion relational expression having an erasable relation with a private key parameter using the first homomorphic ciphertext, the first conversion key, and the second conversion key;

[0154] The first user private key parameter in the first homomorphic ciphertext is converted into a second user private key parameter based on the ciphertext conversion relationship.

[0155] In some embodiments of the present application, after obtaining the conversion key obtained by the first user and the second user through key negotiation, the method further includes:

[0156] Obtain authentication information;

[0157] Determine whether the second user is a user authorized by the first user based on the authentication information. If so, execute the step of converting the first homomorphic ciphertext by converting the first user private key parameter in the first homomorphic ciphertext into the second user private key parameter using the conversion key.

[0158] In some embodiments of the present application, the authentication information is a digital signature obtained by signing the first homomorphic ciphertext using the intermediate conversion key;

[0159] Determining whether the second user is a user authorized by the first user according to the authentication information includes:

[0160] The digital signature is verified using the intermediate conversion key. If the verification passes, it is determined that the second user is a user authorized by the first user.

[0161] In some embodiments of the present application, the conversion key and authentication information are stored in a trusted execution environment in a trusted execution device;

[0162] Obtain conversion keys and authentication information, including:

[0163] Obtain the conversion key and authentication information from the trusted execution environment.

[0164] In some embodiments of the present application, the ciphertext processing method further includes:

[0165] A security authentication information table is constructed in a trusted execution environment, and the conversion key and authentication information are stored in the security authentication information table; the first homomorphic ciphertext and authentication method are also stored in the security authentication information table.

[0166] In some embodiments of the present application, the ciphertext processing method further includes:

[0167] Initialize the trusted execution device according to the basic specifications of the trusted environment to build a trusted execution environment.

[0168] In some embodiments of the present application, the trusted execution environment is divided into a public computing area and a trusted computing area.

[0169] In some embodiments of the present application, the conversion key and authentication information are stored in a trusted computing area.

[0170] In some embodiments of the present application, determining whether the second user is a user authorized by the first user based on the authentication information includes:

[0171] The step of determining whether the second user is a user authorized by the first user according to the authentication information is performed in the trusted computing area.

[0172] In some embodiments of the present application, obtaining a first homomorphic ciphertext obtained by a first user homomorphically encrypting first data includes:

[0173] Obtaining, from the first user, a first homomorphic ciphertext obtained by the first user homomorphically encrypting the first data using a homomorphic encryption algorithm;

[0174] Correspondingly, the second homomorphic ciphertext is obtained by the second user after homomorphically encrypting the second data using a homomorphic encryption algorithm.

[0175] In some embodiments of the present application, the first homomorphic ciphertext is obtained by the first user after homomorphically encrypting the first encoded data of the first data using a homomorphic encryption algorithm; the first encoded data is the encoded data that conforms to the homomorphic encryption input data format obtained after the first user performs an encoding operation on the first data.

[0176] In some embodiments of the present application, after the second user performs homomorphic calculation on the converted homomorphic ciphertext and the second homomorphic ciphertext obtained after the second user homomorphically encrypts the second data, the method further includes:

[0177] The second user performs homomorphic decryption on the ciphertext obtained after the homomorphic calculation to obtain the decrypted plaintext.

[0178] In some embodiments of the present application, after the second user performs homomorphic decryption on the ciphertext obtained after the homomorphic computation to obtain the decrypted plaintext, the following steps are further included:

[0179] The second user performs a decoding operation on the decrypted plaintext to obtain corresponding decoded data; the decoded data is consistent with the result obtained by directly performing the same calculation as the homomorphic calculation on the first data and the second data.

[0180] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the trusted execution device 20; the communication interface 24 can create a data transmission channel between the trusted execution device 20 and external devices. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0181] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon may include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.

[0182] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the trusted execution device 20, so as to enable the processor 21 to calculate and process the massive amount of data 223 in the memory 22. The operating system 221 can be Windows Server, NetWare, Unix, Linux, etc. In addition to including computer programs capable of performing the ciphertext processing method provided by the trusted execution device 20 in any of the aforementioned embodiments, the computer program 222 can further include computer programs capable of performing other specific tasks. The data 223 can include the first homomorphic ciphertext collected by the electronic device 20.

[0183] Furthermore, an embodiment of the present application further provides a storage medium, wherein the storage medium stores a computer program. When the computer program is loaded and executed by a processor, at least the following steps are implemented:

[0184] Obtaining a first homomorphic ciphertext obtained by the first user homomorphically encrypting the first data; the first homomorphic ciphertext includes a private key parameter of the first user;

[0185] Obtaining a conversion key obtained by the first user and the second user through key negotiation, and converting the first homomorphic ciphertext by converting the first user's private key parameter in the first homomorphic ciphertext into the second user's private key parameter using the conversion key to obtain a converted homomorphic ciphertext; the converted homomorphic ciphertext includes the second user's private key parameter;

[0186] The converted homomorphic ciphertext is sent to the second user so that the second user can perform homomorphic calculation on the converted homomorphic ciphertext and the second homomorphic ciphertext obtained after the second user homomorphically encrypts the second data.

[0187] In some embodiments of the present application, the conversion key includes a first conversion key of a first user and a second conversion key of a second user; the first conversion key is a first logical operation result of a private key parameter of the first user and an intermediate conversion key, and the second conversion key is a second logical operation result of a private key parameter of the second user and an intermediate conversion key.

[0188] In some embodiments of the present application, the intermediate conversion key is a key determined through key negotiation when the second user sends an authorization request to the first user.

[0189] In some embodiments of the present application, obtaining a conversion key obtained by a first user and a second user through key negotiation includes:

[0190] If the first user and the second user are able to determine the intermediate conversion key through key agreement, obtaining a first conversion key obtained by performing a logical operation on the first user's private key parameter and the intermediate conversion key, and a second conversion key obtained by performing a logical operation on the second user's private key parameter and the intermediate conversion key;

[0191] If the first user and the second user cannot determine the intermediate conversion key through key negotiation, the first user private key parameters are directly obtained as the first conversion key, and the second user private key parameters are directly obtained as the second conversion key.

[0192] In some embodiments of the present application, the intermediate conversion key is the result of a third logical operation of the first private key package and the second private key package; the first private key package is obtained by the first user performing a logical operation on the first user's private key parameter and the random factor, and the second private key package is obtained by the second user performing a logical operation on the second user's private key parameter and the random factor;

[0193] Correspondingly, the first conversion key is a key expression including only the second user private key parameter and the random factor, obtained by performing a logical operation on the first user private key parameter and the third logical operation result;

[0194] The second conversion key is a key expression including only the first user private key parameter and a random factor, obtained by performing a logical operation on the second user private key parameter and the third logical operation result.

[0195] In some embodiments of the present application, the generation formula of the intermediate conversion key is: 12 =F(s1, s2, r1, r2)

[0196] Where F is the key generation function, the logical operation corresponding to F is addition or subtraction, s1 is the first user private key parameter, s2 is the second user private key parameter, and r1 and r2 are random factors.

[0197] In some embodiments of the present application, converting the first homomorphic ciphertext by converting the first user private key parameter in the first homomorphic ciphertext into the second user private key parameter using a conversion key includes:

[0198] Constructing a ciphertext conversion relational expression having an erasable relation with a private key parameter using the first homomorphic ciphertext, the first conversion key, and the second conversion key;

[0199] The first user private key parameter in the first homomorphic ciphertext is converted into a second user private key parameter based on the ciphertext conversion relationship.

[0200] In some embodiments of the present application, after obtaining the conversion key obtained by the first user and the second user through key negotiation, the method further includes:

[0201] Obtain authentication information;

[0202] Determine whether the second user is a user authorized by the first user based on the authentication information. If so, execute the step of converting the first homomorphic ciphertext by converting the first user private key parameter in the first homomorphic ciphertext into the second user private key parameter using the conversion key.

[0203] In some embodiments of the present application, the authentication information is a digital signature obtained by signing the first homomorphic ciphertext using the intermediate conversion key;

[0204] Determining whether the second user is a user authorized by the first user according to the authentication information includes:

[0205] The digital signature is verified using the intermediate conversion key. If the verification passes, it is determined that the second user is a user authorized by the first user.

[0206] In some embodiments of the present application, the conversion key and authentication information are stored in a trusted execution environment in a trusted execution device;

[0207] Obtain conversion keys and authentication information, including:

[0208] Obtain the conversion key and authentication information from the trusted execution environment.

[0209] In some embodiments of the present application, the ciphertext processing method further includes:

[0210] A security authentication information table is constructed in a trusted execution environment, and the conversion key and authentication information are stored in the security authentication information table; the first homomorphic ciphertext and authentication method are also stored in the security authentication information table.

[0211] In some embodiments of the present application, the ciphertext processing method further includes:

[0212] Initialize the trusted execution device according to the basic specifications of the trusted environment to build a trusted execution environment.

[0213] In some embodiments of the present application, the trusted execution environment is divided into a public computing area and a trusted computing area.

[0214] In some embodiments of the present application, the conversion key and authentication information are stored in a trusted computing area.

[0215] In some embodiments of the present application, determining whether the second user is a user authorized by the first user based on the authentication information includes:

[0216] The step of determining whether the second user is a user authorized by the first user according to the authentication information is performed in the trusted computing area.

[0217] In some embodiments of the present application, obtaining a first homomorphic ciphertext obtained by a first user homomorphically encrypting first data includes:

[0218] Obtaining, from the first user, a first homomorphic ciphertext obtained by the first user homomorphically encrypting the first data using a homomorphic encryption algorithm;

[0219] Correspondingly, the second homomorphic ciphertext is obtained by the second user after homomorphically encrypting the second data using a homomorphic encryption algorithm.

[0220] In some embodiments of the present application, the first homomorphic ciphertext is obtained by the first user after homomorphically encrypting the first encoded data of the first data using a homomorphic encryption algorithm; the first encoded data is the encoded data that conforms to the homomorphic encryption input data format obtained after the first user performs an encoding operation on the first data.

[0221] In some embodiments of the present application, after the second user performs homomorphic calculation on the converted homomorphic ciphertext and the second homomorphic ciphertext obtained after the second user homomorphically encrypts the second data, the method further includes:

[0222] The second user performs homomorphic decryption on the ciphertext obtained after the homomorphic calculation to obtain the decrypted plaintext.

[0223] In some embodiments of the present application, after the second user performs homomorphic decryption on the ciphertext obtained after the homomorphic computation to obtain the decrypted plaintext, the following steps are further included:

[0224] The second user performs a decoding operation on the decrypted plaintext to obtain corresponding decoded data; the decoded data is consistent with the result obtained by directly performing the same calculation as the homomorphic calculation on the first data and the second data.

[0225] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. References to the same or similar parts between the various embodiments are sufficient. For the devices provided in the embodiments, since they correspond to the methods provided in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.

[0226] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0227] The above is a detailed introduction to the ciphertext processing method, device, storage medium and trusted execution device provided by this application. Specific examples are used in this article to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core idea of ​​this application. At the same time, for general technical personnel in this field, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on this application.

Claims

1. A ciphertext processing method, characterized in that: include: Obtaining a first homomorphic ciphertext obtained after the first user homomorphically encrypts the first data; The first homomorphic ciphertext includes a first user private key parameter; Acquire a conversion key obtained by the first user and the second user through key negotiation, and convert the first homomorphic ciphertext by converting the first user private key parameter in the first homomorphic ciphertext into the second user private key parameter using the conversion key to obtain a converted homomorphic ciphertext; The converted homomorphic ciphertext includes a second user private key parameter; The converted homomorphic ciphertext is sent to the second user so that the second user can perform homomorphic calculation on the converted homomorphic ciphertext and the second homomorphic ciphertext obtained after the second user homomorphically encrypts the second data.

2. The ciphertext processing method according to claim 1, characterized in that: The conversion key includes a first conversion key of the first user and a second conversion key of the second user; the first conversion key is a first logical operation result of a first user private key parameter and an intermediate conversion key, and the second conversion key is a second logical operation result of a second user private key parameter and the intermediate conversion key.

3. The ciphertext processing method according to claim 2, characterized in that: The intermediate conversion key is a key determined by key negotiation when the second user sends an authorization request to the first user.

4. The ciphertext processing method according to claim 3, characterized in that: The obtaining of the conversion key obtained by the first user and the second user through key negotiation includes: If the first user and the second user can determine the intermediate conversion key by key negotiation, then obtaining the first conversion key obtained by performing a logical operation on the first user private key parameter and the intermediate conversion key and the second conversion key obtained by performing a logical operation on the second user private key parameter and the intermediate conversion key; If the first user and the second user cannot determine the intermediate conversion key through key negotiation, the first user private key parameters are directly obtained as the first conversion key, and the second user private key parameters are directly obtained as the second conversion key.

5. The ciphertext processing method according to claim 2, characterized in that: The intermediate conversion key is a third logic operation result of the first private key package and the second private key package; the first private key package is obtained by the first user performing a logic operation on the first user private key parameter and a random factor, and the second private key package is obtained by the second user performing a logic operation on the second user private key parameter and a random factor; Correspondingly, the first conversion key is a key expression including only the second user private key parameter and the random factor obtained by performing a logical operation on the first user private key parameter and the third logical operation result; The second conversion key is a key expression including only the first user private key parameter and a random factor, obtained by performing a logical operation on the second user private key parameter and the third logical operation result.

6. The ciphertext processing method according to claim 5, characterized in that: The generation formula of the intermediate conversion key is: 12 =F(s1,s2,r1,r2) Among them, F is the key generation function, the logical operation corresponding to F is addition or subtraction, s1 is the first user private key parameter, s2 is the second user private key parameter, r1 and r2 are random factors.

7. The ciphertext processing method according to claim 5, characterized in that: The converting of the first homomorphic ciphertext by converting the first user private key parameter in the first homomorphic ciphertext into the second user private key parameter by using the conversion key includes: Using the first homomorphic ciphertext, the first conversion key, and the second conversion key, a ciphertext conversion relational expression having an erasable relation with private key parameters is constructed; Based on the ciphertext conversion relationship, the first user private key parameter in the first homomorphic ciphertext is converted into a second user private key parameter.

8. The ciphertext processing method according to claim 2, characterized in that: After obtaining the conversion key obtained by the first user and the second user through key negotiation, the method further includes: Get authentication information; Determine whether the second user is a user authorized by the first user based on the authentication information; if so, execute the step of converting the first homomorphic ciphertext by converting the first user private key parameters in the first homomorphic ciphertext into the second user private key parameters using the conversion key.

9. The ciphertext processing method according to claim 8, characterized in that: The authentication information is a digital signature obtained by signing the first homomorphic ciphertext using the intermediate conversion key; The determining, according to the authentication information, whether the second user is a user authorized by the first user includes: The digital signature is verified using the intermediate conversion key, and if the verification passes, it is determined that the second user is a user authorized by the first user.

10. The ciphertext processing method according to claim 8, characterized in that: The conversion key and the authentication information are stored in a trusted execution environment in a trusted execution device; Acquiring the conversion key and the authentication information includes: The conversion key and the authentication information are obtained from the trusted execution environment.

11. The ciphertext processing method according to claim 10, characterized in that: Also includes: Constructing a security authentication information table in the trusted execution environment, and using the security authentication information table to store the conversion key and the authentication information; The security authentication information table also stores the first homomorphic ciphertext and authentication method.

12. The ciphertext processing method according to claim 10, characterized in that: Also includes: The trusted execution device is initialized according to the trusted environment basic specification to build the trusted execution environment.

13. The ciphertext processing method according to claim 10, characterized in that: The trusted execution environment is divided into a public computing area and a trusted computing area.

14. The ciphertext processing method according to claim 13, characterized in that: The conversion key and the authentication information are stored in the trusted computing area.

15. The ciphertext processing method according to claim 11, characterized in that: The determining, according to the authentication information, whether the second user is a user authorized by the first user includes: The step of determining whether the second user is a user authorized by the first user according to the authentication information is performed in the trusted computing area.

16. The ciphertext processing method according to any one of claims 1 to 15, characterized in that: The obtaining a first homomorphic ciphertext obtained by homomorphically encrypting the first data by the first user includes: Acquire, from the first user, the first homomorphic ciphertext obtained after the first user homomorphically encrypts the first data using a homomorphic encryption algorithm; Correspondingly, the second homomorphic ciphertext is obtained by the second user after homomorphically encrypting the second data using the homomorphic encryption algorithm.

17. The ciphertext processing method according to claim 16, characterized in that: The first homomorphic ciphertext is obtained by the first user performing homomorphic encryption on the first encoded data of the first data using the homomorphic encryption algorithm; The first encoded data is encoded data that complies with the homomorphic encryption input data format and is obtained after the first user performs an encoding operation on the first data.

18. The ciphertext processing method according to any one of claims 1 to 15, characterized in that: After the second user performs homomorphic calculation on the converted homomorphic ciphertext and the second homomorphic ciphertext obtained after the second user homomorphically encrypts the second data, the method further includes: The second user performs homomorphic decryption on the ciphertext obtained after the homomorphic calculation to obtain a decrypted plaintext.

19. The ciphertext processing method according to claim 18, characterized in that: After the second user performs homomorphic decryption on the ciphertext obtained after the homomorphic calculation to obtain the decrypted plaintext, the method further includes: The second user performs a decoding operation on the decrypted plaintext to obtain corresponding decoded data; the decoded data is consistent with a result obtained by directly performing the same calculation as the homomorphic calculation on the first data and the second data.

20. A trusted execution device, characterized in that: The trusted execution device comprises a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the ciphertext processing method according to any one of claims 1 to 19.

21. The trusted execution device according to claim 20, characterized in that: The processor is constructed with a trusted execution environment including a public computing area and a trusted computing area.

22. A ciphertext processing device, characterized in that: include: A ciphertext acquisition module, used to obtain a first homomorphic ciphertext obtained after a first user homomorphically encrypts the first data; The first homomorphic ciphertext includes a first user private key parameter; a key acquisition and ciphertext conversion module, configured to acquire a conversion key obtained by the first user and the second user through key negotiation, and convert the first homomorphic ciphertext by converting the first user private key parameter in the first homomorphic ciphertext into the second user private key parameter using the conversion key to obtain a converted homomorphic ciphertext; the converted homomorphic ciphertext includes the second user private key parameter; The ciphertext sending module is used to send the converted homomorphic ciphertext to the second user, so that the second user can perform homomorphic calculation on the converted homomorphic ciphertext and the second homomorphic ciphertext obtained after the second user homomorphically encrypts the second data.

23. A non-volatile computer-readable storage medium, characterized in that: Used to store computer executable instructions, which, when loaded and executed by a processor, implement the ciphertext processing method as described in any one of claims 1 to 19.

Citation Information

Patent Citations

  • A multi-identity fully homomorphic encryption method supporting threshold decryption

    CN109831297A

  • Lattice-based multi-identity fully homomorphic encryption method

    CN111526002A

  • Multi-key fully homomorphic encryption method with fixed ciphertext length

    CN112543091A

  • Ciphertext processing method and device, storage medium and trusted execution equipment

    CN116170131A

  • Homomorphic Evaluation Including Key Switching, Modulus Switching, And Dynamic Noise Management

    US20160164676A1