Data storage encryption method and terminal

By converting the encrypted data in a distributed network format to generate black hole numbers and storing them in binary tree nodes for compression, the problem of low storage space and efficiency in data encryption technology is solved, low-capacity encryption and efficient data processing are achieved, while ensuring that Data security.

CN119249513AActive Publication Date: 2025-01-03FUJIAN TQ ONLINE INTERACTIVE INC
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411142047.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2025-01-03
Estimated Expiration
2044-08-20

AI Technical Summary

Technical Problem

Existing data encryption technologies have problems such as increased storage space usage and low encryption processing efficiency in distributed networks, and existing compression technologies cannot completely solve these problems.

Method used

The number of black holes is generated by formatting the data to be encrypted and stored in the binary tree node for compression. The number of black holes is generated in response to the encryption request, and the original data is restored based on the binary tree node data in response to the decryption request.

Benefits of technology

Low-capacity data encryption is realized, storage space is saved, encryption efficiency is improved, and data security is ensured through unknown binary tree storage structure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119249513A_ABST
    Figure CN119249513A_ABST
Patent Text Reader

Abstract

The invention discloses a data storage encryption method and a terminal, and the method comprises the steps: converting to-be-encrypted data in response to a data encryption request, generating a corresponding black hole number according to bytes, storing a generation process of each black hole number into a binary tree node, compressing the generated black hole number, and storing the compressed black hole number into a binary tree node; therefore, the to-be-encrypted data is compressed after being converted into the black holes, so that the storage space of the data can be saved, and the encryption efficiency and flexibility can be ensured. In the embodiment of the invention, in response to the data decryption request, the compressed data is decompressed, and the black hole number is restored according to the node data in the binary tree, data restoration information is stored in the binary tree, the encrypted compressed data does not have readability, and the storage structure of the binary tree is unknown to the outside, so that the security of data encryption can be effectively ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data encryption, and in particular to a method and a terminal for data storage encryption. Background Art

[0002] With the rapid development of information technology, distributed networks have become the mainstream architecture for data storage and transmission. Distributed networks are widely used in cloud computing, big data processing, the Internet of Things and other fields due to their high scalability, flexibility and fault tolerance. However, the diversity and complexity of distributed networks also bring huge challenges in data security and privacy protection. Especially in the process of data storage and transmission, how to ensure the confidentiality, integrity and availability of data has become a key issue that needs to be solved urgently.

[0003] In the prior art, data encryption technology is one of the important means to achieve data security. Among them, ADE (Advanced Encryption Standard) and DES (Data Encryption Standard) are classic encryption algorithms and are widely used in various data encryption scenarios. These algorithms encrypt the original data through complex mathematical transformations, making it difficult for unauthorized third parties to steal or tamper with the data content. However, although encryption algorithms such as ADE / DES play an important role in ensuring data security, they also have some shortcomings that cannot be ignored.

[0004] First, when processing large-scale data, encryption algorithms such as ADE / DES often lead to a significant increase in the amount of encrypted data, which in turn increases the burden on storage space. This is undoubtedly a considerable challenge for application scenarios with limited storage space or cost sensitivity. In addition, as the amount of data continues to grow, the time and computing resources required for encryption processing will also increase accordingly, affecting the efficiency and real-time performance of data transmission.

[0005] Secondly, compression technologies such as ZIP can reduce the size of encrypted data to a certain extent, but the compression process itself will increase processing time and complexity, and the compressed data needs to be decompressed after decryption, which further increases the complexity of data processing. At the same time, compression technology cannot completely solve the problem of increased storage space for encrypted data, especially when the data compression rate is low or the data itself is already relatively compact.

[0006] In addition to technologies such as ADE / DES and ZIP, obfuscating data is also a commonly used means of data protection. By changing the form or structure of data, it is difficult for unauthorized third parties to directly understand or use the data content. However, obfuscation technology can usually only be used as an auxiliary means of encryption technology and cannot provide sufficient data security protection alone. In addition, obfuscation technology may also have a certain impact on the availability of data, such as increasing the complexity of data processing and reducing the efficiency of data processing.

[0007] In summary, although the existing technology has achieved certain results in realizing the security protection of data storage and transmission in distributed networks, there are still many shortcomings. Therefore, a more efficient, secure and economical data encryption and storage transmission solution is needed to meet the development needs of distributed networks. Summary of the invention

[0008] The technical problem to be solved by the present invention is to provide a method and a terminal for data storage encryption, which can realize low-capacity data encryption and ensure the efficiency and security of data encryption.

[0009] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0010] A method for encrypting data storage, comprising the steps of:

[0011] In response to a data encryption request, the format of the data to be encrypted is converted, the corresponding black hole number is generated by byte for the converted data to be encrypted, and the generation process of each black hole number is stored in a node of a binary tree, and all the generated black hole numbers are compressed to obtain compressed data;

[0012] In response to a data decryption request, the compressed data is decompressed, and the decompressed black hole number is restored according to the node data in the binary tree to obtain the original data to be encrypted.

[0013] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0014] A terminal for data storage encryption includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step of the above-mentioned method for data storage encryption is implemented.

[0015] The beneficial effects of the present invention are as follows: in response to a data encryption request, the encrypted data is converted to generate the corresponding black hole number by byte, and the generation process of each black hole number is stored in a binary tree node, and the generated black hole number is compressed, so that the encrypted data is converted into black hole numbers and then compressed, which can not only save the storage space of the data, but also ensure the encryption efficiency and flexibility. In response to a data decryption request, the compressed data is decompressed, and the black hole number is restored according to the node data in the binary tree. Since the data restoration information is stored in the binary tree, the encrypted compressed data is not readable and the binary tree storage structure is unknown to the outside, so the security of data encryption can be effectively guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A flowchart of a method for data storage encryption according to an embodiment of the present invention;

[0017] Figure 2 A schematic diagram of a terminal for data storage encryption according to an embodiment of the present invention;

[0018] Figure 3 A schematic diagram of a binary tree storage structure according to an embodiment of the present invention;

[0019] Figure 4 This is a flow chart of data storage encryption according to an embodiment of the present invention.

[0020] Description of labels:

[0021] 1. A terminal for encrypting data storage; 2. A memory; 3. A processor. DETAILED DESCRIPTION

[0022] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

[0023] Glossary:

[0024] Black hole number: also known as trap number, is a type of integer with a peculiar conversion characteristic. Any number that is not all the same integer, after a finite "rearrangement and difference" operation, will always get one or some numbers, these numbers are black hole numbers. The "rearrangement and difference" operation is to subtract the smallest number obtained after the rearrangement of the maximum number obtained after the rearrangement of the numbers that make up the number.

[0025] Please refer to Figure 1 The embodiment of the present invention provides a method for encrypting data storage, comprising the steps of:

[0026] In response to a data encryption request, the format of the data to be encrypted is converted, the corresponding black hole number is generated by byte for the converted data to be encrypted, and the generation process of each black hole number is stored in a node of a binary tree, and all the generated black hole numbers are compressed to obtain compressed data;

[0027] In response to a data decryption request, the compressed data is decompressed, and the decompressed black hole number is restored according to the node data in the binary tree to obtain the original data to be encrypted.

[0028] From the above description, it can be seen that the beneficial effects of the present invention are: in response to a data encryption request, the encrypted data is converted to generate the corresponding black hole number by byte, and the generation process of each black hole number is stored in a binary tree node, and the generated black hole number is compressed. Therefore, the encrypted data is converted into black hole numbers and then compressed, which can not only save data storage space, but also ensure encryption efficiency and flexibility. In response to a data decryption request, the compressed data is decompressed, and the black hole number is restored according to the node data in the binary tree. Since the data restoration information is stored in the binary tree, the encrypted compressed data is not readable and the binary tree storage structure is unknown to the outside, so the security of data encryption can be effectively guaranteed.

[0029] Furthermore, the format of the data to be encrypted is converted, and the corresponding black hole number is generated by bytes of the converted data to be encrypted, including:

[0030] The data to be encrypted is converted into hexadecimal, and the converted data to be encrypted is paged, and two bytes are sequentially obtained from the data of each page and a corresponding black hole number is generated.

[0031] It can be seen from the above description that by dividing the data to be encrypted into pages, multi-threading can be used to simultaneously generate black hole numbers for the data in each page, thereby effectively improving the efficiency of data encryption.

[0032] Furthermore, the generation process of each black hole number is stored in the node of the binary tree, including:

[0033] When generating the corresponding black hole number according to the two bytes, converting the data corresponding to the two bytes into decimal to obtain calculation data, and recording the initial position identifier of each bit of the calculation data in the first node of the binary tree;

[0034] The calculated data are rearranged and subtracted until the number of black holes is calculated, and the rearranged data and the corresponding rounds of each rearrangement and subtraction are recorded in sequence in the nodes after the first node.

[0035] From the above description, it can be seen that two bytes of data are obtained each time to generate the corresponding black hole number, and the initial position identifier of the calculation data corresponding to the two bytes, as well as the rearranged data and calculation rounds for each rearrangement and difference are recorded. Since the content required for data restoration is additionally stored in the binary tree, the storage structure of the binary tree is unknown to the outside world, it can ensure encryption security and facilitate subsequent decryption of the black hole number.

[0036] Furthermore, the decompressed black hole number is restored according to the node data in the binary tree to obtain the original data to be encrypted, including:

[0037] According to the node data in the binary tree, the rearrangement data and the corresponding rounds for each rearrangement and difference calculation are obtained in order from the back to the front of the nodes, so as to restore the rearrangement and difference calculation formula for each round;

[0038] When the initial position identifier of the first node is obtained in the binary tree, the rearranged data of the last restored rearrangement difference formula is restored according to the initial position identifier to obtain the original data to be encrypted.

[0039] From the above description, it can be seen that by gradually restoring the calculation process of the black hole number through the information stored in the binary tree, the original data to be encrypted can be efficiently restored to ensure the efficiency and reliability of data restoration.

[0040] Furthermore, all the generated black hole numbers are compressed to obtain compressed data, including:

[0041] The number of times each black hole number is generated is counted, and the number of times each black hole number is generated and the number of digits of the decimal black hole number are used as compressed data.

[0042] From the above description, it can be seen that compressing all black hole numbers into the number of times each black hole number is generated and the number of black hole digits can not only save storage space, but also make the encrypted data unreadable.

[0043] Please refer to Figure 2 Another embodiment of the present invention provides a terminal for data storage encryption, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements each step of the above-mentioned method for data storage encryption when executing the computer program.

[0044] The above-mentioned data storage encryption method and terminal of the present invention are suitable for implementing low-capacity data encryption in a distributed network and ensuring the efficiency and security of data encryption. The following is an explanation through specific implementation methods:

[0045] Embodiment 1

[0046] Please refer to Figure 1 , Figure 3 and Figure 4 , a method for data storage encryption, comprising the steps of:

[0047] S1. In response to a data encryption request, the format of the data to be encrypted is converted, the corresponding black hole number is generated byte by byte for the converted data to be encrypted, and the generation process of each black hole number is stored in the node of the binary tree, and all the generated black hole numbers are compressed to obtain compressed data.

[0048] S11, converting the data to be encrypted into hexadecimal, and paging the converted data to be encrypted, sequentially obtaining two bytes from each page of data and generating a corresponding black hole number.

[0049] Specifically, the data to be encrypted is converted into hexadecimal, and the memory size of the converted data to be encrypted is divided by 1024 to obtain N pages of size 1024 to achieve data paging and alignment, and the data in each page is obtained in turn in two bytes to generate the corresponding number of black holes.

[0050] Among them, for decimal three-digit data, the fixed result of the black hole number is 495, that is, "EF01" in hexadecimal; for decimal four-digit data, the fixed result of the black hole number is 6174, that is, "1E 18" in hexadecimal.

[0051] Therefore, the data in each page can be converted into data consisting of "EF 01" and "1E 18".

[0052] In this embodiment, only the corresponding black hole number is generated for asymmetric data, and if it is symmetric data, it is directly skipped and not processed.

[0053] S12. When generating the corresponding black hole number based on two bytes, convert the data corresponding to the two bytes into decimal to obtain calculation data, and record the initial position identifier of each bit of the calculation data in the first node of the binary tree; rearrange the calculation data and calculate the difference until the black hole number is calculated, and record the rearranged data and the corresponding rounds of each rearrangement and difference in the nodes after the first node.

[0054] In this embodiment, if the two bytes obtained are "00D5", the corresponding decimal calculation data is 213, so the black hole number generation process of the data is:

[0055] Round 1: 321-123=198;

[0056] Round 2: 981-189=792;

[0057] Round 3: 972-279=693;

[0058] Round 4: 963-369=594;

[0059] Round 5: 954-459=495.

[0060] At this time, the initial position identifier of the calculated data is recorded. The initial position identifier is to generate a corresponding position identifier for each digit in the calculated data in ascending order. The position identifiers corresponding to the values ​​from small to large can be 0, 1, 2, ..., so the initial position identifier of the calculated data 213 in this embodiment is 102.

[0061] Furthermore, the initial position identifier 102 is stored in node 1 of the binary tree, and the round data and rearrangement data are stored in the nodes after node 1, that is, node 2 stores round 1 and rearrangement data 123, node 3 stores round 2 and rearrangement data 189, node 4 stores round 3 and rearrangement data 279, node 5 stores round 4 and rearrangement data 369, and node 6 stores round 5 and rearrangement data 459.

[0062] S13. Count the number of times each black hole number is generated, and use the number of times each black hole number is generated and the number of digits of the decimal black hole number as compressed data.

[0063] In this embodiment, if the following result is obtained by the above operation in the paging: 1E 18 1E 18EF 01EF 01, it means that two decimal three-digit numbers and two decimal four-digit numbers are used for black hole number calculation, so the above data can be simplified to 2:3 2:4.

[0064] S2. In response to a data decryption request, the compressed data is decompressed, and the decompressed black hole number is restored according to the node data in the binary tree to obtain the original data to be encrypted.

[0065] S21. Restoring the number of black holes according to the compressed data, for example, restoring the compressed data 2:3 2:4 to 1E 181E18EF 01EF 01.

[0066] S22. According to the node data in the binary tree, the rearranged data and the corresponding rounds of each rearrangement and difference calculation are obtained in sequence from the back to the front of the nodes to restore the rearrangement and difference formula of each round; when the initial position identifier of the first node is obtained in the binary tree, the rearranged data of the last restored rearrangement and difference formula are restored according to the initial position identifier to obtain the original data to be encrypted.

[0067] In this embodiment, the number of black holes is known to be 495. According to the stored data in the binary tree node, the rearrangement difference formula of each round can be restored. For the rearranged data with the restored round data of 1, the original data to be encrypted can be obtained according to the initial position identifier.

[0068] Embodiment 2

[0069] Please refer to Figure 2 A data storage encryption terminal 1 includes a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, each step of a data storage encryption method of embodiment 1 is implemented.

[0070] In summary, the present invention provides a method and terminal for data storage encryption. In response to a data encryption request, the encrypted data is converted to generate the corresponding black hole number by byte, and the generation process of each black hole number is stored in a binary tree node, and the generated black hole number is compressed. Therefore, the encrypted data is converted into black hole numbers and then compressed, which can not only save data storage space, but also ensure encryption efficiency and flexibility. In response to a data decryption request, the compressed data is decompressed, and the black hole number is restored according to the node data in the binary tree. Since the data restoration information is stored in the binary tree, the encrypted compressed data is not readable and the binary tree storage structure is unknown to the outside, so the security of data encryption can be effectively guaranteed.

[0071] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for data storage encryption, characterized in that: Includes steps: In response to a data encryption request, the format of the data to be encrypted is converted, the corresponding black hole number is generated by byte for the converted data to be encrypted, and the generation process of each black hole number is stored in a node of a binary tree, and all the generated black hole numbers are compressed to obtain compressed data; In response to a data decryption request, the compressed data is decompressed, and the decompressed black hole number is restored according to the node data in the binary tree to obtain the original data to be encrypted.

2. A method for data storage encryption according to claim 1, characterized in that: The format of the encrypted data is converted, and the corresponding black hole number is generated by bytes of the converted encrypted data, including: The data to be encrypted is converted into hexadecimal, and the converted data to be encrypted is paged, and two bytes are sequentially obtained from the data of each page and a corresponding black hole number is generated.

3. A method for data storage encryption according to claim 2, characterized in that: The generation process of each black hole number is stored in the node of the binary tree, including: When generating the corresponding black hole number according to the two bytes, converting the data corresponding to the two bytes into decimal to obtain calculation data, and recording the initial position identifier of each bit of the calculation data in the first node of the binary tree; The calculated data are rearranged and subtracted until the number of black holes is calculated, and the rearranged data and the corresponding rounds of each rearrangement and subtraction are recorded in sequence in the nodes after the first node.

4. A method for data storage encryption according to claim 3, characterized in that: The decompressed black hole number is restored according to the node data in the binary tree to obtain the original data to be encrypted, including: According to the node data in the binary tree, the rearrangement data and the corresponding rounds for each rearrangement and difference calculation are obtained in order from the back to the front of the nodes, so as to restore the rearrangement and difference calculation formula for each round; When the initial position identifier of the first node is obtained in the binary tree, the rearranged data of the last restored rearrangement difference formula is restored according to the initial position identifier to obtain the original data to be encrypted.

5. A method for data storage encryption according to claim 1, characterized in that: Compress all the generated black hole numbers to obtain compressed data, including: The number of times each black hole number is generated is counted, and the number of times each black hole number is generated and the number of digits of the decimal black hole number are used as compressed data.

6. A terminal for storing encrypted data, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the following steps are implemented: In response to a data encryption request, the format of the data to be encrypted is converted, the corresponding black hole number is generated by byte for the converted data to be encrypted, and the generation process of each black hole number is stored in a node of a binary tree, and all the generated black hole numbers are compressed to obtain compressed data; In response to a data decryption request, the compressed data is decompressed, and the decompressed black hole number is restored according to the node data in the binary tree to obtain the original data to be encrypted.

7. A terminal for data storage encryption according to claim 6, characterized in that: The format of the encrypted data is converted, and the corresponding black hole number is generated by bytes of the converted encrypted data, including: The data to be encrypted is converted into hexadecimal, and the converted data to be encrypted is paged, and two bytes are sequentially obtained from the data of each page and a corresponding black hole number is generated.

8. A terminal for data storage encryption according to claim 7, characterized in that: The generation process of each black hole number is stored in the node of the binary tree, including: When generating the corresponding black hole number according to the two bytes, converting the data corresponding to the two bytes into decimal to obtain calculation data, and recording the initial position identifier of each bit of the calculation data in the first node of the binary tree; The calculated data are rearranged and subtracted until the number of black holes is calculated, and the rearranged data and the corresponding rounds of each rearrangement and subtraction are recorded in sequence in the nodes after the first node.

9. A terminal for data storage encryption according to claim 8, characterized in that: The decompressed black hole number is restored according to the node data in the binary tree to obtain the original data to be encrypted, including: According to the node data in the binary tree, the rearrangement data and the corresponding rounds for each rearrangement and difference calculation are obtained in order from the back to the front of the nodes, so as to restore the rearrangement and difference calculation formula for each round; When the initial position identifier of the first node is obtained in the binary tree, the rearranged data of the last restored rearrangement difference formula is restored according to the initial position identifier to obtain the original data to be encrypted.

10. A terminal for data storage encryption according to claim 6, characterized in that: Compress all the generated black hole numbers to obtain compressed data, including: The number of times each black hole number is generated is counted, and the number of times each black hole number is generated and the number of digits of the decimal black hole number are used as compressed data.

Citation Information

Patent Citations

  • Sequence number encrypting method and cipher machine generated by sequencing

    CN101567781A

  • Method and system for information secrecy storage by encoding

    CN105245315A

  • Signature System and Signature Method

    US20080095360A1

  • KR20230078518A