Data transmission method and device based on homomorphic encryption, equipment and storage medium

By using homogenous encryption technology in data transmission, the query request is encrypted, the problem of poor data transmission confidentiality in the existing technology is solved, and the efficient and security of data transmission is realized.

CN119382863AActive Publication Date: 2025-01-28INST OF APPLIED MATHEMATICS HEBEI ACADEMY OF SCI
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411974683.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-01-28
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

During the data sharing process, the existing technology has poor confidentiality, which increases the risk of data leakage, especially when the original data is directly transmitted.

Method used

Use the data transmission method based on the same state encryption, encrypt the query request through the same -state encryption parameters of the target agency, generate the first data, and use the same -state encryption algorithm to convert the first data to the second data during the transmission process, including The information of the original data finally uses the private key decryption to obtain the target data.

Benefits of technology

Effectively ensure the security of data during transmission, protect the privacy of data, improve the efficiency and flexibility of data processing, and simplify the data processing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119382863A_ABST
    Figure CN119382863A_ABST
Patent Text Reader

Abstract

The invention provides a data transmission method and device based on homomorphic encryption, equipment and a storage medium, and belongs to the technical field of data transmission, the method comprises the following steps: encrypting a query request based on homomorphic encryption parameters of a target mechanism to obtain first data, and sending the first data to the target mechanism; the first data is used for indicating the target mechanism to generate second data containing data corresponding to the query request; the homomorphic encryption parameter comprises a first public key; receiving second data sent by the target mechanism, wherein the second data is data obtained by fusing the original data on the basis of the first data by the target mechanism based on the homomorphic encryption algorithm; and decrypting the second data based on the private key to obtain the target data. According to the data transmission method and device based on homomorphic encryption, the equipment and the storage medium provided by the invention, the security of data transmission and the calculation efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure belongs to the technical field of data transmission, and more specifically, to a data transmission method, apparatus, device and storage medium based on homomorphic encryption. Background Art

[0002] With the advent of the big data era, different institutions need to share data. In the process of data sharing, how to protect the privacy and data security of all participants has become an urgent problem to be solved. The existing data transmission methods have poor confidentiality. In some cases, the original data may be directly transmitted to other institutions, increasing the risk of data leakage. Summary of the invention

[0003] The purpose of the present disclosure is to provide a data transmission method, apparatus, device and storage medium based on homomorphic encryption to improve the security of data transmission and improve computing efficiency.

[0004] A first aspect of an embodiment of the present disclosure provides a data transmission method based on homomorphic encryption, comprising: Encrypting the query request based on the homomorphic encryption parameters of the target organization to obtain first data, and sending the first data to the target organization; the first data is used to instruct the target organization to generate second data containing data corresponding to the query request; the homomorphic encryption parameters include a first public key; Receiving second data sent by the target organization, where the second data is data obtained by the target organization by fusing the original data with the first data based on a homomorphic encryption algorithm; The second data is decrypted based on the private key to obtain target data.

[0005] A second aspect of the embodiments of the present disclosure provides a data transmission device based on homomorphic encryption, including: A first encryption module, used to encrypt the query request based on the homomorphic encryption algorithm of the target organization to obtain first data, and send the first data to the target organization; the first data is used to instruct the target organization to generate second data containing the data corresponding to the query request; the homomorphic encryption parameters include a first public key; A receiving module, used to receive second data sent by a target organization, where the second data is data obtained by the target organization by fusing the original data with the first data based on a homomorphic encryption algorithm; A decryption module is used to decrypt the second data based on a private key to obtain target data.

[0006] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of the above-mentioned data transmission method based on homomorphic encryption when executing the computer program.

[0007] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned data transmission method based on homomorphic encryption are implemented.

[0008] The data transmission method, apparatus, device and storage medium based on homomorphic encryption provided by the embodiments of the present disclosure have the following beneficial effects: On the one hand, the disclosed embodiments effectively ensure the security of data during transmission. The query request is encrypted into the first data through the homomorphic encryption algorithm. Even if the data is intercepted during transmission, it is difficult for an attacker to decrypt and obtain the original information, thereby protecting the privacy of the data.

[0009] On the other hand, the disclosed embodiments improve the efficiency and flexibility of data processing. The homomorphic encryption algorithm allows mathematical operations to be performed on ciphertext without decryption. After receiving the first data, the target organization can directly generate the second data containing the data corresponding to the query request based on the homomorphic encryption algorithm without the need for additional decryption and encryption steps. This not only simplifies the data processing process, but also improves the efficiency and flexibility of data processing, making data interaction more convenient and efficient. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0011] Figure 1 A schematic diagram of a data transmission method based on homomorphic encryption provided in accordance with an embodiment of the present disclosure; Figure 2 A structural block diagram of a data transmission device based on homomorphic encryption provided by an embodiment of the present disclosure; Figure 3 A schematic block diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0012] In the following description, specific details such as specific system structures and technologies are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present disclosure. However, it should be clear to those skilled in the art that the present disclosure may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obstructing the description of the present disclosure with unnecessary details.

[0013] In order to make the purpose, technical solutions and advantages of the present disclosure more clear, specific embodiments will be described below in conjunction with the accompanying drawings.

[0014] Please refer to Figure 1 , Figure 1 A schematic diagram of a data transmission method based on homomorphic encryption provided in an embodiment of the present disclosure, the method comprising: S101: Encrypt the query request based on the homomorphic encryption parameters of the target organization to obtain first data, and send the first data to the target organization; the first data is used to instruct the target organization to generate second data containing data corresponding to the query request; the homomorphic encryption parameters include a first public key.

[0015] In this embodiment, the homomorphic encryption algorithm is a special encryption algorithm that can map plaintext data into a specific mathematical space, implement operations such as addition or multiplication in the mathematical space, and remap the result back to the plaintext space. The core of homomorphic encryption is that the ciphertext obtained after the two ciphertexts are operated is the same as the result of the same operation on the corresponding plaintext after decryption. This means that under the homomorphic encryption algorithm, mathematical operations can be performed on the ciphertext without decryption, thereby protecting the privacy of the data. Homomorphic encryption parameters include key parameters. Key parameters include public key, private key, and key length. Each institution participating in data transmission has a pair of keys, namely a public key and a private key, at the time of initialization. The public key is usually used to encrypt data, and the private key is usually used to decrypt data. Each participating institution can send the public key to other participating institutions so that other participating institutions can encrypt data.

[0016] The target organization refers to the sender, which is the initial provider of data in the entire data exchange process. The target organization can send the required information to the requester based on the query information sent by the requester.

[0017] The query request indicates the content of the request made by the initiator to the target organization to obtain relevant information or perform a certain query operation. For example, it can be an expression of specific needs such as querying a certain type of business data, user information, etc. However, in order to ensure its security and confidentiality during transmission, it needs to be encrypted using the homomorphic encryption parameters of the target organization before being sent to the target organization.

[0018] The first data is the result data obtained after encrypting the query request based on the first public key of the target organization. It is essentially an encrypted presentation of the query request. Its purpose is to send it to the target organization in an encrypted form so that the target organization can further generate the second data required later without decrypting the first data.

[0019] In this embodiment, the data transmission method based on homomorphic encryption requires the participation of multiple parties. It is assumed that there are multiple requesting parties and one sending party (target organization). After receiving the encrypted query request from the requesting party, the target organization uses the homomorphic encryption algorithm to encrypt the first data and data related to the first data, and transmits the encrypted second data to the requesting party through the oblivious transfer protocol to ensure that the data is not leaked during the transmission process.

[0020] S102: Receive second data sent by the target organization, where the second data is data obtained by the target organization by fusing the original data with the first data based on a homomorphic encryption algorithm.

[0021] In this embodiment, after receiving the first data, the target organization decrypts the first data based on the first private key corresponding to the first public key to obtain prompt information, and obtains the original data related to the prompt information based on the prompt information. Then, the first data and the original data related to the prompt information are encrypted based on the homomorphic encryption algorithm to obtain the second data. The second data is sent to the requesting party.

[0022] Original data refers to the data resources owned by the target institution itself, which are not encrypted and related to the query request. For example, in the financial scenario, the customer account balances and transaction records stored in the bank; in the medical scenario, the patient medical records and examination results stored in the hospital are all original data. After receiving the first data, the target institution will use the homomorphic encryption algorithm to merge the original data with it, thereby generating the second data containing the content corresponding to the query request. The original data is an important source of basic information in the entire data processing process.

[0023] S103: Decrypt the second data based on the private key to obtain target data.

[0024] In this embodiment, in an asymmetric encryption system, the private key is a key corresponding to the public key and saved by the requester. There is a specific mathematical relationship between the private key and the public key. Only by using the matching private key can the data generated by encryption with the corresponding public key be decrypted and restored, thereby ensuring the security and confidentiality of information during transmission and interaction. The second data is the data encrypted by the target organization using the public key corresponding to the requester.

[0025] The requester uses its own private key to decrypt the second data to obtain the required information. The requester can only decrypt the results of its query and cannot obtain other unqueried data. If the target organization sends data to other requesters by mistake, other requesters cannot obtain data other than their own request, which also ensures the security of data transmission.

[0026] It can be concluded from the above that, on the one hand, the disclosed embodiment effectively ensures the security of data during transmission. The query request is encrypted into the first data through the homomorphic encryption algorithm. Even if the data is intercepted during transmission, it is difficult for the attacker to decrypt and obtain the original information, thereby protecting the privacy of the data.

[0027] On the other hand, the disclosed embodiments improve the efficiency and flexibility of data processing. The homomorphic encryption algorithm allows mathematical operations to be performed on ciphertext without decryption. After receiving the first data, the target organization can directly generate the second data containing the data corresponding to the query request based on the homomorphic encryption algorithm without the need for additional decryption and encryption steps. This not only simplifies the data processing process, but also improves the efficiency and flexibility of data processing, making data interaction more convenient and efficient.

[0028] In one embodiment of the present disclosure, encrypting a query request based on a homomorphic encryption parameter of a target organization to obtain first data includes: The query request is encrypted based on the first formula and the homomorphic encryption parameter of the target organization to obtain the first data, wherein the first formula is:

[0029] The query request is represented as a plaintext message m; the homomorphic encryption parameters of the target organization include the public key , represents the i-th vector element, , b is a scalar value, random noise vector , represents the i-th random noise vector element, and the first data is represented as , q is a positive integer, indicating the modulus, t is the preset scaling factor, mod indicates the modulus operation, Indicates a round-down operation. The b scalar value can be used to perform initial transformation or obfuscation on plaintext data to increase data security.

[0030] In this embodiment, the modulus q limits the value range of the operation result, ensuring that the encryption calculation result is within a suitable numerical range. The scaling factor t is used to perform appropriate numerical scaling on the plaintext message m during the encryption process, so as to facilitate subsequent operations based on homomorphic properties and accurately restore the plaintext during decryption.

[0031] Generally, it is obtained by performing a specific transformation on a certain part of the query request and encrypting it using the first public key of the target organization and specific parameters in the homomorphic encryption algorithm. Usually in On this basis, the other parts of the query request are encrypted, and the encryption process is complicated.

[0032] In one embodiment of the present disclosure, the target organization generates second data containing data corresponding to the query request, including: The target organization generates second data including data corresponding to the query request based on the second formula, and the second formula is:

[0033] Among them, the second data is , the original data is , the target organization uses the homomorphic encryption algorithm parameters for this fusion encryption operation, and the public key is set to , the private key is , for The corresponding private key; represents the jth vector element, , Represents a scalar value, a random noise vector , represents the jth random noise vector element, Represents the modulus, which is a positive integer. Indicates the preset scaling factor, It can be the same value as t; mod means modulus operation. Indicates floor operation. l can be the same as n or different.

[0034] In one embodiment of the present disclosure, sending first data to a target organization includes: The first data is divided into a plurality of sub-data according to a preset segmentation rule, and each sub-data is transmitted to a target organization via a network in turn.

[0035] In this embodiment, the preset segmentation rule is determined based on one or more of the length of the data, the sensitivity level of the data, and the network transmission bandwidth.

[0036] The length of data refers to the amount of information contained in the first data, usually measured in bytes. Data length is one of the important factors in determining the segmentation rules. Long data needs to be divided into multiple sub-data for easy transmission and processing. At the same time, the size of each sub-data can be reasonably allocated according to the data length to avoid the situation where the sub-data is too large or too small, thereby improving the overall transmission efficiency.

[0037] The sensitivity level of data is used to measure the confidentiality and importance of data. For data with high sensitivity levels, stricter measures can be taken during segmentation, such as further subdividing sub-data and increasing encryption levels, to ensure the security of data during transmission. Data of different sensitivity levels have different segmentation strategies and transmission requirements to meet the needs of data protection.

[0038] Network transmission bandwidth refers to the amount of data that a network can transmit per unit time, usually in units of Mbps, Gbps, etc. Network transmission bandwidth is one of the key factors affecting data transmission speed and efficiency. If the size of the first data exceeds the carrying capacity of the network transmission bandwidth, it may cause slow transmission or even failure. By determining the segmentation rules according to the network transmission bandwidth, the first data can be segmented into sub-data suitable for the current network conditions, making full use of network resources and improving transmission efficiency.

[0039] In this embodiment, when the first data volume is large, if the first data is directly transmitted as a whole, the transmission speed may be slow or even fail due to network transmission bandwidth limitations. After it is divided into multiple sub-data, the transmission order and time of the sub-data can be flexibly adjusted according to the network conditions to achieve parallel transmission or staggered transmission, thereby improving the overall transmission efficiency. Various interference or unstable factors may occur during network transmission, such as network fluctuations, temporary interruptions, etc. When encountering transmission problems, smaller sub-data are easier to retransmit or correct errors without the need to retransmit the entire huge data, thereby enhancing the stability and reliability of transmission.

[0040] In this embodiment, although the homomorphic encryption algorithm has advantages in protecting data privacy, it has problems such as high computational complexity and ciphertext expansion. After the first data is segmented, each sub-data is encrypted and transmitted separately, and then processed and integrated after being received by the target organization. Relatively speaking, the impact of ciphertext expansion can be dispersed to a certain extent, avoiding the difficulties caused by a single overly large ciphertext during transmission and processing. The first data is divided into multiple sub-data by segmentation, encryption operations are performed separately, and then integrated and processed at the target organization. In this way, complex calculations can be decomposed into multiple relatively simple sub-calculations, thereby reducing the overall computational complexity to a certain extent and improving computational efficiency.

[0041] It can be concluded from the above that this embodiment divides the first data into multiple data fragments through a preset segmentation rule. Each sub-data is a part of the first data, and they are transmitted to the target organization through the network in turn. The sub-data is smaller in size than the original data and more flexible in the transmission process, which can reduce the pressure on network transmission caused by excessive data volume. At the same time, it is also convenient to monitor and manage each sub-data separately, which enhances the controllability and reliability of data transmission and improves the overall computing efficiency.

[0042] In one embodiment of the present disclosure, decrypting the second data based on the private key to obtain the target data includes: Dividing the second data into a plurality of first data blocks according to a preset segmentation rule, and decrypting each first data block using a private key to obtain a plurality of second data blocks; Based on the association logic between the second data blocks, multiple second data blocks are merged to obtain second data; the association logic is determined based on the data segmentation and combination rules of the homomorphic encryption algorithm.

[0043] In this embodiment, the second data is divided into a plurality of first data blocks according to a preset segmentation rule, so that relatively large and complex data can be broken down into smaller pieces, making it easier to perform subsequent processing operations. If the entire second data is directly decrypted, the decryption process may be too computationally intensive and inefficient due to reasons such as the large size of the data, or even exceed the carrying capacity of system resources.

[0044] The segmentation rules also need to consider the characteristics of homomorphic encryption algorithms in data processing. The ciphertext data after homomorphic encryption has its particularity in structure and processing methods. The segmentation rules need to fit its encrypted state to ensure that the first data block segmented out can be reasonably restored according to the logic required by homomorphic encryption when it is subsequently decrypted using the private key, avoiding the destruction of the internal correlation of the data and the security guaranteed by the encryption algorithm. Segmentation rules include data length, data sensitivity level, network transmission bandwidth, etc. Commonly used segmentation rules are to divide data according to a fixed number of bytes; divide data according to specific fields, tags or semantics; divide data according to network transmission bandwidth, etc.

[0045] In this embodiment, the second data is divided into K first data blocks based on a preset segmentation rule, and the ciphertext portion corresponding to the uth first data block is and The private key is . Decryption operations are performed on each first data block to obtain multiple second data blocks, and the second data blocks are marked as .

[0046] Each first data block is decrypted according to the third formula to obtain a second data block. The third formula is:

[0047] Among them, the first calculation in the inner brackets is based on the ciphertext part and The purpose of the difference and sum operation of encryption parameters is to remove some "interference" factors based on public keys, noise, etc. added in the encryption process, and then limit the result to the modulus range through modulus operation mod, and finally multiply it by the ratio of the scaling factor to the modulus Restore an approximate value of the second data block corresponding to the first data block.

[0048] In this embodiment, the association logic is based on the inherent laws and rules followed when the data is segmented and combined based on the homomorphic encryption algorithm, which is used to guide how to accurately combine multiple second data blocks to restore the complete second data. The association logic includes the sequence, interdependence, and combination methods such as splicing and calculation between each second data block, which is the key basis for ensuring that the decrypted data can be correctly restored. The target data is the real data information with practical application value that the requester expects to obtain when initially initiating the query request.

[0049] It can be concluded from the above that this embodiment processes the second data based on the preset segmentation rules, reduces the difficulty and computational complexity of data decryption, improves decryption efficiency, and avoids the problem of system resource overload caused by excessive data size. At the same time, this embodiment also combines the second data blocks using the association logic based on the homomorphic encryption algorithm to ensure the integrity and accuracy of the data, increase the security of the data and the reliability of the encryption algorithm.

[0050] In an embodiment of the present disclosure, the first data is further used to instruct the target organization to adjust a second encryption parameter of the original data based on the first data.

[0051] Adjusting a second encryption parameter of the original data based on the first data includes: Determine indication information corresponding to the second encryption parameter based on the first data, and adjust the second encryption parameter of the original data based on the indication information.

[0052] In this embodiment, the second encryption parameter is the algorithm parameter in homomorphic encryption. The second encryption parameter includes encryption algorithm parameters, homomorphic operation parameters and performance parameters. Among them, the encryption algorithm parameters include noise parameters, modulus parameters and encryption times; the homomorphic operation parameters include operation type parameters and operation depth parameters; the performance parameters include time complexity parameters and space complexity parameters.

[0053] The noise parameter is used to hide the plaintext information and increase the security of the ciphertext. The modulus is a parameter used to define an integer ring or a finite field in the homomorphic encryption algorithm. It determines the value range and calculation accuracy of the encrypted data. A larger modulus can provide higher security, but it will also increase the computing and storage overhead. The number of encryptions refers to the number of times the same data is encrypted. Multiple encryptions can improve the security of the data, but it will also increase the computing cost and the expansion of the ciphertext.

[0054] Homomorphic encryption algorithms support different types of operations, such as additive homomorphism, multiplicative homomorphism, or full homomorphism. For full homomorphic encryption algorithms, the operation depth parameter limits the number of consecutive homomorphic operations that can be performed on the ciphertext. The time complexity parameter is used to measure the time overhead of the homomorphic encryption algorithm during encryption, decryption, and homomorphic operations. The space complexity parameter refers to the storage space required by the homomorphic encryption algorithm during encryption, decryption, and homomorphic operations.

[0055] In this embodiment, the indication information includes information related to data features and information related to security requirements. Information related to data features includes data sensitivity, data format and structure, etc., and information related to security requirements includes encryption parameter adjustment direction, encryption parameter adjustment range, etc. By adjusting the second encryption parameter of the original data through the indication information, the encryption process can be made dynamic and data security can be improved. For example, if fixed encryption parameters are always used, attackers can gradually infer the encryption parameters by long-term observation and analysis of communication traffic or ciphertext features, thereby cracking the encrypted data.

[0056] It can be concluded from the above that dynamically adjusting parameters can disrupt the attacker's analysis rhythm, reduce the risk of encryption parameter leakage, and ensure that even if part of the data is intercepted, it is difficult to obtain complete and valid information. In one embodiment of the present disclosure, the indication information includes the encryption parameter adjustment direction and the encryption parameter adjustment amplitude; Adjusting the second encryption parameter of the original data based on the indication information includes: Determining the encryption strength and encryption value of the second encryption parameter based on the encryption parameter adjustment direction; Determining an encryption step size of the encrypted value based on the encryption parameter adjustment amplitude; The second encryption parameter is adjusted based on the encryption strength of the second encryption parameter, the encryption value, and the encryption step size of the encryption value.

[0057] In this embodiment, the encryption strength reflects the complexity of obfuscating and transforming data during the encryption process. The higher the encryption strength, the more difficult it is for an attacker to crack the encrypted data. For example, encryption strength can be divided into three levels: low, medium, and high. The encrypted value is a specific parameter value or variable value used to construct an encryption transformation in the encryption algorithm. For example, in some homomorphic encryption algorithms, the encrypted value is related to the modulus, noise value, etc.

[0058] The specific value of the encryption value determines the way the encryption operation transforms the data. Reasonable selection and adjustment of the encryption value can optimize the performance and function of the encryption algorithm while ensuring data security. For example, in the homomorphic encryption algorithm, by adjusting the encryption value, the feasibility and accuracy of homomorphic operations on the ciphertext can be controlled, which will also affect the size and computational complexity of the ciphertext.

[0059] The encryption step size refers to the amplitude or increment of each parameter change when adjusting the encryption parameters. The encryption step size can be a fixed value or can be determined dynamically according to the specific situation, such as adjusting according to factors such as the importance of the data, the frequency of queries, or the performance requirements of the system. A smaller encryption step size can make the adjustment of encryption parameters more refined and can more accurately adapt to different security needs and performance requirements; a larger encryption step size can increase the adjustment speed and reduce the amount of calculation.

[0060] The second encryption parameter is adjusted based on the encryption strength, encryption value and encryption step of the second encryption parameter, for example, the noise parameter and the number of encryptions are adjusted according to the encryption strength, the modulus is adjusted according to the encryption value, and the step size of the modulus value from one value to another is adjusted according to the encryption step. After the target organization adjusts the second encryption parameter, it needs to send the adjusted parameter to the recipient through a network communication protocol or other means, and the recipient adjusts the private key accordingly to ensure that the recipient can decrypt the received second data.

[0061] It can be concluded from the above that this embodiment can optimize the performance and function of the encryption algorithm by refining the adjustment direction and amplitude of the encryption parameters, and can also ensure the security of the data by flexibly adjusting the encryption strength, encryption value and encryption step. At the same time, through the synchronous adjustment of parameters, the decryption ability of the receiver is guaranteed, and the security and reliability of data transmission are enhanced.

[0062] In one embodiment of the present disclosure, before decrypting the second data based on the private key to obtain the target data, the method further includes: By using a specific check code generation mechanism based on a homomorphic encryption algorithm, comparing a first check code attached to the second data with a second check code regenerated based on the received second data; Determine whether to decrypt the second data based on the matching result of the first verification code and the second verification code.

[0063] In this embodiment, when the homomorphic encryption algorithm encrypts the data, in addition to generating the encrypted second data, it also generates a first check code through a specific check code generation algorithm according to the specific characteristics of the data and some parameters in the encryption process, and transmits it together with the second data. After receiving the second data, the receiver uses the same specific check code generation mechanism based on the homomorphic encryption algorithm to generate a check code again according to the received second data, that is, the second check code. During the generation process, the calculation is performed according to the same rules and parameters as the sender to ensure that the generated check code is comparable. The receiver compares the first check code attached to the received second data with the regenerated second check code bit by bit or according to a specific comparison rule. If the two check codes are exactly the same, it means that there is no error or tampering in the data during transmission; if there is a difference between the two check codes, it indicates that there may be a problem with the data.

[0064] If the first check code matches the second check code, that is, the two are completely consistent, it means that the integrity and authenticity of the second data have been verified, the data is reliable, and the decryption operation based on the private key can continue to obtain the target data. If the first check code does not match the second check code, it means that the second data has been interfered with, damaged, or maliciously tampered with during the transmission process. At this time, corresponding measures need to be taken, such as notifying the sender to resend the data, repairing the data, or conducting further security checks according to the specific situation, etc., until the correct and reliable data is obtained before decryption operation.

[0065] From the above, we can conclude that the checksum is used as a means to verify the source of data. Only a legitimate target organization with the correct homomorphic encryption algorithm and related keys can generate the correct checksum that matches the data. When the receiver receives the data and verifies it, if the checksum matches, it can prove to a certain extent that the data was sent by a legitimate target organization, rather than from an illegal or untrustworthy source, thereby increasing the credibility and security of the data.

[0066] In one embodiment of the present disclosure, the query request includes multi-dimensional query conditions; Encrypting the query request based on the homomorphic encryption algorithm of the target organization to obtain first data includes: Determine a first encryption parameter corresponding to the homomorphic encryption algorithm; Encoding the multi-dimensional query conditions to obtain encoded data; The encoded data is encrypted based on a first encryption parameter of the target organization to obtain first data.

[0067] In this embodiment, multi-dimensional query conditions refer to limiting conditions set from multiple different aspects and angles in the query request. For example, when querying medical data, conditions of different dimensions such as patient age range, disease type, treatment time range, and medication status can be included at the same time. These multi-dimensional conditions can enable the query to more accurately locate specific data content that meets the requirements, so that the data finally obtained can best meet the actual needs of the queryer.

[0068] The existing methods generally directly encrypt the multi-dimensional query conditions before transmission, but this will increase the storage space and is not conducive to data transmission. This embodiment can significantly reduce the space occupied by the data during storage and transmission by encoding the multi-dimensional query conditions and then encrypting the encoded data, thereby improving storage efficiency. In addition, the compressed data has a smaller volume and a faster transmission speed, which reduces network delays and improves the timeliness of data transmission.

[0069] In one embodiment of the present disclosure, the first data is also used to instruct the target organization to determine the data distribution of the original data based on the first data, and to determine the data processing method of the original data based on the data distribution of the original data.

[0070] The data processing method of the original data is determined based on the data distribution of the original data, including: If the data distribution of the original data is uniformly distributed data, the data processing method of the original data is the numerical truncation method; If the data distribution of the original data is normal distribution data, the data processing method of the original data is interval approximation. In this embodiment, the numerical truncation method is a method for approximating numerical data. It directly discards a part of the data according to a pre-set truncation rule to obtain an approximate value. According to the characteristics and accuracy requirements of the data, the digit or position to be truncated is selected. For example, for decimal data, it can be decided to truncate to a few decimal places; for integer data, it can be truncated to a certain number of digits.

[0071] For example, when measuring the length of steel in a construction project, the measuring tool is accurate to millimeters. If the data is 500.356 mm, it can be truncated to 500.3 mm for approximate calculations in some preliminary calculations, because the millimeter-level accuracy difference has little effect on the overall result in this scenario, and this truncation can significantly reduce the amount of calculations.

[0072] The interval approximation method is a method of dividing the range of data into several intervals, and then determining the approximate value of the data based on the interval in which the data is located. Each interval corresponds to a pre-set representative value, and the data is approximated to the representative value of the interval in which it is located. Determine the appropriate interval division method based on the distribution of the data and the purpose of analysis. The intervals can be equidistant or unequal, depending on the characteristics of the data. For example, based on the characteristics of the normal distribution, the data is divided into several typical intervals (such as excellent, good, medium, pass, fail, etc., which correspond to different score ranges), and the representative value of the interval (such as the midpoint of the interval) is used for calculation.

[0073] For example, to calculate the average score of students in a class, the scores are divided into intervals of 0-59, 60-69, 70-79, 80-89, and 90-100. 29.5, 64.5, 74.5, 84.5, and 95 are used as representative values ​​of each interval for approximate calculation. This can not only simplify the calculation, but also reflect the overall performance level to a certain extent.

[0074] From the above, it can be concluded that by selecting an appropriate data processing method (numerical truncation method or interval approximation method) according to the data distribution of the original data, this embodiment effectively improves the efficiency and accuracy of data processing, while simplifying the calculation process, and can significantly improve the transmission efficiency of data after encryption.

[0075] Corresponding to the data transmission method based on homomorphic encryption in the above embodiment, Figure 2 This is a block diagram of a data transmission device based on homomorphic encryption provided by an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Figure 2 The data transmission device 20 based on homomorphic encryption includes: a first encryption module 21, a receiving module 22 and a decryption module 23.

[0076] The first encryption module 21 is used to encrypt the query request based on the homomorphic encryption algorithm of the target organization to obtain the first data, and send the first data to the target organization; the first data is used to instruct the target organization to generate the second data containing the data corresponding to the query request; the homomorphic encryption parameters include the first public key; A receiving module 22, used to receive second data sent by a target organization, where the second data is data obtained by the target organization by fusing the original data with the first data based on a homomorphic encryption algorithm; The decryption module 23 is used to decrypt the second data based on the private key to obtain the target data.

[0077] In one embodiment of the present disclosure, the first encryption module 21 is specifically used for: The query request is encrypted based on the first formula and the homomorphic encryption parameter of the target organization to obtain the first data, wherein the first formula is:

[0078] The query request is represented as a plaintext message m; the homomorphic encryption parameters of the target organization include the public key , represents the i-th vector element, , b is a scalar value, random noise vector , represents the i-th random noise vector element, and the first data is represented as , q is a positive integer, indicating the modulus, t is the preset scaling factor, mod indicates the modulus operation, Indicates floor operation.

[0079] In one embodiment of the present disclosure, the receiving module 22 is specifically used for: The target organization generates second data including data corresponding to the query request based on a second formula, where the second formula is:

[0080] Among them, the second data is , the original data is , the target organization uses the homomorphic encryption algorithm parameters for this fusion encryption operation, and the public key is set to , the private key is , for The corresponding private key; represents the jth vector element, , Represents a scalar value, a random noise vector , represents the jth random noise vector element, Represents the modulus, which is a positive integer. Indicates the preset scaling factor, mod indicates the modulo operation, Indicates floor operation.

[0081] In one embodiment of the present disclosure, the decryption module 23 is specifically used to: Dividing the second data into a plurality of first data blocks according to a preset segmentation rule, and decrypting each first data block using a private key to obtain a plurality of second data blocks; Based on the association logic between the second data blocks, multiple second data blocks are merged to obtain second data; the association logic is determined based on the data segmentation and combination rules of the homomorphic encryption algorithm.

[0082] In an embodiment of the present disclosure, the first data is further used to instruct the target organization to adjust a second encryption parameter of the original data based on the first data.

[0083] In one embodiment of the present disclosure, adjusting a second encryption parameter of original data based on first data includes: Determine indication information corresponding to the second encryption parameter based on the first data, and adjust the second encryption parameter of the original data based on the indication information.

[0084] In one embodiment of the present disclosure, the indication information includes an encryption parameter adjustment direction and an encryption parameter adjustment amplitude; Adjusting the second encryption parameter of the original data based on the indication information includes: Determining the encryption strength and encryption value of the second encryption parameter based on the encryption parameter adjustment direction; Determining an encryption step size of the encrypted value based on the encryption parameter adjustment amplitude; The second encryption parameter is adjusted based on the encryption strength of the second encryption parameter, the encryption value, and the encryption step size of the encryption value.

[0085] See also Figure 3 , Figure 3 A schematic block diagram of an electronic device provided by an embodiment of the present disclosure. Figure 3 The electronic device 300 in the embodiment shown may include: one or more processors 301, one or more input devices 302, one or more output devices 303 and one or more memories 304. The processors 301, input devices 302, output devices 303 and memories 304 communicate with each other via a communication bus 305. The memory 304 is used to store computer programs, which include program instructions. The processor 301 is used to execute the program instructions stored in the memory 304. The processor 301 is configured to call the program instructions to execute the functions of the modules in the above-mentioned device embodiments, such as Figure 2 The functions of modules 21 to 23 are shown.

[0086] It should be understood that in the embodiment of the present disclosure, the processor 301 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0087] The input device 302 may include a touch panel, a fingerprint collection sensor (for collecting the user's fingerprint information and fingerprint direction information), a microphone, etc., and the output device 303 may include a display (LCD, etc.), a speaker, etc.

[0088] The memory 304 may include a read-only memory and a random access memory, and provide instructions and data to the processor 301. A portion of the memory 304 may also include a non-volatile random access memory. For example, the memory 304 may also store information about the device type.

[0089] In a specific implementation, the processor 301, input device 302, and output device 303 described in the embodiments of the present disclosure can execute the implementation methods described in the first and second embodiments of the data transmission method based on homomorphic encryption provided in the embodiments of the present disclosure, and can also execute the implementation methods of the electronic device described in the embodiments of the present disclosure, which will not be repeated here.

[0090] In another embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by the processor, all or part of the processes in the above-mentioned embodiment method are implemented, and the computer program can also be completed by instructing the relevant hardware through the computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0091] The computer-readable storage medium may be an internal storage unit of the electronic device of any of the aforementioned embodiments, such as a hard disk or memory of the electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Furthermore, the computer-readable storage medium may also include both an internal storage unit of the electronic device and an external storage device. The computer-readable storage medium is used to store computer programs and other programs and data required by the electronic device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0092] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this disclosure.

[0093] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the electronic devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0094] In the several embodiments provided in the present application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces or units, or it can be an electrical, mechanical or other form of connection.

[0095] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present disclosure.

[0096] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0097] The above are only specific embodiments of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present disclosure, and these modifications or replacements should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A data transmission method based on homomorphic encryption, characterized in that: include: Encrypting the query request based on the homomorphic encryption parameters of the target organization to obtain first data, and sending the first data to the target organization; The first data is used to instruct the target organization to generate second data containing data corresponding to the query request; the homomorphic encryption parameters include a first public key; Receiving second data sent by the target organization, where the second data is data obtained by the target organization by fusing the original data with the first data based on a homomorphic encryption algorithm; The second data is decrypted based on the private key to obtain target data.

2. The data transmission method based on homomorphic encryption according to claim 1, characterized in that: The step of encrypting the query request based on the homomorphic encryption parameter of the target organization to obtain the first data includes: The query request is encrypted based on the first formula and the homomorphic encryption parameter of the target organization to obtain the first data, wherein the first formula is: The query request is represented as a plaintext message m; the homomorphic encryption parameters of the target organization include the public key , represents the i-th vector element, , b is a scalar value, random noise vector , represents the i-th random noise vector element, and the first data is represented as , q is a positive integer, indicating the modulus, t is the preset scaling factor, mod indicates the modulus operation, Indicates floor operation.

3. The data transmission method based on homomorphic encryption according to claim 1, characterized in that: The target organization generates second data containing data corresponding to the query request, including: The target organization generates second data including data corresponding to the query request based on a second formula, where the second formula is: Among them, the second data is , the original data is , the target organization uses the homomorphic encryption algorithm parameters for this fusion encryption operation, and the public key is set to , the private key is , for The corresponding private key; represents the jth vector element, , Represents a scalar value, a random noise vector , represents the jth random noise vector element, Represents the modulus, which is a positive integer. Indicates the preset scaling factor, mod indicates the modulo operation, Indicates floor operation.

4. The data transmission method based on homomorphic encryption according to claim 1, characterized in that: The decrypting the second data based on the private key to obtain the target data includes: Dividing the second data into a plurality of first data blocks according to a preset segmentation rule, and decrypting each first data block using a private key to obtain a plurality of second data blocks; Based on the association logic between the second data blocks, multiple second data blocks are merged to obtain second data; the association logic is determined based on the data segmentation and combination rules of the homomorphic encryption algorithm.

5. The data transmission method based on homomorphic encryption according to claim 1, characterized in that: The first data is also used to instruct the target organization to adjust a second encryption parameter of the original data based on the first data.

6. The data transmission method based on homomorphic encryption according to claim 5, characterized in that: The adjusting the second encryption parameter of the original data based on the first data includes: Determine indication information corresponding to the second encryption parameter based on the first data, and adjust the second encryption parameter of the original data based on the indication information.

7. The data transmission method based on homomorphic encryption according to claim 6, characterized in that: The indication information includes the encryption parameter adjustment direction and the encryption parameter adjustment range; The adjusting the second encryption parameter of the original data based on the indication information comprises: Determining the encryption strength and encryption value of the second encryption parameter based on the encryption parameter adjustment direction; Determining an encryption step size of the encrypted value based on the encryption parameter adjustment amplitude; The second encryption parameter is adjusted based on the encryption strength of the second encryption parameter, the encryption value, and the encryption step size of the encryption value.

8. A data transmission device based on homomorphic encryption, characterized in that: include: A first encryption module, used to encrypt the query request based on the homomorphic encryption algorithm of the target organization to obtain first data, and send the first data to the target organization; The first data is used to instruct the target organization to generate second data containing data corresponding to the query request; the homomorphic encryption parameters include a first public key; A receiving module, used to receive second data sent by a target organization, where the second data is data obtained by the target organization by fusing the original data with the first data based on a homomorphic encryption algorithm; A decryption module is used to decrypt the second data based on a private key to obtain target data.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Data homomorphic encryption method and device and data transmission method and device

    CN114584278A

  • Encryption protocol conversion method, result acquisition node and privacy computing node

    CN114885038A

  • Data security detection method and device in privacy computing

    CN116938434A

  • Data hiding statistical query method and system based on privacy calculation

    CN117494177A

  • Variable-length hybrid dynamic transmission encryption and decryption method and device

    CN117857078A