A disk data erasing method, device and storage medium
By scrambling, grouping, and reorganizing the data blocks generated by true random numbers, the problem of time-consuming disk data erasure caused by the reliance on computer entropy in true random number generation is solved, achieving efficient and secure data erasure.
Patent Information
- Application Number
- CN202210676347.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-15
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2042-06-15
AI Technical Summary
In existing technologies, the generation of truly random numbers relies on computer entropy, which makes the disk data erasure process time-consuming and affects erasure efficiency.
By generating truly random numbers and then scrambling, grouping, and recombining them, irregular and meaningless data blocks are generated for overwriting, thereby improving erasure efficiency while ensuring security and irreversibility.
While improving disk data erasure efficiency, it ensures data security and irreversibility, and reduces overwrite time.
Smart Images

Figure CN115167759B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of disk data erasure technology, and in particular to a disk data erasure method, apparatus and storage medium. Background Technology
[0002] With the explosive growth of data volume in the cloud era, governments, businesses, and individuals are increasingly focused on data storage security. Traditional file deletion and disk formatting cannot completely erase data. Especially when obsolete disks enter the secondhand market, data is often recovered by criminals using recovery software, leading to privacy leaks. Therefore, how to securely and quickly erase disk data without damaging the disk has become a growing concern.
[0003] Currently, there are two common methods for deleting disk data: The first is deleting the file index, while the actual file data is not deleted from the disk. This data can be recovered using specific software programs, and it is the most common way to delete data in daily life. The second is data overwriting, which uses 0s, 1s, random numbers, etc., to overwrite all data on the disk, achieving the purpose of deletion. By repeatedly overwriting different content, it becomes irreversible. The second method is also known as two-dimensional erasure or data erasure. Using this method to erase confidential data on the disk is more reassuring.
[0004] Disks use magnetic recording technology to store binary data. When data needs to be completely deleted, it can be erased by overwriting other data. To increase the difficulty of recovery, or even for irreversible deletion, multiple overwrites are used. Various countries have proposed their own data erasure standards, such as national standards (three or seven overwrites), USDOD 5220.22-M, Russian GOST P50739-95, German VSITR, and the Peter Gutmann standard. In 1996, Peter Gutmann proposed the Gutmann algorithm in the June issue of the journal *Secure Deletion of Data from Magnetic and Solid-State Memory*. This algorithm involves repeatedly writing 35 segments of data to the disk segment to be erased, making data recovery in the erased area extremely difficult, almost impossible with current computing power. However, overwriting 35 times takes too long.
[0005] Each standard is overwritten multiple times, with different overwrite content, but all involve random numbers. Random numbers in computers can be pseudo-random or true random. Pseudo-random numbers are generated by a computer's random function according to a specific algorithm; their results are deterministic and predictable. True random numbers, on the other hand, rely on a physical random number generator, often utilizing more advanced and complex physical processes such as noise in electronic components—essentially entropy. By using true random numbers for overwriting, we can significantly increase the difficulty of recovery. Computer CPUs typically contain a True Random Number Generator (TRNG), which usually generates random numbers using thermal noise from amplified circuits.
[0006] However, the generation of truly random numbers depends on the entropy of the computer. If the acquisition frequency is too fast, it will be slow and time-consuming. Sometimes it is necessary to manually increase the entropy of the computer system, which makes the overwrite time too long.
[0007] Therefore, how to provide a disk data erasure method, device, and storage medium that can both improve the efficiency of disk data erasure and ensure the irreversibility of disk data erasure is an urgent problem to be solved. Summary of the Invention
[0008] In view of this, embodiments of the present invention provide a disk data erasure method, apparatus and storage medium to eliminate or improve one or more defects existing in the prior art.
[0009] One aspect of the present invention provides a disk data erasure method, apparatus, and storage medium, the method comprising the following steps:
[0010] Determine the current location on the disk to be erased;
[0011] When it is determined, based on a predetermined erasure strategy, that random numbers should be used for overwriting, the following steps are performed:
[0012] When overwriting for the first time using random numbers, a data block the size of the overwrite block is created using a true random number generator, and the created data block is used to overwrite the current location on the disk to be erased.
[0013] When overwriting using random numbers for the first time, the created data blocks are grouped and reassembled, and the reassembled data blocks are used to overwrite the current location on the disk to be erased.
[0014] In some embodiments of the present invention, before determining the starting position of the disk to be erased, the method further includes: setting up a disk data erasure environment, including calculating the size of the disk, initializing the erasure strategy, and initializing the size of the overwrite block.
[0015] In some embodiments of the present invention, the predetermined erasure strategy includes the number of erasures and the erasure method for each erasure, wherein the erasure method includes: overwriting with a fixed value and overwriting with a random number; the method further includes: when it is determined based on the predetermined erasure strategy that a fixed value should be used for overwriting, overwriting the current position to be erased on the disk with the fixed value or the complement of the fixed value.
[0016] In some embodiments of the present invention, when overwriting with random numbers for the first time, before grouping and reorganizing the created data blocks, the method further includes: scrambling the data blocks created with the true random numbers using a scrambling algorithm; the grouping and reorganizing of the created data blocks includes: grouping and reorganizing the scrambled data blocks.
[0017] In some embodiments of the present invention, the method of scrambling the data blocks created using the true random numbers using the scrambling algorithm includes: determining the number of particles in the data block based on the granularity of the data block, wherein the number of particles is an integer value obtained by dividing the size of the data block by the granularity; for each particle in the data block, obtaining the starting position of the target particle by taking the remainder of the starting position of the particle by the number of particles, and overwriting the data of the current particle with the data of the target particle.
[0018] In some embodiments of the present invention, the out-of-order operation is performed at a preset frequency.
[0019] In some embodiments of the present invention, the grouping and reorganization of the created data blocks includes: determining the total number of groups; dividing the data blocks equally according to the determined total number of groups to obtain multiple groups; and reordering and reorganizing the grouped data blocks.
[0020] In some embodiments of the present invention, the step of determining the total number of groups includes: taking the remainder of the first value of the data block with a preset constant greater than or equal to 10, and adding 1 to the remainder to obtain the total number of groups; the step of reordering and reorganizing the grouped data blocks includes: reorganizing multiple groups into data blocks in reverse order.
[0021] Another aspect of the present invention provides a disk data erasure apparatus, the apparatus including a processor and a memory, the memory storing computer instructions, the processor executing the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the apparatus implements the steps of any of the methods described in the above embodiments.
[0022] Another aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of any of the methods described in the above embodiments.
[0023] The disk data erasure method, apparatus, and storage medium of the present invention can improve the efficiency of disk data erasure based on true random numbers while ensuring the security and irreversibility of disk data erasure, and have broad application prospects.
[0024] Additional advantages, objects, and features of the invention will be set forth in part in the description which follows, and will also become apparent in part to those skilled in the art upon studying the description, or may be learned by practice of the invention. The objects and other advantages of the invention can be realized and obtained by means of the structures specifically pointed out in the description and drawings.
[0025] Those skilled in the art will understand that the objectives and advantages achievable with the present invention are not limited to those specifically described above, and that the above and other objectives achievable with the present invention will become clearer from the following detailed description. Attached Figure Description
[0026] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, are not intended to limit the scope of the invention. In the drawings:
[0027] Figure 1 This is a schematic diagram of a disk data erasure method in one embodiment of the present invention.
[0028] Figure 2 This is a schematic diagram of the disk data erasure process in one embodiment of the present invention.
[0029] Figure 3 This is a schematic diagram of a true random number generation process in one embodiment of the present invention. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the embodiments and accompanying drawings. Here, the illustrative embodiments and descriptions of this invention are used to explain the invention, but are not intended to limit the invention.
[0031] It should also be noted that, in order to avoid obscuring the invention with unnecessary details, only the structures and / or processing steps closely related to the solution according to the invention are shown in the accompanying drawings, while other details that are not closely related to the invention are omitted.
[0032] It should be emphasized that the term "including / comprises" as used herein refers to the presence of a feature, element, step, or component, but does not exclude the presence or addition of one or more other features, elements, steps, or components.
[0033] It should also be noted that, unless otherwise specified, the term "connection" in this article can refer not only to a direct connection, but also to an indirect connection involving an intermediary.
[0034] In the following description, embodiments of the invention will be illustrated with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar parts, or the same or similar steps.
[0035] To address the problem that existing true random number disk data erasure methods are time-consuming to generate and erase due to the dependence of true random number generation on computer entropy, this invention provides a disk data erasure method that obtains true random numbers only once. By scrambling, grouping, and reorganizing these true random numbers, the data to be overwritten becomes irregular and meaningless, greatly improving erasure efficiency while ensuring the security and irreversibility of disk data erasure.
[0036] In this invention, apart from the first truly random number obtained, the random numbers are obtained by recombining the computer's truly random numbers. These are differential, invalid, and irregular data. In multiple disk overwrites, using this random number generation method is faster than obtaining the computer's truly random numbers each time. While ensuring the security of disk erasure speed, it also achieves safe and fast disk data erasure.
[0037] Figure 1 This is a schematic diagram of a disk data erasure method according to an embodiment of the present invention. The method includes the following steps:
[0038] S100: Determine the current location on the disk to be erased.
[0039] S200: Based on a predetermined erasure strategy, determine that random numbers should be used for overwriting, and perform the following steps:
[0040] S210: When overwriting for the first time using random numbers, a data block of the size of the overwrite block is created using a true random number generator, and the created data block is used to overwrite the current location on the disk to be erased.
[0041] S220: When overwriting using random numbers for the first time, the created data blocks are grouped and reassembled, and the reassembled data blocks are used to overwrite the current location on the disk to be erased. Overwriting with data blocks generated by the grouping and reassembly method in step S220 can greatly improve the speed of disk data erasure, and since the data blocks generated by grouping and reassembly still fall within the concept of true random numbers, the security and irreversibility of disk data erasure are guaranteed.
[0042] Before step S100, the disk data erasure method of the present invention further includes: setting up a disk data erasure environment, including calculating the disk size, initializing the erasure strategy, and initializing the size of the overwrite block.
[0043] In the initialization of the erasure policy step, the erasure policy is either manually customized or imported from an existing erasure standard. Existing erasure standards include the Chinese National Standard (CNS) triple overwrite, the CNS seven overwrite, and the US DOD 5220.22-M erasure standard. Among them, the CNS triple overwrite involves overwriting a specified disk segment three times: the first overwrite is a fixed character, the second is the complement of this fixed character, and the third is a random number.
[0044] In the initialization of the overwrite block size, the size is typically n times 16KB (n≥1), with 16KB being the default. A disk sector is generally 512 bytes, with 4096 bytes being more efficient. Considering memory usage and the impact of concurrent erases across multiple disks, 16KB is a suitable size. Too small a size will lead to excessively frequent disk input and output (IO), resulting in slow data erasure; too large a size will lead to inefficiency during concurrent operations.
[0045] In step S210, the true random number generator is usually a hardware structure integrated into the CPU of a computer. The true random number generator usually generates true random numbers by amplifying the thermal noise of the circuit.
[0046] In some embodiments of the present invention, before step S220, the disk data erasure method of the present invention further includes: scrambling the data blocks created using true random numbers using a scrambling algorithm. Step S220 further includes: grouping and reassembling the scrambled data blocks. The combined use of the scrambling, grouping, and reassembling methods of the present invention further improves the randomness of the data blocks, ensuring the irreversibility of disk data erasure, that is, the disk data is unrecoverable, and does not affect the continued use of the disk. Actual testing shows that on the same computer, this method is 15% more efficient than the traditional method of generating true random numbers each time; this efficiency improvement is even greater when the computer's entropy is relatively low.
[0047] In step S220, the step of scrambling the data blocks created using true random numbers using a scrambling algorithm includes: determining the number of particles in the data block based on the granularity of the data block, where the number of particles is the integer value obtained by dividing the size of the data block by the granularity; for each particle in the data block, obtaining the starting position of the target particle by taking the remainder of the starting position of the particle by the number of particles, and overwriting the data of the current particle with the data of the target particle.
[0048] In one embodiment of the present invention, the out-of-order operation is performed at a preset frequency. Under the preset disk erasure strategy, the grouping and reorganization of created data blocks are performed in each round of disk data erasure based on random numbers. However, the out-of-order algorithm is used to out-of-order the data blocks created using true random numbers. That is, the out-of-order operation is performed at a preset frequency. For example, the data blocks are out-of-ordered once every 3 overwrites based on true random numbers, and the out-of-order data blocks are then grouped and reorganized.
[0049] In step S220, grouping and reorganizing the created data blocks includes: determining the total number of groups; dividing the data blocks equally according to the determined total number of groups to obtain multiple groups; and reordering and reorganizing the grouped data blocks.
[0050] In one embodiment of the present invention, the step of determining the total number of groups in step S220 includes: taking the remainder of the first value of the data block divided by a preset constant greater than or equal to 10, and adding 1 to the remainder to obtain the total number of groups. The step of reordering and reorganizing the grouped data blocks in step S220 includes: reorganizing multiple groups into data blocks in reverse order.
[0051] In one embodiment of the present invention, the predetermined erasure strategy includes the number of erasures and the erasure method for each erasure, wherein the erasure method includes: overwriting using a fixed value and overwriting using a random number. The method further includes: when it is determined based on the predetermined erasure strategy that a fixed value should be used for overwriting, overwriting the current location to be erased on the disk using the fixed value or the two's complement of the fixed value.
[0052] Figure 2 This is a schematic diagram of the disk data erasure process in one embodiment of the present invention, and the process is as follows:
[0053] Step 1: Set up the erase environment. This includes calculating the disk size, initializing the erase policy, and initializing the overwrite block size.
[0054] Step 2: Calculate the current position, check the erasure strategy used, and prepare to overwrite the data. (Note:)
[0055] The current position is the head position by default, which is the starting position for disk data erasure. It is usually initially set to 0. Then, the disk is overwritten based on the overwrite blocks until the entire disk is overwritten.
[0056] Based on the erasure strategy, it is determined whether the overwrite used a true random number, pseudo random number, fixed value, or fixed value complement, and the corresponding data overwrite block is obtained. During each disk overwrite process, the erasure strategy must be checked. For example, if the standard three-times overwrite erasure strategy is used, then the first and second overwrite values are fixed values, such as 0xAA and complement 0xD6, and the third is a true random number.
[0057] Step 3: Obtain the corresponding fixed value or true random number. If this is the first time using random numbers for overwriting, create a data block the size of the overwrite block using the true random number generated by the true random number generator, and use the created data block to overwrite the current location on the disk to be erased. If this is not the first time using random numbers for overwriting, group and reassemble the created data block, and use the reassembled data block to overwrite the current location on the disk to be erased. It should be noted that for non-first-time overwriting using random numbers, the random number processing can be performed directly through the processor's internal calculations, or the method can be integrated into the true random number generator, or a separate true random number generator can be created.
[0058] Step 4: After completing the overwrite operation, repeat steps 2-4 until the erasure strategy is completed.
[0059] Figure 3 This is a schematic diagram of a true random number generation process in one embodiment of the present invention, and the process is as follows:
[0060] Step 1: When overwriting for the first time using random numbers, use a true random number generator to create a data block the size of the overwrite block, and use the created data block to overwrite the current location on the disk to be erased.
[0061] Step 2: Randomize the data blocks created using truly random numbers using a randomization algorithm. The randomization algorithm is executed at a preset frequency; alternatively, the grouping and reassembly steps can be performed without executing the randomization algorithm.
[0062] Step 3: Divide the data blocks into smaller groups according to the grouping algorithm.
[0063] Step 4: Reassemble the grouped data blocks using a reassembly algorithm.
[0064] Step 5: Return the reassembled data blocks.
[0065] Repeat the above process each time a random number block needs to be obtained. Figure 3 Steps 2-5 of the content described above.
[0066] The content of the disordered order algorithm is as follows:
[0067] 1) The data block size is T, which is the size of the overwrite block, and the granularity is P, where 1≤P≤T, and T is an integer multiple of P. The smaller P is, the better the disordering effect. When it is equal to T, there is no disordering.
[0068] 2) K = T / P, where K is the total number of particles;
[0069] 3) Take the remainder of the value at position P (0, P, 2P...(K-1)) with respect to K to obtain I;
[0070] 4) Take the data from I to I+P to overwrite the data at the current position. For example, if the value at position 0 is v, j = v modulo K, then use the data from j to j+P to overwrite the data from 0 to P. Repeat this process until the last block.
[0071] The steps of the grouping algorithm are as follows:
[0072] 1) Take the remainder of the first value of the data block divided by Q;
[0073] 2) The remainder + 1 gives M. Where Q is a user-defined constant, requiring Q≥10; M is the total number of groups.
[0074] 3) Divide the database into M equal groups, where the size of the last group is the remaining data.
[0075] The steps of the recombination algorithm are as follows:
[0076] 1) Number the grouped data as 0, 1, 2... (M-1);
[0077] 2) Reassemble the data blocks in the order (M-1), (M-2)...1,0 (i.e., in reverse order).
[0078] The disk data erasure method of the present invention can improve the efficiency of disk data erasure based on true random numbers while ensuring the security and irreversibility of disk data erasure, and has broad application prospects.
[0079] Another aspect of the present invention provides a disk data erasure apparatus, the apparatus including a processor and a memory, the memory storing computer instructions, the processor executing the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the apparatus implements the steps of any of the methods described in the above embodiments.
[0080] Another aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any of the above embodiments. The computer-readable storage medium may be a tangible storage medium, such as random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, floppy disk, hard disk, removable storage disk, CD-ROM, or any other form of storage medium known in the art.
[0081] Those skilled in the art will understand that the exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Whether implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention. When implemented in hardware, it can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this invention are programs or code segments used to perform the desired tasks. The programs or code segments can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried in a carrier wave.
[0082] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.
[0083] In this invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or in place of features of other embodiments.
[0084] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. For those skilled in the art, various modifications and variations can be made to the embodiments of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for erasing disk data, characterized in that, The method includes the following steps: Determine the current location on the disk to be erased; When it is determined, based on a predetermined erasure strategy, that random numbers should be used for overwriting, the following steps are performed: When overwriting for the first time using random numbers, a data block the size of the overwrite block is created using a true random number generator, and the created data block is used to overwrite the current location on the disk to be erased. When overwriting using random numbers for the first time, the created data blocks are grouped and reassembled, and the reassembled data blocks are used to overwrite the current location on the disk to be erased. The steps of grouping and reorganizing the created data blocks include: determining the total number of groups; dividing the data blocks equally according to the determined total number of groups to obtain multiple groups, with the size of the last group being the remaining data; and reordering and reorganizing the grouped data blocks.
2. The method according to claim 1, characterized in that, Before determining the starting position of the disk to be erased, the method further includes setting up a disk data erasure environment, including calculating the disk size, initializing the erasure strategy, and initializing the size of the overwrite block.
3. The method according to claim 1, characterized in that, The predetermined erasure strategy includes the number of erasures and the erasure method for each erasure. The erasure method includes: overwriting with a fixed value and overwriting with a random number. The method further includes: when it is determined based on the predetermined erasure strategy that a fixed value should be used for overwriting, the fixed value or the complement of the fixed value is used to overwrite the current position to be erased on the disk.
4. The method according to claim 1, characterized in that, When overwriting with random numbers for the first time, before grouping and reorganizing the created data blocks, the method further includes: using a scrambling algorithm to scramble the data blocks created with the true random numbers; The process of grouping and reorganizing the created data blocks includes: grouping and reorganizing the disordered data blocks.
5. The method according to claim 4, characterized in that, The step of using a scrambling algorithm to scramble the data blocks created using the truly random numbers includes: The number of granularities in a data block is determined based on the granularity of the data block. This number of granularities is an integer value obtained by dividing the size of the data block by the granularity. For each particle in the data block, the starting position of the target particle is obtained by taking the remainder of the starting position value of the particle with the number of particles, and the data of the current particle is overwritten with the data of the target particle.
6. The method according to claim 4, characterized in that, The disordered algorithm is executed at a preset frequency.
7. The method according to claim 1, characterized in that, The step of determining the total number of groups includes: taking the remainder of the first value of the data block with a preset constant greater than or equal to 10, and adding 1 to the remainder to obtain the total number of groups; The reordering and reorganization of the grouped data blocks includes: reorganizing multiple groups into data blocks in reverse order.
8. A disk data erasure device, characterized in that, The device includes a processor and a memory, characterized in that the memory stores computer instructions, the processor executes the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the device implements the steps of the method as described in any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Data wiping method based on quantum random number
CN107562384A