An automatic encryption and decryption method based on a quantum security cryptographic module
Patent Information
- Application Number
- CN202610968416.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-01
- Publication Date
- 2026-10-30
AI Technical Summary
此类终端设备通常具有计算资源受限、业务程序固化、通信协议固定、现场升级困难和长期运行等特点,终端设备往往不便安装新的加密驱动,不便改造业务应用程序,也不便在原有控制流程中增加主动密钥请求、加密接口调用或复杂身份认证流程
本发明通过发送侧终端量子安全密码模块以终端侧硬件旁路接口捕获原始业务帧,并将完整原始业务帧作为待加密业务数据,使原终端设备侧不需要安装加密驱动、不需要调用加密接口、不需要主动请求业务会话密钥,也不需要改变终端设备输入和输出的原业务帧格式,从而降低封闭式终端接入加密能力时对原系统的改造要求;通过发送侧终端量子安全密码模块基于本地随机序列、发送端设备唯一标识、接收端设备唯一标识、防重放随机数、业务帧序号和当前密钥版本号生成业务会话密钥,使业务会话密钥与具体通信对象、具体业务帧和当前密钥状态建立对应关系,减少业务通信过程对平台在线分发业务会话密钥的依赖;通过由业务会话密钥得到数据加密子密钥和完整性认证子密钥,使业务数据加密和完整性认证分别使用不同用途的子密钥,降低同一密钥材料多用途使用带来的实现风险;通过点对点密钥加密密钥对业务会话密钥进行认证加密封装,并由数据加密子密钥加密待加密业务数据,使长期密钥不直接参与业务明文加密;通过会话密钥密文、业务数据加密随机数、业务数据密文和认证标签形成加密封装帧,并在接收侧依次进行密钥槽位绑定认证、防重放验证和认证标签验证后再恢复业务帧,可以在设备标识不匹配、密钥版本异常、报文重放、业务数据加密随机数被替换或密文被篡改时阻断当前业务帧对应明文输出,使接收侧终端设备获得与原始业务帧格式一致的数据。
Smart Images

Figure CN123020033A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication security technology, and specifically to an automatic encryption and decryption method based on a quantum-safe cryptographic module. Background Technology
[0002] Hardware bypass automatic encryption / decryption and quantum-secure key processing in closed terminal communication links are applicable to secure communication between terminal devices such as UAV flight control modules, ground station business systems, industrial controllers, sensor acquisition terminals, and IoT edge control terminals. These terminal devices typically have limited computing resources, fixed business programs, fixed communication protocols, difficulties in field upgrades, and long-term operation. It is often inconvenient to install new encryption drivers, modify business applications, or add active key requests, encryption interface calls, or complex authentication processes to the existing control flow. Existing communication encryption schemes usually rely on the platform to generate and distribute session keys, or on the terminal system actively calling the security module to complete encryption and decryption. In scenarios where the platform is temporarily unavailable, the link is unstable, or the terminal system cannot be modified, problems may arise such as untimely acquisition of business session keys, strong coupling between key updates and business communication, and intrusion of the encryption process into the original terminal system. Furthermore, directly adding fields such as key ciphertext, random numbers, version numbers, and authentication tags to the original business frames output by the terminal device may change the original fixed frame format of the terminal device, making it impossible for the receiving terminal device to recognize the data according to the original business protocol. Some solutions rely solely on device identifiers or session identifiers for identity verification, failing to establish a unified verification chain that integrates device relationships, key slots, key versions, anti-replay random numbers, service frame sequence numbers, service data encryption random numbers, and authentication tags. This results in difficulties in promptly blocking the plaintext output of the current service frame when the encrypted encapsulated frame is replayed, fields are replaced, or key versions are inconsistent. Furthermore, the lack of linkage between the terminal's random number supply capacity and the service message rate may affect the stability of service session key generation in high-frequency message scenarios. If the old key is directly replaced during the key encryption key update process, in the event of power failure, lost confirmation messages, or link timeouts, it may lead to inconsistent key states between the communicating parties, affecting subsequent communication recovery. Summary of the Invention
[0003] This invention provides an automatic encryption and decryption method based on a quantum-safe cryptographic module. The purpose of this invention is to solve the problem in closed terminal communication links that it is difficult to achieve terminal-side autonomous generation of service session keys, hardware bypass automatic encryption and decryption, trusted verification of encrypted encapsulated frames, and recovery from key update anomalies without modifying the terminal service program and the original service frame format on the terminal device side.
[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: An automatic encryption / decryption method based on a quantum-safe cryptographic module includes: a quantum-safe cryptographic module at the transmitting end capturing the original service frame output by the transmitting end device through a terminal-side hardware bypass interface, identifying the frame boundary of the original service frame, and determining the service data to be encrypted based on the frame boundary; the quantum-safe cryptographic module at the transmitting end generating a service session key based on a local random sequence, a unique identifier of the transmitting end device, a unique identifier of the receiving end device, an anti-replay random number, a service frame sequence number, and a current key version number, and obtaining a data encryption subkey and an integrity authentication subkey from the service session key; the quantum-safe cryptographic module at the transmitting end using point-to-point encryption... The service session key is encapsulated using the key encryption key. The service data to be encrypted is encrypted using the data encryption subkey. An authentication tag is generated using the integrity authentication subkey. An encrypted encapsulation frame is generated based on the additional authentication data, the ciphertext of the session key, the encrypted random number of the service data, the ciphertext of the service data, and the authentication tag. The quantum-safe cryptographic module of the receiving terminal receives the encrypted encapsulation frame and performs key slot binding authentication, replay protection verification, and authentication tag verification on the encrypted encapsulation frame. After the verification is successful, the service session key is decapsulated and the ciphertext of the service data is decrypted. A recovery service frame with the same format as the original service frame is restored and output to the receiving terminal device.
[0005] In one aspect of the invention, the transmitting-side terminal quantum-safe cryptographic module captures the original service frame output by the transmitting-side terminal device through a terminal-side hardware bypass interface, comprising: the transmitting-side terminal quantum-safe cryptographic module being serially disposed between the transmitting-side terminal device and the transmitting-side communication module; the terminal-side hardware bypass interface being connected to the transmitting-side terminal device; the communication-side hardware bypass interface being connected to the transmitting-side communication module; the transmitting-side terminal device outputting the original service frame according to the original service process; the transmitting-side terminal quantum-safe cryptographic module capturing the original service frame through the terminal-side hardware bypass interface without requiring the transmitting-side terminal device to call the encryption interface, without requiring the transmitting-side terminal device to request a service session key, and without modifying the service program of the transmitting-side terminal device; the transmitting-side terminal quantum-safe cryptographic module identifying the frame boundary according to the physical link type of the original service frame, wherein the physical link type includes at least one of a serial port link, a control bus link, or an Ethernet link; and the transmitting-side terminal quantum-safe cryptographic module determining the complete original service frame containing the original service frame header, the original service payload, the original service check field, and the original service frame trailer as the service data to be encrypted.
[0006] In one aspect of the invention, the local random sequence includes a quantum random sequence output by a quantum random number unit and passing a health check, and an auxiliary random sequence output by a true random number unit and passing a health check. Before generating the service session key, the quantum secure cryptographic module of the transmitting terminal performs consecutive bit detection, repeated block detection, minimum entropy estimation, and output rate detection on the quantum random sequence and the auxiliary random sequence, respectively. After both the quantum random sequence and the auxiliary random sequence pass the health check, the quantum secure cryptographic module of the transmitting terminal generates the service session key based on the quantum random sequence, the auxiliary random sequence, the unique identifier of the transmitting device, the unique identifier of the receiving device, the anti-replay random number, the service frame sequence number, and the current key version number. When either the quantum random sequence or the auxiliary random sequence fails the health check, the quantum secure cryptographic module of the transmitting terminal stops generating the service session key based on the current random sequence and clears the random number buffer and plaintext buffer corresponding to the current original service frame.
[0007] In one aspect of the invention, before the transmitting-side terminal quantum secure cryptographic module generates a service session key based on a local random sequence, a unique identifier of the transmitting device, a unique identifier of the receiving device, an anti-replay random number, a service frame sequence number, and the current key version number, the method further includes: the transmitting-side terminal quantum secure cryptographic module determining a random number water level state based on the random number output rate, a statistical time window, the number of service messages to be encrypted within the statistical time window, the length of a single service session key, the length of a single anti-replay random number, the length of a single service data encryption random number, and the number of reserved random bits; when the random number water level state satisfies the condition of generating a one-message-one-service-session-key The quantum-secure cryptographic module of the transmitting terminal generates a new service session key for the current original service frame. When the random number level does not meet the condition of generating a service session key per message and there is available random material in the random number buffer that has passed the health check, the quantum-secure cryptographic module of the transmitting terminal calls the available random material to generate the service session key. When the random number level does not meet the condition of generating a service session key per message and there is no available random material in the random number buffer, the quantum-secure cryptographic module of the transmitting terminal suspends the output of new encrypted encapsulated frames and reports a random number level insufficiency event to the quantum-secure cryptographic module management platform.
[0008] In one aspect of the invention, the transmitting-side terminal quantum-safe cryptographic module encapsulates the service session key using a point-to-point key encryption key, comprising: the transmitting-side terminal quantum-safe cryptographic module querying a point-to-point key slot bound to the unique identifier of the receiving device and the current key version number in a hardware security module; when the point-to-point key slot is active and the allowed operation type includes session key encapsulation, the transmitting-side terminal quantum-safe cryptographic module calling the point-to-point key encryption key in the point-to-point key slot; the transmitting-side terminal quantum-safe cryptographic module using the point-to-point key encryption key, with the unique identifier of the transmitting device, the unique identifier of the receiving device, the anti-replay random number, the service frame sequence number, and the current key version number as session key encapsulation association data, performing authentication encryption encapsulation on the service session key to generate the session key ciphertext; the session key ciphertext being written into the encryption encapsulation frame, enabling the receiving-side terminal quantum-safe cryptographic module to recover the service session key based on the session key ciphertext after the key slot binding authentication is successful.
[0009] In one aspect of the present invention, the transmitting-side terminal quantum secure cryptographic module generates an authentication tag using the integrity authentication subkey, comprising: the transmitting-side terminal quantum secure cryptographic module generating additional authentication data based on the encrypted encapsulation frame header, the unique identifier of the transmitting device, the unique identifier of the receiving device, the current key version number, the anti-replay random number, the service frame sequence number, the communication mode identifier, the service data encryption random number, and the session key ciphertext; the transmitting-side terminal quantum secure cryptographic module encrypting the service data to be encrypted using the data encryption subkey to generate the service data ciphertext; the transmitting-side terminal quantum secure cryptographic module generating the authentication tag using the integrity authentication subkey on the additional authentication data and the service data ciphertext; the transmitting-side terminal quantum secure cryptographic module combining the fields corresponding to the additional authentication data, the session key ciphertext, the service data encryption random number, the service data ciphertext, and the authentication tag into the encrypted encapsulation frame, and outputting the encrypted encapsulation frame through the communication-side hardware bypass interface.
[0010] In one aspect of the present invention, the receiving-side terminal quantum secure cryptographic module performs key slot binding authentication on the encrypted encapsulated frame, including: the receiving-side terminal quantum secure cryptographic module parses the encrypted encapsulated frame to obtain the unique identifier of the transmitting device, the unique identifier of the receiving device, the current key version number, the anti-replay random number, the service frame sequence number, the communication mode identifier, the session key ciphertext, the service data encryption random number, the service data ciphertext, and the authentication tag; the receiving-side terminal quantum secure cryptographic module queries the hardware security module based on the unique identifier of the transmitting device, the unique identifier of the receiving device, and the current key version number. The key slot binding table in the system; when the query result is unique, the unique identifier of the receiving device is consistent with the unique identifier of the local device, the current key version number is within a valid range, the key status is active and the allowed operation type includes session key decapsulation, the receiving terminal quantum secure cryptographic module allows the call to the corresponding point-to-point key slot; when the query result is empty, the query result is not unique, the unique identifier of the receiving device is inconsistent with the unique identifier of the local device, the current key version number is not within a valid range, the key status is not active or the allowed operation type does not include session key decapsulation, the receiving terminal quantum secure cryptographic module discards the encrypted encapsulation frame.
[0011] In one aspect of the invention, the receiving-side terminal quantum secure cryptographic module performs anti-replay verification and authentication tag verification on the encrypted encapsulated frame, including: the receiving-side terminal quantum secure cryptographic module maintaining an anti-replay window indexed by the unique identifier of the transmitting-side device and the current key version number; when the anti-replay random number has already appeared, or the service frame sequence number is lower than the minimum service frame sequence number allowed by the anti-replay window, the receiving-side terminal quantum secure cryptographic module discards the encrypted encapsulated frame; when the anti-replay verification passes, the receiving-side terminal quantum secure cryptographic module decapsulates the session key ciphertext to obtain the service session key, and obtains the data encryption subkey and the complete [data encryption subkey] from the service session key. The integrity authentication subkey is used by the receiving terminal quantum secure cryptographic module to recalculate the authentication tag for the additional authentication data in the encrypted encapsulation frame and the ciphertext of the service data. The additional authentication data includes a random number encrypted with the service data. The recalculated authentication tag is then compared with the authentication tag in the encrypted encapsulation frame over a constant time period. If the comparison results match, the receiving terminal quantum secure cryptographic module uses the data encryption subkey and the random number encrypted with the service data to decrypt the ciphertext of the service data, obtaining a recovered service frame. If the comparison results do not match, the receiving terminal quantum secure cryptographic module discards the encrypted encapsulation frame and does not output the plaintext data corresponding to the current encrypted encapsulation frame.
[0012] In one aspect of the invention, the method further includes: a quantum-safe cryptographic module management platform generating a new key encryption key via a platform cryptographic card, the new key encryption key including a new device-specific key encryption key or a new peer-to-peer key encryption key, and generating key update ciphertext and a key update authentication tag based on the old device-specific key encryption key or the old peer-to-peer key encryption key; after receiving the key update ciphertext and the key update authentication tag, the terminal quantum-safe cryptographic module verifies the device unique identifier, the old key version number, the update random number, and the candidate key slot identifier, and after the key update authentication tag is verified, writes the new key encryption key into the candidate key slot. The terminal quantum-safe cryptographic module uses the new key from the candidate key slot to encrypt the key and generate a confirmation response. After the quantum-safe cryptographic module management platform verifies the confirmation response, it issues a switching confirmation command. After the terminal quantum-safe cryptographic module verifies the switching confirmation command, it switches the candidate key slot to the active key slot and sets the old active key slot to a read-only reserved state within a preset rollback window. In the event of a lost confirmation response, a failed verification of the switching confirmation command, a power outage of the terminal quantum-safe cryptographic module, or a link timeout, the terminal quantum-safe cryptographic module keeps the old active key slot valid and clears the unconfirmed key material from the candidate key slot.
[0013] In one aspect of the invention, the method further includes: in a one-to-many communication mode, the quantum-safe cryptographic module management platform generates a group root key through a platform cryptographic card, and encapsulates the group root key using the device-specific key encryption key of each terminal quantum-safe cryptographic module; after receiving the encapsulated group root key, each terminal quantum-safe cryptographic module decapsulates it based on the device-specific key encryption key in its local hardware security module to obtain the group root key; the transmitting terminal quantum-safe cryptographic module does not directly use the group root key to encrypt service data, but derives a group communication service session key based on the group root key, the unique identifier of the transmitting device, the group identifier, the group random number, the group service frame sequence number, and the group communication policy version number, and then... The unique identifier of the transmitting device, the group identifier, the group random number, the group service frame sequence number, and the group communication policy version number are written into the authentication field of the group encrypted encapsulation frame. Each terminal's quantum-secure cryptographic module on the receiving side, based on the group root key obtained from local decapsulation and the unique identifier of the transmitting device, the group identifier, the group random number, the group service frame sequence number, and the group communication policy version number carried in the group encrypted encapsulation frame, reproduces the group communication service session key. Based on the group communication service session key, it obtains the group communication data encryption subkey and the group communication integrity authentication subkey, and automatically decrypts the one-to-many service data according to the authentication tag verification and recovery service frame output method.
[0014] Compared with the prior art, the present invention has the following beneficial effects: This invention captures the original service frame through a terminal-side hardware bypass interface using a quantum-secure cryptographic module on the transmitting side, and uses the complete original service frame as the service data to be encrypted. This eliminates the need for the original terminal device to install encryption drivers, call encryption interfaces, actively request service session keys, or change the original service frame format input and output, thus reducing the modification requirements of the original system when a closed terminal accesses encryption capabilities. The quantum-secure cryptographic module on the transmitting side generates a service session key based on a local random sequence, the unique identifier of the transmitting device, the unique identifier of the receiving device, anti-replay random numbers, the service frame sequence number, and the current key version number. This establishes a correspondence between the service session key and specific communication objects, specific service frames, and the current key state, reducing the dependence of the service communication process on the platform's online distribution of service session keys. Furthermore, the invention utilizes the quantum-secure cryptographic module on the transmitting side to capture the original service frame through a quantum-secure cryptographic module on the transmitting side, and uses the complete original service frame as the service data to be encrypted. The system obtains a data encryption subkey and an integrity authentication subkey, enabling business data encryption and integrity authentication to use subkeys for different purposes, reducing the implementation risks caused by using the same key material for multiple purposes. The system uses a point-to-point key encryption key to authenticate and encrypt the business session key, and then uses the data encryption subkey to encrypt the business data to be encrypted, ensuring that long-term keys do not directly participate in the encryption of plaintext business data. An encrypted encapsulated frame is formed using the session key ciphertext, the business data encryption random number, the business data ciphertext, and the authentication tag. At the receiving end, key slot binding authentication, replay protection verification, and authentication tag verification are performed sequentially before the business frame is restored. This can block the plaintext output of the current business frame in cases of device identifier mismatch, key version abnormality, message replay, replacement of the business data encryption random number, or ciphertext tampering, ensuring that the receiving terminal device receives data consistent with the original business frame format. Attached Figure Description
[0015] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained from these drawings without creative effort.
[0016] Figure 1 This is a flowchart of an automatic encryption and decryption method based on a quantum-safe cryptographic module according to the present invention.
[0017] Figure 2 This is a flowchart of the sub-steps in step 1 of the automatic encryption and decryption method based on a quantum-safe cryptographic module of the present invention.
[0018] Figure 3 This is a flowchart of the sub-step of step 2 in the automatic encryption and decryption method based on a quantum-safe cryptographic module of the present invention.
[0019] Figure 4 This is a flowchart of the sub-step of step 3 in the automatic encryption and decryption method based on a quantum-safe cryptographic module of the present invention.
[0020] Figure 5 This is a flowchart of the sub-step 4 in the automatic encryption and decryption method based on a quantum-safe cryptographic module of the present invention.
[0021] Figure 6 This is a schematic diagram of the overall architecture and high-level data flow of the present invention.
[0022] Figure 7 This is a schematic diagram of the timing interaction of the core process of this invention. Detailed Implementation
[0023] The present invention will be further described below with reference to embodiments. These embodiments are merely some, not all, of the embodiments of the present invention. Other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are all within the protection scope of the present invention.
[0024] In this embodiment, to ensure consistent terminology, the hardware device serially connected between the terminal device and the communication module, used for capturing original service frames, generating service session keys, encapsulating service session keys, encrypting service data, generating authentication tags, verifying encrypted encapsulated frames, decrypting service data, and recovering original service frames, is uniformly referred to as the terminal quantum secure cryptographic module. The terminal quantum secure cryptographic module includes a terminal-side hardware bypass interface, a communication-side hardware bypass interface, a quantum random number unit, a true random number unit, a hardware security module, and an encryption / decryption engine. The terminal-side hardware bypass interface is used to connect to the terminal device, and the communication-side hardware bypass interface is used to connect to the communication module or an external communication link. The quantum random number unit is used to output quantum random sequences, the true random number unit is used to output auxiliary random sequences, the hardware security module is used to non-derivatively store the key encryption key and maintain the key slot binding table, and the encryption / decryption engine is used to perform key derivation, session key encapsulation, session key decapsulation, service data encryption, service data decryption, authentication tag generation, and authentication tag verification.
[0025] In this embodiment, the software and hardware combination system used for device registration, communication policy distribution, key encryption key initialization, key encryption key dynamic update, group root key distribution, status monitoring, and anomaly handling is collectively referred to as the quantum-safe cryptographic module management platform. The hardware cryptographic devices installed within the quantum-safe cryptographic module management platform for generating and isolating platform-side key materials are collectively referred to as platform cryptographic cards. The quantum-safe cryptographic module management platform does not generate service session keys online for each service message in point-to-point communication mode, nor does it periodically distribute the current service session key to the terminal quantum-safe cryptographic module. The service session key is generated or derived locally by the sending-side terminal quantum-safe cryptographic module based on a local random sequence and communication context after capturing the original service frame.
[0026] In this embodiment, the long-term keys used for encapsulating service session keys, group root keys, or key update data are collectively referred to as key encryption keys. Key encryption keys include device-specific key encryption keys and point-to-point key encryption keys. Device-specific key encryption keys are used to protect key update data, group root key data, or policy authentication data between the quantum-safe cryptographic module management platform and a single terminal quantum-safe cryptographic module. Point-to-point key encryption keys are used for encapsulating and decapsulating service session keys between two terminal quantum-safe cryptographic modules. Key encryption keys do not directly encrypt plaintext service data. The short-term keys generated or derived by the sending-side terminal quantum-safe cryptographic module for the original service frame are collectively referred to as service session keys. Service session keys are derived or split to form data encryption subkeys and integrity authentication subkeys. Data encryption subkeys are used to encrypt the complete original service frame, and integrity authentication subkeys are used to generate and verify authentication tags.
[0027] In this embodiment, the terminal device can be a UAV flight control module, a ground station business system, an industrial controller, a sensor acquisition terminal, an IoT edge control terminal, or other closed terminal devices with fixed business processes. After deploying the terminal quantum-safe cryptographic module, it is not necessary to install encryption software drivers on the terminal device side, actively request business session keys, call encryption interfaces, or modify the original business application. The terminal device still outputs the original business frame according to the original business process. The terminal quantum-safe cryptographic module captures the original business frame through the terminal-side hardware bypass interface and completes key generation, key encapsulation, business data encryption, and authentication tag generation within the module. After receiving the encrypted and encapsulated frame, the receiving-side terminal quantum-safe cryptographic module completes key slot binding authentication, replay protection verification, authentication tag verification, business data decryption, and original business frame recovery within the module, and outputs the recovered business frame to the receiving-side terminal device.
[0028] like Figure 1As shown, this embodiment discloses an automatic encryption and decryption method based on a quantum-safe cryptographic module, which includes the following steps: S1. The quantum-safe cryptographic module of the transmitting terminal captures the original service frame output by the transmitting terminal device through the terminal hardware bypass interface, identifies the frame boundary of the original service frame, and determines the service data to be encrypted based on the frame boundary.
[0029] S2. The quantum-secure cryptographic module of the transmitting terminal generates a service session key based on a local random sequence, a unique identifier of the transmitting device, a unique identifier of the receiving device, an anti-replay random number, a service frame sequence number, and the current key version number, and obtains a data encryption subkey and an integrity authentication subkey from the service session key.
[0030] S3. The quantum-safe cryptographic module of the transmitting terminal encapsulates the service session key using a point-to-point key encryption key, encrypts the service data to be encrypted using the data encryption subkey, generates an authentication tag using the integrity authentication subkey, and generates an encrypted encapsulation frame based on the additional authentication data, the session key ciphertext, the service data encryption random number, the service data ciphertext, and the authentication tag.
[0031] S4. The quantum-safe cryptographic module of the receiving terminal receives the encrypted encapsulated frame, performs key slot binding authentication, anti-replay verification, and authentication tag verification on the encrypted encapsulated frame, and after the verification is passed, decapsulates the service session key and decrypts the ciphertext of the service data, restores the recovery service frame with the same format as the original service frame, and outputs it to the receiving terminal device.
[0032] In this embodiment, it should be noted that in S1, the quantum-safe cryptographic module of the transmitting terminal is located between the transmitting terminal device and the transmitting communication module. The transmitting terminal device can continuously output control commands, status data, telemetry data, or acquisition data according to the original service logic. After receiving the original service frame, the terminal-side hardware bypass interface identifies the start position, end position, payload range, and original service check field of the original service frame according to the link type. For serial port links, the terminal-side hardware bypass interface can identify the complete frame based on the start bit, data bits, check bit, and stop bit. For control bus links, the terminal-side hardware bypass interface can identify the complete frame based on the frame identifier, data length field, and data field. For Ethernet links, the terminal-side hardware bypass interface can identify the complete frame based on the frame header, payload, and frame check sequence. The terminal quantum-safe cryptographic module does not change the format of the original service frame on the terminal device side, but instead uses the complete original service frame containing the original service frame header, original service payload, original service check field, and original service frame tail as the service data to be encrypted. This processing allows the terminal device to maintain the original service protocol, and the terminal device does not need to identify the encrypted encapsulated frame.
[0033] In S2, the quantum-secure cryptographic module on the transmitting side triggers the generation of a service session key after capturing the original service frame. The service session key is not generated online by the quantum-secure cryptographic module management platform for each service message, nor is it actively requested by the terminal device from the quantum-secure cryptographic module management platform. Instead, the transmitting side quantum-secure cryptographic module calls its local quantum random number unit to obtain a quantum random sequence and its local true random number unit to obtain an auxiliary random sequence, and performs health checks on both types of random sequences. After the health check passes, the transmitting side quantum-secure cryptographic module combines the unique identifier of the transmitting device, the unique identifier of the receiving device, the anti-replay random number, the service frame sequence number, and the current key version number to generate the service session key. After the service session key is generated, the transmitting side quantum-secure cryptographic module further obtains a data encryption subkey and an integrity authentication subkey, allowing data encryption and integrity authentication to use subkeys for different purposes. This avoids directly mixing the same key material between different cryptographic uses.
[0034] In S3, the transmitting terminal's quantum-secure cryptographic module first queries the point-to-point key slot bound to the receiver's unique identifier and current key version number through the hardware security module. If the corresponding key slot is active and allows operations including session key encapsulation, the hardware security module allows the encryption / decryption engine to call the point-to-point key encryption key in that key slot. The transmitting terminal's quantum-secure cryptographic module uses the aforementioned point-to-point key encryption key, with the transmitting terminal's unique identifier, the receiver's unique identifier, the anti-replay random number, the service frame sequence number, and the current key version number as the session key encapsulation association data, to perform authentication encryption encapsulation on the service session key, obtaining the session key ciphertext. Subsequently, the transmitting terminal's quantum-secure cryptographic module uses the data encryption subkey to encrypt the entire service data to be encrypted, obtaining the service data ciphertext. The transmitting terminal's quantum-secure cryptographic module then uses the integrity authentication subkey to generate an authentication tag from the additional authentication data, the service data encryption random number, and the service data ciphertext in the encrypted encapsulation frame. The session key ciphertext, the service data encryption random number, the service data ciphertext, and the authentication tag together constitute the key content of the encrypted encapsulation frame.
[0035] In S4, the receiving terminal's quantum-secure cryptographic module receives encrypted encapsulated frames through the communication-side hardware bypass interface. After parsing the encrypted encapsulated frame, the receiving terminal's quantum-secure cryptographic module does not immediately output any plaintext data. Instead, it first queries the key slot binding table in the hardware security module based on the unique identifier of the sending device, the unique identifier of the receiving device, and the current key version number. Only when the query result is unique, the unique identifier of the receiving device matches the unique identifier of the local device, the current key version number is valid, the key status is active, and the allowed operation type includes session key decapsulation, will the receiving terminal's quantum-secure cryptographic module allow the call to the corresponding point-to-point key slot. Subsequently, the receiving terminal's quantum-secure cryptographic module performs anti-replay verification to confirm that the anti-replay random number has not been used and that the service frame sequence number is within the allowed range. After the anti-replay verification passes, the receiving terminal's quantum-secure cryptographic module decapsulates the service session key to obtain the data encryption subkey and the integrity authentication subkey, and uses the integrity authentication subkey to verify the authentication tag. After the authentication tag is verified, the quantum-safe cryptographic module of the receiving terminal decrypts the ciphertext of the service data, restores the recovery service frame with the same format as the original service frame, and outputs it to the receiving terminal device through the terminal-side hardware bypass interface.
[0036] like Figure 2 As shown, in one specific embodiment, S1 includes: S11. The quantum-secure cryptographic module of the transmitting terminal receives the original service frames output by the transmitting terminal device through the terminal-side hardware bypass interface.
[0037] S12. The quantum-secure cryptographic module of the transmitting terminal identifies the frame boundary of the original service frame according to the link type.
[0038] S13. The quantum secure cryptographic module of the transmitting terminal caches the complete original service frame to the internal plaintext buffer.
[0039] S14. The quantum-safe cryptographic module of the transmitting terminal identifies the complete original service frame as the service data to be encrypted.
[0040] In this embodiment, it should be noted that, for S11, the terminal-side hardware bypass interface of the transmitting-side terminal quantum-safe cryptographic module is connected to the transmitting-side terminal device. The transmitting-side terminal device continues to output data according to the original service protocol. The transmitting-side terminal quantum-safe cryptographic module does not expose the key generation interface to the transmitting-side terminal device, nor does it require the transmitting-side terminal device to change the transmission format. The terminal-side hardware bypass interface can be configured in a transparent reception mode, allowing the data output by the transmitting-side terminal device to first enter the terminal quantum-safe cryptographic module, and then the terminal quantum-safe cryptographic module decides whether to generate an encrypted encapsulation frame. This process allows the terminal device's service software to maintain its original operating mode.
[0041] For S12, the quantum-secure cryptographic module on the transmitting side executes different frame boundary identification rules based on different link types. For serial links, boundaries can be identified based on character spacing, frame header fields, or fixed length rules. For control bus links, boundaries can be identified based on bus frame identifiers and data length codes. For Ethernet links, boundaries can be identified based on Ethernet frame headers, payload length, and frame check sequences. The purpose of frame boundary identification is not to alter the original service frame, but to determine the complete range of the encrypted object, avoiding the situation where only part of the service data is encrypted, resulting in the receiving side being unable to recover the original service frame.
[0042] Specifically, when the physical link type is an Ethernet link and the terminal-side hardware bypass interface can obtain the frame verification sequence, the transmitting terminal quantum secure cryptographic module uses the Ethernet frame header, payload, and frame verification sequence together as the basis for frame boundary identification; when the link layer where the terminal-side hardware bypass interface is located does not expose the frame verification sequence to the module, the transmitting terminal quantum secure cryptographic module uses the actually captured Ethernet frame header, length field, payload boundary, and link layer reception completion event as the basis for frame boundary identification, and determines the actually captured complete field as the service data to be encrypted.
[0043] For S13, the transmitting terminal's quantum-secure cryptographic module caches the complete original service frame in its internal plaintext buffer. This plaintext buffer is located within the terminal's quantum-secure cryptographic module and cannot be directly accessed by external terminal devices or external communication links. If an abnormal frame length, missing original service verification field, or incomplete frame tail is detected during frame boundary identification, the transmitting terminal's quantum-secure cryptographic module can discard the abnormal original service frame according to the communication policy and record the frame format abnormality event. This process prevents abnormal frames from entering subsequent encryption processes.
[0044] For S14, the transmitting terminal's quantum-secure cryptographic module uses the complete original service frame as the service data to be encrypted. The complete original service frame includes the original service frame header, original service payload, original service check field, and original service frame trailer. If the original service protocol does not have an independent check field, the service data to be encrypted includes all fields actually output by the original service protocol. Using the complete original service frame as the service data to be encrypted ensures that the receiving terminal's quantum-secure cryptographic module can recover a service frame that the terminal device can directly recognize after decryption, rather than recovering a data fragment that requires further conversion by the terminal device.
[0045] like Figure 3 As shown, in one specific embodiment, S2 includes: S21. The quantum secure cryptographic module of the transmitting terminal reads the quantum random sequence and the auxiliary random sequence.
[0046] S22. The quantum secure cryptographic module of the transmitting terminal performs health checks on the quantum random sequence and the auxiliary random sequence.
[0047] S23. The quantum secure cryptographic module of the transmitting terminal determines the random number water level status.
[0048] S24. The quantum-secure cryptographic module of the transmitting terminal generates a service session key based on a random sequence that has passed health checks and the communication context.
[0049] S25. The quantum-secure cryptographic module of the transmitting terminal obtains the data encryption subkey and the integrity authentication subkey from the business session key.
[0050] In this embodiment, it should be noted that for S21, the quantum random sequence is output by the quantum random number unit within the terminal quantum secure cryptographic module, and the auxiliary random sequence is output by the true random number unit within the terminal quantum secure cryptographic module. Both types of random sequences are generated internally within the terminal quantum secure cryptographic module and are not distributed online by the quantum secure cryptographic module management platform. The transmitting-side terminal quantum secure cryptographic module can trigger random sequence reading according to the arrival event of a service frame, or it can pre-establish a random number buffer when service traffic is high. The random materials in the random number buffer must have passed a health check; random materials that have not passed the health check must not enter the key generation process.
[0051] For S22, the health check includes at least consecutive bit detection, duplicate block detection, minimum entropy estimation, and output rate detection. Consecutive bit detection determines if there are consecutive identical bits in the random sequence exceeding the policy's allowed range. Duplicate block detection determines if there are abnormally high proportions of duplicate blocks in the random sequence. Minimum entropy estimation determines if the random sequence meets the entropy requirements for generating the service session key. Output rate detection determines if the random number generation capability meets the current service message processing rate. If any detection fails, the quantum-secure cryptographic module on the sending terminal stops using the random sequence and reports a random number health check anomaly.
[0052] The consecutive bit detection threshold, repeated block detection threshold, minimum entropy threshold, and output rate threshold are obtained by the terminal quantum-safe cryptographic module during the factory calibration stage based on a finite number of historical random number samples, specifically through continuous acquisition. Groups of random sequence samples, each group having a length of [length missing]. Calculate the maximum consecutive identical bit length in each sample group. , proportion of repeating blocks Minimum entropy estimate and post-processing output rate Then The quantile value rises As a threshold for continuous bit detection, The quantile value rises As the threshold for duplicate block detection, The quantile value decreases As the minimum entropy threshold, The The quantile value is used as the output rate threshold; for example, if Group samples The quantile value The consecutive bit detection threshold is then set to ,like The quantile value The duplicate block detection threshold is then set to ,like The quantile value Then the minimum entropy threshold is set to ,like The quantile value Then the output rate threshold is set to .
[0053] For S23, the random number level is used to determine whether the current random number supply capacity meets the encryption requirements of the service message. The random number level is related to the available random bit output rate, statistical time window, number of service messages, length of service session key, length of anti-replay random number, length of service data encryption random number, and number of reserved random bits. When the random number level meets the condition of generating a service session key per message, the quantum-safe cryptographic module of the transmitting terminal generates a new service session key for the current original service frame. When the random number level does not meet this condition but there is available random material in the random number buffer, the quantum-safe cryptographic module of the transmitting terminal calls the buffered random material. If the random number level does not meet this condition and the buffer is insufficient, the output of new encrypted encapsulated frames is paused.
[0054] The random number water level status can be determined in the following way:
[0055] in, Represents the water level difference of random numbers, in units of ; This represents the output rate of available random bits after post-processing of the terminal quantum-secure cryptographic module, in units of... ; Indicates the statistical time window, in units of ; This indicates the number of business messages that need to be encrypted within the statistical time window, in frames. This indicates the length of random bits required for a single business session key, in units of... ; This represents the length of random bits required to generate a single anti-replay random number, in units of... ; This represents the length of random bits required to encrypt a single piece of business data, expressed in units of... ; This indicates the number of random bits reserved within the statistical time window, in units of... ; Indicates multiplication operation; This represents the addition operation; This represents the subtraction operation; and This indicates that the operations within the parentheses take precedence.
[0056] The random number water level threshold is set to When the random number water level difference is greater than or equal to the random number water level threshold, it indicates that the number of available random bits within the statistical time window can cover the needs of the business session key, anti-replay random numbers, business data encryption random numbers, and reserved random bits. When the random number water level difference is less than the random number water level threshold, it indicates that the supply of random numbers is insufficient. The random number water level threshold is derived from the balance between the supply and consumption of random bits, and is specifically determined by the random number post-processing output rate, peak rate of business messages, key length configuration, and random number redundancy configuration of the terminal quantum secure cryptographic module, and is calibrated during equipment factory testing and business stress testing.
[0057] The random number water level threshold is set to 0 bits. When the random number water level threshold is greater than or equal to 0 bits, it means that the number of available random bits within the statistical time window can cover the needs of the business session key, anti-replay random numbers, business data encryption random numbers, and reserved random bits. When the random number water level threshold is less than 0 bits, it means that the random number supply is insufficient. The quantum-safe cryptographic module on the transmitting side terminal suspends the output of new encrypted encapsulation frames and reports the random number water level shortage event to the quantum-safe cryptographic module management platform. The random number water level threshold is determined by a finite number of historical business traffic data and random number output data. Specifically, 7 days of operation logs are collected in the target business scenario, and the number of business packets and the available random bit output rate are counted every 1 second. The random number water level difference within each statistical time window is obtained according to the random number water level difference calculation method. For example, if the available random bit output rate within a certain statistical time window is 1,024,000 bits / s, the statistical time window is 1 second, the number of business packets to be encrypted is 100 frames, the length of a single business session key is 256 bits, the length of a single anti-replay random number is 96 bits, the length of a single business data encryption random number is 96 bits, and the number of reserved random bits is 2,048 bits, then the total random number consumption within this statistical time window is 46,848 bits, the number of available random bits is 1,024,000 bits, and the random number water level difference is 977,152 bits. Therefore, the condition of generating a one-packet-one-business-session-key is met.
[0058] For S24, the service session key is generated locally by the quantum-secure cryptographic module on the transmitting terminal. The inputs involved in generating the service session key include at least a quantum random sequence, an auxiliary random sequence, a unique identifier for the transmitting device, a unique identifier for the receiving device, a replay-protected random number, a service frame sequence number, and the current key version number. The unique identifier for the transmitting device is used to bind the local identity, the unique identifier for the receiving device is used to bind the communication object, the replay-protected random number is used to reduce the risk of replay attacks, the service frame sequence number is used to maintain the order of service frames, and the current key version number is used to bind the currently active key slot. These inputs collectively participate in the service session key generation, associating the generation result with the current service frame, the current communication object, and the current key state.
[0059] Business session keys can be generated in the following ways:
[0060] in, Indicates the business session key; This represents a function derived from the business session key. Represents a quantum random sequence; Indicates an auxiliary random sequence; This indicates data concatenation operations; This represents the unique identifier of the sending device; This represents the unique identifier of the receiving device; Indicates a random number to prevent replay. Indicates the service frame sequence number; Indicates the current key version number; This indicates the bit length of the business session key. It can be implemented by a hardware-fixed key derivation function based on a hash function, whose output length is determined by... limited.
[0061] For S25, the quantum-secure cryptographic module on the transmitting side terminal obtains the data encryption subkey and the integrity authentication subkey from the service session key. The data encryption subkey is only used to encrypt the service data to be encrypted, and the integrity authentication subkey is only used to generate the authentication tag. If the service session key length is... Then a portion of it can be used to form The data encryption subkey will be used to form another part of the key. Integrity authentication subkey. If the specific algorithm uses different key lengths, the terminal quantum secure cryptographic module can adjust the subkey length according to the communication strategy, but it must ensure that the data encryption purpose and the integrity authentication purpose are separated.
[0062] The length of the business session key, the length of the anti-replay random number, the length of the business data encryption random number, and the number of reserved random bits are determined by the scale of a limited number of historical messages, key usage data, and random number health check data. Specifically, the maximum number of messages per task, the maximum message sending frequency, the key update cycle, and the number of random number health check retries are collected from 50 historical tasks. The business session key length is determined based on the length of the data encryption subkey and the integrity authentication subkey. The anti-replay random number length is determined based on the maximum number of messages under a single key version and replay risk control requirements. The length of the business data encryption random number is determined based on the requirement of the business data encryption function for a unique random number per frame. The number of reserved random bits is determined based on the short-term burst message volume and abnormal retry requirements. For example, when the data encryption subkey length is 128 bits and the integrity authentication subkey length is 128 bits, the business session key length can be set to 256 bits. When the maximum number of messages per key version in historical tasks is less than 2... 32 Furthermore, when it is necessary to control the risk of random number duplication, the length of the anti-replay random number can be set to 96 bits. When the business data encryption function requires the use of a unique random number per frame and the link field overhead allows for a 12-byte field, the length of the business data encryption random number can be set to 96 bits. When historical burst packet statistics show that the additional consumption of the 99th percentile burst does not exceed 1536 bits, the number of reserved random bits can be set to 2048 bits.
[0063] like Figure 4As shown, in one specific embodiment, S3 includes: S31. The quantum secure cryptographic module of the transmitting terminal queries the point-to-point key slot.
[0064] S32. The quantum-safe cryptographic module of the transmitting terminal uses a point-to-point key encryption key to encapsulate the service session key and generate the session key ciphertext.
[0065] S33. The quantum-secure cryptographic module of the transmitting terminal uses the data encryption subkey to encrypt the business data to be encrypted, and generates the business data ciphertext.
[0066] S34. The quantum-secure cryptographic module of the transmitting terminal uses the integrity authentication subkey to generate an authentication tag.
[0067] S35. The quantum-safe cryptographic module of the transmitting terminal generates an encrypted encapsulated frame and outputs it through the communication-side hardware bypass interface.
[0068] For S31, the transmitting terminal's quantum-secure cryptographic module queries the key slot binding table within the hardware security module based on the receiving device's unique identifier and the current key version number. The key slot binding table includes the key slot identifier, the device's unique identifier, the communication target device's unique identifier, the key version number, the allowed operation types, and the key status. If the corresponding key slot does not exist, or the key status is not active, or the allowed operation types do not include session key encapsulation, the transmitting terminal's quantum-secure cryptographic module does not generate an encrypted encapsulation frame and records a key slot anomaly. This process ensures that the key encapsulation operation is constrained by the hardware security module, rather than solely by software fields.
[0069] For S32, the quantum-safe cryptographic module on the transmitting side uses a point-to-point key encryption key to authenticate and encrypt the service session key. The binding fields include the unique identifier of the transmitting device, the unique identifier of the receiving device, an anti-replay random number, the service frame sequence number, and the current key version number. These binding fields participate in the encapsulation authentication as associated data for the session key encapsulation, and are not included as the encrypted plaintext payload in the ciphertext field of the session key. Binding these fields to the authentication and encapsulation process of the service session key allows the quantum-safe cryptographic module on the receiving side to confirm the device relationship, key version, and service frame sequence number corresponding to the service session key during decapsulation. The point-to-point key encryption key is only used to encapsulate the service session key and is not used to encrypt plaintext service data.
[0070] The session key ciphertext is obtained by the quantum-safe cryptographic module of the transmitting terminal using a point-to-point key encryption key to authenticate and encrypt the service session key. The unique identifier of the transmitting device, the unique identifier of the receiving device, the anti-replay random number, the service frame sequence number, and the current key version number are used as associated data in the session key encapsulation authentication and are not included as the encrypted plaintext payload in the session key ciphertext field. This avoids the session key ciphertext field length becoming uncontrollable due to the increase of bound fields such as device identifier, random number, and version number, while still allowing the quantum-safe cryptographic module of the receiving terminal to verify the device relationship, service frame sequence number, and key version number during decapsulation. If the session key length is... The total overhead of the session key encapsulation algorithm outputting ciphertext and encapsulation authentication is: Then the session key ciphertext field in the encrypted encapsulation frame can be set to .
[0071] For S33, the transmitting terminal's quantum-secure cryptographic module treats the complete original service frame as the service data to be encrypted and encrypts it using a data encryption subkey. If the complete original service frame contains an original service verification field, this field is included as part of the service data to be encrypted. Thus, after decryption, the receiving terminal's quantum-secure cryptographic module can recover the complete service frame containing the original service verification field, and the receiving terminal device can continue to verify this field according to the original service protocol. The authentication tag generated by the terminal's quantum-secure cryptographic module is used for external link protection, which has a different purpose than the original service verification field.
[0072] For S34, the authentication tag covers key fields, encrypted random numbers for service data, and ciphertext for service data in the encrypted encapsulation frame. Key fields include at least the encrypted encapsulation frame header, unique identifier of the sending device, unique identifier of the receiving device, current key version number, anti-replay random number, service frame sequence number, communication mode identifier, and session key ciphertext. The authentication tag enables the quantum-safe cryptographic module of the receiving terminal to detect field substitutions, encrypted random number substitutions for service data, ciphertext tampering with service data, ciphertext tampering with the session key, and key version rollback. If the authentication tag fails verification, the quantum-safe cryptographic module of the receiving terminal must not output the plaintext data corresponding to the current encrypted encapsulation frame.
[0073] The encrypted service data is obtained by encrypting the complete original service frame using a data encryption subkey and a service data encryption random number by the quantum-safe cryptographic module of the transmitting terminal. The authentication tag is calculated by the quantum-safe cryptographic module of the transmitting terminal using an integrity authentication subkey, combining the additional authentication data, the service data encryption random number, and the encrypted service data in the encrypted encapsulated frame. The authentication tag can be generated as follows:
[0074] in, Indicates certification label; This indicates the message authentication function executed using the integrity authentication subkey; Indicates the integrity authentication subkey; This indicates that the encrypted encapsulated frame contains additional authentication data; This represents an encrypted random number generated from business data. This indicates encrypted business data; This indicates a data concatenation operation. It includes at least the encrypted encapsulated frame header, the unique identifier of the sending device, the unique identifier of the receiving device, the current key version number, the anti-replay random number, the service frame sequence number, the communication mode identifier, and the session key ciphertext. Because and All participated The quantum-safe cryptographic module at the receiving terminal can detect situations where the encrypted random number of the service data has been replaced, the ciphertext of the service data has been tampered with, or the additional authentication data has been modified. When the authentication tag fails verification, the quantum-safe cryptographic module at the receiving terminal discards the current encrypted encapsulation frame and does not output the plaintext data corresponding to the current encrypted encapsulation frame.
[0075] The authentication tag length threshold is determined by a finite number of link error data, authentication failure data, and external link field overhead. Specifically, 100,000 historical encrypted encapsulated frame transmission records are collected, and the link error rate, authentication tag verification failure rate, and single-frame field overhead are statistically analyzed. Under the premise of meeting the maximum transmission unit constraint of the service, the authentication tag length that can achieve the target authentication strength is selected. For example, when the length that an external communication link can carry per frame is 256 bytes, and the encrypted encapsulated frame header, session key ciphertext, encrypted random number of service data, and ciphertext of service data fields total 172 bytes, and the remaining field space can accommodate a 16-byte authentication tag, the authentication tag length threshold is set to 128 bits.
[0076] For S35, the encrypted encapsulated frame is output through the communication-side hardware bypass interface and transmitted over the external communication link between the terminal quantum-safe cryptographic modules. The encrypted encapsulated frame differs from the original service frame output by the terminal device. The sending terminal device only outputs the original service frame, and the receiving terminal device only receives the recovered service frame. The encrypted encapsulated frame exists only between the two terminal quantum-safe cryptographic modules. This frame format separation method allows the key encapsulation field, random number field, authentication tag field, and ciphertext field of the service data to be added to the external communication link without altering the terminal device's service protocol.
[0077] The length of the encrypted encapsulation frame is obtained by adding the length of the encrypted encapsulation frame header, the length of the session key ciphertext field, the length of the encrypted random number segment of the business data, the length of the business data ciphertext field, and the length of the authentication tag field. For example, the length of the encrypted encapsulation frame header is... The length of the session key ciphertext field is The length of the encrypted random number segment for business data is [length missing]. The length of the encrypted field for business data is The length of the authentication label field is The length of a single encrypted encapsulated frame is If the length of a single frame in an external communication link is... If the encrypted encapsulation frame is longer than the length that a single frame of the external communication link can carry, then the terminal quantum secure cryptographic module enables the fragmentation mechanism and performs key slot binding authentication, anti-replay verification, and authentication tag verification after completing fragmentation and reassembly on the receiving side.
[0078] The threshold for the length that a single frame can carry in an external communication link is determined by a limited number of link carrying capacity test data. Specifically, 1000 test frames of different lengths are continuously sent to the target communication module, and the success rate, retransmission count, and average link latency for each test length are statistically analyzed. The maximum single frame length that has a success rate of not less than 99%, a retransmission count that does not exceed the range allowed by the communication policy, and an average link latency that meets the real-time requirements of the service is selected as the threshold for the length that a single frame can carry in an external communication link. For example, if the success rate of sending 128-byte, 188-byte, and 256-byte test frames is not less than 99%, while the success rate of sending 384-byte test frames drops to 96%, then the threshold for the length that a single frame can carry in an external communication link is set to 256 bytes.
[0079] like Figure 5 As shown, in one specific embodiment, S4 includes: S41. The quantum-safe cryptographic module of the receiving terminal parses the encrypted encapsulated frame.
[0080] S42. The quantum-safe cryptographic module of the receiving terminal performs key slot binding authentication.
[0081] S43. The quantum-safe cryptographic module of the receiving terminal performs anti-replay verification.
[0082] S44. The quantum-safe cryptographic module of the receiving terminal decapsulates the service session key and obtains the data encryption subkey and the integrity authentication subkey.
[0083] S45. The quantum-secure cryptographic module of the receiving terminal verifies the authentication tag and decrypts the ciphertext of the business data.
[0084] S46. The quantum-secure cryptographic module of the receiving terminal recovers the service frame and outputs it to the receiving terminal device.
[0085] For S41, the receiving terminal's quantum-safe cryptographic module receives the encrypted encapsulated frame through the communication-side hardware bypass interface and parses out the encrypted encapsulated frame header, the unique identifier of the sending device, the unique identifier of the receiving device, the current key version number, the anti-replay random number, the service frame sequence number, the communication mode identifier, the session key ciphertext, the service data encryption random number, the service data ciphertext, and the authentication tag. If the encrypted encapsulated frame fields are incomplete, the receiving terminal's quantum-safe cryptographic module directly discards the encrypted encapsulated frame and records the frame format error.
[0086] For S42, the quantum-secure cryptographic module of the receiving terminal queries the key slot binding table in the hardware security module based on the unique identifier of the transmitting device, the unique identifier of the receiving device, and the current key version number. Only when the query result is unique, the unique identifier of the receiving device matches the unique identifier of the local device, the current key version number is valid, the key status is active, and the allowed operation types include session key decapsulation, will the quantum-secure cryptographic module of the receiving terminal allow access to the corresponding point-to-point key slot.
[0087] The authentication mechanism does not simply compare the unique identifier of the device, but uses the device relationship, key version, key slot and allowed operation type as hardware authentication conditions.
[0088] The validity range of the current key version is determined by a limited number of historical key update data. Specifically, this involves collecting the round-trip latency of confirmation responses, the latency of switching confirmation commands, the latency of terminal power failure recovery, and the latency of platform status synchronization during 200 key update processes. The current key version number that is active is directly identified as the valid version, and the previous key version number is temporarily identified as the valid version within the rollback window. For example, if the current active key version number is 18, the previous key version number is 17, and the terminal quantum security cryptography module is still within the 300s rollback window, then both the current key version number 17 and the current key version number 18 are within the valid range; if the rollback window is exceeded, only the current key version number 18 is within the valid range.
[0089] For S43, the receiving terminal's quantum-safe cryptographic module maintains an anti-replay window indexed by the sending device's unique identifier and the current key version number. The anti-replay window records the range of received anti-replay random numbers and service frame sequence numbers. If the anti-replay random number has already appeared, or the service frame sequence number is lower than the minimum allowed service frame sequence number in the anti-replay window, the receiving terminal's quantum-safe cryptographic module discards the encrypted frame. If the anti-replay verification passes, the receiving terminal's quantum-safe cryptographic module allows the continuation of session key decapsulation.
[0090] The anti-replay window length threshold is determined by a finite number of link out-of-order and retransmitted data. Specifically, 100,000 historical service packets are collected, and the out-of-order offset between the arrival sequence number and the sending sequence number of each frame, the maximum number of retransmitted frames on the link, and the number of frames that the terminal quantum secure cryptographic module can buffer are calculated. A window length not less than the historical 99.9th percentile out-of-order offset and not exceeding the buffer capacity is selected as the anti-replay window length threshold. For example, if the historical 99.9th percentile out-of-order offset is 180 frames, the maximum number of retransmitted frames is 64 frames, and the available buffer capacity is 1024 frames, then the anti-replay window length threshold can be set to 512 frames.
[0091] For S44, the receiving terminal's quantum-safe cryptographic module calls the point-to-point key encryption key in the hardware security module to decapsulate the session key ciphertext, obtaining the service session key. The receiving terminal's quantum-safe cryptographic module then uses the same rules as the sending terminal's quantum-safe cryptographic module to derive the data encryption subkey and integrity authentication subkey from the service session key. If decapsulation fails, the receiving terminal's quantum-safe cryptographic module discards the encrypted / encapsulated frame and clears the intermediate decapsulation data.
[0092] For S45, the receiving terminal's quantum-safe cryptographic module uses the integrity authentication subkey to recalculate the authentication tag for the additional authentication data and the ciphertext of the service data in the encrypted encapsulation frame. The additional authentication data includes an encrypted random number for the service data. The recalculated authentication tag is then compared with the authentication tag carried in the encrypted encapsulation frame using a constant-time comparison. If the comparison result is inconsistent, the receiving terminal's quantum-safe cryptographic module discards the encrypted encapsulation frame and does not output the plaintext data corresponding to the current encrypted encapsulation frame. If the comparison result is consistent, the receiving terminal's quantum-safe cryptographic module uses the data encryption subkey and the encrypted random number for the service data to decrypt the ciphertext of the service data, obtaining the recovered complete service frame.
[0093] For S46, the quantum-secure cryptographic module of the receiving terminal outputs the recovered service frame to the receiving terminal device through the terminal-side hardware bypass interface. The recovered service frame has the same format as the original service frame output by the transmitting terminal device, including the original service frame header, original service payload, original service check field, and original service frame trailer. The receiving terminal device does not need to parse the session key ciphertext, authentication tag, anti-replay random number, service data encryption random number, or current key version number. The receiving terminal device continues to process the recovered service frame according to the original service protocol.
[0094] In some embodiments, this embodiment describes the key slot binding table. The hardware security module establishes the key slot binding table during the initialization phase. The key slot binding table includes at least a key slot identifier, a unique device identifier, a unique identifier of the communication target device, the current key version number, allowed operation types, and the key status. The key slot identifier is used to locate non-derivative key slots within the hardware security module. The unique device identifier is used to represent the local terminal's quantum secure cryptographic module. The unique identifier of the communication target device is used to represent the allowed communication peer terminal's quantum secure cryptographic module. The current key version number is used to distinguish the key encryption key update phase. The allowed operation types are used to limit the operations that the key slot can perform, such as session key encapsulation, session key decapsulation, key update decryption, and policy authentication. The key status indicates whether the key slot is in an active, candidate, read-only reserved, locked, or invalid state.
[0095] In point-to-point communication mode, a pre-configured point-to-point encryption key is established between the quantum-secure cryptographic modules of the sending and receiving terminals. This encryption key is written into the point-to-point key slots of the hardware security modules at both ends. After writing, the hardware security module binds the point-to-point key slot to the unique device identifier of its own quantum-secure cryptographic module, the unique device identifier of the receiving terminal's quantum-secure cryptographic module, and the current key version number. External interfaces cannot read the plaintext of the point-to-point encryption key; they can only submit session key encapsulation or decapsulation requests. The hardware security module determines whether the request is allowed based on the key slot binding table.
[0096] When the quantum-safe cryptographic module at the receiving terminal processes encrypted encapsulated frames, the key slot binding table provides hardware-level constraints. If an attacker copies a device's unique identifier but lacks the corresponding point-to-point key slot, valid key version, and legitimate authentication tag, the quantum-safe cryptographic module at the receiving terminal cannot authenticate through key slot binding. This process elevates identity verification from a simple identifier comparison to a verification process constrained by key slots, device relationships, key versions, and authentication tags.
[0097] In some embodiments, this embodiment describes the dynamic updating of the key encryption key. Dynamic updating of the key encryption key includes candidate key slots, active key slots, and a read-only reserved state. The quantum-safe cryptographic module management platform generates a new key encryption key through the platform cryptographic card. The new key encryption key can be a new device-specific key encryption key or a new point-to-point key encryption key. The quantum-safe cryptographic module management platform generates key update ciphertext and key update authentication tag based on the old device-specific key encryption key or the old point-to-point key encryption key. After receiving the key update ciphertext and key update authentication tag, the terminal quantum-safe cryptographic module verifies the device unique identifier, the old key version number, the update random number, and the candidate key slot identifier. After successful verification, the terminal quantum-safe cryptographic module does not directly replace the old active key slot, but instead writes the new key encryption key into the candidate key slot. When the update object is a point-to-point key encryption key, the terminal quantum-safe cryptographic module writes the new point-to-point key encryption key into the candidate point-to-point key slot bound to the communication object device unique identifier and the new key version number.
[0098] The terminal quantum-safe cryptographic module uses the new key from the candidate key slot to encrypt the key and generate an acknowledgment response. After the quantum-safe cryptographic module management platform verifies the acknowledgment response, it issues a switch acknowledgment command. Upon successful verification of the switch acknowledgment command, the terminal quantum-safe cryptographic module switches the candidate key slot to the active key slot and sets the old active key slot to a read-only reserved state within a preset rollback window. If the acknowledgment response is lost, the switch acknowledgment command verification fails, the terminal quantum-safe cryptographic module experiences a power outage, or the link times out, the terminal quantum-safe cryptographic module retains the old active key slot and clears the unacknowledged key material from the candidate key slot.
[0099] The rollback window length threshold is determined by a limited number of key update confirmation data and power outage recovery data. Specifically, it involves collecting the maximum round-trip time of the confirmation response, the maximum retransmission period of the link, the terminal power outage recovery time, and the platform state synchronization period from 200 key update tests. The coverage values of these times are taken and a safety margin is added as the rollback window length threshold. For example, if the maximum round-trip time of the confirmation response is 40s, the maximum retransmission period of the link is 60s, the terminal power outage recovery time is 120s, and the platform state synchronization period is 30s, totaling 250s, after adding a 50s margin, the rollback window length threshold is set to 300s.
[0100] The key update cycle threshold is determined by a limited number of historical key usages and the configured service security level. Specifically, it involves collecting data from 50 historical tasks, including the frequency of service message transmission, the online duration of a single task, and the number of messages that a single key version can process. This data is then combined with the service security level and maintenance policy to determine the key update cycle. For example, if the historical 95th percentile service message transmission frequency is 100 frames / s and the single key version can process 360,000 frames, then the key update cycle should not exceed 3600 seconds. Therefore, the key update cycle threshold can be set to 3600 seconds.
[0101] In some embodiments, this embodiment describes a one-to-many communication mode. In this mode, the quantum-safe cryptographic module management platform generates a group root key via a platform cryptographic card and encapsulates the group root key using the device-specific key of each terminal quantum-safe cryptographic module. Each terminal quantum-safe cryptographic module receives the encapsulated group root key and decapsulates it using the device-specific key in its local hardware security module to obtain the group root key. The group root key does not directly encrypt service data but is used as one of the inputs for generating the group communication service session key.
[0102] The transmitting terminal's quantum-secure cryptographic module derives a group communication service session key based on the group root key, the transmitting device's unique identifier, the group identifier, the group random number, the group service frame sequence number, and the group communication policy version number. It then writes these identifiers into the authentication field of the group encrypted encapsulation frame. Each receiving terminal's quantum-secure cryptographic module reconstructs the group communication service session key based on the same group root key obtained from local decapsulation and the transmitting device's unique identifier, group identifier, group random number, group service frame sequence number, and group communication policy version number carried in the group encrypted encapsulation frame. This group communication service session key is then used to obtain the group communication data encryption subkey and the group communication integrity authentication subkey. The terminal's quantum-secure cryptographic module performs automatic decryption of one-to-many service data according to the authentication tag verification and service frame output recovery method described in the previous embodiment.
[0103] In the one-to-many communication mode, the group root key is not directly used to encrypt service data. The quantum-secure cryptographic module on the transmitting end derives the group communication service session key based on the group root key, the transmitting device's unique identifier, the group identifier, the group random number, the group service frame sequence number, and the group communication policy version number. It then writes these information into the authentication field of the group encrypted encapsulation frame. On the receiving end, each terminal's quantum-secure cryptographic module reproduces the same group communication service session key as the transmitting end, based on the same group root key obtained from local decapsulation and the same transmitting device's unique identifier, group identifier, group random number, group service frame sequence number, and group communication policy version number carried in the group encrypted encapsulation frame. This avoids the problem of inconsistent derived keys caused by each receiving end using its own local random sequence.
[0104] The group root key validity period threshold is determined by a limited number of group member change data and group service message data. Specifically, it involves collecting data on the number of group members joining, leaving, group message sending frequency, and group root key distribution delay in 30 group communication tasks. When the group member change frequency or group message frequency is high, the group root key validity period is shortened; when the group members are stable and the distribution overhead is high, the group root key validity period is appropriately extended. For example, if the group members change on average once every 1800 seconds in 30 tasks, and the average time for group root key distribution is 6 seconds, then the group root key validity period threshold can be set to 1800 seconds.
[0105] The threshold for the number of group members is determined by a limited number of concurrent encapsulation tests and link synchronization tests conducted on the platform cryptographic card. Specifically, the total latency of group root key encapsulation, policy synchronization latency, distribution failure rate, and platform processing load are tested at scales of 16, 32, 64, and 128 terminal quantum-safe cryptographic modules, respectively. The maximum number of terminals with a distribution failure rate not exceeding 1% and a platform processing load not exceeding the maintenance threshold is selected as the threshold for the number of group members. For example, if the distribution failure rate is 0.4% and the platform processing load is 65% with 64 terminals, while the distribution failure rate is 3.2% and the platform processing load is 92% with 128 terminals, then the threshold for the number of group members is set to 64 terminal quantum-safe cryptographic modules.
[0106] In some embodiments, this embodiment describes the exception handling. The terminal quantum secure cryptographic module enters the exception handling process under any of the following circumstances: quantum random number unit health check failure, true random number unit health check failure, insufficient random number level, business session key generation failure, point-to-point key slot query failure, key slot binding authentication failure, anti-replay verification failure, session key decapsulation failure, authentication tag verification failure, business data decryption failure, current key version number mismatch, key update confirmation failure, or the hardware security module detects an abnormality in the unpacking or debugging interface.
[0107] Upon entering the anomaly handling process, the terminal quantum-secure cryptographic module first stops outputting the ciphertext or plaintext data corresponding to the current service frame, and then clears the service session key, data encryption subkey, integrity authentication subkey, key derivation intermediate value, decapsulation intermediate value, and plaintext cache corresponding to the current service frame. Subsequently, the terminal quantum-secure cryptographic module records the anomaly type, device unique identifier, communication object device unique identifier, current key version number, service frame sequence number, and anomaly count. If the communication link is available, the terminal quantum-secure cryptographic module reports the anomaly digest to the quantum-secure cryptographic module management platform. If the communication link is unavailable, the terminal quantum-secure cryptographic module caches the anomaly digest in its local security log and reports it after the communication link is restored.
[0108] The anomaly count threshold and authentication failure threshold are determined by a limited number of historical error, packet loss, and authentication failure statistics. Specifically, this involves collecting link error events, authentication tag verification failure events, anti-replay failure events, and key slot anomaly events from 100,000 historical encrypted encapsulated frames. A distinction is made between occasional failures caused by normal link fluctuations and continuous failures caused by attacks or configuration errors. The threshold is selected based on the number of consecutive failures that can cover normal occasional failures but still trigger timely alarms. For example, if the maximum number of consecutive anomalies caused by normal errors in historical data is 3, and the maximum number of occasional consecutive authentication tag failures is 2, then the anomaly count threshold can be set to 10 consecutive anomalies, and the authentication failure threshold can be set to 5 consecutive failures.
[0109] In some embodiments, this embodiment describes specific data. It is assumed that the transmitting terminal device is a UAV flight control module, and the receiving terminal device is a ground station service system. The UAV flight control module outputs data per second. The original service frame has a length of [length missing]. The post-processed output rate of the terminal quantum-safe cryptographic module is [data missing]. The business session key length is... The length of the anti-replay random number is The length of the encrypted random number for business data is [length missing]. The number of reserved random bits is .exist Within the statistical time window, the terminal quantum secure cryptographic module needs to provide... Each frame service message prepares a service session key, an anti-replay random number, and a service data encryption random number, therefore the random number consumption is... Within the same statistical time window, the number of random bits that the terminal quantum-secure cryptographic module can provide is: The difference between the two random numbers and the water level is: Because the water level difference of this random number is greater than The quantum secure cryptography module of the sending terminal determines that the current random number level meets the conditions for generating a one-message-one-service-session key, and can generate a new service-session key for the current original service frame.
[0110] Regarding the length of the encrypted encapsulated frame, assuming the length of the encrypted encapsulated frame header is... The length of the session key ciphertext field is The length of the encrypted random number segment for business data is [length missing]. The length of the encrypted field for business data is The length of the authentication label field is The length of a single encrypted encapsulated frame is If the length of a single frame in an external communication link is... In this case, the encrypted encapsulated frame can be transmitted within a single external link frame without fragmentation. However, if the length of the original service frame increases, causing the length of the encrypted encapsulated frame to exceed [a certain limit], then [further action is required]. If the terminal quantum secure cryptographic module enables the fragmentation mechanism, it will perform key slot binding authentication, anti-replay verification, and authentication tag verification after completing fragment reassembly on the receiving side.
[0111] Regarding latency handling, the quantum-secure cryptographic module on the transmitting side terminal performs continuous processing... Frame length is When processing the original service frames, record the processing delay from the completion of frame boundary identification to the completion of encrypted encapsulation frame output for each frame, and discard the previous delay. Calculate the remaining samples after frame initialization The arithmetic mean of the frame processing delays yields the average processing delay on the sending side. The quantum-secure cryptographic module at the receiving terminal performs continuous processing. When encrypting and encapsulating frames, record the processing delay for each frame from the completion of parsing the encrypted and encapsulated frame to the completion of outputting the restored service frame, and discard the previous delays. Calculate the remaining samples after frame initialization The arithmetic mean of the frame processing delays yields the average processing delay at the receiving side. The combined average processing latency on both the sending and receiving sides is... Below the additional security processing delay threshold Therefore, this embodiment can meet the requirements of the UAV flight control link for additional security processing latency.
[0112] The additional security processing latency threshold is determined by a limited number of service control cycles and link latency test data. Specifically, it involves collecting terminal service processing latency, link transmission latency, and terminal quantum security cryptographic module security processing latency from 1000 control service interactions. Under the premise of meeting the service control cycle, a threshold not exceeding the latency budget is allocated to the security processing process. For example, if the UAV flight control link control cycle is 50ms, and the combined 95th percentile latency of service processing and link transmission is 28ms, then the available budget for security processing is 22ms, and the additional security processing latency threshold can be set to 20ms.
[0113] In some embodiments, this embodiment describes the functional boundaries of the quantum-safe cryptographic module management platform. The quantum-safe cryptographic module management platform is used for device registration, device status maintenance, communication policy distribution, key encryption key initialization, key encryption key dynamic updating, group root key distribution, and anomaly handling. The quantum-safe cryptographic module management platform does not generate a service session key online for each service message in point-to-point communication mode, nor does it require terminal devices to send a current-cycle service session key request to the quantum-safe cryptographic module management platform. In point-to-point communication mode, the terminal quantum-safe cryptographic module generates a service session key based on a local random sequence and communication context, and encapsulates the service session key using a point-to-point key encryption key.
[0114] The quantum-safe cryptographic module management platform receives status digests reported by terminal quantum-safe cryptographic modules. These status digests may include the device's unique identifier, current key version number, service frame processing count, random number watermark status, random number health check status, authentication failure count, anti-replay failure count, key slot status, and key update status. The status digest does not include plaintext service data, service session keys, data encryption subkeys, integrity authentication subkeys, plaintext key encryption keys, or unused random sequences. Based on the status digest, the quantum-safe cryptographic module management platform determines whether to issue new communication policies, trigger key encryption key updates, lock abnormal terminal quantum-safe cryptographic modules, or perform manual maintenance.
[0115] The state digest reporting cycle threshold is determined by a finite frequency of state changes and platform monitoring load data. Specifically, it involves collecting data on the random number level change frequency, authentication failure count change frequency, key slot status change frequency, and platform concurrent processing load of 100 terminal quantum secure cryptographic modules during historical operation. The reporting cycle is determined under the condition that the platform load is controllable and anomalies can be detected in a timely manner. For example, if the average change interval of the state field is 300s under stable operation, the platform load is 40% under a 60s cycle, and rises to 85% under a 10s cycle, then the state digest reporting cycle threshold can be set to 60s.
[0116] This embodiment describes alternative implementations. The key features of this invention are hardware-bypass frame-level transparent processing of the terminal quantum-safe cryptographic module, end-side autonomous generation of service session keys, key slot binding authentication, replay protection verification, authentication tag verification, and a dynamic key update rollback mechanism. The service data encryption function can be implemented using a hardware-embedded symmetric encryption algorithm. The message authentication function can be implemented using a hardware-embedded message authentication algorithm. The key derivation function can be implemented using a hash-based key derivation function. The post-quantum key encapsulation algorithm can be used as an optional enhancement to assist in establishing or updating the key encryption key, but it is not a necessary step for hardware-bypass automatic encryption and decryption in point-to-point communication mode.
[0117] In some optional embodiments, if the terminal quantum-secure cryptographic module is deployed in a sensor acquisition scenario where only uplink service data is transmitted, the transmitting-side terminal quantum-secure cryptographic module can only enable the functions of original service frame capture, service session key generation, service data encryption, authentication tag generation, and encrypted encapsulated frame output. The receiving-side terminal quantum-secure cryptographic module enables the functions of encrypted encapsulated frame parsing, key slot binding authentication, anti-replay verification, authentication tag verification, service data decryption, and service frame recovery output. If the terminal quantum-secure cryptographic module is deployed in a bidirectional control scenario, both the transmitting and receiving terminals' quantum-secure cryptographic modules enable full functionality in both the transmitting and receiving directions.
[0118] In some optional embodiments, if the external communication link bandwidth is low, the terminal quantum-safe cryptographic module can merge multiple short raw service frames into a single encrypted encapsulated frame. However, the merging window must meet the real-time requirements of the service. The merging window threshold is determined by a finite number of short frame arrival intervals and service real-time test data. Specifically, the arrival interval, service control cycle, external link transmission delay, and allowable waiting time on the receiving side are collected from 10,000 short raw service frames. A merging waiting time that improves link carrying efficiency without exceeding the service real-time constraints is selected as the merging window threshold. For example, if the 90th percentile of the short frame arrival interval is 3ms, the service control cycle is 50ms, the external link transmission delay is 25ms, and the allowable additional waiting time on the receiving side does not exceed 12ms, then the merging window threshold can be set to 10ms.
[0119] When multiple short original service frames are merged into a single encrypted encapsulation frame, the quantum-secure cryptographic module of the transmitting terminal writes the frame length, frame order, and frame boundary identifier of each short original service frame into the service data to be encrypted. After the authentication tag is verified and the encrypted service data is decrypted, the quantum-secure cryptographic module of the receiving terminal restores the multiple short original service frames frame by frame according to the frame length, frame order, and frame boundary identifier, and outputs them to the receiving terminal device in the output order of the original service frames.
[0120] This embodiment describes the technical path of the solution. The transmitting terminal's quantum-secure cryptographic module captures the original service frame through a terminal-side hardware bypass interface and identifies the complete original service frame as the service data to be encrypted. The transmitting terminal's quantum-secure cryptographic module generates a service session key based on a local random sequence and communication context, and obtains a data encryption subkey and an integrity authentication subkey from the service session key. The transmitting terminal's quantum-secure cryptographic module uses a point-to-point encryption key to authenticate and encrypt the service session key, uses the data encryption subkey to encrypt the service data to be encrypted, and uses the integrity authentication subkey to generate an authentication tag from the additional authentication data, the service data encrypted random number, and the service data ciphertext, forming an encrypted encapsulated frame. The receiving terminal's quantum-secure cryptographic module performs key slot binding authentication, replay protection verification, and authentication tag verification on the encrypted encapsulated frame. After successful verification, it decapsulates the service session key and decrypts the service data ciphertext, ultimately restoring a recovered service frame consistent with the original service frame format.
[0121] In this technical approach, the original service frame exists only between the terminal device and the terminal quantum-safe cryptographic module, while the encrypted encapsulated frame exists only in the external communication link between the terminal quantum-safe cryptographic modules. The service session key is generated locally by the sending-side terminal quantum-safe cryptographic module and is not distributed online for each service message by the quantum-safe cryptographic module management platform. The encryption key is used to encapsulate the service session key and does not directly encrypt the plaintext data of the service. The receiving-side terminal quantum-safe cryptographic module does not output the plaintext data corresponding to the current encrypted encapsulated frame before the authentication tag verification is successful. The above processes together constitute an implementable automatic encryption and decryption closed loop, which is distinct from the path where the platform periodically issues service session keys and the security module passively uses the platform key to encrypt and decrypt service data.
[0122] In some embodiments, such as Figure 6 As shown, Figure 6 The overall architecture and high-level data flow relationship of the present invention are illustrated. In this diagram, the quantum-safe cryptographic module management platform is connected to both the transmitting-side terminal quantum-safe cryptographic module and the receiving-side terminal quantum-safe cryptographic module, and is used to issue key update ciphertext and key update authentication tags, and receive status digests reported by the terminal side. The transmitting-side terminal device outputs the original service frame according to the original service process. The transmitting-side terminal quantum-safe cryptographic module captures the original service frame through the terminal-side hardware bypass interface. After capturing the original service frame and identifying the frame boundary, the service data to be encrypted is determined. Subsequently, the transmitting-side terminal quantum-safe cryptographic module generates a service session key based on the local random sequence, the unique identifier of the transmitting device, the unique identifier of the receiving device, the anti-replay random number, the service frame sequence number, and the current key version number. With the cooperation of the quantum random number unit, the true random number unit, and the hardware security module, an encrypted encapsulation frame is generated. The encrypted encapsulation frame includes additional authentication data, session key ciphertext, service data encryption random number, service data ciphertext, and authentication tag, and is sent to the receiving-side communication module via the transmitting-side communication module. After receiving the encrypted encapsulated frame through the communication-side hardware bypass interface, the quantum-safe cryptographic module of the receiving terminal sequentially performs encrypted encapsulated frame parsing, key slot binding authentication, replay protection verification, authentication tag verification, and service session key decapsulation and service data decryption. Upon successful verification, the service frame is restored and output to the receiving terminal device through the terminal-side hardware bypass interface. Thus, Figure 6 This demonstrates the conversion relationship between the original service frame, the encrypted encapsulated frame, and the recovery service frame at different link locations. The original service frame exists only between the transmitting terminal device and the transmitting terminal quantum-safe cryptographic module, the encrypted encapsulated frame exists between the transmitting communication module and the receiving communication module, and the recovery service frame exists between the receiving terminal quantum-safe cryptographic module and the receiving terminal device.
[0123] In some embodiments, such as Figure 7 As shown, Figure 7This illustrates the core timing interaction relationships in the point-to-point communication process of this invention. The transmitting terminal device first outputs the original service frame to the transmitting terminal quantum-safe cryptographic module. Upon receiving the original service frame, the transmitting terminal quantum-safe cryptographic module sequentially performs original service frame capture and frame boundary identification, service session key generation, and encrypted encapsulation frame generation, and sends the generated encrypted encapsulation frame to the receiving terminal quantum-safe cryptographic module. Upon receiving the encrypted encapsulation frame, the receiving terminal quantum-safe cryptographic module does not directly output plaintext data to the receiving terminal device. Instead, it sequentially performs encrypted encapsulation frame parsing, key slot binding authentication, replay protection verification, authentication tag verification, and service session key decapsulation and service data decryption. After all the above verifications pass, the receiving terminal quantum-safe cryptographic module recovers the service frame and outputs the recovered service frame to the receiving terminal device. If verification fails during key slot binding authentication, replay protection verification, or authentication tag verification, the receiving terminal quantum-safe cryptographic module discards the encrypted encapsulation frame and does not output the plaintext data corresponding to the current encrypted encapsulation frame to the receiving terminal device. Therefore, Figure 7 This reflects a timing processing path where the transmitting side performs autonomous encryption and encapsulation, the receiving side performs step-by-step verification and decryption recovery, and plaintext output is blocked upon verification failure.
[0124] To better enable those skilled in the art to fully understand and implement the technical solutions described in this specification, the specific implementation principles of the technical solutions described in this specification are further explained below in the context of a communication scenario between a UAV flight control module and a ground station business system. In this application scenario, the UAV flight control module acts as the transmitting-side terminal device, and the ground station business system acts as the receiving-side terminal device. The transmitting-side terminal quantum secure cryptographic module is connected in series between the UAV flight control module and the UAV communication module, and the receiving-side terminal quantum secure cryptographic module is connected in series between the ground station communication module and the ground station business system. The UAV flight control module still outputs the original telemetry service frames according to the original business procedure, and the ground station business system still receives the telemetry service frames according to the original business procedure. Neither of them needs to install encryption drivers, call encryption interfaces, or request business session keys from the quantum secure cryptographic module management platform. Before device deployment, the quantum secure cryptographic module management platform completes device registration and key encryption key initialization. For example, it assigns a unique identifier to the transmitting-side terminal quantum secure cryptographic module and a unique identifier to the receiving-side terminal quantum secure cryptographic module, and writes the point-to-point key encryption key into the hardware security modules of the quantum secure cryptographic modules on both sides. The hardware security module internally establishes a key slot binding table, which binds the key slot containing the point-to-point key encryption key to the unique identifier of the sending device, the unique identifier of the receiving device, the current key version number, the session key encapsulation operation type, and the session key decapsulation operation type. The plaintext key is not exported through an external interface.
[0125] When the drone flight control module outputs a frame of length at time XX... When the original telemetry service frame is received, the quantum-secure cryptographic module of the transmitting terminal captures the original telemetry service frame through the terminal-side hardware bypass interface. It identifies the frame boundary based on the frame header, payload length, and original service check field, and determines the complete original telemetry service frame containing the original service frame header, payload, check field, and trailer as the service data to be encrypted. Subsequently, the quantum-secure cryptographic module of the transmitting terminal calls the quantum random number unit to output a quantum random sequence and the true random number unit to output an auxiliary random sequence. It then performs continuous bit detection, repeating block detection, minimum entropy estimation, and output rate detection on both types of random sequences. Assume that the usable random bit output rate of the terminal quantum-secure cryptographic module after post-processing is... The drone flight control module outputs per second The original telemetry service frame has a single service session key length of [length missing]. The length of a single anti-replay random number is The length of the encrypted random number for a single business data item is [length missing]. The number of reserved random bits is ,but The number of random bits required within the statistical time window is The number of random bits that can be supplied is The random number water level difference is This satisfies the condition of generating a one-message-one-service-session-key. Based on this, the quantum-secure cryptographic module of the transmitting terminal allows the generation of a new service session key for the current original telemetry service frame. It uses the quantum random sequence, auxiliary random sequence, unique identifier of the transmitting device, unique identifier of the receiving device, anti-replay random number, service frame sequence number, and current key version number as key generation inputs, thus associating the service session key with the current communication object, the current service frame, and the current key version.
[0126] After the service session key is generated, the quantum-secure cryptographic module of the transmitting terminal obtains a data encryption subkey and an integrity authentication subkey from this service session key. The data encryption subkey is used to encrypt the complete original telemetry service frame, and the integrity authentication subkey is used to generate an authentication tag. The quantum-secure cryptographic module of the transmitting terminal queries the point-to-point key slot bound to the unique identifier of the receiving device and the current key version number in the hardware security module. After confirming that the key slot is active and that the allowed operation type includes session key encapsulation, it calls the point-to-point key encryption key in the key slot. Using the unique identifier of the transmitting device, the unique identifier of the receiving device, the anti-replay random number, the service frame sequence number, and the current key version number as the session key encapsulation association data, it performs authentication encryption encapsulation on the service session key to obtain the session key ciphertext. Then, the quantum-secure cryptographic module of the transmitting terminal uses the data encryption subkey to... The complete original telemetry service frame is encrypted to obtain ciphertext service data. An authentication tag is then generated using the integrity authentication subkey, along with the encrypted encapsulated frame header, the unique identifier of the sending device, the unique identifier of the receiving device, the current key version number, the anti-replay random number, the service frame sequence number, the communication mode identifier, the session key ciphertext, the encrypted service data random number, and the encrypted service data ciphertext. Assume the encrypted encapsulated frame header length is... The length of the session key ciphertext field is The length of the encrypted random number segment for business data is [length missing]. The length of the encrypted field for business data is The length of the authentication label field is The length of a single encrypted encapsulated frame is Less than the length that a single frame of an external communication link can carry. Therefore, the quantum-safe cryptographic module on the transmitting side can directly output the encrypted encapsulated frame through the communication side hardware bypass interface without needing to fragment the encrypted encapsulated frame.
[0127] After receiving the encrypted and encapsulated frame through the communication-side hardware bypass interface, the quantum-secure cryptographic module of the receiving terminal first parses out the unique identifier of the transmitting device, the unique identifier of the receiving device, the current key version number, the anti-replay random number, the service frame sequence number, the communication mode identifier, the session key ciphertext, the service data encryption random number, the service data ciphertext, and the authentication tag. The quantum-secure cryptographic module of the receiving terminal does not immediately output data to the ground station's service system. Instead, it first queries the key slot binding table in its own hardware security module based on the unique identifier of the transmitting device, the unique identifier of the receiving device, and the current key version number. Only if the query result is unique, the unique identifier of the receiving device matches the unique identifier of the local device, the current key version number is within a valid range, the key status is active, and the allowed operation type includes session key decapsulation, will the quantum-secure cryptographic module of the receiving terminal allow the call to the corresponding point-to-point key slot. Subsequently, the quantum-secure cryptographic module of the receiving terminal uses the unique identifier of the transmitting device and the current key version number as an index to query the anti-replay window, confirming that the anti-replay random number has not been used and the service frame sequence number is within the allowed range. After successful replay protection verification, the receiving terminal's quantum-safe cryptographic module uses a point-to-point key to encrypt and decrypt the session key ciphertext, recovering the service session key. From this, it obtains the data encryption subkey and integrity authentication subkey. The receiving terminal's quantum-safe cryptographic module then recalculates the authentication tag using the integrity authentication subkey and compares it with the authentication tag carried in the encrypted encapsulated frame over a constant time interval. If they match, it uses the data encryption subkey and the service data encryption random number to decrypt the service data ciphertext, recovering a telemetry service frame consistent with the original output format of the UAV flight control module. This frame is then output to the ground station service system via the terminal's hardware bypass interface. If the device unique identifier does not match, the key version number is invalid, the replay protection random number is duplicated, the service frame sequence number is abnormal, the service data encryption random number is replaced, or the authentication tag verification fails, the receiving terminal's quantum-safe cryptographic module discards the encrypted encapsulated frame, clears the service session key, data encryption subkey, integrity authentication subkey, and decryption intermediate data, and does not output the plaintext service frame corresponding to the current encrypted encapsulated frame to the ground station service system.
[0128] In the aforementioned application scenarios, if the quantum-safe cryptographic module management platform needs to update the device-specific key encryption key or point-to-point key encryption key of the transmitting terminal quantum-safe cryptographic module, the platform generates a new key encryption key through the platform cryptographic card and generates key update ciphertext and key update authentication tag based on the old key encryption key. Upon receiving the update, the transmitting terminal quantum-safe cryptographic module first verifies the device unique identifier, the old key version number, the update random number, and the candidate key slot identifier. After the key update authentication tag is verified, the new key encryption key is written into the candidate key slot, instead of directly overwriting the old active key slot. The transmitting terminal quantum-safe cryptographic module uses the new key encryption key from the candidate key slot to generate a confirmation response. After the quantum-safe cryptographic module management platform verifies the confirmation response, it issues a switch confirmation command. After the transmitting terminal quantum-safe cryptographic module verifies the switch confirmation command, it switches the candidate key slot to the active key slot and sets the old active key slot to a read-only reserved state within a preset rollback window. If a confirmation response is lost, the handover confirmation command verification fails, the terminal quantum-safe cryptographic module loses power, or the link times out, the sending-side terminal quantum-safe cryptographic module keeps the old active key slot valid and removes unconfirmed key materials from the candidate key slots. Through this process, the terminal quantum-safe cryptographic module can still make decisions based on the key status during key updates, reducing the impact of key version inconsistencies on the recovery of subsequent service communication.
[0129] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. An automatic encryption and decryption method based on a quantum-safe cryptographic module, characterized in that, include: The quantum-safe cryptographic module of the transmitting terminal captures the original service frame output by the transmitting terminal device through the terminal hardware bypass interface, identifies the frame boundary of the original service frame, and determines the service data to be encrypted based on the frame boundary; The quantum-secure cryptographic module of the transmitting terminal generates a service session key based on a local random sequence, a unique identifier of the transmitting device, a unique identifier of the receiving device, an anti-replay random number, a service frame sequence number, and the current key version number, and obtains a data encryption subkey and an integrity authentication subkey from the service session key; The quantum-safe cryptographic module of the transmitting terminal uses a point-to-point key encryption key to encapsulate the service session key, uses the data encryption subkey to encrypt the service data to be encrypted, uses the integrity authentication subkey to generate an authentication tag, and generates an encrypted encapsulation frame based on the additional authentication data, the session key ciphertext, the service data encrypted random number, the service data ciphertext, and the authentication tag. The quantum-safe cryptographic module of the receiving terminal receives the encrypted encapsulated frame, performs key slot binding authentication, anti-replay verification, and authentication tag verification on the encrypted encapsulated frame, and after the verification is passed, decapsulates the service session key and decrypts the ciphertext of the service data, restores the recovery service frame with the same format as the original service frame, and outputs it to the receiving terminal device.
2. The automatic encryption and decryption method based on a quantum-safe cryptographic module according to claim 1, characterized in that, The quantum-secure cryptographic module of the transmitting terminal captures the original service frames output by the transmitting terminal device through the terminal-side hardware bypass interface, including: The quantum-secure cryptographic module of the transmitting terminal is connected in series between the transmitting terminal device and the transmitting communication module. The terminal-side hardware bypass interface is connected to the transmitting terminal device, and the communication-side hardware bypass interface is connected to the transmitting communication module. The transmitting terminal device outputs the original service frame according to the original service process. The quantum-safe cryptographic module of the transmitting terminal captures the original service frame through the terminal hardware bypass interface without requiring the transmitting terminal device to call the encryption interface, request the service session key, or modify the service program of the transmitting terminal device. The quantum-secure cryptographic module of the transmitting terminal identifies the frame boundary according to the physical link type of the original service frame. The physical link type includes at least one of serial port link, control bus link, or Ethernet link. The quantum-secure cryptographic module of the transmitting terminal determines the complete original service frame, which includes the original service frame header, the original service payload, the original service verification field, and the original service frame tail, as the service data to be encrypted.
3. The automatic encryption and decryption method based on a quantum-safe cryptographic module according to claim 1, characterized in that, The local random sequence includes a quantum random sequence output by a quantum random number unit and passing a health check, and an auxiliary random sequence output by a true random number unit and passing a health check. Before generating the service session key, the quantum secure cryptographic module of the transmitting terminal performs continuous bit detection, repeated block detection, minimum entropy estimation, and output rate detection on the quantum random sequence and the auxiliary random sequence, respectively. After both the quantum random sequence and the auxiliary random sequence pass the health check, the quantum secure cryptographic module of the transmitting terminal generates the service session key based on the quantum random sequence, the auxiliary random sequence, the unique identifier of the transmitting device, the unique identifier of the receiving device, the anti-replay random number, the service frame sequence number, and the current key version number; When the quantum random sequence or the auxiliary random sequence fails the health check, the quantum secure cryptographic module of the transmitting terminal stops generating the service session key based on the current random sequence and clears the random number cache and plaintext cache corresponding to the current original service frame.
4. The automatic encryption and decryption method based on a quantum-safe cryptographic module according to claim 1, characterized in that, Before the quantum-secure cryptographic module of the transmitting terminal generates the service session key based on the local random sequence, the unique identifier of the transmitting device, the unique identifier of the receiving device, the anti-replay random number, the service frame sequence number, and the current key version number, it also includes: The quantum secure cryptographic module of the transmitting terminal determines the random number level status based on the random number output rate, statistical time window, number of service messages to be encrypted within the statistical time window, length of a single service session key, length of a single anti-replay random number, length of a single service data encryption random number, and number of reserved random bits. When the random number level state meets the conditions for generating a one-message-one-service-session key, the quantum secure cryptographic module of the sending terminal generates a new service-session key for the current original service frame. When the random number level does not meet the conditions for generating a one-message-one-service session key and there are available random materials in the random number buffer that have passed the health check, the quantum secure cryptographic module of the sending terminal calls the available random materials to generate the service session key. When the random number level does not meet the conditions for generating a message-to-service session key and there is no available random material in the random number buffer, the quantum-safe cryptographic module of the sending terminal suspends the output of new encrypted encapsulation frames and reports the random number level insufficiency event to the quantum-safe cryptographic module management platform.
5. The automatic encryption and decryption method based on a quantum-safe cryptographic module according to claim 1, characterized in that, The quantum-safe cryptographic module of the transmitting terminal uses a point-to-point key encryption key to encapsulate the service session key, including: The quantum-secure cryptographic module of the transmitting terminal queries the point-to-point key slot bound to the unique identifier of the receiving device and the current key version number in the hardware security module; When the point-to-point key slot is active and the allowed operation type includes session key encapsulation, the quantum secure cryptographic module of the transmitting terminal calls the point-to-point key encryption key in the point-to-point key slot. The quantum-safe cryptographic module of the transmitting terminal uses the point-to-point key encryption key, and encapsulates the service session key with the unique identifier of the transmitting device, the unique identifier of the receiving device, the anti-replay random number, the service frame sequence number and the current key version number as the session key encapsulation associated data, and performs authentication encryption encapsulation on the service session key to generate the session key ciphertext; The ciphertext of the session key is written into the encrypted encapsulation frame, enabling the quantum-safe cryptographic module of the receiving terminal to recover the business session key based on the ciphertext of the session key after the key slot binding authentication is successful.
6. The automatic encryption and decryption method based on a quantum-safe cryptographic module according to claim 1, characterized in that, The quantum-secure cryptographic module of the transmitting terminal uses the integrity authentication subkey to generate an authentication tag, including: The quantum-secure cryptographic module of the transmitting terminal generates additional authentication data based on the encrypted encapsulated frame header, the unique identifier of the transmitting device, the unique identifier of the receiving device, the current key version number, the anti-replay random number, the service frame sequence number, the communication mode identifier, the service data encryption random number, and the session key ciphertext; The quantum-secure cryptographic module of the transmitting terminal uses the data encryption subkey to encrypt the business data to be encrypted, generating the ciphertext of the business data; The quantum-secure cryptographic module of the transmitting terminal uses the integrity authentication subkey to generate the authentication tag from the additional authentication data and the ciphertext of the business data; The quantum-safe cryptographic module of the transmitting terminal combines the fields corresponding to the additional authentication data, the session key ciphertext, the encrypted random number of the service data, the service data ciphertext, and the authentication tag into the encrypted encapsulation frame, and outputs the encrypted encapsulation frame through the communication side hardware bypass interface.
7. The automatic encryption and decryption method based on a quantum-safe cryptographic module according to claim 1, characterized in that, The quantum-safe cryptographic module of the receiving terminal performs key slot binding authentication on the encrypted encapsulated frame, including: The quantum-safe cryptographic module of the receiving terminal parses the encrypted encapsulation frame to obtain the unique identifier of the sending device, the unique identifier of the receiving device, the current key version number, the anti-replay random number, the service frame sequence number, the communication mode identifier, the session key ciphertext, the service data encryption random number, the service data ciphertext, and the authentication tag; The quantum security cryptographic module of the receiving terminal queries the key slot binding table in the hardware security module based on the unique identifier of the sending device, the unique identifier of the receiving device, and the current key version number; When the query result is unique, the unique identifier of the receiving device is consistent with the unique identifier of the local device, the current key version number is within a valid range, the key status is active and the allowed operation type includes session key decapsulation, the quantum secure cryptographic module of the receiving terminal is allowed to call the corresponding point-to-point key slot. When the query result is empty, the query result is not unique, the unique identifier of the receiving device is inconsistent with the unique identifier of the local device, the current key version number is not within the valid range, the key status is not active, or the allowed operation type does not include session key decapsulation, the quantum secure cryptographic module of the receiving terminal discards the encrypted encapsulation frame.
8. The automatic encryption and decryption method based on a quantum-safe cryptographic module according to claim 1, characterized in that, The quantum-safe cryptographic module of the receiving terminal performs anti-replay verification and authentication tag verification on the encrypted encapsulated frame, including: The quantum-secure cryptographic module of the receiving terminal maintains an anti-replay window using the unique identifier of the sending device and the current key version number as indexes. When the anti-replay random number has already appeared, or when the service frame sequence number is lower than the minimum service frame sequence number allowed by the anti-replay window, the quantum secure cryptographic module of the receiving terminal discards the encrypted encapsulated frame. When the anti-replay verification passes, the quantum secure cryptographic module of the receiving terminal obtains the service session key by decapsulating the ciphertext of the session key, and obtains the data encryption subkey and the integrity authentication subkey from the service session key; The receiving terminal quantum secure cryptographic module uses the integrity authentication subkey to recalculate the authentication tag for the additional authentication data in the encrypted encapsulation frame and the ciphertext of the service data, wherein the additional authentication data includes the encrypted random number of the service data, and compares the recalculated authentication tag with the authentication tag in the encrypted encapsulation frame for a constant time. When the comparison results are consistent, the quantum-safe cryptographic module of the receiving terminal uses the data encryption subkey and the service data encryption random number to decrypt the ciphertext of the service data to obtain the recovered service frame; when the comparison results are inconsistent, the quantum-safe cryptographic module of the receiving terminal discards the encrypted encapsulated frame and does not output the plaintext data corresponding to the current encrypted encapsulated frame.
9. The automatic encryption and decryption method based on a quantum-safe cryptographic module according to claim 1, characterized in that, Also includes: The quantum-safe cryptographic module management platform generates a new key encryption key through the platform cryptographic card. The new key encryption key includes a new device-specific key encryption key or a new point-to-point key encryption key. Based on the old device-specific key encryption key or the old point-to-point key encryption key, it generates key update ciphertext and key update authentication tag. After receiving the key update ciphertext and the key update authentication tag, the terminal quantum security cryptographic module verifies the device unique identifier, the old key version number, the update random number and the candidate key slot identifier, and writes the new key encryption key into the candidate key slot after the key update authentication tag is verified. The terminal quantum secure cryptographic module uses the new key from the candidate key slot to encrypt the key and generate a confirmation response. After the quantum secure cryptographic module management platform verifies the confirmation response, it issues a switch confirmation command. After the terminal quantum secure cryptographic module verifies the switching confirmation command, it switches the candidate key slot to the active key slot and sets the old active key slot to a read-only reserved state within a preset rollback window. In the event of lost confirmation response, failed switching confirmation command verification, power failure of the terminal quantum secure cryptographic module, or link timeout, the terminal quantum secure cryptographic module keeps the old active key slot valid and clears the unconfirmed key material in the candidate key slot.
10. The automatic encryption and decryption method based on a quantum-safe cryptographic module according to claim 1, characterized in that, Also includes: In a one-to-many communication mode, the quantum-safe cryptographic module management platform generates a group root key through the platform cryptographic card, and encapsulates the group root key using the device-specific key of each terminal quantum-safe cryptographic module; After receiving the encapsulated group root key, each terminal quantum security cryptographic module decapsulates the group root key based on the device-specific key in its local hardware security module. The quantum-secure cryptographic module of the transmitting terminal does not directly use the group root key to encrypt service data. Instead, it derives a group communication service session key based on the group root key, the unique identifier of the transmitting device, the group identifier, the group random number, the group service frame sequence number, and the group communication policy version number. The unique identifier of the transmitting device, the group identifier, the group random number, the group service frame sequence number, and the group communication policy version number are written into the authentication field of the group encryption encapsulation frame. Each terminal quantum-secure cryptographic module on the receiving side reproduces the group communication service session key based on the group root key obtained by local decapsulation and the unique identifier of the sending device, the group identifier, the group random number, the group service frame sequence number, and the group communication policy version number carried in the group encrypted encapsulation frame. Based on the group communication service session key, it obtains the group communication data encryption subkey and the group communication integrity authentication subkey, and automatically decrypts the one-to-many service data according to the authentication tag verification and recovery service frame output method.
