Transparent proxy smooth upgrade method against quantum secure gateway

CN122969897APending Publication Date: 2026-10-23BEIJING CATHAY INTERNET INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611404126.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-10
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0005]鉴于此,本发明提出了一种抗量子安全网关的透明代理平滑升级方法,旨在解决现有技术可能导致业务系统停机、通信协议调整以及原有安全体系重新部署,存在改造范围大、实施成本高以及业务连续性难以保证的问题

Benefits of technology

[0016]与现有技术相比,本发明的有益效果在于:通过抗量子安全网关对现有业务会话进行透明代理,在无需改造源终端及目标业务服务器的情况下,引入混合密钥协商和双路径身份认证,实现了传统密码体系与抗量子密码体系的兼容接入;通过建立新的密码安全上下文并在业务会话持续过程中进行安全上下文切换,使抗量子密码能力能够在不中断现有业务通信的情况下完成升级,从而降低了系统改造成本和业务中断风险,提高了业务通信的抗量子安全能力及升级过程的连续性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122969897A_ABST
    Figure CN122969897A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of encrypted communication, and discloses a transparent proxy smooth upgrading method of a quantum-resistant security gateway, which comprises the following steps: connecting the quantum-resistant security gateway to an existing service network, determining a source terminal, a target service server and a communication protocol of service traffic; establishing a first communication session of the source terminal and a second communication session of the target service server; determining a quantum-resistant password algorithm combination of the second communication session, generating a quantum-resistant security session key; obtaining a traditional password identity certificate and a quantum-resistant identity certificate, and establishing a double-path identity authentication relationship; transparently encrypting and transmitting service data through the communication protocol; and according to the updated quantum-resistant password algorithm combination, establishing a new password security context, and switching the second communication session from a current password security context to the new password security context. The application improves the quantum-resistant security capability of service communication and the continuity of upgrading.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of encrypted communication technology, and more specifically, to a transparent proxy smooth upgrade method for quantum-resistant secure gateways. Background Technology

[0002] With the development of network communication technology, government, finance, energy, and industrial control systems widely adopt traditional public-key cryptography for identity authentication and key negotiation, forming a relatively mature infrastructure for terminals, servers, communication protocols, and certificates. However, with the development of quantum computing technology, some traditional public-key cryptographic algorithms face potential quantum attack risks, necessitating the gradual introduction of quantum-resistant cryptographic algorithms into existing systems. Nevertheless, different systems differ in communication protocols, cryptographic algorithms, certificate systems, and equipment capabilities. Therefore, the quantum-resistant upgrade process must also consider the compatibility of traditional cryptographic systems as well as the security and compliance requirements of different business scenarios.

[0003] Existing quantum-resistant upgrade methods require modifications to terminal software, business applications, servers, or underlying cryptographic components to support new quantum-resistant key exchange and authentication algorithms. For a large number of existing business systems already in operation, these modifications not only involve software upgrades, certificate replacements, and equipment compatibility issues, but may also lead to business system downtime, communication protocol adjustments, and the redeployment of existing security systems. Therefore, these modifications are characterized by a large scope, high implementation costs, and difficulty in ensuring business continuity.

[0004] Therefore, it is necessary to design a transparent proxy smooth upgrade method for quantum-resistant secure gateways to solve the problems existing in the current technology. Summary of the Invention

[0005] In view of this, the present invention proposes a transparent proxy smooth upgrade method for quantum-resistant security gateways, which aims to solve the problems of existing technologies that may lead to business system downtime, communication protocol adjustments and redeployment of the original security system, resulting in large-scale transformation, high implementation costs and difficulty in ensuring business continuity.

[0006] This invention proposes a transparent proxy smooth upgrade method for quantum-safe gateways, comprising: The quantum-resistant security gateway is connected to the existing business network to acquire business traffic and perform session identification to determine the source terminal, target business server, and communication protocol of the business traffic. Based on the quantum-resistant security gateway as a proxy node, the original business session of the business traffic is divided, and a first communication session of the source terminal and a second communication session of the target business server are established. Based on the cryptographic algorithm capabilities and security policies of the target service server, a quantum-resistant cryptographic algorithm combination for the second communication session is determined; a hybrid key negotiation is performed based on the quantum-resistant cryptographic algorithm combination to generate a quantum-resistant secure session key; The traditional cryptographic identity credentials of the target business server are obtained. The quantum-resistant security gateway establishes a quantum-resistant identity credential with the target business server based on the traditional cryptographic identity credential. The traditional cryptographic identity credential and the quantum-resistant identity credential are verified respectively to establish a dual-path identity authentication relationship. After the dual-path identity authentication relationship is verified, the business data is transparently encrypted and transmitted through the communication protocol based on the quantum-resistant secure session key. When the business data is transmitted transparently and encrypted in the second communication session, a new cryptographic security context is established based on the updated quantum-resistant cryptographic algorithm combination. While the first communication session maintains the communication state, the second communication session is switched from the current cryptographic security context to the new cryptographic security context.

[0007] Furthermore, establishing the first communication session of the source terminal and the second communication session of the target service server includes: A session association identifier is generated for the first communication session and the second communication session, and the source terminal, the target service server, the identifier of the original service session, and the type of the communication protocol are written into the session association identifier; A data mapping relationship is established between the first communication session and the second communication session based on the session association identifier. The service data in the first communication session is mapped to the second communication session according to the transmission order of the original service session, and the return data of the second communication session is mapped to the first communication session.

[0008] Furthermore, determining the quantum-resistant cryptographic algorithm combination for the second communication session includes: The system acquires the classical key exchange algorithm, quantum-resistant key encapsulation algorithm, classical identity authentication algorithm, and quantum-resistant identity authentication algorithm supported by the target service server. Based on the security policy, it matches the compatibility, security level, and compliance attributes of the classical key exchange algorithm, the quantum-resistant key encapsulation algorithm, the classical identity authentication algorithm, and the quantum-resistant identity authentication algorithm to determine a target algorithm combination that simultaneously satisfies the cryptographic algorithm capabilities and the security policy. When multiple target algorithm combinations exist, it selects one target algorithm combination from the multiple target algorithm combinations according to a preset priority as the quantum-resistant cryptographic algorithm combination for the second communication session.

[0009] Furthermore, when generating a quantum-resistant session key through hybrid key negotiation based on the aforementioned quantum-resistant cryptographic algorithm combination, the process includes: Classical key exchange is performed in the second communication session according to the classical key exchange algorithm in the quantum-resistant cryptographic algorithm combination to obtain the first shared key material; quantum-resistant key encapsulation is performed in the second communication session according to the quantum-resistant key encapsulation algorithm in the quantum-resistant cryptographic algorithm combination to obtain the second shared key material; the first shared key material, the second shared key material, and the session context of the second communication session are input into the key derivation function to generate the quantum-resistant secure session key.

[0010] Furthermore, when generating a quantum-resistant session key through hybrid key negotiation based on the aforementioned quantum-resistant cryptographic algorithm combination, the method further includes: Integrity checks are performed on the first shared key material and the second shared key material respectively. If the first shared key material or the second shared key material is missing or the check is abnormal, the generation of the quantum-resistant session key is prohibited.

[0011] Furthermore, establishing a dual-path authentication relationship includes: The traditional cryptographic identity credential is subjected to certificate chain verification to obtain a traditional identity authentication result; the quantum-resistant security gateway obtains a quantum-resistant identity credential corresponding to the target business server from a preset certificate management entity based on the entity identifier information in the traditional cryptographic identity credential; the quantum-resistant identity credential is subjected to certificate chain verification to obtain a quantum-resistant identity authentication result; a first entity identifier is extracted from the traditional cryptographic identity credential, a second entity identifier is extracted from the quantum-resistant identity credential, and a consistency check is performed on the first entity identifier and the second entity identifier.

[0012] Furthermore, establishing a dual-path authentication relationship also includes: When both the traditional identity authentication result and the quantum-resistant identity authentication result are verified and the first entity identifier and the second entity identifier meet the consistency condition, the traditional cryptographic identity credential and the quantum-resistant identity credential are bound to the second communication session to establish the dual-path identity authentication relationship.

[0013] Furthermore, establishing a dual-path authentication relationship also includes: The quantum-resistant cryptographic algorithm combination, the dual-path authentication relationship, and the session association identifier of the second communication session are bound together to generate a security negotiation context; during the establishment and updating of the second communication session, the received key negotiation information is verified for consistency based on the security negotiation context; when an unexpected change occurs in the quantum-resistant cryptographic algorithm combination, the dual-path authentication relationship, or the session association identifier, the establishment or updating of the second communication session is refused.

[0014] Furthermore, when switching the second communication session from the current cryptographic security context to the new cryptographic security context, it includes: During the handover, the current password security context and the new password security context are maintained simultaneously, and session sequence information is set for the business data. The password security context corresponding to the business data is determined according to the session sequence information. The business data before the handover is encrypted using the current password security context, and the business data after the handover is encrypted using the new password security context. When the amount of business data continuously carried by the new password security context reaches a preset data volume threshold, and the encryption and decryption processing of the business data does not encounter any abnormalities, the current password security context is released.

[0015] Furthermore, it also includes: The second communication session is maintained in a quantum-resistant state, which undergoes state transitions sequentially based on capability detection, cryptographic handshake, dual-path authentication, hybrid key establishment, secure transmission, session update, and session termination. When it is detected that the quantum-resistant algorithm is not supported, dual-path authentication fails, key negotiation is abnormal, certificate validity period is abnormal, or the cryptographic algorithm version changes, the corresponding security processing strategy is triggered according to the current quantum-resistant state. When the security processing strategy allows rollback, the second communication session is switched to classical security mode and the rollback event is recorded, keeping the communication state of the first communication session unchanged. When the security processing strategy prohibits rollback, the second communication session is terminated.

[0016] Compared with existing technologies, the advantages of this invention are as follows: By transparently proxying existing business sessions through a quantum-resistant security gateway, hybrid key negotiation and dual-path authentication are introduced without modifying the source terminal and target business server, achieving compatible access between traditional cryptographic systems and quantum-resistant cryptographic systems; by establishing a new cryptographic security context and switching the security context during the business session, the quantum-resistant cryptographic capability can be upgraded without interrupting existing business communication, thereby reducing system modification costs and business interruption risks, and improving the quantum-resistant security capability of business communication and the continuity of the upgrade process. Attached Figure Description

[0017] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 A flowchart of a transparent proxy smooth upgrade method for a quantum-resistant security gateway provided in an embodiment of the present invention. Detailed Implementation

[0018] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the disclosure to those skilled in the art. It should be noted that, unless otherwise specified, embodiments and features in the embodiments of the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0019] In some embodiments of this application, see Figure 1 As shown, a transparent proxy smooth upgrade method for quantum-safe gateways is proposed, including: S100: Connect the quantum-resistant security gateway to the existing business network, acquire business traffic and perform session identification to determine the source terminal, target business server and communication protocol of the business traffic; S200: Based on the quantum-resistant security gateway as a proxy node, the original business session of the business traffic is divided, and a first communication session of the source terminal and a second communication session of the target business server are established. S300: Determine the quantum-resistant cryptographic algorithm combination for the second communication session based on the cryptographic algorithm capabilities and security policies of the target service server; perform hybrid key negotiation based on the quantum-resistant cryptographic algorithm combination to generate a quantum-resistant secure session key; S400: Obtain the traditional cryptographic identity credentials of the target business server. The quantum-resistant security gateway establishes a quantum-resistant identity credential with the target business server based on the traditional cryptographic identity credential. It verifies the traditional cryptographic identity credential and the quantum-resistant identity credential separately and establishes a dual-path identity authentication relationship. S500: After the dual-path identity authentication relationship is verified, the business data is transparently encrypted and transmitted through the communication protocol based on the quantum-resistant secure session key; S600: When transparently encrypting and transmitting business data in the second communication session, a new cryptographic security context is established based on the updated quantum-resistant cryptographic algorithm combination. While maintaining the communication state in the first communication session, the second communication session is switched from the current cryptographic security context to the new cryptographic security context.

[0020] In step S100, the quantum-resistant security gateway is connected to the existing service network to acquire service traffic and perform session identification to determine the source terminal, target service server, and communication protocol of the service traffic.

[0021] Specifically, before performing the quantum-safe upgrade, the quantum-safe gateway is first connected to the existing service network, enabling it to receive service traffic requiring quantum-safe processing. In this embodiment, the quantum-safe gateway can be deployed between the source terminal's network and the target service server's network using a transparent bridging method. Alternatively, it can be deployed through switch traffic redirection, policy routing, policy forwarding, or other service traffic redirection methods, directing specified service traffic through the quantum-safe gateway. When deployed using a transparent proxy method, the source terminal does not need to be aware of the quantum-safe gateway's existence; the source terminal still sends service data to the target service server according to the original target address, target port, and communication protocol, thereby avoiding modifications to existing service applications.

[0022] Specifically, service traffic refers to network data generated during service interactions between a source terminal and a target service server. This data can include request data, response data, handshake data, confirmation data, and application-layer service data. Upon receiving service traffic, the quantum-resistant security gateway first parses the traffic data and extracts information that characterizes the communication connection. This information includes at least the source network address, source port, destination network address, destination port, transport layer protocol, and communication direction. In scenarios using TCP (Transmission Control Protocol), a basic network connection can be identified using a five-tuple consisting of the source IP address, source port, destination IP address, destination port, and transport protocol. In other communication protocol scenarios, identification is based on the connection identifier, endpoint identifier, or session identifier within the corresponding protocol.

[0023] To distinguish between different service sessions established between the same source terminal and the same target service server, the quantum-resistant security gateway can also identify sessions by combining connection establishment time, connection identifier, protocol handshake information, and application layer session identifier. For example, the same source terminal may establish multiple service sessions at different times, or the same source terminal may establish multiple parallel connections with the same target service server simultaneously. Therefore, it is not possible to determine whether they belong to the same service session based solely on the source IP address and the target IP address; further determination is required by combining port, connection identifier, or protocol session information.

[0024] Specifically, the communication protocol is used to determine the communication method and subsequent security processing method used for service traffic. For example, in one implementation, the communication protocol is TLS (Transport Layer Security), and the quantum-resistant security gateway can identify the cipher suites, protocol versions, and authentication information supported by both communicating parties based on the TLS handshake message; in another implementation, the communication protocol is IPSec (Internet Protocol Security), and the quantum-resistant security gateway can identify the corresponding security associations and cryptographic parameters based on the IPSec negotiation message; for other encrypted communication protocols that require quantum-resistant security upgrades, the corresponding communication protocol type can also be determined based on the connection establishment information in the protocol message.

[0025] The quantum-resistant security gateway establishes a service session record based on the identified service traffic information. The service session record records basic communication information of the current service session, which may include at least the source terminal identifier, target service server identifier, source port, target port, communication protocol type, service session establishment time, and service session status. The source terminal identifier can be represented by a source IP address, terminal device identifier, or a terminal association identifier generated by the gateway; the target service server identifier can be represented by a target IP address, server domain name, server device identifier, or server association identifier.

[0026] After identifying the service session, the quantum-resistant security gateway determines whether the identified service session belongs to the target service session that requires transparent proxying and quantum-resistant security processing according to the preset quantum-resistant security processing strategy. When the service session meets the preset processing conditions, the service session is identified as the target service session and enters the subsequent proxy session establishment process; when the service session does not meet the preset processing conditions, it is processed according to the original forwarding path of the existing service network, thereby avoiding the impact on service traffic that does not require upgrades.

[0027] For example, in one specific embodiment, the source terminal's IP address is 10.10.1.20, the target service server's IP address is 10.20.1.30, the source port is 52000, the target port is 443, and the communication protocol is TLS. After receiving the TCP connection establishment message and subsequent TLS handshake message sent by the source terminal, the quantum-resistant security gateway determines the service connection based on the source IP address, source port, target IP address, target port, and transport protocol, and marks the connection as the target service session to be processed with quantum-resistant security. At this time, the source terminal still considers the target service server to be 10.20.1.30, and the target service server can continue to receive communication requests from the service network according to its original network address. The quantum-resistant security gateway completes the proxy processing of service traffic in the network path.

[0028] In step S200, after determining the target service session, the quantum-resistant security gateway does not directly treat the original connection between the source terminal and the target service server as a single security processing object. Instead, it uses the quantum-resistant security gateway as a proxy node to logically divide the original service session into two interconnected but independently security-processable communication sessions. The communication session between the source terminal and the quantum-resistant security gateway is defined as the first communication session, and the communication session between the quantum-resistant security gateway and the target service server is defined as the second communication session.

[0029] The first communication session is primarily used to maintain the original communication state of the source terminal, allowing it to continue communicating using its original network address, port, communication protocol, and service interaction method. The second communication session is primarily used to establish an independent secure communication relationship between the quantum-resistant security gateway and the target service server, enabling the quantum-resistant security gateway to perform secure processing such as cryptographic algorithm negotiation, authentication, key establishment, and encrypted forwarding of service data during the second communication session.

[0030] Specifically, when establishing the first communication session, the quantum-resistant security gateway can receive and maintain the connection request sent by the source terminal, and record the communication state corresponding to the connection request in the session state of the first communication session. For the second communication session, the quantum-resistant security gateway, acting as a proxy node, initiates the corresponding connection request to the target service server, and establishes the second communication session with the target service server based on the target address, target port, and communication protocol corresponding to the first communication session.

[0031] Therefore, the first and second communication sessions can have independent connection states, sequence states, and security contexts at the network connection layer, while still belonging to the same original business session in terms of business logic. The quantum-resistant security gateway associates the two communication sessions through internally maintained session relationships, enabling business data sent by the source terminal to enter the second communication session from the first communication session, and enabling data returned by the target business server to return to the source terminal in the opposite direction.

[0032] The first and second communication sessions each have independent session states. The session state of the first communication session may include the source terminal connection state, data reception state, data transmission state, and original service protocol state; the session state of the second communication session may include the target service server connection state, password negotiation state, authentication state, secure transmission state, and password security context state. By maintaining the states of the two communication sessions separately, the communication state of the first communication session can be maintained even when the second communication session undergoes a quantum-resistant cryptographic upgrade.

[0033] When establishing a first communication session for the source terminal and a second communication session for the target service server, a session association identifier is generated for the first and second communication sessions, and the identifiers of the source terminal, the target service server, the original service session, and the type of communication protocol are written into the session association identifier.

[0034] Specifically, the session association identifier is used to uniquely identify the correspondence between the first communication session and the second communication session, so that the quantum-resistant security gateway can accurately determine the second communication session corresponding to a certain first communication session when it simultaneously proxies multiple source terminals and multiple target service servers, thus avoiding cross-mapping of data between different service sessions.

[0035] In one implementation, the session association identifier can be generated by the quantum-resistant security gateway based on the identifier of the original service session, or it can be generated by the quantum-resistant security gateway by combining the source terminal identifier, the target service server identifier, the original service session identifier, and the communication protocol type. The session association identifier can be further associated with the connection identifier of the first communication session and the connection identifier of the second communication session.

[0036] For example, for a TLS service session established between source terminal 10.10.1.20 and target service server 10.20.1.30, the quantum-resistant security gateway can generate an association identifier CID-0001 for the original service session and establish the following association in its internal session association table: CID-0001 corresponds to source terminal 10.10.1.20, target service server 10.20.1.30, original service session identifier Session-A, TLS protocol, first communication session ID-C1, and second communication session ID-C2. Therefore, when the quantum-resistant security gateway receives service data corresponding to ID-C1, it can determine based on CID-0001 that the service data should be mapped to ID-C2, and will not send the data to other service sessions.

[0037] Session association identifiers are not only used to identify the correspondence between two communication sessions, but also serve as the basis for binding subsequent cryptographic security contexts to business sessions. For example, when establishing a quantum-resistant cryptographic security context, the session association identifier can be used as the association parameter of the security context, so that a specific quantum-resistant secure session key corresponds only to a specific second communication session, thereby avoiding the mixing of keys or security contexts between different business sessions.

[0038] A data mapping relationship is established between the first communication session and the second communication session based on the session association identifier. The service data in the first communication session is mapped to the second communication session according to the transmission order of the original service session, and the return data of the second communication session is mapped to the first communication session.

[0039] Specifically, the quantum-resistant security gateway establishes a bidirectional data mapping channel between the first and second communication sessions. For data sent by the source terminal, it is first received by the first communication session. The quantum-resistant security gateway determines the corresponding second communication session based on the session association identifier of the first communication session, and then maps the service data to the second communication session according to the order in which the data was received in the first communication session. During this process, the service data can be encrypted, decrypted, or encapsulated according to the current cryptographic security context used in the second communication session before being sent to the target service server.

[0040] For data returned by the target service server, it is processed according to the reverse data path. The quantum-resistant security gateway receives the data returned by the target service server through the second communication session, determines the corresponding first communication session based on the session association identifier corresponding to the second communication session, maps the processed return data to the first communication session, and then sends it to the source terminal through the first communication session.

[0041] To ensure that business data maintains the same transmission order as the original business session before and after being processed by the proxy, the quantum-resistant security gateway can maintain session sequence information for data entering the proxy processing. This session sequence information can be determined based on the sequence number, data block number, reception sequence number from the original business session, or the proxy sequence number generated by the gateway. For multiple consecutively received business data units, the quantum-resistant security gateway queues and maps them according to their order in the original business session, avoiding out-of-order data due to differences in internal cryptographic processing, caching, or network transmission latency.

[0042] For example, when the source terminal continuously sends the first, second, and third service data blocks, the quantum-resistant security gateway first receives the three service data blocks in the first communication session and records the corresponding session sequence information S1, S2, and S3 for each. Then, it maps the three service data blocks to the second communication session in the order of S1, S2, and S3. Even if the encryption processing within the second communication session has different processing delays, caching and sequence control ensure that the service data is sent to the target service server in the transmission order corresponding to the original service session.

[0043] For the data returned by the target service server, the corresponding session sequence information is recorded according to the return order of the second communication session, and mapped back to the first communication session according to the session association identifier, thereby forming a forward data path of "source terminal - first communication session - quantum-resistant security gateway - second communication session - target service server" and a reverse data path of "target service server - second communication session - quantum-resistant security gateway - first communication session - source terminal".

[0044] To avoid session crosstalk when multiple service sessions are running concurrently, the quantum-resistant security gateway can maintain independent session association records, data buffers, and session states for each service session. Upon receiving service data, it first determines the corresponding session association identifier based on the first or second communication session to which the data belongs, and then determines the corresponding data mapping relationship and security context based on the session association identifier. Therefore, data from one service session can only be mapped to its corresponding other communication session.

[0045] When an anomaly occurs in either the first or second communication session, the quantum-resistant security gateway can locate the other associated communication session based on the session association identifier and synchronize the states of the two communication sessions. For example, if the second communication session cannot connect to the target service server, the connection state of the first communication session can be temporarily maintained, and a decision can be made to re-establish or terminate the second communication session based on subsequent security policies. When it is determined that a service session needs to be terminated, the session resources corresponding to that service session are released simultaneously based on the session association identifier.

[0046] In step S300, based on the cryptographic algorithm capabilities of the target service server and the security policy corresponding to the current business scenario, a suitable quantum-resistant cryptographic algorithm combination is determined for the second communication session. A hybrid key negotiation process is then established based on the determined quantum-resistant cryptographic algorithm combination to generate a quantum-resistant secure session key for subsequent encrypted transmission of business data in the second communication session. The quantum-resistant cryptographic algorithm combination considers both the cryptographic algorithms actually supported by the target service server and the cryptographic algorithms permitted by the current security policy, ensuring that the final determined algorithm combination can both establish communication with the target service server and meet the security level and compliance requirements of the current business scenario.

[0047] Specifically, after the second communication session is established, the quantum-resistant security gateway acquires the cryptographic algorithm capabilities of the target service server. Cryptographic algorithm capabilities represent the cryptographic algorithms and related protocols that the target service server is currently capable of participating in cryptographic negotiation and actually executing. The quantum-resistant security gateway can acquire cryptographic algorithm capabilities through capability negotiation information during the establishment of the second communication session, or it can obtain them based on the capability information pre-registered by the target service server. In this embodiment, the acquired cryptographic algorithm capabilities include at least the classical key exchange algorithm, quantum-resistant key encapsulation algorithm, classical authentication algorithm, and quantum-resistant authentication algorithm supported by the target service server. These four types of algorithms are used to complete traditional key exchange, quantum-resistant key establishment, traditional authentication, and quantum-resistant authentication, respectively, thereby providing an algorithmic foundation for the subsequent formation of quantum-resistant secure communication compatible with traditional cryptographic systems.

[0048] Classical key exchange algorithms are used to generate shared key materials for traditional cryptographic systems, such as elliptic curve key exchange algorithms like X25519. Quantum-resistant key encapsulation algorithms are used to generate shared key materials resistant to quantum computing attacks, such as the ML-KEM (Module-Lattice-Based Key-Encapsulation Mechanism) series of algorithms, with ML-KEM-768 being a specific implementation. The Kyber768 (CRYSTALS-Kyber768) mentioned in earlier technical documents corresponds to the standardized ML-KEM-768 parameter set; therefore, in actual implementation, it can be configured according to the standard version supported by the target service server and the quantum-resistant security gateway. Classical authentication algorithms can employ traditional public-key cryptography algorithms such as RSA (Rivest–Shamir–Adleman, RSA public-key cryptography algorithm) or ECDSA (Elliptic Curve Digital Signature Algorithm), while quantum-resistant authentication algorithms can employ quantum-resistant digital signature algorithms such as ML-DSA (Module-Lattice-Based Digital Signature Algorithm).

[0049] After acquiring the cryptographic algorithm capabilities supported by the target business server, the quantum-resistant security gateway further acquires the security policy corresponding to the current second communication session. The security policy limits the range and combination conditions of cryptographic algorithms allowed for the current business communication, ensuring that the quantum-resistant security gateway does not directly select algorithms based solely on the target business server's algorithm capabilities, but rather further filters algorithm combinations that meet the current security requirements within the actual range of algorithms supported by the target business server. The security policy can be pre-stored in the quantum-resistant security gateway and configured according to different business types, security levels, or compliance requirements.

[0050] Specifically, the quantum-resistant security gateway first forms a set of candidate algorithms based on the classical key exchange algorithm, quantum-resistant key encapsulation algorithm, classical authentication algorithm, and quantum-resistant authentication algorithm supported by the target service server. Then, it selects algorithms from each candidate set that can collectively form a complete security negotiation, resulting in multiple candidate target algorithm combinations. Each target algorithm combination includes at least one classical key exchange algorithm, one quantum-resistant key encapsulation algorithm, one classical authentication algorithm, and one quantum-resistant authentication algorithm, thus enabling the formed algorithm combinations to possess both traditional cryptographic capabilities and quantum-resistant cryptographic capabilities.

[0051] For example, when the target service server supports the algorithms corresponding to X25519, ML-KEM-768, RSA, and ML-DSA, the quantum-resistant security gateway can use X25519 as a candidate classical key exchange algorithm, ML-KEM-768 as a candidate quantum-resistant key encapsulation algorithm, RSA as a candidate classical authentication algorithm, and ML-DSA as a candidate quantum-resistant authentication algorithm, thus forming corresponding quantum-resistant cryptographic algorithm combinations. If the target service server simultaneously supports multiple classical key exchange algorithms or multiple quantum-resistant key encapsulation algorithms, they can be combined separately to form multiple candidate target algorithm combinations.

[0052] After forming candidate target algorithm combinations, the quantum-resistant security gateway performs compatibility matching on each combination according to the security policy. Compatibility is used to determine whether the various algorithms in the candidate combination can negotiate together under the communication protocol and protocol version used in the current second communication session. Specifically, the quantum-resistant security gateway checks the communication protocol version, cipher suites, or protocol extension capabilities supported by the target service server, and determines whether the selected classical key exchange algorithm, quantum-resistant key encapsulation algorithm, and authentication algorithm can be used together in the current protocol environment. If an algorithm, although supported by the target service server, cannot negotiate together with the protocol version of the current second communication session or other candidate algorithms, the candidate combination containing that algorithm is excluded.

[0053] After completing compatibility matching, the quantum-resistant security gateway further performs security level matching on candidate target algorithm combinations according to the security policy. The security level represents the security strength that the algorithm combination can provide. The quantum-resistant security gateway compares the security level of the algorithm corresponding to the candidate target algorithm combination with the security level required by the current second communication session. If any algorithm in the candidate target algorithm combination does not meet the minimum security requirements specified by the current security policy, the candidate target algorithm combination is excluded; if all algorithms in the candidate target algorithm combination meet the corresponding security level requirements, the candidate target algorithm combination is retained.

[0054] The quantum-resistant security gateway performs compliance attribute matching on candidate target algorithm combinations. Compliance attributes indicate whether the corresponding cryptographic algorithm meets the cryptographic usage specifications required by the current business scenario. Based on pre-configured security policies, the quantum-resistant security gateway determines the permitted algorithm range and algorithm combination constraints for the current business scenario, and judges whether each algorithm in the candidate target algorithm combination has the corresponding compliance attributes. When a candidate target algorithm combination contains algorithms that do not meet the current compliance requirements, the candidate target algorithm combination is excluded; only candidate target algorithm combinations that simultaneously meet all compliance requirements are retained.

[0055] After matching based on compatibility, security level, and compliance attributes, the quantum-resistant security gateway obtains a target algorithm combination that simultaneously satisfies the cryptographic algorithm capabilities of the target business server and the current security policy. Therefore, the final target algorithm combination is not determined solely by the security level of a single algorithm, but rather by a combination of conditions that simultaneously satisfy "the target business server can support it," "the current protocol can be used," "the security level meets the requirements," and "the compliance requirements are met."

[0056] If only one target algorithm combination is obtained after the above matching process, the quantum-resistant security gateway directly uses this combination as the quantum-resistant cryptographic algorithm combination for the current second communication session. If multiple target algorithm combinations are obtained after matching, the quantum-resistant security gateway sorts these combinations according to a preset priority and selects one as the final quantum-resistant cryptographic algorithm combination to be used in the second communication session. The preset priority is used to make a deterministic selection among multiple algorithm combinations that all meet the basic security conditions, thereby avoiding uncertain algorithm selection results due to different candidate algorithms each time a second communication session is established.

[0057] In one specific implementation, the preset priority can be determined in advance based on factors such as quantum security resistance, compliance attributes, protocol compatibility, and algorithm version. When multiple algorithm combinations all satisfy the current security policy, the algorithm combination with higher quantum security resistance and compliance with current compliance requirements is selected first. When security capabilities and compliance attributes are the same, the algorithm combination with higher compatibility with the current communication protocol is selected first. When the above conditions are still the same, the selection is further determined based on the algorithm version or the preset algorithm priority. In this way, a second communication session under the same capabilities and policy conditions can select an algorithm combination according to deterministic rules.

[0058] After determining the combination of quantum-resistant cryptographic algorithms, the quantum-resistant secure gateway performs hybrid key negotiation based on this combination. Hybrid key negotiation refers to simultaneously using classical key exchange algorithms and quantum-resistant key encapsulation algorithms to generate shared key materials, and then using both shared key materials together for subsequent session key generation. Therefore, the generated quantum-resistant secure session key does not rely solely on either the classical key exchange algorithm or the quantum-resistant key encapsulation algorithm, but is constrained by both key establishment mechanisms simultaneously.

[0059] Specifically, the quantum-resistant security gateway first performs a classical key exchange process with the target service server in the second communication session, based on the classical key exchange algorithm in the determined quantum-resistant cryptographic algorithm combination. Taking X25519 as an example, the quantum-resistant security gateway and the target service server respectively generate corresponding key exchange parameters and exchange the necessary public key parameters through the second communication session. After both parties complete the key exchange calculation, they obtain the same shared key material. The shared key material obtained through the classical key exchange process is denoted as the first shared key material. The first shared key material is used to participate in subsequent hybrid key derivation but is not directly used as the final session key for encrypting business data.

[0060] After obtaining the first shared key material, the quantum-resistant security gateway further executes a quantum-resistant key encapsulation process according to the quantum-resistant key encapsulation algorithm in the determined quantum-resistant cryptographic algorithm combination. Taking ML-KEM-768 as an example, the quantum-resistant security gateway and the target service server generate or use the corresponding key material according to the key encapsulation mechanism corresponding to ML-KEM, and complete the ciphertext encapsulation and decapsulation process, enabling both communicating parties to obtain the corresponding second shared key material. The second shared key material originates from the quantum-resistant key encapsulation process and is used to enhance the resistance of the final session key to quantum computing attacks.

[0061] After obtaining the first and second shared key materials, the quantum-safe gateway does not directly use either shared key material as the final quantum-safe session key. Instead, it inputs the first and second shared key materials, along with the session context of the second communication session, into a key derivation function (KDF) to generate a quantum-safe session key. The key derivation function combines multiple shared key materials according to preset key derivation rules to form the final session key, ensuring that the final generated quantum-safe session key is simultaneously influenced by both classical key exchange results and quantum-safe key encapsulation results.

[0062] In this context, the session context of the second communication session is used to confine the generated quantum-resistant session key within the current second communication session. The session context corresponds at least to the session association information, communication protocol type, and protocol version of the current second communication session, and may further correspond to the currently determined combination of quantum-resistant cryptographic algorithms and the negotiation state of the current session. By incorporating the session context into key derivation, even if different second communication sessions use the same classical key exchange algorithm and quantum-resistant key encapsulation algorithm, they will not directly use the same key derivation input, thus establishing a correspondence between the generated quantum-resistant session key and the current second communication session.

[0063] For example, in a second communication session, the quantum-resistant security gateway obtains the first shared key material via X25519 and the second shared key material via ML-KEM-768, while simultaneously acquiring the session context corresponding to the current second communication session. The quantum-resistant security gateway inputs the two shared key materials and the current session context into a key derivation function according to a preset key derivation rule, thereby generating the quantum-resistant security session key corresponding to the current second communication session. The target service server, after performing key derivation using the same algorithm combination, the same key negotiation result, and the corresponding session context, can obtain the quantum-resistant security session key corresponding to the quantum-resistant security gateway. Both parties can then use this session key for secure transmission of subsequent business data.

[0064] To prevent the generation of the final session key from occurring even when only one type of shared key material is valid during the key negotiation process, the quantum-safe gateway further performs integrity checks on the first and second shared key materials before generating the quantum-safe session key. This integrity check does not involve sending the first or second shared key material to the peer in plaintext for comparison. Instead, it verifies the integrity of the negotiation result corresponding to the shared key material based on the negotiation messages, handshake messages, negotiation result digests, protocol states, and relevant authentication results during the key negotiation process. This verifies whether the shared key material was generated from a complete and correct key negotiation process.

[0065] Specifically, for the first shared key material, the quantum-safe gateway checks whether the classical key exchange process has been completely executed, whether the relevant key exchange messages have been completely received, whether the message authentication or handshake verification results are normal, and whether the current key exchange result matches the negotiation state of the current second communication session. When all the above checks meet the requirements, the first shared key material is determined to have passed the integrity verification; when necessary messages are missing, message verification is abnormal, the negotiation state is abnormal, or a valid shared key material cannot be obtained during the classical key exchange process, the first shared key material is determined to have an verification error.

[0066] For the second shared key material, the quantum-resistant security gateway performs integrity verification according to the negotiation process corresponding to the quantum-resistant key encapsulation algorithm. Specifically, it checks whether the negotiation message required for quantum-resistant key encapsulation is complete, whether the encapsulated ciphertext passes the corresponding protocol verification, whether the decapsulation process is normal, and whether the obtained key material matches the negotiation state of the current second communication session. When the above conditions are met, the second shared key material is deemed to have passed the integrity verification; when there are issues such as missing encapsulated ciphertext, abnormal key encapsulation process, decapsulation failure, or inconsistent negotiation states, the second shared key material is deemed to have failed verification.

[0067] Only after both the first and second shared key materials pass integrity verification can the quantum-resistant gateway allow the final key derivation process to be executed and generate the quantum-resistant session key. In other words, both the classical key exchange result and the quantum-resistant key encapsulation result are necessary inputs for generating the final session key; a so-called quantum-resistant session key cannot be generated using only the other part of the key material if one part is missing or abnormal.

[0068] When the first shared key material is missing or its integrity verification fails, the quantum-resistant security gateway prohibits the generation of the quantum-resistant session key corresponding to the current second communication session; similarly, when the second shared key material is missing or its integrity verification fails, the generation of the quantum-resistant session key corresponding to the current second communication session is also prohibited. In this situation, the quantum-resistant security gateway maintains the current second communication session in a state of incomplete key negotiation and renegotiates the key negotiation process or terminates the current second communication session according to the current security policy, rather than continuing into the encrypted transmission state of business data with incomplete key materials.

[0069] In step S400, during the establishment of the second communication session, the target service server undergoes both traditional cryptographic authentication and quantum-resistant authentication. The results of these two authentications are then correlated to form a dual-path authentication relationship for the same target service server. This dual-path authentication relationship does not replace one authentication credential with the other; instead, it independently verifies both the traditional cryptographic and quantum-resistant authentication credentials, further confirming that the entities corresponding to both credentials belong to the same target service server. After confirming that both credentials are valid and the corresponding entities are consistent, the two credentials are bound to the current second communication session, thus providing a clear identity foundation for subsequent secure communication based on a combination of quantum-resistant cryptographic algorithms.

[0070] Specifically, when establishing the second communication session, the quantum-resistant security gateway first obtains the traditional cryptographic identity credentials used by the target business server. These credentials are used to prove the target business server's identity within the existing traditional cryptographic framework; they can be traditional digital certificates already deployed and used in the existing business system. For example, if the target business server uses TLS communication, the traditional cryptographic identity credentials can be server digital certificates generated based on traditional public-key cryptographic algorithms such as RSA or ECDSA. Since the target business server is an existing device within the existing business system, the traditional cryptographic identity credentials can directly use the currently configured credentials of the target business server without changing its original identity configuration.

[0071] After obtaining traditional cryptographic identity credentials, the quantum-resistant security gateway first performs certificate chain verification on the credentials to determine whether they were issued by a trusted certificate system and whether they are currently valid. Specifically, the quantum-resistant security gateway retrieves the corresponding superior certificates level by level based on the issuer information carried in the traditional cryptographic identity credentials, and verifies the certificate chain according to the preset root of trust. It also checks the certificate's validity period, signature validity, and whether the certificate's purpose meets the server authentication requirements of the current second communication session. If the certificate chain can be traced back to the preset root of trust, all levels of certificate signature verification are successful, the certificate has not expired, and the certificate's purpose matches the target business server's authentication requirements, a successful traditional identity authentication result is generated. If any verification requirement is not met, a failed traditional identity authentication result is generated.

[0072] While verifying traditional cryptographic identity credentials, the quantum-resistant security gateway extracts entity identification information from these credentials to determine the target business server corresponding to them. Entity identification information can be the certificate subject name, subject unique identifier, server identifier, unified entity identifier, or a server identity identifier pre-configured by the business system. To ensure that traditional cryptographic identity credentials and quantum-resistant identity credentials can subsequently be mapped to the same target business server, the quantum-resistant security gateway uses entity identification information as the basis for obtaining the quantum-resistant identity credentials, rather than solely relying on network addresses or communication ports to determine the correspondence.

[0073] Furthermore, the quantum-resistant security gateway obtains the quantum-resistant identity credential corresponding to the target business server from a pre-defined certificate management entity based on the entity identification information in the traditional cryptographic identity credential. The pre-defined certificate management entity maintains the existing correspondence between the traditional identity and the quantum-resistant identity of the target business server and provides the quantum-resistant identity credential matching the target business server to the quantum-resistant security gateway. The quantum-resistant identity credential can be generated using a quantum-resistant digital signature algorithm, such as a quantum-resistant digital certificate formed using ML-DSA. The quantum-resistant identity credential does not require the target business server to change its original traditional cryptographic identity credential; instead, it is obtained by the quantum-resistant security gateway during proxy communication and used to establish the quantum-resistant identity authentication path corresponding to the target business server.

[0074] In one specific implementation, a pre-defined certificate management entity establishes a binding relationship between the traditional identity and the quantum-resistant identity for the target business server. This binding relationship includes at least the entity identifier corresponding to the traditional cryptographic identity credential and the entity identifier corresponding to the quantum-resistant identity credential. When the quantum-resistant security gateway sends the entity identifier information from the traditional cryptographic identity credential, the certificate management entity queries the corresponding quantum-resistant identity credential based on the entity identifier and returns the quantum-resistant identity credential to the quantum-resistant security gateway. Thus, the quantum-resistant security gateway can determine the corresponding quantum-resistant identity based on the existing traditional identity of the target business server, without requiring the target business server to temporarily generate or change its original identity credential.

[0075] After obtaining a quantum-resistant identity credential, the quantum-resistant security gateway performs independent certificate chain verification to obtain a quantum-resistant authentication result. Specifically, the quantum-resistant security gateway establishes a corresponding quantum-resistant certificate chain based on the issuer information of the quantum-resistant identity credential and verifies the quantum-resistant identity credential using a preset quantum-resistant root of trust. The verification process checks at least whether the signature of the quantum-resistant identity credential is valid, whether the certificate chain can be traced back to the root of trust, whether the certificate is valid, and whether the certificate's purpose meets the authentication requirements of the current second communication session. When all the above verification conditions are met, a successful quantum-resistant identity authentication result is generated; when any verification condition is not met, a failed quantum-resistant identity authentication result is generated.

[0076] To avoid the problem of traditional cryptographic identity credentials and quantum-resistant identity credentials being valid but corresponding to different business servers, the quantum-resistant security gateway further verifies the consistency of entity identifiers in the two types of identity credentials after obtaining the traditional and quantum-resistant authentication results. Specifically, a first entity identifier is extracted from the traditional cryptographic identity credential, and a second entity identifier is extracted from the quantum-resistant identity credential. The first and second entity identifiers are then compared and associated. The first and second entity identifiers can be represented by the same server-unique identifier; when the two certificates use different formats of identifier information, they can be converted into a unified entity identifier based on a preset entity identifier mapping relationship before comparison.

[0077] For example, the first entity identifier in the original traditional digital certificate of the target business server is the server's unique identifier "SERVER-001", and the certificate management entity configures a second entity identifier "SERVER-001" for the quantum-resistant identity credential corresponding to the target business server. The quantum-resistant security gateway extracts the first and second entity identifiers from the two identity credentials respectively, processes them into a unified format, and then compares them. When both correspond to "SERVER-001", it is determined that the two identity credentials correspond to the same target business server; if the traditional cryptographic identity credential corresponds to "SERVER-001" while the quantum-resistant identity credential corresponds to "SERVER-002", it is determined that the two identity credentials do not meet the consistency condition, and even if the certificate chain verification of each identity credential passes, a dual-path identity authentication relationship is not established.

[0078] When both traditional and quantum-resistant authentication results pass verification, and the first entity identifier and the second entity identifier meet the consistency condition, the quantum-resistant security gateway binds both the traditional cryptographic identity credentials and the quantum-resistant identity credentials to the current second communication session, establishing a dual-path authentication relationship. This binding records the two types of identity credentials corresponding to the current second communication session, enabling the quantum-resistant security gateway to clearly determine that the current second communication session has simultaneously completed both traditional cryptographic and quantum-resistant identity verification. At this point, the identity status of the second communication session is marked as successful dual-path authentication, allowing subsequent secure communication to continue based on a determined combination of quantum-resistant cryptographic algorithms.

[0079] When binding two types of identity credentials to a second communication session, the identifiers of the traditional cryptographic identity credential, the quantum-resistant identity credential, the first entity identifier, the second entity identifier, and the session association identifier of the second communication session can be written into the authentication status record corresponding to the current session. The authentication status record indicates the identity credential used in the current second communication session and the corresponding target business server, thereby establishing a connection between the authentication result and the specific business session, preventing the authentication result of one business server from being incorrectly used in the second communication session of another business server.

[0080] Furthermore, to ensure that subsequent key negotiation and cryptographic security context updates are still based on the verified identity and algorithm combination, the quantum-resistant security gateway binds the determined quantum-resistant cryptographic algorithm combination, the dual-path authentication relationship, and the session association identifier of the second communication session to generate a security negotiation context. The security negotiation context is used to record the current security negotiation state of the second communication session, enabling subsequently received key negotiation information to correspond to the already determined algorithm, identity, and session.

[0081] Specifically, the security negotiation context records at least the following identifiers for the current second communication session: the quantum-resistant cryptographic algorithm combination identifier, the traditional cryptographic identity credential identifier, the quantum-resistant identity credential identifier, the first entity identifier, the second entity identifier, and the session association identifier. It may also record information such as the current cryptographic negotiation stage, the current security context state, and the protocol version corresponding to this negotiation. All of the above information is used together to form the security negotiation benchmark for the current second communication session.

[0082] During the establishment of the second communication session, each time the quantum-resistant security gateway receives information related to key negotiation, it performs a consistency check on the key negotiation information based on the security negotiation context. Specifically, the quantum-resistant security gateway first identifies the second communication session to which the key negotiation information belongs, and uses the session association identifier to confirm whether the key negotiation information belongs to the current target service server; then it checks whether the cryptographic algorithm information carried or corresponding to it is consistent with the quantum-resistant cryptographic algorithm combination recorded in the security negotiation context, and further checks whether the identity authentication status corresponding to the key negotiation process is still the verified dual-path identity authentication status.

[0083] During the aforementioned consistency check, if the quantum-resistant cryptographic algorithm corresponding to the received key negotiation information is inconsistent with the algorithm combination recorded in the security negotiation context, it is considered that the current key negotiation information has undergone an unexpected change. For example, the security negotiation context records that the current second communication session uses a predetermined combination of classical key exchange algorithm and quantum-resistant key encapsulation algorithm, but subsequent received negotiation information requires the use of another quantum-resistant algorithm that has not been confirmed by the current policy. In this case, the quantum-resistant security gateway refuses to continue using the key negotiation information to establish or update the second communication session.

[0084] Similarly, if the identity authentication relationship corresponding to the current key negotiation information is inconsistent with the dual-path identity authentication relationship recorded in the security negotiation context, it is considered that the identity status has changed unexpectedly. For example, the current second communication session has already bound the traditional cryptographic identity credential and the quantum-resistant identity credential corresponding to the target business server, but the entity identifier corresponding to the subsequent key negotiation information changes, or the corresponding quantum-resistant identity credential is inconsistent with the already bound quantum-resistant identity credential, then the quantum-resistant security gateway refuses to use the key negotiation information to continue establishing or updating the second communication session.

[0085] If an unexpected change in the session association identifier is detected, the establishment or updating of the second communication session will also be refused. By binding the session association identifier to the security negotiation context, it can be ensured that key negotiation information can only be applied to its corresponding second communication session. For example, when a quantum-resistant security gateway simultaneously proxies the communication services of multiple target service servers, even if different second communication sessions use the same cryptographic algorithm combination, they need to be distinguished according to their respective session association identifiers to avoid the key negotiation state of one second communication session being incorrectly applied to another.

[0086] When the quantum-resistant cryptographic algorithm combination, dual-path authentication relationship, and session association identifier are all consistent with the security negotiation context, the quantum-resistant security gateway determines that the current key negotiation information belongs to a second communication session with an established security negotiation relationship, and allows the corresponding key negotiation or security context update operation to continue. Therefore, the subsequently established cryptographic security context can be simultaneously constrained by the algorithm state, identity state, and session state.

[0087] For example, the quantum-resistant security gateway establishes a second communication session C2 for the target service server SERVER-001, and determines that this second communication session uses a predetermined classical key exchange algorithm, a quantum-resistant key encapsulation algorithm, and a dual-path authentication relationship, while generating a corresponding session association identifier CID-0001. The quantum-resistant security gateway binds the above information to form a security negotiation context. When key negotiation information is subsequently received, it first confirms that the information belongs to the second communication session corresponding to CID-0001, then confirms that its algorithm combination is consistent with the current security negotiation context, and confirms that its authentication status still corresponds to SERVER-001's traditional cryptographic identity credentials and quantum-resistant identity credentials. Only when all the above conditions are met is key negotiation allowed to continue.

[0088] In step S500, after the established dual-path authentication relationship is verified and a quantum-safe session key has been generated, the service data in the second communication session is transmitted with transparent encryption. This transparent encryption transmission is performed by the quantum-safe gateway on the second communication session side. The source terminal does not need to change its original service data generation method, and the target service server does not need to change its original service data processing method. The quantum-safe gateway only receives, processes, and forwards service data between the first and second communication sessions, and uses the established quantum-safe session key to perform corresponding encryption or decryption processing on the service data in the second communication session.

[0089] Specifically, after the dual-path authentication relationship is verified, the quantum-resistant security gateway confirms that the current second communication session has completed both traditional cryptographic authentication and quantum-resistant authentication, and confirms that the generated quantum-resistant session key belongs to the current second communication session. At this point, the quantum-resistant security gateway associates the quantum-resistant session key with the cryptographic security state corresponding to the current second communication session and marks the current second communication session as a state where secure data transmission is possible. The quantum-resistant session key is only used for the protection of business data in the current second communication session and is not directly applied to other second communication sessions.

[0090] In step S600, when the source terminal sends service data to the target service server, the source terminal first sends the service data to the quantum-resistant security gateway according to the original communication protocol. Since the quantum-resistant security gateway has already established a first communication session and a second communication session, it determines which second communication session the received service data belongs to based on the established session association. After determining the second communication session to which the service data belongs, the quantum-resistant security gateway encrypts the service data according to the cryptographic security context corresponding to the current second communication session, and then sends the encrypted service data to the target service server through the second communication session.

[0091] For the business data returned by the target business server, the quantum-resistant security gateway processes it in the reverse direction. The target business server sends the secure business data through a second communication session. The quantum-resistant security gateway decrypts the business data according to the cryptographic security context corresponding to the current second communication session and sends the decrypted business data to the source terminal through the first communication session. Thus, the first communication session continues to operate according to the original communication method of the source terminal, while the quantum-resistant security protection mainly applies to the second communication session between the quantum-resistant security gateway and the target business server.

[0092] During the above process, the quantum-resistant security gateway does not change the original business data content and business processing logic of the source terminal. Instead, it performs encryption and decryption processing on the data that needs to be transmitted through the second communication session according to the cryptographic security context corresponding to the current second communication session. Since the first and second communication sessions have already established a corresponding data mapping relationship, business data can be bidirectionally forwarded between the first and second communication sessions, thus ensuring that the business communication relationship between the source terminal and the target business server remains continuous.

[0093] In this embodiment, the cryptographic security context used by the second communication session is updated when the second communication session already carries service data. This allows the new quantum-resistant cryptographic algorithm combination to be applied to subsequent service data transmission without terminating the first communication session. The cryptographic security context describes the current security protection state of the second communication session, corresponding at least to the currently used quantum-resistant cryptographic algorithm combination and the corresponding session key and negotiation state. Therefore, when the quantum-resistant cryptographic algorithm combination is updated, a new cryptographic security context needs to be established based on the updated combination before switching the service data protection method of the second communication session from the current context to the new one.

[0094] Specifically, when a cryptographic security context update is required for the current second communication session, the quantum-resistant security gateway re-executes the corresponding security negotiation process based on the updated quantum-resistant cryptographic algorithm combination, and obtains new security parameters and a new session key corresponding to the updated algorithm combination. The quantum-resistant security gateway associates the updated algorithm combination, the new session key, and the corresponding session state to form a new cryptographic security context. The new cryptographic security context is in a pending switchover state before it is officially used for business data transmission, while the current cryptographic security context remains valid, thus allowing the current cryptographic security context and the new cryptographic security context to coexist during the switchover phase.

[0095] After the new cryptographic security context is established, the quantum-resistant gateway does not immediately release the current cryptographic security context. Instead, it maintains both the current and new cryptographic security contexts simultaneously during the handover. The current cryptographic security context continues to process data that entered the second communication session before the handover, while the new cryptographic security context is used to process data entering the second communication session after the handover. By maintaining two cryptographic security contexts simultaneously, situations where decryption or encryption is impossible can be avoided after the old context is released and before the new context has fully taken over the business data.

[0096] To determine whether service data belongs to the data before or after the handover, the quantum-resistant security gateway sets session sequence information for the service data in the second communication session. The session sequence information indicates the order in which service data enters the current second communication session. This session sequence information can be based on existing protocol sequence numbers or record sequence numbers in the second communication session, or it can be formed by the quantum-resistant security gateway maintaining consecutive sequence numbers for the current session. Its purpose is to enable the quantum-resistant security gateway to determine the corresponding cryptographic security context according to the order in which service data enters the second communication session.

[0097] Specifically, upon initiating a cryptographic security context switch, the quantum-resistant security gateway determines a context switch boundary and, based on this boundary, divides the service data in the second communication session into pre-switch service data and post-switch service data. Service data located before the switch boundary continues to be encrypted or decrypted using the current cryptographic security context, while service data located after the switch boundary is encrypted or decrypted using the new cryptographic security context. The switch boundary corresponds to session sequence information; therefore, the quantum-resistant security gateway can determine which cryptographic security context the service data belongs to based on the session sequence information.

[0098] For example, in the second communication session, service data with sequence numbers 1001, 1002, and 1003 have been generated sequentially. When the quantum-resistant security gateway determines that sequence number 1003 is the switching boundary, service data with sequence numbers no greater than 1003 continue to be processed using the current cryptographic security context, while subsequent service data with sequence numbers greater than 1003 are processed using the new cryptographic security context. Therefore, even if the current cryptographic security context and the new cryptographic security context coexist for a period of time, the cryptographic security context corresponding to each piece of service data can be clearly identified based on the session sequence information, preventing the same service data from being incorrectly processed using two different cryptographic security contexts.

[0099] During the cryptographic security context switch, the first communication session maintains its original communication state. That is, the first communication session between the source terminal and the quantum-resistant security gateway will not be closed, re-established, or require the source terminal to re-establish a service connection due to the cryptographic security context update of the second communication session. The quantum-resistant security gateway only performs the cryptographic security context switch on its second communication session with the target service server; therefore, the service connection on the source terminal side can be continuously maintained.

[0100] For service data received in the first communication session but not yet processed in the second communication session, the quantum-resistant security gateway determines the corresponding cryptographic security context based on its session sequence information, performs encryption or decryption according to the corresponding context, and then forwards it through the second communication session. For service data newly received after the boundary switch, it is processed directly according to the new cryptographic security context. Thus, even if continuous service data arrives during the cryptographic security context switch, the data processing order can be maintained according to the session sequence.

[0101] After the new cryptographic security context begins carrying business data, the quantum-resistant security gateway continues to verify the business processing status of the new cryptographic security context. When the amount of business data continuously carried by the new cryptographic security context reaches a preset data volume threshold, and no anomalies occur in the encryption and decryption processing of the business data during this carrying process, the quantum-resistant security gateway determines that the new cryptographic security context has completed stable takeover. The preset data volume threshold is used to ensure that the new cryptographic security context has actually processed a certain amount of business data, rather than simply being successfully established but not yet verified by actual business transmission.

[0102] The absence of anomalies in the encryption and decryption of business data means that during the continuous transmission of business data in the new cryptographic security context, there were no instances of incorrect decryption, encryption failure, authentication errors, or mismatches with session sequence information. The quantum-resistant security gateway releases the current cryptographic security context only when both conditions are met: the continuous data transmission volume reaches a preset threshold and encryption / decryption processing proceeds without anomalies. After releasing the current cryptographic security context, the second communication session continues to use the new cryptographic security context to process subsequent business data, thus completing a smooth switch of cryptographic security context.

[0103] For example, the current second communication session is using the first cryptographic security context for business data transmission. The quantum-resistant security gateway establishes a second cryptographic security context based on the updated quantum-resistant cryptographic algorithm combination. During the handover phase, both the first and second cryptographic security contexts remain valid. The quantum-resistant security gateway uses a certain session sequence as the handover boundary; data before this boundary continues to be processed using the first cryptographic security context, while data after this boundary is processed using the second cryptographic security context. When the second cryptographic security context has continuously processed a preset amount of business data without any encryption / decryption, authentication, or sequence anomalies, the quantum-resistant security gateway releases the first cryptographic security context. Throughout this process, the first communication session between the source terminal and the quantum-resistant security gateway remains connected, therefore the source terminal does not need to re-establish the business connection.

[0104] Furthermore, to provide unified state management for the aforementioned quantum-safe communication process, the quantum-safe gateway maintains a quantum-safe state for the second communication session. The quantum-safe state represents the current quantum-safe processing stage of the second communication session and transitions according to the following processing sequence: capability detection, cryptographic handshake, dual-path authentication, hybrid key establishment, secure transmission, session update, and session termination. Each state corresponds to a secure processing stage of the second communication session, and the quantum-safe gateway determines the permitted operations for the current second communication session based on the current state.

[0105] In the capability probing state, the quantum-resistant security gateway acquires the cryptographic algorithm capabilities of the target service server and determines whether the target service server supports the quantum-resistant cryptographic algorithm combination required by the current security policy. When the capability probing is completed and the subsequent negotiation conditions are met, the quantum-resistant security state enters the cryptographic handshake state; after completing the corresponding protocol handshake in the cryptographic handshake state, it enters the dual-path authentication state; after successful dual-path authentication, it enters the hybrid key establishment state; and after both the first and second shared key materials are valid and a quantum-resistant secure session key is generated, it enters the secure transmission state.

[0106] In secure transmission state, the quantum-resistant secure gateway uses the established quantum-resistant secure session key to transparently encrypt and transmit service data in the second communication session. When an update to the cryptographic algorithm combination is required, the quantum-resistant secure state transitions from secure transmission state to session update state, where a new cryptographic security context is established and the aforementioned cryptographic security context switching process is executed. Once the new cryptographic security context has been stably taken over, the second communication session continues in secure transmission state. When the service communication ends normally, the quantum-resistant secure state transitions to session termination state and releases the security state and cryptographic security context corresponding to the current second communication session.

[0107] During the operation of the aforementioned quantum-resistant security state, the quantum-resistant security gateway continuously detects abnormal situations that may affect the security of the current second communication session. These abnormal situations include the target service server not supporting the currently required quantum-resistant algorithm, dual-path authentication failure, key negotiation anomalies, expired identity credentials, or changes in the cryptographic algorithm version. When such an anomaly is detected, the quantum-resistant security gateway first determines the quantum-resistant security state of the current second communication session, and then determines the permissible processing method under the current abnormal situation based on the pre-configured security handling policy.

[0108] When the security processing strategy allows for rollback, the quantum-resistant security gateway switches the second communication session to classical security mode. Classical security mode means that the second communication session uses the security mechanisms corresponding to the original traditional cryptographic system for communication. During rollback, the quantum-resistant security gateway redetermines the available traditional secure communication parameters based on the actual state of the current second communication session, updates the security state of the second communication session to classical security mode, and records this rollback event. The rollback event is used to record at least the second communication session in which the rollback occurred and the corresponding rollback reason, thus ensuring a clear record of the current security processing state of the second communication session.

[0109] When performing a classic security mode rollback, the quantum-resistant gateway maintains the communication state of the first communication session unchanged. In other words, the rollback operation only applies to the second communication session between the quantum-resistant gateway and the target service server; the first communication session between the source terminal and the quantum-resistant gateway does not need to be re-established due to the security mode change in the second communication session. Therefore, even if a quantum-resistant security mode rollback occurs in the second communication session, it will not directly cause the current service connection of the source terminal to be interrupted.

[0110] When the security processing policy prohibits rollback, the quantum-resistant security gateway does not allow the second communication session to degrade to classical security mode; instead, it terminates the second communication session. In this case, the quantum-resistant security gateway does not continue to use cryptographic algorithms that do not meet the current security policy for business data transmission, ensuring that the mandatory quantum-resistant security policy is not automatically downgraded due to abnormal circumstances.

[0111] For example, if the second communication session is already in a quantum-resistant secure transmission state, and the version of the quantum-resistant algorithm on the target service server changes, the quantum-resistant secure gateway detects this version change and enters the corresponding security processing flow based on the current quantum-resistant secure state. If the current security policy allows conventional cryptographic modes as a fallback method in abnormal situations, the second communication session continues secure communication according to the classical security mode, while the first communication session maintains its original connection state; if the current security policy requires the use of quantum-resistant cryptographic algorithms, the quantum-resistant secure gateway prohibits fallback and terminates the current second communication session.

[0112] In summary, by using a quantum-resistant security gateway to transparently proxy existing business sessions, hybrid key negotiation and dual-path authentication are introduced without modifying the source terminal and target business server, achieving compatible access between traditional cryptographic systems and quantum-resistant cryptographic systems. By establishing a new cryptographic security context and switching the security context during the business session, the quantum-resistant cryptographic capability can be upgraded without interrupting existing business communication, thereby reducing system modification costs and business interruption risks, and improving the quantum-resistant security capability of business communication and the continuity of the upgrade process.

[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the present invention.

Claims

1. A transparent proxy smooth upgrade method for a quantum-safe gateway, characterized in that, include: The quantum-resistant security gateway is connected to the existing business network to acquire business traffic and perform session identification to determine the source terminal, target business server, and communication protocol of the business traffic. Based on the quantum-resistant security gateway as a proxy node, the original business session of the business traffic is divided, and a first communication session of the source terminal and a second communication session of the target business server are established. Based on the cryptographic algorithm capabilities and security policies of the target service server, a quantum-resistant cryptographic algorithm combination for the second communication session is determined; a hybrid key negotiation is performed based on the quantum-resistant cryptographic algorithm combination to generate a quantum-resistant secure session key; The traditional cryptographic identity credentials of the target business server are obtained. The quantum-resistant security gateway establishes a quantum-resistant identity credential with the target business server based on the traditional cryptographic identity credential. The traditional cryptographic identity credential and the quantum-resistant identity credential are verified respectively to establish a dual-path identity authentication relationship. After the dual-path identity authentication relationship is verified, the business data is transparently encrypted and transmitted through the communication protocol based on the quantum-resistant secure session key. When the business data is transmitted transparently and encrypted in the second communication session, a new cryptographic security context is established based on the updated quantum-resistant cryptographic algorithm combination. While the first communication session maintains the communication state, the second communication session is switched from the current cryptographic security context to the new cryptographic security context.

2. The transparent proxy smooth upgrade method for a quantum-resistant secure gateway according to claim 1, characterized in that, Establishing a first communication session between the source terminal and a second communication session between the target service server includes: A session association identifier is generated for the first communication session and the second communication session, and the source terminal, the target service server, the identifier of the original service session, and the type of the communication protocol are written into the session association identifier; A data mapping relationship is established between the first communication session and the second communication session based on the session association identifier. The service data in the first communication session is mapped to the second communication session according to the transmission order of the original service session, and the return data of the second communication session is mapped to the first communication session.

3. The transparent proxy smooth upgrade method for a quantum-resistant secure gateway according to claim 1, characterized in that, Determining the quantum-resistant cryptographic algorithm combination for the second communication session includes: The system acquires the classical key exchange algorithm, quantum-resistant key encapsulation algorithm, classical identity authentication algorithm, and quantum-resistant identity authentication algorithm supported by the target service server. Based on the security policy, it matches the compatibility, security level, and compliance attributes of the classical key exchange algorithm, the quantum-resistant key encapsulation algorithm, the classical identity authentication algorithm, and the quantum-resistant identity authentication algorithm to determine a target algorithm combination that simultaneously satisfies the cryptographic algorithm capabilities and the security policy. When multiple target algorithm combinations exist, it selects one target algorithm combination from the multiple target algorithm combinations according to a preset priority as the quantum-resistant cryptographic algorithm combination for the second communication session.

4. The transparent proxy smooth upgrade method for a quantum-resistant secure gateway according to claim 3, characterized in that, When generating a quantum-resistant secure session key through hybrid key negotiation based on the aforementioned quantum-resistant cryptographic algorithm combination, the following steps are included: Classical key exchange is performed in the second communication session according to the classical key exchange algorithm in the quantum-resistant cryptographic algorithm combination to obtain the first shared key material; quantum-resistant key encapsulation is performed in the second communication session according to the quantum-resistant key encapsulation algorithm in the quantum-resistant cryptographic algorithm combination to obtain the second shared key material; the first shared key material, the second shared key material, and the session context of the second communication session are input into the key derivation function to generate the quantum-resistant secure session key.

5. The transparent proxy smooth upgrade method for a quantum-resistant secure gateway according to claim 4, characterized in that, When generating a quantum-resistant secure session key based on the aforementioned quantum-resistant cryptographic algorithm combination for hybrid key negotiation, the method further includes: Integrity checks are performed on the first shared key material and the second shared key material respectively. If the first shared key material or the second shared key material is missing or the check is abnormal, the generation of the quantum-resistant session key is prohibited.

6. The transparent proxy smooth upgrade method for a quantum-resistant secure gateway according to claim 1, characterized in that, Establishing a dual-path authentication relationship includes: The traditional cryptographic identity credential is subjected to certificate chain verification to obtain a traditional identity authentication result; the quantum-resistant security gateway obtains a quantum-resistant identity credential corresponding to the target business server from a preset certificate management entity based on the entity identifier information in the traditional cryptographic identity credential; the quantum-resistant identity credential is subjected to certificate chain verification to obtain a quantum-resistant identity authentication result; a first entity identifier is extracted from the traditional cryptographic identity credential, a second entity identifier is extracted from the quantum-resistant identity credential, and a consistency check is performed on the first entity identifier and the second entity identifier.

7. The transparent proxy smooth upgrade method for a quantum-resistant secure gateway according to claim 6, characterized in that, Establishing a dual-path authentication relationship also includes: When both the traditional identity authentication result and the quantum-resistant identity authentication result are verified and the first entity identifier and the second entity identifier meet the consistency condition, the traditional cryptographic identity credential and the quantum-resistant identity credential are bound to the second communication session to establish the dual-path identity authentication relationship.

8. The transparent proxy smooth upgrade method for a quantum-resistant secure gateway according to claim 7, characterized in that, Establishing a dual-path authentication relationship also includes: The quantum-resistant cryptographic algorithm combination, the dual-path authentication relationship, and the session association identifier of the second communication session are bound together to generate a security negotiation context; during the establishment and updating of the second communication session, the received key negotiation information is verified for consistency based on the security negotiation context; when an unexpected change occurs in the quantum-resistant cryptographic algorithm combination, the dual-path authentication relationship, or the session association identifier, the establishment or updating of the second communication session is refused.

9. The transparent proxy smooth upgrade method for a quantum-resistant secure gateway according to claim 1, characterized in that, When switching the second communication session from the current cryptographic security context to the new cryptographic security context, the following is included: During the handover, the current password security context and the new password security context are maintained simultaneously, and session sequence information is set for the business data. The password security context corresponding to the business data is determined according to the session sequence information. The business data before the handover is encrypted using the current password security context, and the business data after the handover is encrypted using the new password security context. When the amount of business data continuously carried by the new password security context reaches a preset data volume threshold, and the encryption and decryption processing of the business data does not encounter any abnormalities, the current password security context is released.

10. The transparent proxy smooth upgrade method for a quantum-resistant secure gateway according to claim 1, characterized in that, Also includes: The second communication session maintains a quantum-resistant security state, which undergoes state transitions sequentially based on capability detection, cryptographic handshake, dual-path authentication, hybrid key establishment, secure transmission, session update, and session termination. When it is detected that the quantum-resistant algorithm is not supported, dual-path authentication fails, key negotiation is abnormal, certificate validity period is abnormal, or cryptographic algorithm version changes, the corresponding security processing strategy is triggered according to the current quantum-resistant security state. When the security processing policy allows rollback, the second communication session is switched to classic security mode and the rollback event is recorded, while keeping the communication state of the first communication session unchanged. When the security processing policy prohibits rollback, the second communication session is terminated.