Data sending method, data receiving method, sender device and receiver device
Public-private key pairs are generated through quantum cryptographic algorithms and quantum key distribution devices, combined with certificate certification agencies to verify, data transmission security is achieved in the quantum computing environment, solving the problem that classic asymmetric key systems cannot resist quantum computing attacks, and ensuring the integrity and security of data transmission.
Patent Information
- Application Number
- CN202510829302.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-08-15
AI Technical Summary
The existing classic asymmetric key system cannot provide sufficient data transmission security guarantees in the quantum computing environment and cannot meet the information security needs of the post-quantum era.
The quantum cryptographic algorithm is used to generate public and private key pairs, and the quantum key distribution device is used to obtain the key, generate signature data and target ciphertext, verify user certificates through certificate authentication agencies, and combine the non-eavesdropping nature of the quantum key distribution device to realize the triple security mechanism of encryption, signature and authentication.
Under the threat of quantum computing, ensure the integrity and security of data transmission, prevent signature forgery and identity tampering, and provide trusted data transmission guarantees.
Smart Images

Figure CN120498684A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of quantum secure communication technology, and specifically to a data sending method, a data receiving method, a sending device, and a receiving device. Background Art
[0002] With the rapid development of quantum computers, existing classical asymmetric key systems are no longer secure in quantum computing environments. Specifically, in practical applications, classical asymmetric key systems rely on asymmetric encryption to protect session keys and digital signatures to ensure the authenticity and integrity of messages. For example, the sender encrypts the session key with the receiver's public key and then signs the data with their own private key, achieving the dual purposes of encryption and identity authentication.
[0003] However, in the post-quantum era, classical asymmetric key systems can no longer resist quantum computing attacks to provide sufficient data transmission security, that is, they cannot meet the information security needs of the post-quantum era. Summary of the Invention
[0004] The purpose of this application is to provide a data sending method, a data receiving method, a sending device and a receiving device to address the deficiencies in the above-mentioned prior art, so as to solve the problem that the classical asymmetric key system in the prior art can no longer resist quantum computing attacks to provide sufficient data transmission security, that is, it cannot meet the information security needs of the post-quantum era.
[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of the present application are as follows:
[0006] In a first aspect, an embodiment of the present application provides a data sending method, applied to a sending device, the method comprising:
[0007] If the sending device and the receiving device are not trusted, obtaining a first key distributed by a quantum key distribution device, and generating a public-private key pair based on a quantum-resistant cryptographic algorithm, the public-private key pair including a public key and a private key;
[0008] Obtaining a user certificate from a certificate authority based on the public key, and generating signature data based on the plaintext data to be transmitted and the private key;
[0009] generating a first target ciphertext according to the first key and the plaintext data, wherein the first target ciphertext includes: a first data ciphertext encrypted by the plaintext data and a first key ciphertext encrypted by the key for encrypting the plaintext data;
[0010] First target data is sent to the receiving device according to a first preset encapsulation format, where the first target data includes: the signature data, the user certificate, and the first target ciphertext.
[0011] As a possible implementation, generating signature data according to the plaintext data to be transmitted and the private key includes:
[0012] Performing a digest calculation on the plaintext data to obtain digest information;
[0013] The summary information is signed using the private key to obtain the signature data.
[0014] As a possible implementation manner, generating a first target ciphertext according to the first key and the plaintext data includes:
[0015] Generate a first random number, and use the first random number as a first session key;
[0016] Encrypting the plaintext data using the first session key to obtain the first data ciphertext;
[0017] The first session key is encrypted using the first key to obtain the first key ciphertext.
[0018] As a possible implementation, the method further includes:
[0019] If the sending device and the receiving device are trustworthy, obtaining the second key and the third key distributed by the quantum key distribution device;
[0020] Generating a message authentication code for the plaintext data to be transmitted, and encrypting an authentication code key corresponding to the message authentication code using the third key to obtain an authentication key ciphertext;
[0021] generating a second target ciphertext based on the second key and the plaintext data, wherein the second target ciphertext includes: a second data ciphertext encrypted by the plaintext data and a second key ciphertext encrypted by the key for encrypting the plaintext data;
[0022] Second target data is sent to the receiving device according to a second preset encapsulation format, where the second target data includes: the message authentication code, the authentication key ciphertext, and the second target ciphertext.
[0023] As a possible implementation, generating a message authentication code for the plaintext data to be transmitted includes:
[0024] Generate a second random number, and use the second random number as the authentication code key;
[0025] A message authentication code for the plaintext data is generated using the authentication code key.
[0026] As a possible implementation manner, generating a second target ciphertext according to the second key and the plaintext data includes:
[0027] generating a third random number, and using the third random number as a second session key;
[0028] Encrypting the plaintext data using the second session key to obtain the second data ciphertext;
[0029] The second session key is encrypted using the second key to obtain the second key ciphertext.
[0030] In a second aspect, an embodiment of the present application provides a data receiving method, applied to a receiving device, the method comprising:
[0031] Receive first target data, the first target data including signature data, a user certificate, and a first target ciphertext, the first target ciphertext including a first data ciphertext encrypted from plaintext data and a first key ciphertext encrypted from a key for encrypting the plaintext data;
[0032] Obtaining a first key distributed by a quantum key distribution device, and obtaining an authentication certificate from a certificate authority, wherein the authentication certificate is generated by the certificate authority based on a public key sent by a sender device;
[0033] Decrypting the first target ciphertext according to the first key to obtain a decrypted plaintext;
[0034] Verification is performed based on the authentication certificate, the signature data, and the user certificate to obtain a verification result.
[0035] As a possible implementation manner, decrypting the first target ciphertext according to the first key to obtain decrypted plaintext includes:
[0036] decrypting the first key ciphertext using the first key to obtain a first session key;
[0037] The first data ciphertext is decrypted using the first session key to obtain the decrypted plaintext.
[0038] As a possible implementation manner, the performing verification according to the authentication certificate, the signature data, and the user certificate to obtain a verification result includes:
[0039] verifying the signature data using the user certificate;
[0040] The user certificate is verified using the authentication certificate to obtain a verification result.
[0041] As a possible implementation, the method further includes:
[0042] receiving second target data, the second target data including: a message authentication code, an authentication key ciphertext, and a second target ciphertext, the second target ciphertext including: a second data ciphertext encrypted from the plaintext data and a second key ciphertext encrypted from the key for encrypting the plaintext data;
[0043] Obtaining a second key and a third key distributed by a quantum key distribution device;
[0044] decrypting the second target ciphertext according to the second key to obtain a decrypted plaintext;
[0045] Authentication is performed according to the third key, the message authentication code, and the authentication key ciphertext to obtain an authentication result.
[0046] As a possible implementation manner, decrypting the second target ciphertext according to the second key to obtain decrypted plaintext includes:
[0047] decrypting the second key ciphertext using the second key to obtain a second session key;
[0048] The second data ciphertext is decrypted using the second session key to obtain the decrypted plaintext.
[0049] As a possible implementation manner, performing authentication according to the third key, the message authentication code, and the authentication key ciphertext to obtain an authentication result includes:
[0050] Decrypting the authentication key ciphertext using the third key to obtain the actual authentication key;
[0051] The message authentication code is authenticated using the actual authentication key.
[0052] In a third aspect, an embodiment of the present application provides a data sending device, applied to a sending device, the device comprising:
[0053] a processing module, configured to obtain a first key distributed by a quantum key distribution device if the sending device and the receiving device are not trusted, and generate a public-private key pair based on a quantum-resistant cryptographic algorithm, the public-private key pair including a public key and a private key;
[0054] A first generating module is used to obtain a user certificate from a certificate certification authority according to the public key, and generate signature data according to the plaintext data to be transmitted and the private key;
[0055] a second generating module, configured to generate a first target ciphertext based on the first key and the plaintext data, wherein the first target ciphertext includes: a first data ciphertext encrypted by encrypting the plaintext data and a first key ciphertext encrypted by encrypting the key for encrypting the plaintext data;
[0056] The sending module is configured to send first target data to the receiving device according to a first preset encapsulation format, where the first target data includes: the signature data, the user certificate, and the first target ciphertext.
[0057] As a possible implementation, the first generating module is specifically configured to:
[0058] Performing a digest calculation on the plaintext data to obtain digest information;
[0059] The summary information is signed using the private key to obtain the signature data.
[0060] As a possible implementation, the second generating module is specifically configured to:
[0061] Generate a first random number, and use the first random number as a first session key;
[0062] Encrypting the plaintext data using the first session key to obtain the first data ciphertext;
[0063] The first session key is encrypted using the first key to obtain the first key ciphertext.
[0064] As a possible implementation manner, the processing module is further configured to obtain the second key and the third key distributed by the quantum key distribution device if the sending device and the receiving device are trustworthy;
[0065] The first generating module is further configured to generate a message authentication code for the plaintext data to be transmitted, and encrypt an authentication code key corresponding to the message authentication code using the third key to obtain an authentication key ciphertext;
[0066] The second generating module is further configured to generate a second target ciphertext based on the second key and the plaintext data, wherein the second target ciphertext includes: a second data ciphertext encrypted by encrypting the plaintext data and a second key ciphertext encrypted by encrypting the key for encrypting the plaintext data;
[0067] The sending module is further configured to send second target data to the receiving device according to a second preset encapsulation format, where the second target data includes: the message authentication code, the authentication key ciphertext, and the second target ciphertext.
[0068] As a possible implementation, the first generating module is specifically configured to:
[0069] Generate a second random number, and use the second random number as the authentication code key;
[0070] A message authentication code for the plaintext data is generated using the authentication code key.
[0071] As a possible implementation, the second generating module is specifically configured to:
[0072] generating a third random number, and using the third random number as a second session key;
[0073] Encrypting the plaintext data using the second session key to obtain the second data ciphertext;
[0074] The second session key is encrypted using the second key to obtain the second key ciphertext.
[0075] In a fourth aspect, an embodiment of the present application provides a data receiving apparatus, applied to a receiving device, the apparatus comprising:
[0076] a receiving module, configured to receive first target data, the first target data including signature data, a user certificate, and a first target ciphertext, the first target ciphertext including a first data ciphertext encrypted from plaintext data and a first key ciphertext encrypted from a key for encrypting the plaintext data;
[0077] An acquisition module, configured to acquire a first key distributed by a quantum key distribution device and obtain an authentication certificate from a certificate authority, wherein the authentication certificate is generated by the certificate authority based on a public key sent by a sender device;
[0078] a decryption module, configured to decrypt the first target ciphertext according to the first key to obtain a decrypted plaintext;
[0079] The verification module is used to perform verification based on the authentication certificate, the signature data and the user certificate to obtain a verification result.
[0080] As a possible implementation, the decryption module is specifically configured to:
[0081] decrypting the first key ciphertext using the first key to obtain a first session key;
[0082] The first data ciphertext is decrypted using the first session key to obtain the decrypted plaintext.
[0083] As a possible implementation, the verification module is specifically configured to:
[0084] verifying the signature data using the user certificate;
[0085] The user certificate is verified using the authentication certificate to obtain a verification result.
[0086] As a possible implementation, the receiving module is further configured to receive second target data, where the second target data includes: a message authentication code, an authentication key ciphertext, and a second target ciphertext, where the second target ciphertext includes: a second data ciphertext encrypted from the plaintext data and a second key ciphertext encrypted from the key for encrypting the plaintext data;
[0087] The acquisition module is further configured to acquire a second key and a third key distributed by a quantum key distribution device;
[0088] The decryption module is further configured to decrypt the second target ciphertext according to the second key to obtain a decrypted plaintext;
[0089] The verification module is further configured to perform authentication based on the third key, the message authentication code, and the authentication key ciphertext to obtain an authentication result.
[0090] As a possible implementation, the decryption module is specifically configured to:
[0091] decrypting the second key ciphertext using the second key to obtain a second session key;
[0092] The second data ciphertext is decrypted using the second session key to obtain the decrypted plaintext.
[0093] As a possible implementation, the verification module is specifically configured to:
[0094] Decrypting the authentication key ciphertext using the third key to obtain the actual authentication key;
[0095] The message authentication code is authenticated using the actual authentication key.
[0096] In the fifth aspect, an embodiment of the present application provides a sending device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the sending device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to perform the steps of the data sending method as described in any one of the first aspects above.
[0097] In the sixth aspect, an embodiment of the present application provides a receiving device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the receiving device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to perform the steps of the data receiving method as described in any one of the second aspects above.
[0098] In the seventh aspect, an embodiment of the present application provides a data transmission system, including the sending device described in the fifth aspect and the receiving device described in the sixth aspect.
[0099] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the computer program executes the steps of the data sending method as described in any one of the first aspects above, and executes the steps of the data receiving method as described in any one of the second aspects above.
[0100] According to the data sending method, data receiving method, sender device and receiver device of the embodiment of the present application, in the case of distrust between the sender device and the receiver device, first, the sender no longer uses the traditional asymmetric encryption algorithm based on number theory principles (Rivest-Shamir-Adleman, RSA) or elliptic curve cryptography (Elliptic Curve Cryptography, ECC) and other asymmetric encryption algorithms that are vulnerable to quantum attacks, but instead generates a public-private key pair based on the quantum cryptography algorithm (Post-Quantum Cr yptography, PQC), ensuring that even in the case of a quantum computer being attacked, the generated digital signature still has sufficient security to prevent the signature from being forged. Secondly, because the quantum key distribution (Quantum Key Distribution, QKD) device has physical inability to be eavesdropped and can detect potential eavesdropping behavior, the sender uses the first key obtained from the quantum key distribution device QKD to encrypt the plaintext data, ensuring the security of the key used for encryption and avoiding the risk of man-in-the-middle attacks in the traditional key exchange process. And the sender submits the public key generated based on the quantum-resistant algorithm to the Certificate Authority (CA) to obtain the user certificate, and includes the user certificate and signature data in the data sent to the receiver, so that the receiver verifies the legitimacy of the user certificate and the authenticity of the signature data by obtaining the authentication certificate from the certificate authentication machine CA, thereby not only achieving quantum-resistant identity authentication, but also preventing identity forgery and data tampering. In addition, the sender packages the signature data, user certificate and the encrypted first target ciphertext in a unified encapsulation format and sends them. The receiver uses the first key obtained synchronously by the quantum key distribution device QKD to decrypt the original plaintext data, and verifies the received signature data based on the certificate system to ensure that the data source is credible and has not been tampered with. In this way, this application provides a triple security mechanism including encryption, signature and authentication for the situation of distrust between the sender's device and the receiver's device, so that the data transmission process can still obtain complete information security protection in the face of quantum computing threats. BRIEF DESCRIPTION OF THE DRAWINGS
[0101] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0102] Figure 1 A schematic diagram of the architecture of a data transmission system provided in an embodiment of the present application is shown;
[0103] Figure 2 A schematic diagram showing a flow chart of a data sending method provided in an embodiment of the present application is shown;
[0104] Figure 3 A schematic diagram of a data receiving method according to an embodiment of the present application is shown;
[0105] Figure 4 A schematic diagram showing a flow chart of another data sending method provided in an embodiment of the present application is shown;
[0106] Figure 5 A schematic diagram showing a flow chart of another data receiving method provided in an embodiment of the present application is shown;
[0107] Figure 6 An interactive diagram of a data transmission method between a sending device and a receiving device in an untrusted situation provided by an embodiment of the present application is shown;
[0108] Figure 7 A schematic diagram of a ciphertext transmission method integrating a quantum key distribution device QKD and a quantum-resistant cryptographic algorithm PQC is shown in an embodiment of the present application;
[0109] Figure 8 A schematic diagram illustrating an interaction method for data transmission between a sending device and a receiving device in a trusted situation provided by an embodiment of the present application is shown;
[0110] Figure 9 A schematic diagram of a ciphertext transmission method based on a quantum key distribution device QKD provided in an embodiment of the present application is shown;
[0111] Figure 10 A schematic structural diagram of a data sending device provided in an embodiment of the present application is shown;
[0112] Figure 11 A schematic structural diagram of a data receiving device provided in an embodiment of the present application is shown;
[0113] Figure 12 A schematic diagram of the structure of a sending device provided in an embodiment of the present application is shown;
[0114] Figure 13 A structural diagram of a receiving device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0115] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of illustration and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowcharts can be implemented out of sequence, and steps without logical context can be reversed or implemented simultaneously. In addition, those skilled in the art, under the guidance of the contents of this application, can add one or more other operations to the flowchart, or remove one or more operations from the flowchart.
[0116] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.
[0117] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0118] Figure 1 FIG2 shows a schematic diagram of the architecture of a data transmission system provided by an embodiment of the present application. Figure 1 As shown, the data transmission system includes a sending device and a receiving device, both the sending device and the receiving device include a QKD, PQC key operation module and a QKD key synchronization module, and the QKD, PQC key operation module in the sending device is communicated with the QKD, PQC key operation module in the receiving device through a classical channel, and the QKD key synchronization module in the sending device is communicated with the QKD key synchronization module in the receiving device through a quantum channel.
[0119] Optionally, the QKD key synchronization module is used to synchronize QKD keys in a quantum channel. The quantum channel is a highly reliable means of protecting key transmission security based on physical properties. The QKD key synchronization module in the sender device and the QKD key synchronization module in the receiver device communicate through the quantum channel, which can ensure that the sender of the sender device and the receiver corresponding to the receiver device can share the same QKD key, providing a basis for subsequent data encryption.
[0120] Optionally, the QKD and PQC key calculation modules are responsible for data encryption and decryption, as well as for transmitting ciphertext data over classical channels. If the sending and receiving devices are untrustworthy, PQC and symmetric encryption algorithms are used to encrypt the plaintext data to be transmitted, thereby defending against quantum computing attacks and ensuring data transmission security. If the sending and receiving devices are trusted, symmetric encryption algorithms can be used for efficient and secure data encryption. Because quantum channels are typically costly and primarily used to transmit high-value information, such as synchronized QKD keys, data encrypted using symmetric encryption and PQC algorithms can be transmitted over classical channels, which has a wider range of applications and is relatively low cost.
[0121] Based on the data transmission system provided by the embodiments of this application, this application provides two different data transmission methods based on whether the communicating parties in a quantum network environment are trustworthy. One method can achieve secure data transmission in the quantum network environment when the communicating parties are untrustworthy. The other method, when the communicating parties in the quantum network environment are trustworthy, not only ensures the secure transmission of data on the classical network but also simplifies the authentication process. Based on this, it not only effectively replaces the traditional PKCS#7 message signing and encryption method, but also effectively resists quantum computing attacks, improving security capabilities in the post-quantum era.
[0122] The following combines the above Figure 1 The content described in the data transmission system shown is used to provide a detailed description of the data sending method and the data receiving method provided in the embodiments of the present application.
[0123] Figure 2 The flowchart of a data sending method provided by an embodiment of the present application is shown, and the execution subject of the method is the sending device. Figure 2 As shown, in the case where the sending device and the receiving device are not trusted, the data sending method specifically includes the following steps:
[0124] S201. If the sending device and the receiving device are not trusted, obtain a first key distributed by a quantum key distribution device, and generate a public-private key pair based on a quantum-resistant cryptographic algorithm.
[0125] Optionally, if the sending device and the receiving device are not trusted, it means that the channel between the sending and receiving devices is considered untrustworthy, and the currently used communication link may be at risk of attack, such as being eavesdropped or tampered with. Therefore, it is not possible to directly use plain text to transmit keys or perform identity authentication. Instead, it is necessary to establish the keys and identity authentication information required for communication in a secure manner.
[0126] Optionally, the first key is a key synchronized between the sending device and the receiving device. A quantum key distribution device, based on quantum key distribution (QKD) technology, such as the BB84 protocol, synchronously distributes a shared symmetric key, also known as the first key, between the sending device and the receiving device. The first key, denoted as ks, is absolutely secure and can be used for subsequent data encryption.
[0127] Optionally, the quantum-resistant cryptographic algorithm PQC is an encryption method that can provide classical computers with protection against future quantum computer attacks. PQC is used to prevent future quantum computers from cracking traditional algorithms such as RSA and ECC. The sending device generates a PQC public-private key pair based on the PQC algorithm. This public-private key pair consists of a public key and a private key. The public key is used to obtain the user certificate from the Certificate Authority (CA) and for subsequent decryption operations, while the private key is used to sign the plaintext data to be transmitted. The Certificate Authority (CA) is a trusted third-party organization responsible for issuing and managing digital certificates.
[0128] In this way, when the communication environment between the sending device and the receiving device is insecure, the sending device first obtains a secure shared first key from the quantum key distribution device QKD, and then uses the PQC algorithm to generate a public-private key pair to prepare for subsequent encryption and signing.
[0129] S202: Obtain a user certificate from a certificate authority based on the public key, and generate signature data based on the plaintext data to be transmitted and the private key.
[0130] Optionally, after the sending device generates a public-private key pair, it sends the public key to the certificate authority (CA), that is, uses the public key to apply for a digital certificate from the certificate authority (CA) to prove its identity. The certificate authority (CA) receives the public key submitted by the sending device, verifies the identity of the sending device, and binds the public key submitted by the sending device with the sender's identity information after verification, and issues a user certificate (Cert) to the sending device. A The sending device can use the user certificate Cert A Send it to the receiving device, and the receiving device can verify the user certificate Cert A To confirm the identity of the sending device.
[0131] Optionally, a digital signature is a mechanism for ensuring data integrity, authentication, and non-repudiation. It allows a sender to sign specific data and allows the receiver to verify the authenticity of the signature, thereby confirming that the data is indeed from the claimed sender and has not been tampered with. In an embodiment of the present application, the sending device uses the generated PQC private key to digitally sign the plaintext data to be transmitted to ensure the integrity and non-repudiation of the plaintext data. The sending device uses its own generated PQC private key to encrypt the plaintext data to be transmitted, such as plaintext data d, to generate a digital signature. Because the private key is unique and confidential, only the sending device can generate a valid signature. Correspondingly, the receiving device uses the sending device's public key to decrypt the digital signature and compare the decrypted data with the plaintext data d, specifically with the hash value of the plaintext data d. If the two match, the digital signature is valid, that is, the plaintext data d is indeed sent by the sending device and has not been tampered with. Therefore, the sending device obtains the user certificate through the certificate authentication authority CA to authenticate the identity, and uses the PQC private key to sign the plaintext data d to be transmitted to ensure the security and credibility of the communication process.
[0132] S203: Generate a first target ciphertext according to the first key and the plaintext data.
[0133] Optionally, the first target ciphertext includes: a first data ciphertext obtained by encrypting the plaintext data and a first key ciphertext obtained by encrypting the key used to encrypt the plaintext data.
[0134] Optionally, the sending device can generate a first session key sessionKey and use this first session key sessionKey as a symmetric key to encrypt the plaintext data d using a symmetric encryption algorithm to obtain a first data ciphertext. Furthermore, the key used to encrypt the plaintext data, namely the first session key sessionKey, is encrypted using the first key ks distributed by the quantum key distribution device to obtain a first key ciphertext, which is also the first session key ciphertext. In this way, the sending device encrypts the plaintext data and the key used to encrypt the plaintext data to obtain the first data ciphertext encrypted from the plaintext data and the first key ciphertext encrypted from the key used to encrypt the plaintext data. While encrypting and protecting the plaintext data, the key used to encrypt the plaintext data is also encrypted and protected, forming a complete encryption structure.
[0135] S204: Send the first target data to the receiving device according to the first preset encapsulation format.
[0136] Optionally, the first target data includes: signature data, user certificate and first target ciphertext.
[0137] Optionally, after the sending device signs and encrypts the plaintext data d to be transmitted, the sending device sends the obtained signature data, the first target ciphertext and the user certificate Cert obtained from the certificate authority CA to the server. A The first target data is encapsulated according to a first preset encapsulation format to obtain the first target data, and the first target data is sent to the recipient device. The first preset encapsulation format is a digital envelope encapsulation format with a signature that integrates QKD and PQC. The first preset encapsulation format is encapsulated with reference to the standard format of PKCS#7 and is modified based on it, mainly including an extended PQC signature algorithm and a recipient information definition.
[0138] Exemplarily, the package definition of the standard PKCS#7 format includes: version number, encrypted information recipient, digest algorithm, encrypted information, certificate, certificate revocation list and signer information. On this basis, this application makes a PQC extension definition of the signature algorithm, that is, modifies the original PQC signature algorithm to obtain the extended PQC signature algorithm, and its corresponding package definition includes: version number, signature object identifier (OID), digest algorithm, signature attributes, extended PQC signature algorithm, signature data and non-authentication attributes.
[0139] Exemplarily, the definition of extended recipient information includes extending the definition of a QKD key recipient based on multiple recipients, including key transmission, key agreement, symmetric keys, and passwords. Specifically, the definition includes: a version number, a QKD synchronization sequence number used to identify QKD, a designated QKD key used to determine a specific QKD synchronization, an encryption algorithm, and ciphertext data. The structure definition of the QKD synchronization sequence number includes the QKD sequence number, time, and other key attributes.
[0140] Based on this, according to the data transmission method of the embodiment of the present application, in the case of distrust between the sending and receiving devices, first, the sender no longer uses traditional asymmetric encryption algorithms such as RSA or ECC that are vulnerable to quantum attacks. Instead, it generates a public-private key pair based on a quantum-resistant cryptographic algorithm. This ensures that even if a quantum computer is attacked, the generated digital signature remains sufficiently secure and prevents signature forgery. Secondly, because the quantum key distribution device (QKD) is physically untappable and can detect potential eavesdropping, the sender uses the first key obtained from the quantum key distribution device (QKD) to encrypt the plaintext data, ensuring the security of the encryption key and avoiding the risk of man-in-the-middle attacks in traditional key exchange processes. The sender also submits the public key generated based on the quantum-resistant algorithm to a certificate authority (CA) to obtain a user certificate. The sender also includes the user certificate and signature data in the data sent to the receiver. The receiver verifies the legitimacy of the user certificate and the authenticity of the signature data by obtaining an authentication certificate from the CA. This not only achieves quantum-resistant identity authentication but also prevents identity forgery and data tampering. In addition, the sender packages the signature data, user certificate, and encrypted first target ciphertext in a unified encapsulation format and sends them. The receiver uses the first key obtained synchronously by the quantum key distribution device QKD to decrypt the original plaintext data. At the same time, the received signature data is verified based on the certificate system to ensure that the data source is trustworthy and has not been tampered with. In this way, this application provides a triple security mechanism including encryption, signing, and authentication for the situation where there is no trust between the sender and receiver devices, so that the data transmission process can still obtain complete information security protection in the face of quantum computing threats.
[0141] As a possible implementation, step S202 generates signature data based on the plaintext data to be transmitted and the private key, including: performing digest calculation on the plaintext data to obtain digest information, and signing the digest information using the private key to obtain signature data.
[0142] Optionally, the process of the sending device signing the plaintext data d specifically includes: first performing a digest calculation on the plaintext data d to obtain the digest information hash (d) of the plaintext data d, and then using the PQC private key (denoted as S A ) performs PQC signature operation on the summary information hash(d) to obtain the signature data PQCSign(S A ,hash(d)).
[0143] For example, in a quantum-resistant environment, a secure or long-output hash function, such as SHA-256 or SHA-3, is used to calculate the digest of the plaintext data d to obtain the digest information hash(d). A Encrypt and sign the summary information hash(d) to generate the unique corresponding signature data PQCSign(S A ,hash(d)).
[0144] Based on this, this application does not directly sign the original plaintext data, but first calculates the digest of the plaintext data, and then signs the hash (i.e., digest) of the plaintext data, which can improve the efficiency and security of data transmission.
[0145] As a possible implementation method, the above step S203 generates a first target ciphertext based on the first key and the plaintext data, including: generating a first random number, and using the first random number as a first session key, encrypting the plaintext data using the first session key to obtain a first data ciphertext, and encrypting the first session key using the first key to obtain a first key ciphertext.
[0146] Optionally, the first data ciphertext is plaintext data encrypted with the first session key, and the first key ciphertext is the first session key encrypted with the first key. The sending device determines the length of the first random number based on the symmetric encryption algorithm used. For example, the symmetric encryption algorithm AES-256 requires 256 bits, or 32 bytes. Based on the determined length of the first random number, the sending device uses a cryptographically secure pseudorandom number generator to generate a first random number of the corresponding length and uses this first random number as the first session key sessionKey. Based on this, the plaintext data d is encrypted using the first session key sessionKey to obtain the first data ciphertext SymEnc(sessionKey, d). The first session key sessionKey is also encrypted using the first key ks to obtain the first key ciphertext QKDEnc(ks, sessionKey).
[0147] Based on this, the sending device generates a random number as the first session key to perform efficient symmetric encryption on the plaintext data, and then uses the first key shared by the quantum distribution device to encrypt the first session key, that is, to perform key encapsulation, thereby ensuring the secure transmission of the communicating parties in an untrusted channel.
[0148] Figure 3 The flowchart of a data receiving method provided by an embodiment of the present application is shown, and the execution subject of the method is a receiving device. Figure 3As shown, accordingly, in the case where there is no trust between the sending device and the receiving device, the data receiving method specifically includes the following steps:
[0149] S301: Receive first target data.
[0150] Optionally, the first target data includes signature data, a user certificate, and a first target ciphertext, and the first target ciphertext includes a first data ciphertext encrypted from the plaintext data and a first key ciphertext encrypted from the key used to encrypt the plaintext data.
[0151] Optionally, since the first target data is sent to the receiving device after being format-encapsulated by the sending device according to the first preset encapsulation format, the receiving device first decapsulates the first target data after receiving the first target data sent by the sending device.
[0152] S302: Obtain a first key distributed by a quantum key distribution device, and obtain a certification certificate from a certificate authority.
[0153] Optionally, the first key is a key synchronized between the sending device and the receiving device, which means that the sending device and the receiving device synchronize the first key ks through the quantum key distribution device QKD, so the receiving device can directly obtain the first key ks distributed by the quantum key distribution device QKD.
[0154] Optionally, the authentication certificate is generated by the certificate authority (CA) based on the public key sent by the sender's device. After the sender's device generates a public-private key pair, it will send the public key to the certificate authority (CA), that is, use the public key to apply for a digital certificate from the certificate authority (CA) to prove its identity. After receiving the public key submitted by the sender's device, the certificate authority (CA) will verify the identity of the sender's device, and after verification, it will bind the public key submitted by the sender's device and the sender's identity information, and issue a user certificate (Cert) to the sender's device. A At the same time, the certificate authority CA will also generate its own certification certificate Cert CA When the receiving device receives the first target data sent by the sending device, it also obtains the authentication certificate Cert from the certificate authority CA. CA .
[0155] S303: Decrypt the first target ciphertext according to the first key to obtain a decrypted plaintext.
[0156] Optionally, the first target ciphertext includes a first key ciphertext QKDEnc(ks,sessionKey) and a first data ciphertext SymEnc(sessionKey,d). The first data ciphertext QKDEnc(ks,sessionKey) is plaintext data d encrypted using the first session key sessionKey, and the first key ciphertext QKDEnc(ks,sessionKey) is the first session key sessionKey encrypted using the first key ks. The receiving device obtains the first key ks distributed by the quantum key distribution device QKD and decrypts the first target ciphertext in the first target data based on the first key ks. Specifically, the receiving device first decrypts the first key ciphertext QKDEnc(ks,sessionKey) using the first key ks to obtain the first session key sessionKey. The first data ciphertext SymEnc(sessionKey,d) is then decrypted using the first session key sessionKey to obtain the decrypted plaintext d′.
[0157] S304: Verify based on the authentication certificate, signature data and user certificate to obtain a verification result.
[0158] Optionally, the receiving device obtains the authentication certificate Cert from the certificate authority CA CA , and receive the user certificate Cert sent by the sending device A And the signature data PQCSign(S A , hash(d)), and then use the user certificate Cert A Verify the signature data PQCSign(S A , hash(d)), and use the authentication certificate Cert CA Verify user certificate Cert A The legitimacy of the data is verified to obtain the verification result. The verification result refers to the conclusion after verifying the received signature data and user certificate, including verification success and verification failure. Verification success indicates that the user certificate is valid, the signature is valid, the plaintext data is complete and the source is trustworthy. Verification failure indicates that the plaintext data may be forged or tampered with, the user certificate is expired, or the user certificate is illegal.
[0159] Based on this, according to the data receiving method of the embodiment of the present application, in the case of distrust between the sending device and the receiving device, the sender submits the public key generated based on the quantum-resistant algorithm to the certificate authentication authority CA to obtain the user certificate, and includes the user certificate and signature data in the data sent to the receiver, so that the receiver verifies the legitimacy of the user certificate and the authenticity of the signature data by obtaining the authentication certificate from the certificate authentication machine CA, thereby not only achieving quantum-resistant identity authentication, but also preventing identity forgery and data tampering. In addition, the sender packages the signature data, user certificate and encrypted first target ciphertext in a unified encapsulation format and sends them. The receiver uses the first key obtained synchronously by the quantum key distribution device QKD to decrypt the original plaintext data, and at the same time verifies the received signature data based on the certificate system to ensure that the data source is credible and has not been tampered with.
[0160] As a possible implementation method, the above-mentioned step S303 decrypts the first target ciphertext according to the first key to obtain the decrypted plaintext, including: using the first key to decrypt the first key ciphertext to obtain the first session key, and using the first session key to decrypt the first data ciphertext to obtain the decrypted plaintext.
[0161] Optionally, the first key ciphertext QKDEnc(ks,sessionKey) is obtained by encrypting the first session key sessionKey using the first key ks, and the first data ciphertext SymEnc(sessionKey,d) is obtained by encrypting the plaintext data d using the first session key sessionKey. Based on this, after receiving the first target ciphertext, the receiving device first decrypts the first key ciphertext QKDEnc(ks,sessionKey) using the first key ks synchronized by the quantum key distribution device QKD to obtain the first session key sessionKey. It then uses the first session key sessionKey to decrypt the first data ciphertext SymEnc(sessionKey,d) to obtain the decrypted plaintext d′, which is the original, unencrypted plaintext data.
[0162] Based on this, the layered decryption mechanism that combines the quantum key distribution device QKD with symmetric encryption has achieved security enhancement in the data communication process. By effectively separating the key transmission and data encryption processes, it not only takes advantage of the quantum key distribution device QKD's anti-eavesdropping advantages in key distribution, but also combines the high efficiency of the symmetric encryption algorithm in data encryption and decryption, thereby significantly improving the security, confidentiality and anti-attack capabilities of the entire communication process.
[0163] As a possible implementation, the above step S304 performs verification based on the authentication certificate, signature data and user certificate to obtain a verification result, including: using the user certificate to verify the signature data, and using the authentication certificate to verify the user certificate to obtain a verification result.
[0164] Optionally, the user certificate Cert A It is the identity certificate of the sending device. The receiving device obtains the authentication certificate Cert from the certificate authority CA. CA Then, use the authentication certificate Cert CA The public key in the received user certificate Cert sent by the sender device A Verify the signature to confirm the user certificate Cert A It is indeed issued by the certificate authority CA, and the user certificate Cert A The data has not been tampered with, and the identity information of the sending device is authentic and valid.
[0165] Further, from the user certificate Cert A Extract the public key and use it to sign the data PQCSign(S A , hash(d)) is decrypted to restore the original summary information hash(d), and the summary of the received plaintext data d is recalculated to obtain a new summary information, and the new summary information is compared with the decrypted summary information hash(d). If the new summary information is consistent with the decrypted summary information hash(d), it means that the signature is valid and the plaintext data d has not been tampered with. On the contrary, if the new summary information is inconsistent with the decrypted summary information hash(d), it means that the signature is invalid and the plaintext data d has been tampered with.
[0166] Based on this, a combination of certificate-based public key authentication and digital signature verification achieves dual protection for the identity authenticity and data integrity of both communicating parties. The receiving device uses the authentication certificate to verify the legitimacy of the user certificate, ensuring that the sender's identity is authentic and the certificate has not been tampered with. It then uses the public key extracted from the user certificate to decrypt the received signed data, recovering the original data digest. This is then compared with the locally recalculated data digest to determine whether the data has been tampered with during transmission. This effectively prevents security threats such as identity forgery, man-in-the-middle attacks, and data tampering, improving the reliability of identity authentication and data integrity verification capabilities.
[0167] Figure 4 The flowchart of another data sending method provided by the embodiment of the present application is shown, and the execution subject of the method is the sending device. Figure 4 As shown, in the case where the sending device and the receiving device are trustworthy, the data sending method specifically includes the following steps:
[0168] S401. If the sending device and the receiving device are trustworthy, obtain the second key and the third key distributed by the quantum key distribution device.
[0169] Optionally, if the sender device and the receiver device are trustworthy, it means that the channel between the sender and the receiver is considered to be trustworthy, the currently used communication link is secure, there is no risk of attack, and it can resist quantum attacks, so secure data transmission can be achieved based on quantum key distribution QKD technology.
[0170] Optionally, the second key and the third key are keys synchronized between the sending device and the receiving device. The quantum key distribution (QKD) device distributes the second key ks synchronously between the sending device and the receiving device based on quantum key distribution QKD technology, such as the BB84 protocol. enc and the third key ks hmac , the second key ks enc and the third key ks hmac It is absolutely safe and can be used for subsequent data encryption. enc The user data encryption key is mainly used to encrypt data. The third key ks hmAC To authenticate encryption keys, it is mainly used to generate and verify message authentication codes to ensure the integrity and identity authentication of plaintext data.
[0171] S402: Generate a message authentication code for the plaintext data to be transmitted, and use a third key to encrypt an authentication code key corresponding to the message authentication code to obtain an authentication key ciphertext.
[0172] Optionally, the sending device uses a preset algorithm, such as a Hash-based Message Authentication Code (HMAC) algorithm, to calculate the message authentication code of the plaintext data d, which is used to verify whether the plaintext data d has been tampered with and to verify the identity of the sender. Then, a second session key is generated as the authentication code key hmacKey corresponding to the message authentication code, and a third key ks is used to generate the authentication code. hmac Encrypt the generated authentication code key hmacKey to obtain the authentication key ciphertext QKDEnc(ks hmac ,hmacKey) to prevent a third party from intercepting the authentication code key and forging the message authentication code.
[0173] S403: Generate a second target ciphertext according to the second key and the plaintext data.
[0174] Optionally, the second target ciphertext includes: a second data ciphertext obtained by encrypting the plaintext data and a second key ciphertext obtained by encrypting the key used to encrypt the plaintext data.
[0175] Optionally, the sending device can generate a second session key sessionKey2, and use the second session key sessionKey2 as a symmetric key to encrypt the plaintext data d using a symmetric encryption algorithm to obtain a second data ciphertext. enc The key used to encrypt the plaintext data, namely the second session key sessionKey2, is encrypted to obtain the second key ciphertext, which is also the second session key ciphertext. In this way, the sending device encrypts the plaintext data and the key used to encrypt the plaintext data, obtaining the second data ciphertext encrypted from the plaintext data and the second key ciphertext encrypted from the key used to encrypt the plaintext data. This encrypts and protects both the plaintext data and the key used to encrypt the plaintext data, forming a complete encryption structure.
[0176] S404: Send the second target data to the receiving device according to the second preset encapsulation format.
[0177] Optionally, the second target data includes: a message authentication code, an authentication key ciphertext and a second target ciphertext.
[0178] Optionally, after performing message authentication code calculation and encryption on the plaintext data d to be transmitted, the sending device encapsulates the obtained message authentication code, the second target ciphertext, and the authentication key ciphertext according to a second preset encapsulation format to obtain second target data, and sends the second target data to the receiving device. The second preset encapsulation format is an encapsulation format for authentication information based on QKD. The second preset encapsulation format is encapsulated with reference to the standard format of PKCS#7 and is modified based on it to add a MAC key recipient and ciphertext information structure.
[0179] Exemplarily, the encapsulation definition of the second preset encapsulation format includes: version number, message sender information, QKD decryption key receiver, QKD MAC key receiver, MAC algorithm, algorithm for calculating content digest, encrypted ciphertext information, authentication attributes, message authentication code and non-authentication attributes.
[0180] Based on this, according to the data transmission method provided in the embodiments of the present application, if the sending device and the receiving device are trustworthy, data transmission does not rely on traditional asymmetric encryption algorithms such as RSA and ECC, which are vulnerable to quantum computing attacks. Instead, it directly uses the second and third keys distributed by the quantum key distribution device (QKD) for data encryption and message authentication, fundamentally avoiding the security threats posed by quantum computers cracking asymmetric keys. In addition, both the sender and the receiver obtain the second and third keys from the quantum key distribution device (QKD). The second and third keys are generated and transmitted based on the principles of quantum physics and have the characteristics of information being unaware of eavesdropping and non-copyable, thereby ensuring the absolute security of the keys used in subsequent encryption and authentication operations and preventing man-in-the-middle attacks and key leakage. In addition, the sender uses the second key to double-encrypt the plaintext data and its session key to generate a second target ciphertext, and simultaneously uses the third key to encrypt the authentication code key to protect the secure transmission of the message authentication code. Correspondingly, the receiver uses the second key to decrypt the data and the third key to restore the authentication code key and verify the message integrity and source authenticity. This not only improves the efficiency of data transmission but also ensures data security during the data transmission process.
[0181] As a possible implementation, step S402 generates a message authentication code for the plaintext data to be transmitted, including: generating a second random number, using the second random number as an authentication code key, and using the authentication code key to generate a message authentication code for the plaintext data.
[0182] Optionally, the receiving device may adopt the HMAC algorithm to calculate the message authentication code Hmac(hmacKey,d) of the plaintext data d. Accordingly, the receiving device may determine the length of the second random number according to the adopted HMAC algorithm, and based on the determined length of the second random number, use a cryptographically secure pseudo-random number generator to generate a second random number of corresponding length, and use the generated second random number as the authentication code key hmacKey.
[0183] Exemplarily, the HMAC algorithm is a message authentication code algorithm based on a hash function and a shared key. It combines a cryptographic hash function (such as SHA-256) with a symmetric key mechanism. The plaintext data d and the authentication code key hmacKey are used as inputs to the HMAC algorithm, and a fixed-length MAC is output. This MAC can serve as the message authentication code Hmac(hmacKey, d). Specifically, assuming the HMAC-SHA256 algorithm is used, the output length is 256 bits (i.e., 32 bytes). Accordingly, the length of the authentication code key hmacKey is also determined to be 256 bits (32 bytes). On this basis, a cryptographically secure pseudo-random number generator is used to generate a second random number of a fixed length (e.g., 32 bytes). This second random number is a random key that can be used as the authentication code key hmacKey.
[0184] Based on this, since simple hash calculation cannot prevent forgery, attackers can calculate the hash value themselves to forge data. This application introduces the HMAC algorithm to determine an authentication code key hmacKey that only the communicating parties know, making it impossible for a third party to forge a legal authentication code, thereby ensuring the security of the data transmission process.
[0185] As a possible implementation method, the above step S403 generates a second target ciphertext based on the second key and the plaintext data, including: generating a third random number, and using the third random number as the second session key, using the second session key to encrypt the plaintext data to obtain a second data ciphertext, and using the second key to encrypt the second session key to obtain a second key ciphertext.
[0186] Optionally, the second data ciphertext is plaintext data encrypted with the second session key, and the second key ciphertext is the second session key encrypted with the second key. The receiving device determines the length of the second random number based on the symmetric encryption algorithm used. For example, the symmetric encryption algorithm AES-256 requires 256 bits, that is, 32 bytes. Based on the determined length of the third random number, a cryptographically secure pseudo-random number generator is used to generate a third random number of the corresponding length, and the third random number is used as the second session key sessionKey2. On this basis, the plaintext data d is encrypted using the second session key sessionKey2 to obtain the second data ciphertext SymEnc(sessionKey2,d), and the second key ks is used to encrypt the plaintext data d. enc The second session key sessionKey2 is encrypted to obtain the second key ciphertext QKDEnc(ks enc ,sessionKey2).
[0187] Based on this, the sending device generates a random number as the second session key to perform efficient symmetric encryption on the plaintext data, and then uses the second key shared by the quantum distribution device to encrypt the second session key, that is, to perform key encapsulation, thereby ensuring the secure transmission of the communicating parties in an untrusted channel.
[0188] Figure 5 The flowchart of another data receiving method provided by the embodiment of the present application is shown, and the execution subject of the method is the receiving device. Figure 5 As shown, accordingly, in the case where the sending device and the receiving device are trustworthy, the data receiving method specifically includes the following steps:
[0189] S501: Receive second target data.
[0190] Optionally, the second target data includes: a message authentication code, an authentication key ciphertext and a second target ciphertext, and the second target ciphertext includes: a second data ciphertext encrypted from the plaintext data and a second key ciphertext encrypted from the key used to encrypt the plaintext data.
[0191] Optionally, since the second target data is sent to the receiving device after being format-encapsulated by the sending device according to the second preset encapsulation format, the receiving device first decapsulates the second target data after receiving the second target data sent by the sending device.
[0192] S502. Obtain a second key and a third key distributed by a quantum key distribution device.
[0193] Optionally, the second key ks enc and the third key ks hmac The key synchronized between the sender device and the receiver device, which means that the sender device and the receiver device synchronize the second key ks through the quantum key distribution device QKD enc and the third key ks hmac , so the receiving device can directly obtain the second key ks distributed by the quantum key distribution device QKD enc and the third key ks hmac .
[0194] S503: Decrypt the second target ciphertext according to the second key to obtain a decrypted plaintext.
[0195] Optionally, the second target ciphertext includes a second key ciphertext QKDEnc(ks enc,sessionKey2) and the second data ciphertext SymEnc(sessionKey2,d), the second data ciphertext SymEnc(sessionKey2,d) is the plaintext data d encrypted with the second session key sessionKey2, the second key ciphertext QKDEnc(ks enc ,sessionKey2) is the second key ks enc The encrypted second session key sessionKey2. The receiving device obtains the second key ks distributed by the quantum key distribution device QKD enc , according to the second key ks enc The second target ciphertext in the second target data is decrypted. Specifically, the second key ks is first used to decrypt the second target ciphertext. enc For the second key ciphertext QKDEnc(ks enc ,sessionKey2) is decrypted to obtain the second session key sessionKey2, and then the second data ciphertext SymEnc(sessionKey2,d) is decrypted using the second session key sessionKey2 to obtain the decrypted plaintext d′.
[0196] S504: Perform authentication based on the third key, the message authentication code, and the authentication key ciphertext to obtain an authentication result.
[0197] Optionally, the receiving device uses a third key ks hmac Authentication key ciphertext QKDEnc(ks hmac ,hmacKey) is decrypted to obtain the original authentication code key hmacKey. The decrypted authentication code key hmacKey is then used to authenticate the message authentication code Hmac(hmacKey,d) to obtain the authentication result. The authentication result refers to the judgment result of whether the received message is authentic and has not been tampered with.
[0198] Optionally, the message authentication code Hmac(hmacKey,d) is generated by the sending device using the authentication code key hmacKey and the plaintext data d. It is a special hash value. The message authentication code Hmac(hmacKey,d) not only ensures the integrity of the plaintext data d, but also provides authentication of the data source.
[0199] Based on this, according to the data receiving method provided in the embodiment of the present application, when the sending device and the receiving device are trusted, it is ensured that only the receiving device with the correct authentication code key hmacKey can verify the authenticity of the plaintext data d, while preventing man-in-the-middle attacks or other forms of data tampering.
[0200] As a possible implementation method, the above-mentioned step S503 decrypts the second target ciphertext according to the second key to obtain the decrypted plaintext, including: using the second key to decrypt the second key ciphertext to obtain the second session key, and using the second session key to decrypt the second data ciphertext to obtain the decrypted plaintext.
[0201] Optionally, the second key ciphertext QKDEnc(ks enc ,sessionKey2) is the use of the second key ks enc The second session key sessionKey2 is encrypted, and the second data ciphertext SymEnc(sessionKey2,d) is obtained by encrypting the plaintext data d using the second session key sessionKey2. On this basis, after receiving the second target ciphertext, the receiving device first uses the second key ks synchronized by the quantum key distribution device QKD to enc For the second key ciphertext QKDEnc(ks enc ,sessionKey2) to obtain the second session key sessionKey2, and then use the second session key sessionKey2 to decrypt the second data ciphertext SymEnc(sessionKey2,d) to obtain the decrypted plaintext d′, which is the original unencrypted plaintext data.
[0202] Based on this, this application achieves high security protection of the data transmission process by combining layered encryption with quantum key distribution equipment QKD. It not only improves the flexibility and efficiency of data decryption, but also uses the high-security key distribution channel provided by the quantum key distribution equipment QKD to effectively prevent the key from being eavesdropped or tampered with, thereby ensuring the overall confidentiality, integrity and anti-attack capability of the communication. It is especially suitable for quantum secure communication scenarios with extremely high security requirements.
[0203] As a possible implementation method, the above step S504 performs authentication based on the third key, the message authentication code and the authentication key ciphertext to obtain an authentication result, including: using the third key to decrypt the authentication key ciphertext to obtain the actual authentication key, and using the actual authentication key to authenticate the message authentication code.
[0204] Optionally, the receiving device first uses the third key ks hmAC Authentication key ciphertext QKDEnc(ks hmac,hmacKey) and the received plaintext data d, recalculate the message authentication code to obtain the actual authentication key Hmac, and compare the calculated actual authentication key Hmac with the message authentication code Hmac(hmacKey,d) sent by the sending device. If the calculated actual authentication key Hmac is consistent with the message authentication code Hmac(hmacKey,d) sent by the sending device, it means that the plaintext data d has not been tampered with, and the plaintext data d does come from the sending device holding the correct authentication code key hmacKey, which means that the plaintext data d is complete and the source is trustworthy, that is, the authentication result is successful. On the contrary, if the calculated actual authentication key Hmac is inconsistent with the message authentication code Hmac(hmacKey,d) sent by the sending device, it means that the plaintext data d may have been tampered with or the source is untrustworthy, and the authentication result is failed.
[0205] Based on this, the authentication key ciphertext is decrypted using a third key to obtain the original authentication code key. This authentication code key is then used to recalculate the message authentication code (MAC) for the received plaintext data. This code is then compared with the MAC provided by the sender, thereby achieving dual verification of the integrity and source authenticity of the received data. If the two match, the data has not been tampered with and originated from a legitimate sender, indicating a successful authentication. Otherwise, the data may have been tampered with or the source is untrustworthy, indicating a failed authentication. This effectively ensures data integrity and identity authenticity during communication, improving the security and resistance to quantum attacks of the data transmission system.
[0206] Figure 6 The following is a schematic diagram showing an interaction method of a data transmission method between a sending device and a receiving device in an untrusted situation provided by an embodiment of the present application. Figure 6 As shown, in the case where the sending device and the receiving device are not trusted, the data transmission method specifically includes the following steps:
[0207] S601. The quantum key distribution device QKD synchronizes a first key to a sending device and a receiving device.
[0208] S602: The sending device generates a public-private key pair, which includes a public key and a private key.
[0209] S603: The sending device sends the public key to the certificate authority CA.
[0210] S604: The certificate authority CA generates a user certificate and an authentication certificate based on the public key sent by the sending device.
[0211] S605: The certificate authority CA sends the user certificate to the sending device.
[0212] S606. The sending device performs digest calculation on the plaintext data to obtain digest information, and uses the private key to sign the digest information to obtain signature data.
[0213] S607. The sending device generates a first session key, symmetrically encrypts the plaintext data using the first session key to obtain a first data ciphertext, and encrypts the first session key using the first key to obtain a first key ciphertext.
[0214] S608. The sending device encapsulates the first target data in a first preset encapsulation format, where the first target data includes signature data, user certificate, and first target ciphertext, and the first target ciphertext includes a first data ciphertext and a first key ciphertext.
[0215] S609: The sending device sends the first target data to the receiving device.
[0216] S610: The receiving device obtains an authentication certificate from a certificate authority CA, receives first target data sent by the sending device, and decapsulates the first target data.
[0217] S611. The receiving device decrypts the first target ciphertext according to the first key synchronized by the quantum key distribution device QKD to obtain a decrypted plaintext.
[0218] S612: The receiving device performs verification based on the authentication certificate, signature data, and user certificate to obtain a verification result.
[0219] The specific implementation methods of the above steps have been explained in detail above and will not be repeated here.
[0220] Optionally, refer to Figure 7 The schematic diagram of the ciphertext transmission method that integrates QKD and PQC is shown. In the case where the sending device and the receiving device are untrusted, the sending device (user A) first generates a PQC public-private key pair, sends the public key to the certificate authority (CA) for issuance, obtains the user certificate and authentication certificate generated by the certificate authority, and performs a digest calculation on the plaintext data d to obtain the summary information of the plaintext data d. The digest information is then PQC-signed using the private key to obtain the signature data. Furthermore, a first random number is generated as a first session key, and this first session key is used as a symmetric key. The plaintext data d is encrypted using a symmetric encryption algorithm to obtain the first data ciphertext. The first session key is then encrypted using the first key synchronized with the quantum key distribution device to obtain the first key ciphertext. Based on this, the signature data, user certificate, first data ciphertext, and first key ciphertext are formatted and packaged according to a first preset packaging format and sent to the receiving device (user B).
[0221] Accordingly, the receiving device (user B) decapsulates the encapsulated data sent by the sending device (user A) and obtains an authentication certificate from the certificate authority (CA). It then uses the first key synchronized with the quantum key distribution device to decrypt the first key ciphertext, obtaining the first session key. It then uses the first session key to decrypt the first data ciphertext to obtain the decrypted plaintext. Furthermore, the user certificate is used to verify the signature data, and the authentication certificate is used to verify the legitimacy of the user certificate, thereby ensuring the integrity of the data and the authenticity of the sender's identity. Finally, the decrypted plaintext and verification result are output.
[0222] In addition, continue to refer to Figure 7 As shown, the receiving device (user B) may also act as a sending device to conduct quantum communication with other receiving devices. In this case, the receiving device (user B) can also generate a PQC public-private key pair and send the public key to the certificate certification authority CA for certificate issuance. The certificate certification authority CA generates the corresponding user certificate and authentication certificate based on the public key provided by the receiving device (user B), and returns the generated user certificate and authentication certificate to the receiving device (user B).
[0223] Based on this, according to a data transmission method provided in an embodiment of the present application, in the case of untrustworthiness between the sending device and the receiving device, the entire data transmission process combines the secure transmission of quantum keys and identity authentication of digital certificates to ensure the security of communication.
[0224] Figure 8 The following is a schematic diagram showing an interaction method of a data transmission method under a trustworthy situation between a sending device and a receiving device provided by an embodiment of the present application. Figure 8 As shown, the method specifically includes the following steps:
[0225] S801. The quantum key distribution device QKD synchronizes the second key and the third key to the sending device and the receiving device.
[0226] S802: The sending device generates an authentication code key, and uses the authentication code key to generate a message authentication code for the plaintext data.
[0227] S803. The sending device uses the third key to encrypt the authentication code key corresponding to the message authentication code to obtain the authentication key ciphertext.
[0228] S804. The sending device generates a second session key, encrypts the plaintext data using the second session key to obtain a second data ciphertext, and encrypts the second session key using the second key to obtain a second key ciphertext.
[0229] S805. The sending device encapsulates the second target data in a format according to a second preset encapsulation format, wherein the second target data includes a message authentication code, an authentication key ciphertext, and a second target ciphertext, and the second target ciphertext includes a second data ciphertext and a second key ciphertext.
[0230] S806: The sending device sends the second target data to the receiving device.
[0231] S807. The receiving device obtains the second key and the third key from the quantum key distribution device QKD, and decapsulates the second target data.
[0232] S808. The receiving device uses the second key to decrypt the second key ciphertext to obtain a second session key, and uses the second session key to decrypt the second data ciphertext to obtain decrypted plaintext.
[0233] S809. The receiving device performs authentication based on the third key, the message authentication code, and the authentication key ciphertext to obtain an authentication result.
[0234] The specific implementation methods of the above steps have been explained in detail above and will not be repeated here.
[0235] Optionally, refer to Figure 9 The schematic diagram of the ciphertext transmission method based on the quantum key distribution device (QKD) is shown. Under the condition that the sending device and the receiving device are trustworthy, the sending device (user A) first uses the third key to calculate the message authentication code of the plaintext data, generates the second session key to encrypt the plaintext data to obtain the second data ciphertext, and simultaneously uses the second key to encrypt the second session key to obtain the second key ciphertext, and encrypts the second session key to obtain the authentication key ciphertext. The message authentication code, authentication key ciphertext, second data ciphertext, and second key ciphertext are then formatted and encapsulated according to the second preset encapsulation format, and the encapsulated information is transmitted to the receiving device (user B) via the quantum channel. Correspondingly, the receiving device uses the second key and third key synchronized by the quantum key distribution device (QKD) to perform decryption processing and authentication, and finally outputs the decrypted plaintext and authentication result, ensuring the confidentiality and integrity of data transmission under the condition that the sending device and the receiving device are trustworthy.
[0236] Based on this, according to another data transmission method provided in an embodiment of the present application, when the sending device and the receiving device are trusted, the entire data transmission process combines the security of quantum keys with traditional encryption technology to ensure the security and confidentiality of data transmission.
[0237] Based on the same inventive concept, the embodiment of the present application also provides a data sending device corresponding to the data sending method. Since the principle of solving the problem by the data sending device in the embodiment of the present application is similar to the above-mentioned data sending method in the embodiment of the present application, the implementation of the data sending device can refer to the implementation of the data sending method, and the repeated parts will not be repeated.
[0238] Reference Figure 10 FIG. 1 is a schematic diagram of the structure of a data sending device provided in an embodiment of the present application. The data sending device 1000 includes: a processing module 1001, a first generating module 1002, a second generating module 1003, and a sending module 1004, wherein:
[0239] Processing module 1001 is configured to obtain a first key distributed by a quantum key distribution device if the sending device and the receiving device are not trusted, and generate a public-private key pair based on a quantum-resistant cryptographic algorithm, the public-private key pair including a public key and a private key;
[0240] The first generating module 1002 is used to obtain a user certificate from a certificate authority according to a public key, and generate signature data according to the plaintext data to be transmitted and the private key;
[0241] The second generating module 1003 is configured to generate a first target ciphertext based on the first key and the plaintext data, where the first target ciphertext includes: a first data ciphertext encrypted from the plaintext data and a first key ciphertext encrypted from the key used to encrypt the plaintext data;
[0242] The sending module 1004 is configured to send first target data to a receiving device according to a first preset encapsulation format, where the first target data includes signature data, a user certificate, and a first target ciphertext.
[0243] Based on this, according to the data transmission device of the embodiment of the present application, in the case of distrust between the sending device and the receiving device, first, the sender no longer uses traditional asymmetric encryption algorithms such as RSA or ECC that are vulnerable to quantum attacks. Instead, it generates a public-private key pair based on a quantum-resistant cryptographic algorithm. This ensures that even if a quantum computer is attacked, the generated digital signature remains sufficiently secure and prevents signature forgery. Secondly, because the quantum key distribution device (QKD) is physically untappable and can detect potential eavesdropping, the sender uses the first key obtained from the quantum key distribution device (QKD) to encrypt the plaintext data, ensuring the security of the encryption key and avoiding the risk of man-in-the-middle attacks in traditional key exchange processes. The sender also submits the public key generated based on the quantum-resistant algorithm to a certificate authority (CA) to obtain a user certificate. The sender also includes the user certificate and signature data in the data sent to the receiver. The receiver verifies the legitimacy of the user certificate and the authenticity of the signature data by obtaining an authentication certificate from the CA. This not only achieves quantum-resistant identity authentication but also prevents identity forgery and data tampering. In addition, the sender packages the signature data, user certificate, and encrypted first target ciphertext in a unified encapsulation format and sends them. The receiver uses the first key obtained synchronously by the quantum key distribution device QKD to decrypt the original plaintext data. At the same time, the received signature data is verified based on the certificate system to ensure that the data source is trustworthy and has not been tampered with. In this way, this application provides a triple security mechanism including encryption, signing, and authentication for the situation where there is no trust between the sender and receiver devices, so that the data transmission process can still obtain complete information security protection in the face of quantum computing threats.
[0244] In a possible implementation, the first generating module 1002 is specifically configured to:
[0245] Perform summary calculation on plaintext data to obtain summary information;
[0246] The summary information is signed using the private key to obtain signature data.
[0247] In a possible implementation, the second generating module 1003 is specifically configured to:
[0248] Generate a first random number, and use the first random number as a first session key;
[0249] Encrypting the plaintext data using the first session key to obtain a first data ciphertext;
[0250] The first session key is encrypted using the first key to obtain a first key ciphertext.
[0251] In one possible implementation, the processing module 1001 is further configured to obtain the second key and the third key distributed by the quantum key distribution device if the sending device and the receiving device are trustworthy.
[0252] The first generating module 1002 is further configured to generate a message authentication code for the plaintext data to be transmitted, and encrypt the authentication code key corresponding to the message authentication code using the third key to obtain an authentication key ciphertext;
[0253] The second generating module 1003 is further configured to generate a second target ciphertext based on the second key and the plaintext data, wherein the second target ciphertext includes: a second data ciphertext encrypted from the plaintext data and a second key ciphertext encrypted from the key used to encrypt the plaintext data;
[0254] The sending module 1004 is further configured to send second target data to a receiving device according to a second preset encapsulation format, where the second target data includes a message authentication code, an authentication key ciphertext, and a second target ciphertext.
[0255] In a possible implementation, the first generating module 1002 is specifically configured to:
[0256] Generate a second random number, and use the second random number as an authentication code key;
[0257] Generates a message authentication code for plaintext data using the authentication code key.
[0258] In a possible implementation, the second generating module 1003 is specifically configured to:
[0259] generating a third random number, and using the third random number as a second session key;
[0260] Encrypting the plaintext data using the second session key to obtain a second data ciphertext;
[0261] The second session key is encrypted using the second key to obtain a second key ciphertext.
[0262] Based on the same inventive concept, an embodiment of the present application also provides a data receiving device corresponding to the data receiving method. Since the principle of solving the problem by the data receiving device in the embodiment of the present application is similar to that of the above-mentioned data receiving method in the embodiment of the present application, the implementation of the data receiving device can refer to the implementation of the data receiving method, and the repeated parts will not be repeated.
[0263] Reference Figure 11 FIG. 1 is a schematic diagram of the structure of a data receiving device provided in an embodiment of the present application. The data receiving device 1100 includes: a receiving module 1101, an acquisition module 1102, a decryption module 1103, and a verification module 1104, wherein:
[0264] The receiving module 1101 is configured to receive first target data, the first target data including signature data, a user certificate, and a first target ciphertext, the first target ciphertext including a first data ciphertext encrypted from the plaintext data and a first key ciphertext encrypted from the key used to encrypt the plaintext data;
[0265] An acquisition module 1102 is configured to acquire a first key distributed by a quantum key distribution device and obtain an authentication certificate from a certificate authority, wherein the authentication certificate is generated by the certificate authority based on a public key sent by a sender device;
[0266] A decryption module 1103 is configured to decrypt the first target ciphertext according to the first key to obtain a decrypted plaintext;
[0267] The verification module 1104 is used to perform verification based on the authentication certificate, signature data and user certificate to obtain a verification result.
[0268] Based on this, according to the data receiving device provided by the embodiment of the present application, in the case of distrust between the sending device and the receiving device, the sender submits the public key generated based on the quantum-resistant algorithm to the certificate authentication authority CA to obtain the user certificate, and includes the user certificate and signature data in the data sent to the receiver, so that the receiver verifies the legitimacy of the user certificate and the authenticity of the signature data by obtaining the authentication certificate from the certificate authentication machine CA, thereby not only achieving quantum-resistant identity authentication, but also preventing identity forgery and data tampering. In addition, the sender packages the signature data, user certificate and encrypted first target ciphertext in a unified encapsulation format and sends them. The receiver uses the first key obtained synchronously by the quantum key distribution device QKD to decrypt the original plaintext data, and at the same time verifies the received signature data based on the certificate system to ensure that the data source is credible and has not been tampered with.
[0269] In a possible implementation, the decryption module 1103 is specifically configured to:
[0270] Decrypting the first key ciphertext using the first key to obtain a first session key;
[0271] The first data ciphertext is decrypted using the first session key to obtain a decrypted plaintext.
[0272] In one possible implementation, the verification module 1104 is specifically configured to:
[0273] Verify the signature data using the user certificate;
[0274] Use the authentication certificate to verify the user certificate and obtain the verification result.
[0275] In one possible implementation, the receiving module 1101 is further configured to receive second target data, where the second target data includes a message authentication code, an authentication key ciphertext, and a second target ciphertext. The second target ciphertext includes a second data ciphertext encrypted from the plaintext data and a second key ciphertext encrypted from the key for encrypting the plaintext data.
[0276] The acquisition module 1102 is further configured to acquire a second key and a third key distributed by a quantum key distribution device;
[0277] The decryption module 1103 is further configured to decrypt the second target ciphertext according to the second key to obtain a decrypted plaintext;
[0278] The verification module 1104 is further configured to perform authentication based on the third key, the message authentication code, and the authentication key ciphertext to obtain an authentication result.
[0279] In a possible implementation, the decryption module 1103 is specifically configured to:
[0280] decrypting the second key ciphertext using the second key to obtain a second session key;
[0281] The second data ciphertext is decrypted using the second session key to obtain decrypted plaintext.
[0282] In one possible implementation, the verification module 1104 is specifically configured to:
[0283] Decrypt the authentication key ciphertext using the third key to obtain the actual authentication key;
[0284] Authenticate the message authentication code using the actual authentication key.
[0285] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference can be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0286] The embodiment of the present application also provides a sending device 1200, such as Figure 12 As shown, a schematic diagram of the structure of a sending device 1200 provided in an embodiment of the present application includes: a processor 1201, a memory 1202, and optionally, a bus 1203. The memory 1202 stores machine-readable instructions executable by the processor 1201. When the sending device 1200 is running, the processor 1201 communicates with the memory 1202 via the bus 1203. When the machine-readable instructions are executed by the processor 1201, the steps of the data sending method described in any one of the above items are performed.
[0287] The embodiment of the present application also provides a receiving device 1300, such as Figure 13 As shown, a schematic diagram of the structure of a receiving device 1300 provided in an embodiment of the present application includes: a processor 1301, a memory 1302, and optionally, a bus 1303. The memory 1302 stores machine-readable instructions executable by the processor 1301. When the receiving device 1300 is running, the processor 1301 communicates with the memory 1302 via the bus 1303. When the machine-readable instructions are executed by the processor 1301, the steps of the data receiving method described in any one of the above items are performed.
[0288] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program executes the steps of the data sending method as described in any one of the above items, and executes the steps of the data receiving method as described in any one of the above items.
[0289] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0290] In addition, the functional units in the various embodiments of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0291] The above is only a specific implementation method of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the protection scope of the present application.
Claims
1. A data transmission method, characterized in that: Applied to a sending device, the method includes: If the sending device and the receiving device are not trusted, obtaining a first key distributed by a quantum key distribution device, and generating a public-private key pair based on a quantum-resistant cryptographic algorithm, the public-private key pair including a public key and a private key; Obtaining a user certificate from a certificate authority based on the public key, and generating signature data based on the plaintext data to be transmitted and the private key; generating a first target ciphertext according to the first key and the plaintext data, wherein the first target ciphertext includes: a first data ciphertext encrypted by the plaintext data and a first key ciphertext encrypted by the key for encrypting the plaintext data; First target data is sent to the receiving device according to a first preset encapsulation format, where the first target data includes: the signature data, the user certificate, and the first target ciphertext.
2. The method according to claim 1, characterized in that The generating of signature data according to the plaintext data to be transmitted and the private key includes: Performing a digest calculation on the plaintext data to obtain digest information; The summary information is signed using the private key to obtain the signature data.
3. The method according to claim 1, characterized in that Generating a first target ciphertext according to the first key and the plaintext data includes: Generate a first random number, and use the first random number as a first session key; Encrypting the plaintext data using the first session key to obtain the first data ciphertext; The first session key is encrypted using the first key to obtain the first key ciphertext.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: If the sending device and the receiving device are trustworthy, obtaining the second key and the third key distributed by the quantum key distribution device; Generating a message authentication code for the plaintext data to be transmitted, and encrypting an authentication code key corresponding to the message authentication code using the third key to obtain an authentication key ciphertext; generating a second target ciphertext based on the second key and the plaintext data, wherein the second target ciphertext includes: a second data ciphertext encrypted by the plaintext data and a second key ciphertext encrypted by the key for encrypting the plaintext data; Second target data is sent to the receiving device according to a second preset encapsulation format, where the second target data includes: the message authentication code, the authentication key ciphertext, and the second target ciphertext.
5. The method according to claim 4, characterized in that Generating a message authentication code for the plaintext data to be transmitted includes: Generate a second random number, and use the second random number as the authentication code key; A message authentication code for the plaintext data is generated using the authentication code key.
6. The method according to claim 4, characterized in that Generating a second target ciphertext according to the second key and the plaintext data includes: generating a third random number, and using the third random number as a second session key; Encrypting the plaintext data using the second session key to obtain the second data ciphertext; The second session key is encrypted using the second key to obtain the second key ciphertext.
7. A data receiving method, characterized in that: Applied to a receiving device, the method includes: Receive first target data, the first target data including signature data, a user certificate, and a first target ciphertext, the first target ciphertext including a first data ciphertext encrypted from plaintext data and a first key ciphertext encrypted from a key for encrypting the plaintext data; Obtaining a first key distributed by a quantum key distribution device, and obtaining an authentication certificate from a certificate authority, wherein the authentication certificate is generated by the certificate authority based on a public key sent by a sender device; Decrypting the first target ciphertext according to the first key to obtain a decrypted plaintext; Verification is performed based on the authentication certificate, the signature data, and the user certificate to obtain a verification result.
8. The method according to claim 7, characterized in that The decrypting the first target ciphertext according to the first key to obtain a decrypted plaintext includes: decrypting the first key ciphertext using the first key to obtain a first session key; The first data ciphertext is decrypted using the first session key to obtain the decrypted plaintext.
9. The method according to claim 7, characterized in that The verification is performed according to the authentication certificate, the signature data, and the user certificate to obtain a verification result, including: verifying the signature data using the user certificate; The user certificate is verified using the authentication certificate to obtain a verification result.
10. The method according to any one of claims 7 to 9, characterized in that: The method further comprises: receiving second target data, the second target data including: a message authentication code, an authentication key ciphertext, and a second target ciphertext, the second target ciphertext including: a second data ciphertext encrypted from the plaintext data and a second key ciphertext encrypted from the key for encrypting the plaintext data; Obtaining a second key and a third key distributed by a quantum key distribution device; decrypting the second target ciphertext according to the second key to obtain a decrypted plaintext; Authentication is performed according to the third key, the message authentication code, and the authentication key ciphertext to obtain an authentication result.
11. The method according to claim 10, characterized in that The decrypting the second target ciphertext according to the second key to obtain a decrypted plaintext includes: decrypting the second key ciphertext using the second key to obtain a second session key; The second data ciphertext is decrypted using the second session key to obtain the decrypted plaintext.
12. The method according to claim 10, characterized in that The performing authentication according to the third key, the message authentication code, and the authentication key ciphertext to obtain an authentication result includes: Decrypting the authentication key ciphertext using the third key to obtain the actual authentication key; The message authentication code is authenticated using the actual authentication key.
13. A sending device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the sending device is running, the processor executes the machine-readable instructions to perform the steps of the data sending method according to any one of claims 1 to 6.
14. A receiving device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the receiving device is running, the processor executes the machine-readable instructions to perform the steps of the data receiving method according to any one of claims 7 to 12.
15. A data transmission system, characterized in that: The invention comprises the sending device according to claim 13 and the receiving device according to claim 14.
Citation Information
Patent Citations
Hybrid secret key packaging method and system
CN119483934A
Battery module and battery pack including the same and vehicle including the same
KR1020250146423A