A data access method and system for a secure storage device

CN117786772BActive Publication Date: 2026-10-09HUADA YUNXIN (NANJING) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311722161.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-13
Publication Date
2026-10-09
Estimated Expiration
2043-12-13

AI Technical Summary

Technical Problem

[0005]鉴于上述的分析,本发明实施例旨在提供一种安全存储设备的数据访问方法和系统,用以解决现有安全存储设备数据访问效率低、访问不方便的问题

Benefits of technology

[0045] Compared to existing technologies, when the environment is insecure, data in the encrypted area of ​​the solid-state drive can only be read and written through the extended SDK, and other applications cannot access it. This protects data security while facilitating data access. After user authentication, access can be made through the extended SDK or through the system API. Even data written through the extended SDK can be accessed through the normal access method of the system API, thereby improving the convenience of data access.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117786772B_ABST
    Figure CN117786772B_ABST
Patent Text Reader

Abstract

The application relates to a data access method of a secure storage device, and belongs to the technical field of secure storage devices. The method solves the problems of low data access efficiency and inconvenient access of the secure storage device in the prior art. The method comprises the following steps: judging whether the current environment is safe; when the current environment is not safe, sending a data read-write instruction to the security management module through an extended SDK; when the current environment is safe, sending a data read-write instruction to the security management module through the extended SDK or a system API; and the security management module reads and writes encrypted area data of the solid state disk according to the data read-write instruction. The safety and convenience of data access of the secure storage device are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of secure storage device technology, and in particular to a data access method and system for a secure storage device. Background Technology

[0002] With the development of the internet and the digital economy, data transmission demands are increasing in capacity and facing growing security threats. Interactions between internal and external networks of enterprises, governments, and military departments are becoming more frequent. To ensure the security of data exchange, one-way transmission is typically employed.

[0003] Existing secure storage devices are generally accessed in two ways: 1) Secure storage devices have hidden partitions, and the contents of these partitions are stored in a standard file system format; after successful authentication, the hidden partitions become identifiable, and the device can be accessed using the operating system's built-in file explorer; 2) Secure storage devices have hidden partitions, and the contents of these partitions use a proprietary file format, meaning only specialized tools can read and write the data on the device.

[0004] For example, financial data is regularly backed up to secure storage devices. If authentication fails, data cannot be securely stored on the secure storage devices, affecting backup efficiency. If a proprietary file format definition is used, data needs to be parsed when data needs to be restored, making data access inconvenient, unintuitive, and inefficient. Summary of the Invention

[0005] Based on the above analysis, the embodiments of the present invention aim to provide a data access method and system for secure storage devices to solve the problems of low data access efficiency and inconvenience in existing secure storage devices.

[0006] On one hand, embodiments of the present invention provide a data access method for a secure storage device, the secure storage device including a security management module and a solid-state drive (SSD), wherein the SSD is divided into an encrypted area, and the method includes the following steps:

[0007] Determine if the current environment is safe;

[0008] When the current environment is insecure, data read / write commands are sent to the security management module via the extended SDK; when the current environment is secure, data read / write commands are sent to the security management module via the extended SDK or system API.

[0009] The security management module reads and writes the encrypted data of the solid-state drive according to the data read / write instructions.

[0010] Based on a further improvement of the above method, data read / write commands are sent to the security management module via an extended SDK, including:

[0011] When a file needs to be read, the file path and file name are obtained, and a private SCSI read command is sent to the security management module according to the file path and file name to read the file data corresponding to the file path and file name.

[0012] When writing a file, obtain the file path, file name, and file data to be written, and send a private SCSI read command to the security management module to find a free MFT file;

[0013] If the file data length exceeds 1K bytes, a private SCSI read command is sent to the security management module to find a free data address; a private SCSI write command is sent to the security management module to write the file data to the free data address; a private SCSI write command is sent to the security management module to write the free data address to the free MFT file; if the file data length does not exceed 1K bytes, a private SCSI write command is sent to the security management module to write the file data to the free MFT file.

[0014] Add the filename and free MFT file information to the end of the file path and to the index assignment attribute of the MFT file in the folder.

[0015] Based on a further improvement to the above method, a private SCSI read command is sent to the security management module according to the file path and filename to read the file data corresponding to the file path and filename, including:

[0016] S211. Calculate the address of the MFT file in the root directory based on the starting address of the MFT file; use the root directory as the current directory; use the first-level folder in the file path as the current file to search for;

[0017] S212. Construct a private SCSI read instruction to read the MFT file in the current directory based on the address of the MFT file in the current directory; send the private SCSI read instruction to read the MFT file in the current directory to the security management module, and obtain the current directory information by obtaining the data returned by the security management module;

[0018] S213. Check the index allocation attribute of the current directory information to see if the currently searched file is included. If it is not included, return a message that the path is incorrect; otherwise, proceed to step S214.

[0019] S214. Find the MFT file number corresponding to the currently searched file in the index allocation attribute of the current directory information, calculate the address of the MFT file corresponding to the currently searched file, and take the currently searched file as the current directory; if there is a sub-file of the currently searched file in the file path, then take the sub-file of the currently searched file in the file path as the current searched file; if the currently searched file is a filename, then execute step S215; otherwise, return to step S212.

[0020] S215. Construct a private SCSI read instruction to read the MFT file of the currently searched file based on the address of the MFT file of the currently searched file; send the private SCSI read instruction to read the MFT file of the currently searched file to the security management module, obtain the MFT file information of the currently searched file by the data returned by the security management module, and obtain the file data based on the MFT file information of the currently searched file.

[0021] A further improvement to the above method involves sending a private SCSI read command to the security management module to locate free data addresses, including:

[0022] The offset address of the bitmap file is calculated using the formula: MFT file start address + 6 * 0x400.

[0023] Based on the offset address of the bitmap file, a private SCSI read command is constructed to read the bitmap file and sent to the security management module. The bitmap information is obtained by obtaining the data returned by the security management module. The first bit marked as free is found in the bitmap information in the order from front to back. The cluster address corresponding to the bit marked as free is the free data address.

[0024] A further improvement to the above method involves sending a private SCSI read command to the security management module to locate a free MFT file, including:

[0025] The private SCSI read command for reading the main MFT file is calculated and constructed based on the starting address of the MFT file and sent to the security management module. The main MFT file information is obtained based on the data returned by the security management module.

[0026] Obtain the MFT bitmap information based on the MFT bitmap attributes in the MFT file information;

[0027] The first bit marked as free is found in the MFT bitmap information in the order from front to back. The MFT file corresponding to the bit marked as free is the found free MFT file.

[0028] Based on a further improvement of the above method, the security management module reads and writes the encrypted data of the solid-state drive according to the data read / write instructions, including:

[0029] Determine whether the data read / write instruction is a private SCSI instruction; if so, convert the address in the private SCSI instruction to an encrypted area address, and convert the private SCSI instruction to a standard instruction; read and write the encrypted area data of the solid-state drive according to the standard instruction;

[0030] If the data read / write command is not a private command, then it is determined whether the authentication is successful. If successful, the encrypted data of the solid-state drive is read / written according to the data read / write command. If unsuccessful, no read / write operation is performed on the solid-state drive.

[0031] Based on a further improvement of the above method, if the data read instruction is a write instruction, then the file data is encrypted before sending the data read / write instruction to the solid-state drive;

[0032] If the data read / write instruction is a read instruction, then after sending the data read / write instruction to the solid-state drive to read the encrypted data of the solid-state drive, the process also includes decrypting the read data.

[0033] A further improvement to the above method involves converting the address in the private SCSI command to an encrypted zone address and converting the private SCSI command to a standard command, including:

[0034] The address for reading and writing data is obtained by parsing the private SCSI instruction; the address is added to the starting address of the encrypted area to obtain the converted address; the address in the private SCSI instruction is modified to the converted address.

[0035] Modify the reserved fields in the private SCSI command to their default values, and modify the private command to a standard command.

[0036] On the other hand, embodiments of the present invention provide a data access system for a secure storage device, including a secure storage device and a host terminal. The secure storage device includes a solid-state drive and a security management module; the solid-state drive is divided into encrypted areas.

[0037] The host determines whether the current environment is safe;

[0038] When the current environment is insecure, the host sends data read / write commands to the security management module through the extended SDK; when the current environment is secure, the host sends data read / write commands to the security management module through the extended SDK or system API.

[0039] The security management module reads and writes the encrypted data of the solid-state drive according to the data read / write instructions.

[0040] Based on further improvements to the above system, the host sends data read / write commands to the security management module via an extended SDK, including:

[0041] When a file needs to be read, the host obtains the file path and file name to be read, and sends a private SCSI read command to the security management module according to the file path and file name to read the file data corresponding to the file path and file name.

[0042] When writing a file, the host obtains the file path, file name, and file data to be written, and sends a private SCSI read command to the security management module to find a free MFT file;

[0043] If the file data length exceeds 1K bytes, a private SCSI read command is sent to the security management module to find a free data address; a private SCSI write command is sent to the security management module to write the file data to the free data address; a private SCSI write command is sent to the security management module to write the free data address to the free MFT file; if the file data length does not exceed 1K bytes, a private SCSI write command is sent to the security management module to write the file data to the free MFT file.

[0044] Add the filename and free MFT file information to the end of the file path and to the index assignment attribute of the MFT file in the folder.

[0045] Compared to existing technologies, when the environment is insecure, data in the encrypted area of ​​the solid-state drive can only be read and written through the extended SDK, and other applications cannot access it. This protects data security while facilitating data access. After user authentication, access can be made through the extended SDK or through the system API. Even data written through the extended SDK can be accessed through the normal access method of the system API, thereby improving the convenience of data access.

[0046] In this invention, the above-described technical solutions can be combined with each other to achieve more preferred combinations. Other features and advantages of this invention will be set forth in the following description, and some advantages may become apparent from the description or be learned by practicing the invention. The objects and other advantages of this invention can be realized and obtained from what is particularly pointed out in the description and drawings. Attached Figure Description

[0047] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts.

[0048] Figure 1 This is a flowchart illustrating a data access method for a secure storage device according to an embodiment of the present invention. Detailed Implementation

[0049] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.

[0050] A specific embodiment of the present invention discloses a data access method for a secure storage device, wherein the secure storage device includes a security management module and a solid-state drive (SSD), and the SSD is divided into encrypted areas, such as... Figure 1 As shown, the method includes the following steps:

[0051] S1. Determine if the current environment is safe;

[0052] S2. When the current environment is insecure, send data read / write commands to the security management module through the extended SDK; when the current environment is secure, send data read / write commands to the security management module through the extended SDK or system API.

[0053] S3. The security management module reads and writes the encrypted data of the solid-state drive according to the data read and write instructions.

[0054] During implementation, the public area of ​​the secure storage device can be accessed directly, but the encrypted area requires a secure environment to access. For example, if user authentication fails or is not performed, the environment is considered insecure. In this case, data in the encrypted area of ​​the solid-state drive can only be read and written through the extended SDK, and other applications cannot access it. This protects data security while facilitating data access. Once user authentication is successful, access can be made through the extended SDK or the system API. Even data written through the extended SDK can be accessed through the normal access method of the system API, thereby improving the convenience of data access.

[0055] In practice, the secure storage device consists of a regular solid-state drive (SSD) and a main control security chip, which implements the security management module. During implementation, the data on the SSD is stored in the NTFS file format.

[0056] Specifically, sending data read / write commands to the security management module via the extended SDK includes:

[0057] S21. When a file needs to be read, obtain the file path and file name to be read, and send a private SCSI read command to the security management module according to the file path and file name to read the file data corresponding to the file path and file name.

[0058] S22. When writing a file, obtain the file path, file name and file data to be written, and send a private SCSI read command to the security management module to find a free MFT file;

[0059] If the file data length exceeds 1K bytes, a private SCSI read command is sent to the security management module to find a free data address; a private SCSI write command is sent to the security management module to write the file data to the free data address; a private SCSI write command is sent to the security management module to write the free data address to the free MFT file; if the file data length does not exceed 1K bytes, a private SCSI write command is sent to the security management module to write the file data to the free MFT file.

[0060] Add the filename and free MFT file information to the end of the file path and to the index assignment attribute of the MFT file in the folder.

[0061] During implementation, when a file needs to be read, the path and filename of the file to be read are first obtained, then a private SCSI read command for reading file system attributes is constructed and sent to the security management module to obtain the MFT file starting cluster address.

[0062] During implementation, a private SCSI read command is constructed to read file system attributes. The read address in this private SCSI read command is the DBR sector (sector 0) address, and the read length is 512 bytes. This private SCSI read command is sent to the security management module. The security management module returns data based on this command and determines whether the data at offset 0x03 is "NTFS". If not, it does not conform to the preset file format. If it is "NTFS", it further checks whether the number of sectors per cluster at offset 0x0D is 0x08 and the size of each sector at offset 0x0B is 0x0200. If both conform, it conforms to the preset file format; otherwise, it does not conform to the preset file format. If it does not conform to the preset file format, a message indicating that it does not conform to the preset format and cannot be read or written is returned.

[0063] If the file format is correct, the starting address of the MFT file is obtained based on the data returned by the security management module. That is, 8 bytes of data are extracted from the 0x30 offset address of the DBR sector to obtain the starting address of the MFT file.

[0064] Based on the file path and filename, a private SCSI read command is sent to the security management module to read the file data corresponding to the file path and filename, including:

[0065] S211. Calculate the address of the MFT file in the root directory based on the starting address of the MFT file; use the root directory as the current directory; use the first-level folder in the file path as the current file to search for;

[0066] S212. Construct a private SCSI read instruction to read the MFT file in the current directory based on the address of the MFT file in the current directory; send the private SCSI read instruction to read the MFT file in the current directory to the security management module, and obtain the current directory information by obtaining the data returned by the security management module;

[0067] S213. Check the index allocation attribute of the current directory information to see if the currently searched file is included. If it is not included, return a message that the path is incorrect; otherwise, proceed to step S214.

[0068] S214. Find the MFT file number corresponding to the currently searched file in the index allocation attribute of the current directory information, calculate the address of the MFT file corresponding to the currently searched file, and take the currently searched file as the current directory; if there is a sub-file of the currently searched file in the file path, then take the sub-file of the currently searched file in the file path as the current searched file; if the currently searched file is a filename, then execute step S215; otherwise, return to step S212.

[0069] S215. Construct a private SCSI read instruction to read the MFT file of the currently searched file based on the address of the MFT file of the currently searched file; send the private SCSI read instruction to read the MFT file of the currently searched file to the security management module, obtain the MFT file information of the currently searched file by the data returned by the security management module, and obtain the file data based on the MFT file information of the currently searched file.

[0070] It should be noted that the MFT file is composed of attributes, among which the index allocation attribute, namely the A0H attribute, records the file / folder name in the current directory and the address of the corresponding MFT file.

[0071] For example, given a file path of system:\dir1\ and a file named a.txt, the address of the MFT file in the root directory is first calculated based on the starting address of the MFT file. The MFT file number in the root directory is 5. Therefore, the address of the MFT file in the root directory is calculated using the formula: MFT file starting address + 5 * 0x400. The root directory is used as the current directory; the first-level directory dir1 in the file path is the currently searched file. A private SCSI read command to read the MFT file in the current directory is constructed based on the address of the MFT file in the root directory. This private SCSI read command is sent to the security management module, which returns data to obtain the root directory information. The index attributes within the module are checked to see if the currently searched file dir1 is included. If not, an incorrect path message is returned. If it is found, the MFT file number of the currently searched file dir1 is obtained based on the index attribute. The MFT file address of the currently searched file dir1 is obtained by adding the MFT file start address and the file number * 0x400. dir1 is set as the current directory. Since there is a subdirectory file a.txt under dir1, a.txt is set as the current search file. The process returns to step S212 to check if the index attribute of dir1 contains a.txt. If it does not contain it, an incorrect path message is returned. If it is found, the MFT file number of the currently searched file a.txt is obtained based on the index attribute. The MFT file address of the currently searched file a.txt is obtained by adding the MFT file start address and the file number * 0x400. Since a.txt is the file to be read, a private SCSI read instruction to read the MFT file of the currently searched file a.txt is constructed based on the address of the MFT file of the currently searched file a.txt. This instruction is sent to the security management module, and the MFT file information of the currently searched file is obtained by obtaining the data returned by the security management module. The file data is then obtained based on the MFT file information of the currently searched file.

[0072] During implementation, if the 80H attribute of the MFT file information of a.txt is a resident attribute, the file data can be obtained directly from the 80H attribute body.

[0073] If attribute 80H is a non-resident attribute, then the Run List of the file is recorded at address 0x20 in the attribute header of attribute 80H. The Run List records the cluster addresses storing the file data. For example, the Run List is: 0x32 40 34 00 00 0C 32 80 31 07 54 16. First, according to 0x32, the lower 4 bits are 2, indicating that the next 2 bytes are the running cluster size (i.e., 0x3440), and the higher 4 bits are 3, indicating that the 3 bytes after the cluster size are the starting cluster (i.e., 0x0C0000), at which point one run ends. Similarly, the next 0x32 indicates that the running cluster size is 0x3180 and the starting cluster is 0x165407. At this time, a private SCSI read command to read the data of these two clusters can be constructed in sequence, sent to the security management module, and the data returned by the security management module can be obtained, thus obtaining the file data of the a.txt file.

[0074] When writing a file, the system first obtains the file path, file name, and file data, then sends a private SCSI read command to the security management module to locate a free MFT file. This process includes:

[0075] The private SCSI read command for reading the main MFT file is calculated and constructed based on the starting address of the MFT file and sent to the security management module. The main MFT file information is obtained based on the data returned by the security management module.

[0076] Obtain the MFT bitmap information based on the MFT bitmap attributes in the MFT file information;

[0077] The first bit marked as free is found in the MFT bitmap information in the order from front to back. The MFT file corresponding to the bit marked as free is the found free MFT file.

[0078] The starting address of the MFT file is the address of the main MFT file (MFT file number 0). The main MFT file can be read using private SCSI read commands. The B0H attribute (i.e., bitmap attribute) of the main MFT file records the MFT bitmap information, i.e., the usage status of the MFT file. If an MFT file is occupied, it is marked as 1; otherwise, it is marked as 0, indicating it is free. Therefore, by reading the MFT bitmap information, the first bit marked as free is found in the MFT bitmap information in sequential order. The MFT file corresponding to this free bit is the found free MFT file. For example, if the first bit marked as 0 is bit 37, then MFT file number 37 is the found free MFT file.

[0079] Then, it checks if the file length exceeds 1KB. If the file data length exceeds 1KB, the data cannot be directly stored in the MFT file and needs to be stored in the data area. The address index of the data area is stored in the MFT file. Therefore, a private SCSI read command is first sent to the security management module to find a free data address.

[0080] Specifically, the following method is used to send a private SCSI read command to the security management module to find a free data address:

[0081] The offset address of the bitmap file is calculated using the formula: MFT file start address + 6 * 0x400.

[0082] Based on the offset address of the bitmap file, a private SCSI read command is constructed to read the bitmap file and sent to the security management module. The bitmap information is obtained by obtaining the data returned by the security management module. The first bit marked as free is found in the bitmap information in the order from front to back. The cluster address corresponding to the bit marked as free is the free data address.

[0083] MFT file #6 is a bitmap file that records cluster usage. If a cluster is occupied, it is marked as 1; otherwise, it is marked as 0, indicating it is free. Therefore, the offset address of the bitmap file is calculated based on the starting address of the MFT file. The bitmap information is obtained through a private SCSI read command. The first bit marked as free is found in the bitmap information in a forward-to-back order. The cluster address corresponding to this free bit is the free data address.

[0084] It should be noted that the size of one cluster is 4K. If the size of the file to be written exceeds the size of one cluster, for example, 5K, two free data addresses are found from the bitmap information to store the file data. At the same time, the file data is split into two parts. Then, a private SCSI write command is constructed to write data to the first free data address, and the private SCSI write command and the first part of the data are sent to the security management module. The first part of the data is written to the first free data address. Then, a private SCSI write command is constructed to write data to the second free data address, and the private SCSI write command and the second part of the data are sent to the security management module. The second part of the data is written to the second free data address.

[0085] Then, a private SCSI write command is sent to the security management module to write the free data addresses to the free MFT file. That is, the free MFT file is used as the MFT file corresponding to the file being written. The 10H attribute of this MFT file records the file creation time, version information, etc., the 30H attribute records the file name, the 80H attribute type is marked as non-resident, and the two free data addresses and their corresponding data sizes are recorded at address 0x20 in the 80H attribute header.

[0086] If the file data length does not exceed 1K bytes, a private SCSI write command is sent to the security management module to write the file data to the idle MFT file;

[0087] Add the filename and free MFT file number to the index assignment attribute of the MFT file in the last-level folder.

[0088] During implementation, the MFT file address of the last-level folder of the file path to be written is found according to the process of steps S211 to S214. A private SCSI write instruction is constructed, and the file name and the free MFT file number (the MFT file number to be written to the file) are written into the index allocation attribute of the MFT file of the last-level folder.

[0089] During implementation, the security management module receives data read / write commands, including private SCSI read / write commands and standard SCSI read / write commands. Based on these commands, it reads and writes data in the encrypted area of ​​the solid-state drive, specifically including:

[0090] S31. Determine whether the data read / write instruction is a private SCSI instruction; if so, convert the address in the private SCSI instruction to the encrypted area address, and convert the private SCSI instruction to a standard instruction; read and write the encrypted area data of the solid-state drive according to the standard instruction;

[0091] S32. If the data read / write instruction is not a private instruction, determine whether the authentication is successful. If successful, read / write the encrypted data of the solid-state drive according to the data read / write instruction. If unsuccessful, do not read / write the solid-state drive.

[0092] When the security management module receives a data read / write command, it first determines whether it is a private SCSI command.

[0093] The 0th byte of a SCSI command is the opcode, indicating the operation type, such as a read or write command. Bytes 2-5 are the address of the command operation, and bytes 7-8 are the length of the command operation, such as the length of data read or written. Bytes 9-11 are reserved bytes. In implementation, the reserved bytes are used to determine whether it is proprietary SCSI. If the reserved bytes contain pre-defined data, it is proprietary SCSI; otherwise, it is standard SCSI.

[0094] When the data read / write command is a private SCSI command, the private SCSI command reads or writes data in the encrypted area, so the address is converted to the encrypted area address.

[0095] Specifically, the private SCSI instruction is parsed to obtain the address for reading and writing data; this address is added to the starting address of the encrypted area to obtain the converted address; and the address in the private SCSI instruction is modified to the converted address. That is, the address of bytes 2-5 of the private SCSI instruction is added to the starting address of the encrypted area to obtain the converted address, and then the address of bytes 2-5 of the private SCSI instruction is modified to the converted address.

[0096] Then, the reserved fields in the private SCSI instructions are modified to default values, and the private instructions are modified to standard instructions.

[0097] The security management module reads and writes corresponding data in the solid-state drive (SSD) according to the modified standard instructions. In the implementation shown, the security management module converts SCSI instructions to SATA instructions and sends them to the SSD to read and write data. The conversion of SCSI instructions to SATA instructions is existing technology and will not be elaborated upon here.

[0098] If the command is not a private instruction, i.e. accessed through a system API, it is necessary to determine whether the authentication is successful. If successful, the data read / write command is sent to the solid-state drive to read / write the encrypted data in the solid-state drive. If unsuccessful, no read / write operation is performed on the solid-state drive.

[0099] It should be noted that the data stored in a solid-state drive (SSD) is encrypted. Even if the SSD is deliberately removed, the data on the drive cannot be accessed.

[0100] Therefore, when the data read / write command is a write command, the file data is encrypted before the data read / write command is sent to the solid-state drive;

[0101] If the data read / write instruction is a read instruction, then after sending the data read / write instruction to the solid-state drive to read the encrypted data of the solid-state drive, the process also includes decrypting the read data.

[0102] When data is received for writing via a private SCSI write command, it is first encrypted before being written to the SSD. When reading data from the SSD, the data is first decrypted before being returned to the data read / write command sender. This further ensures data security.

[0103] In practice, a symmetric encryption algorithm is used for encryption, and the data length is the same before and after encryption.

[0104] One embodiment of the present invention discloses a data access system for a secure storage device, including a secure storage device and a host terminal. The secure storage device includes a solid-state drive and a security management module; the solid-state drive is divided into encrypted areas.

[0105] The host determines whether the current environment is safe;

[0106] When the current environment is insecure, the host sends data read / write commands to the security management module through the extended SDK; when the current environment is secure, the host sends data read / write commands to the security management module through the extended SDK or system API.

[0107] The security management module reads and writes the encrypted data of the solid-state drive according to the data read / write instructions.

[0108] Preferably, the host sends data read / write commands to the security management module via the extended SDK, including:

[0109] When a file needs to be read, the host obtains the file path and file name to be read, and sends a private SCSI read command to the security management module according to the file path and file name to read the file data corresponding to the file path and file name.

[0110] When writing a file, the host obtains the file path, file name, and file data to be written, and sends a private SCSI read command to the security management module to find a free MFT file;

[0111] If the file data length exceeds 1K bytes, a private SCSI read command is sent to the security management module to find a free data address; a private SCSI write command is sent to the security management module to write the file data to the free data address; a private SCSI write command is sent to the security management module to write the free data address to the free MFT file; if the file data length does not exceed 1K bytes, a private SCSI write command is sent to the security management module to write the file data to the free MFT file.

[0112] Add the filename and free MFT file information to the end of the file path and to the index assignment attribute of the MFT file in the folder.

[0113] Compared to existing technologies, when the environment is insecure, data in the encrypted area of ​​the solid-state drive can only be read and written through the extended SDK, and other applications cannot access it. This protects data security while facilitating data access. After user authentication, access can be made through the extended SDK or through the system API. Even data written through the extended SDK can be accessed through the normal access method of the system API, thereby improving the convenience of data access.

[0114] The above-described method and system embodiments are based on the same principles, and their related aspects can be referenced from each other to achieve the same technical effects. For specific implementation processes, please refer to the foregoing embodiments, which will not be repeated here.

[0115] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.

[0116] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A data access method for a secure storage device, characterized in that, The secure storage device includes a security management module and a solid-state drive (SSD), wherein the SSD is divided into encrypted areas. The method includes the following steps: Determine if the current environment is safe; When the current environment is insecure, data read / write commands are sent to the security management module via the extended SDK; when the current environment is secure, data read / write commands are sent to the security management module via the extended SDK or system API. The security management module reads and writes the encrypted data of the solid-state drive according to the data read and write instructions; Sending data read / write commands to the security management module via the extended SDK includes: When a file needs to be read, the file path and file name are obtained, and a private SCSI read command is sent to the security management module according to the file path and file name to read the file data corresponding to the file path and file name. When writing a file, obtain the file path, file name, and file data to be written, and send a private SCSI read command to the security management module to find a free MFT file; If the file data length exceeds 1K bytes, a private SCSI read command is sent to the security management module to find a free data address; a private SCSI write command is sent to the security management module to write the file data to the free data address; a private SCSI write command is sent to the security management module to write the free data address to the free MFT file; if the file data length does not exceed 1K bytes, a private SCSI write command is sent to the security management module to write the file data to the free MFT file. Add the filename and free MFT file information to the end of the file path and to the index allocation attribute of the MFT file in the folder; The security management module reads and writes the encrypted data of the solid-state drive according to the data read / write instructions, including: Determine whether the data read / write instruction is a private SCSI instruction; if so, convert the address in the private SCSI instruction to an encrypted area address, and convert the private SCSI instruction to a standard instruction; read and write the encrypted area data of the solid-state drive according to the standard instruction; If the data read / write command is not a private command, then it is determined whether the authentication is successful. If successful, the encrypted data of the solid-state drive is read / written according to the data read / write command. If unsuccessful, no read / write operation is performed on the solid-state drive.

2. The data access method for a secure storage device according to claim 1, characterized in that, Based on the file path and filename, a private SCSI read command is sent to the security management module to read the file data corresponding to the file path and filename, including: S211. Calculate the address of the MFT file in the root directory based on the starting address of the MFT file; use the root directory as the current directory; use the first-level folder in the file path as the current file to search for; S212. Construct a private SCSI read instruction to read the MFT file in the current directory based on the address of the MFT file in the current directory; send the private SCSI read instruction to read the MFT file in the current directory to the security management module, and obtain the current directory information by obtaining the data returned by the security management module; S213. Check the index allocation attribute of the current directory information to see if the currently searched file is included. If it is not included, return a message that the path is incorrect; otherwise, proceed to step S214. S214. Find the MFT file number corresponding to the currently searched file in the index allocation attribute of the current directory information, calculate the address of the MFT file corresponding to the currently searched file, and take the currently searched file as the current directory; if there is a sub-file of the currently searched file in the file path, then take the sub-file of the currently searched file in the file path as the current searched file; if the currently searched file is a filename, then execute step S215; otherwise, return to step S212. S215. Construct a private SCSI read instruction to read the MFT file of the currently searched file based on the address of the MFT file of the currently searched file; send the private SCSI read instruction to read the MFT file of the currently searched file to the security management module, obtain the MFT file information of the currently searched file by the data returned by the security management module, and obtain the file data based on the MFT file information of the currently searched file.

3. The data access method for a secure storage device according to claim 1, characterized in that, Send a private SCSI read command to the security management module to find a free data address, including: According to the formula: MFT file start address + 6 The offset address of the bitmap file is calculated using 0x400; Based on the offset address of the bitmap file, a private SCSI read command is constructed to read the bitmap file and sent to the security management module. The bitmap information is obtained by obtaining the data returned by the security management module. The first bit marked as free is found in the bitmap information in the order from front to back. The cluster address corresponding to the bit marked as free is the free data address.

4. The data access method for a secure storage device according to claim 1, characterized in that, Send a private SCSI read command to the security management module to locate a free MFT file, including: The private SCSI read command for reading the main MFT file is calculated and constructed based on the starting address of the MFT file and sent to the security management module. The main MFT file information is obtained based on the data returned by the security management module. Obtain the MFT bitmap information based on the MFT bitmap attributes in the MFT file information; The first bit marked as free is found in the MFT bitmap information in the order from front to back. The MFT file corresponding to the bit marked as free is the found free MFT file.

5. The data access method for a secure storage device according to claim 1, characterized in that, If the data read instruction is a write instruction, then the file data is encrypted before sending the data read / write instruction to the solid-state drive; If the data read / write instruction is a read instruction, then after sending the data read / write instruction to the solid-state drive to read the encrypted data of the solid-state drive, the process also includes decrypting the read data.

6. The data access method for a secure storage device according to claim 1, characterized in that, The process of converting the address in the private SCSI command to an encrypted zone address and converting the private SCSI command to a standard command includes: The address for reading and writing data is obtained by parsing the private SCSI instruction; the address is added to the starting address of the encrypted area to obtain the converted address; the address in the private SCSI instruction is modified to the converted address. Modify the reserved fields in the private SCSI command to their default values, and modify the private command to a standard command.

7. A data access system for a secure storage device, characterized in that, It includes a secure storage device and a host device, wherein the secure storage device includes a solid-state drive and a security management module; the solid-state drive is divided into encrypted areas; The host determines whether the current environment is safe; When the current environment is insecure, the host sends data read / write commands to the security management module through the extended SDK; when the current environment is secure, the host sends data read / write commands to the security management module through the extended SDK or system API. The security management module reads and writes the encrypted data of the solid-state drive according to the data read and write instructions; The host sends data read / write commands to the security management module via the extended SDK, including: When a file needs to be read, the host obtains the file path and file name to be read, and sends a private SCSI read command to the security management module according to the file path and file name to read the file data corresponding to the file path and file name. When writing a file, the host obtains the file path, file name, and file data to be written, and sends a private SCSI read command to the security management module to find a free MFT file; If the file data length exceeds 1K bytes, a private SCSI read command is sent to the security management module to find a free data address; a private SCSI write command is sent to the security management module to write the file data to the free data address; a private SCSI write command is sent to the security management module to write the free data address to the free MFT file; if the file data length does not exceed 1K bytes, a private SCSI write command is sent to the security management module to write the file data to the free MFT file. Add the filename and free MFT file information to the end of the file path and to the index allocation attribute of the MFT file in the folder; The security management module reads and writes the encrypted data of the solid-state drive according to the data read / write instructions, including: Determine whether the data read / write instruction is a private SCSI instruction; if so, convert the address in the private SCSI instruction to an encrypted area address, and convert the private SCSI instruction to a standard instruction; read and write the encrypted area data of the solid-state drive according to the standard instruction; If the data read / write command is not a private command, then it is determined whether the authentication is successful. If successful, the encrypted data of the solid-state drive is read / written according to the data read / write command. If unsuccessful, no read / write operation is performed on the solid-state drive.

Citation Information

Patent Citations

  • Encryption method and decryption method of hard disk storage device and encryption and decryption system used for hard disk storage device

    CN102346716A

  • Method and device for realizing data prefetching

    CN103984640A