Data encryption management method and system
Through a combination of asymmetric and symmetric encryption, the data is processed and encrypted, and the cloud storage and matching word segmentation ciphertexts are used to solve the problem of low data fuzzy retrieval efficiency in the existing technology, and efficient and secure data retrieval is achieved and storage.
Patent Information
- Application Number
- CN202410930253.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-11-12
AI Technical Summary
The prior art is difficult to efficiently perform data fuzzy search without breaking data encryption, resulting in inefficient search efficiency or index failure.
A combination of asymmetric encryption and symmetric encryption is used to process and encrypt the stored data word segmentation, and efficient fuzzy retrieval of data is achieved through cloud storage and matching word segmentation ciphertexts, and query data is obtained during decryption.
It improves the data fuzzy retrieval performance of the database, maintains data confidentiality and security, reduces the intrusion of services, realizes the independence of custom encryption algorithms, and does not rely on the database application system.
Smart Images

Figure CN118944913A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data security technology, and in particular to a data encryption management method and a data encryption management system. Background Art
[0002] Unencrypted data may lead to problems and risks such as leakage, tampering, violation of regulations, and loss of trust. Unencrypted data can be easily stolen or tampered with during transmission or storage, resulting in the exposure of confidential information and causing serious financial and reputational losses to companies or individuals. For some industries or fields (such as finance, medical care, government agencies, etc.), unencrypted data may also violate relevant regulations and legal provisions, increasing the risk of adverse effects and legal risks.
[0003] Therefore, in order to avoid these potential problems and risks, data must be encrypted. Encryption can ensure that data is not stolen or tampered with during transmission and storage, while helping enterprises or individuals comply with relevant laws and regulations, further improving data security and protecting confidential information. In the current information age, encryption technology has become one of the important means to ensure information security. Data encryption is not only a necessary condition for enterprise information security management, but also an inevitable trend of social informatization development.
[0004] Although data encryption is one of the basic security measures, it brings difficulty and cost to data retrieval, because encrypted data cannot be directly matched and queried, and must be decrypted before searching. How to efficiently perform fuzzy data retrieval without destroying data encryption has become an urgent problem to be solved. There are currently two solutions:
[0005] 1) Use the database's own encryption option to implement an encryption and decryption algorithm that is consistent with the program, modify the fuzzy query conditions, and use the database encryption and decryption function to decrypt first and then fuzzy search. The advantages of this are low implementation cost and low development and use cost. It only requires a slight modification of the previous fuzzy search to achieve it, but the disadvantages are also obvious. The encrypted data cannot hit the database index, thereby greatly reducing the retrieval efficiency. Some databases may not even be able to guarantee an encryption and decryption algorithm that is consistent with the program implementation.
[0006] 2) Perform word segmentation and combination on the ciphertext data, encrypt the result set of word segmentation and combination respectively, and then store it in the extended column, and use fuzzy query when querying. However, there will be a large number of repeated word segments in the extended column of the table, and it is difficult to avoid index failure.
[0007] In view of the current problem that it is impossible to efficiently perform data fuzzy retrieval without destroying data encryption, a new data encryption management solution needs to be proposed. Summary of the invention
[0008] The purpose of the embodiments of the present invention is to provide a data encryption management method and system to at least solve the problem that it is currently impossible to efficiently perform data fuzzy retrieval without destroying data encryption.
[0009] In order to achieve the above-mentioned purpose, the first aspect of the present invention provides a data encryption management method, which is executed by a user end, and the method includes: collecting data to be stored, performing word segmentation processing on the data to be stored, and performing asymmetric encryption on the data to be stored after the word segmentation processing to obtain encrypted data; performing symmetric encryption on multiple word segmentation items obtained by the word segmentation processing to obtain word segmentation item ciphertext; sending the encrypted data and the word segmentation item ciphertext to the cloud for the cloud to perform data association storage; initiating a query request for the cloud to match the word segmentation item ciphertext based on the query word segmentation item in the query request, and recovering the encrypted data corresponding to the word segmentation item ciphertext matched by the cloud; decrypting the recovered encrypted data to obtain query data.
[0010] Optionally, performing word segmentation processing on the data to be stored includes: based on a pre-selected word segmentation tool, performing word segmentation tool initialization, and performing word segmentation tool loading after completing the initialization; performing word segmentation processing on the plaintext data of the data to be stored based on the word segmentation tool to obtain multiple word segmentation items.
[0011] Optionally, the performing asymmetric encryption on the data to be stored after the word segmentation processing to obtain encrypted data includes: performing data encryption on the data to be stored after the word segmentation processing based on the public key to obtain encrypted data; storing the encrypted data in a ciphertext table and obtaining a data ciphertext ID; and sending the private key and the data ciphertext ID to the cloud.
[0012] Optionally, performing symmetric encryption on the multiple word segmentation items obtained by the word segmentation processing to obtain the word segmentation item ciphertext includes: generating a symmetric encryption key, and performing symmetric encryption on the multiple word segmentation items obtained by the word segmentation processing based on the symmetric encryption key to obtain the word segmentation item ciphertext; and sending the symmetric encryption key and the word segmentation item ciphertext to the cloud.
[0013] Optionally, the cloud-based data association storage includes: the cloud-based system is configured to: determine whether the segmentation item ciphertext already exists in an existing segmentation item ciphertext table; if so, perform the corresponding segmentation item ciphertext and data ciphertext ID association storage; if not, store the corresponding segmentation item ciphertext in the existing segmentation item ciphertext table, and perform the corresponding segmentation item ciphertext and data ciphertext ID association storage.
[0014] Optionally, the initiating of a query request for the cloud to match the query segmentation item ciphertext based on the query segmentation item in the query request, and recovering the encrypted data corresponding to the segmentation item ciphertext matched by the cloud, includes: the cloud is configured to: obtain a plaintext segmentation item based on the query request, and encrypt the plaintext segmentation item based on the symmetric encryption key uploaded by the user end to obtain the query segmentation item ciphertext; determine whether the query segmentation item ciphertext exists in an existing segmentation item ciphertext table; if not, determine that there is no corresponding query data, and feed back a query failure signal to the user end; if so, feed back a ciphertext table of the data ciphertext ID corresponding to the matched segmentation item ciphertext to the user end.
[0015] Optionally, decrypting the recovered encrypted data to obtain query data includes: obtaining a corresponding private key from the cloud based on the data ciphertext ID of the fed-back ciphertext table; decrypting the ciphertext table based on the private key to obtain a plaintext list, which is pushed to the user as query data.
[0016] A second aspect of the present invention provides a user terminal, which includes: a collection unit, which is used to collect data to be stored, perform word segmentation processing on the data to be stored, and perform asymmetric encryption on the data to be stored after the word segmentation processing to obtain encrypted data; a word segmentation encryption unit, which is used to perform symmetric encryption on multiple word segmentation items obtained by the word segmentation processing to obtain word segmentation item ciphertext; a transmission unit, which is used to send the encrypted data and the word segmentation item ciphertext to the cloud for the cloud to perform data association storage; a request unit, which is used to initiate a query request for the cloud to perform word segmentation item ciphertext matching based on the query word segmentation items in the query request, and recover the encrypted data corresponding to the word segmentation item ciphertext matched by the cloud; a decryption unit, which is used to decrypt the recovered encrypted data to obtain query data.
[0017] A third aspect of the present invention provides a data encryption management system, characterized in that the system includes the above-mentioned user terminal and a cloud terminal that is communicatively connected to the user terminal.
[0018] A third aspect of the present invention provides a computer-readable storage medium, on which instructions are stored, which, when executed on a computer, enable the computer to execute the above-mentioned data encryption management method.
[0019] Through the above technical solution, by encrypting and storing data and processing word segmentation, the data fuzzy retrieval performance of the database is improved without affecting business development and the use of core database features. At the same time, the original text content will not be exposed, with a certain degree of confidentiality and security. In addition, the encryption algorithm can be customized during storage, which is completely independent of the database application system and can achieve data encryption without changing the database application system. Finally, the focus of solving the fuzzy retrieval problem is placed on the storage level, which reduces the intrusion into the business and makes business development simpler and more efficient.
[0020] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0022] Figure 1 is a flowchart of the steps of a data encryption management method provided by an embodiment of the present invention;
[0023] Figure 2 It is a structural diagram of a user terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0024] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.
[0025] Figure 1 FIG. 1 is a flow chart of a data encryption management method provided by an embodiment of the present invention. Figure 1 As shown, an embodiment of the present invention provides a data encryption management method, the method comprising:
[0026] Step S10: Collect data to be stored, perform word segmentation processing on the data to be stored, and perform asymmetric encryption on the data to be stored after the word segmentation processing to obtain encrypted data.
[0027] Specifically, based on the pre-selected word segmentation tool, the word segmentation tool is initialized, and after the initialization is completed, the word segmentation tool is loaded; based on the word segmentation tool, word segmentation processing is performed on the plaintext data of the data to be stored to obtain multiple word segmentation items.
[0028] In an embodiment of the present invention, the selection of a word segmentation tool is the basis of the entire word segmentation process. Different word segmentation tools have different word segmentation algorithms and effects. Common word segmentation tools include Jieba, Ansj, THULAC, etc. These tools have their own advantages and disadvantages when processing Chinese text. For example, the Jieba word segmentation tool uses a dictionary word segmentation algorithm based on a Trie tree structure, supports three modes: precise mode, full mode, and search engine mode, and is suitable for different application scenarios; while Ansj is based on a deep learning model and has higher word segmentation accuracy and efficiency. The scheme of the present invention can customize the word segmentation tool based on user needs. After selecting a suitable word segmentation tool, initialization is required. The initialization process includes loading a word segmentation dictionary, configuring word segmentation parameters, etc. This process is the key to ensuring that the word segmentation tool can run correctly. For example, in the Jieba word segmentation tool, initialization includes loading a user-defined dictionary to ensure that the word segmentation result can contain domain-specific nouns and new words; in the Ansj word segmentation tool, initialization may involve loading a model file and configuring a word segmentation strategy.
[0029] Furthermore, through word segmentation, unstructured text data can be converted into structured data. This structured data is convenient for subsequent database storage and indexing, and improves the efficiency of data retrieval. For example, in a search engine, structured word segmentation data can speed up the keyword retrieval and matching process.
[0030] Preferably, the performing asymmetric encryption on the data to be stored after the word segmentation processing to obtain encrypted data includes: performing data encryption on the data to be stored after the word segmentation processing based on the public key to obtain encrypted data; storing the encrypted data in a ciphertext table and obtaining a data ciphertext ID; and sending the private key and the data ciphertext ID to the cloud.
[0031] In an embodiment of the present invention, asymmetric encryption (also known as public key encryption) is an encryption technology that uses a pair of keys: a public key and a private key. The public key is used to encrypt data, while the private key is used to decrypt data. A major advantage of this technology is that it can ensure the confidentiality and security of data, because even if the public key is public, only those who have the corresponding private key can decrypt the data. After the word segmentation process is completed, the data is encrypted using the public key. The public key can be publicly released and anyone can use it to encrypt data, but only those who have the corresponding private key can decrypt the data. A key advantage of asymmetric encryption is that even if the encrypted data is intercepted, it cannot be decrypted unless the private key is possessed. The encrypted data is stored in a ciphertext table. The ciphertext table is a database table specifically used to store encrypted data. Each record includes encrypted data and a unique ciphertext ID. The ciphertext ID is an identifier used to identify each encrypted data record. For secure management, the private key and ciphertext ID need to be sent to the cloud for storage and management. The cloud can provide higher security and availability to ensure that the private key is not leaked or lost. When the data needs to be decrypted, the corresponding encrypted data can be found through the ciphertext ID and decrypted using the private key.
[0032] Based on the scheme of the present invention, by using asymmetric encryption, the security of data during storage and transmission can be ensured. Even if an attacker intercepts the encrypted data, it cannot be decrypted unless the corresponding private key is possessed. Asymmetric encryption can not only protect the confidentiality of the data, but also ensure the integrity of the data and prevent the data from being tampered with during transmission and storage.
[0033] Step S20: performing symmetric encryption on the multiple segmentation items obtained by the segmentation process to obtain segmentation item ciphertexts.
[0034] Specifically, a symmetric encryption key is generated, and symmetric encryption is performed on multiple segmentation items obtained by the segmentation processing based on the symmetric encryption key to obtain the segmentation item ciphertext; the symmetric encryption key and the segmentation item ciphertext are sent to the cloud.
[0035] In the embodiment of the present invention, symmetric encryption is a technology widely used in modern information security, which uses a single key to perform encryption and decryption operations. The process of symmetric encryption includes three main steps: key generation, encryption and decryption.
[0036] Furthermore, a symmetric encryption key needs to be generated. The most commonly used symmetric encryption algorithms include Advanced Encryption Standard (AES), Data Encryption Standard (DES), Triple Data Encryption Standard (3DES), etc. Here, AES is taken as an example to introduce the key generation process. AES supports 128-bit, 192-bit, and 256-bit key lengths. You can use the Cryptography library in Python to generate a 256-bit AES key. Perform symmetric encryption on multiple segmentation items obtained by word segmentation. Word segmentation is a common technique in natural language processing (NLP), which splits text into independent words or phrases. These segmentation items can be words, phrases, or other text fragments. Send the symmetric encryption key and the segmentation item ciphertext to the cloud. Cloud storage uses AWS S3, Google Cloud Storage, or other cloud storage services. Before sending, in order to ensure the security of the data, use HTTPS for transmission.
[0037] Step S30: Send the encrypted data and the ciphertext of the word segmentation item to the cloud for the cloud to perform data association storage.
[0038] Specifically, the cloud determines whether the segmentation item ciphertext already exists in the existing segmentation item ciphertext table; if so, the corresponding segmentation item ciphertext and data ciphertext ID are associated and stored; if not, the corresponding segmentation item ciphertext is stored in the existing segmentation item ciphertext table, and the corresponding segmentation item ciphertext and data ciphertext ID are associated and stored.
[0039] In an embodiment of the present invention, in the cloud data processing process, the segmentation item ciphertext is a ciphertext formed by segmenting and encrypting sensitive data. In order to ensure the security of data, these segmentation item ciphertexts need to be effectively managed and stored. Specifically, when a new segmentation item ciphertext is generated, the system first needs to determine whether the segmentation item ciphertext already exists in the existing segmentation item ciphertext table. The system will first query the existing segmentation item ciphertext table to determine whether the segmentation item ciphertext already exists. This step is implemented by hashing and encryption algorithms to ensure the efficiency and security of the query process. According to the query results, the system determines whether the segmentation item ciphertext already exists in the table. If it exists, it means that the segmentation item ciphertext has been processed and stored before. If the segmentation item ciphertext exists, the system will perform the corresponding segmentation item ciphertext and data ciphertext ID association storage operation. This means that the system will associate the segmentation item ciphertext with the new data ciphertext ID so that the relevant data can be quickly located and retrieved in the subsequent query and processing process. If the ciphertext of the word segment item does not exist, the system will store the ciphertext of the word segment item in the existing ciphertext table of the word segment item. Subsequently, the system also performs the associated storage operation of the corresponding ciphertext of the word segment item and the data ciphertext ID to ensure the integrity and traceability of the data.
[0040] Based on the scheme of the present invention, by judging whether the ciphertext of the segmentation item exists, the system can avoid repeated storage and processing of the same ciphertext of the segmentation item. This not only reduces the storage space occupied, but also improves the efficiency of data processing. Especially in large-scale data processing environments, this mechanism can significantly reduce the load of the system. During data transmission and storage, all segmentation items and data ciphertexts are encrypted to ensure data security. Even when stored and processed in the cloud, sensitive data will not be leaked or tampered with. The process of judging whether the ciphertext of the segmentation item exists is actually a data deduplication operation. Through this mechanism, the system can avoid storing redundant data, thereby saving storage resources. This is of great significance for cloud computing platforms that process massive data.
[0041] Step S40: Initiate a query request so that the cloud can perform ciphertext matching of the query ciphertext items based on the query ciphertext items in the query request, and recover the encrypted data corresponding to the ciphertext items matched by the cloud.
[0042] Specifically, the cloud obtains a plaintext word segmentation item based on the query request, and encrypts the plaintext word segmentation item based on the symmetric encryption key uploaded by the user end to obtain a query word segmentation item ciphertext; determines whether the query word segmentation item ciphertext exists in an existing word segmentation item ciphertext table; if not, determines that there is no corresponding query data, and feeds back a query failure signal to the user end; if so, feeds back a ciphertext table of the data ciphertext ID corresponding to the matching word segmentation item ciphertext to the user end.
[0043] In an embodiment of the present invention, the user terminal initiates a query request, and the system obtains the corresponding plaintext segmentation items according to the request. These segmentation items are keywords or phrases extracted from the user's query conditions and are used to locate and retrieve relevant data. The system uses a pre-generated symmetric encryption key to encrypt the plaintext segmentation items and generate query segmentation item ciphertexts. This process ensures the security of the query segmentation items during transmission and processing, and prevents the plaintext information from being intercepted or tampered with. The system compares the generated query segmentation item ciphertext with the stored segmentation item ciphertext table to determine whether the ciphertext exists in the table. If the query segmentation item ciphertext does not exist in the stored segmentation item ciphertext table, the system determines that there is no corresponding query data, and feeds back a query failure signal to the user terminal. If the query segmentation item ciphertext exists in the stored segmentation item ciphertext table, the system feeds back the ciphertext table of the data ciphertext ID corresponding to the matching segmentation item ciphertext to the user terminal so that the user can decrypt and obtain the query data.
[0044] In an embodiment of the present invention, through symmetric encryption, the query segmentation item is always in an encrypted state during the transmission and processing process, which effectively prevents the leakage and tampering of plaintext data and ensures the security of data query. By judging whether the query segmentation item ciphertext exists, the system can quickly determine whether the corresponding data exists, thereby improving the query efficiency. Especially in a large-scale data processing environment, this mechanism can significantly reduce the query time and improve the system response speed. The system only stores and processes the associated information of the segmentation item ciphertext and the data ciphertext ID, avoiding the storage of a large amount of redundant data. This mechanism not only saves storage space, but also reduces the processing burden of the system.
[0045] Step S50: decrypt the recovered encrypted data to obtain query data.
[0046] Specifically, based on the data ciphertext ID of the fed-back ciphertext table, a corresponding private key is obtained from the cloud; based on the private key, the ciphertext table is decrypted to obtain a plaintext list, which is pushed to the user as query data.
[0047] In the embodiment of the present invention, during the data query process, after the user submits the query request and goes through multiple encryption and verification steps, the system will eventually feedback a set of data ciphertext IDs of the ciphertext table to the user. Next, the user needs to obtain the corresponding private key from the cloud, and decrypt the ciphertext table based on the private key to obtain the required plaintext list. Specifically including:
[0048] 1) Obtaining data ciphertext ID: When the query segmentation item ciphertext exists, the system will feed back the ciphertext table of data ciphertext ID corresponding to the matching segmentation item ciphertext to the user end. These data ciphertext IDs are unique identifiers in an encrypted state and are used to locate and retrieve relevant data.
[0049] 2) Obtaining the private key: The client obtains the corresponding private key from the cloud based on the data ciphertext ID in the feedback ciphertext table. The private key is usually stored in a secure key management system and can only be accessed and used by authorized users. This step ensures that only legitimate users can decrypt and access sensitive data.
[0050] 3) Decryption of the ciphertext table: The client uses the obtained private key to decrypt the data ciphertext ID in the ciphertext table. The decryption process is implemented through advanced encryption algorithms (such as RSA or AES) to ensure that the decrypted data is the original plaintext data.
[0051] 4) Obtaining a plaintext list: After decryption is completed, the client obtains a list of plaintext data. These plaintext data are the results of the user's query and can be directly used for display or further processing.
[0052] 5) Push query data: Finally, the system pushes the decrypted plaintext list to the user as query data, completing the entire data query and processing process.
[0053] Based on the scheme of the present invention, through a multi-level encryption and decryption mechanism, data is always encrypted during transmission and storage, effectively preventing data leakage and tampering. Sensitive data can be fully protected even when stored and processed in the cloud. The system quickly locates and retrieves relevant data through the data ciphertext ID of the ciphertext table, and obtains the plaintext list through private key decryption. This mechanism greatly improves the efficiency of data query and processing, especially in large-scale data processing environments, can significantly shorten query time and improve system response speed.
[0054] Figure 2 Schematic diagram of the structure of a user terminal provided by an embodiment of the present invention. Figure 2 As shown, an embodiment of the present invention provides a user terminal, which includes: a collection unit, which is used to collect data to be stored, perform word segmentation processing on the data to be stored, and perform asymmetric encryption on the data to be stored after the word segmentation processing to obtain encrypted data.
[0055] Specifically, based on the pre-selected word segmentation tool, the word segmentation tool is initialized, and after the initialization is completed, the word segmentation tool is loaded; based on the word segmentation tool, word segmentation processing is performed on the plaintext data of the data to be stored to obtain multiple word segmentation items.
[0056] In an embodiment of the present invention, the selection of a word segmentation tool is the basis of the entire word segmentation process. Different word segmentation tools have different word segmentation algorithms and effects. Common word segmentation tools include Jieba, Ansj, THULAC, etc. These tools have their own advantages and disadvantages when processing Chinese text. For example, the Jieba word segmentation tool uses a dictionary word segmentation algorithm based on a Trie tree structure, supports three modes: precise mode, full mode, and search engine mode, and is suitable for different application scenarios; while Ansj is based on a deep learning model and has higher word segmentation accuracy and efficiency. The scheme of the present invention can customize the word segmentation tool based on user needs. After selecting a suitable word segmentation tool, initialization is required. The initialization process includes loading a word segmentation dictionary, configuring word segmentation parameters, etc. This process is the key to ensuring that the word segmentation tool can run correctly. For example, in the Jieba word segmentation tool, initialization includes loading a user-defined dictionary to ensure that the word segmentation result can contain domain-specific nouns and new words; in the Ansj word segmentation tool, initialization may involve loading a model file and configuring a word segmentation strategy.
[0057] Furthermore, through word segmentation, unstructured text data can be converted into structured data. This structured data is convenient for subsequent database storage and indexing, and improves the efficiency of data retrieval. For example, in a search engine, structured word segmentation data can speed up the keyword retrieval and matching process.
[0058] Preferably, the performing asymmetric encryption on the data to be stored after the word segmentation processing to obtain encrypted data includes: performing data encryption on the data to be stored after the word segmentation processing based on the public key to obtain encrypted data; storing the encrypted data in a ciphertext table and obtaining a data ciphertext ID; and sending the private key and the data ciphertext ID to the cloud.
[0059] In an embodiment of the present invention, asymmetric encryption (also known as public key encryption) is an encryption technology that uses a pair of keys: a public key and a private key. The public key is used to encrypt data, while the private key is used to decrypt data. A major advantage of this technology is that it can ensure the confidentiality and security of data, because even if the public key is public, only those who have the corresponding private key can decrypt the data. After the word segmentation process is completed, the data is encrypted using the public key. The public key can be publicly released and anyone can use it to encrypt data, but only those who have the corresponding private key can decrypt the data. A key advantage of asymmetric encryption is that even if the encrypted data is intercepted, it cannot be decrypted unless the private key is possessed. The encrypted data is stored in a ciphertext table. The ciphertext table is a database table specifically used to store encrypted data. Each record includes encrypted data and a unique ciphertext ID. The ciphertext ID is an identifier used to identify each encrypted data record. For secure management, the private key and ciphertext ID need to be sent to the cloud for storage and management. The cloud can provide higher security and availability to ensure that the private key is not leaked or lost. When the data needs to be decrypted, the corresponding encrypted data can be found through the ciphertext ID and decrypted using the private key.
[0060] Based on the scheme of the present invention, by using asymmetric encryption, the security of data during storage and transmission can be ensured. Even if an attacker intercepts the encrypted data, it cannot be decrypted unless the corresponding private key is possessed. Asymmetric encryption can not only protect the confidentiality of the data, but also ensure the integrity of the data and prevent the data from being tampered with during transmission and storage.
[0061] The word segmentation encryption unit is used to perform symmetric encryption on multiple word segmentation items obtained by word segmentation processing to obtain word segmentation item ciphertext.
[0062] Specifically, a symmetric encryption key is generated, and symmetric encryption is performed on multiple segmentation items obtained by the segmentation processing based on the symmetric encryption key to obtain the segmentation item ciphertext; the symmetric encryption key and the segmentation item ciphertext are sent to the cloud.
[0063] In the embodiment of the present invention, symmetric encryption is a technology widely used in modern information security, which uses a single key to perform encryption and decryption operations. The process of symmetric encryption includes three main steps: key generation, encryption and decryption.
[0064] Furthermore, a symmetric encryption key needs to be generated. The most commonly used symmetric encryption algorithms include Advanced Encryption Standard (AES), Data Encryption Standard (DES), Triple Data Encryption Standard (3DES), etc. Here, AES is taken as an example to introduce the key generation process. AES supports 128-bit, 192-bit, and 256-bit key lengths. You can use the Cryptography library in Python to generate a 256-bit AES key. Perform symmetric encryption on multiple segmentation items obtained by word segmentation. Word segmentation is a common technique in natural language processing (NLP), which splits text into independent words or phrases. These segmentation items can be words, phrases, or other text fragments. Send the symmetric encryption key and the segmentation item ciphertext to the cloud. Cloud storage uses AWS S3, Google Cloud Storage, or other cloud storage services. Before sending, in order to ensure the security of the data, use HTTPS for transmission.
[0065] The transmission unit is used to send the encrypted data and the ciphertext of the word segmentation item to the cloud so that the cloud can perform data association storage.
[0066] Specifically, the cloud determines whether the segmentation item ciphertext already exists in the existing segmentation item ciphertext table; if so, the corresponding segmentation item ciphertext and data ciphertext ID are associated and stored; if not, the corresponding segmentation item ciphertext is stored in the existing segmentation item ciphertext table, and the corresponding segmentation item ciphertext and data ciphertext ID are associated and stored.
[0067] In an embodiment of the present invention, in the cloud data processing process, the segmentation item ciphertext is a ciphertext formed by segmenting and encrypting sensitive data. In order to ensure the security of data, these segmentation item ciphertexts need to be effectively managed and stored. Specifically, when a new segmentation item ciphertext is generated, the system first needs to determine whether the segmentation item ciphertext already exists in the existing segmentation item ciphertext table. The system will first query the existing segmentation item ciphertext table to determine whether the segmentation item ciphertext already exists. This step is implemented by hashing and encryption algorithms to ensure the efficiency and security of the query process. According to the query results, the system determines whether the segmentation item ciphertext already exists in the table. If it exists, it means that the segmentation item ciphertext has been processed and stored before. If the segmentation item ciphertext exists, the system will perform the corresponding segmentation item ciphertext and data ciphertext ID association storage operation. This means that the system will associate the segmentation item ciphertext with the new data ciphertext ID so that the relevant data can be quickly located and retrieved in the subsequent query and processing process. If the ciphertext of the word segment item does not exist, the system will store the ciphertext of the word segment item in the existing ciphertext table of the word segment item. Subsequently, the system also performs the associated storage operation of the corresponding ciphertext of the word segment item and the data ciphertext ID to ensure the integrity and traceability of the data.
[0068] Based on the scheme of the present invention, by judging whether the ciphertext of the segmentation item exists, the system can avoid repeated storage and processing of the same ciphertext of the segmentation item. This not only reduces the storage space occupied, but also improves the efficiency of data processing. Especially in large-scale data processing environments, this mechanism can significantly reduce the load of the system. During data transmission and storage, all segmentation items and data ciphertexts are encrypted to ensure data security. Even when stored and processed in the cloud, sensitive data will not be leaked or tampered with. The process of judging whether the ciphertext of the segmentation item exists is actually a data deduplication operation. Through this mechanism, the system can avoid storing redundant data, thereby saving storage resources. This is of great significance for cloud computing platforms that process massive data.
[0069] The request unit is used to initiate a query request so that the cloud can perform ciphertext matching of the query ciphertext items based on the query ciphertext items in the query request, and recover the encrypted data corresponding to the ciphertext items matched by the cloud.
[0070] Specifically, the cloud obtains a plaintext word segmentation item based on the query request, and encrypts the plaintext word segmentation item based on the symmetric encryption key uploaded by the user end to obtain a query word segmentation item ciphertext; determines whether the query word segmentation item ciphertext exists in an existing word segmentation item ciphertext table; if not, determines that there is no corresponding query data, and feeds back a query failure signal to the user end; if so, feeds back a ciphertext table of the data ciphertext ID corresponding to the matching word segmentation item ciphertext to the user end.
[0071] In an embodiment of the present invention, the user terminal initiates a query request, and the system obtains the corresponding plaintext segmentation items according to the request. These segmentation items are keywords or phrases extracted from the user's query conditions and are used to locate and retrieve relevant data. The system uses a pre-generated symmetric encryption key to encrypt the plaintext segmentation items and generate query segmentation item ciphertexts. This process ensures the security of the query segmentation items during transmission and processing, and prevents the plaintext information from being intercepted or tampered with. The system compares the generated query segmentation item ciphertext with the stored segmentation item ciphertext table to determine whether the ciphertext exists in the table. If the query segmentation item ciphertext does not exist in the stored segmentation item ciphertext table, the system determines that there is no corresponding query data, and feeds back a query failure signal to the user terminal. If the query segmentation item ciphertext exists in the stored segmentation item ciphertext table, the system feeds back the ciphertext table of the data ciphertext ID corresponding to the matching segmentation item ciphertext to the user terminal so that the user can decrypt and obtain the query data.
[0072] In an embodiment of the present invention, through symmetric encryption, the query segmentation item is always in an encrypted state during the transmission and processing process, which effectively prevents the leakage and tampering of plaintext data and ensures the security of data query. By judging whether the query segmentation item ciphertext exists, the system can quickly determine whether the corresponding data exists, thereby improving the query efficiency. Especially in a large-scale data processing environment, this mechanism can significantly reduce the query time and improve the system response speed. The system only stores and processes the associated information of the segmentation item ciphertext and the data ciphertext ID, avoiding the storage of a large amount of redundant data. This mechanism not only saves storage space, but also reduces the processing burden of the system.
[0073] The decryption unit is used to decrypt the recovered encrypted data to obtain query data.
[0074] Specifically, based on the data ciphertext ID of the fed-back ciphertext table, a corresponding private key is obtained from the cloud; based on the private key, the ciphertext table is decrypted to obtain a plaintext list, which is pushed to the user as query data.
[0075] In the embodiment of the present invention, during the data query process, after the user submits the query request and goes through multiple encryption and verification steps, the system will eventually feedback a set of data ciphertext IDs of the ciphertext table to the user. Next, the user needs to obtain the corresponding private key from the cloud, and decrypt the ciphertext table based on the private key to obtain the required plaintext list.
[0076] An embodiment of the present invention further provides a data encryption management system, which includes the above-mentioned user terminal and a cloud terminal in communication with the user terminal.
[0077] The embodiment of the present invention further provides a computer-readable storage medium, on which instructions are stored, which, when executed on a computer, enable the computer to execute the above-mentioned data encryption management method.
[0078] Those skilled in the art will understand that all or part of the steps in the method for implementing the above-mentioned embodiments can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions for making a single-chip microcomputer, a chip or a processor (processor) perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0079] The optional embodiments of the present invention are described in detail above in conjunction with the accompanying drawings. However, the embodiments of the present invention are not limited to the specific details in the above embodiments. Within the technical concept of the embodiments of the present invention, the technical scheme of the embodiments of the present invention can be subjected to a variety of simple modifications, and these simple modifications all belong to the protection scope of the embodiments of the present invention. It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the embodiments of the present invention will not further describe various possible combinations.
[0080] In addition, various embodiments of the present invention may be arbitrarily combined, and as long as they do not violate the concept of the embodiments of the present invention, they should also be regarded as the contents disclosed in the embodiments of the present invention.
Claims
1. A data encryption management method, characterized in that: The method is executed by a user terminal, and the method includes: Collecting data to be stored, performing word segmentation processing on the data to be stored, and performing asymmetric encryption on the data to be stored after the word segmentation processing is completed to obtain encrypted data; Perform symmetric encryption on multiple segmentation items obtained by the segmentation process to obtain segmentation item ciphertexts; Sending the encrypted data and the ciphertext of the segmentation item to the cloud for the cloud to perform data association storage; Initiate a query request so that the cloud can perform ciphertext matching of the query ciphertext items based on the query ciphertext items in the query request, and recover the encrypted data corresponding to the ciphertext items matched by the cloud; The recovered encrypted data is decrypted to obtain the query data.
2. The method according to claim 1, characterized in that The performing word segmentation processing on the data to be stored includes: Based on the pre-selected word segmentation tool, the word segmentation tool is initialized, and after the initialization is completed, the word segmentation tool is loaded; Based on the word segmentation tool, word segmentation processing is performed on the plaintext data of the data to be stored to obtain multiple word segmentation items.
3. The method according to claim 1, characterized in that The step of performing asymmetric encryption on the data to be stored after the word segmentation process is completed to obtain encrypted data includes: Performing data encryption on the data to be stored after word segmentation based on the public key to obtain encrypted data; Storing the encrypted data in a ciphertext table and obtaining a data ciphertext ID; The private key and the data ciphertext ID are sent to the cloud.
4. The method according to claim 3, characterized in that The step of performing symmetric encryption on the multiple segmentation items obtained by the segmentation process to obtain the segmentation item ciphertexts includes: Generate a symmetric encryption key, and perform symmetric encryption on multiple segmentation items obtained by the segmentation process based on the symmetric encryption key to obtain segmentation item ciphertexts; The symmetric encryption key and the segmentation item ciphertext are sent to the cloud.
5. The method according to claim 4, characterized in that The method for performing data association storage in the cloud includes: The cloud is configured as follows: Determine whether the segmentation item ciphertext already exists in the existing segmentation item ciphertext table; If it exists, the corresponding word segmentation item ciphertext and data ciphertext ID are associated and stored; If it does not exist, the corresponding segmentation item ciphertext is stored in the stored segmentation item ciphertext table, and the corresponding segmentation item ciphertext and data ciphertext ID are associated and stored.
6. The method according to claim 1, characterized in that The initiating of a query request for the cloud to perform a ciphertext match of a query term based on the query term in the query request, and recovering encrypted data corresponding to the ciphertext of the term matched by the cloud, includes: The cloud is configured as follows: Obtaining a plaintext segmentation item based on the query request, and encrypting the plaintext segmentation item based on the symmetric encryption key uploaded by the user end to obtain a ciphertext of the query segmentation item; Determine whether the query segmentation item ciphertext exists in the stored segmentation item ciphertext table; If it does not exist, it is determined that there is no corresponding query data, and a query failure signal is fed back to the user end; If it exists, the ciphertext table of the data ciphertext ID corresponding to the matching segmentation item ciphertext is fed back to the user end.
7. The method according to claim 1, characterized in that The step of decrypting the recovered encrypted data to obtain the query data includes: Obtain the corresponding private key from the cloud based on the data ciphertext ID of the feedback ciphertext table; The ciphertext table is decrypted based on the private key to obtain a plaintext list, which is pushed to the user as query data.
8. A user terminal, characterized in that: The user terminal comprises: A collection unit is used to collect data to be stored, perform word segmentation processing on the data to be stored, and perform asymmetric encryption on the data to be stored after the word segmentation processing to obtain encrypted data; A word segmentation encryption unit is used to perform symmetric encryption on multiple word segmentation items obtained by word segmentation processing to obtain word segmentation item ciphertext; A transmission unit, used to send the encrypted data and the ciphertext of the segmentation item to the cloud, so that the cloud can perform data association storage; A request unit, configured to initiate a query request, so that the cloud can perform ciphertext matching of the query ciphertext items based on the query ciphertext items in the query request, and recover encrypted data corresponding to the ciphertext items matched by the cloud; The decryption unit is used to decrypt the recovered encrypted data to obtain query data.
9. A data encryption management system, characterized in that: The system includes the user terminal as described in claim 8, and a cloud terminal communicatively connected to the user terminal.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the data encryption management method described in any one of claims 1 to 7.
