Data erasing method and system, secure erasing switch and data erasing device

By detecting and parsing storage device information, generating configuration files and executing scripts, it solves the problem of data erasure on multiple media, realizes automated, secure and offline data erasure, ensures advanced data erasure and identity authentication, and solves the problem of traditional tools cumbersome operations and risks of illegal deletion.

CN118520520BActive Publication Date: 2024-10-01中电信量子信息科技集团有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410985649.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-10-01
Estimated Expiration
2044-07-23

AI Technical Summary

Technical Problem

It is difficult to achieve complete erasure of data on multiple types of storage media with existing technology, especially on encrypted storage devices. Traditional tools are cumbersome to operate, do not support offline erasure, and lack identity authentication, so there is a risk of data being illegally deleted. .

Method used

By detecting all storage media types and partition information of the target device, generate storage device entries, convert them into configuration files, parse them into execution scripts, create worker threads, map them to operation instances, perform data erasure operations, and use random numbers and encryption algorithms Combined with advanced erasure, it supports multiple erasure levels and offline triggers to achieve binding authentication of data and devices.

Benefits of technology

It realizes automatic data erasure on a variety of storage media, supports erasure at different security levels, ensures the irrecoverability and security of data, and supports offline erasure, which enhances identity authentication and ensures the reliability of data erasure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118520520B_ABST
    Figure CN118520520B_ABST
Patent Text Reader

Abstract

The present invention discloses a data erasure method and system, a security erasure switch and a data erasure device. The method comprises the following steps: after successfully logging in in response to a user login password, detecting all storage medium types and partition information of a target device and generating a plurality of storage device entries, wherein the storage device entries contain storage description information of the device; in response to an erasure command, converting the storage device entries and setting information into a configuration file, wherein the setting information includes an erasure level, an erasure policy entry and an erasure rule entry; parsing the configuration file, converting the storage description information in the configuration file into an execution script, and creating a working thread for each execution script; mapping each erasure rule into an operation instance, and using the working thread to traverse each operation instance to execute the data erasure operation of the target device; the present invention can realize data erasure of various types of storage media.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to a data erasing method and system, a security erasing switch and a data erasing device. Background Art

[0002] Data erasure technology uses a series of methods and processes to ensure that data stored on digital devices is completely deleted and cannot be recovered. This type of technology is very important for protecting personal privacy, business secrets, etc. It is usually divided into: logical erasure, physical destruction and verified erasure.

[0003] Encrypted storage is a security measure that uses encryption algorithms to protect data stored on digital devices, ensuring that the data remains confidential and intact in the event of unauthorized access. When clearing high-security data, especially when the data itself has been encrypted and saved, re-using encryption will make the data more unrecoverable than simply overwriting it with a write operation. Therefore, cryptographic technology is also often used to clear sensitive data.

[0004] Traditional data erasure tools mainly focus on clearing data from disk media. In addition, during the data clearing process, most tools require operators to interact with the clearing software on the device. They have shortcomings in media adaptability, ease of operation, and security, which can be briefly summarized as follows:

[0005] (1) It is not friendly to digital devices other than disk media. It is difficult for the tool to completely clear the storage data of embedded devices because the erasing tool does not support some types of devices, such as spi-flash; and the file system used by FLASH, such as yaffs, jffs, etc., may not be recognized by the erasing tool; in addition, some erasing tools may only focus on the data in the partition, but may not destroy the data structure of the partition itself, such as the partition table, file system log, etc., resulting in residual partition information.

[0006] (2) Triggering the clearing operation is conditional and requires the user to perform command operations, window operations, or restart the device, which is cumbersome.

[0007] (3) In an emergency, it is difficult to quickly perform the clearing operation because the erasing tool is usually operated through window UI software, mouse and keyboard. In some scenarios, if the device does not have access to such peripherals, the user will not be able to quickly perform the erasing operation.

[0008] (4) There is a lack of identity verification for personnel who perform data clearing operations, which creates a risk of illegal deletion of stored data.

[0009] (5) When the device is in a disconnected state (no display, no network, no debugging interface), data cannot be cleared offline.

[0010] In the related art, the patent application document with application publication number CN109495259A proposes a portable mobile terminal encryptor, which is used to inject cryptographic algorithm logic from the configuration computer through the USB interface, load different cryptographic algorithms to encrypt data, and can destroy the key inside the USB device through the key destroy button instead of clearing the data on the digital device. The patent application document with application publication number CN107566407A proposes to use random numbers for multiple overwrites to achieve data destruction, but random number overwrites are only used to erase sensitive data and are not suitable for erasing highly sensitive data; in addition, the solution only provides erasure of FAT file format and is not universal. The patent application document with application publication number CN109711208A also uses random numbers for multiple overwrites to achieve data destruction, and the solution only supports data erasure of USB interface storage devices and cannot support data erasure of media of multiple types and interfaces. Summary of the invention

[0011] The technical problem to be solved by the present invention is how to realize data erasure on various types of storage media.

[0012] The present invention solves the above technical problems by the following technical means:

[0013] In a first aspect, the present invention provides a data erasure method, the method comprising:

[0014] In response to a successful login with a user login password, detecting all storage media types and partition information of the target device and generating a plurality of storage device entries, wherein the storage device entries include storage description information of the device;

[0015] In response to an erase command, converting the storage device entry and setting information into a configuration file, wherein the setting information includes an erase level, an erase policy entry, and an erase rule entry;

[0016] Parsing the configuration file, converting the storage description information in the configuration file into an execution script, and creating a working thread for each execution script;

[0017] Each erasure rule is mapped to an operation instance, and the working thread is used to traverse each operation instance to execute the data erasure operation of the target device.

[0018] Furthermore, the storage description information includes storage medium type, storage space and partition information, and the storage space includes device capacity and used space.

[0019] Furthermore, the erasure policies of the erasure policy entries are arranged according to the type of storage medium and the erasure level, and the erasure policies are used to describe the way of clearing data in the storage medium;

[0020] The structure of the erase strategy is defined as:

[0021] method_type_{ops1_count}

[0022] The method field indicates that the current entry is an erase policy entry, the type field indicates the type of storage medium, the ops1 field indicates the erase field, and the count field is used to identify the number of times the previous ops1 field is executed.

[0023] Furthermore, the erasure rule in the erasure rule entry is used to describe the operation mode of data clearing, and the structure of the erasure rule is defined as:

[0024] action_ops2[_engine]

[0025] The action field indicates that the current entry is an erase rule entry, the ops2 field indicates a clear operation to write to the storage medium, the engine field indicates calling the avx hardware acceleration unit or the neon hardware acceleration unit, and [ ] indicates a non-required field.

[0026] Furthermore, the erasure levels include a basic erasure level, a medium erasure level and an advanced erasure level, wherein:

[0027] The basic clearing level is to write overwritten data to the storage medium in a single pass;

[0028] The medium clearing level is to write overwritten data to the storage medium multiple times;

[0029] The advanced erasure level is to use a random number combined with an encryption algorithm to erase the data in the storage medium;

[0030] The overwriting data is a fixed number, a random number, or a sequential number.

[0031] Furthermore, the method of erasing data in a storage medium by combining a random number with an encryption algorithm includes:

[0032] Using random numbers as encryption keys, the sensitive data to be erased in the storage medium is subjected to multiple rounds of substitution, replacement, and key addition operations through a block cipher algorithm, and the encryption key is destroyed after completion.

[0033] Further, after parsing the configuration file, converting the storage description information in the configuration file into an execution script, and creating a working thread for each execution script, the method further includes:

[0034] When it is determined that the system disk or the primary partition in the storage description information is true, the mount point directory of the configuration file is read; if the system disk or the primary partition in the storage description information is false, the erasure strategy is directly executed on the storage partition, and no temporary mount point is established in the memory;

[0035] Copy the basic library, dynamic linker, and basic commands to the mount point directory;

[0036] Terminate all user-mode processes except the erasing process, and remount the root file system to the mount point directory;

[0037] All storage medium partitions mounted on the target device are unmounted, and then the working thread is executed.

[0038] Furthermore, mapping each erasure rule to an operation instance, and using the working thread to traverse each operation instance to perform the data erasure operation on the target device, includes:

[0039] Determine the type of storage medium and fill in the corresponding software erasure tool interface;

[0040] Reading an erasure field of the erasure policy and filling an erasure rule set, wherein the erasure rule set is a set of erasure rule entries obtained by decomposing the erasure policy;

[0041] Read the execution count field of the erasure strategy to obtain the execution count;

[0042] Mapping each erasure rule in the erasure rule set to an operation instance;

[0043] Execute the working thread to traverse all operation instances in sequence, and each operation instance is executed cyclically according to the execution number;

[0044] Write 0 to the address segment of all partition information of the target device, wherein the partition information includes sector 0, a primary partition header, a primary partition table, a backup partition header and a backup partition table.

[0045] Furthermore, after the execution of the work thread sequentially traverses all operation instances and each operation instance is executed cyclically according to the execution number, the method further includes:

[0046] When it is determined that there is an encryption algorithm call in the erasure rule, the encryption key data structure of the symmetric encryption algorithm in the cache is deleted.

[0047] Furthermore, the method further comprises:

[0048] A random number cache is created through a random thread to store the random sequence required for data erasure operations.

[0049] Furthermore, before detecting all storage media types and partition information of the target device and generating a plurality of storage device entries in response to the user login password, the method further includes:

[0050] When the data erasure switch is detected to be inserted, the login password input by the user is transmitted to the data erasure switch, so that the data erasure switch saves the hash value of the login password;

[0051] Sending the device information and the public key request of the target device to the data erasure switch, so that the data erasure switch creates a key pair based on the public key request and signs the device information with the private key in the key pair to obtain a signature file;

[0052] The public key and the device index number returned by the data erasure switch are received and saved to achieve binding with the data erasure switch.

[0053] Furthermore, the method further comprises:

[0054] When the data erase switch is detected to be inserted, an authentication request and a device index number are sent to the data erase switch;

[0055] The signature file returned by the data erasure switch is received, and the signature file is verified based on the public key and the device information, and the authentication result obtained by the verification is sent to the erasure switch.

[0056] Furthermore, the method further comprises:

[0057] When the authentication result is successful, in response to the switch signal sent by the data erasing switch, polling the state of the switch signal, and performing an erasing operation on the data of the target device;

[0058] When the authentication result is authentication failure, the switch signal sent by the data erasing switch is locked.

[0059] Furthermore, after successfully logging in in response to the user login password, before detecting all storage media types and partition information of the target device and generating a plurality of storage device entries, the method further includes:

[0060] Transmitting the login password input by the user to the data erasure switch so that the data erasure switch calculates a hash value of the login password, and compares the currently calculated hash value of the login password with the hash value of the login password calculated during the device binding process;

[0061] Receive the hash value comparison result returned by the data erasure switch to determine whether the login is successful.

[0062] In a second aspect, the present invention provides a data erasure method, the method comprising:

[0063] The data erasure switch is mounted to the operating system of the target device in slave mode and the data secure erasure software image package is installed;

[0064] Receive device information sent by the target device, sign the device information, obtain a signature file and complete binding with the target device;

[0065] Receive an authentication request sent by a target device, and return the signature file to the target device based on the authentication request so that the target device can verify the signature and obtain an authentication result;

[0066] When receiving the authentication result that the authentication is successful, sending a switch signal to the target device so that the target device polls the state of the switch signal and performs an erasing operation on the data of the target device;

[0067] When receiving that the authentication result is authentication failure, sending a switch signal to the target device so that the target device locks the switch signal.

[0068] Further, the receiving device information sent by the target device, signing the device information, and obtaining a signature file to complete binding with the target device includes:

[0069] Receive a login password input by a user sent by a target device, and save a hash value of the login password;

[0070] Receive device information and a public key request sent by the target device, create a key pair based on the public key request, and use the private key in the key pair to sign the device information to obtain a signature file;

[0071] The public key and the device index number in the key pair are returned to the target device to achieve binding with the target device.

[0072] Further, the receiving of the authentication request sent by the target device, and returning the signature file to the target device based on the authentication request so that the target device verifies the signature to obtain the authentication result, includes:

[0073] Receive an authentication request and a device index number sent by a target device, and return the signature file to the target device based on the authentication request, so that the target device verifies the signature file based on the public key and the device information to obtain an authentication result;

[0074] Receive the authentication result sent by the target device.

[0075] Furthermore, the switch signal includes executing a user-set or default data clearing policy, executing a full disk data default policy, executing a full disk data complex policy, and an invalid operation.

[0076] Furthermore, the method further comprises:

[0077] Displays the current wipe status of the target device.

[0078] In a third aspect, the present invention further proposes a data erasure system, the system comprising:

[0079] A daemon process, configured to detect all storage media types and partition information of a target device and generate a plurality of storage device entries after successfully logging in in response to a user login password, wherein the storage device entries include storage description information of the device;

[0080] and for, in response to an erase command, invoking a data erase policy generator to convert the storage device entry and setting information into a configuration file, wherein the setting information includes an erase level, an erase policy entry, and an erase rule entry;

[0081] A rule parser is used to parse the configuration file, convert the storage description information in the configuration file into an execution script, and create a working thread for each execution script; and map each erasure rule to an operation instance, and use the working thread to traverse each operation instance to execute the data erasure operation of the target device.

[0082] In a fourth aspect, the present invention further proposes a client, comprising a memory and a processor; wherein the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the data erasure method described in the first aspect above.

[0083] In a fifth aspect, the present invention proposes a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the data erasure method as described in the first aspect above is implemented.

[0084] In a sixth aspect, the present invention proposes a data erase switch, comprising: a random number entropy source, an algorithm cryptographic component, a main controller, an off-chip FLASH, and an erase switch, wherein the output of the random number entropy source is connected to the main controller and the off-chip FLASH, the output of the erase switch is connected to the main controller, and the output of the main controller and the output of the algorithm cryptographic component are both connected to a USB interface via a USB connector;

[0085] The USB interface is used to insert the target device so that the erase switch is mounted to the operating system of the target device in slave mode and the data security erase software image package is installed, wherein the off-chip FLASH is used to store the operation log and the installation image of the security erase software;

[0086] The main controller is used to receive device information sent by the target device, call the algorithm cryptographic component to sign the device information, obtain the signature file and store it in the main controller, and complete the binding with the target device; receive the authentication request sent by the target device, and return the signature file to the target device based on the authentication request so that the target device verifies the signature and obtains the authentication result;

[0087] The erase switch is used to generate a switch signal and send it to a target device, so that the target device polls the state of the switch signal or locks the switch signal;

[0088] The random number entropy source is used to provide random numbers for data erasure.

[0089] In a seventh aspect, the present invention provides a data erasing device, including a data erasing switch and a data erasing system installed in a target device, wherein the data erasing system includes:

[0090] A daemon process, configured to detect all storage media types and partition information of a target device and generate a plurality of storage device entries after successfully logging in in response to a user login password, wherein the storage device entries include storage description information of the device;

[0091] and for converting the storage device entries and setting information into a configuration file in response to an erase command or a switch signal sent offline by the data erase switch, wherein the setting information includes an erase level, an erase policy entry, and an erase rule entry;

[0092] A rule parser is used to parse the configuration file, convert the storage description information in the configuration file into an execution script, and create a working thread for each execution script; map each erasure rule to an operation instance, and use the working thread to traverse each operation instance to execute the data erasure operation of the target device.

[0093] The advantages of the present invention are:

[0094] (1) The present invention generates storage device entries by detecting all storage media types and partition information of the target device, and obtains a configuration file based on the storage device entries and setting information. The configuration file is parsed to convert the storage description information obtained by the parsing into an execution script. The operation instances obtained by mapping the erasure rules are traversed through the working threads created by each execution script to execute data erasure operations on various types of storage media of the target device. The present invention can complete data erasure operations on various types of storage media by automatically scanning the storage media types of the target device, and the operation is simple, and the user does not need to operate the software or reset the device.

[0095] (2) The present invention supports logical erasure of data of different security levels by setting multiple erasure levels, including basic erasure level, medium erasure level and advanced erasure level, and can support multiple application scenarios, and supports erasing of all disk data when the system is running.

[0096] (3) The advanced clearing level provided by the present invention supports clearing of highly sensitive data based on a commercial symmetric algorithm.

[0097] (4) The present invention adds a hardware control mode, supports hardware offline triggered erasing operations and software triggered erasing operations, and can realize offline data clearing when the target device is in a disconnected state.

[0098] (5) No other peripherals are required. After the hardware switch is pressed, the software will directly execute the pre-set or default erase strategy. The user does not need to make any settings during the process. The software will automatically generate an erase strategy for all storage devices identified by the system. In addition to data, the file system and partition information itself are also within the scope of clearing.

[0099] (6) The present invention designs a binding authentication process between the data erasing switch and the target device to authenticate the identity of the person who performs the data erasing operation, thereby ensuring the security and reliability of data erasing.

[0100] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0101] Figure 1 is a flow chart of a data erasing method proposed in the first embodiment of the present invention;

[0102] Figure 2 is a flow chart of a data erasing method proposed in the second embodiment of the present invention;

[0103] Figure 3 is a structural schematic diagram of a data erasure system proposed in a third embodiment of the present invention;

[0104] Figure 4 is a structural schematic diagram of a data erasing switch proposed in a fourth embodiment of the present invention;

[0105] Figure 5 It is a structural schematic diagram of a data erasing device proposed in the fifth embodiment of the present invention. DETAILED DESCRIPTION

[0106] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described in combination with the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0107] Example 1

[0108] like Figure 1 As shown, a data erasing method proposed in the first embodiment of the present invention is applied to a target device to be cleared of data, and the method comprises the following steps:

[0109] S101, in response to a user successfully logging in with a login password, detecting all storage media types and partition information of a target device and generating a plurality of storage device entries, wherein the storage device entries include storage description information of the device;

[0110] It should be noted that this embodiment actively identifies the storage media of the target device through the daemon process, and provides users with security erasure rules and algorithms of different erasure levels, configures default or user-defined data erasure policies, and after the user successfully logs in, all detected storage media and partitions will be displayed by default. The user can set each detected storage medium in the command line, and can also set the full disk clearing mode.

[0111] Specifically, after all storage devices are powered on, they will negotiate with the kernel at the physical layer, i.e., the hardware identification process. During this process, the kernel will trigger an event. Through the uevent technology, the bus and hardware information submitted by the device can be actively obtained, thereby identifying the media type. Then, based on the storage media of the target device being detected, a storage device database is generated, which stores storage device entries.

[0112] This embodiment obtains storage-related hardware information from kernel events through a user-mode interface opened by uevent, and then calls different tools or custom programming for different media types to implement clearing operations.

[0113] S102, in response to an erase command, converting the storage device entry and setting information into a configuration file, wherein the setting information includes an erase level, an erase policy entry, and an erase rule entry;

[0114] It should be noted that this embodiment specifically converts the storage device entries and setting information into the data serialization format of YAML.

[0115] S103, parsing the configuration file, converting the storage description information in the configuration file into an execution script, and creating a working thread for each execution script;

[0116] S104: Map each erasure rule to an operation instance, and use the work thread to traverse each operation instance to execute a data erasure operation on the target device.

[0117] This embodiment parses the configuration file, converts the storage description information obtained by the parsing into an execution script, and traverses the operation instances obtained by mapping the erasure rules through the work thread created for each execution script to execute the data erasure operation on various types of storage media of the target device; the present invention can complete the data erasure operation on various types of storage media by automatically scanning the storage medium type of the target device, and the operation is simple, and the user does not need to operate the software or reset the device

[0118] Furthermore, the process of user login and user information setting is as follows:

[0119] Insert the hardware data wipe switch into the USB port of the target device.

[0120] The user opens the erasure software client installed on the target device and enters the login password;

[0121] The daemon passes the login password to the data erasure switch, which calculates the hash value of the password and returns the comparison result of the hash value to the target device.

[0122] It should be noted that if the user uses software to perform the erase operation, a password is required to log in. If the hash value comparison is inconsistent, the login is not allowed. If the hash value comparison results are consistent and the login is successful, all detected storage media and partitions are displayed in the form of a device tree as follows:

[0123] localhost

[0124] |—sda (Device, Type: SSD)

[0125] |——sdal (Partition, Type: part, Size: 500M, FS: ext4, Boot)

[0126] |——sda2 (Partition, Type: part, Size: 1G, Fs: swap)

[0127] |——sda3 (Partition, Type: part, Size: 18.5G, FS: ext4, Primary)

[0128] |—sdb (Device, Type: HD)

[0129] |——sdbl (Partition, Type: part, Size: 100G, FS: xfs)

[0130] |—sdc (Device, Type: HD)

[0131] |——sdcl (Partition, Type: part, Size: 200G, FS: ntfs)

[0132] |——sdc2 (Partition, Type: part, Size: 300G, Fs: ntfs)

[0133] |—nvme0nl(Device,Type: nvme)

[0134] |——nvme0nlpl (Partition, Type: part, Size: 512M, FS: vfat, Boot)

[0135] |——nvme0nlp2 (Partition, Type: part, Size: 100G, FS: ext4)

[0136] |——nvme0nlp3 (Partition, Type: part, Size: 200G, FS: btrfs,Primary)

[0137] |—mtdl (Device, Type: flash)

[0138] |——mtdblock0 (Partition,Type: part, Size: 32G, FS: fat32, Boot)

[0139] As a further preferred technical solution, the storage description information includes storage medium type, storage space and partition information, and the storage space includes device capacity and used space.

[0140] It should be noted that the information contained in a single storage device entry is: device file name, device capacity, used space, partition table, and encryption protection enabled. The device file name refers to the name of the device node that the storage device driver has registered in the kernel (such as sda); encryption protection enabled refers to whether the storage device currently uses encrypted storage to obtain the partition. Enabled means that the physical data stored in the storage device is ciphertext itself. For this type of storage, the erasure strategy is different. Instead of erasing data, the key and partition information are directly erased.

[0141] Furthermore, this embodiment automatically traverses the storage device database to obtain all storage types, storage spaces and partition information of the target device. Through user settings or default levels, a configuration file is generated, and the configuration file includes a storage medium configuration file and a full disk erase configuration file, wherein the storage medium configuration file includes: the file name of the storage device, the medium type, the partition configuration information, the erase level, the implemented erase strategy and the erase rule set. The full disk erase configuration file includes: a storage device list, a memory mount directory, an erase level, an implemented erase strategy and an erase rule set.

[0142] It should be pointed out here that under the system, a storage medium can have multiple hardware-independent storage devices. For example, a mechanical hard disk is a disk-type medium, and a device may have multiple mechanical hard disks installed.

[0143] Among them, disks represents the storage medium configuration file. The following is an example:

[0144] disks:

[0145] —disk_id: "diskl"

[0146] device_type: "SSD"

[0147] partitions:

[0148] —partition_id: "partition1"

[0149] capacity:"500GB"

[0150] remaining_usage: "200GB"

[0151] is_system: true

[0152] — partition_id: "partition2"

[0153] capacity: "250GB"

[0154] remaining_usage: "150GB"

[0155] is_system: false

[0156] clear_class: l"

[0157] clear_method: "method_d_0_1_1_1 random_1"

[0158] clear_rules: ["action_0", "action_1", "action_random"]

[0159] Among them, fd represents the full - disk erasure configuration file instance as follows:

[0160] fd_1:

[0161] — disk_id_list: ["diskl", "disk2", "flashl"]

[0162] tmp_mount_dir: / run / tmp_rootfs

[0163] clear_class: 2"

[0164] clear_method: "method_fd_random_1_sm4_avx_2"

[0165] clear_rules: ["action_sm4", "action_random"]

[0166] fd_default:

[0167] — disk_id_list: ["diskl", "disk2", "flashl"]

[0168] tmp_mount_dir: / run / tmp_rootfs

[0169] clear_class: "0"

[0170] clear_method: "method_fd_0_2_1_2_random_1"

[0171] clear_rules:["action","action1","action_randoml"]

[0172] As a further preferred technical solution, the erasure strategy of the erasure strategy entry is arranged according to the type of storage medium and the erasure level, and the erasure strategy is used to describe the method of clearing data in the storage medium;

[0173] The structure of the erase strategy is defined as:

[0174] method_type_{ops1_count}

[0175] The method field indicates that the current entry is an erase policy entry, the type field indicates the type of storage medium, the ops1 field indicates the erase field, and the count field is used to identify the number of times the previous ops1 field is executed.

[0176] Specifically, the definitions of the fields of the erasure strategy are shown in Table 1 below:

[0177] Table 1 Field definitions of the erasure policy

[0178]

[0179] The default erasure strategy mapped to each erasure level is shown in Table 2 below:

[0180] Table 2 Erasure strategies corresponding to data erasure levels

[0181]

[0182] It should be noted that the erasure level is used to describe the complexity of the erasure process. Each erasure level is composed of different erasure strategies, and the erasure strategy can be decomposed into several erasure rule entries.

[0183] As a further preferred technical solution, the erasure rule in the erasure rule entry is used to describe the operation mode of data clearing, and the structure of the erasure rule is defined as:

[0184] action_ops2[_engine]

[0185] The action field indicates that the current entry is an erase rule entry, the ops2 field indicates a clear operation to write to the storage medium, the engine field indicates calling the avx hardware acceleration unit or the neon hardware acceleration unit, and [ ] indicates a non-required field. This field is optional because some CPU architectures do not have the hardware acceleration function represented by this field.

[0186] Specifically, the ops2 field definition is shown in Table 3:

[0187] Table 3 ops2 field definition

[0188]

[0189] The engine field is optional and is only valid when ops is defined as aes / sm4. The engine field definition is shown in Table 4:

[0190] Table 4 engine field definition

[0191]

[0192] As a further preferred technical solution, the erasure levels include a basic erasure level, a medium erasure level and an advanced erasure level, wherein:

[0193] The basic clearing level is to write overwritten data to the storage medium in a single pass;

[0194] The medium clearing level is to write overwritten data to the storage medium multiple times;

[0195] The advanced erasure level is to use a random number combined with an encryption algorithm to erase the data in the storage medium;

[0196] The overwriting data is a fixed number, a random number, or a sequential number.

[0197] Specifically, the data erasure levels set in this embodiment are defined as follows:

[0198] (1) Basic clear (class 0): A single pass is used to write overwritten data to the storage medium. The overwritten data can be a fixed number such as all zeros or all ones, or it can be random data.

[0199] It should be noted that the basic clearing level set in this embodiment is used to erase non-sensitive data and only needs to meet basic data erasure requirements.

[0200] It should be noted that after the non-sensitive data in the storage medium is erased through the basic clearing level, some areas of the disk are randomly sampled and checked to ensure that the data is overwritten.

[0201] (2) Moderate clear (class 1): Overwrite data by writing to the storage medium multiple times, which may include different data patterns (such as all 0s first, then all 1s, and then random data).

[0202] It should be noted that the medium clearing level set in this embodiment is used for data that needs to be kept confidential but is not sensitive data that is important or confidential.

[0203] It should be noted that after the sensitive data in the storage medium is erased through the medium clearing level, a sample read is performed on all areas of the disk to ensure that the data has been overwritten.

[0204] (3) Advanced clearing (class 2): Use random numbers and cryptographic algorithms to erase sensitive data on the device, and use block cipher algorithms to perform multiple rounds of substitution, replacement, and key addition operations on the erased data. After completion, the encryption key is destroyed. After executing this process multiple times, the sensitive data will be unrecoverable, completing the purpose of secure erasure.

[0205] It should be noted that the advanced clearing level set in this embodiment is used to perform an erasing operation on highly confidential or extremely sensitive data.

[0206] It should be noted that after erasing highly sensitive data in the storage medium through the advanced clearing level, the disk header and tail sectors are read completely and each partition is sampled to detect whether there is any data remaining.

[0207] In particular, the erasure level is set to class 0 by default.

[0208] As a further preferred technical solution, in step S30: after parsing the configuration file, converting the storage description information in the configuration file into an execution script, and creating a working thread for each execution script, the method further includes the following steps:

[0209] When it is determined that the system disk or the primary partition in the storage description information is true, reading the mount point directory of the configuration file;

[0210] Copy the basic library, dynamic linker, and basic commands to the mount point directory;

[0211] Terminate all user-mode processes except the erasing process, and remount the root file system to the mount point directory;

[0212] All storage medium partitions mounted on the target device are unmounted, and then the working thread is executed.

[0213] It should be noted that basic commands are the most basic commands to maintain the operation of a system software. These commands and libraries cannot be deleted directly because the deletion operation itself will also use these basic commands. Forcibly deleting them will cause the operation to fail, directly resulting in system unavailability and inability to continue to clear the remaining data.

[0214] It should be noted that when it is determined that the system disk or primary partition in the storage description is true, a temporary operating environment is first constructed to the memory mount point and set as a temporary root file system; if the system disk or primary partition in the storage description information is false, the erase strategy is directly executed on the storage partition, and no temporary mount point is established in the memory.

[0215] As a further preferred technical solution, the step S40: mapping each erasure rule to an operation instance, and using the working thread to traverse each operation instance to perform the data erasure operation on the target device, includes the following steps:

[0216] S41, determining the type of storage medium, and filling in the corresponding software erasure tool interface;

[0217] It should be noted that different storage media require different operating tools. For example, flash memory requires flashtools, and hard disks require fdisk, partd and other tools.

[0218] S42, reading the erasure field of the erasure policy and filling the erasure rule set;

[0219] It should be noted that, through the rule parser, the erasure policy can be decomposed into a set of erasure rule entries.

[0220] S43, reading the execution count field of the erasure strategy to obtain the execution count;

[0221] Specifically, this embodiment reads the ops field of the method, fills the erasure rule set, and reads the count field of the method to obtain the number of executions as the loop count.

[0222] S44, mapping each erasure rule in the erasure rule set to an operation instance;

[0223] S45, executing the work thread to traverse all operation instances in sequence, and each operation instance is executed cyclically according to the execution number;

[0224] S46. Write 0 to the address segment of all partition information of the target device, where the partition information includes sector 0, a primary partition header, a primary partition table, a backup partition header, and a backup partition table.

[0225] Furthermore, in the step S45: executing the work thread to sequentially traverse all operation instances, after each operation instance is cyclically executed according to the execution number, the method further includes:

[0226] When it is determined that there is an encryption algorithm call in the erasure rule, the encryption key data structure in the cache is deleted.

[0227] As a further preferred technical solution, the method further comprises the following steps:

[0228] A random number cache is created through a random thread to store the random sequence required for data erasure operations.

[0229] Specifically, in addition to creating a working thread, this embodiment also maintains a special thread to create a fixed-size random number block as an entropy source for random number erase operations. This thread, as a pseudo-random number generator (PRNG), uses the random number entropy source in the hardware data erase switch as a seed to generate a random sequence. By creating a special thread, the random number generation speed is increased to avoid slow random number generation that affects erase efficiency.

[0230] It should be noted that the operation object of the working thread is the device file, which is a system abstraction of different types of storage media, as shown in Table 5 below:

[0231] Table 5 Work thread operation objects

[0232]

[0233] As a further preferred technical solution, this embodiment binds the target device to the secure erase switch to implement one-way authentication before performing the data erase operation. After the erase daemon is run for the first time, the data erase switch hardware is detected, and the target device information is sent to the data erase switch. The data erase switch signs the target device information and saves the signature file to the on-chip flash, completing the binding of the data erase switch and the target device.

[0234] Specifically, before the step S10: detecting all storage media types and partition information of the target device and generating a plurality of storage device entries in response to the user login password, the method further includes a device binding process, specifically:

[0235] When the data erasure switch is detected to be inserted, the login password input by the user is transmitted to the data erasure switch, so that the data erasure switch saves the hash value of the login password using the SM3 algorithm or the SM4 algorithm;

[0236] Sending the device information and the public key request of the target device to the data erasure switch, so that the data erasure switch creates a key pair based on the public key request and signs the device information with the private key in the key pair to obtain a signature file;

[0237] The public key and the device index number returned by the data erasure switch are received and saved to achieve binding with the data erasure switch.

[0238] The process of one-way authentication between the target device and the secure erase switch includes:

[0239] When the data erase switch is detected to be inserted, an authentication request and a device index number are sent to the data erase switch;

[0240] The signature file returned by the data erasure switch is received, and the signature file is verified based on the public key and the device information, and the authentication result obtained by the verification is sent to the erasure switch.

[0241] It should be noted that this embodiment designs a binding authentication process between the data erasing switch and the target device to authenticate the identity of the person who performs the data erasing operation, thereby ensuring the security and reliability of data erasing.

[0242] As a further preferred technical solution, the method further comprises the following steps:

[0243] When the authentication result is successful, in response to the switch signal sent by the data erasing switch, polling the state of the switch signal, and performing an erasing operation on the data of the target device;

[0244] When the authentication result is authentication failure, the switch signal sent by the data erasing switch is locked.

[0245] It should be noted that the logs of the erasing operation triggered in response to the switch signal and the erasing operation triggered in response to the user using the erasing command will be saved in the data erasing switch.

[0246] It should be noted that the present embodiment adds a hard control mode, supports hardware offline triggered erasing operation and software triggered erasing operation, and can realize offline data clearing when the target device is in a disconnected state.

[0247] Example 2

[0248] like Figure 2 As shown, the second embodiment of the present invention proposes a data erasing method, which is applied to a data erasing switch and includes the following steps:

[0249] S201, the data erasure switch is mounted to the operating system of the target device in slave mode, and a data security erasure software image package is installed;

[0250] S202, receiving device information sent by the target device, and signing the device information to obtain a signature file to complete binding with the target device;

[0251] S203, receiving an authentication request sent by the target device, and returning the signature file to the target device based on the authentication request so that the target device verifies the signature and obtains an authentication result;

[0252] S204, when receiving the authentication result that the authentication is successful, sending a switch signal to the target device so that the target device polls the state of the switch signal, and performing an erasing operation on the data of the target device;

[0253] S205: When receiving the authentication result that the authentication fails, sending a switch signal to the target device so that the target device locks the switch signal.

[0254] As a further preferred technical solution, the step S202: receiving device information sent by the target device, signing the device information, obtaining a signature file to complete binding with the target device, includes the following steps:

[0255] Receive a login password input by a user sent by a target device, and save a hash value of the login password;

[0256] Receive device information and a public key request sent by the target device, create a key pair based on the public key request, and use the private key in the key pair to sign the device information to obtain a signature file;

[0257] The public key and the device index number in the key pair are returned to the target device to achieve binding with the target device.

[0258] It should be noted that the data wipe switch can save multiple device signature files.

[0259] As a further preferred technical solution, the step S203: receiving an authentication request sent by a target device, and returning the signature file to the target device based on the authentication request so that the target device verifies the signature to obtain an authentication result, includes the following steps:

[0260] Receive an authentication request and a device index number sent by a target device, and return the signature file to the target device based on the authentication request, so that the target device verifies the signature file based on the public key and the device information to obtain an authentication result;

[0261] Receive the authentication result sent by the target device.

[0262] As a further preferred technical solution, the switch signal includes executing a user-set or default data clearing policy, executing a full disk data default policy, executing a full disk data complex policy, and an invalid operation.

[0263] Specifically, the erase switch may be a micro switch. The user sends a data clearing signal to the target device by pressing the micro switch. The signal mode is shown in Table 5 below:

[0264] Table 6 Signal mode of data erase switch

[0265] Number of presses within 3 seconds Signal Definition 1 Enforce user-defined or default data clearing policies 2 Execute the default policy for all disk data (speed priority) 3 Execute complex strategies for all disk data (security first) Other values Invalid operation

[0266] It should be noted that the three erasure strategies shown in Table 6 are shown in Table 1 and Table 2 above.

[0267] As a further preferred technical solution, the method further includes:

[0268] Displays the current wipe status of the target device.

[0269] Specifically, the erasing status includes states such as waiting for signal input, invalid signal input, clearing operation in progress, clearing operation completed, device authentication failed, and not bound to the device.

[0270] Example 3

[0271] like Figure 3 As shown, the third embodiment of the present invention provides a data erasure system, the system comprising:

[0272] A daemon process, configured to detect all storage media types and partition information of a target device and generate a plurality of storage device entries after successfully logging in in response to a user login password, wherein the storage device entries include storage description information of the device;

[0273] and for, in response to an erase command, invoking a data erase policy generator to convert the storage device entry and setting information into a configuration file, wherein the setting information includes an erase level, an erase policy entry, and an erase rule entry;

[0274] A rule parser is used to parse the configuration file, convert the storage description information in the configuration file into an execution script, and create a working thread for each execution script; and map each erasure rule to an operation instance, and use the working thread to traverse each operation instance to execute the data erasure operation of the target device.

[0275] The daemon is the core process of the system, which is mainly used to monitor the data erase switch and the underlying events of the storage medium. Through event-driven, it actively identifies the storage medium of the device and generates a storage device database. The single storage device entry stored in the storage device database includes: device file name, device capacity, used space, partition table, and encryption protection enabled. Upon receiving the erase command or switch signal, the policy generator is called. And the random number entropy source of the erase switch is periodically collected. Through the daemon, users are provided with different levels of security erase rules and algorithms, and default or customized data clearing policies are configured.

[0276] Furthermore, the data erasure levels set by this system include basic erasure level, medium erasure level and advanced erasure level. The system is also provided with a cryptographic algorithm library and a random number cache, which clear highly sensitive data by encryption through a combination of cryptographic algorithms and random numbers to meet the advanced data erasure technical specifications.

[0277] As a further preferred technical solution, the system is further provided with a policy rule library for storing data erasure policies and erasure rules, and the policy rules are arranged according to device categories and security erasure levels.

[0278] As a further preferred technical solution, the rule parser set in the system is responsible for the core process of the data clearing operation, mainly used for configuration file parsing, mapping each rule to an erase operation instruction function, and creating a working thread group to perform clearing operations in parallel.

[0279] As a further preferred technical solution, a switch authentication module is also provided in the system, which is used to perform device binding and device authentication with the data erase switch, and when the device authentication result is authentication success, in response to the switch signal sent by the data erase switch, poll the status of the switch signal; when the authentication result is authentication failure, lock the switch signal sent by the data erase switch.

[0280] As a further preferred technical solution, the cryptographic algorithm library is used to provide a cryptographic SM2 / SM3 / SM4 algorithm acceleration interface (avx2 / neon) and a random number entropy source expansion interface.

[0281] As a further preferred technical solution, the general USB and device management library set in the system is used to provide APIs for uevent device management and USB management.

[0282] It should be noted that other embodiments of the data erasure system of the present invention or implementation methods thereof may refer to the above-mentioned method embodiment 1, which will not be repeated here.

[0283] Example 4

[0284] like Figure 4 As shown, the fourth embodiment of the present invention proposes a data erase switch, comprising: a random number entropy source, an algorithm cryptographic component, a main controller, an off-chip FLASH and an erase switch, wherein the output of the random number entropy source is connected to the main controller and the off-chip FLASH, the output of the erase switch is connected to the main controller, and the output of the main controller and the output of the algorithm cryptographic component are both connected to a USB interface via a USB connector;

[0285] The USB interface is used to insert the target device so that the erase switch is mounted to the operating system of the target device in slave mode and the data security erase software image package is installed, wherein the off-chip FLASH is used to store the operation log and the installation image of the security erase software;

[0286] The main controller is used to receive device information sent by the target device, call the algorithm cryptographic component to sign the device information, obtain the signature file and store it in the main controller, and complete the binding with the target device; receive the authentication request sent by the target device, and return the signature file to the target device based on the authentication request so that the target device verifies the signature and obtains the authentication result;

[0287] The erase switch is used to generate a switch signal and send it to a target device, so that the target device polls the state of the switch signal or locks the switch signal;

[0288] The random number entropy source is used to provide random numbers for data erasure.

[0289] Specifically, the data security erasure switch proposed in this embodiment is an independent hardware unit that provides user identity authentication and erasure signals, and is equipped with data security erasure software, and provides a USB interface to connect to a target device.

[0290] Among them, the random number entropy source, as a cryptographic peripheral, provides a true random number source with high security and high performance.

[0291] The algorithm cryptographic component is used as a commercial algorithm SM2 / SM3 / SM4 algorithmizer to provide encryption algorithms.

[0292] The firmware code runs in the main controller, controls and calls other built-in hardware modules, and is responsible for USB communication with the erasure software running on the device. The on-chip flash of the main controller stores the cryptographic device firmware and the device digital signature.

[0293] The off-chip FLASH is used to store operation logs and securely erase the software installation image.

[0294] The erase switch is a small micro switch built into the motherboard. The switch cap extends out of the device housing, and the user issues an erase command by pressing it.

[0295] Specifically, the data erase switch implements one-way authentication with the switch authentication module of the erasure software system. After the erasure daemon runs for the first time, it detects the data erase switch, calls the switch authentication module to send device information, and the data erase switch signs the device information and saves the signature file to the on-chip flash to complete the binding of the data erase switch and the target device. If the data erase switch authentication fails, the data erase software daemon locks the switch signal and does not poll the signal status. The function of the hardware signal triggering the clearing operation does not take effect. When the data erase switch authentication passes, the data erase software polls the switch signal status, and the switch built-in firmware converts the input signal into a status value and returns it to the software.

[0296] As a further preferred technical solution, an LED display light is provided at the tail of the data erase switch to inform the user of the current erase status, specifically:

[0297] Orange: Steady on means authentication is passed and waiting for signal input; flashing means signal input is invalid;

[0298] Green: Flashing indicates that the clearing operation is in progress, and constant light indicates that the clearing operation is completed;

[0299] Red: Flashing means the device authentication failed;

[0300] Off: Not bound to a device.

[0301] It should be noted that other embodiments or implementation methods of the data erase switch of the present invention can refer to the above-mentioned method embodiment 2, which will not be repeated here.

[0302] Example 5

[0303] like Figure 5 The fifth embodiment of the present invention provides a data erasing device, including a data erasing switch and a data erasing system installed in a target device, wherein the data erasing system includes:

[0304] A daemon process, configured to detect all storage media types and partition information of a target device and generate a plurality of storage device entries after successfully logging in in response to a user login password, wherein the storage device entries include storage description information of the device;

[0305] and for converting the storage device entries and setting information into a configuration file in response to an erase command or a switch signal sent offline by the data erase switch, wherein the setting information includes an erase level, an erase policy entry, and an erase rule entry;

[0306] A rule parser is used to parse the configuration file, convert the storage description information in the configuration file into an execution script, and create a working thread for each execution script; map each erasure rule to an operation instance, and use the working thread to traverse each operation instance to execute the data erasure operation of the target device.

[0307] Specifically, the interaction process between the data erasure switch and the data erasure system installed in the target device is as follows:

[0308] (1) The data erase switch binding process is as follows:

[0309] Insert the data wipe switch into the device.

[0310] The user opens the erasure software client and enters the login password.

[0311] The daemon passes the password to the data erasure switch, and the data erasure switch saves the hash value of the password SM3.

[0312] The switch authentication module obtains the motherboard number, CPU information, host name and current time of the device and saves them as a message.

[0313] The switch authentication module sends a public key request and message to the data erasure switch.

[0314] The data wipe switch creates and saves a key pair.

[0315] The data wipe switch signs the message with the private key and returns the public key and device index number.

[0316] The switch authentication module stores the public key and the device index number.

[0317] (2) The automatic authentication process of the data erase switch is as follows:

[0318] The switch authentication module detects the insertion of a data erase switch.

[0319] The switch authentication module sends a request and a device index number to the data erase switch.

[0320] After receiving the authentication request, the data erasure switch returns the signature file.

[0321] The switch authentication module uses the saved switch public key and message to verify the signature.

[0322] The switch authentication module returns the signature verification result to the data erasure switch.

[0323] The data wipe switch records log information.

[0324] (3) User login and information setting process:

[0325] Insert the data wipe switch into the device.

[0326] The user opens the erasure software client and enters the login password.

[0327] The daemon passes the password to the data wipe switch, which calculates the hash value of the password.

[0328] The data erasure switch returns the comparison result of the hash value. If the comparison is consistent, login is allowed; if the comparison is inconsistent, login fails.

[0329] (4) Online data erasure process:

[0330] After the daemon successfully logs in in response to the user login password, it detects all storage media types and partition information of the target device and generates a plurality of storage device entries, wherein the storage device entries include storage description information of the device; in response to an erase command or a switch signal sent offline by the data erase switch, the storage device entries and setting information are converted into a configuration file, wherein the setting information includes an erase level, an erase policy entry, and an erase rule entry;

[0331] The rule parser is used to parse the configuration file, convert the storage description information in the configuration file into an execution script, and create a working thread for each execution script; map each erasure rule to an operation instance, and use the working thread to traverse each operation instance to execute the data erasure operation of the target device.

[0332] (5) Offline data erasure process:

[0333] The data erasure switch is mounted to the operating system of the target device in slave mode and the data secure erasure software image package is installed;

[0334] When the device authentication result is successful, sending a switch signal to the target device so that the target device polls the state of the switch signal and performs an erasing operation on the data of the target device;

[0335] When the device authentication result is authentication failure, a switch signal is sent to the target device so that the target device locks the switch signal.

[0336] It should be noted that other embodiments or implementation methods of the data erasing device of the present invention can refer to the above embodiments, which will not be repeated here.

[0337] Furthermore, this embodiment also requests protection for a client, which includes a memory and a processor; wherein the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the method described in Example 1 above.

[0338] Furthermore, this embodiment proposes a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method described in the above embodiment 1 is implemented.

[0339] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0340] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0341] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0342] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0343] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A data erasure method, characterized in that: The method comprises: In response to a successful login with a user login password, all storage media types and partition information of the target device are detected and a plurality of storage device entries are generated, wherein the storage device entries include storage description information of the device, wherein the storage description information includes storage media type, storage space and partition information, wherein the storage space includes device capacity and used space; In response to an erase command, converting the storage device entry and setting information into a configuration file, wherein the setting information includes an erase level, an erase policy entry, and an erase rule entry; Parsing the configuration file, converting the storage description information in the configuration file into an execution script, and creating a working thread for each execution script; Each erasure rule is mapped to an operation instance, and the working thread is used to traverse each operation instance to execute the data erasure operation of the target device.

2. The data erasing method according to claim 1, characterized in that: The erasure policies of the erasure policy entries are arranged according to the type of storage medium and the erasure level, and the erasure policies are used to describe the way of clearing data in the storage medium; The structure of the erase strategy is defined as: method_type_{ops1_count} The method field indicates that the current entry is an erase policy entry, the type field indicates the type of storage medium, the ops1 field indicates the erase field, and the count field is used to identify the number of times the previous ops1 field is executed.

3. The data erasing method according to claim 1, characterized in that: The erasure rule in the erasure rule entry is used to describe the operation mode of data clearing. The structure of the erasure rule is defined as: action_ops2[_engine] The action field indicates that the current entry is an erase rule entry, the ops2 field indicates a clear operation to write to the storage medium, the engine field indicates calling the avx hardware acceleration unit or the neon hardware acceleration unit, and [ ] indicates a non-required field.

4. The data erasing method according to claim 1, wherein: The erasure levels include a basic erasure level, a medium erasure level, and an advanced erasure level, wherein: The basic clearing level is to write overwritten data to the storage medium in a single pass; The medium clearing level is to write overwritten data to the storage medium multiple times; The advanced erasure level is to use a random number combined with an encryption algorithm to erase the data in the storage medium; The overwriting data is a fixed number, a random number, or a sequential number.

5. The data erasing method according to claim 4, characterized in that: The method of erasing data in a storage medium by combining a random number with an encryption algorithm includes: Using random numbers as encryption keys, the sensitive data to be erased in the storage medium is subjected to multiple rounds of substitution, replacement, and key addition operations through a block cipher algorithm, and the encryption key is destroyed after completion.

6. The data erasing method according to claim 1, characterized in that: After parsing the configuration file, converting the storage description information in the configuration file into an execution script, and creating a working thread for each execution script, the method includes: When it is determined that the system disk or the primary partition in the storage description information is true, reading the mount point directory of the configuration file; Copy the basic library, dynamic linker, and basic commands to the mount point directory; Terminate all user-mode processes except the erasing process, and remount the root file system to the mount point directory; All storage medium partitions mounted on the target device are unmounted, and then the working thread is executed.

7. The data erasing method according to claim 1 or 2, characterized in that: The step of mapping each erasure rule to an operation instance and using the working thread to traverse each operation instance to perform a data erasure operation on the target device includes: Determine the type of storage medium and fill in the corresponding software erasure tool interface; Reading the erasure field of the erasure policy and populating an erasure rule set; Read the execution count field of the erasure strategy to obtain the execution count; Mapping each erasure rule in the erasure rule set to an operation instance; Execute the working thread to traverse all operation instances in sequence, and each operation instance is executed cyclically according to the execution number; Write 0 to the address segment of all partition information of the target device, wherein the partition information includes sector 0, a primary partition header, a primary partition table, a backup partition header and a backup partition table.

8. The data erasing method according to claim 7, characterized in that: After the execution of the work thread sequentially traverses all operation instances and each operation instance is executed cyclically according to the execution number, the method further includes: When it is determined that there is an encryption algorithm call in the erasure rule, the encryption key data structure in the cache is deleted.

9. The data erasing method according to claim 1, characterized in that: The method further comprises: A random number cache is created through a random thread to store the random sequence required for data erasure operations.

10. The data erasing method according to claim 1, wherein: Before detecting all storage media types and partition information of the target device and generating a plurality of storage device entries in response to the user login password, the method further includes: When the data erasure switch is detected to be inserted, the login password input by the user is transmitted to the data erasure switch, so that the data erasure switch saves the hash value of the login password; Sending the device information and the public key request of the target device to the data erasure switch, so that the data erasure switch creates a key pair based on the public key request and signs the device information with the private key in the key pair to obtain a signature file; The public key and the device index number returned by the data erasure switch are received and saved to achieve binding with the data erasure switch.

11. The data erasing method according to claim 10, characterized in that: The method further comprises: When the data erase switch is detected to be inserted, an authentication request and a device index number are sent to the data erase switch; The signature file returned by the data erasure switch is received, and the signature file is verified based on the public key and the device information, and the authentication result obtained by the verification is sent to the erasure switch.

12. The data erasing method according to claim 11, characterized in that: The method further comprises: When the authentication result is successful, in response to the switch signal sent by the data erasing switch, polling the state of the switch signal, and performing an erasing operation on the data of the target device; When the authentication result is authentication failure, the switch signal sent by the data erasing switch is locked.

13. The data erasing method according to claim 10, characterized in that: After successfully logging in in response to the user login password, before detecting all storage media types and partition information of the target device and generating a plurality of storage device entries, the method further includes: Transmitting the login password input by the user to the data erasure switch so that the data erasure switch calculates a hash value of the login password, and compares the currently calculated hash value of the login password with the hash value of the login password calculated during the device binding process; Receive the hash value comparison result returned by the data erasure switch to determine whether the login is successful.

14. A data erasure method, characterized in that: The method comprises: The data erasure switch is mounted to the operating system of the target device in slave mode and the data secure erasure software image package is installed; Receive device information sent by the target device, sign the device information, obtain a signature file and complete binding with the target device; Receive an authentication request sent by a target device, and return the signature file to the target device based on the authentication request so that the target device can verify the signature and obtain an authentication result; When receiving the authentication result that the authentication is successful, sending a switch signal to the target device so that the target device polls the state of the switch signal and performs an erasing operation on the data of the target device; When receiving that the authentication result is authentication failure, sending a switch signal to the target device so that the target device locks the switch signal; Inserting a data erasure switch into the target device to enable the target device to perform online data erasure, including: in response to a user login password successfully logging in, detecting all storage media types and partition information of the target device and generating a plurality of storage device entries, wherein the storage device entries include storage description information of the device, wherein the storage description information includes storage media type, storage space and partition information, and the storage space includes device capacity and used space; In response to an erase command, converting the storage device entry and setting information into a configuration file, wherein the setting information includes an erase level, an erase policy entry, and an erase rule entry; Parsing the configuration file, converting the storage description information in the configuration file into an execution script, and creating a working thread for each execution script; Each erasure rule is mapped to an operation instance, and the working thread is used to traverse each operation instance to execute the data erasure operation of the target device.

15. The data erasing method according to claim 14, characterized in that: The receiving device information sent by the target device, signing the device information, and obtaining a signature file to complete binding with the target device includes: Receive a login password input by a user sent by a target device, and save a hash value of the login password; Receive device information and a public key request sent by the target device, create a key pair based on the public key request, and use the private key in the key pair to sign the device information to obtain a signature file; The public key and the device index number in the key pair are returned to the target device to achieve binding with the target device.

16. The data erasing method according to claim 14, characterized in that: The receiving the authentication request sent by the target device, and returning the signature file to the target device based on the authentication request so that the target device verifies the signature to obtain the authentication result, includes: Receive an authentication request and a device index number sent by a target device, and return the signature file to the target device based on the authentication request, so that the target device verifies the signature file based on the public key in the key pair and the device information to obtain an authentication result; Receive the authentication result sent by the target device.

17. The data erasing method according to claim 14, characterized in that: The switch signal includes executing a user-set or default data clearing policy, executing a full disk data default policy, executing a full disk data complex policy, and an invalid operation.

18. The data erasing method according to claim 14, characterized in that: The method further comprises: Displays the current wipe status of the target device.

19. A data erasure system, characterized in that: The system comprises: A daemon process, configured to detect all storage media types and partition information of a target device and generate a plurality of storage device entries in response to a successful login by a user with a login password, wherein the storage device entries include storage description information of the device, the storage description information includes storage media type, storage space and partition information, and the storage space includes device capacity and used space; and for, in response to an erase command, invoking a data erase policy generator to convert the storage device entry and setting information into a configuration file, wherein the setting information includes an erase level, an erase policy entry, and an erase rule entry; A rule parser is used to parse the configuration file, convert the storage description information in the configuration file into an execution script, and create a working thread for each execution script; and map each erasure rule to an operation instance, and use the working thread to traverse each operation instance to execute the data erasure operation of the target device.

20. A client, characterized in that: The client includes a memory and a processor; wherein the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the method according to any one of claims 1 to 13.

21. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.

22. A data erasing switch, characterized in that: include: A random number entropy source, an algorithm cryptographic component, a main controller, an off-chip FLASH and an erase switch, wherein the output of the random number entropy source is connected to the main controller and the off-chip FLASH, the output of the erase switch is connected to the main controller, and the output of the main controller and the output of the algorithm cryptographic component are both connected to a USB interface via a USB connector; The USB interface is used to insert the target device so that the erase switch is mounted to the operating system of the target device in slave mode and the data security erase software image package is installed, wherein the off-chip FLASH is used to store the operation log and the installation image of the security erase software; The main controller is used to receive device information sent by the target device, call the algorithm cryptographic component to sign the device information, obtain the signature file and store it in the main controller, and complete the binding with the target device; receive the authentication request sent by the target device, and return the signature file to the target device based on the authentication request so that the target device verifies the signature and obtains the authentication result; The erase switch is used to generate a switch signal and send it to the target device, so that the target device polls the state of the switch signal and erases the data of the target device when the authentication result is authentication success, or locks the switch signal when the authentication result is authentication failure; The random number entropy source is used to provide random numbers for data erasure; Inserting a data erasure switch into the target device to enable the target device to perform online data erasure, including: in response to a user login password successfully logging in, detecting all storage media types and partition information of the target device and generating a plurality of storage device entries, wherein the storage device entries include storage description information of the device, wherein the storage description information includes storage media type, storage space and partition information, and the storage space includes device capacity and used space; In response to an erase command, converting the storage device entry and setting information into a configuration file, wherein the setting information includes an erase level, an erase policy entry, and an erase rule entry; Parsing the configuration file, converting the storage description information in the configuration file into an execution script, and creating a working thread for each execution script; Each erasure rule is mapped to an operation instance, and the working thread is used to traverse each operation instance to execute the data erasure operation of the target device.

23. A data erasing device, characterized in that: The invention comprises a data erasure switch and a data erasure system installed in a target device, wherein the data erasure system is used to execute the data erasure method according to any one of claims 1 to 13, and the data erasure switch is used to execute the data erasure method according to any one of claims 14 to 18, including: A daemon process, for detecting all storage media types and partition information of a target device and generating a plurality of storage device entries after successfully logging in in response to a user login password, wherein the storage device entries include storage description information of the device; and for converting the storage device entries and setting information into a configuration file in response to an erase command or a switch signal sent offline by the data erase switch, wherein the setting information includes an erase level, an erase policy entry, and an erase rule entry; A rule parser is used to parse the configuration file, convert the storage description information in the configuration file into an execution script, and create a working thread for each execution script; map each erasure rule to an operation instance, and use the working thread to traverse each operation instance to execute the data erasure operation of the target device.