A method for secure USB flash drive access based on storage data block management
By creating a virtual USB storage device and marking virus data blocks when a USB flash drive is connected, combined with asymmetric encryption, the problem of existing USB flash drive security management technologies changing user habits and causing false virus detection is solved, thus achieving a safe and convenient USB flash drive usage experience.
Patent Information
- Application Number
- CN202311651298.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-05
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2043-12-05
AI Technical Summary
Existing USB flash drive security management technologies have changed users' habits, increased learning and management costs, and pose a risk of data loss due to false virus detection.
A virtual USB storage device is created using a dedicated USB protection device, which monitors USB drive access in real time and performs virus detection, marks virus data blocks, restricts access to virus files, and uses an asymmetric encryption algorithm for USB drive authentication.
It achieves the isolation of virus files without changing user habits, avoiding data loss, reducing management costs, and ensuring secure access to USB drives.
Smart Images

Figure CN117951761B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of mobile storage device security technology, specifically to a secure access method for USB flash drives based on storage data block management. Background Technology
[0002] With the continuous expansion of the capacity and widespread use of USB mobile storage devices, they have become one of the main storage media for transferring files and other data.
[0003] In the face of increasingly severe cyberattacks using USB mobile storage devices, industrial enterprises need to establish clear security management strategies for USB mobile storage devices, build security protection systems, and use scientific and safe methods to ensure the safe use of USB mobile storage devices, thereby protecting business security and preventing unnecessary losses caused by the misuse of USB mobile storage devices.
[0004] To address the security threats posed by USB flash drives, the industry has introduced various USB flash drive security management technologies. For example, patent publication number CN115809487A discloses a USB mobile storage media security isolation method, system, and device. Through multiple security policies, it achieves secure isolation of mobile storage files, offering advantages such as easy access to the isolation box's operating status and operation records for convenient management and authorization. Patent publication number CN115952566A discloses a USB mobile storage media security access method, electronic device, and data transfer system. This system adds a USB peripheral management module that executes the USB mobile storage media security access method to the data transfer system and applies it to the power system network structure. This avoids consuming valuable internal resources of the existing power system, greatly benefiting the secure and stable operation of core internal business systems. However, these methods all alter the USB flash drive usage process to some extent. Users cannot directly browse and operate files on the USB flash drive like ordinary USB flash drives, resulting in a significant learning curve. Furthermore, providing access isolation and ensuring the security of data transmission over the network increases management and usage costs. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a secure USB flash drive access method based on storage data block management. The purpose is to connect to a target host via a dedicated USB protection device, displaying a card reader-like device on the target host. After the USB flash drive is connected to the USB protection device and undergoes virus detection and problematic data block marking, the user can see the USB flash drive mapped via OTG, view all directories and files on the ordinary USB flash drive, and perform localized operations, using it like a regular USB flash drive without altering the user's daily usage habits. Simultaneously, it does not delete the original virus files, avoiding potential data loss caused by misidentification and deletion of virus files.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a secure USB flash drive access method based on storage data block management, comprising the following steps:
[0007] Step S1: Create a virtual USB storage device using a dedicated USB protection device, connect the virtual USB storage device to the target host via an OTG cable, and display the storage device on the target host;
[0008] Step S2: The USB protection device monitors the USB flash drive connection in real time. When a USB flash drive is detected, the USB protection device reads the USB flash drive data and verifies whether the USB flash drive has a security tag and whether the security tag is valid. The USB protection device refuses to use USB flash drives without a security tag or with an invalid security tag.
[0009] Step S3: For USB flash drives with valid security tags, the dedicated USB protection device reads the data from the USB flash drive and performs virus detection on the data. Based on different data types, it parses out the data blocks in the data where the virus is located and marks them with the word "virus". The storage block filtering module sets a list of problematic data blocks based on the marked data blocks where the virus is located.
[0010] Step S4: Bind the USB flash drive that has been scanned and marked with viruses in step S3 to the storage device in step S1. The target host can view the data in the USB flash drive through the USB protection device. When accessing the data block where the virus is marked is accessed, access is denied, thus preventing access to the virus file in the USB flash drive. The target host user can know the reason for the access denial by the data name marked with the word "virus".
[0011] Step S5: After use, once the target host ejects the USB drive or removes the USB drive from the target host, the virtual USB storage device created by the target host will return to a state without a USB drive inserted, waiting for a new USB drive to be connected.
[0012] Furthermore, the process of creating a security label for a USB flash drive is as follows: extract the physical information of the USB flash drive; calculate the hash value based on the extracted physical information; encrypt the calculated hash value using an asymmetric encryption algorithm; and write the encrypted hash value into a fixed free sector at the beginning of the USB flash drive.
[0013] Further, the process of verifying whether a USB flash drive has a security label is as follows: Read the fixed free sector at the beginning of the USB flash drive to see if an encrypted hash value exists; if not, the verification fails. If an encrypted hash value exists in the fixed free sector at the beginning of the USB flash drive, use an asymmetric algorithm to decrypt the hash value to obtain the decrypted hash value. Extract the physical information within the decrypted hash value. Calculate the hash value based on the extracted physical information within the decrypted hash value. Compare the decrypted hash value with the calculated hash value. If they match, it is a valid security label, and the USB flash drive verification is successful; if they do not match, it is an invalid label, and the USB flash drive verification fails.
[0014] Furthermore, the process of forming the problematic data block list is as follows: Load the USB drive with a valid security label; use a virus scanning engine to detect malicious code in the data within the USB drive with a valid security label; record basic information such as the path and size of the identified malicious code files; unload the USB drive with a valid security label; scan the partition table data of the USB drive with a valid security label; scan the directory area data of the USB drive with a valid security label based on the partition table information; identify file information based on the data area pointed to by the directory area of the USB drive with a valid security label; scan the files and block device information in the data area of the USB drive with a valid security label. If no malicious code files are found, continue scanning.
[0015] Furthermore, the specific process of step S4 is as follows: The target host views the data in the USB flash drive through the USB protection device; sends a read / write request for the storage data block to the USB flash drive; after receiving the request, the virtual USB storage device forwards the request to the bound USB flash drive; the storage block filtering module detects the data blocks to be read / written by the USB flash drive; it queries the USB flash drive's problematic block data list to see if the data block is recorded; if recorded, it returns a rejection; if not recorded, it reads / writes the data block to the bound USB flash drive; it feeds back the access prohibition or read / write operation result to the virtual USB storage device; it obtains the read / write result of the USB flash drive data block; the target host prompts the user or terminates the operation based on the result of the OTG mapping of the USB flash drive according to the above operations.
[0016] Compared with existing technologies, this invention has the following advantages: It achieves control over inserted USB flash drives by using a virtual USB storage device; it isolates and restricts access to virus files by marking the physical storage data blocks of virus files within the USB flash drive and thus restricting the reading and writing of problematic data blocks; for virus files, it adds the word "virus" to their filenames through renaming, making it easier for users to understand the reason for access denial during use; and it employs an asymmetric encryption algorithm combined with the physical properties of the USB flash drive to achieve access authentication, preventing the use of unauthorized USB flash drives. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the overall process of the present invention.
[0018] Figure 2 This is a diagram illustrating the process of creating the security label for the USB flash drive of this invention.
[0019] Figure 3 This diagram illustrates the process of verifying whether a USB flash drive has a security label, as per the present invention.
[0020] Figure 4 This is a diagram illustrating the process of forming the problem data block list for this invention.
[0021] Figure 5 This is a diagram illustrating the process of managing data blocks stored on a USB flash drive according to the present invention. Detailed Implementation
[0022] like Figure 1 As shown, the present invention provides a technical solution: a secure USB flash drive access method based on storage data block management, comprising the following steps:
[0023] Step S1: Create a virtual USB storage device using a dedicated USB protection device, connect the virtual USB storage device to the target host via an OTG cable, and display the storage device on the target host;
[0024] The USB protection device is a piece of hardware that connects a USB flash drive to a target host. After the USB flash drive is inserted into the device, the device will perform preset actions to detect the USB flash drive label, detect and mark the files on the USB flash drive for viruses, and map the USB flash drive to the target host by creating a virtual USB storage device.
[0025] Step S2: The USB protection device monitors the USB flash drive connection in real time. When a USB flash drive is detected, the USB protection device reads the USB flash drive data and verifies whether the USB flash drive has a security tag and whether the security tag is valid. The USB protection device refuses to use USB flash drives without a security tag or with an invalid security tag.
[0026] Step S3: For USB flash drives with valid security tags, the dedicated USB protection device reads the data from the USB flash drive and performs virus detection on the data. Based on different data types, it parses out the data blocks in the data where the virus is located and marks them with the word "virus". The storage block filtering module sets a list of problematic data blocks based on the marked data blocks where the virus is located.
[0027] Step S4: Bind the USB flash drive that has been scanned and marked with viruses in step S3 to the storage device in step S1. The target host can view the data in the USB flash drive through the USB protection device. When accessing the data block where the virus is marked is accessed, access is denied, thus preventing access to the virus file in the USB flash drive. The target host user can know the reason for the access denial by the data name marked with the word "virus".
[0028] Step S5: After use, once the target host ejects the USB drive or removes the USB drive from the target host, the virtual USB storage device created by the target host will return to a state without a USB drive inserted, waiting for a new USB drive to be connected.
[0029] like Figure 2 As shown, the process for creating a security label for a USB flash drive is as follows:
[0030] 1. Extract the physical information of the USB flash drive, including its VID, PID, serial number, and description;
[0031] 2. Calculate the hash value based on the extracted physical information; (The calculation method uses a hash algorithm, such as MD5 or SM3).
[0032] 3. The calculated hash value is encrypted using an asymmetric encryption algorithm;
[0033] 4. Write the encrypted hash value to a fixed free sector at the beginning of the USB drive.
[0034] like Figure 3 As shown, the process for verifying whether a USB flash drive has a security label is as follows:
[0035] 1. Check if the encrypted hash value exists in the fixed free sector at the beginning of the USB drive; if not, the signature verification fails.
[0036] 2. If the fixed free sector at the beginning of the USB flash drive contains an encrypted hash value, then an asymmetric algorithm is used to decrypt the hash value to obtain the decrypted hash value;
[0037] 3. Extract the physical information of the USB flash drive, such as VID, PID, serial number, and description, from the decrypted hash value;
[0038] 4. Calculate the hash value based on the physical information of the USB flash drive, such as VID, PID, serial number, and description, extracted from the decrypted hash value;
[0039] 5. Compare the decrypted hash value with the calculated hash value. If they match, the label is valid and the USB drive verification is successful. If they do not match, the label is invalid and the USB drive verification fails.
[0040] like Figure 4 As shown, the process of forming the list of problem data blocks is as follows:
[0041] 1. Load a USB drive with a valid security label;
[0042] 2. Use a virus scanning engine to detect malicious code in the data of USB drives with valid security tags;
[0043] 3. Record basic information such as the path and size of the identified malicious code files;
[0044] 4. Uninstall the USB drive with a valid security label;
[0045] 5. Scan the partition table data of the USB drive with a valid security label;
[0046] 6. Scan the directory area data of the USB drive with a valid security label based on the partition table information;
[0047] 7. Identify file information based on the data area pointed to by the directory area of the USB flash drive with a valid security label;
[0048] The file information refers to files stored on the user's USB drive, which can be data files, text files, or executable files, etc. The specific type is not limited. The whole method is described as scanning for malicious code files on the user's USB drive, but it can also be extended to identify or standardize files with specific suffixes or specific types of files.
[0049] 8. Scan the data area files and block device information of the USB flash drive with a valid security label. If no malicious code files are found, continue scanning.
[0050] 9. Record file information and corresponding storage data block information of scanned malicious code files; In operating systems such as Windows and Linux, file access is performed through file systems, such as NTFS and FAT. File systems organize file data into disk sectors, including sectors recording file size, file path, and file content. These sectors together form storage data blocks. When a user reads or writes files within a USB protection device, at the USB protection device level, this means reading and writing these storage data blocks on the disk. This also includes OTG-mapped USB flash drives.
[0051] 10. If malicious code files or data are still present on the USB drive with a valid security label, proceed to step 7 to continue scanning;
[0052] 11. Create a list of problematic data blocks containing malicious code files within the USB drive with valid security labels.
[0053] like Figure 5 As shown, the specific process of step S4 is as follows:
[0054] Step 1: The target host uses a dedicated USB protection device to view the data on the USB flash drive;
[0055] Step 2: Send read / write requests for the stored data blocks to the USB drive;
[0056] Step 3: After receiving the request, the virtual USB storage device forwards the request to the bound USB flash drive;
[0057] Step 4: The storage block filtering module detects the data blocks read and written by the USB drive;
[0058] Step 5: Check if the data block is recorded in the USB drive's problematic data block list. If it is recorded, return a rejection; if it is not recorded, read and write the data block to the bound USB drive.
[0059] Step 6: Send the result of the access or read / write operation being denied back to the virtual USB storage device;
[0060] Step 7: Obtain the read / write results of the USB drive data blocks;
[0061] Step 8: The target host will prompt the user or end the operation based on the results of the OTG mapping of the USB drive as described above.
[0062] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A secure USB flash drive access method based on storage data block management, characterized in that, Includes the following steps: Step S1: Create a virtual USB storage device using a dedicated USB protection device, connect the virtual USB storage device to the target host via an OTG cable, and display the storage device on the target host; Step S2: The USB protection device monitors the USB flash drive connection in real time. When a USB flash drive is detected, the USB protection device reads the USB flash drive data and verifies whether the USB flash drive has a security tag and whether the security tag is valid. The USB protection device refuses to use USB flash drives without a security tag or with an invalid security tag. Step S3: For USB flash drives with valid security tags, the dedicated USB protection device reads the data from the USB flash drive and performs virus detection on the data. Based on different data types, it parses out the data blocks in the data where the virus is located and marks them with the word "virus". The storage block filtering module sets a list of problematic data blocks based on the marked data blocks where the virus is located. Step S4: Bind the USB flash drive that has been scanned and marked with viruses in step S3 to the storage device in step S1. The target host can view the data in the USB flash drive through the USB protection device. When accessing the data block where the virus is marked is accessed, access is denied, thus preventing access to the virus file in the USB flash drive. The target host user can know the reason for the access denial by the data name marked with the word "virus". Step S5: After use, once the target host ejects the USB drive or removes the USB drive from the target host, the virtual USB storage device created by the target host will return to a state without a USB drive inserted, waiting for a new USB drive to be connected.
2. The USB flash drive secure access method based on storage data block management according to claim 1, characterized in that: The process of creating a security label for a USB flash drive is as follows: extract the physical information of the USB flash drive; calculate the hash value based on the extracted physical information; encrypt the calculated hash value using an asymmetric encryption algorithm; and write the encrypted hash value into a fixed free sector at the beginning of the USB flash drive.
3. The USB flash drive secure access method based on storage data block management according to claim 2, characterized in that: The process of verifying whether a USB flash drive has a security label is as follows: Read whether there is an encrypted hash value in the fixed free sector at the beginning of the USB flash drive. If not, the label verification fails. If there is an encrypted hash value in the fixed free sector at the beginning of the USB flash drive, use an asymmetric algorithm to decrypt the hash value to obtain the decrypted hash value. Extract the physical information from the decrypted hash value; calculate the hash value based on the extracted physical information from the decrypted hash value. Compare the decrypted hash value with the calculated hash value. If they match, the label is valid and the USB drive verification is successful. If they do not match, the label is invalid and the USB drive verification fails.
4. The USB flash drive secure access method based on storage data block management according to claim 3, characterized in that: The process of forming the problematic data block list is as follows: Load the USB drive with a valid security label; use a virus scanning engine to detect malicious code in the data of the USB drive with a valid security label; record the basic information such as the path and size of the identified malicious code files; Uninstall the USB drive with a valid security label; scan the partition table data of the USB drive with a valid security label; scan the directory area data of the USB drive with a valid security label based on the partition table information; identify file information based on the data area pointed to by the directory area of the USB drive with a valid security label; scan the files and block device information of the data area of the USB drive with a valid security label. If no malicious code files are found, continue scanning.
5. A method for secure USB flash drive access based on storage data block management according to claim 4, characterized in that: The specific process of step S4 is as follows: The target host views the data in the USB flash drive through the USB protection device; sends a read / write request for the stored data block to the USB flash drive; after receiving the request, the virtual USB storage device forwards the request to the bound USB flash drive; The storage block filtering module detects data blocks read and written by the USB flash drive; it queries the USB flash drive's problematic block data list to see if the data block is recorded. If recorded, it returns a rejection; if not recorded, it reads and writes the data block to the bound USB flash drive; and it sends the access prohibition or read / write operation result back to the virtual USB storage device. Obtain the read and write results of the data blocks on the USB drive; The target host will prompt the user or terminate the operation based on the results of the OTG mapping of the USB drive as described above.
Citation Information
Patent Citations
Security isolation method, system and equipment for USB (Universal Serial Bus) mobile storage medium
CN115809487A
Safe access method for USB mobile storage medium, electronic equipment and data ferry system
CN115952566A
Virus detecting and killing method for removable storage devices
CN104899510A
Interconnection information safety protective system of electric automobile
CN107247907A
