Homomorphic encryption ciphertext retrieval method and system based on hardware encryption card
Through the combination of hardware encryption cards and homomorphic encryption technology, the problem of low full-text retrieval efficiency of large-scale crypto-state documents is solved, and safe and efficient crypto-text search is achieved, ensuring the security of data and index tables.
Patent Information
- Application Number
- CN202411452390.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-10-17
AI Technical Summary
The existing homomorphic encryption technology is inefficient in the full-text search scenario of large-scale cryptographic documents, making it difficult to achieve efficient cryptographic search, and traditional encryption technology is limited in efficiency when searching for encrypted data.
Combining hardware encryption card and homomorphic encryption technology, plain text documents and index tables are encrypted through hardware encryption cards, cipher text documents and cipher text index tables are generated, and cipher text keyword matching is performed in cloud servers, and hardware encryption cards are used for Encrypt and decrypt, improve retrieval efficiency.
It realizes safe and efficient cipher text full-text search in large-scale crypto-state document scenarios, protects data security and index table security, and improves retrieval efficiency.
Smart Images

Figure CN119311644A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of ciphertext retrieval, and more specifically, relates to a homomorphic encryption ciphertext retrieval method and system based on a hardware encryption card. Background Art
[0002] With the rapid development of information technology, data plays an increasingly important role in all walks of life. However, the widespread use of data has also brought serious security and privacy issues. Especially in highly sensitive fields such as medicine and finance. How to effectively utilize data while protecting data privacy is crucial. Although traditional encryption technology can effectively protect the confidentiality of data, once the data is encrypted, it is difficult to effectively search in the encrypted data.
[0003] Searchable encryption is a technology that allows encrypted data to be searched while encrypting it. In existing searchable encryption technologies, homomorphic encryption is generally used to implement calculations on data in an encrypted state, ensuring the confidentiality of sensitive information during processing. However, due to the high computational complexity of homomorphic encryption algorithms, the efficiency of encrypted data in ciphertext search is limited, and it is difficult to achieve usability in full-text retrieval scenarios of large-scale ciphertext documents. How to achieve efficient ciphertext full-text retrieval while ensuring data security has become a problem that needs to be solved urgently. Summary of the invention
[0004] In view of the above defects or improvement needs of the prior art, the present invention provides a homomorphic encryption ciphertext retrieval method and system based on a hardware encryption card, which aims to achieve safe and efficient encrypted full-text search in the full-text retrieval scenario of large-scale encrypted documents.
[0005] To achieve the above object, according to a first aspect of the present invention, a homomorphic encryption ciphertext retrieval method based on a hardware encryption card is provided, which is applied to an encryption server containing a hardware encryption card, and comprises:
[0006] Calling a hardware encryption card to symmetric-encrypt a plaintext document received from a client to generate a ciphertext document, and homomorphically encrypting a keyword in a plaintext index table received from a client to generate a ciphertext keyword, using the ciphertext keyword and a document number associated with the ciphertext keyword as a ciphertext index table, and sending the ciphertext document and the ciphertext index table to a ciphertext database in a cloud server for storage; wherein the plaintext document is a plaintext document containing sensitive data uploaded by a data owner through a client; the plaintext index table contains keywords extracted by the client from the plaintext document and the document number associated with the keyword;
[0007] After calling the hardware encryption card to perform homomorphic encryption on the query keyword received from the client to generate a homomorphic ciphertext corresponding to the query keyword, the homomorphic ciphertext is sent to the cloud server; wherein the query keyword is input by the inquirer through the client;
[0008] Call the hardware encryption card to symmetrically decrypt the ciphertext document information list sent by the cloud server, obtain the decrypted document information list, and send it to the client to realize ciphertext document retrieval; wherein, the ciphertext document information list is based on the document number matching the ciphertext keyword queried from the ciphertext index table when the cloud server successfully matches the homomorphic ciphertext with the ciphertext keyword in the ciphertext index table.
[0009] Furthermore, it also includes:
[0010] Calling the hardware encryption card to symmetrically encrypt the keywords in the plaintext index subtable received from the client, and intercepting the last M bits of the encrypted keywords; wherein the plaintext index subtable is a plurality of plaintext index subtables obtained by dividing the plaintext index table by the client according to the word length of the keywords;
[0011] Divide the keywords with the same last M digits into buckets, and number the buckets;
[0012] The plaintext index subtable is also encrypted into a corresponding ciphertext index subtable; the ciphertext index subtable when the ciphertext keyword is matched is determined according to the word length of the query keyword, and the query keyword is symmetrically encrypted, and the bucket number in the ciphertext index subtable is determined according to the last M bits of the query keyword after symmetrical encryption, and the ciphertext keyword is matched in the corresponding bucket according to the bucket number.
[0013] Furthermore, it also includes:
[0014] Call the hardware encryption card to symmetrically decrypt the ciphertext document to be decrypted received from the cloud server to obtain a plaintext document, and send the plaintext document to the client for the inquirer to view or download; wherein the ciphertext document to be decrypted is determined by the cloud server according to the document number to be decrypted selected by the inquirer from the decrypted document information list sent by the client.
[0015] Furthermore, the ciphertext keyword matching includes:
[0016] The receiving cloud server performs homomorphic subtraction of the homomorphic ciphertext corresponding to the query keyword and the ciphertext keyword to obtain the secret difference; and performs homomorphic decryption on it. If the decryption result is 0, it indicates a successful match; wherein the ciphertext keyword is a ciphertext keyword in the ciphertext index table, or a ciphertext keyword in the ciphertext index subtable.
[0017] Furthermore, it also includes:
[0018] Calling a hardware encryption card to symmetrically decrypt the importance-sorted ciphertext document information list to obtain a decrypted document information list; wherein, the importance-sorted ciphertext document information list is obtained in the following manner: the cloud server takes the union of the ciphertext document information lists corresponding to each query keyword and merges them into a ciphertext document information list, calculates the TF-IDF vector of the document in the merged ciphertext document information list, and sorts the document information in the merged ciphertext document information list from high to low importance based on the TF-IDF vector; wherein, the TF-IDF vector is used to measure the importance of the keyword to the document.
[0019] According to a second aspect of the present invention, there is provided an encryption server including a hardware encryption card, comprising a computer-readable storage medium and a processor;
[0020] The computer-readable storage medium is used to store executable instructions;
[0021] The processor is used to read the executable instructions stored in the computer-readable storage medium to execute the homomorphic encryption ciphertext retrieval method described in any one of the first aspects.
[0022] According to a third aspect of the present invention, a homomorphic encryption ciphertext retrieval method based on a hardware encryption card is provided, which is applied to a cloud server and includes:
[0023] The ciphertext document and ciphertext index table sent by the encryption server are stored in the ciphertext database; wherein the ciphertext document is generated by symmetrically encrypting the plaintext document received from the client by the encryption server containing the hardware encryption card, the ciphertext index table includes ciphertext keywords and document numbers associated with the ciphertext keywords, the ciphertext keywords are generated by homomorphically encrypting the keywords in the plaintext index table received from the client by the encryption server, and the plaintext document is a plaintext document containing sensitive data uploaded by the data owner through the client; the plaintext index table includes keywords extracted by the client from the plaintext document and the document numbers associated with the keywords;
[0024] The homomorphic ciphertext corresponding to the query keyword sent by the encryption server is stored in the ciphertext database; wherein the homomorphic ciphertext is generated by the encryption server calling the hardware encryption card to perform homomorphic encryption on the query keyword received from the client, and the query keyword is input by the inquirer through the client;
[0025] The homomorphic ciphertext is matched with the ciphertext keywords in the ciphertext index table. When the match is successful, the document number matching the ciphertext keyword is queried from the ciphertext index table to form a ciphertext document information list, and the ciphertext document information list is sent to the encryption server, so that the encryption server calls the hardware encryption card to symmetrically decrypt the ciphertext document information list, and sends the symmetrically decrypted document information list to the client to realize ciphertext document retrieval.
[0026] According to a fourth aspect of the present invention, there is provided a cloud server comprising a computer-readable storage medium and a processor;
[0027] The computer-readable storage medium is used to store executable instructions;
[0028] The processor is used to read the executable instructions stored in the computer-readable storage medium to execute the homomorphic encryption ciphertext retrieval method described in the third aspect.
[0029] According to a fifth aspect of the present invention, a homomorphic encryption ciphertext retrieval method based on a hardware encryption card is provided, which is applied to a client and includes:
[0030] Extract keywords from a plaintext document containing sensitive data uploaded by a data owner to generate a plaintext index table, and send the plaintext document and the plaintext index table to an encryption server containing a hardware encryption card, so that the encryption server calls the hardware encryption card to symmetrically encrypt the plaintext document to generate a ciphertext document, homomorphically encrypt the keywords in the plaintext index table to generate ciphertext keywords, use the ciphertext keywords and the document numbers associated with the ciphertext keywords as the ciphertext index table, and send the ciphertext document and the ciphertext index table to a ciphertext database in a cloud server for storage; wherein the plaintext index table contains the keywords and the document numbers associated with the keywords;
[0031] The query keyword input by the inquirer is sent to the encryption server, and the decrypted document information list corresponding to the query keyword sent by the encryption server is received to realize ciphertext document retrieval; wherein, the document information list is obtained by the encryption server calling the hardware encryption card to symmetrically decrypt the ciphertext document information list, and the ciphertext document information list is obtained by the document number matching the ciphertext keyword queried from the ciphertext index table when the cloud server successfully matches the homomorphic ciphertext with the ciphertext keyword in the ciphertext index table; the homomorphic ciphertext is obtained by the encryption server calling the hardware encryption card to homomorphically encrypt the query keyword.
[0032] According to a sixth aspect of the present invention, there is provided a client, comprising a computer-readable storage medium and a processor;
[0033] The computer-readable storage medium is used to store executable instructions;
[0034] The processor is used to read the executable instructions stored in the computer-readable storage medium to execute the homomorphic encryption ciphertext retrieval method described in the fifth aspect.
[0035] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects:
[0036] (1) The present invention takes into account that although the hardware encryption card has a high encryption and decryption efficiency, it cannot realize ciphertext retrieval, and although the homomorphic encryption technology can realize the calculation of data in the encryption and decryption state, the retrieval efficiency is extremely low in the full-text retrieval scenario of large-scale ciphertext documents. To this end, the present invention combines the hardware encryption card with homomorphic encryption, uses the hardware encryption card to improve the speed of encryption calculation, and provides a reliable computing environment for encryption and decryption and key generation and management, so that the cloud server and the encryption server can support the full-text keyword retrieval service of large-scale ciphertext documents. Specifically, the plaintext documents uploaded by the data owner through the client are stored in the database of the cloud server in ciphertext form, and the data encryption and decryption are all performed in the hardware encryption card of the encryption server. The attacker cannot obtain the plaintext information through the ciphertext documents in the cloud server, thereby protecting the security of the data. At the same time, based on the homomorphic encryption technology, the keywords in the ciphertext index table are encrypted into random ciphertexts through the homomorphic encryption algorithm. The attacker cannot obtain the sequence information of the keywords and the corresponding relationship between the keywords and the documents through the ciphertext index table in the cloud server, thereby ensuring the security of the index table. In addition, the hardware encryption card and homomorphic encryption are combined, and encryption and decryption are performed based on the hardware encryption card, which provides a safe and efficient computing environment for the implementation of searchable encryption. The homomorphic encryption ciphertext retrieval method based on the hardware encryption card of the present invention can realize safe and efficient encrypted full-text search in the full-text retrieval scenario of large-scale encrypted documents.
[0037] (2) Furthermore, the ciphertext index table is divided into several sub-index tables according to the word length of the keyword. Each sub-table is divided into multiple buckets according to the last M bits of the symmetrically encrypted ciphertext of the keyword, and the buckets are numbered. When matching ciphertext keywords, it is only necessary to select the corresponding bucket for ciphertext keyword matching based on the word length and the bucket number, which further improves the retrieval efficiency.
[0038] (3) Furthermore, the ciphertext document information lists corresponding to each query keyword are combined into a ciphertext document information list, and the document information in the combined ciphertext document information list is sorted from high to low in importance according to the TF-IDF vector, so that the queryer can quickly obtain the required document information from the decrypted document information list, further improving the retrieval efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a schematic diagram of a homomorphic encryption ciphertext retrieval method based on a hardware encryption card in an embodiment of the present invention.
[0040] Figure 2 The figure is a schematic diagram of the process of constructing a ciphertext database in an embodiment of the present invention.
[0041] Figure 3 The figure is a schematic diagram of the ciphertext retrieval process in an embodiment of the present invention.
[0042] Figure 4 Schematic diagram of the keyword matching process in an embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0044] Example 1
[0045] like Figure 1 As shown, the embodiment of the present invention provides a homomorphic encryption ciphertext retrieval method based on a hardware encryption card, which mainly includes:
[0046] The data owner submits a plaintext document containing sensitive data to the client.
[0047] The client extracts each keyword in the plaintext document to generate a plaintext index table, wherein the plaintext index table contains each keyword and a plaintext document number associated with each keyword; the client sends the plaintext document and the plaintext index table to an encryption server having a hardware encryption card.
[0048] The encryption server calls the symmetric encryption algorithm of the hardware encryption card to symmetric encrypt the plaintext document to generate a ciphertext document; at the same time, the hardware encryption card calls the homomorphic encryption algorithm to homomorphically encrypt the keywords in the plaintext index table to generate ciphertext keywords, so as to generate a ciphertext index table; wherein, the ciphertext index table includes ciphertext keywords and ciphertext document numbers, and the ciphertext document numbers are the same as the plaintext document numbers, that is, the document numbers in the plaintext index table are not encrypted. The encryption server sends the ciphertext document and the ciphertext index table to the ciphertext database in the cloud server for storage.
[0049] The inquirer with corresponding authority inputs the query keyword through the corresponding client.
[0050] The client sends the query keyword to the encryption server.
[0051] The encryption server calls the hardware encryption card to perform homomorphic encryption on the query keywords, generates the homomorphic ciphertext corresponding to the query keywords, and then sends the homomorphic ciphertext corresponding to the query keywords to the cloud server.
[0052] The cloud server matches the homomorphic ciphertext corresponding to the query keyword with the ciphertext keyword in the ciphertext index table stored in its ciphertext database. When the match is successful, the cloud server queries the ciphertext document numbers of all the ciphertext keywords matching the ciphertext keyword from the ciphertext index table and forms a ciphertext document information list; wherein the ciphertext document information list contains encrypted document information, such as the title of the ciphertext document. The cloud server sends the ciphertext document information list to the encryption server.
[0053] The hardware encryption card in the encryption server uses a symmetric encryption algorithm to symmetrically decrypt the ciphertext document information list, obtains a decrypted document information list, and sends it to the client for viewing by a queryer with corresponding permissions, thereby realizing ciphertext document retrieval. Preferably, the encryption server only decrypts the encrypted document information in the ciphertext document information list, without decrypting all matching ciphertext document contents, so as to reduce the amount of decryption calculations and improve retrieval efficiency.
[0054] Furthermore, the search method in the embodiment of the present invention further includes:
[0055] The inquirer with corresponding authority determines the plaintext document number to be viewed or downloaded based on the decrypted document information list.
[0056] The client sends the plaintext document number to the cloud server.
[0057] The cloud server sends the ciphertext document stored in its ciphertext database to the encryption server based on the plaintext document number.
[0058] The encryption server calls the symmetric encryption algorithm of the hardware encryption card to symmetric decrypt the ciphertext document to obtain the plaintext document, and sends the plaintext document to the corresponding client for the inquirer to view or download.
[0059] In order to further improve the retrieval efficiency, in the embodiment of the present invention, Figure 2-Figure 4 As shown, after the plaintext index table generated by the client, the plaintext index table is further divided into multiple plaintext index sub-tables according to the word length of each keyword, that is, the word lengths of keywords in the same plaintext index sub-table are equal. Each row in each plaintext index sub-table represents a keyword, and each row contains the numbers of all plaintext documents containing the keyword.
[0060] Correspondingly, when the encryption server performs encryption, it also includes: the hardware encryption card calls the symmetric encryption algorithm to symmetrically encrypt the keywords in each plaintext index subtable, and intercepts the last M bits of the encrypted keywords, and in each plaintext index subtable, the keywords with the same last M bits are divided into a bucket, and the buckets in the plaintext index subtable are numbered; in each plaintext index subtable, the keywords, the plaintext document numbers corresponding to the keywords, and the bucket numbers correspond one to one. As a preferred implementation method, the last M bits of the encrypted keywords are directly used as the bucket numbers, and the keywords with the same bucket numbers are divided into a bucket. In the embodiment of the present invention, M is 8, and in other embodiments, M can also be 16, etc. The smaller M is, the higher the security is. Correspondingly, the larger M is, the higher the retrieval efficiency is. In actual applications, a trade-off is made between security and efficiency.
[0061] Correspondingly, when the encryption server calls the hardware encryption card for encryption, each plaintext index subtable is encrypted into a corresponding ciphertext index subtable.
[0062] Correspondingly, after the encryption server calls the hardware encryption card to perform homomorphic encryption on the query keyword, the method further includes: determining the ciphertext index subtable when the ciphertext keyword matches according to the word length of the query keyword;
[0063] The symmetric encryption algorithm is called to symmetrically encrypt the query keyword, and the bucket number in the ciphertext index subtable required for the above ciphertext keyword matching is determined according to the last M bits of the symmetric encrypted query keyword, and the ciphertext keyword matching is performed in the bucket where the corresponding bucket number is located. As a preferred implementation method, the last M bits of the symmetric encrypted query keyword are used as the bucket number of the current query keyword, and the bucket in the ciphertext index subtable required for the ciphertext keyword matching is selected according to the bucket number, and the ciphertext keyword matching is performed in the bucket where it is located. In this way, homomorphic matching can be performed directly in the bucket where the keyword is located, which greatly improves the retrieval efficiency.
[0064] Specifically, the keys required by the encryption server for encryption and decryption are stored in the hardware encryption card of the encryption server. The encryption server is also used to generate corresponding system parameters based on security parameters, which are used to generate public and private key pairs and identity authentication of users (including data owners and inquirers with corresponding permissions, etc.). Among them, the public key is used when the encryption server performs homomorphic encryption, and the private key is used when the encryption server performs homomorphic decryption; during the encryption and decryption process, the encryption server authenticates the key index holder (such as the above-mentioned user) based on the key index.
[0065] Specifically, the cloud server performs the above ciphertext keyword matching, including:
[0066] Perform homomorphic subtraction on the homomorphic ciphertext corresponding to the query keyword and each ciphertext keyword in its corresponding ciphertext index table (or ciphertext index subtable) to obtain the secret difference between the two keywords in the secret state; send all the secret differences to the encryption server for decryption. If the decryption result is 0, it means the match is successful.
[0067] As a preferred implementation, after the cloud server searches the ciphertext index table for all ciphertext document numbers that match the ciphertext keyword and forms a ciphertext document information list, it also includes:
[0068] Taking a union of the ciphertext document information lists corresponding to each query keyword, so as to merge the ciphertext document information lists corresponding to each query keyword into one ciphertext document information list;
[0069] Calculate the TF-IDF vector of the document in the merged ciphertext document information list, sort the document information in the merged ciphertext document information list from high to low importance based on the TF-IDF vector, and send the ciphertext document information list sorted by importance to the encryption server; wherein the TF-IDF vector is used to measure the importance of the keyword to the document;
[0070] Correspondingly, the hardware encryption card in the encryption server uses a symmetric encryption algorithm to symmetrically decrypt the ciphertext document information list sorted by importance, thereby further improving the retrieval efficiency.
[0071] As a preferred implementation, before the client extracts each keyword in the plaintext document, it also includes authenticating the data owner. Correspondingly, before the client sends the query keyword to the encryption server, it also includes authenticating the inquirer. The client extracts each keyword in the plaintext document by segmenting the plaintext document provided by the data owner. The client extracts the query keyword by segmenting the search string input by the inquirer.
[0072] As a preferred implementation, the above homomorphic encryption algorithm is an integer homomorphic encryption algorithm, which can further improve the retrieval efficiency. When the encryption server symmetrically encrypts the plaintext document, the SM4 symmetric encryption algorithm is used. When the symmetric encryption algorithm is used to symmetrically encrypt the keywords (keywords or query keywords in the plaintext index subtable) to generate bucket numbers, the AES symmetric encryption algorithm is used. In this way, the retrieval efficiency can be further improved while ensuring security.
[0073] In an embodiment of the present invention, the inquirer is an entity that needs to obtain specific data, and the inquirer may be an individual user, an enterprise organization, or other client system. The inquirer usually initiates a data query request to the cloud server to obtain the required data. The cloud server refers to an entity that stores and manages data, which is responsible for managing, storing and maintaining data, and providing data to the query client as needed. The encryption server provides encryption and decryption functions based on the encryption algorithm supported by the hardware encryption card. The hardware encryption card is a hardware device specifically used to protect encryption keys and perform encryption operations. It provides a safe and efficient way to handle encryption tasks and key management. The role of the hardware encryption card is to protect data security, improve performance, and prevent key leakage.
[0074] As one specific implementation method, the client, cloud server and encryption server are connected, and the process includes the following steps:
[0075] Step 1. System initialization: The encryption server generates keys and verification information based on security parameters. The steps for generating the public and private keys required for integer homomorphic encryption are to select two large prime numbers p and q and calculate their product pair 2 l Modulo n, l is the number of bits of the homomorphic ciphertext. Calculate the least common multiple λ of p-1 and q-1, and select a random number g such that g is n 2 A unit root of the modulus, get the public key (n,g). Calculate g λ mod n 2 The multiplicative inverse element μ of is obtained to obtain the private key (λ,μ).
[0076] Step 2. Build a ciphertext database: The data owner submits the document containing sensitive data to the client, which extracts keywords from the document and generates an index table with associated document numbers. The document and index table are then sent to the encryption server, which encrypts the document and index table and generates a bucket number, which is then sent to the cloud server. The cloud server stores the ciphertext document and ciphertext index table in the ciphertext database. This step specifically includes the following sub-steps:
[0077] 2.1 The data owner submits the document to the client, which first verifies the user's identity. If the verification is successful, the document is assigned a document number and the word segmentation algorithm is called to extract keywords and generate an index. The index table is divided into several sub-tables according to the length of the keyword. Each row in the table represents a keyword and contains the numbers of all documents containing the keyword. After the keyword extraction is completed, the document, index table and key index are sent to the encryption server;
[0078] 2.2 The encryption server calls the symmetric encryption algorithm of the hardware encryption card to encrypt the document, calls the integer homomorphic encryption algorithm to encrypt the keywords in the index table, calls the symmetric encryption algorithm to encrypt the keywords and intercepts the last 8 bits of the ciphertext as the bucket number, uses the bucket number of the keyword, the integer homomorphic ciphertext corresponding to the keyword and the associated document number as the new ciphertext index table, and sends the ciphertext document and the ciphertext index table to the cloud server;
[0079] 2.3 After receiving the ciphertext document and ciphertext index table, the cloud server first verifies the consistency proof of the message. If the verification is successful, the ciphertext document, ciphertext index and other ciphertext data are stored in the ciphertext database. The entire ciphertext database construction process is as follows: Figure 2 As shown in the figure, the ciphertext document is obtained by symmetric encryption of the document. Each row of the ciphertext index table consists of the bucket number of the keyword extracted from a document, the integer homomorphic ciphertext corresponding to the keyword, and the document numbers of all documents containing the keyword. At the same time, the ciphertext index table is divided into several sub-tables according to the word length of the keyword, and each sub-table is divided into several buckets according to the bucket number.
[0080] Step 3. Ciphertext query: All users with corresponding permissions can query the ciphertext document content in the ciphertext database by entering keywords in the client. Specifically, the client sends the query keyword to the encryption server, which encrypts it into homomorphic ciphertext and sends it to the cloud server. The cloud server first finds the bucket where the keyword is located, then performs homomorphic subtraction on the homomorphic ciphertext of the query keyword and the ciphertext keyword in the ciphertext index table, and then sends the result to the encryption server for decryption. A result of 0 indicates that the keyword matches successfully. Figure 3 This is a schematic diagram of the ciphertext retrieval process, refer to Figure 3 The client divides the search string into keywords t1 to t k There are k query keywords in total. Each query keyword is matched through the homomorphically encrypted ciphertext index table to obtain document sets 1 to k. The union of k document sets is taken to obtain document set D. The TF-IDF vector is calculated for the documents in D, and the documents are sorted according to the TF-IDF vector. The sorted ciphertext document information list is sent to the encryption server. The encryption server decrypts the document information list and returns it to the client as the query result. Figure 4 This is a schematic diagram of the keyword matching process of the present invention, refer to Figure 4 , this step specifically includes the following sub-steps:
[0081] 3.1 The user enters a search string on the client to query the encrypted document. The client verifies the user's identity and authority. If the verification is successful, the search string is segmented to extract the query keywords, and the query keywords and key index are sent to the encryption server;
[0082] 3.2 The encryption server calls the integer homomorphic encryption algorithm of the hardware encryption card to encrypt the query keyword to generate homomorphic ciphertext, calls the symmetric encryption algorithm to encrypt the query keyword to generate the bucket number, and sends the word length of the query keyword, the integer homomorphic ciphertext corresponding to the query keyword, and the bucket number to the cloud server;
[0083] 3.3 The cloud server finds the bucket where the query keyword is located based on the word length and bucket number, and performs homomorphic subtraction with all the ciphertext keywords in the ciphertext index table in the bucket. The obtained secret difference is sent to the encryption server. The encryption server decrypts and returns the result of the homomorphic subtraction to the cloud server. The result of 0 indicates that the keyword matches successfully. The cloud server extracts the ciphertext document number corresponding to the query keyword based on the result;
[0084] 3.4 The cloud server takes the union of each ciphertext document set, calculates the TF-IDF vector as a standard for measuring the importance of keywords to the document, sorts the documents according to the TF-IDF vector, and sends the sorted ciphertext document information list to the encryption server. The encryption server decrypts the document information list and returns it to the client as the query result.
[0085] Step 4. Obtain plain text: The query user obtains a matching document information list and selects the plain text of the document to be viewed or downloaded. Specifically, the client sends a decryption request (the queryer determines the plain text document number to be viewed or downloaded based on the decrypted document information list) to the cloud server. After receiving the request, the cloud server sends the ciphertext document to the encryption server. The encryption server calls the symmetric encryption algorithm of the hardware encryption card to decrypt the ciphertext document and returns the decrypted document to the client. This step specifically includes the following sub-steps:
[0086] 4.1 The queryer selects the document number to be decrypted through the client and sends it to the cloud server;
[0087] 4.2 The cloud server extracts the corresponding ciphertext document from the ciphertext database and sends it to the encryption server;
[0088] 4.3 The encryption server calls the symmetric encryption algorithm of the hardware encryption card to decrypt the ciphertext document and returns the plaintext document to the client.
[0089] The present invention takes into account that although the hardware encryption card has a high encryption and decryption efficiency, it cannot realize ciphertext retrieval, and although the homomorphic encryption technology can realize the calculation (retrieval) of data in the encryption and decryption state, the retrieval efficiency is extremely low in the full-text retrieval scenario facing large-scale ciphertext documents. To this end, the present invention combines the hardware encryption card with homomorphic encryption, uses the hardware encryption card to improve the speed of encryption calculation, and provides a reliable computing environment for encryption and decryption and key generation and management, so that the cloud server and the encryption server can support the full-text keyword retrieval service of large-scale ciphertext documents. Specifically, the plaintext documents uploaded by the data owner through the client are stored in the database of the cloud server in ciphertext form, and the data encryption and decryption are all executed in the hardware encryption card of the encryption server. The attacker cannot obtain the plaintext information through the ciphertext document in the cloud server, which protects the security of the data. At the same time, based on the homomorphic encryption technology, the keywords in the ciphertext index table are encrypted into random ciphertexts through the homomorphic encryption algorithm, and the attacker cannot obtain the order information of the keywords and the corresponding relationship between the keywords and the documents through the ciphertext index table in the cloud server, which ensures the security of the index table. In addition, the hardware encryption card and homomorphic encryption are combined, and encryption and decryption are performed based on the hardware encryption card, which provides a safe and efficient computing environment for the implementation of searchable encryption. The homomorphic encryption ciphertext retrieval method based on the hardware encryption card of the present invention can realize safe and efficient encrypted full-text search in the full-text retrieval scenario of large-scale encrypted documents.
[0090] In order to further improve the retrieval efficiency, the ciphertext index table is divided into several sub-index tables according to the length of the keywords. Each sub-table is divided into several buckets according to the bucket number. The bucket number is generated based on the symmetric encrypted ciphertext to ensure security while further optimizing the query efficiency.
[0091] Example 2
[0092] The embodiment of the present invention provides a homomorphic encryption ciphertext retrieval method based on a hardware encryption card, which is applied to an encryption server containing a hardware encryption card, and includes:
[0093] Calling the hardware encryption card to symmetric encrypt the plaintext document received from the client to generate a ciphertext document, and homomorphically encrypting the keywords in the plaintext index table received from the client to generate ciphertext keywords, using the ciphertext keywords and the document numbers associated with the ciphertext keywords as the ciphertext index table, and sending the ciphertext document and the ciphertext index table to the ciphertext database in the cloud server for storage; wherein the plaintext document is a plaintext document containing sensitive data uploaded by the data owner through the client; the plaintext index table contains the keywords extracted by the client from the plaintext document and the document numbers associated with the keywords;
[0094] Calling the hardware encryption card to perform homomorphic encryption on the query keyword received from the client to generate a homomorphic ciphertext corresponding to the query keyword, and then sending the homomorphic ciphertext to the cloud server; wherein the query keyword is input by the queryer through the client;
[0095] The hardware encryption card is called to symmetrically decrypt the ciphertext document information list sent by the cloud server, and the decrypted document information list is obtained and sent to the client to realize ciphertext document retrieval; wherein, the ciphertext document information list is obtained based on the document number matching the ciphertext keyword queried from the ciphertext index table when the cloud server successfully matches the homomorphic ciphertext with the ciphertext keyword in the ciphertext index table.
[0096] Furthermore, it also includes:
[0097] Calling the hardware encryption card to symmetrically encrypt the keywords in the plaintext index subtable received from the client, and intercepting the last M bits of the encrypted keywords; wherein the plaintext index subtable is a plurality of plaintext index subtables divided by the client according to the word length of the keywords;
[0098] Divide the keywords with the same last M digits into buckets and number the buckets;
[0099] The plaintext index subtable is also encrypted into a corresponding ciphertext index subtable. The ciphertext index subtable for ciphertext keyword matching is determined according to the word length of the query keyword, and the query keyword is symmetrically encrypted. The bucket number in the ciphertext index subtable is determined according to the last M bits of the symmetrically encrypted query keyword, and the ciphertext keyword matching is selected in the corresponding bucket according to the bucket number.
[0100] Furthermore, it also includes:
[0101] The hardware encryption card is called to symmetrically decrypt the ciphertext document to be decrypted received from the cloud server to obtain a plaintext document, and the plaintext document is sent to the client for the inquirer to view or download; wherein the ciphertext document to be decrypted is determined by the cloud server according to the document number to be decrypted selected by the inquirer from the decrypted document information list sent by the client.
[0102] Furthermore, the ciphertext keyword matching includes:
[0103] The receiving cloud server performs homomorphic subtraction on the homomorphic ciphertext corresponding to the query keyword and the ciphertext keyword to obtain the secret difference; and performs homomorphic decryption on it. If the decryption result is 0, it means that the match is successful; wherein, the ciphertext keyword is the ciphertext keyword in the ciphertext index table, or the ciphertext keyword in the ciphertext index subtable.
[0104] Furthermore, it also includes:
[0105] The hardware encryption card is called to symmetrically decrypt the ciphertext document information list sorted by importance to obtain a decrypted document information list; wherein, the ciphertext document information list sorted by importance is obtained as follows: the cloud server takes the union of the ciphertext document information lists corresponding to each query keyword and merges them into a ciphertext document information list, calculates the TF-IDF vector of the document in the merged ciphertext document information list, and sorts the document information in the merged ciphertext document information list from high to low importance based on the TF-IDF vector; wherein, the TF-IDF vector is used to measure the importance of the keyword to the document.
[0106] For the specific technical solutions related to the client, encryption server and cloud server, please refer to the corresponding description in Example 1, which will not be repeated here.
[0107] Example 3
[0108] An embodiment of the present invention provides an encryption server including a hardware encryption card, including a computer-readable storage medium and a processor;
[0109] Computer-readable storage media for storing executable instructions;
[0110] The processor is used to read the executable instructions stored in the computer-readable storage medium to execute the homomorphic encryption ciphertext retrieval method in Example 2.
[0111] For the relevant specific technical solutions, please refer to the corresponding description in Example 2, which will not be repeated here.
[0112] Example 4
[0113] The embodiment of the present invention provides a homomorphic encryption ciphertext retrieval method based on a hardware encryption card, which is applied to a cloud server and includes:
[0114] The ciphertext document and ciphertext index table sent by the encryption server are stored in the ciphertext database; wherein the ciphertext document is generated by the encryption server containing the hardware encryption card to symmetrically encrypt the plaintext document received from the client, the ciphertext index table includes the ciphertext keyword and the document number associated with the ciphertext keyword, the ciphertext keyword is generated by the encryption server to homomorphically encrypt the keyword in the plaintext index table received from the client, the plaintext document is the plaintext document containing sensitive data uploaded by the data owner through the client; the plaintext index table includes the keyword extracted by the client from the plaintext document and the document number associated with the keyword;
[0115] The homomorphic ciphertext corresponding to the query keyword sent by the encryption server is stored in the ciphertext database; wherein the homomorphic ciphertext is generated by the encryption server calling the hardware encryption card to perform homomorphic encryption on the query keyword received from the client, and the query keyword is input by the queryer through the client;
[0116] The homomorphic ciphertext is matched with the ciphertext keywords in the ciphertext index table. When the match is successful, the document number matching the ciphertext keyword is queried from the ciphertext index table to form a ciphertext document information list, and the ciphertext document information list is sent to the encryption server, so that the encryption server calls the hardware encryption card to symmetrically decrypt the ciphertext document information list, and sends the symmetrically decrypted document information list to the client to realize ciphertext document retrieval.
[0117] For the specific technical solutions related to the client, encryption server and cloud server, please refer to the corresponding description in Example 1, which will not be repeated here.
[0118] Example 5
[0119] An embodiment of the present invention provides a cloud server, including a computer-readable storage medium and a processor;
[0120] Computer-readable storage media for storing executable instructions;
[0121] The processor is used to read the executable instructions stored in the computer-readable storage medium to execute the homomorphic encryption ciphertext retrieval method in Example 4.
[0122] For the relevant specific technical solutions, please refer to the corresponding description in Example 4, which will not be repeated here.
[0123] Example 6
[0124] The embodiment of the present invention provides a homomorphic encryption ciphertext retrieval method based on a hardware encryption card, which is applied to a client and includes:
[0125] Extract keywords from plaintext documents containing sensitive data uploaded by data owners to generate a plaintext index table, and send the plaintext documents and the plaintext index table to an encryption server containing a hardware encryption card, so that the encryption server calls the hardware encryption card to symmetrically encrypt the plaintext documents to generate ciphertext documents, homomorphically encrypt the keywords in the plaintext index table to generate ciphertext keywords, use the ciphertext keywords and the document numbers associated with the ciphertext keywords as the ciphertext index table, and send the ciphertext documents and the ciphertext index table to the ciphertext database in the cloud server for storage; wherein the plaintext index table contains keywords and the document numbers associated with the keywords;
[0126] The query keywords input by the inquirer are sent to the encryption server, and the decrypted document information list corresponding to the query keywords sent by the encryption server is received to realize the retrieval of ciphertext documents; wherein, the document information list is obtained by the encryption server calling the hardware encryption card to symmetrically decrypt the ciphertext document information list, and the ciphertext document information list is obtained by the document number matching the ciphertext keyword queried from the ciphertext index table when the cloud server successfully matches the homomorphic ciphertext with the ciphertext keyword in the ciphertext index table; the homomorphic ciphertext is obtained by the encryption server calling the hardware encryption card to homomorphically encrypt the query keyword.
[0127] For the specific technical solutions related to the client, encryption server and cloud server, please refer to the corresponding description in Example 1, which will not be repeated here.
[0128] Example 7
[0129] An embodiment of the present invention provides a client, including a computer-readable storage medium and a processor;
[0130] Computer-readable storage media for storing executable instructions;
[0131] The processor is used to read the executable instructions stored in the computer-readable storage medium to execute the homomorphic encryption ciphertext retrieval method in Example 6.
[0132] For the relevant specific technical solutions, please refer to the corresponding description in Example 6, which will not be repeated here. For the relevant specific technical solutions of the client, encryption server and cloud server, please refer to the corresponding description in Example 1, which will not be repeated here.
[0133] Example 8
[0134] The embodiment of the present invention provides a homomorphic encryption ciphertext retrieval system based on a hardware encryption card, including a client, an encryption server including a hardware encryption card, and a cloud server;
[0135] Among them, the client is the client in the above embodiment, the encryption server is the encryption server containing a hardware encryption card in the above embodiment; and the cloud server is the cloud server in the above embodiment.
[0136] For the specific technical solutions related to the client, encryption server and cloud server, please refer to the corresponding description in Example 1, which will not be repeated here.
[0137] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A homomorphic encryption ciphertext retrieval method based on a hardware encryption card, characterized in that: Applicable to encryption servers with hardware encryption cards, including: Calling a hardware encryption card to symmetric-encrypt a plaintext document received from a client to generate a ciphertext document, and homomorphically encrypting a keyword in a plaintext index table received from a client to generate a ciphertext keyword, using the ciphertext keyword and a document number associated with the ciphertext keyword as a ciphertext index table, and sending the ciphertext document and the ciphertext index table to a ciphertext database in a cloud server for storage; wherein the plaintext document is a plaintext document containing sensitive data uploaded by a data owner through a client; the plaintext index table contains keywords extracted by the client from the plaintext document and the document number associated with the keyword; After calling the hardware encryption card to perform homomorphic encryption on the query keyword received from the client to generate a homomorphic ciphertext corresponding to the query keyword, the homomorphic ciphertext is sent to the cloud server; wherein the query keyword is input by the inquirer through the client; Call the hardware encryption card to symmetrically decrypt the ciphertext document information list sent by the cloud server, obtain the decrypted document information list, and send it to the client to realize ciphertext document retrieval; wherein, the ciphertext document information list is based on the document number matching the ciphertext keyword queried from the ciphertext index table when the cloud server successfully matches the homomorphic ciphertext with the ciphertext keyword in the ciphertext index table.
2. The homomorphic encryption ciphertext retrieval method according to claim 1, characterized in that: Also includes: Calling the hardware encryption card to symmetrically encrypt the keywords in the plaintext index subtable received from the client, and intercepting the last M bits of the encrypted keywords; wherein the plaintext index subtable is a plurality of plaintext index subtables obtained by dividing the plaintext index table by the client according to the word length of the keywords; Divide the keywords with the same last M digits into buckets, and number the buckets; The plaintext index subtable is also encrypted into a corresponding ciphertext index subtable; the ciphertext index subtable when the ciphertext keyword is matched is determined according to the word length of the query keyword, and the query keyword is symmetrically encrypted, and the bucket number in the ciphertext index subtable is determined according to the last M bits of the query keyword after symmetrical encryption, and the ciphertext keyword is matched in the corresponding bucket according to the bucket number.
3. The homomorphic encryption ciphertext retrieval method according to claim 1 or 2, characterized in that: Also includes: Call the hardware encryption card to symmetrically decrypt the ciphertext document to be decrypted received from the cloud server to obtain a plaintext document, and send the plaintext document to the client for the inquirer to view or download; wherein the ciphertext document to be decrypted is determined by the cloud server according to the document number to be decrypted selected by the inquirer from the decrypted document information list sent by the client.
4. The homomorphic encryption ciphertext retrieval method according to claim 3, characterized in that: The ciphertext keyword matching includes: The receiving cloud server performs homomorphic subtraction of the homomorphic ciphertext corresponding to the query keyword and the ciphertext keyword to obtain the secret difference; and performs homomorphic decryption on it. If the decryption result is 0, it indicates a successful match; wherein the ciphertext keyword is a ciphertext keyword in the ciphertext index table, or a ciphertext keyword in the ciphertext index subtable.
5. The homomorphic encryption ciphertext retrieval method according to claim 1 or 2, characterized in that: Also includes: Calling a hardware encryption card to symmetrically decrypt the importance-sorted ciphertext document information list to obtain a decrypted document information list; wherein, the importance-sorted ciphertext document information list is obtained in the following manner: the cloud server takes the union of the ciphertext document information lists corresponding to each query keyword and merges them into a ciphertext document information list, calculates the TF-IDF vector of the document in the merged ciphertext document information list, and sorts the document information in the merged ciphertext document information list from high to low importance based on the TF-IDF vector; wherein, the TF-IDF vector is used to measure the importance of the keyword to the document.
6. An encryption server containing a hardware encryption card, characterized in that: comprising a computer readable storage medium and a processor; The computer-readable storage medium is used to store executable instructions; The processor is used to read the executable instructions stored in the computer-readable storage medium to execute the homomorphic encryption ciphertext retrieval method described in any one of claims 1-5.
7. A homomorphic encryption ciphertext retrieval method based on a hardware encryption card, characterized in that: Applied to cloud servers, including: The ciphertext document and ciphertext index table sent by the encryption server are stored in the ciphertext database; wherein the ciphertext document is generated by symmetrically encrypting the plaintext document received from the client by the encryption server containing the hardware encryption card, the ciphertext index table includes ciphertext keywords and document numbers associated with the ciphertext keywords, the ciphertext keywords are generated by homomorphically encrypting the keywords in the plaintext index table received from the client by the encryption server, and the plaintext document is a plaintext document containing sensitive data uploaded by the data owner through the client; the plaintext index table includes keywords extracted by the client from the plaintext document and the document numbers associated with the keywords; The homomorphic ciphertext corresponding to the query keyword sent by the encryption server is stored in the ciphertext database; wherein the homomorphic ciphertext is generated by the encryption server calling the hardware encryption card to perform homomorphic encryption on the query keyword received from the client, and the query keyword is input by the inquirer through the client; The homomorphic ciphertext is matched with the ciphertext keywords in the ciphertext index table. When the match is successful, the document number matching the ciphertext keyword is queried from the ciphertext index table to form a ciphertext document information list, and the ciphertext document information list is sent to the encryption server, so that the encryption server calls the hardware encryption card to symmetrically decrypt the ciphertext document information list, and sends the symmetrically decrypted document information list to the client to realize ciphertext document retrieval.
8. A cloud server, characterized in that: comprising a computer readable storage medium and a processor; The computer-readable storage medium is used to store executable instructions; The processor is used to read the executable instructions stored in the computer-readable storage medium to execute the homomorphic encryption ciphertext retrieval method described in claim 7.
9. A homomorphic encryption ciphertext retrieval method based on a hardware encryption card, characterized in that: Applied to the client, including: Extract keywords from a plaintext document containing sensitive data uploaded by a data owner to generate a plaintext index table, and send the plaintext document and the plaintext index table to an encryption server containing a hardware encryption card, so that the encryption server calls the hardware encryption card to symmetrically encrypt the plaintext document to generate a ciphertext document, homomorphically encrypt the keywords in the plaintext index table to generate ciphertext keywords, use the ciphertext keywords and the document numbers associated with the ciphertext keywords as the ciphertext index table, and send the ciphertext document and the ciphertext index table to a ciphertext database in a cloud server for storage; wherein the plaintext index table contains the keywords and the document numbers associated with the keywords; The query keyword input by the inquirer is sent to the encryption server, and the decrypted document information list corresponding to the query keyword sent by the encryption server is received to realize ciphertext document retrieval; wherein, the document information list is obtained by the encryption server calling the hardware encryption card to symmetrically decrypt the ciphertext document information list, and the ciphertext document information list is obtained by the document number matching the ciphertext keyword queried from the ciphertext index table when the cloud server successfully matches the homomorphic ciphertext with the ciphertext keyword in the ciphertext index table; the homomorphic ciphertext is obtained by the encryption server calling the hardware encryption card to homomorphically encrypt the query keyword.
10. A client, characterized in that: comprising a computer readable storage medium and a processor; The computer-readable storage medium is used to store executable instructions; The processor is used to read the executable instructions stored in the computer-readable storage medium to execute the homomorphic encryption ciphertext retrieval method described in claim 9.
Citation Information
Patent Citations
Keyword hiding and tracing query method and device based on homomorphic encryption
CN116756185A
Private information retrieval with probabilistic batch codes
US20190325082A1
Cited By
Fully homomorphic encryption method, system, device and medium suitable for ciphertext encryption
CN119788264A
Ciphertext retrieval method and system based on homomorphic encryption
CN121009583A