Data encryption and decryption processing method, device and equipment and computer readable storage medium

Through the interaction of the hash linked list cache technology and kernel data, directly searching the processing and decryption data of the cache area, solving the problem of slow and insufficient security processing in the existing technology, and achieved more efficient and secure and secure decryption processing.

CN119377984APending Publication Date: 2025-01-28SHENZHEN MAI ANXIN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411459974.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

The prior art has problems such as slow encryption and decryption speed and insufficient security in data encryption and decryption processing, especially when using upper-layer applications or encryption cards.

Method used

Use the hash linked list cache technology to do hash processing for the data of the plus decryption, record the hash value of the data that has been encrypted or decrypted, and stores the decrypted data in the corresponding cache area. Through the kernel data interaction, directly find the decryption data in the cache area, and avoid using the encryption card to decrypt it again.

Benefits of technology

The efficiency and security of data decryption processing have been improved, and the problem of slow and insufficient security is avoided, especially when dealing with a large amount of the same data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119377984A_ABST
    Figure CN119377984A_ABST
Patent Text Reader

Abstract

The invention discloses a data encryption and decryption processing method, device and equipment and a computer readable storage medium, and relates to the technical field of information security, the data encryption and decryption processing method comprises the following steps: under the condition that a target file has encryption and decryption requirements, performing hash processing on target data to be written into the target file, obtaining a hash value of the target data; matching the hash value of the target data with a preset hash chain table to determine whether the hash chain table contains the hash value of the target data; if the hash value of the target data is contained in the hash chain table, searching encrypted data or decrypted data of the target data in a cache region associated with the hash chain table by taking the hash value of the target data as an index; and writing the encrypted data or the decrypted data of the target data into the target file. The data encryption and decryption processing efficiency and safety can be improved, and the stability of an encryption and decryption system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information security technology, and in particular to a data encryption and decryption processing method, device, equipment and computer-readable storage medium. Background Art

[0002] Data encryption and decryption is one of the important means to protect data security. Currently, the following two methods are usually used to encrypt and decrypt data:

[0003] One method is to use upper-level applications to encrypt and decrypt data. However, this method requires reading files multiple times and interacting with the kernel more times, resulting in problems such as slow encryption and decryption speed and insufficient security.

[0004] Another method is to use an encryption card to encrypt and decrypt data. However, if the encryption card cannot encrypt and decrypt data due to an abnormality, it will cause an abnormality in the encryption and decryption system. In addition, if the encryption card needs to encrypt and decrypt a large amount of data, the efficiency of its encryption and decryption processing will also be affected.

[0005] Therefore, how to improve the efficiency and security of data encryption and decryption processing is a problem that needs to be solved urgently. Summary of the invention

[0006] The main purpose of this application is to provide a data encryption and decryption processing method, device, equipment and computer-readable storage medium, aiming to improve the efficiency and security of data encryption and decryption processing.

[0007] To achieve the above purpose, the present application provides a data encryption and decryption processing method, the data encryption and decryption processing method comprising:

[0008] In the case where the target file needs to be encrypted or decrypted, performing hash processing on the target data to be written into the target file to obtain a hash value of the target data;

[0009] Matching the hash value of the target data with a preset hash chain table to determine whether the hash value of the target data is included in the hash chain table;

[0010] If the hash value of the target data is included in the hash linked list, the encrypted data or decrypted data of the target data is searched in the cache area associated with the hash linked list using the hash value of the target data as an index;

[0011] The encrypted data or the decrypted data of the target data is written into the target file.

[0012] In one embodiment, after the step of matching the hash value of the target data with a preset hash chain list, the method further includes:

[0013] If the hash value of the target data is not included in the hash chain table, a target encryption card is determined from the encryption cards included in the preset encryption card queue;

[0014] Performing encryption and decryption processing on the target data by the target encryption card to obtain encrypted data or decrypted data of the target data;

[0015] The encrypted data or the decrypted data of the target data is written into the target file.

[0016] In one embodiment, the step of determining the target encryption card from the encryption cards included in the preset encryption card queue includes:

[0017] Among the encryption cards included in the preset encryption card queue, the encryption card pointed to by the polling pointer is used as the target encryption card.

[0018] In one embodiment, the step of determining the target encryption card from the encryption cards included in the preset encryption card queue includes:

[0019] Obtain the remaining resource space of each encryption card included in the preset encryption card queue;

[0020] Based on the remaining resource space of each of the encryption cards, the encryption card with the largest remaining resource space is used as the target encryption card.

[0021] In one embodiment, after the step of encrypting and decrypting the target data by the target encryption card to obtain the encrypted data or decrypted data of the target data, the step further includes:

[0022] The hash value of the target data is added to the hash linked list, and the encrypted data or decrypted data of the target data is stored in a cache area corresponding to the hash value.

[0023] In one embodiment, the method further comprises:

[0024] If a newly inserted encryption card is detected, the newly inserted encryption card is added to the encryption card queue.

[0025] In one embodiment, the method further comprises:

[0026] Determine whether the target file needs encryption or decryption according to the encryption and decryption identifier of the target file obtained;

[0027] If yes, then executing the step of performing hash processing on the target data to be written into the target file to obtain a hash value of the target data;

[0028] If not, the target data is written into the target file.

[0029] To achieve the above-mentioned purpose, the present application also provides a data encryption and decryption processing device, the data encryption and decryption processing device comprising:

[0030] A hash processing module is used to perform hash processing on target data to be written into the target file to obtain a hash value of the target data when encryption and decryption are required for the target file;

[0031] A hash value matching module, used to match the hash value of the target data with a preset hash chain table to determine whether the hash value of the target data is included in the hash chain table;

[0032] A data search module, configured to search for encrypted data or decrypted data of the target data in a cache area associated with the hash chain list using the hash value of the target data as an index if the hash chain list contains the hash value of the target data;

[0033] The data writing module is used to write the encrypted data or decrypted data of the target data into the target file.

[0034] To achieve the above-mentioned purpose, the present application also provides a data encryption and decryption processing device, which is a physical device, and includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the data encryption and decryption processing method as described above.

[0035] To achieve the above objectives, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data encryption and decryption processing method as described above are implemented.

[0036] To achieve the above objectives, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the data encryption and decryption processing method described above are implemented.

[0037] The present application provides a data encryption and decryption processing method. When a target file has encryption and decryption requirements, the present application adopts a hash linked list cache technology to process the data to be encrypted and decrypted.

[0038] Therefore, the present application records the hash value of the data that has been encrypted or decrypted through a hash linked list, and records the encrypted data or decrypted data that has been processed using the encryption card in the cache area of ​​the hash value. Therefore, if the hash linked list contains the hash value of the target data, the encrypted data or decrypted data of the target data can be directly found from the cache area associated with the hash linked list. Therefore, the present application can complete the encryption and decryption processing of the target data through the interaction of kernel data, and there is no need to use the encryption card to encrypt and decrypt the target data, thereby avoiding the problems of slow encryption and decryption speed and insufficient security when using the encryption card to encrypt and decrypt data, and improving the efficiency and security of data encryption and decryption processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0041] Figure 1 A flowchart of an embodiment of a method for data encryption and decryption processing provided in this application;

[0042] Figure 2 This is a schematic diagram of the overall process of the data encryption and decryption processing method of this application;

[0043] Figure 3 This is a schematic diagram of the implementation architecture of the data encryption and decryption processing method of this application;

[0044] Figure 4 This is a schematic diagram of the module structure of the data encryption and decryption processing device according to an embodiment of the present application;

[0045] Figure 5 Schematic diagram of the device structure of the hardware operating environment involved in the data encryption and decryption processing method in the embodiment of the present application.

[0046] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0047] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0048] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0049] Data encryption and decryption is one of the important means to protect data security. Currently, the following two methods are usually used to encrypt and decrypt data:

[0050] One is to use upper-layer applications to encrypt and decrypt data. However, this method requires multiple file reads and many interactions with the kernel, resulting in slow encryption and decryption speeds and insufficient security. In addition, upper-layer applications are vulnerable to attacks by malicious programs and are at risk of being cracked and tampered with.

[0051] Another method is to use an encryption card to encrypt and decrypt data. However, if the encryption card cannot encrypt and decrypt data due to an abnormality, it will cause an abnormality in the encryption and decryption system. In addition, if the encryption card needs to encrypt and decrypt a large amount of data, the efficiency of its encryption and decryption processing will also be affected.

[0052] Therefore, how to improve the efficiency and security of data encryption and decryption processing is a problem that needs to be solved urgently.

[0053] The main solution of the present application is: when there is a need for encryption and decryption of a target file, hash processing is performed on the target data to be written into the target file to obtain a hash value of the target data; the hash value of the target data is matched with a preset hash chain table to determine whether the hash value of the target data is contained in the hash chain table; if the hash value of the target data is contained in the hash chain table, the encrypted data or decrypted data of the target data is searched in a cache area associated with the hash chain table with the hash value of the target data as an index; and the encrypted data or decrypted data of the target data is written into the target file.

[0054] The present application records the hash value of the data that has been encrypted or decrypted through a hash linked list, and records the encrypted data or decrypted data that has been processed by the encryption card in the cache area of ​​the hash value. Therefore, if the hash linked list contains the hash value of the target data, the encrypted data or decrypted data of the target data can be directly found from the cache area associated with the hash linked list. Therefore, the present application can complete the encryption and decryption processing of the target data through the interaction of kernel data, and there is no need to use the encryption card to encrypt and decrypt the target data, thereby avoiding the problems of slow encryption and decryption speed and insufficient security when using the encryption card to encrypt and decrypt a large amount of identical data, and improving the efficiency and security of data encryption and decryption processing.

[0055] Data encryption and decryption refers to the encryption or decryption of data.

[0056] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a data encryption and decryption processing device that can realize the above functions, etc., and this embodiment does not specifically limit this. The following takes the data encryption and decryption processing device as the execution subject as an example to illustrate this embodiment and the following embodiments.

[0057] Based on this, this application proposes a data encryption and decryption processing method of the first embodiment, please refer to Figure 1 The data encryption and decryption processing method includes steps S10 to S40:

[0058] Step S10, when the target file needs to be encrypted or decrypted, performing hash processing on the target data to be written into the target file to obtain a hash value of the target data;

[0059] It should be noted that the target file refers to the file in the directory to be encrypted and decrypted, and the encryption and decryption requirements are used to indicate that the file needs to be encrypted and decrypted. Hash processing is a process of transforming an input of any length (usually called pre-mapping) into an output of fixed length (i.e., a hash value) through a hash algorithm.

[0060] The target data to be written into the target file may be hashed using a preset hash algorithm, and the hash algorithm may be MD5 (Message Digest Algorithm), SHA (Secure Hash Algorithm), etc., which is not specifically limited in this embodiment.

[0061] Step S20, matching the hash value of the target data with a preset hash chain table to determine whether the hash chain table contains the hash value of the target data;

[0062] It should be noted that the hash linked list is used to record the hash value of the data that has been encrypted or decrypted, and cache the encrypted or decrypted data.

[0063] Step S30: If the hash value of the target data is included in the hash linked list, the encrypted data or decrypted data of the target data is searched in the cache area associated with the hash linked list using the hash value of the target data as an index;

[0064] It should be noted that the cache area is used to record the encrypted data or decrypted data of the data that has been encrypted or decrypted using the encryption card.

[0065] It can be understood that if the hash list contains the hash value of the target data, it means that the encrypted data or decrypted data of the target data is recorded in the cache area associated with the hash list. Then, the hash value of the target data can be used as an index to directly find the encrypted data or decrypted data of the target data from the cache area associated with the hash list.

[0066] Step S40: writing the encrypted data or decrypted data of the target data into the target file.

[0067] In a feasible implementation, if the target file records data in the form of encrypted pages, when writing the encrypted data or decrypted data of the target data into the target file, it is necessary to first determine the offset position of the write data based on the status information of the encrypted page of the target file, and then write the encrypted data or decrypted data of the target data into the target file based on the offset position of the write data.

[0068] For example, it can be assumed that an encrypted page can record 2048 bytes of data. If 1500 bytes of data are written to the encrypted page for the first time, the data will be written starting from the 1501st byte (offset position is 1500 bytes) when writing data to the encrypted page for the second time.

[0069] The present embodiment provides a data encryption and decryption processing method. In the present embodiment, when there is a need for encryption and decryption of a target file, target data to be written into the target file is hashed to obtain a hash value of the target data; the hash value of the target data is matched with a preset hash chain table to determine whether the hash value of the target data is included in the hash chain table; if the hash value of the target data is included in the hash chain table, the hash value of the target data is used as an index to search for encrypted data or decrypted data of the target data in a cache area associated with the hash chain table; and the encrypted data or decrypted data of the target data is written into the target file.

[0070] This embodiment records the hash value of the data that has been encrypted or decrypted through a hash linked table, and records the encrypted data or decrypted data that has been processed by the encryption card in the cache area of ​​the hash value. Therefore, if the hash linked table contains the hash value of the target data, the encrypted data or decrypted data of the target data can be directly found from the cache area associated with the hash linked table. Therefore, this embodiment can complete the encryption and decryption processing of the target data through the interaction of kernel data, and there is no need to use the encryption card to encrypt and decrypt the target data, thereby avoiding the problems of slow encryption and decryption speed and insufficient security when using the encryption card to encrypt and decrypt a large amount of identical data, thereby improving the efficiency and security of data encryption and decryption processing.

[0071] Based on the above first embodiment, a second embodiment of the data encryption and decryption processing method of the present application is proposed. In the second embodiment of the present application, after step S20, the data encryption and decryption processing method further includes steps S21 to S23:

[0072] Step S21, if the hash value of the target data is not included in the hash chain table, a target encryption card is determined from the encryption cards included in the preset encryption card queue;

[0073] It should be noted that the encryption card queue records the encryption cards that can currently be used to perform encryption and decryption processing on data, and the target encryption card is the encryption card used to perform encryption and decryption processing on the target data.

[0074] In a first feasible implementation manner, step S21 may include step S211:

[0075] Step S211: Among the encryption cards included in the preset encryption card queue, the encryption card pointed to by the polling pointer is used as the target encryption card.

[0076] It should be noted that the polling pointer is used to indicate the encryption card currently selected for encrypting and decrypting the target data.

[0077] For example, assuming there are encryption cards A, B and C, the polling pointer will use the polling mechanism of "encryption card A->encryption card B->encryption card C->encryption card A" to cyclically select encryption card A, B and C to encrypt and decrypt data, that is, cyclically assign encryption and decryption tasks to encryption card A, B and C.

[0078] In a second feasible implementation manner, step S21 may include steps S212 to S213:

[0079] Step S212, obtaining the remaining resource space of each encryption card included in the preset encryption card queue;

[0080] It should be noted that the remaining resource space refers to the unused space on the encryption card that can be used to store keys, execute encryption algorithms, decryption algorithms and other security operations.

[0081] Step S213: Based on the remaining resource spaces of the encryption cards, the encryption card with the largest remaining resource space is used as the target encryption card.

[0082] In this embodiment, by selecting the encryption card with the largest remaining resource space among the encryption cards included in the encryption card queue as the target encryption card, it is possible to avoid the situation where an encryption card needs to encrypt and decrypt too much data at the same time, thereby further improving the efficiency of data encryption and decryption processing.

[0083] In a third feasible implementation manner, step S21 may further include: arbitrarily selecting an encryption card from the encryption cards included in the preset encryption card queue as the target encryption card.

[0084] The above are only three feasible implementation methods of step S21 provided in this embodiment, and this embodiment does not specifically limit the specific implementation method of step S21.

[0085] Step S22, encrypting and decrypting the target data by the target encryption card to obtain encrypted data or decrypted data of the target data;

[0086] The target data can be encrypted and decrypted by the encryption and decryption functions of the target encryption card.

[0087] Step S23, writing the encrypted data or decrypted data of the target data into the target file.

[0088] This embodiment sets up multiple encryption cards that can be used to encrypt and decrypt data, so that the multiple encryption cards can work together to complete the encryption and decryption of data, so as to avoid the situation where the encryption and decryption efficiency is affected due to the excessive amount of data required for encryption and decryption when using one encryption card to encrypt and decrypt data, so as to improve the efficiency of data encryption and decryption. In addition, it can also avoid the problem of encryption and decryption system abnormality caused by encryption card abnormality when using one encryption card to encrypt and decrypt data.

[0089] In addition, compared with upper-level applications, encryption cards are less vulnerable to attacks by malicious programs, and thus the risk of being cracked and tampered with is also lower. Therefore, this embodiment implements data encryption and decryption processing through encryption cards, and can also improve the security and stability of data encryption and decryption processing.

[0090] Based on the above second embodiment, a third embodiment of the data encryption and decryption processing method of the present application is proposed. In the third embodiment of the present application, after step S22, the data encryption and decryption processing method further includes step S24:

[0091] Step S24: adding the hash value of the target data to the hash linked list, and storing the encrypted data or decrypted data of the target data in a cache area corresponding to the hash value.

[0092] This embodiment stipulates that after the encryption and decryption processing of the target data is completed, the hash value of the target data needs to be added to the hash linked list, and the encrypted data or decrypted data of the target data needs to be stored in the cache area corresponding to the hash value, so that when the data identical to the target data is subsequently written to the target file, the encryption and decryption processing of the data identical to the target data can be completed directly through the interaction of the kernel data, so as to improve the efficiency and security of the subsequent encryption and decryption processing of the data identical to the target data.

[0093] Based on the above second embodiment and / or third embodiment, a fourth embodiment of the data encryption and decryption processing method of the present application is proposed. In the fourth embodiment of the present application, the data encryption and decryption processing method further includes step S25:

[0094] Step S25: If a newly inserted encryption card is detected, the newly inserted encryption card is added to the encryption card queue.

[0095] It can be understood that when managing multiple encryption cards in the encryption card queue, this embodiment first needs to load the driver management module (i.e., the encryption card management module). After successful loading, the driver management module will read the / dev / device driver file under the data encryption and decryption processing device in real time; if a new encryption card is inserted into the server, the device will be mounted to the / dev / device file through the driver loading method, and then the newly inserted encryption card will be initialized (including generating keys, etc.); after reading the new encryption card device, the driver management module will add the read new encryption card device to the encryption card queue.

[0096] After detecting a newly inserted encryption card, this embodiment will add the newly inserted encryption card to the encryption card queue, thereby further improving the efficiency of data encryption and decryption processing and avoiding abnormal problems in the encryption and decryption system by continuously increasing the encryption cards that can be used to encrypt and decrypt data.

[0097] Based on the above-mentioned first embodiment, second embodiment and / or third embodiment, a fifth embodiment of the data encryption and decryption processing method of the present application is proposed. In the fifth embodiment of the present application, the data encryption and decryption processing method further includes steps S01 to S03:

[0098] Step S01, judging whether the target file needs to be encrypted or decrypted according to the encryption and decryption identifier of the target file obtained;

[0099] It should be noted that the encryption / decryption flag is used to indicate whether the target file needs to be encrypted / decrypted.

[0100] When obtaining the encryption and decryption identifier of the target file, you can read the header information of the target file through kernel methods such as ecryptfs_write and ecryptfs_read, and then extract the identifier in the header information to obtain the encryption and decryption identifier, file size, file offset, file attributes, file encryption and decryption information, etc. of the target file.

[0101] In a feasible implementation, the value of the encryption / decryption identifier can be used to determine whether the target file needs encryption / decryption. Specifically, if the value of the encryption / decryption identifier is true, it is determined that the target file needs encryption / decryption; if the value of the encryption / decryption identifier is false, it is determined that the target file does not need encryption / decryption.

[0102] In another feasible implementation, whether there is a need for encryption or decryption for the target file can be determined by parsing the state of the encryption or decryption identifier. Specifically, if after parsing, it is determined that the state of the encryption or decryption identifier is an encryption or decryption state, then it is determined that there is a need for encryption or decryption for the target file; if after parsing, it is determined that the state of the encryption or decryption identifier is a non-encryption or decryption state, then it is determined that there is no need for encryption or decryption for the target file.

[0103] The above are merely two feasible implementations of step S01 provided in this embodiment, and this embodiment does not specifically limit the specific implementation of step S01.

[0104] Step S02: if yes, then perform the step of performing hash processing on the target data to be written into the target file to obtain the hash value of the target data;

[0105] Step S03: if not, writing the target data into the target file.

[0106] In this embodiment, the encryption and decryption identifier of the target file is obtained to determine whether the target file has encryption and decryption requirements. If the target file has encryption and decryption requirements, it is necessary to ensure that the data written to the target file is encrypted data and decrypted. If the target file does not have encryption and decryption requirements, the target data can be directly written to the target file without encryption and decryption. Therefore, this embodiment can ensure the security of target files that have encryption and decryption requirements, and ensure the data writing efficiency of target files that do not have encryption and decryption requirements.

[0107] For example, in order to help understand the implementation process of the data encryption and decryption processing method obtained by combining the above embodiments, please refer to Figure 2 , as follows:

[0108] After completing the initialization of the data encryption and decryption processing equipment, first mount the directory to be encrypted and decrypted, and open the target file in the directory; then process the target file through the kernel program to obtain the encryption and decryption identifier of the target file; then, based on the encryption and decryption identifier of the target file, determine whether the target file has encryption and decryption requirements; if the target file does not have encryption and decryption requirements, write the target data into the target file through the kernel program.

[0109] If the target file needs to be encrypted or decrypted, the target data is first hashed to obtain the hash value of the target data. Based on the hash value of the target data, a matching hash value is searched in the hash linked list. If it exists, the corresponding encrypted data or decrypted data is directly found based on the hash value, and the encrypted data or decrypted data found is directly returned to the kernel program, and the encrypted data or decrypted data found is written to the target file through the kernel program.

[0110] If the hash value of the target data is not found in the cache area, the target data is added to the encryption and decryption task queue through the kernel program, and the task manager determines an encryption card from the encryption cards contained in the encryption card queue to perform encryption and decryption on the target data; then, the target data is encrypted and decrypted through the determined encryption card to obtain the encrypted data or decrypted data of the target data, and the obtained encrypted data or decrypted data of the target data is returned to the encryption and decryption function; then, the obtained encrypted data or decrypted data of the target data is written into the target file through the kernel program, and stored in the cache area corresponding to the hash value of the target data.

[0111] Among them, the initialization work of the data encryption and decryption processing equipment may include initializing the file system, initializing the kernel processing function, initializing the cache area, initializing the driver management module, initializing the task management queue, initializing the policy management module, etc. Specifically, initializing the file system is to mount the directory that needs to be encrypted and decrypted in the file system by reading the configuration file; initializing the kernel processing function is to obtain the function used to encrypt and decrypt the data. By default, a single core is used to process the file encryption and decryption data. The multi-core parameters of the configuration file can also be used to increase the processing speed of the file encryption and decryption data; initializing the cache area is used to temporarily store the relevant data after encryption and decryption, and a hash linked list can be used to cache and search the encrypted and decrypted data; initializing the driver management module to dynamically identify the driver module of the encryption card; initializing the task management queue, and dynamically allocating it to different encryption cards to encrypt and decrypt the data; initializing the policy management module is to perform configuration authority management.

[0112] For further information, please refer to Figure 3 , Figure 3 The schematic diagram of the implementation architecture of the data encryption and decryption processing method is shown, specifically:

[0113] First, the file content is read in the upper-level application, and then the encryption and decryption function is called through the file operator in the kernel's file encryption and decryption driver to extract the required file content from the memory and write it into the buff, and then the encrypted and decrypted data is stored in the cache area; then the encryption and decryption task is added to the task queue, and the task manager in the kernel's encryption card management driver assigns each task in the task queue to different encryption cards for encryption or decryption. In this task allocation process, the encryption card driver management can allocate tasks to encryption card 1, encryption card 2 and encryption card 3 according to certain allocation rules; after each encryption card completes the encryption and decryption task, the encrypted data or decrypted data is returned to be written into the buff, and then the encrypted and decrypted file content is returned in the upper-level application.

[0114] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the data encryption and decryption processing method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0115] This application also provides a data encryption and decryption processing device, please refer to Figure 4 , the data encryption and decryption processing device comprises:

[0116] The hash processing module 10 is used to perform hash processing on target data to be written into the target file to obtain a hash value of the target data when there is a need for encryption and decryption of the target file;

[0117] A hash value matching module 20 is used to match the hash value of the target data with a preset hash chain table to determine whether the hash value of the target data is included in the hash chain table;

[0118] A data search module 30 is configured to search for encrypted data or decrypted data of the target data in a cache area associated with the hash chain list using the hash value of the target data as an index if the hash chain list contains the hash value of the target data;

[0119] The data writing module 40 is used to write the encrypted data or decrypted data of the target data into the target file.

[0120] Optionally, the data encryption and decryption processing device further includes:

[0121] If the hash value of the target data is not included in the hash chain table, a target encryption card is determined from the encryption cards included in the preset encryption card queue;

[0122] Performing encryption and decryption processing on the target data by the target encryption card to obtain encrypted data or decrypted data of the target data;

[0123] The encrypted data or the decrypted data of the target data is written into the target file.

[0124] Optionally, the data encryption and decryption processing device further includes:

[0125] Among the encryption cards included in the preset encryption card queue, the encryption card pointed to by the polling pointer is used as the target encryption card.

[0126] Optionally, the data encryption and decryption processing device further includes:

[0127] Obtain the remaining resource space of each encryption card included in the preset encryption card queue;

[0128] Based on the remaining resource space of each of the encryption cards, the encryption card with the largest remaining resource space is used as the target encryption card.

[0129] Optionally, the data encryption and decryption processing device further includes:

[0130] The hash value of the target data is added to the hash linked list, and the encrypted data or decrypted data of the target data is stored in a cache area corresponding to the hash value.

[0131] Optionally, the data encryption and decryption processing device further includes:

[0132] If a newly inserted encryption card is detected, the newly inserted encryption card is added to the encryption card queue.

[0133] Optionally, the data encryption and decryption processing device further includes:

[0134] Determine whether the target file needs encryption or decryption according to the encryption and decryption identifier of the target file obtained;

[0135] If yes, then executing the step of performing hash processing on the target data to be written into the target file to obtain a hash value of the target data;

[0136] If not, the target data is written into the target file.

[0137] The data encryption and decryption processing device provided by the present application adopts the data encryption and decryption processing method in the above embodiment, which can improve the efficiency and security of data encryption and decryption processing. Compared with the prior art, the beneficial effects of the data encryption and decryption processing device provided by the present application are the same as the beneficial effects of the data encryption and decryption processing method provided by the above embodiment, and other technical features in the data encryption and decryption processing device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0138] The present application provides a data encryption and decryption processing device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the data encryption and decryption processing method in the above-mentioned embodiment one.

[0139] Reference below Figure 5 , which shows a schematic diagram of the structure of a data encryption and decryption processing device suitable for implementing the embodiment of the present disclosure. The data encryption and decryption processing device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The data encryption and decryption processing device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0140] like Figure 5As shown, the data encryption and decryption processing device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the data encryption and decryption processing device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the data encryption and decryption processing device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a data encryption and decryption processing device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.

[0141] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0142] The data encryption and decryption processing device provided by the present application adopts the data encryption and decryption processing method in the above embodiment, which can improve the efficiency and security of data encryption and decryption processing. Compared with the prior art, the beneficial effects of the data encryption and decryption processing device provided by the present application are the same as the beneficial effects of the data encryption and decryption processing method provided by the above embodiment, and other technical features in the data encryption and decryption processing device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0143] It should be understood that the various parts of the present disclosure can be implemented with hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0144] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0145] The present application provides a computer-readable storage medium having computer-readable program instructions stored thereon, and the computer-readable program instructions are used to execute the data encryption and decryption processing method in the above-mentioned embodiment.

[0146] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0147] The computer-readable storage medium may be included in the data encryption and decryption processing device; or may exist independently without being assembled into the data encryption and decryption processing device.

[0148] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0149] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0150] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of the module does not limit the unit itself in some cases.

[0151] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions for executing the above-mentioned data encryption and decryption processing method, and can improve the efficiency and security of data encryption and decryption processing. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the data encryption and decryption processing method provided by the above-mentioned embodiment, and will not be repeated here.

[0152] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned data encryption and decryption processing method when executed by a processor.

[0153] The computer program product provided by this application can improve the efficiency and security of data encryption and decryption processing. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the data encryption and decryption processing method provided by the above embodiment, which will not be repeated here.

[0154] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.

Claims

1. A data encryption and decryption processing method, characterized in that: The data encryption and decryption processing method comprises: In the case where the target file needs to be encrypted or decrypted, performing hash processing on the target data to be written into the target file to obtain a hash value of the target data; Matching the hash value of the target data with a preset hash chain table to determine whether the hash value of the target data is included in the hash chain table; If the hash value of the target data is included in the hash linked list, the encrypted data or decrypted data of the target data is searched in the cache area associated with the hash linked list using the hash value of the target data as an index; The encrypted data or the decrypted data of the target data is written into the target file.

2. The method according to claim 1, characterized in that After the step of matching the hash value of the target data with the preset hash chain list, the method further includes: If the hash value of the target data is not included in the hash chain table, a target encryption card is determined from the encryption cards included in the preset encryption card queue; Performing encryption and decryption processing on the target data by the target encryption card to obtain encrypted data or decrypted data of the target data; The encrypted data or the decrypted data of the target data is written into the target file.

3. The method according to claim 2, characterized in that The step of determining the target encryption card from the encryption cards included in the preset encryption card queue includes: Among the encryption cards included in the preset encryption card queue, the encryption card pointed to by the polling pointer is used as the target encryption card.

4. The method according to claim 2, characterized in that The step of determining the target encryption card from the encryption cards included in the preset encryption card queue includes: Obtain the remaining resource space of each encryption card included in the preset encryption card queue; Based on the remaining resource space of each of the encryption cards, the encryption card with the largest remaining resource space is used as the target encryption card.

5. The method according to claim 2, characterized in that After the step of encrypting and decrypting the target data by the target encryption card to obtain the encrypted data or decrypted data of the target data, the method further includes: The hash value of the target data is added to the hash linked list, and the encrypted data or decrypted data of the target data is stored in a cache area corresponding to the hash value.

6. The method according to any one of claims 2 to 5, characterized in that The method further comprises: If a newly inserted encryption card is detected, the newly inserted encryption card is added to the encryption card queue.

7. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Determine whether the target file needs encryption or decryption according to the encryption and decryption identifier of the target file obtained; If yes, then executing the step of performing hash processing on the target data to be written into the target file to obtain a hash value of the target data; If not, the target data is written into the target file.

8. A data encryption and decryption processing device, characterized in that: The data encryption and decryption processing device comprises: A hash processing module is used to perform hash processing on target data to be written into the target file to obtain a hash value of the target data when encryption and decryption are required for the target file; A hash value matching module, used to match the hash value of the target data with a preset hash chain table to determine whether the hash value of the target data is included in the hash chain table; A data search module, configured to search for encrypted data or decrypted data of the target data in a cache area associated with the hash chain list using the hash value of the target data as an index if the hash chain list contains the hash value of the target data; The data writing module is used to write the encrypted data or decrypted data of the target data into the target file.

9. A data encryption and decryption processing device, characterized in that: The data encryption and decryption processing device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the data encryption and decryption processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data encryption and decryption processing method according to any one of claims 1 to 7 are implemented.