A method and system for automatically locking a mobile storage device off-site

By dynamically determining the key residency calibration site in a mobile storage device, constructing a dynamic star-shaped radiation envelope domain and performing radial cutting, the problem of incomplete key erasure in existing technologies is solved, achieving a highly secure and easy-to-use off-site automatic locking key erasure operation.

CN123069397APending Publication Date: 2026-11-10SHAANXI JUNNING INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611245323.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-17
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

Existing mobile storage devices do not completely erase keys when a physical connection is detected to be broken, making them vulnerable to cold start attacks and chip disassembly and reading threats. Furthermore, the criteria for determining disconnection are singular, which can easily lead to misjudgment or frequent accidental erasure, resulting in insufficient availability.

Method used

By continuously monitoring the connection status, the system dynamically determines the resident calibration sites of multiple keys in the logical volume table of the key storage area, constructs a dynamic star-shaped radiation envelope domain, generates radial cutting bands by radially dividing them equally, calculates the area of ​​the cutting bands, uses the fitted residual exponent to confirm the displacement, and performs access locking and irreversible erasure operations.

Benefits of technology

It improves the accuracy of off-site detection, avoids accidental key erasure, ensures complete key destruction, eliminates data recovery risks, and guarantees high security and ease of use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123069397A_ABST
    Figure CN123069397A_ABST
Patent Text Reader

Abstract

The application provides a mobile storage device off-site automatic locking key erasing method and system, relates to the off-site key erasing technical field of mobile storage, and the method comprises the following steps: continuously monitoring the connection state between the mobile storage device and the authorized terminal; when detecting that the connection between the mobile storage device and the authorized terminal is disconnected, generating an off-site detection signal; based on the off-site detection signal, dynamically determining a plurality of key resident calibration sites in the logical volume table of the key storage area of the mobile storage device; each key resident calibration site is respectively positioned at the first double-word position of the key metadata header sector, the middle sector of each segment of the key load body, and the tail double-word position of the key integrity digest sector. The application improves the reliability of off-site confirmation and complete key erasing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of mobile storage device removal key erasure technology, and in particular to a method and system for automatic locking and key erasure of mobile storage devices when they are removed from their original positions. Background Technology

[0002] In research and development scenarios involving classified units or enterprises, hardware-encrypted mobile storage devices (such as encrypted USB flash drives and encrypted external hard drives) are commonly used to carry sensitive data. These devices can only be decrypted and accessed on authorized terminals. When an operator inserts the device into an authorized computer to process files, in case of an emergency and the device is unauthorizedly removed or lost, the storage device should be able to prevent subsequent unauthorized access. For example, a research and development department stored core design data on an encrypted USB flash drive. An engineer was using the USB flash drive to read files on an authorized workstation and temporarily left for some reason. Someone else took advantage of this and removed the USB flash drive. Because the USB flash drive was only locked after leaving the authorized terminal, an attacker could disassemble the USB flash drive and use a specialized flash memory reading device to directly obtain the remaining key material in the storage chip, successfully decrypting and stealing all the technical data, causing serious losses.

[0003] In practice, some mobile storage devices, upon detecting a physical connection loss, only perform an access lock operation, leaving the encryption key intact in the non-volatile storage area. This exposes them to cold-start attacks and the threat of chip disassembly and reading. Other solutions attempt to trigger key erasure upon disconnection; however, their criteria for determining disconnection are relatively singular, often relying on electrical connection status or simple heartbeat timeouts. These are susceptible to interference from factors such as momentary poor contact at the USB interface, host system hibernation, or voltage fluctuations, leading to false alarms. This can result in either failure to erase the key in time, leaving vulnerabilities, or frequent false erases requiring repeated key recovery, resulting in insufficient usability. Furthermore, even if an erase command is executed, if the erasure process is interrupted or only the file allocation table is rewritten, the key data may not be irrecoverably destroyed, allowing attackers to potentially recover the original key. Summary of the Invention

[0004] This invention provides a method and system for automatically locking and erasing keys when a mobile storage device is out of place, which improves the reliability of out-of-place confirmation and complete key erasure.

[0005] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: In a first aspect, a method for automatically locking and wiping the key when a mobile storage device is removed from its position, the method comprising: Step 1: Continuously monitor the connection status between the mobile storage device and the authorized terminal. When the connection between the mobile storage device and the authorized terminal is detected to be disconnected, generate an off-site detection signal. Step 2: Based on the off-position detection signal, dynamically determine multiple key residency calibration bits in the logical volume table of the key storage area of ​​the mobile storage device; each key residency calibration bit is located at the first double-word position of the key data header sector, the middle sector of each segment of the key payload, and the last double-word position of the key integrity digest sector. Step 3: A dynamic star-shaped radiation envelope is formed by connecting the spatial coordinates of each key-residence calibration site; the dynamic star-shaped radiation envelope is radially divided into equal parts to obtain several radially cut strips; the area of ​​each radially cut strip is calculated; and the radially cut strip area sequence is obtained based on the area of ​​the radially cut strips. Step 4: Perform numerical simulation fitting on the radial cutting area sequence to obtain the radial cutting fitting residual index of the envelope domain; compare the radial cutting fitting residual index of the envelope domain with the preset displacement threshold; when the radial cutting fitting residual index of the envelope domain exceeds the preset displacement threshold, a displacement confirmation command is obtained. Step 5: Based on the departure confirmation command, perform an access lock operation on the mobile storage device to obtain a lock status identifier; based on the lock status identifier, perform an irreversible erase operation on the encryption key stored in the mobile storage device to obtain a key erasure completion identifier.

[0006] Secondly, a mobile storage device automatic locking and key erasure system upon removal from its location includes: The monitoring module is used to continuously monitor the connection status between the mobile storage device and the authorized terminal. When the connection between the mobile storage device and the authorized terminal is detected to be disconnected, an off-site detection signal is generated. The dynamic determination module is used to dynamically determine multiple key-resident calibration bits in the logical volume table of the key storage area of ​​the mobile storage device based on the off-position detection signal; each key-resident calibration bit is located at the first double-word position of the key data header sector, the middle sector of each segment of the key payload, and the last double-word position of the key integrity digest sector. The cutting module is used to form a dynamic star-shaped radiation envelope domain by connecting the spatial coordinates of each key-residence calibration crystal position; to perform radial equal division of the dynamic star-shaped radiation envelope domain to obtain several radial cutting bands; to calculate the area of ​​each radial cutting band; and to obtain the radial cutting band area sequence based on the area of ​​the radial cutting bands. The comparison module is used to perform numerical simulation fitting on the radial cut area sequence to obtain the radial cut fitting residual index of the envelope domain; the radial cut fitting residual index of the envelope domain is compared with the preset displacement threshold, and when the radial cut fitting residual index of the envelope domain exceeds the preset displacement threshold, a displacement confirmation command is obtained. The processing module is used to perform an access locking operation on the mobile storage device based on the departure confirmation command, and obtain a lock status identifier; based on the lock status identifier, it performs an irreversible erasure operation on the encryption key stored in the mobile storage device, and obtains a key erasure completion identifier.

[0007] The above-described solution of the present invention has at least the following beneficial effects: By continuously monitoring the connection status, an out-of-connection confirmation process based on key storage area characteristics is initiated upon disconnection. The key's residing calibration location is dynamically determined in the key storage logical volume table, encompassing key sector locations such as the metadata header, payload segments, and integrity digest. These location spatial coordinates are used to construct a dynamic star-shaped radial envelope domain, effectively capturing fine-grained features of the storage layout. The envelope domain is radially divided into equal sections, generating a radially divided area sequence. The radially divided residual index of the envelope domain is obtained through numerical simulation fitting and compared with a preset out-of-connection threshold as the basis for out-of-connection confirmation. This method significantly improves the accuracy of out-of-connection determination, avoiding false triggers caused by momentary access locking due to poor contact or system power saving, followed by irreversible erasure of the encryption key. Once unauthorized out-of-connection is confirmed, the erasure operation is first restored, completely destroying the key from the storage medium's underlying layer, eliminating the possibility of physical extraction and data recovery. This process is completed automatically without user intervention, ensuring high security while maintaining ease of use. Attached Figure Description

[0008] Figure 1 This is a flowchart illustrating an automatic locking and key erasure method for a mobile storage device when it is out of place, as provided in an embodiment of the present invention.

[0009] Figure 2 This is a schematic diagram of the process for obtaining the radial boundary values ​​between each radially equal partition provided by an embodiment of the present invention.

[0010] Figure 3 This is a schematic diagram of an automatic locking and key erasure system for a mobile storage device when it is out of place, provided by an embodiment of the present invention. Detailed Implementation

[0011] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0012] like Figures 1 to 2 As shown, an embodiment of the present invention proposes a method for automatically locking and wiping the key when a mobile storage device is removed from its position. The method includes the following steps: Step 1: Continuously monitor the connection status between the mobile storage device and the authorized terminal. When a disconnection is detected between the mobile storage device and the authorized terminal, a departure detection signal is generated, specifically including: The firmware of the mobile storage device integrates a connection status monitoring module. This module continuously reads the connection status register inside the Universal Serial Bus Interface (USB) controller of the mobile storage device at a preset polling cycle, and obtains the connection status flag bit at the current moment in each polling cycle. The connection status register is a hardware register inside the USB interface controller. Bit 0 of this register is used to indicate the physical layer electrical connection status. When this bit is logic 1, it indicates that the physical layer electrical connection is valid, that is, the terminating resistor on the differential data line has been correctly detected. When this bit is logic 0, it indicates that the physical layer electrical connection is invalid, that is, the terminating resistor on the differential data line has disappeared.

[0013] The first bit of the register is used to indicate the device enumeration completion status. When this bit is logic 1, it means that the mobile storage device has completed the device enumeration process with the authorized terminal, that is, the device descriptor has been successfully reported and the host has allocated a device address. When this bit is logic 0, it means that the device enumeration process has not been completed or has failed. The second bit of the register is used to indicate the data channel communication handshake status. When this bit is logic 1, it means that both the Universal Serial Bus bulk transfer endpoint and the control transfer endpoint are in a ready state and can exchange data with the authorized terminal. When this bit is logic 0, it means that the data channel communication handshake has been interrupted.

[0014] In each polling cycle, the connection status monitoring module reads all three bits from the connection status register at once and assembles them into a three-bit connection status code. Bit 0 of the connection status code corresponds to the physical layer electrical connection status, bit 1 corresponds to the device enumeration completion status, and bit 2 corresponds to the data channel communication handshake status. Based on the connection status code read in the current polling cycle, it compares bit by bit with the historical connection status code recorded in the previous polling cycle. The comparison rule is as follows: when any one of the three bits of the current connection status code changes from logic 1 to logic 0, and the corresponding bit of the historical connection status code is logic 1, it is determined that the connection at the corresponding level has been broken. When all three bits change from logic 1 to logic 0, it is determined that the connection between the mobile storage device and the authorized terminal is completely broken.

[0015] Based on the determination that the connection is completely disconnected, the connection status monitoring module generates a departure detection signal. The departure detection signal is a digital signal containing a 1-byte instruction code and a 1-byte departure timestamp. The instruction code is 0xFF, indicating a departure event. The departure timestamp is the count value of the free-running counter inside the connection status monitoring module at the current moment. The polling period is 100ms. This value is based on the maximum response time requirement for device disconnection detection in Section 7.1.7.3 of the Universal Serial Bus specification USB 2.0, which requires the host to detect the disconnection event within no more than 200ms after the device is disconnected. Using 100ms as the polling period ensures that the device side detects the disconnection event within at most two polling periods, i.e., 200ms, to meet the specification requirements, while avoiding excessively frequent register read operations that increase device power consumption.

[0016] In this embodiment of the invention, by monitoring the connection status at the hardware register level, the connection status code composed of three independent bits (physical layer electrical connection, device enumeration completion, and data channel communication handshake) in the Universal Serial Bus Interface Controller is continuously read at a polling cycle of 100ms, and compared bit by bit with historical status codes. This enables comprehensive perception of connection disconnection events from the physical layer, protocol layer, and transport layer, effectively distinguishing between temporary poor device contact and genuine unauthorized disconnection, and avoiding misjudgment problems caused by relying solely on a single electrical connection signal.

[0017] Step 2: Based on the off-site detection signal, dynamically determine multiple key-residence calibration bits in the logical volume table of the key storage area of ​​the mobile storage device; each key-residence calibration bit is located at the first double-word position of the key data header sector, the middle sector of each segment of the key payload, and the last double-word position of the key integrity digest sector, specifically including: Based on the off-site detection signal, after receiving a signal with the instruction code 0xFF, the security control firmware inside the mobile storage device parses the off-site timestamp field to record the time of the off-site event, and then triggers the key resident calibration bit determination process. The security control firmware reads the starting address of the logical volume table of the key storage area from its internal read-only memory, and reads each sector index entry of the logical volume table sequentially from the non-volatile flash memory of the key storage area according to the sector granularity. All the read sector index entries are loaded into the static random access memory of the security control firmware to obtain the logical volume table.

[0018] A logical volume table is a metadata index structure within the key storage area. Its internal structure is as follows: The logical volume table starts storing data from physical sector 0 of the key storage area. Each sector index entry occupies 16 bytes. Bytes 0 to 3 store the sector type flag field, which identifies the functional type of the physical sector pointed to by the index entry. Bytes 4 to 7 store the starting physical sector number of the functional sector. Bytes 8 to 11 store the ending physical sector number of the functional sector. Bytes 12 to 15 store the attribute flag field of the functional sector. The encoding rules for the sector type flag field are as follows: 0x00000001 represents the key metadata header sector; 0x00000002 represents the key payload segment sector; 0x00000003 represents the key integrity digest sector; and 0x00000000 represents an empty entry, i.e., the end marker of the logical volume table. In the logical volume table, each sector index entry is arranged in ascending order of the value of the sector type marker field. That is, the key metadata header sector entry is placed first, followed by the key payload segment sector entries, and finally the key integrity digest sector entries. Empty entries are placed at the end.

[0019] The functional sectors in the key storage area are defined as follows: The key metadata header sector is the sector in the key storage area that stores the encryption key attribute information. This attribute information includes: an encryption algorithm identifier (occupying 2 bytes) indicating the type of symmetric encryption algorithm used, such as the Advanced Encryption Standard (AES-256); a key length (occupying 2 bytes) indicating the bit length of the encryption key; and a key version number (occupying 4 bytes) indicating the version number of the encryption key, used to support key rotation. These attribute information, totaling 8 bytes, are stored in the first 8 bytes of the key metadata header sector. The first double-word position of the key metadata header sector refers to the physical storage location of the first double-word, i.e., the 4 bytes at sector offset addresses 0x00 to 0x03. This first double-word position stores the encryption algorithm identifier and key length attribute fields. The key payload segment sector refers to a continuous sector segment in the key storage area that stores the actual encryption key data. The key payload is divided into at least one segment, each segment being a continuous physical sector. The length of the segment depends on the actual length of the encryption key and the storage strategy.

[0020] The key integrity digest sector refers to the sector in the key storage area that stores the integrity verification value of the encryption key data. This verification value is obtained by performing a hash operation on all the data in the key payload. The verification value occupies 32 bytes and is stored in the last 32 bytes of the key integrity digest sector, i.e., the sector offset address is from 0x1E0 to 0x1FF. The tail double word position of the key integrity digest sector refers to the physical storage location of the last double word of the key integrity digest sector, i.e., the 4 bytes at the sector offset address is from 0x1FC to 0x1FF. This tail double word position stores the last 4 bytes of the integrity verification value.

[0021] The security control firmware performs calibration bit positioning based on the logical volume table loaded into the running memory. It traverses all the sector index entries loaded in the logical volume table, matches the sector type flag field of each entry with the preset type code, and finds the entry with the sector type flag field equal to 0x00000001, which is the key metadata header sector index entry. It reads the starting physical sector number field of bytes 4 to 7 from this entry, parses it to obtain the starting physical address of the key metadata header sector. The physical address of the first double word of the key metadata header sector is equal to the starting physical address of the key metadata header sector, which is the address offset 0x00 based on the first byte of the sector. The calculated position is determined as the first calibration bit, and the physical address and sector type flag value corresponding to the first calibration bit are recorded in the calibration bit temporary storage table.

[0022] Following the sector index entries in the logical volume table, continue traversing backwards from the sector index entries in the key metadata header, sequentially finding all entries where the sector type flag field is equal to 0x00000002, i.e., the key payload segment sector index entries. For each key payload segment sector index entry, read the starting physical sector number from bytes 4 to 7 and the ending physical sector number from bytes 8 to 11. Divide the sum of the starting and ending physical sector numbers by 2 to obtain the physical address of the intermediate sector for that segment. Determine the physical address of the intermediate sector as the intermediate calibration bit corresponding to that segment. When the key payload contains M segments, obtain M intermediate calibration bits. Append the physical address and sector type flag value corresponding to each intermediate calibration bit to the calibration bit temporary storage table in sequence. The middle sector refers to the geometric midpoint of the first and last sectors of the key payload segment in the physical address space. The sector corresponding to this position stores the encrypted key data located in the middle of the segment. Selecting the middle sector as the calibration position can evenly represent the data distribution characteristics of the segment.

[0023] Following the sector index entries in the logical volume table, continue traversing backwards from the last key payload segment sector index entry to find the entry where the sector type flag field equals 0x00000003, which is the key integrity digest sector index entry. Read the starting physical sector number from the 4th to the 7th byte of this entry to obtain the starting physical address of the key integrity digest sector. The physical address of the last double word of the key integrity digest sector is equal to the starting physical address of the key integrity digest sector plus the sector offset. The sector offset is calculated by subtracting the length of one double word (4 bytes) from the standard size of each sector (512 bytes) to obtain 508 bytes, or 0x1FC. The position of this last double word is determined as the last calibration bit. The physical address and sector type flag value corresponding to the last calibration bit are appended and recorded in the calibration bit temporary storage table.

[0024] After the traversal is complete, the security control firmware summarizes all the calibration bits recorded in the calibration bit temporary storage table, namely the first calibration bit, each intermediate calibration bit, and the last calibration bit, into a calibration bit set. This calibration bit set is stored as multiple key-resident calibration bits in the protected memory area of ​​the security control firmware. The key-resident calibration bit refers to the key physical location point in the physical address space of the key storage area where the encryption key data or its metadata is located. Each calibration bit is identified by the physical address and the sector type flag value. These calibration bits are located in three different functional levels of the key storage area: the metadata header sector layer, the key payload segment intermediate sector layer, and the integrity digest sector layer. Together, they constitute the spatial sampling point set of the key storage layout.

[0025] In this embodiment of the invention, by sequentially traversing the three functional levels of the metadata header sector, the intermediate sectors of each segment of the key payload, and the integrity digest sector along the sector index chain, key physical location points distributed at different depths in the key storage area are automatically extracted. There is no need to store preset coordinate information. Moreover, the number and position of the calibrated crystal positions are dynamically determined according to the actual sector allocation results of the key storage layout. The set of calibrated crystal positions is different for different devices or for the same device at different stages of use, which makes the subsequent envelope domain form device-unique and time-varying, thus enhancing the security of the off-site determination.

[0026] Step 3: A dynamic star-shaped radiation envelope is formed by connecting the spatial coordinates of each key-residence calibration site; the dynamic star-shaped radiation envelope is radially divided into several radially diced bands; the area of ​​each radially diced band is calculated; based on the area of ​​the radially diced bands, a sequence of radially diced band areas is obtained, specifically including: Based on multiple key-residence calibration bits, the security control firmware traverses each calibration bit entry in the calibration bit set one by one, resolving the physical address of each calibration bit into two components: sector number and byte offset within the sector. The sector number is equal to the physical address divided by 512 and rounded down, and the byte offset within the sector is equal to the physical address modulo 512. Using the sector number as the first-dimensional coordinate and the byte offset within the sector as the second-dimensional coordinate, a two-dimensional spatial coordinate for each key-residence calibration bit is established. The two-dimensional spatial coordinates of all key-residence calibration bits are summarized to obtain the spatial coordinates of each key-residence calibration bit in the logical volume table.

[0027] The first dimension in the two-dimensional spatial coordinate represents the sector-level position of the key residency calibration bit in the key storage area, i.e., the vertical position. The larger the sector number, the closer the bit is to the end of the key storage area. The second dimension represents the byte-level fine position of the key residency calibration bit within its sector, i.e., the horizontal position. This two-dimensional coordinate mapping method can simultaneously capture the macro-sector distribution characteristics and micro-byte-level offset characteristics of the key storage layout.

[0028] Based on the spatial coordinates of each key-residence calibration bit, the security control firmware performs geometric centroid calculation. Specifically, it reads the spatial coordinates of the first key-residence calibration bit from the calibration bit set, extracts the first-dimensional coordinate value from the spatial coordinates, stores the first-dimensional coordinate value in the first-dimensional accumulation register as the initial value of the first-dimensional coordinate sum, extracts the second-dimensional coordinate value from the spatial coordinates, stores the second-dimensional coordinate value in the second-dimensional accumulation register as the initial value of the second-dimensional coordinate sum, and sets the processed bit counter to 1.

[0029] Read the spatial coordinates of the next key-residence calibration crystal position sequentially from the calibration crystal position set, extract the first-dimensional coordinate value of the spatial coordinate, add the current value in the first-dimensional accumulation register to the extracted first-dimensional coordinate value, and store the sum of the sums back to the first-dimensional accumulation register to update the first-dimensional coordinate sum. At the same time, extract the second-dimensional coordinate value of the spatial coordinate, add the current value in the second-dimensional accumulation register to the extracted second-dimensional coordinate value, and store the sum of the sums back to the second-dimensional accumulation register to update the second-dimensional coordinate sum. Increment the value of the processed crystal position counter by 1.

[0030] Determine if the current value of the processed bit counter is equal to the total number of key-resident calibration bits. If the value of the processed bit counter is less than the total number of key-resident calibration bits, return to continue processing the next key-resident calibration bit. If the value of the processed bit counter is equal to the total number of key-resident calibration bits, it indicates that the coordinate values ​​of all key-resident calibration bits have been accumulated. At this time, the value in the first-dimensional accumulation register is the first-dimensional coordinate accumulation sum.

[0031] The total number of key-resident calibration bits is read from the protected memory area of ​​the security control firmware. The sum of the first-dimensional coordinates is divided by the total number of key-resident calibration bits, and the quotient is the first-dimensional centroid coordinate. The sum of the second-dimensional coordinates is divided by the total number of key-resident calibration bits, and the quotient is the second-dimensional centroid coordinate.

[0032] The first-dimensional centroid coordinates and the second-dimensional centroid coordinates are combined into a two-dimensional coordinate point. The first-dimensional component of this two-dimensional coordinate point is equal to the first-dimensional centroid coordinate, and the second-dimensional component is equal to the second-dimensional centroid coordinate. This two-dimensional coordinate point is determined as the geometric centroid of each key-residence calibration site, and this geometric centroid is determined as the radiation origin of the dynamic star-shaped radiation envelope domain. The geometric centroid refers to the central reference point obtained by taking the arithmetic mean of the spatial coordinates of each key-residence calibration site through each dimension. This central reference point represents the overall spatial distribution center of the key-related key locations in the key storage area. The radiation origin is the geometric reference point for subsequent radial radiation operations.

[0033] Based on the spatial coordinates of the origin and the spatial coordinates of each key-residence calibration site, the security control firmware establishes the first radial connection starting from the origin and ending at the spatial coordinates of the first key-residence calibration site. The second radial connection starts from the origin and ends at the spatial coordinates of the second key-residence calibration site, and so on, until the last radial connection starts from the origin and ends at the spatial coordinates of the last key-residence calibration site. This results in a total of several radial connections equal to the number of key-residence calibration sites. Each radial connection is defined by the two-dimensional spatial coordinates of the origin and the corresponding two-dimensional spatial coordinates of the end point. The radial connection represents the radial direction vector from the spatial center of the key storage layout to each key location point.

[0034] Based on each radiating connection, the security control firmware extracts the spatial coordinates of the endpoint of each radiating connection, i.e. the endpoint furthest from the origin of radiation (that is, the spatial coordinates of each key resident calibration crystal position itself), and obtains each end endpoint. The spatial coordinates of all end endpoints are then summarized into an end endpoint list.

[0035] Based on each endpoint, the security control firmware uses the radiation origin as the angle measurement reference center and calculates the azimuth angle of each endpoint relative to the radiation origin. The azimuth angle is calculated as follows: The difference between the endpoint and the radiation origin in the first dimension is calculated by subtracting the first-dimensional coordinate of the radiation origin from the first-dimensional coordinate of the endpoint; the difference in the second dimension is calculated by subtracting the second-dimensional coordinate of the radiation origin from the second-dimensional coordinate of the endpoint; the difference in the third dimension is calculated by... The ratio of the dimensional difference to the first-dimensional difference is used to perform an arctangent operation on this ratio to obtain the radian angle. The radian angle is then converted to an angle value. When the first-dimensional difference is greater than or equal to 0 and the second-dimensional difference is greater than or equal to 0, the azimuth angle is equal to the angle value. When the first-dimensional difference is less than 0, the azimuth angle is equal to the angle value plus 180°. When the first-dimensional difference is greater than or equal to 0 and the second-dimensional difference is less than 0, the azimuth angle is equal to the angle value plus 360°. This normalizes the range of the azimuth angle to the interval between 0° and 360°.

[0036] The endpoints are rearranged in ascending order of their corresponding azimuth angles to obtain an endpoint azimuth angle arrangement sequence. Based on this sequence, the safety control firmware starts from the first endpoint in the sequence and connects the first and second endpoints with a straight line segment to obtain the first boundary line. The second and third endpoints are then connected with a straight line segment to obtain the second boundary line, and so on. The second-to-last endpoint is connected with the last endpoint to obtain the second-to-last boundary line, and the last endpoint is connected with the first endpoint to obtain the last boundary line, thus forming a closed loop and obtaining the boundary line connection chain.

[0037] Each boundary line is a straight line segment connecting two adjacent endpoints. The boundary line connection chain as a whole forms a closed polygonal outer boundary surrounding the radiation origin. According to the connection chain between each radiation line and the boundary line, the security control firmware connects the radiation origin, the starting point (which is the radiation origin itself) and the ending point (i.e., each endpoint) of each radiation line, and the starting and ending points of each boundary line. The specific closure rules are as follows: Starting from the radiation origin, go along the first radiation line to its endpoint, go along the corresponding boundary line to the adjacent endpoint, then go along the second radiation line back to the radiation origin, then go from the radiation origin along the second radiation line to its endpoint... and so on. Finally, the radiation origin, all radiation lines and all boundary lines together enclose a closed star-shaped region whose interior is filled with several triangular sub-regions by radiation lines and whose exterior is closed by the boundary line connection chain. This closed star-shaped region is defined as the dynamic star-shaped radiation envelope domain.

[0038] A dynamic star-shaped radiation envelope region refers to a closed star-shaped geometric region enclosed by the radiation origin, the radiation lines connecting each key-residence calibration bit, and the boundary lines. The geometry of this region has the following characteristics: the center of the region is the radiation origin; each protruding vertex of the region is the endpoint of a key-residence calibration bit; the outline of the region is determined by the outer boundary of a polygon formed by boundary lines connected end-to-end in azimuth order; and the interior of the region is divided into multiple triangular sub-regions by several radiation lines. Since the physical address of each key-residence calibration bit depends on the actual sector allocation result of the key storage layout, the allocation position of key storage sectors in different mobile storage devices, even those of the same model, will differ due to the bad block management strategy and wear leveling operation of the flash memory chip. The key storage sector position of the same device will also change at different stages of use due to key update operations. Therefore, the shape of the envelope region constructed from the spatial coordinates of these calibration bits is dynamically changing. Differences in the key storage layout of different devices or the same device at different times will cause the shape of the envelope region to change accordingly.

[0039] Based on the dynamic star-shaped radiation envelope domain, the security control firmware extends outward from the radiation origin along each radiation line direction. The straight-line distance from the radiation origin along the radiation line direction to the intersection of the radiation line and the boundary line is measured. This straight-line distance is the radial distance in the radiation line direction. All radiation line directions are traversed, and the radial distance in each radiation line direction is calculated. The largest value among all radial distances is selected as the maximum radial distance from the radiation origin to the farthest endpoint on each boundary line.

[0040] Based on the maximum radial distance, the security control firmware obtains a preset fractional division. The preset fractional division represents the number of equally long intervals into which the radial direction of the dynamic star-shaped radiation envelope, from the radiation origin to the maximum radial distance, is uniformly divided. The preset fractional division is determined according to the total number of key-residence calibration bits: 8 when the total number of key-residence calibration bits is greater than or equal to 8, 6 when the total number of key-residence calibration bits is between 4 and 7, and 4 when the total number of key-residence calibration bits is less than or equal to 3. The basis for this value rule is as follows: the more calibration sites there are, the more complex the outer boundary contour of the envelope domain becomes, requiring more radially divided intervals to capture the fine variation features of the envelope domain morphology at different radial depths; the fewer calibration sites there are, the simpler the outer boundary contour of the envelope domain becomes, and fewer radially divided intervals are sufficient to characterize the key geometric features of the envelope domain morphology while ensuring that each layer of radial cut strip contains sufficient area numerical stability. Since the key payload is divided into 5 segments, plus the first calibration site and the last calibration site, there are a total of 7 key-residing calibration sites. According to the rule, the preset value of the number of equal segments is 6.

[0041] The security control firmware divides the maximum radial distance by a preset fraction, i.e., 6, to obtain the radial division step size. Taking the origin of radiation as the radial zero point, starting from the radial zero point along the radial direction, the radial division step size is accumulated to the radial zero point to obtain the initial radial boundary value between the first radial division. The initial radial boundary value between the first radial division is then accumulated by the radial division step size to obtain the initial radial boundary value between the second radial division. The initial radial boundary value between the second radial division is then accumulated by the radial division step size to obtain the initial radial boundary value between the third radial division, and so on. The fifth accumulation yields the initial radial boundary value between the fifth radial division. The value obtained by the sixth accumulation is equal to the maximum radial distance, i.e., the initial radial boundary value between the sixth radial division. A total of 6 initial radial boundary values ​​between radial divisions are obtained.

[0042] Based on the initial radial boundary values ​​between each radially divided section, the security control firmware maps each initial radial boundary value along the direction of each radial line. The mapping method is as follows: a radial line is selected, and a segment of length equal to the initial radial boundary value is intercepted along the direction of the radial line, starting from the origin of the radiation. The endpoint of this segment is the radial boundary point of the radial line in the current radially divided section. This mapping operation is performed on all radial lines one by one. Each radially divided section obtains a set of radial boundary points equal to the number of radial lines, and all radial boundary points constitute the set of radial boundary points.

[0043] Based on the set of radial boundary points, the safety control firmware constructs each radial cutting line in the following manner: For a set of radial boundary points corresponding to the same radially divided interval, according to the azimuth order of the radial connection lines where the radial boundary points are located in the end point azimuth angle arrangement sequence (i.e., from small to large), connect the radial boundary points on the first radial connection line with the radial boundary points on the second radial connection line with straight line segments, connect the radial boundary points on the second radial connection line with the radial boundary points on the third radial connection line with straight line segments, and so on, connecting the radial boundary points on the last radial connection line with the radial boundary points on the first radial connection line with straight line segments to form a closed loop. This closed loop is a radial cutting line corresponding to the radially divided interval. All radially divided intervals are processed in sequence to obtain the same number of radial cutting lines as the preset number of equal intervals. Each radial cutting line is a closed broken line segment, and the radial cutting lines are arranged in concentric rings nested inside the dynamic star-shaped radiation envelope domain.

[0044] Based on the radial cutting lines, the security control firmware divides the dynamic star-shaped radiation envelope into multiple annular strip-shaped sub-regions radially from the inside out. The division rules are as follows: the innermost radial cutting strip is bounded by the radiation origin and the first radial cutting line (i.e., the radial cutting line with the smallest radial depth); the second radial cutting strip is bounded by the first and second radial cutting lines; the third radial cutting strip is bounded by the second and third radial cutting lines, and so on; the outermost radial cutting strip is bounded by the last radial cutting line and the outer boundary of the dynamic star-shaped radiation envelope (i.e., the boundary connecting chain). All of the above annular strip-shaped sub-regions constitute several radial cutting strips.

[0045] Based on each radial cutting zone, the safety control firmware calculates the area of ​​each radial cutting zone. The area calculation adopts the triangulation accumulation method. For each radial cutting zone, the execution process is as follows: the inner boundary (i.e., the radial cutting line on the side closer to the radiation origin or the radiation origin itself) and the outer boundary (i.e., the radial cutting line on the side away from the radiation origin or the outer boundary of the envelope domain) of the radial cutting zone are decomposed into several broken line segments. Taking the radiation origin as the common vertex, the four points on the inner and outer boundaries of the radial cutting zone are intercepted by the two adjacent radiation lines to divide it into a quadrilateral calculation unit. The quadrilateral calculation unit is enclosed by two points on the inner boundary and two points on the outer boundary.

[0046] Divide the quadrilateral calculation unit into two triangles along its diagonal. The three vertices of the first triangle are the origin of radiation, the first intercept point on the inner boundary, and the first intercept point on the outer boundary. The three vertices of the second triangle are the origin of radiation, the first intercept point on the outer boundary, and the second intercept point on the outer boundary. Calculate the area of ​​the first triangle. The area is equal to the product of the distance from the origin of radiation to the first intercept point on the inner boundary and the distance from the origin of radiation to the first intercept point on the outer boundary, multiplied by 1 / 2 of the sine of the angle between the lines connecting the intercept points on the inner and outer boundaries.

[0047] Calculate the area of ​​the second triangle. The area is equal to the product of the distance from the origin of radiation to the first intercept point of the outer boundary and the distance from the origin of radiation to the second intercept point of the outer boundary, multiplied by 2 / 1 of the sine of the angle between the two intercept points of the outer boundary. Add the areas of the first and second triangles to get the area corresponding to the quadrilateral calculation unit. Traverse all quadrilateral calculation units within the radial cutting zone and sum the areas corresponding to each quadrilateral calculation unit to get the total area of ​​the radial cutting zone. Calculate the area of ​​each radial cutting zone one by one.

[0048] Based on the area of ​​each radial cut zone, the security control firmware is arranged in the order from the inside to the outside of each radially divided interval, that is, starting from the radial cut zone area closest to the origin of radiation and moving outwards to the radial cut zone area closest to the outer boundary of the envelope domain, to obtain a one-dimensional area value sequence, which is the radial cut zone area sequence.

[0049] In this embodiment of the invention, by mapping discrete key-residence calibration sites to two-dimensional spatial coordinates and constructing a dynamic star-shaped radiation envelope domain, the spatial distribution characteristics of the key storage layout are transformed into a quantifiable geometric shape. Then, through radial equipartitioning and triangulation area calculation, the geometric shape is further transformed into a one-dimensional area numerical sequence. This layer-by-layer process of physical address, spatial coordinates, geometric envelope domain and area sequence can amplify the changes in envelope domain shape caused by subtle offsets in the key storage sector layout, making the off-position determination highly sensitive to changes in the storage layout. At the same time, the dimension of the area sequence is much lower than that of the original sector address space, reducing the computational overhead of the off-position determination module.

[0050] Step 4: Perform numerical simulation fitting on the radial cutting area sequence to obtain the radial cutting fitting residual index of the envelope domain; compare the radial cutting fitting residual index of the envelope domain with a preset displacement threshold. When the radial cutting fitting residual index of the envelope domain exceeds the preset displacement threshold, a displacement confirmation command is obtained, specifically including: Based on the radial cutting zone area sequence, the safety control firmware establishes an area distribution coordinate sequence with the index of each radial equal partition as the horizontal axis variable and the area of ​​each radial cutting zone as the vertical axis variable. The specific establishment process is as follows: the index 1 of the first radial equal partition is paired with the area value of the first radial cutting zone to form the first coordinate point; the index 2 of the second radial equal partition is paired with the area value of the second radial cutting zone to form the second coordinate point, and so on, until the index of the last radial equal partition is paired with the area value of the last radial cutting zone to form the last coordinate point. All coordinate points are arranged in ascending order of the radial equal partition index to form the area distribution coordinate sequence.

[0051] Based on the area distribution coordinate sequence, the security control firmware starts from the second coordinate point in the sequence and calculates the difference between the radial cutting zone area of ​​each coordinate point and the radial cutting zone area of ​​the previous coordinate point. This difference is the increment between two adjacent radial cutting zone areas, that is, the change in area after the area is radially advanced from the inside to the outside by one equally divided interval. The arithmetic mean of all increments is calculated, that is, the sum of all increments is divided by the total number of increments, to obtain the area change step size. The area change step size is a reference change amount that represents the radial uniform change trend of the envelope area under ideal conditions. The positive or negative sign of this value indicates the direction of increase or decrease of area along the radial direction. When the shape of the envelope is close to the ideal uniform star shape, the area change step size should be a stable value. When the shape of the envelope is abnormally distorted, the area change step size will show large dispersion.

[0052] Based on the area variation step size, the safety control firmware uses the radial cutting zone area at the first coordinate point in the area distribution coordinate sequence, i.e., the actual area of ​​the innermost radial cutting zone, as the starting reference area to construct an ideal area variation reference sequence. The construction process is as follows: the starting reference area is used as the first reference area of ​​the ideal reference sequence; the first reference area is added to the area variation step size to obtain the second reference area; the second reference area is added to the area variation step size to obtain the third reference area; and so on, until the same number of reference area values ​​as the number of elements in the radial cutting zone area sequence are generated, thus obtaining the ideal area variation reference sequence.

[0053] The ideal area variation benchmark sequence represents the linear variation trend of an ideal, uniform star-shaped envelope region under the same radially equidistant division conditions. The derivation logic of this linear variation trend is as follows: For an ideal, uniform star-shaped region, the area of ​​each radially cut strip increases linearly with the radial depth (when the outer contour of the envelope region expands outward) or decreases linearly (when the outer contour of the envelope region contracts inward). The area change follows a first-order linear law. When the mobile storage device remains normally connected on the authorized terminal, the geometry of the envelope region remains stable because the key storage sector layout remains stable. At this time, the deviation between the actual area sequence and the ideal linear variation benchmark sequence is small. When the mobile storage device experiences a displacement event, the key storage sector layout may undergo a slight shift due to the firmware's security response pre-action. This shift is reflected in the local changes in the shape of the envelope region, which in turn leads to a deviation between the actual area sequence and the ideal linear benchmark sequence.

[0054] Based on the ideal area variation reference sequence and the area distribution coordinate sequence, the security control firmware performs point-by-point deviation calculation on the two sequences. The specific process of point-by-point deviation calculation is as follows: Take the radial cutting zone area value of the first coordinate point in the area distribution coordinate sequence, subtract it from the first reference area value in the ideal area variation reference sequence, and calculate the absolute value of the difference between the two. This absolute value is the first radial cutting zone deviation. Take the radial cutting zone area value of the second coordinate point in the area distribution coordinate sequence, subtract it from the second reference area value in the ideal area variation reference sequence, and calculate the absolute value of the difference between the two to obtain the second radial cutting zone deviation. Perform the subtraction and absolute value operation on all corresponding positions in the two sequences point by point to obtain the radial cutting zone deviation of each radial cutting zone, which is the same as the number of radial cutting zones. Each radial cutting zone deviation reflects the local deviation amplitude between the actual envelope morphology and the ideal uniform star morphology at each radial depth level.

[0055] The deviations of each radial cut are weighted and aggregated to obtain the radial cut fitting residual index of the envelope domain. The specific execution process of weighted aggregation is as follows: the security control firmware assigns a corresponding weight coefficient to each radial cut deviation. The total number of weight coefficients is equal to the number of radial cuts, which is equal to the preset number of equal parts. In this embodiment, the preset number of equal parts is 6, so there are 6 weight coefficients. The weight coefficients are determined according to the difference in physical importance of each radial cut in the key storage area. The inner radial cuts closer to the origin are assigned larger weight values ​​because they cover key areas such as the first double-word position of the key data header sector and the starting segment of the key payload. The outer radial cuts farther from the origin are assigned smaller weight values ​​because they cover the auxiliary area of ​​the last double-word position of the key integrity digest sector. The weight values ​​decrease linearly from the inside to the outside in the radial direction.

[0056] The specific values ​​and basis for the weighting coefficients are as follows: the weighting coefficient of the first radial cutting zone (the innermost one) is 1.0, the weighting coefficient of the sixth radial cutting zone (the outermost one) is 0.1, and the weighting coefficients of the second to fifth radial cutting zones are determined by linear interpolation. That is, the decreasing step size between adjacent weighting coefficients is the difference between the first and last weighting coefficients divided by the total number of radial cutting zones minus 1. In this embodiment, the decreasing step size is equal to the difference between 1.0 and 0.1 divided by 6 minus 1, which is 0.9 divided by 5, which equals 0.18. Therefore, the second weighting coefficient is 0.82, the third weighting coefficient is 0.64, the fourth weighting coefficient is 0.46, and the fifth weighting coefficient is 0.28.

[0057] The weighting coefficients are determined based on the following rules: the sectors covered by the inner radial cutting strips correspond to the metadata header and the beginning segment of the key payload. The physical addresses of these sectors have the strongest uniqueness and identification capability in the key storage layout, and their area deviation should be given the highest weight for its contribution to the shape change of the envelope field. The sectors covered by the outer radial cutting strips correspond to the key integrity digest sector. This region is located at the end of the key storage layout and is relatively less sensitive to layout changes. Its area deviation should be given a lower weight for its contribution to the shape change of the envelope field. The weight reduction coefficient of 0.18 ensures that the contribution of the inner cutting strips to the final residual index is about 10 times that of the outer cutting strips, which is consistent with the importance hierarchy of each functional sector in the key storage layout.

[0058] The security control firmware multiplies the first radial cut deviation by the first weighting coefficient to obtain the first weighted deviation, multiplies the second radial cut deviation by the second weighting coefficient to obtain the second weighted deviation, and so on, multiplying all six radial cut deviations by their respective weighting coefficients to obtain six weighted deviations. The six weighted deviations are then summed, and the sum is the envelope domain radial cut fitting residual index. The envelope domain radial cut fitting residual index is a scalar value, which comprehensively measures the weighted overall deviation between the actual key storage layout's envelope domain shape and the ideal linear uniform envelope domain shape at each radial depth level. The greater the deviation, the less the spatial distribution of the key storage layout is close to the ideal uniform state, thus indicating that the key storage sector layout of the mobile storage device may have undergone changes detrimental to security due to device relocation.

[0059] Based on the residual exponent fitted by radial slicing of the envelope domain, the security control firmware reads a pre-stored preset departure threshold from the protected memory region. The preset departure threshold is a numerical limit for determining a departure event. The process for determining the preset departure threshold is as follows: During the calibration data acquisition phase before the mobile storage device leaves the factory, the mobile storage device is inserted into an authorized calibration terminal and a normal physical connection is maintained. The calibration mode of the security control firmware is started. In the calibration mode, the firmware automatically and repeatedly executes the complete processing chain at a preset acquisition cycle, including key-resident calibration position determination, dynamic star-shaped radiation envelope domain construction, radial equipartition cutting and area sequence generation, and envelope domain radial cutting fitting residual index calculation. Each execution yields a sample value of the envelope domain radial cutting fitting residual index under normal connection state. The authorized calibration terminal does not perform any file read / write operations during the calibration process to eliminate the impact of data transmission on the internal operation of the flash memory controller. The total number of calibration acquisitions, N, is set to 200 times, with a 5-second interval between each acquisition to allow the flash memory controller to complete internal background operations such as garbage collection and wear leveling. The 200 residual index sample values ​​obtained from the 200 acquisitions are stored in the normal sample sequence in the order of acquisition time.

[0060] Statistical analysis was performed on 200 residual index sample values ​​in the normal sample sequence. All 200 sample values ​​were summed, and the sum was divided by 200 to obtain the sample mean. The difference between each sample value and the sample mean was calculated to obtain the sample deviation value. Each sample deviation value was squared to obtain the sample deviation square value. All sample deviation square values ​​were summed, and the sum of the deviation squares was divided by 200. The square root of the quotient was then taken to obtain the sample standard deviation.

[0061] Normality tests were performed on the sample data. The test method involved calculating the skewness coefficient and kurtosis coefficient of the sample values. The calculation process for the skewness coefficient was as follows: subtract the sample mean from each sample value to obtain the sample deviation value; divide each sample deviation value by the sample standard deviation to obtain the standardized deviation value; raise each standardized deviation value to the third power to obtain the cubed value of the standardized deviation; sum the cubed values ​​of all standardized deviations to obtain the cumulative cubed standardized deviation; and divide the cumulative cubed standardized deviation by 2. 00, to obtain the third central moment of the sample; divide the third central moment of the sample by the cube of the sample standard deviation to obtain the skewness coefficient. The calculation process of the kurtosis coefficient is as follows: raise the standardized deviation value of each sample to the fourth power to obtain the fourth power value of the standardized deviation of each sample; sum the fourth power values ​​of the standardized deviations of all samples to obtain the sum of the fourth powers of the standardized deviations; divide the sum of the fourth powers of the standardized deviations by 200 to obtain the fourth central moment of the sample; divide the fourth central moment of the sample by the fourth power of the sample standard deviation to obtain the kurtosis coefficient.

[0062] Normality is determined based on the skewness and kurtosis coefficients. When the absolute value of the skewness coefficient is less than a preset skewness threshold and the absolute value of the difference between the kurtosis coefficient and the theoretical kurtosis value of 3 for a normal distribution is less than the preset kurtosis threshold, the sample data is confirmed to follow a normal distribution. The theoretical skewness coefficient of a normal distribution is 0, and the theoretical kurtosis coefficient is 3. The closer the skewness coefficient is to 0 and the closer the kurtosis coefficient is to 3, the closer the sample distribution is to a normal distribution. The preset skewness threshold is 0.5, and the preset kurtosis threshold is 1.0. The values ​​of these two thresholds are based on the commonly used empirical standard for normality judgment in statistics: when the absolute value of the skewness is less than 0.5 and the kurtosis is close to 3, the data can be approximately considered to follow a normal distribution. After the normality test, it is confirmed that the normal sample data in this embodiment follows a normal distribution.

[0063] Threshold calculation and storage: Based on the characteristics of the normal distribution, at a 97.7% confidence level (i.e., μ + 2σ), the residual exponent values ​​in a normal connection state mostly fall within this limit. Taking μ + 3σ, i.e., the upper bound corresponding to the 99.7% confidence level, as the preset departure threshold allows only about 0.3% of normal fluctuations to cross this limit, thereby minimizing the risk of false triggering caused by random fluctuations in a normal connection state. The calculated preset departure threshold is written into the protected memory area of ​​the security control firmware and stored long-term. This threshold remains unchanged during normal device use and only needs to be recalibrated and updated after the device performs a key rotation or firmware upgrade.

[0064] Based on the residual exponent of the radial cutting fit of the envelope domain and the preset displacement threshold retrieved from the protected memory, the security control firmware performs a numerical comparison judgment: the two values ​​are compared. When the residual exponent of the radial cutting fit of the envelope domain is greater than the preset displacement threshold, it indicates that the deviation between the current actual envelope domain shape and the ideal uniform envelope domain shape has exceeded the maximum allowable range of random fluctuations under normal connection conditions. It is determined that the mobile storage device has experienced an unauthorized displacement event, and a displacement confirmation command is generated.

[0065] When the radial cut fitting residual exponent of the envelope domain is less than or equal to the preset deviation threshold, it indicates that the current deviation is still within the random fluctuation range of the normal connection state. It is determined that the mobile storage device is still in a normal connection state or the disconnection is a non-departure interference such as momentary poor contact. No departure confirmation command is generated. The security control firmware discards the calculation result and makes the connection status monitoring module continue to execute the connection status monitoring loop. The departure confirmation command is a multi-byte trigger signal generated by the departure judgment logic module inside the security control firmware. The first byte of the signal is the instruction type code with a value of 0xFE, indicating departure confirmation trigger. The second to fifth bytes are the self-running counter timestamps at the departure confirmation time. The sixth byte is the high 8-bit quantization value of the radial cut fitting residual exponent of the envelope domain calculated at the moment.

[0066] In this embodiment of the invention, by constructing an ideal linearly varying benchmark sequence with an area varying step size and comparing it with the actual area sequence point by point, the degree of local anomaly in the envelope domain morphology is quantified into an envelope domain radial cutting fitting residual index. This index is then compared with a preset displacement threshold determined by normal distribution statistics based on 200 calibration samples. The upper bound (mean plus 3 times the standard deviation) corresponding to a 99.7% confidence level is used as the judgment boundary. This can control the false trigger probability in the normal connection state to within about 0.3% while maintaining a high detection rate for real displacement events. It takes into account both the dual requirements of high security and reliability and low false alarms in availability. Moreover, the linearly decreasing weighting strategy with an inner weight coefficient of 1.0 to an outer weight of 0.1 can make the layout changes of key metadata and payload area have a dominant influence on the judgment result, ensuring that the judgment basis for displacement confirmation is concentrated in the most critical area of ​​key storage.

[0067] Step 5: Based on the departure confirmation command, perform an access lock operation on the removable storage device to obtain a lock status indicator; based on the lock status indicator, perform an irreversible erase operation on the encryption key stored in the removable storage device to obtain a key erasure completion indicator, specifically including: According to the departure confirmation instruction, the departure judgment logic module inside the security control firmware sends the instruction to the access control module through the internal bus of the security control firmware. After receiving the signal with the instruction type code 0xFE, the access control module parses the departure confirmation time timestamp and residual exponent quantization value carried in the instruction and writes them as security audit log records into the security event log area of ​​the security control firmware. Then, the access control module generates an access lock control signal, which is an internal bus write operation instruction sequence, which consists of multiple register write operation instructions.

[0068] Based on the access lock control signal, the access control module in the security control firmware performs hardware-level access channel shutdown operations in the following order: First, it writes an endpoint disable instruction to the endpoint configuration register of the Universal Serial Bus Interface (USB) controller, changing the endpoint enable bit of the bulk transfer endpoint from logic 1 to logic 0 to disable the bulk transfer endpoint. Any subsequent bulk data transfer requests initiated by the authorized terminal to this endpoint will be rejected by the USB controller with a direct STALL handshake packet response. Next, it writes an endpoint disable instruction to the endpoint configuration register of the USB controller for the control transfer endpoint, disabling the control transfer endpoint. Then, it writes an endpoint disable instruction to the endpoint configuration register of the USB controller for the interrupt transfer endpoint, disabling the interrupt transfer endpoint. Finally, it writes a host access prohibition flag bit to the master control register of the flash controller, changing this flag bit from logic 0 to logic 1. Upon detecting that this flag bit is logic 1, the flash controller will refuse to respond to any sector read and sector write commands forwarded from the USB controller, even if the authorized terminal sends a storage access request through other interface paths that are not disabled, which will be intercepted by the flash controller at the hardware level.

[0069] After execution, all data read / write access channels of the mobile storage device are closed, resulting in a closed channel status. Based on this closed channel status, the security control firmware writes a lock status code to the device status register of the mobile storage device. Specifically, it rewrites the access status byte at offset address 0x04 in the device status register from 0x00 (indicating an open state) to 0xFF (indicating a locked state). This byte in the device status register will be returned the next time the authorized terminal queries the device status. The authorized terminal will then know that the device has entered an access-locked state. After the rewriting is completed, the security control firmware reads back the access status byte from the device status register to verify whether the write was successful. When the readback value is equal to 0xFF, the current state is recorded as a locked status identifier, and the locked status identifier, along with the timestamp of the locking time, is written into the running status record area of ​​the security control firmware. The locked status identifier is a state machine status code within the security control firmware, with a value of 0x01 indicating that the device is currently in an access-locked state.

[0070] Based on the locked status indicator, the key management module inside the security control firmware initiates the key erasure process. First, it locates the storage address of the encryption key. The location process is as follows: The key management module reads the extracted and cached logical volume table data from the protected memory area of ​​the security control firmware, traverses the sector index entries in the logical volume table, and finds all entries where the sector type flag field is equal to 0x00000002, which are the key payload segment sector index entries. For each key payload segment sector index entry, it reads its starting physical sector number and ending physical sector number, expands all physical sector numbers between the starting and ending physical sector numbers one by one to obtain a sector address list, and merges and removes duplicates of the sector address lists corresponding to all key payload segments to obtain the set of all physical storage addresses of the encryption key in the key storage area. This set is the storage address list of the encryption key.

[0071] Based on the list of storage addresses for the encryption key, the security control firmware performs an irreversible erasure operation on each physical storage address in ascending order. For a single physical storage address, the specific execution rules for the irreversible erasure operation are as follows: In the first erasure round, all zero data (each byte is 0x00) is written to the physical storage address. After writing, the data is immediately read back from the physical storage address and compared byte by byte with the written all-zero data. After confirming that all read-back data is 0x00, the next write operation begins. In the second erasure round, all one data (each byte is 0xFF) is written to the same physical storage address. After writing, the data is immediately read back and compared byte by byte. In the third erasure round, random data is written to the same physical storage address. The random data is generated by a true random number generator inside the security control firmware based on a sequence of random bytes generated by a physical noise source. After writing, the data is immediately read back and compared byte by byte.

[0072] The above three erasure rounds (all zero, all one, random) constitute a complete unrecoverable erasure operation. Executing three consecutive rounds of write overwrite can ensure that the original key data is covered by at least three different charge states on the floating gate charge level of the flash memory cell, thereby eliminating the possibility of recovering the original data through charge residual analysis.

[0073] Performing a readback check immediately after each erase cycle is to detect whether the flash memory storage cell has experienced write-through or write fatigue, resulting in the failure of the written data to be stored correctly. The specific comparison rules for the readback check are as follows: each byte read back is XORed with the corresponding byte written. When the XOR result of all bytes is 0x00, the write cycle is considered successful. When the XOR result of any byte is not 0x00, the write cycle is considered to have failed. The security control firmware re-executes the write operation of this cycle for the physical storage address until the check passes, but the maximum number of retries is set to 3. If the check fails after 3 consecutive retries, the physical storage address is marked as an erase abnormal address and the abnormal information is written to the security event log area before continuing to process the next address.

[0074] After traversing all physical storage addresses in the list of storage addresses for the encryption key and performing the above-mentioned irreversible erasure operation one by one, the security control firmware summarizes the execution results of all erasure operations. If all physical storage addresses are successfully erased, the erasure execution result is successful. If there is at least one address marked as an erasure failure, the erasure execution result is partially failed, and the list of erasure failure addresses is appended to the execution result.

[0075] Based on the erase execution result, when the erase execution result is successful, the security control firmware writes 0x00 (indicating erased status) to the key status byte at offset address 0x08 in the device status register of the mobile storage device. After confirming that the subsequent device status register readback value is 0x00, a key erase completion identifier is generated. The key erase completion identifier is a termination status code with a value of 0x00 inside the security control firmware, indicating that the encryption key has been successfully and irreversibly destroyed. The security control firmware writes the key erase completion identifier along with the timestamp of the key erase completion time into the running status record area. When the erase execution result is partially failed, the security control firmware writes 0x01 (indicating erase abnormal status) to the key status byte in the device status register and generates an erase abnormal identifier instead of the key erase completion identifier. At the same time, the security control firmware reports the erase abnormal identifier and the erase abnormal address list to the authorized terminal in the last device status response issued before being shut down through the universal serial bus interface to notify the administrator for manual handling.

[0076] In this embodiment of the invention, a serial security response strategy of locking before erasing is adopted. Physical access blocking is achieved by disabling hardware endpoints and prohibiting host access to the flash controller, eliminating the risk of the key data being read externally during the erasure process. The entire physical storage address of the encryption key is destroyed through an unrecoverable erasure process of three overwrites of all zeros, all ones, and random data and byte-by-byte readback verification.

[0077] like Figure 3As shown, embodiments of the present invention also provide an automatic locking and key erasure system for mobile storage devices when they are out of place, comprising: The monitoring module is used to continuously monitor the connection status between the mobile storage device and the authorized terminal. When the connection between the mobile storage device and the authorized terminal is detected to be disconnected, an off-position detection signal is generated. The dynamic determination module is used to dynamically determine multiple key-resident calibration bits in the logical volume table of the key storage area of ​​the mobile storage device based on the off-position detection signal; each key-resident calibration bit is located at the first double-word position of the key data header sector, the middle sector of each segment of the key payload, and the last double-word position of the key integrity digest sector. The cutting module is used to form a dynamic star-shaped radiation envelope domain by connecting the spatial coordinates of each key-residence calibration crystal position; to perform radial equal division of the dynamic star-shaped radiation envelope domain to obtain several radial cutting bands; to calculate the area of ​​each radial cutting band; and to obtain the radial cutting band area sequence based on the area of ​​the radial cutting bands. The comparison module is used to perform numerical simulation fitting on the radial cut area sequence to obtain the radial cut fitting residual index of the envelope domain; the radial cut fitting residual index of the envelope domain is compared with the preset displacement threshold, and when the radial cut fitting residual index of the envelope domain exceeds the preset displacement threshold, a displacement confirmation command is obtained. The processing module is used to perform an access locking operation on the mobile storage device based on the departure confirmation command, and obtain a lock status identifier; based on the lock status identifier, it performs an irreversible erasure operation on the encryption key stored in the mobile storage device, and obtains a key erasure completion identifier.

[0078] It should be noted that this system is a system corresponding to the above method. All implementation methods in the above method embodiments are applicable to this embodiment and can achieve the same technical effect.

[0079] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for automatically locking and wiping the key when a mobile storage device is removed from its position, characterized in that, The method includes: Step 1: Continuously monitor the connection status between the mobile storage device and the authorized terminal. When the connection between the mobile storage device and the authorized terminal is detected to be disconnected, generate an off-site detection signal. Step 2: Based on the off-position detection signal, dynamically determine multiple key residency calibration bits in the logical volume table of the key storage area of ​​the mobile storage device; each key residency calibration bit is located at the first double-word position of the key data header sector, the middle sector of each segment of the key payload, and the last double-word position of the key integrity digest sector. Step 3: A dynamic star-shaped radiation envelope is formed by connecting the spatial coordinates of each key-residence calibration site; the dynamic star-shaped radiation envelope is radially divided into equal parts to obtain several radially cut strips; the area of ​​each radially cut strip is calculated; and the radially cut strip area sequence is obtained based on the area of ​​the radially cut strips. Step 4: Perform numerical simulation fitting on the radial cutting area sequence to obtain the radial cutting fitting residual index of the envelope domain; compare the radial cutting fitting residual index of the envelope domain with the preset displacement threshold; when the radial cutting fitting residual index of the envelope domain exceeds the preset displacement threshold, a displacement confirmation command is obtained. Step 5: Based on the departure confirmation command, perform an access lock operation on the mobile storage device to obtain a lock status identifier; based on the lock status identifier, perform an irreversible erase operation on the encryption key stored in the mobile storage device to obtain a key erasure completion identifier.

2. The automatic locking and key erasure method for mobile storage devices when they are out of place according to claim 1, characterized in that, Step 2 includes: Based on the off-site detection signal, the logical volume table is extracted from the key storage area of ​​the mobile storage device; Based on the logical volume table, the starting address of the key metadata header sector is parsed to locate the first double word position of the key metadata header sector, and the first double word position is determined as the first calibration bit; Based on the first calibration crystal position, the sector index of the logical volume table is shifted backward to the key payload area to locate the middle sector of each segment of the key payload; each middle sector is determined as the corresponding middle calibration crystal position. Based on each intermediate calibrated bit, continue shifting backward along the sector index of the logical volume table to the end of the key storage area to locate the tail double-word position of the key integrity digest sector; determine the tail double-word position as the last calibrated bit; Based on the first calibration crystal position, each intermediate calibration crystal position and the last calibration crystal position, multiple key-resident calibration crystal positions are obtained.

3. The automatic locking and key erasure method for mobile storage devices when they are out of place according to claim 2, characterized in that, A dynamic star-shaped radiation envelope is formed by connecting the spatial coordinates of each key-residence calibration site, including: Based on the resident calibration bits of each key, the spatial coordinates of each resident calibration bit in the logical volume table are extracted; Based on the spatial coordinates, the geometric centroid of each key-residence calibration crystal position is calculated, and the geometric centroid is determined as the radiation origin of the dynamic star-shaped radiation envelope domain; Based on the spatial coordinates of the radiation origin and each key-residence calibration crystal position, establish radiation lines from the radiation origin to each of the aforementioned key-residence calibration crystal positions. A dynamic star-shaped radiation envelope is formed by connecting each radiation line and the boundary lines between adjacent key-residence calibration sites.

4. The automatic locking and key erasure method for a mobile storage device when it is out of place according to claim 3, characterized in that, Based on the radiative connections and the boundary connections between adjacent key-residence calibration sites, a dynamic star-shaped radiative envelope is formed, including: Based on each radiation line, extract the endpoints of each radiation line that are far from the origin of radiation to obtain each endpoint; Based on each end point, arrange them in ascending order of their azimuth angles around the origin of radiation to obtain the end point azimuth angle arrangement sequence; Based on the azimuth sequence of the end endpoints, adjacent end endpoints are connected sequentially with corresponding boundary lines to obtain a boundary line connection chain. Based on the connection chain between each radiation line and the boundary line, the radiation origin, each radiation line and each boundary line are closed end to end, forming a closed star-shaped region; the closed star-shaped region is defined as the dynamic star-shaped radiation envelope domain.

5. The automatic locking and key erasure method for a mobile storage device when it is out of place according to claim 4, characterized in that, The dynamic star-shaped radiation envelope domain is radially divided into equal segments to obtain several radially cut bands; Calculate the area of ​​each radial cutting band; Based on the area of ​​the radially cut strip, a sequence of radially cut strip areas is obtained, including: Based on the dynamic star-shaped radiation envelope domain, determine the maximum radial distance from the radiation origin to the farthest endpoint on each boundary line; Based on the maximum radial distance, the maximum radial distance is divided into several radially equal intervals according to a preset number of equal parts, and the radial boundary values ​​between each radially equal interval are obtained. Based on the radial boundary values ​​between each radial equal partition, starting from the origin of radiation, the corresponding radial boundary points are intercepted along the direction of each radiation line to obtain the set of each radial boundary point. Based on the set of radial boundary points, connect the radial boundary points corresponding to adjacent radially divided intervals in sequence to obtain each radial cutting line; Based on each radial cutting line, the dynamic star-shaped radiation envelope is divided into several radial cutting zones; based on each radial cutting zone, the area of ​​each radial cutting zone is calculated to obtain the area of ​​each radial cutting zone. Based on the area of ​​each radial cutting zone, the radial cutting zone areas are arranged in order from the inside to the outside according to the radially divided intervals, thus obtaining the radial cutting zone area sequence.

6. The method for automatically locking and erasing the key when a mobile storage device is removed from its position according to claim 5, characterized in that, Based on the maximum radial distance, the maximum radial distance is divided into several radially equal intervals according to a preset number of equal divisions, resulting in radial boundary values ​​between each radially equal interval, including: Based on the maximum radial distance, obtain a preset number of equal divisions; based on the maximum radial distance and the preset number of equal divisions, divide the maximum radial distance into equal radial division steps of the same number as the preset number of equal divisions; Based on the radial division step size, with the radiation origin as the radial zero point, the radial division step size is accumulated sequentially along the radial direction to obtain the initial radial boundary value between each radial division. Based on each initial radial boundary value, each initial radial boundary value is mapped to the radial position corresponding to each radial line to obtain the radial boundary values ​​between each radially equal partition.

7. The automatic locking and key erasure method for a mobile storage device when it is out of place according to claim 6, characterized in that, Numerical simulation fitting was performed on the radial cut area sequence to obtain the radial cut fitting residual exponent of the envelope domain, including: Based on the radial cutting zone area sequence, an area distribution coordinate sequence is established with the sequence number between each radial equal partition as the horizontal axis and the area of ​​each radial cutting zone as the vertical axis; The area variation step size is determined based on the incremental difference between adjacent radial cutting zone areas in the area distribution coordinate sequence. Based on the area variation step size, the ideal area variation reference sequence is obtained by sequentially extrapolating from the inside to the outside along the radially divided intervals starting from the first radial cutting zone area. Based on the ideal area variation reference sequence and the area distribution coordinate sequence, the difference between the area of ​​each radial cutting zone and the reference area at the corresponding position in the ideal area variation reference sequence is compared point by point; based on this difference, the deviation of each radial cutting zone is obtained. The deviation of each radial cutting band is weighted and aggregated to obtain the radial cutting fitting residual index of the envelope domain.

8. The automatic locking and key erasure method for a mobile storage device when it is out of place according to claim 7, characterized in that, The residual index of the radial cut fitting of the envelope region is compared with a preset displacement threshold. When the residual index of the radial cut fitting of the envelope region exceeds the preset displacement threshold, a displacement confirmation instruction is obtained, including: Based on the residual index fitted by the radial cutting of the envelope domain, a preset displacement threshold is retrieved; the numerical comparison between the residual index fitted by the radial cutting of the envelope domain and the preset displacement threshold is performed to obtain the threshold comparison result; Based on the threshold comparison results, when the threshold comparison results indicate that the radial cutting fitting residual index of the envelope domain exceeds the preset displacement threshold, a displacement confirmation command is generated.

9. The automatic locking and key erasure method for a mobile storage device when it is out of place according to claim 8, characterized in that, Based on the departure confirmation command, an access lock operation is performed on the mobile storage device to obtain a lock status identifier; Based on the lock status identifier, an irreversible erasure operation is performed on the encryption key stored in the mobile storage device to obtain a key erasure completion identifier, including: Based on the departure confirmation command, an access lock control signal is generated; based on the access lock control signal, all data read / write access channels of the mobile storage device are closed, and the channel is closed. Based on the channel's closed state, generate a lock status identifier; based on the lock status identifier, locate the storage address of the encryption key in the mobile storage device; Based on the storage address, perform an irreversible erasure operation on the encryption key to obtain the erasure execution result; based on the erasure execution result, generate a key erasure completion identifier.

10. A mobile storage device automatic locking and key erasure system upon removal from its position, the system implementing the method as described in any one of claims 1 to 9, characterized in that, include: The monitoring module is used to continuously monitor the connection status between the mobile storage device and the authorized terminal. When the connection between the mobile storage device and the authorized terminal is detected to be disconnected, an off-position detection signal is generated. The dynamic determination module is used to dynamically determine multiple key-resident calibration bits in the logical volume table of the key storage area of ​​the mobile storage device based on the off-position detection signal; each key-resident calibration bit is located at the first double-word position of the key data header sector, the middle sector of each segment of the key payload, and the last double-word position of the key integrity digest sector. The cutting module is used to form a dynamic star-shaped radiation envelope domain by connecting the spatial coordinates of each key-residence calibration crystal position; to perform radial equal division of the dynamic star-shaped radiation envelope domain to obtain several radial cutting bands; to calculate the area of ​​each radial cutting band; and to obtain the radial cutting band area sequence based on the area of ​​the radial cutting bands. The comparison module is used to perform numerical simulation fitting on the radial cut area sequence to obtain the radial cut fitting residual index of the envelope domain; the radial cut fitting residual index of the envelope domain is compared with the preset displacement threshold, and when the radial cut fitting residual index of the envelope domain exceeds the preset displacement threshold, a displacement confirmation command is obtained. The processing module is used to perform an access locking operation on the mobile storage device based on the departure confirmation command, and obtain a lock status identifier; based on the lock status identifier, it performs an irreversible erasure operation on the encryption key stored in the mobile storage device, and obtains a key erasure completion identifier.