Secure interaction method and device, off-card equipment, smart card and storage medium

By establishing a secure channel based on post-quantum cryptography algorithms between smart cards and external devices, the security problem of traditional cryptographic algorithms under quantum computer attacks is solved, achieving higher data interaction security and compatibility.

CN121125163APending Publication Date: 2025-12-12CHINA MOBILE COMM LTD RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511095638.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-06
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

The data exchange channels of existing smart cards cannot be guaranteed to be secure in the face of quantum computer attacks, and traditional cryptographic algorithms are no longer sufficient to provide quantum security.

Method used

By employing post-quantum cryptography algorithms, a symmetric key is determined through certificate requests and public key exchange, and a secure channel based on post-quantum cryptography algorithms is established to ensure the security of data interaction between the smart card and external devices.

Benefits of technology

It improves the confidentiality and security of data interaction, can resist quantum computing attacks, adapts to a variety of complex application environments, is compatible with existing smart card technology, and reserves space for technology upgrades.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121125163A_ABST
    Figure CN121125163A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data security, and provides a security interaction method and device, an off-card device, an intelligent card and a storage medium, and the method comprises the steps: initiating a certificate request to the intelligent card, so as to obtain a first password certificate of the intelligent card; wherein the first password certificate comprises a first public key of the smart card; according to the type of the first password certificate of the smart card, determining a mode of establishing a secure channel; determining a symmetric key based on the first public key and the second public key when the mode of establishing the secure channel based on the post quantum cryptography algorithm with the smart card is determined to be adopted; wherein the second public key is a public key of an off-card device stored in the smart card; and according to the symmetric key, establishing a secure channel based on a post-quantum cryptography algorithm between the smart card and the smart card to realize data interaction with the smart card. According to the method, a new interaction process for establishing the secure channel is designed, the secure channel is established by applying the post-quantum cryptography algorithm, and the confidentiality and security in the data interaction process are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data security technology, and in particular to secure interaction methods, devices, external devices, smart cards, and storage media. Background Technology

[0002] Smart cards, as integrated chip-based card devices, are widely used in many critical areas such as identity authentication, electronic payment, and encrypted information transmission. In these applications, the theft or tampering of smart card data can easily lead to serious security problems. Therefore, establishing a reliable secure channel to ensure the secure data exchange between smart cards and external devices is crucial.

[0003] Currently, most secure channel establishment methods rely on traditional cryptographic algorithms. However, with the development of quantum computing technology, quantum computers possess sufficient computing power to threaten existing secure channels based on traditional cryptographic algorithms. This means that the security of smart cards cannot be guaranteed under attacks from quantum computers. Summary of the Invention

[0004] This application provides a secure interaction method, apparatus, external device, smart card, and storage medium to address the problem that interaction channels based on traditional cryptographic algorithms in smart cards lack quantum security in the prior art.

[0005] This application provides a secure interaction method applied to an external device. The secure interaction method includes: initiating a certificate request to a smart card to obtain a first cryptographic certificate of the smart card; wherein the first cryptographic certificate includes a first public key of the smart card; determining a method for establishing a secure channel based on the type of the first cryptographic certificate of the smart card; when it is determined that a secure channel based on a post-quantum cryptography algorithm is to be established with the smart card, determining a symmetric key based on the first public key and a second public key; wherein the second public key is the public key of the external device stored in the smart card; and establishing a secure channel based on a post-quantum cryptography algorithm between the smart card and the smart card based on the symmetric key to realize data interaction with the smart card.

[0006] According to a secure interaction method provided in this application, the method for establishing a secure channel is determined based on the type of the first cryptographic certificate of the smart card, including: when the type of the first cryptographic certificate is a post-quantum cryptographic certificate, determining to adopt a method for establishing a secure channel with the smart card based on a post-quantum cryptographic algorithm.

[0007] According to the secure interaction method provided in this application, after determining the method for establishing a secure channel based on the type of the first cryptographic certificate of the smart card, the method further includes: when the type of the first cryptographic certificate is a cryptographic certificate type other than a post-quantum cryptographic certificate, determining to establish a secure channel with the smart card using a non-post-quantum cryptographic algorithm to achieve data interaction with the smart card.

[0008] According to a secure interaction method provided in this application, a symmetric key is determined based on a first public key and a second public key, comprising: sending first key negotiation data to a smart card, the first key negotiation data including a first signature and a public key in a temporary post-quantum key encapsulation algorithm public-private key pair; wherein the first signature is determined based on first verification information and a second private key corresponding to the second public key; the first verification information is determined based on the public key in the temporary post-quantum key encapsulation algorithm public-private key pair; receiving second key negotiation data from the smart card; the second key negotiation data including ciphertext and a second signature; wherein the second signature is determined based on second verification information and a first private key corresponding to the first public key; the second verification information is determined based on the public key and ciphertext in the temporary post-quantum key encapsulation algorithm public-private key pair; the ciphertext is generated by the smart card using the post-quantum key encapsulation algorithm after successfully verifying the first signature with the second public key; decrypting the ciphertext using a post-quantum key decapsulation algorithm to obtain a shared key, and determining the symmetric key based on the shared key.

[0009] According to a secure interaction method provided in this application, ciphertext is decrypted using a post-quantum key decapsulation algorithm to obtain a shared key, and a symmetric key is determined based on the shared key. The method includes: decrypting ciphertext using a post-quantum key decapsulation algorithm to obtain an initial shared key; verifying a second signature using a first public key and then using the initial shared key as the shared key; determining third verification information based on the public key and the shared key in the public-private key pair of the temporary post-quantum key decapsulation algorithm; and determining the symmetric key based on the third verification information and the shared key.

[0010] According to a secure interaction method provided in this application, the first verification information is a first hash value, and the first key negotiation data is sent to the smart card, including: generating a public-private key pair of a temporary post-quantum key encapsulation algorithm; generating a first random number; determining the first hash value based on the first random number and the public key in the public-private key pair of the temporary post-quantum key encapsulation algorithm; determining a first signature of the first hash value based on the second private key corresponding to the second public key; and sending the first signature, the first random number, and the public-private key pair of the temporary post-quantum key encapsulation algorithm as the first key negotiation data to the smart card.

[0011] According to a secure interaction method provided in this application, after obtaining the first cryptographic certificate of a smart card, the method further includes: determining a certificate verification public key corresponding to the type of the first cryptographic certificate of the smart card; verifying the first cryptographic certificate based on the certificate verification public key; and extracting the first public key of the smart card from the first cryptographic certificate after successful verification.

[0012] According to a secure interaction method provided in this application, before determining the symmetric key based on the first public key and the second public key, the method further includes: directly sending the second public key to the smart card; or, sending a second cryptographic certificate to the smart card so that after the smart card verifies the second cryptographic certificate, it extracts the second public key of the external device from the second cryptographic certificate.

[0013] This application also provides a secure interaction method applied to a smart card. The secure interaction method includes: receiving a certificate request sent by an external device and sending a first cryptographic certificate to the external device; wherein the first cryptographic certificate includes a first public key of the smart card; when establishing a secure channel with the external device based on a post-quantum cryptography algorithm, determining a symmetric key based on the first public key and a second public key; wherein the second public key is the public key of the external device stored in the smart card; and establishing a secure channel with the external device based on a post-quantum cryptography algorithm according to the symmetric key to realize data interaction with the external device.

[0014] According to a secure interaction method provided in this application, after sending the first cryptographic certificate to the external device, the method further includes: when the type of the first cryptographic certificate is a post-quantum cryptographic certificate, establishing a secure channel with the external device based on a post-quantum cryptographic algorithm.

[0015] According to a secure interaction method provided in this application, after sending a first cryptographic certificate to an external device, the method further includes: when the type of the first cryptographic certificate is a cryptographic certificate type other than a post-quantum cryptographic certificate, determining to establish a secure channel with the external device using a non-post-quantum cryptographic algorithm, so as to realize data interaction with the external device.

[0016] According to a secure interaction method provided in this application, a symmetric key is determined based on a first public key and a second public key, comprising: receiving first key negotiation data sent by an external device, the first key negotiation data including a first signature and a public key in a temporary post-quantum key encapsulation algorithm public-private key pair; wherein the first signature is determined based on first verification information and a second private key corresponding to the second public key; the first verification information is determined based on the public key in the temporary post-quantum key encapsulation algorithm public-private key pair; after successfully verifying the first signature using the second public key, generating a shared key and ciphertext using the post-quantum key encapsulation algorithm based on the public key in the temporary post-quantum key encapsulation algorithm public-private key pair; generating a symmetric key based on the shared key and the second verification information; wherein the second verification information is determined based on the public key and ciphertext in the temporary post-quantum key encapsulation algorithm public-private key pair; and determining the symmetric key based on the shared key.

[0017] According to a secure interaction method provided in this application, after generating a symmetric key based on a shared key and second verification information, the method further includes: sending second key negotiation data to an external device; the second key negotiation data includes ciphertext and a second signature; wherein the second signature is determined based on the second verification information and the first private key corresponding to the first public key.

[0018] According to a secure interaction method provided in this application, the second verification information is a second hash value, and the second key negotiation data is sent to an external device, including: generating a second random number; determining the second hash value based on the public key and shared key in the public-private key pair of the first random number, the second random number, and the temporary post-quantum key encapsulation algorithm; the first random number is generated by the external device; determining the second signature of the second hash value based on the first private key corresponding to the first public key; and sending the second random number, the ciphertext, and the second signature as the second key negotiation data to the external device.

[0019] According to a secure interaction method provided in this application, before determining the symmetric key based on the first public key and the second public key, the method further includes: receiving the sent second public key.

[0020] According to a secure interaction method provided in this application, before determining the symmetric key based on the first public key and the second public key, the method further includes: receiving a second cryptographic certificate sent by an external device; and after verifying the second cryptographic certificate, extracting the second public key of the external device from the second cryptographic certificate.

[0021] This application also provides a secure interaction device deployed on an external device. The secure interaction device includes: a request sending module, used to initiate a certificate request to the smart card to obtain a first cryptographic certificate of the smart card; wherein the first cryptographic certificate includes a first public key of the smart card; a certificate type determination module, used to determine the method of establishing a secure channel based on the type of the first cryptographic certificate of the smart card; a first symmetric key module, used to determine a symmetric key based on the first public key and a second public key when it is determined that a secure channel based on a post-quantum cryptography algorithm is to be established with the smart card; wherein the second public key is the public key of the external device stored in the smart card; and a first secure channel module, used to establish a secure channel based on a post-quantum cryptography algorithm between the smart card and the smart card according to the symmetric key, so as to realize data interaction with the smart card.

[0022] This application also provides a secure interaction device deployed on a smart card. The secure interaction device includes: a request receiving module, used to receive a certificate request sent by an external device and send a first cryptographic certificate to the external device; wherein the first cryptographic certificate includes a first public key of the smart card; a second symmetric key module, used to determine a symmetric key based on the first and second public keys when establishing a secure channel with the external device based on a post-quantum cryptography algorithm; wherein the second public key is the public key of the external device stored in the smart card; and a second secure channel module, used to establish a secure channel with the external device based on a post-quantum cryptography algorithm according to the symmetric key, so as to realize data interaction with the external device.

[0023] This application also provides an external device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement any of the secure interaction methods described above.

[0024] This application also provides a smart card, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement any of the secure interaction methods described above.

[0025] This application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the secure interaction method as described above.

[0026] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the secure interaction method as described above.

[0027] This application provides a secure interaction method, apparatus, external device, smart card, and storage medium. The method includes: initiating a certificate request to the smart card to obtain a first cryptographic certificate of the smart card; wherein the first cryptographic certificate includes a first public key of the smart card; determining the method for establishing a secure channel based on the type of the first cryptographic certificate of the smart card; when it is determined that a secure channel based on a post-quantum cryptographic algorithm is to be established with the smart card, determining a symmetric key based on the first public key and a second public key; wherein the second public key is the public key of the external device stored in the smart card; and establishing a secure channel based on a post-quantum cryptographic algorithm between the smart card and the smart card based on the symmetric key to realize data interaction with the smart card. Through the above method, this application can determine the method for establishing a secure channel based on the type of the first cryptographic certificate of the smart card, and designs a new interaction process for establishing a secure channel. It can use a post-quantum cryptographic algorithm to construct a secure channel, enhancing the reliability of secure communication, resisting new attack threats such as quantum computing, and improving the confidentiality and security during data interaction. Attached Figure Description

[0028] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 This is one of the flowcharts illustrating the secure interaction method provided in the embodiments of this application.

[0030] Figure 2 This is the second flowchart illustrating the secure interaction method provided in the embodiments of this application.

[0031] Figure 3 This is a flowchart illustrating the initial retrieval process in the secure interaction method provided in this application embodiment.

[0032] Figure 4 This is a schematic diagram of the process of importing a secure public key in the secure interaction method provided in the embodiments of this application.

[0033] Figure 5 This is a schematic diagram of the secure channel key negotiation process in the secure interaction method provided in the embodiments of this application.

[0034] Figure 6 This is one of the structural schematic diagrams of the secure interaction device provided in the embodiments of this application.

[0035] Figure 7 This is the second structural schematic diagram of the secure interaction device provided in the embodiments of this application.

[0036] Figure 8 This is a schematic diagram of the physical structure of the external device provided in the embodiments of this application. Detailed Implementation

[0037] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0038] With the rapid development of quantum computers, their ability to crack cryptographic algorithms has significantly improved. To ensure the security of smart card-related services, this application provides a secure interaction method that can transition scenarios using traditional cryptographic algorithms to those using post-quantum cryptographic algorithms. Based on the characteristics of post-quantum cryptographic algorithms, this application designs a new process for establishing a secure channel between an external device and a smart card, providing a guarantee for further enhancing the security of interactions between external devices and smart cards.

[0039] The secure interaction method of this application may specifically involve two modules: smart card and off-card entity (OCE).

[0040] The smart card can include SIM cards, financial cards, general-purpose IC cards, and other types of cards that can interact with external devices via APDU (Application Protocol Data Unit) commands. The external device can be any device that can interact with the smart card via APDU commands. Both the smart card and the external device should support post-quantum cryptography algorithms, which are public-key cryptographic algorithms resistant to quantum computer attacks.

[0041] Please see Figure 1 , Figure 1 This is one of the flowcharts illustrating the secure interaction method provided in this application embodiment. In this embodiment, the secure interaction method is applied to an external device and may include steps S110 to S120, each step of which is as follows: S110: Initiate a certificate request to the smart card to obtain the first cryptographic certificate of the smart card; wherein the first cryptographic certificate includes the first public key of the smart card.

[0042] First, the external device sends a certificate request command to the smart card, triggering the smart card to return its first cryptographic certificate. This first cryptographic certificate contains the smart card's first public key, which serves as the key identifier and encryption basis for the smart card, providing the smart card's public key information for the subsequent establishment of a secure channel.

[0043] S120: Determine the method for establishing a secure channel based on the type of the first cryptographic certificate of the smart card.

[0044] Based on the type of the first cryptographic certificate obtained from the smart card, the external device analyzes and determines the method for establishing a secure channel with the smart card. Different certificate types correspond to different encryption mechanisms and security policies; by identifying the certificate type, the appropriate secure channel establishment method can be flexibly adapted.

[0045] S130: When it is determined that a secure channel based on a post-quantum cryptography algorithm is to be established with the smart card, a symmetric key is determined based on a first public key and a second public key; wherein the second public key is the public key of an external device stored in the smart card.

[0046] When it is determined that a secure channel will be established using a post-quantum cryptography algorithm, the external device and the smart card negotiate parameters. This includes exchanging the public key parameters, random numbers, and other necessary initialization parameters required by the post-quantum cryptography algorithm. Based on these parameters, both parties perform key negotiation using the post-quantum cryptography algorithm. During this process, the external device uses the smart card's first public key and its own stored second public key to calculate the symmetric key through the key negotiation mechanism of the post-quantum cryptography algorithm.

[0047] The second public key is stored on the smart card during the security configuration process, ensuring that both parties possess each other's public key information for secure communication. The symmetric key will be used for subsequent encryption and decryption of data within the secure channel.

[0048] S140: Establish a secure channel with the smart card based on a post-quantum cryptography algorithm using a symmetric key to enable data interaction with the smart card.

[0049] Finally, based on the determined symmetric key, a secure channel based on post-quantum cryptography is constructed between the smart card and the external device. This secure channel is used for subsequent data interaction, thereby ensuring the confidentiality and integrity of the data interaction process in a quantum computing environment.

[0050] Specifically, the external device sends a secure channel activation request to the smart card. The smart card verifies the validity and integrity of the request and then activates the secure channel. Alternatively, the smart card sends a secure channel activation request to the external device, which verifies the validity and integrity of the request and then activates the secure channel. At this point, a secure channel is formally established between the smart card and the external device, and both parties can begin secure data interaction based on post-quantum cryptography algorithms.

[0051] During data interaction, all transmitted data will be encrypted and decrypted through this secure channel to ensure the confidentiality and integrity of the data during transmission, thereby effectively resisting quantum computing attacks and other potential security threats.

[0052] Through the above methods, this application embodiment can utilize post-quantum cryptography algorithms to construct secure channels, effectively addressing potential security risks arising from the future development of quantum computing technology. Compared to other cryptographic algorithms, it significantly improves the confidentiality and integrity of data interaction. Furthermore, this application embodiment determines the secure channel establishment method based on the type of the smart card's first cryptographic certificate. This allows for flexible selection of appropriate and reliable communication security measures according to different scenarios and smart card characteristics, adapting to various complex application environments and device combinations. Moreover, it satisfies compatibility and scalability, enabling secure interaction by introducing post-quantum cryptography algorithms and implementing corresponding certificate processing and key negotiation mechanisms on the basis of existing smart card technology. This ensures good compatibility with current smart cards and external devices while reserving space for future upgrades and expansions of cryptographic technologies.

[0053] It should also be noted that the relevant schemes, when designing the secure channel establishment process, did not take into account the characteristics of post-quantum cryptography algorithms, such as longer key lengths and output results compared to traditional public-key cryptography algorithms, and the inability to use the same public-private key pair for signatures and key encapsulation. Therefore, it is not suitable to directly improve quantum security by replacing the traditional public-key algorithms defined in the specification with post-quantum cryptography algorithms.

[0054] Based on this, since the public key length and the generated result length of the post-quantum algorithm are relatively large, the embodiments of this application redesign the key negotiation process to ensure security while minimizing the amount of data that needs to be exchanged during the establishment of a secure channel between the external device and the smart card, and also to minimize the number of times the smart card executes the post-quantum algorithm.

[0055] Based on any of the above embodiments, the step of determining the method for establishing a secure channel according to the type of the first cryptographic certificate of the smart card may specifically include: When the type of the first cryptographic certificate is a post-quantum cryptographic certificate, the method of establishing a secure channel based on the post-quantum cryptographic algorithm with the smart card is determined.

[0056] In this embodiment, after obtaining the first cryptographic certificate of the smart card, the external device first identifies the certificate type. Different certificate types correspond to different encryption mechanisms and security features. The external device can accurately determine the type of cryptographic certificate currently used by the smart card based on predefined certificate type identification rules.

[0057] When the type of the first cryptographic certificate is identified as a post-quantum cryptographic certificate, the external device determines to establish a secure channel with the smart card based on the post-quantum cryptographic algorithm.

[0058] Post-quantum cryptography certificates refer to digital certificates generated based on post-quantum cryptography algorithms. Optionally, a post-quantum cryptography certificate includes the smart card's public key, certificate holder information, and the certificate authority's digital signature. The public key, corresponding to the private key, is stored on the smart card for encryption and authentication.

[0059] Based on any of the above embodiments, the steps following determining the method for establishing a secure channel according to the type of the first cryptographic certificate of the smart card may further include: When the type of the first cryptographic certificate is other than the post-quantum cryptographic certificate, a non-post-quantum cryptographic algorithm is used to establish a secure channel with the smart card to achieve data interaction with the smart card.

[0060] In this embodiment, after determining the method for establishing a secure channel, the process enters the branch for processing non-post-quantum cryptographic certificate types. Specifically, when the external device parses the smart card's first cryptographic certificate and determines that its type is not a post-quantum cryptographic certificate, but rather another traditional cryptographic certificate type, such as a certificate based on traditional cryptographic algorithms like ECC (Elliptic Curve Cryptography), the corresponding adaptation mechanism will be activated.

[0061] The external device uses a non-post-quantum cryptographic algorithm that matches the traditional cryptographic algorithms of smart cards to build a secure channel. For example, based on the traditional public-key cryptography ECC method, asymmetric public-private key pairs are pre-set on both the external device and the smart card. A session key is negotiated between the external device and the smart card through key negotiation, and a secure channel is established based on this session key.

[0062] When modifying existing smart cards, they can be categorized into two types: those supporting post-quantum cryptography algorithms (including signature algorithms and key encapsulation algorithms) and those not supporting post-quantum cryptography algorithms. Both types must be compatible with traditional cryptographic algorithms. For smart cards not supporting post-quantum cryptography algorithms, existing standards can be followed to establish a secure channel with external devices based on traditional cryptographic algorithms. For smart cards supporting post-quantum cryptography algorithms, the secure channel can be established with external devices using the method designed in this application's embodiments, or by using existing standard methods based on traditional cryptographic algorithms.

[0063] Correspondingly, external devices can also be categorized into those supporting post-quantum cryptography algorithms (signature algorithms, key encapsulation algorithms) and those not supporting post-quantum cryptography algorithms, but both should support traditional cryptographic algorithms. When both the external device and the smart card support post-quantum cryptography algorithms, the method designed in the embodiments of this application can be used to establish a secure channel with the smart card.

[0064] The above embodiments achieve compatibility with existing smart cards, enabling external devices to seamlessly interface with a large number of deployed smart cards based on traditional cryptographic algorithms. It should be noted that "traditional cryptographic algorithms" here refers to public-key cryptography algorithms that are vulnerable to quantum computer attacks, as well as symmetric cryptography algorithms.

[0065] It should also be noted that, since the different certificate types in this application correspond to the establishment methods of secure channels, space can also be reserved for future upgrades and expansions of cryptographic technologies.

[0066] Based on any of the above embodiments, the step of determining the symmetric key based on the first public key and the second public key may specifically include: Send first key negotiation data to the smart card. The first key negotiation data includes a first signature and the public key in the public-private key pair of the temporary post-quantum key encapsulation algorithm. The first signature is determined based on the first verification information and the second private key corresponding to the second public key. The first verification information is determined based on the public key in the public-private key pair of the temporary post-quantum key encapsulation algorithm. Receive second key negotiation data from the smart card. The second key negotiation data includes ciphertext and a second signature. The second signature is determined based on the second verification information and the first private key corresponding to the first public key. The second verification information is determined based on the public key and ciphertext in the public-private key pair of the temporary post-quantum key encapsulation algorithm. The ciphertext is generated by the smart card using the post-quantum key encapsulation algorithm after successfully verifying the first signature with the second public key. Decrypt the ciphertext using the post-quantum key decapsulation algorithm to obtain the shared key, and determine the symmetric key based on the shared key.

[0067] An external device sends first key negotiation data to the smart card, including a first signature and the public key from a public-private key pair of a temporary post-quantum key encapsulation algorithm. The generation of the first signature involves first verification information and a second private key corresponding to the second public key. The first verification information itself is determined based on the public key from the public-private key pair of the temporary post-quantum key encapsulation algorithm, aiming to provide verifiable information to the smart card and ensure the integrity and reliability of the negotiation process.

[0068] After receiving the first key negotiation data, the smart card first verifies the first signature using the second public key. If the verification is successful, it indicates that the first key negotiation data has not been tampered with and its source is trustworthy. Subsequently, the smart card uses a post-quantum key encapsulation algorithm, based on the public key in the temporary post-quantum key encapsulation algorithm's public-private key pair and its own generated ciphertext, to determine the second verification information. The smart card then returns the second key negotiation data, composed of the ciphertext and the second signature, to the external device. The second signature, determined based on the second verification information and the first private key corresponding to the first public key, is used to prove its identity and data integrity to the external device.

[0069] After receiving the second key negotiation data from the smart card, the external device uses a post-quantum key decapsulation algorithm to decrypt the ciphertext, thereby obtaining the shared key. The shared key is a crucial element for subsequent secure communication. Based on the shared key, the external device determines the symmetric key used for data encryption and decryption operations through a specific key derivation function or by directly using it as the symmetric key. This step marks the completion of the key negotiation process, and both parties have jointly determined the symmetric key used for the secure channel.

[0070] The above methods ensure the security of communication between the smart card and external devices by using post-quantum cryptography algorithms for key negotiation and signature verification.

[0071] Based on any of the above embodiments, the steps of decrypting the ciphertext using a post-quantum key decapsulation algorithm to obtain a shared key, and determining the symmetric key based on the shared key, may specifically include: The ciphertext is decrypted using a post-quantum key decapsulation algorithm to obtain the initial shared key. After the second signature is successfully verified using the first public key, the initial shared key is used as the shared key. The third verification information is determined based on the public key and the shared key in the public-private key pair of the temporary post-quantum key decapsulation algorithm. The symmetric key is determined based on the third verification information and the shared key.

[0072] In this embodiment, after receiving the second key negotiation data returned by the smart card, the external device decrypts the ciphertext using a post-quantum key decapsulation algorithm. This ciphertext is generated by the smart card using the post-quantum key decapsulation algorithm after successfully verifying the first signature. Upon successful decryption, the external device obtains the initial shared key. This initial shared key is the crucial foundation for subsequently determining the symmetric key; it carries the core confidential information agreed upon by both parties.

[0073] The external device uses the first public key to verify the second signature returned by the smart card. The generation of the second signature involves second verification information and the first private key corresponding to the first public key. The second verification information is determined based on the public key and ciphertext in the public-private key pair using a temporary post-quantum key encapsulation algorithm. By verifying the second signature, the external device can verify the legitimacy of the smart card and the integrity of the returned data, ensuring that the negotiation process has not been subjected to man-in-the-middle attacks or other tampering.

[0074] After successful verification of the second signature, the external device confirms the initial shared key as a valid shared key. Next, based on the public key and shared key in the temporary post-quantum key encapsulation algorithm's public-private key pair, the external device determines the third verification information through specific algorithms or logical operations. The generation of the third verification information integrates the two key elements of the temporary public key and the shared key, further enhancing the security and attack resistance of the key negotiation process. Based on the third verification information and the shared key, the external device uses specific key derivation functions or algorithms to finally determine the symmetric key used for secure communication. This step organically integrates the third verification information and the shared key to generate a highly secure and unique symmetric key for subsequent data encryption and decryption operations between the smart card and the external device.

[0075] In summary, this embodiment effectively defends against various security threats through multi-layered signature verification and encryption / decryption operations. The second signature verification process authenticates the smart card, ensuring that the smart card communicating with external devices is legitimate. The introduction of the third verification information increases the complexity of the key negotiation process, ensuring data integrity during key negotiation and thus enhancing the security of the entire key negotiation process.

[0076] Based on any of the above embodiments, where the first verification information is a first hash value, the step of sending the first key negotiation data to the smart card may specifically include: Generate a public-private key pair for the temporary post-quantum key encapsulation algorithm; generate a first random number; determine a first hash value based on the first random number and the public key in the temporary post-quantum key encapsulation algorithm public-private key pair; determine a first signature of the first hash value based on the second private key corresponding to the second public key; and send the first signature, the first random number, and the temporary post-quantum key encapsulation algorithm public-private key pair as first key negotiation data to the smart card.

[0077] The external device first generates a temporary public-private key pair for the post-quantum key encapsulation algorithm, ensuring the randomness and unpredictability of the key.

[0078] To increase the uncertainty and security of the key negotiation process, an external device generates a first random number. This first random number is used in subsequent steps to generate a first hash value as part of the verification information, ensuring the uniqueness and non-repeatability of each key negotiation.

[0079] Based on the first random number and the public key in the public-private key pair of the temporary post-quantum key encapsulation algorithm, the external device calculates and determines the first hash value. The hash function takes the first random number and the public key as input, and the output is the first hash value that can be used as the first verification information.

[0080] The external device uses the second private key corresponding to the second public key to sign the first hash value, generating a first signature. The hash value is then encrypted using the private key, and the generated signature can be verified by the smart card holding the corresponding public key. This step ensures the reliability of the first hash value's source and the integrity of the data.

[0081] Finally, the external device combines the first signature, the first random number, and the public key from the public-private key pair of the temporary post-quantum key encapsulation algorithm into the first key negotiation data, and sends it to the smart card. In other words, the external device completes the initialization of the key negotiation process and provides the smart card with all the necessary information so that the smart card can perform subsequent verification and response.

[0082] Based on any of the above embodiments, the steps following obtaining the first cryptographic certificate of the smart card may further include: Determine the certificate verification public key corresponding to the type of the first cryptographic certificate of the smart card; verify the first cryptographic certificate based on the certificate verification public key; after successful verification, extract the first public key of the smart card from the first cryptographic certificate.

[0083] After obtaining the initial cryptographic certificate for the smart card, the external device needs to determine the certificate verification public key corresponding to that certificate type. Different cryptographic certificate types may use different signature algorithms and public key formats. Using the determined certificate verification public key, the external device verifies the initial cryptographic certificate. Verification may include digital signature verification, certificate validity checks, etc.

[0084] Once the first cryptographic certificate passes the verification steps described above, the external device extracts the smart card's first public key from the certificate. This first public key is the core of the certificate and is used for subsequent secure communication. The certificate verification process is essentially a confirmation of the smart card's identity. By verifying the certificate, the external device can be certain that it is communicating with the correct, authenticated smart card, ensuring the legitimacy and trustworthiness of transactions and operations.

[0085] Based on any of the above embodiments, the steps prior to determining the symmetric key based on the first public key and the second public key may further include: Send the second public key directly to the smart card; or send the second cryptographic certificate to the smart card so that the smart card can extract the second public key of the external device from the second cryptographic certificate after the smart card verifies the second cryptographic certificate.

[0086] The second public key stored in the smart card can be sent directly to the smart card via an external device, or it can be extracted from the second cryptographic certificate after the second cryptographic certificate sent by the smart card has been verified.

[0087] The second cryptographic certificate is a digital certificate for the external device, which includes the external device's second public key, identity information, and digital signature of the Certificate Authority (CA). It can be used by the smart card to verify the legitimacy of the external device's public key when the smart card communicates with the external device.

[0088] In some embodiments, the smart card may also be pre-loaded with a second public key from an external device before leaving the factory.

[0089] This application also provides a secure interaction method applied to a smart card. The parts that are the same as those in the above-described external device-side embodiments will not be repeated here; this embodiment will focus on the processing content on the smart card side.

[0090] Please see Figure 2 , Figure 2 This is a second schematic flowchart of the secure interaction method provided in this application embodiment. In this embodiment, the secure interaction method may include steps S210 to S230, each step of which is as follows: S210: Receive a certificate request sent by an external device and send a first cryptographic certificate to the external device; wherein the first cryptographic certificate includes the first public key of the smart card.

[0091] S220: When establishing a secure channel with an external device based on a post-quantum cryptography algorithm, a symmetric key is determined based on a first public key and a second public key; wherein the second public key is the public key of the external device stored in the smart card.

[0092] S230: Establish a secure channel based on post-quantum cryptography algorithm between the card and the external device using a symmetric key to enable data interaction with the external device.

[0093] Upon receiving a certificate request from an external device, the smart card responds and sends its first cryptographic certificate to the external device. When the smart card and the external device agree to establish a secure channel based on post-quantum cryptography, the smart card uses its own first public key and the pre-stored second public key of the external device to determine the symmetric key. The determination of the symmetric key typically involves a key negotiation mechanism within the post-quantum cryptography algorithm, ensuring that only the smart card and the external device can calculate the same symmetric key using their respective public and private key pairs. Using the determined symmetric key, the smart card and the external device jointly establish a secure channel based on post-quantum cryptography. After the secure channel is established, the smart card interacts with the external device through this channel, ensuring the confidentiality and integrity of data transmission.

[0094] Through the above methods, the embodiments of this application can use post-quantum cryptography algorithms to construct secure channels, thereby improving the confidentiality and security of data interaction.

[0095] In some embodiments, when the type of the first cryptographic certificate is a post-quantum cryptographic certificate, a secure channel based on a post-quantum cryptographic algorithm is established with the external device.

[0096] In some embodiments, when the type of the first cryptographic certificate is a cryptographic certificate other than a post-quantum cryptographic certificate, it is determined that a non-post-quantum cryptographic algorithm is used to establish a secure channel with the external device in order to realize data interaction with the external device.

[0097] Based on any of the above embodiments, the step of determining the symmetric key based on the first public key and the second public key may specifically include: The system receives first key negotiation data sent by an external device. This data includes a first signature and a public key from a temporary post-quantum key encapsulation algorithm public-private key pair. The first signature is determined based on first verification information and a second private key corresponding to the second public key. The first verification information is determined based on the public key from the temporary post-quantum key encapsulation algorithm public-private key pair. After successfully verifying the first signature using the second public key, a shared key and ciphertext are generated using the post-quantum key encapsulation algorithm based on the public key from the temporary post-quantum key encapsulation algorithm public-private key pair. A symmetric key is generated based on the shared key and the second verification information. The second verification information is determined based on the public key and ciphertext from the temporary post-quantum key encapsulation algorithm public-private key pair. The symmetric key is then determined based on the shared key.

[0098] The smart card receives first key negotiation data sent by an external device, which includes a first signature and the public key from a temporary post-quantum key encapsulation algorithm public-private key pair. The first signature is generated by the external device based on first verification information and the second private key corresponding to the second public key, and is used to verify the integrity and reliability of the source of the first key negotiation data.

[0099] The smart card uses the second public key to verify the first signature. If the verification is successful, it indicates that the first key negotiation data has not been tampered with and its source is trustworthy. The smart card can then be certain that it is communicating with a legitimate off-card device.

[0100] Based on the public key in the public-private key pair of the temporary post-quantum key encapsulation algorithm, the smart card uses the post-quantum key encapsulation algorithm to generate a shared key and ciphertext. This step is a crucial part of the key negotiation process; the shared key will be used for subsequent symmetric encrypted communication, while the ciphertext will be used to transmit necessary information to external devices.

[0101] The smart card generates a symmetric key based on a shared key and second verification information. The second verification information is determined by the public key in the public-private key pair from the temporary post-quantum key encapsulation algorithm and the generated ciphertext, and is used to increase the complexity and security of the symmetric key generation process.

[0102] Based on any of the above embodiments, the steps following the generation of the symmetric key according to the shared key and the second verification information may further include: Send second key negotiation data to an external device; the second key negotiation data includes ciphertext and a second signature; wherein the second signature is determined based on second verification information and a first private key corresponding to a first public key.

[0103] After generating the symmetric key, the smart card prepares second key negotiation data, which includes the previously generated ciphertext and the newly generated second signature. This process is an important feedback step in the entire key negotiation process, ensuring that external devices can verify the smart card's operation and ultimately establish a symmetric key that is agreed upon by both parties.

[0104] The smart card uses a first private key corresponding to a first public key, and generates a second signature based on second verification information. This process authenticates the smart card's identity, ensuring its legitimacy and data integrity. External devices can verify this signature to confirm the smart card's identity and ensure that data has not been tampered with during key negotiation.

[0105] The smart card sends second key negotiation data, containing ciphertext and a second signature, to the external device. This means the smart card has completed the generation of the symmetric key and is ready to share the necessary information with the external device to establish secure communication.

[0106] Based on any of the above embodiments, where the second verification information is a second hash value, the step of sending the second key negotiation data to the external device may specifically include: Generate a second random number; determine a second hash value based on the public key and shared key in the public-private key pair of the first random number, the second random number, and the temporary post-quantum key encapsulation algorithm; the first random number is generated by an external device; determine a second signature of the second hash value based on the first private key corresponding to the first public key; send the second random number, ciphertext, and second signature as second key negotiation data to the external device.

[0107] The smart card generates a second random number. This second random number is used in subsequent steps to generate a second hash value, which serves as part of the verification information, ensuring the uniqueness and non-repeatability of each key negotiation.

[0108] The smart card determines its second hash value based on a first random number generated by an external device, a second random number generated by the card itself, the public key in the public-private key pair of the temporary post-quantum key encapsulation algorithm, and the previously negotiated shared key. The hash function takes the first random number, the second random number, the public key, and the shared key as input, and outputs a second hash value that can be used as the second verification information.

[0109] The smart card uses the first private key corresponding to the first public key to sign the second hash value, generating a second signature. This process can be implemented using an asymmetric encryption algorithm, ensuring that only the smart card holding the corresponding private key can generate a valid signature, thereby guaranteeing the reliability and integrity of the data source.

[0110] The smart card combines the second random number, the previously generated ciphertext, and the second signature into second key negotiation data and sends it to the external device. In this step, the smart card completes the feedback loop of the entire key negotiation process, providing the external device with the necessary information so that the external device can verify the smart card's operation and ultimately determine the symmetric key.

[0111] Based on any of the above embodiments, the steps prior to determining the symmetric key based on the first public key and the second public key may further include: Receive the second public key that has been sent.

[0112] Before a smart card can determine its symmetric key based on the first and second public keys, it must first receive the second public key. Specifically, the external device sends the second public key to the smart card, which then retrieves it through a specific receiving mechanism and stores it in its secure storage area. This process is a prerequisite for the smart card to use the second public key for subsequent key negotiation and symmetric key determination, ensuring that the smart card possesses the public key information required for secure communication with external devices.

[0113] In some embodiments, the smart card may also be pre-loaded with a second public key from an external device before leaving the factory.

[0114] In some embodiments, the smart card may also obtain the second public key from a device other than the card-related device described above.

[0115] Based on any of the above embodiments, the steps prior to determining the symmetric key based on the first public key and the second public key may further include: Receive the second cryptographic certificate sent by the external device; after verifying the second cryptographic certificate, extract the second public key of the external device from the second cryptographic certificate.

[0116] In this embodiment, the smart card can also receive a second cryptographic certificate sent by an external device. The smart card verifies the second cryptographic certificate, including verifying the digital signature, checking the certificate's validity period and revocation status, etc. If the second cryptographic certificate is verified successfully, the smart card extracts the external device's second public key from the certificate.

[0117] To more clearly illustrate the secure interaction method proposed in this application, an example based on the overall system is given below for reference. Furthermore, since the following embodiments use many abbreviations, their definitions and explanations are provided first: PK: Public Key; SK: Private key; Hash: Hash algorithm; KEM: Key-Encapsulation Mechanism; Sig: Digital Signature; ePK: Ephemeral Public Key; eSK: Ephemeral Private Key; AEAD: Authenticated Encryption with Associated Data; KDF: Key Derivation Function.

[0118] In this embodiment, the secure interaction method can be roughly divided into three processes: initial retrieval process, secure public key import, and secure channel key negotiation.

[0119] The external device and smart card should have the signature certificate verification public key PK.CA.Sig pre-installed before leaving the factory, or loaded after leaving the factory through other secure methods. The signature certificate verification public key PK.CA.Sig is used to verify the legitimacy of the signature certificate received by the external device or smart card from an external source. The signature certificate verification public key PK.CA.Sig can be considered as the certificate verification public key in the above embodiments.

[0120] Please see Figure 3 , Figure 3 This is a flowchart illustrating the initial retrieval process in the secure interaction method provided in this application embodiment. The detailed steps are as follows: (1) The external device first initiates a certificate request from the smart card to obtain the static signature public key certificate of the smart card. The static signature public key certificate can be used as the first cryptographic certificate.

[0121] (2) After receiving the “get data” request, the smart card sends the static signature public key certificate stored in the card as response data to the external device.

[0122] (3) Based on the static signature public key certificate type of the smart card, the external device can select a suitable signature certificate to verify the public key PK.CA.Sig to verify the static signature public key certificate. After successful verification, the smart card static signature public key PK.SD.Sig is extracted and step (4) is performed. Among them, the smart card static signature public key PK.SD.Sig can be used as the first public key.

[0123] (4) The external device determines the certificate type based on the received smart card static signature public key certificate. The traditional cryptographic certificate type (case 4-1) or the post-quantum cryptographic certificate type (case 4-2) are selected as follows: (4-1) If the certificate is a traditional cryptographic certificate type, the external device will choose to use the existing secure channel establishment method to negotiate the secure channel key with the smart card. For example, if the public key carried in the certificate is a traditional public key, the traditional method will still be used to negotiate the secure channel key.

[0124] (4-2) If the certificate type is post-quantum cryptography (i.e. the public key carried in the certificate is a post-quantum signature public key), and the external device also supports the post-quantum cryptography algorithm, then a secure channel is established with the smart card based on the post-quantum cryptography algorithm.

[0125] After the external device confirms that it can establish a secure channel with the smart card based on the post-quantum cryptography algorithm through the above steps, it needs to import the external device's secure public key into the smart card. There are three methods for importing this key: Method 1: Write a static signature public key certificate (i.e., a second cryptographic certificate) into the card. After the smart card verifies that the certificate is correct, extract the static signature public key PK.OCE.Sig (i.e., the second public key) from the external device. Method 2: Directly write the static signature public key PK.OCE.Sig to the external device; Method 3: The smart card has a pre-installed external device static signature public key PK.OCE.Sig before leaving the factory.

[0126] Method 3 can be understood as executing Method 2 during the card production process, and its workflow is the same as Method 2. The choice between Method 1 and Method 2 depends on the current security strategy.

[0127] Please see Figure 4 , Figure 4 This is a flowchart illustrating the import of a secure public key in the secure interaction method provided in this application embodiment. The detailed steps are as follows: (1) Based on the current security policy, select method one or method two to send data to the smart card.

[0128] After verifying the smart card's signature certificate, the external device selects which data to send to the smart card based on different security levels if the smart card supports post-quantum cryptography. Method 1 involves sending the external device's post-quantum static signature public key certificate to the smart card; Method 2 involves providing the external device's post-quantum static signature public key to the smart card.

[0129] (2) The smart card adopts the appropriate method according to the type of data received. Method 1 is to verify the certificate provided by the external device. If the verification is successful, the static signature public key PK.OCE.Sig of the external device is extracted. Method 2 is to directly save the static signature public key PK.OCE.Sig of the external device in the received data.

[0130] (3) The smart card sends a response to the external device, and the external device determines whether the card has successfully saved the external device's static signature public key PK.OCE.Sig based on the response.

[0131] Through the aforementioned process, the external device has obtained the smart card's static signature public key PK.SD.Sig (which is also the smart card's post-quantum static signature public key), and the smart card has obtained the external device's static signature public key PK.OCE.Sig (which is also the external device's post-quantum static signature public key).

[0132] Simultaneously, the external device possesses a static post-quantum algorithm signature public-private key pair (PK.OCE.Sig, SK.OCE.Sig), i.e., a second public key and its corresponding second private key. The smart card possesses a static post-quantum algorithm signature public-private key pair (PK.SD.Sig, SK.SD.Sig), i.e., a second public key and its corresponding second private key. A secure channel can be established based on the post-quantum algorithm through the following secure channel key negotiation method.

[0133] Please see Figure 5 , Figure 5 This is a flowchart illustrating the secure channel key negotiation process in the secure interaction method provided in this application embodiment. The detailed steps are as follows: (1) The external device generates a temporary quantum key encapsulation algorithm public and private key pair (ePK.OCE.KEM, eSK.OCE.KEM).

[0134] (2) The external device generates the first random number r1 and calculates the first hash value h1:=Hash(r1||ePK.OCE.KEM).

[0135] (3) After the external device uses the quantum static signature private key SK.OCE.Sig (i.e. the second private key), it calculates the first signature sig1←SIG (SK.OCE.Sig, h1) of the first hash value h1.

[0136] (4) The external device sends the first signature sig1, the first random number r1 and the temporary post-quantum key encapsulation algorithm public key ePK.OCE.KEM to the smart card.

[0137] (5) The smart card uses the external device's static signature public key PK.OCE.Sig to verify the correctness of the first signature sig1. After successful verification, the post-quantum key encapsulation algorithm (ss,ct)←Encaps(ePK.OCE.KEM) is used to generate the shared key ss and the corresponding ciphertext ct.

[0138] (6) The smart card generates a second random number r2 and calculates the second hash value h2:=Hash(r2||r1||ePK.OCE.KEM||ss).

[0139] (7) After the smart card uses the quantum static signature private key SK.SD.Sig (i.e. the first private key), calculate the second signature sig2←SIG (SK.SD.Sig, h2) of the second hash value h2.

[0140] (8) The smart card uses the KDF algorithm to derive the AEAD symmetric key K:=KDF(ss,h2).

[0141] (9) The smart card sends the second random number r2, the ciphertext ct, and the second signature sig2 as a response to the external device.

[0142] (10) After the external device uses the quantum key decapsulation algorithm, decrypt (ss')=Decaps(eSK.OCE.KEM,ct) to obtain the shared key ss'.

[0143] (11) The external device calculates the third hash value h3:=Hash(r2||r1||ePK.OCE.KEM||ss') and uses the public key PK.SD.Sig to verify the signature sig2. If the verification is successful, then ss'=ss. The third hash value can be used as the third verification information mentioned above.

[0144] (12) The external device derives the AEAD symmetric key K':=KDF(ss',h3) using the KDF algorithm. If the derivation is correct, then K'=K.

[0145] (13) Based on the symmetric key K, the external device and the smart card can use the AEAD algorithm to protect their interaction.

[0146] In summary, this application embodiment improves the quantum security of establishing a secure channel between the external device and the smart card based on the post-quantum cryptography algorithm. Furthermore, this application embodiment redesigns the key negotiation process, which, while ensuring security, minimizes the amount of data that needs to be exchanged during the establishment of a secure channel between the external device and the smart card, and also minimizes the number of times the smart card executes the post-quantum algorithm, thereby improving the confidentiality and security of the data interaction process.

[0147] The secure interaction device provided in this application is described below. The secure interaction device described below can be referred to in correspondence with the secure interaction method described above.

[0148] This application also provides a secure interaction device deployed on an off-card device. Please refer to [link / reference]. Figure 6 , Figure 6 This is one of the structural schematic diagrams of the secure interaction device provided in the embodiments of this application. In this embodiment, the secure interaction device may include a request sending module 610, a certificate type judgment module 620, a first symmetric key module 630, and a first secure channel module 640.

[0149] The request sending module 610 is used to initiate a certificate request to the smart card in order to obtain the first cryptographic certificate of the smart card; wherein the first cryptographic certificate includes the first public key of the smart card.

[0150] The certificate type determination module 620 is used to determine the method for establishing a secure channel based on the type of the first password certificate of the smart card.

[0151] The first symmetric key module 630 is used to determine a symmetric key based on a first public key and a second public key when it is determined that a secure channel based on a post-quantum cryptography algorithm is to be established with the smart card; wherein the second public key is the public key of an external device stored in the smart card.

[0152] The first secure channel module 640 is used to establish a secure channel with the smart card based on a post-quantum cryptography algorithm according to the symmetric key, so as to realize data interaction with the smart card.

[0153] Based on any of the above embodiments, the certificate type determination module 620 is specifically used for: When the type of the first cryptographic certificate is a post-quantum cryptographic certificate, the method of establishing a secure channel based on the post-quantum cryptographic algorithm with the smart card is determined.

[0154] Based on any of the above embodiments, the certificate type determination module 620 is specifically used for: When the type of the first cryptographic certificate is other than the post-quantum cryptographic certificate, a non-post-quantum cryptographic algorithm is used to establish a secure channel with the smart card to achieve data interaction with the smart card.

[0155] Based on any of the above embodiments, the first symmetric key module 630 is specifically used for: Send first key negotiation data to the smart card. The first key negotiation data includes a first signature and the public key in the public-private key pair of the temporary post-quantum key encapsulation algorithm. The first signature is determined based on the first verification information and the second private key corresponding to the second public key. The first verification information is determined based on the public key in the public-private key pair of the temporary post-quantum key encapsulation algorithm. Receive second key negotiation data from the smart card. The second key negotiation data includes ciphertext and a second signature. The second signature is determined based on the second verification information and the first private key corresponding to the first public key. The second verification information is determined based on the public key and ciphertext in the public-private key pair of the temporary post-quantum key encapsulation algorithm. The ciphertext is generated by the smart card using the post-quantum key encapsulation algorithm after successfully verifying the first signature with the second public key. Decrypt the ciphertext using the post-quantum key decapsulation algorithm to obtain the shared key, and determine the symmetric key based on the shared key.

[0156] Based on any of the above embodiments, the first symmetric key module 630 is further configured to: The ciphertext is decrypted using a post-quantum key decapsulation algorithm to obtain the initial shared key. After the second signature is successfully verified using the first public key, the initial shared key is used as the shared key. The third verification information is determined based on the public key and the shared key in the public-private key pair of the temporary post-quantum key decapsulation algorithm. The symmetric key is determined based on the third verification information and the shared key.

[0157] Based on any of the above embodiments, the first symmetric key module 630 is further configured to: Generate a public-private key pair for the temporary post-quantum key encapsulation algorithm; generate a first random number; determine a first hash value based on the first random number and the public key in the temporary post-quantum key encapsulation algorithm public-private key pair; determine a first signature of the first hash value based on the second private key corresponding to the second public key; and send the first signature, the first random number, and the temporary post-quantum key encapsulation algorithm public-private key pair as first key negotiation data to the smart card.

[0158] Based on any of the above embodiments, the secure interaction device further includes a first verification module, which can specifically be used for: Determine the certificate verification public key corresponding to the type of the first cryptographic certificate of the smart card; verify the first cryptographic certificate based on the certificate verification public key; after successful verification, extract the first public key of the smart card from the first cryptographic certificate.

[0159] Based on any of the above embodiments, the secure interaction device further includes a second public key sending module, which can specifically be used for: Send the second public key directly to the smart card; or send the second cryptographic certificate to the smart card so that the smart card can extract the second public key of the external device from the second cryptographic certificate after the smart card verifies the second cryptographic certificate.

[0160] This application also provides a secure interaction device deployed on a smart card. Please refer to [link / reference]. Figure 7 , Figure 7 This is a second schematic diagram of the secure interaction device provided in this application embodiment. In this embodiment, the secure interaction device may include a request receiving module 710, a second symmetric key module 720, and a second secure channel module 730.

[0161] The request receiving module 710 is used to receive a certificate request sent by an external device and send a first cryptographic certificate to the external device; wherein the first cryptographic certificate includes the first public key of the smart card; The second symmetric key module 720 is used to determine the symmetric key based on the first public key and the second public key when establishing a secure channel with an external device based on a post-quantum cryptography algorithm; wherein the second public key is the public key of the external device stored in the smart card. The second secure channel module 730 is used to establish a secure channel based on post-quantum cryptography algorithm between the card and the external device according to the symmetric key, so as to realize data interaction with the external device.

[0162] Based on any of the above embodiments, the secure interaction device further includes a channel selection module, which can specifically be used for: When the type of the first cryptographic certificate is a post-quantum cryptographic certificate, a secure channel based on the post-quantum cryptographic algorithm is established with the external device.

[0163] Based on any of the above embodiments, the channel selection module can also be used for: When the type of the first cryptographic certificate is a cryptographic certificate other than a post-quantum cryptographic certificate, a non-post-quantum cryptographic algorithm is used to establish a secure channel with the external device in order to realize data interaction with the external device.

[0164] Based on any of the above embodiments, the second security channel module 730 can specifically be used for: The system receives first key negotiation data sent by an external device. This data includes a first signature and a public key from a temporary post-quantum key encapsulation algorithm public-private key pair. The first signature is determined based on first verification information and a second private key corresponding to the second public key. The first verification information is determined based on the public key from the temporary post-quantum key encapsulation algorithm public-private key pair. After successfully verifying the first signature using the second public key, a shared key and ciphertext are generated using the post-quantum key encapsulation algorithm based on the public key from the temporary post-quantum key encapsulation algorithm public-private key pair. A symmetric key is generated based on the shared key and the second verification information. The second verification information is determined based on the public key and ciphertext from the temporary post-quantum key encapsulation algorithm public-private key pair. The symmetric key is then determined based on the shared key.

[0165] Based on any of the above embodiments, the second security channel module 730 can also be used for: Send second key negotiation data to an external device; the second key negotiation data includes ciphertext and a second signature; wherein the second signature is determined based on second verification information and a first private key corresponding to a first public key.

[0166] Based on any of the above embodiments, the second security channel module 730 can also be used for: Generate a second random number; determine a second hash value based on the public key and shared key in the public-private key pair of the first random number, the second random number, and the temporary post-quantum key encapsulation algorithm; the first random number is generated by an external device; determine a second signature of the second hash value based on the first private key corresponding to the first public key; send the second random number, ciphertext, and second signature as second key negotiation data to the external device.

[0167] Based on any of the above embodiments, the secure interaction device further includes a second public key receiving module, which can be specifically used to: receive the sent second public key.

[0168] Based on any of the above embodiments, the second public key receiving module can also be used to: receive a second cryptographic certificate sent by an external device; and after verifying the second cryptographic certificate, extract the second public key of the external device from the second cryptographic certificate.

[0169] On the other hand, this application also provides an external device, please refer to... Figure 8 , Figure 8 This is a schematic diagram of the physical structure of the external device provided in the embodiments of this application, such as... Figure 8 As shown, the external device may include memory 820, processor 810, and a computer program stored on memory 820 and executable on processor 810. When processor 810 executes the program, it can implement a secure interaction method, which may include: A certificate request is initiated to the smart card to obtain the smart card's first cryptographic certificate, which includes the smart card's first public key. Based on the type of the smart card's first cryptographic certificate, a method for establishing a secure channel is determined. When it is determined that a secure channel based on a post-quantum cryptographic algorithm will be established with the smart card, a symmetric key is determined based on the first and second public keys. The second public key is the public key of an external device stored in the smart card. A secure channel based on a post-quantum cryptographic algorithm is established between the smart card and the smart card using the symmetric key to enable data interaction with the smart card.

[0170] Optionally, the external device may also include a communication bus 830 and a communication interface 840, wherein the processor 810, the communication interface 840, and the memory 820 communicate with each other through the communication bus 830. The processor 810 can call the computer program in the memory 820 to execute the secure interaction methods provided by the above methods.

[0171] Furthermore, the logical instructions in the aforementioned memory 820 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0172] On the other hand, this application also provides a smart card, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements any of the above-mentioned secure interaction methods. The steps and principles of these methods have been described in detail above and will not be repeated here.

[0173] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the secure interaction methods provided by the above methods. The steps and principles of these methods have been described in detail in the above methods and will not be repeated here.

[0174] In another aspect, this application also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the secure interaction methods provided by the above methods. The steps and principles of the above methods have been described in detail and will not be repeated here.

[0175] Non-transitory computer-readable storage media can be any available medium or data storage device that can be accessed by a processor, including but not limited to magnetic storage (e.g., floppy disks, hard disks, magnetic tapes, magneto-optical disks (MOs), etc.), optical storage (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (e.g., ROMs, EPROMs, EEPROMs, non-volatile memory (NAND flash), solid-state drives (SSDs)).

[0176] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0177] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0178] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A secure interaction method, characterized in that, The secure interaction method, applied to external devices, includes: A certificate request is initiated to the smart card to obtain the first cryptographic certificate of the smart card; wherein the first cryptographic certificate includes the first public key of the smart card. The method for establishing a secure channel is determined based on the type of the first cryptographic certificate of the smart card; When it is determined that a secure channel based on a post-quantum cryptography algorithm is to be established with the smart card, a symmetric key is determined based on the first public key and the second public key; wherein the second public key is the public key of the external device stored in the smart card. A secure channel based on a post-quantum cryptography algorithm is established between the symmetric key and the smart card to enable data interaction with the smart card.

2. The secure interaction method according to claim 1, characterized in that, The step of determining the method for establishing a secure channel based on the type of the first cryptographic certificate of the smart card includes: When the first cryptographic certificate is a post-quantum cryptographic certificate, it is determined that a secure channel based on a post-quantum cryptographic algorithm will be established with the smart card.

3. The secure interaction method according to claim 1, characterized in that, After determining the method for establishing a secure channel based on the type of the first cryptographic certificate of the smart card, the method further includes: When the first cryptographic certificate is of a type other than a post-quantum cryptographic certificate, a secure channel is established with the smart card using a non-post-quantum cryptographic algorithm to enable data interaction with the smart card.

4. The secure interaction method according to claim 1, characterized in that, The process of determining the symmetric key based on the first public key and the second public key includes: Send first key negotiation data to the smart card, the first key negotiation data including a first signature and the public key in the public-private key pair of the temporary post-quantum key encapsulation algorithm; wherein the first signature is determined based on first verification information and the second private key corresponding to the second public key; the first verification information is determined based on the public key in the public-private key pair of the temporary post-quantum key encapsulation algorithm; The system receives second key negotiation data from the smart card; the second key negotiation data includes ciphertext and a second signature; wherein the second signature is determined based on second verification information and a first private key corresponding to the first public key; the second verification information is determined based on the public key and ciphertext in the public-private key pair of the temporary post-quantum key encapsulation algorithm; the ciphertext is generated by the smart card using the post-quantum key encapsulation algorithm after the smart card successfully verifies the first signature using the second public key. The ciphertext is decrypted using a post-quantum key decapsulation algorithm to obtain a shared key, and the symmetric key is determined based on the shared key.

5. The secure interaction method according to claim 4, characterized in that, The step of using a post-quantum key decryption algorithm to decrypt the ciphertext, obtain a shared key, and determine the symmetric key based on the shared key includes: The ciphertext was decrypted using a post-quantum key decapsulation algorithm to obtain the initial shared key. After successfully verifying the second signature using the first public key, the initial shared key is used as the shared key. The third verification information is determined based on the public key in the public-private key pair of the temporary post-quantum key encapsulation algorithm and the shared key; The symmetric key is determined based on the third verification information and the shared key.

6. The secure interaction method according to claim 4, characterized in that, The first verification information is a first hash value, and sending the first key negotiation data to the smart card includes: Generate temporary public-private key pairs for the quantum key encapsulation algorithm; Generate the first random number; The first hash value is determined based on the public key in the public-private key pair of the first random number and the temporary post-quantum key encapsulation algorithm; The first signature of the first hash value is determined based on the second private key corresponding to the second public key; The first signature, the first random number, and the public / private key of the temporary post-quantum key encapsulation algorithm are sent to the smart card as the first key negotiation data.

7. The secure interaction method according to any one of claims 1 to 6, characterized in that, After obtaining the first cryptographic certificate of the smart card, the process further includes: Determine the certificate verification public key corresponding to the type of the first cryptographic certificate of the smart card; The first cryptographic certificate is verified using the certificate verification public key. After successful verification, the first public key of the smart card is extracted from the first cryptographic certificate.

8. The secure interaction method according to any one of claims 1 to 6, characterized in that, Before determining the symmetric key based on the first and second public keys, the method further includes: Send the second public key directly to the smart card; Alternatively, a second cryptographic certificate may be sent to the smart card, so that after the smart card verifies the second cryptographic certificate, the second public key of the external device may be extracted from the second cryptographic certificate.

9. A secure interaction method, characterized in that, Applied to smart cards, the secure interaction method includes: The system receives a certificate request from the external device and sends a first cryptographic certificate to the external device; wherein the first cryptographic certificate includes the first public key of the smart card. When establishing a secure channel with the external device based on a post-quantum cryptography algorithm, a symmetric key is determined based on the first public key and the second public key; wherein the second public key is the public key of the external device stored in the smart card. A secure channel based on a post-quantum cryptography algorithm is established between the card and the external device using the symmetric key to enable data interaction with the external device.

10. The secure interaction method according to claim 9, characterized in that, After sending the first password certificate to the external device, the method further includes: When the first cryptographic certificate is a post-quantum cryptographic certificate, a secure channel based on a post-quantum cryptographic algorithm is established with the external device.

11. The secure interaction method according to claim 9, characterized in that, After sending the first password certificate to the external device, the method further includes: When the first cryptographic certificate is of a type other than a post-quantum cryptographic certificate, a secure channel between the card and the external device is established using a non-post-quantum cryptographic algorithm to enable data interaction with the external device.

12. The secure interaction method according to claim 9, characterized in that, The process of determining the symmetric key based on the first public key and the second public key includes: The system receives first key negotiation data sent by the external device. The first key negotiation data includes a first signature and a public key in the public-private key pair of the temporary post-quantum key encapsulation algorithm. The first signature is determined based on first verification information and a second private key corresponding to the second public key. The first verification information is determined based on the public key in the public-private key pair of the temporary post-quantum key encapsulation algorithm. After successfully verifying the first signature using the second public key, a shared key and ciphertext are generated using the post-quantum key encapsulation algorithm based on the public key in the public-private key pair of the temporary post-quantum key encapsulation algorithm. A symmetric key is generated based on the shared key and the second verification information; wherein the second verification information is determined based on the public key and ciphertext in the public-private key pair of the temporary post-quantum key encapsulation algorithm; The symmetric key is determined based on the shared key.

13. The secure interaction method according to claim 12, characterized in that, After generating the symmetric key based on the shared key and the second verification information, the process further includes: Send second key negotiation data to the external device; the second key negotiation data includes ciphertext and a second signature; wherein the second signature is determined based on second verification information and a first private key corresponding to the first public key.

14. The secure interaction method according to claim 13, characterized in that, The second verification information is a second hash value, and sending the second key negotiation data to the external device includes: Generate a second random number; The second hash value is determined based on the first random number, the second random number, the public key in the public-private key pair of the temporary post-quantum key encapsulation algorithm, and the shared key; the first random number is generated by the external device. A second signature of the second hash value is determined based on the first private key corresponding to the first public key; The second random number, the ciphertext, and the second signature are sent as the second key negotiation data to the external device.

15. The secure interaction method according to any one of claims 9 to 14, characterized in that, Before determining the symmetric key based on the first and second public keys, the method further includes: Receive the second public key that has been sent.

16. The secure interaction method according to any one of claims 9 to 14, characterized in that, Before determining the symmetric key based on the first and second public keys, the method further includes: Receive the second password certificate sent by the external device; After the second cryptographic certificate is verified, the second public key of the external device is extracted from the second cryptographic certificate.

17. A secure interactive device, characterized in that, Deployed on an external device, the secure interaction device includes: A request sending module is used to initiate a certificate request to the smart card to obtain the first cryptographic certificate of the smart card; wherein the first cryptographic certificate includes the first public key of the smart card. The certificate type determination module is used to determine the method for establishing a secure channel based on the type of the first cryptographic certificate of the smart card. The first symmetric key module is used to determine a symmetric key based on the first public key and the second public key when it is determined that a secure channel based on a post-quantum cryptography algorithm is to be established with the smart card; wherein the second public key is the public key of the external device stored in the smart card. The first secure channel module is used to establish a secure channel based on a post-quantum cryptography algorithm between the module and the smart card according to the symmetric key, so as to realize data interaction with the smart card.

18. A secure interactive device, characterized in that, Deployed on a smart card, the secure interaction device includes: A request receiving module is configured to receive a certificate request sent by the external device and send a first cryptographic certificate to the external device; wherein the first cryptographic certificate includes the first public key of the smart card; The second symmetric key module is used to determine a symmetric key based on the first public key and the second public key when establishing a secure channel with the external device using a post-quantum cryptography algorithm; wherein the second public key is the public key of the external device stored in the smart card. The second secure channel module is used to establish a secure channel based on a post-quantum cryptography algorithm between the card and the external device according to the symmetric key, so as to realize data interaction with the external device.

19. An external device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the secure interaction method as described in any one of claims 1 to 8.

20. A smart card, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the secure interaction method as described in any one of claims 9 to 16.

21. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the secure interaction method as described in any one of claims 1 to 16.

22. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the secure interaction method as described in any one of claims 1 to 16.