A blockchain transaction signature and verification method and device supporting quantum security
By using the key encapsulation mechanism to protect transaction data in the blockchain system, the security problems of traditional asymmetric encryption algorithms in front of quantum computers are solved, and higher anti-quantum attack security performance and data security are achieved.
Patent Information
- Application Number
- CN202411667136.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-11-21
AI Technical Summary
Traditional asymmetric encryption algorithms are at risk of being cracked in front of quantum computers. The existing post-quantum signature algorithms have shortcomings in terms of computing efficiency, key length and signature size, and cannot effectively improve the quantum security of blockchains.
By using a key encapsulation mechanism between the client device and the target node of the blockchain, the session key is generated and the encapsulated ciphertext is protected by using the session key to ensure the security of the data during transmission.
It improves the anti-quantum attack security performance of blockchain systems, enhances the security of transaction data and system reliability, and ensures long-term data security.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of quantum security technology, and in particular to a blockchain transaction signature and verification method and device that supports quantum security. Background Art
[0002] In the practice of modern blockchain systems, security is the cornerstone for building trust and ensuring the safety of user assets. Leading public blockchain projects such as Ethereum, as well as private or consortium blockchain projects such as Hyperledger Fabric and Corda, have widely adopted asymmetric encryption algorithms in their core operations. Traditionally, asymmetric encryption algorithms such as the elliptic curve digital signature algorithm (ECDSA) and RSA (proposed by Rivest, Shamir, and Adleman) are important components of blockchain network security architecture, responsible for ensuring transaction authenticity, node identity authentication, and data encryption.
[0003] ECDSA is used in mainstream blockchain platforms such as Ethereum to generate public and private key pairs, which are used to verify the identity of the transaction initiator during the transaction signing process. Although the RSA algorithm is not as widely used as ECDSA in the blockchain field, it is still regarded as an important cryptographic system due to its long-standing application in the traditional digital security field, especially in enterprise-level blockchain solutions.
[0004] However, with the development of quantum computing technology, traditional asymmetric encryption algorithms face the risk of being cracked by quantum computers. At present, although there are multiple post-quantum signature algorithms (such as Falcon, Dilithium, etc.) that can be used to replace the ECDSA / RSA algorithm, they are still insufficient in terms of computing efficiency, computing loss, key length, and signature size. Although the key encapsulation mechanism (KEM) in the post-quantum algorithm is usually used for key negotiation or distribution, it has advantages in key length, generation speed, encapsulation and decapsulation efficiency, and implicit identity authentication capabilities. It has become a potential option for replacing the ECDSA / RSA algorithm or integrating it with it in some cases to improve the quantum security of blockchain. Summary of the invention
[0005] In order to solve the above problems, the present application proposes a blockchain transaction signature and verification method and device that supports quantum security, and an electronic device, which can realize transaction signature and verification that supports quantum security in the blockchain, thereby improving the system's anti-quantum attack security performance.
[0006] In a first aspect, the present application provides a blockchain transaction signature and verification method that supports quantum security, which is applied to a client device that performs a transaction, and the method includes:
[0007] Signing the original data for the transaction using the second encryption private key of the client device to obtain the first data;
[0008] Using the session key to symmetrically encrypt the first data to obtain the second data;
[0009] The second data and the encapsulated ciphertext are sent to the target node, so that the target node decrypts the second data according to the first encapsulated private key corresponding to the first encapsulated public key and the second encrypted public key corresponding to the second encrypted private key to obtain the original data.
[0010] Therefore, the present application uses the second encrypted private key of the client device in the client device to perform the first encryption protection on the original data of the transaction when the client device and the target node in the blockchain conduct a transaction; at the same time, the key encapsulation mechanism is combined in the client device, and the first encrypted public key of the target node is used to generate a session key and an encapsulated ciphertext based on the key encapsulation mechanism, and the session key is used to perform the second encryption protection on the original data. Finally, the client device sends the twice-encrypted original data and the encrypted session key (i.e., the encapsulated ciphertext) to the target node, so that the target node uses the decrypted session key and the second encrypted public key to perform the second decryption and restore to obtain the original data. Since the original data is twice encrypted based on the key encapsulation mechanism during the transmission process, the system's anti-quantum attack security performance can be improved.
[0011] In a second aspect, the present application provides a blockchain transaction signature and verification method that supports quantum security, which is applied to a target node in a blockchain for a transaction, and the method includes:
[0012] receiving second data and encapsulated ciphertext sent by the client device; the second data is obtained by twice encrypting the original data of the transaction based on the second encryption private key and the session key of the client device respectively, the session key and the encapsulated ciphertext are generated by the first encryption public key of the target node based on the post-quantum key encapsulation algorithm, and the encapsulated ciphertext is an encrypted representation of the session key encrypted based on the first encapsulated public key of the target node;
[0013] Decrypt the encapsulated ciphertext using the first encapsulated private key of the target node to obtain the session key;
[0014] The second data is decrypted twice in succession using the session key and the second encryption public key of the client device to obtain the original data.
[0015] In a third aspect, the present application provides a blockchain transaction signature and verification device that supports quantum security, which is deployed on a client device that performs transactions, and the device includes:
[0016] A session key generation module, used to generate a session key and a packaged ciphertext using a first encrypted public key of a target node in a blockchain; the session key and the packaged ciphertext are generated based on a post-quantum key package algorithm, and the packaged ciphertext is an encrypted representation of the session key after being encrypted based on the first packaged public key of the target node;
[0017] A one-time encryption module, used to sign the original data for the transaction using the second encryption private key of the client device to obtain the first data;
[0018] A secondary encryption module, used to symmetrically encrypt the first data using the session key to obtain the second data;
[0019] The sending module is used to send the second data and the encapsulated ciphertext to the target node, so that the target node decrypts the second data according to the first encapsulated private key corresponding to the first encapsulated public key and the second encrypted public key corresponding to the second encrypted private key to obtain the original data.
[0020] In a fourth aspect, the present application provides a blockchain transaction signature and verification device that supports quantum security, which is deployed on a target node in a blockchain where a transaction is conducted, and the device includes:
[0021] A receiving module, used to receive second data and encapsulated ciphertext sent by a client device; the second data is obtained by double-encrypting the original data of the transaction based on the second encryption private key and the session key of the client device respectively, the session key and the encapsulated ciphertext are generated by the first encryption public key of the target node based on the post-quantum key encapsulation algorithm, and the encapsulated ciphertext is an encrypted representation of the session key encrypted based on the first encapsulated public key of the target node;
[0022] A one-time decryption module, used to decrypt the encapsulated ciphertext using the first encapsulated private key of the target node to obtain a session key;
[0023] The secondary decryption module is used to decrypt the second data twice in succession using the session key and the second encryption public key of the client device to obtain the original data.
[0024] In a fifth aspect, the present application provides an electronic device, comprising: at least one memory for storing programs; and at least one processor for executing the programs stored in the memory; wherein, when the programs stored in the memory are executed, the processor is used to execute the method described in the first aspect or any possible implementation of the first aspect, and execute the method described in the second aspect or any possible implementation of the second aspect.
[0025] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0027] Figure 1 This is a system architecture diagram of a combination of KEM and ECDSA / RSA provided in an embodiment of the present application;
[0028] Figure 2 This is a schematic diagram of a blockchain transaction signature and verification method supporting quantum security provided by an embodiment of the present application;
[0029] Figure 3 This is a flowchart of a blockchain transaction signature and verification method supporting quantum security provided by an embodiment of the present application;
[0030] Figure 4 This is a flowchart of another blockchain transaction signature and verification method supporting quantum security provided by an embodiment of the present application;
[0031] Figure 5 This is a framework diagram of a blockchain transaction signature and verification device supporting quantum security provided by an embodiment of the present application;
[0032] Figure 6 This is a framework diagram of another blockchain transaction signature and verification device that supports quantum security provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] 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 described below in conjunction with the accompanying drawings.
[0034] In the description of the embodiments of the present application, words such as "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a concrete way.
[0035] In the description of the embodiments of the present application, the term "and / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the term "multiple" means two or more. For example, multiple systems refers to two or more systems, and multiple screen terminals refers to two or more screen terminals.
[0036] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprises", "has" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0037] Asymmetric encryption is a key encryption system that uses a pair of keys, a public key for encryption and a private key for decryption. The public key can be made public, but the private key must be kept secret. Traditional asymmetric encryption algorithms (such as ECDSA and RSA) may not be safe in the face of quantum computers, so it is particularly important to study post-quantum asymmetric encryption algorithms.
[0038] Post-quantum algorithms refer to encryption algorithms that can remain secure even in the face of the powerful computing power of quantum computers in the era of quantum computing. In post-quantum cryptography, KEM is often used in combination with certain encryption algorithms (such as symmetric encryption algorithms) to provide a complete secure communication solution. It uses asymmetric encryption algorithms to securely encapsulate (i.e., encrypt) the keys required for symmetric encryption, and then uses symmetric encryption algorithms for encrypted data communication.
[0039] In the KEM key encapsulation mechanism, the initiator runs an encapsulation algorithm to generate a session key and the corresponding ciphertext, also known as session key encapsulation, and then sends the session key encapsulation to the receiver. The receiver runs the decapsulation algorithm to obtain the same session key as the initiator. In this process, it is necessary to ensure that the session keys obtained by both parties must be consistent and fresh, and the relevant information of the session key will not be leaked.
[0040] In view of the fact that the above-mentioned traditional asymmetric encryption algorithm may not be safe in front of quantum computers, therefore, when the client device and the target node in the blockchain conduct transactions, this solution uses the second encrypted private key of the client device in the client device to perform the first encryption protection on the original data of the transaction; at the same time, in the client device, the first encrypted public key of the target node is combined with the key encapsulation mechanism to generate the session key and the encapsulated ciphertext based on the key encapsulation mechanism, and the session key is used to perform the second encryption protection on the original data. Finally, the client device sends the twice-encrypted original data and the encrypted session key (i.e., the encapsulated ciphertext) to the target node, so that the target node uses the decrypted session key and the second encrypted public key to perform the second decryption and restore to obtain the original data. Since the original data is twice encrypted based on the key encapsulation mechanism during the transmission process, the system's anti-quantum attack security performance can be improved.
[0041] For example, Figure 1 A system architecture diagram of a combination of KEM and ECDSA / RSA provided in an embodiment of the present application is shown in FIG. Figure 1 As shown in the figure, the system includes a blockchain composed of multiple blockchain nodes, a client device that initiates transactions, a certificate authority (CA), and a membership service provider (MSP).
[0042] The target node for the transaction is any node in multiple blockchain nodes, and the blockchain is any blockchain that uses an asymmetric encryption algorithm, such as Hyperledger Fabric. The client device is the user node that initiates the transaction, and the client device and the target node perform the transaction signature and verification process during the transaction.
[0043] CA is the institution that issues certificates and is responsible for issuing qualified digital certificates for client devices and multiple blockchain nodes. Digital certificates can prove the identity of an entity and the legitimacy of its public key, as well as the matching relationship between the entity and the public key. MSP is a management platform that provides management services for blockchains. It provides a framework for different entities to be authenticated and authorized in blockchains. It is responsible for managing digital certificates and related keys, as well as defining which certificates are considered valid and their scope.
[0044] The following will take the Hyperledger Fabric blockchain as an example to explain this solution in detail.
[0045] In this embodiment, before the client device initiates a transaction, the client device and each blockchain node introduce a dual identity authentication process by combining KEM with a certificate-based authentication mechanism.
[0046] In the identity authentication process, taking the client device as an example (also applicable to each blockchain node), first, the client device uses the ECDSA / RSA algorithm to generate a second public-private key pair, and then provides the necessary identity authentication information to the CA organization to apply for a digital certificate based on the second ECDSA / RSA public key. After the CA organization verifies the identity of the client device and the authenticity of the second ECDSA / RSA public key (for example: reviewing the identity document submitted by the client device. Verifying the domain name or server control of the client device, etc.), it issues the first digital certificate. The client device uses the first digital certificate obtained to apply to the blockchain's MSP to join the network. The MSP verifies the validity of the digital certificate according to its own rules. If the verification passes, the node is accepted to join the network and is assigned corresponding roles and permissions.
[0047] Secondly, for client devices that have joined the network, the KEM algorithm is now used to generate another pair of public and private keys in order to take advantage of quantum security. The client device submits a certificate application containing the second KEM-encapsulated public key to the CA. After the CA verifies the identity of the client device and the authenticity of the second KEM-encapsulated public key, it issues a second digital certificate.
[0048] The client device registers the first digital certificate based on the second ECDSA / RSA public key and the second digital certificate of the second KEM encapsulated public key into the blockchain for use in subsequent signing and verification processes. It can be understood that the digital certificate of the client device includes the first digital certificate and the second digital certificate.
[0049] The client device does not download the certificates of all nodes before interacting with other nodes (such as conducting transactions or contract execution). During the interaction process, if an unknown node is encountered, the client device will request the digital certificate of the node in real time. After receiving the certificate, the client device will verify the authenticity and validity of its signature.
[0050] Finally, in the actual interaction scenario, the client device verifies the authenticity and validity of the digital certificate sent by other nodes. This verification includes: checking the validity period of the digital certificate, confirming whether the CA organization that signed the certificate is credible, etc. If the certificate is valid, the client device caches the digital certificate in the local digital certificate list for subsequent interactions with the node.
[0051] The client device will recycle old or no longer used certificates and only save the certificates of active nodes or nodes with frequent interactions. The client device will update the certificate cache according to specific policies (such as a period of time before the certificate is about to expire).
[0052] Thus, by combining KEM with a certificate-based authentication mechanism, a dual authentication mechanism is introduced in the blockchain. In this mechanism, the client device first performs the first authentication through the traditional certificate authentication mechanism, and then performs the second authentication through the key pair generated by KEM. This dual authentication strategy greatly improves the security level of authentication and increases the difficulty for attackers to successfully forge identities, so that the authentication process can maintain a strong security line even in the face of advanced quantum computing attacks.
[0053] Based on the above operations, when the client device enters the transaction phase, the client device and the target node can execute the following Figure 2 The transaction signing and verification process shown.
[0054] For example, Figure 2 A schematic diagram of a blockchain transaction signature and verification method supporting quantum security provided in an embodiment of the present application is shown in FIG.
[0055] like Figure 2 As shown, the client device Alice and the target node Bob have completed key generation and network registration respectively. The key pair generated by the client device Alice in the identity authentication process includes: the second ECDSA / RSA private key and the second ECDSA / RSA public key, the second KEM-encapsulated public key and the second KEM-encapsulated private key. Similarly, the key pair generated by the target node Bob in the identity authentication process includes: the first ECDSA / RSA private key and the first ECDSA / RSA public key, the first KEM-encapsulated public key and the first KEM-encapsulated private key.
[0056] The use of signatures and verification in the entire blockchain system is an important part of its core security features. They ensure that activities in the blockchain network are traceable, transparent, and cannot be tampered with. The following is an introduction to signature verification for transaction data:
[0057] In the first step, before initiating a transaction, the client device can obtain the digital certificate of the target node by querying the digital certificate list stored in the local cache, or receive the digital certificate sent by the target node for the first time.
[0058] In the second step, when the client device initiates a transaction, it first uses the first ECDSA / RSA public key of the target node to generate a session key through the KEM encapsulation function, and then uses the first KEM encapsulation public key of the target node to encapsulate it into an encapsulated ciphertext.
[0059] In the third step, the client device uses its own second ECDSA / RSA private key to sign the original transaction data (first encryption protection), and then uses the generated session key to symmetric encrypt the signed transaction data (including the original data and signature) (second encryption protection) to protect the security of the transaction content.
[0060] In the fourth step, the client sends the encapsulated ciphertext generated in the second step and the transaction data C obtained after double encryption in the third step to the target node.
[0061] In the fifth step, after receiving the encrypted transaction data C, the target node first uses the first KEM encapsulation private key to decapsulate the received encapsulated ciphertext to obtain the session key, and then uses the session key to decrypt the original data and signature.
[0062] In the sixth step, the target node uses the second ECDSA / RSA public key of the client device to verify the validity of the signature to ensure the authenticity and integrity of the transaction.
[0063] If the verification is successful, the target node broadcasts the original data of the transaction to other nodes in the network for consensus and confirmation. After receiving the transaction data, other nodes will also verify the signature and consensus confirmation. If the entire network reaches a consensus, the transaction data is added to a new block and the new block is added to the blockchain.
[0064] After the transaction is completed, the target node will send a confirmation message to the client device to inform it that the transaction has been successfully completed. After receiving the confirmation message, the client device will update the local account balance and transaction record.
[0065] Therefore, by combining the KEM algorithm with the ECDSA / RSA algorithm, a KEM-ECDSA / RSA dual encryption mechanism is implemented for the signing and verification (signature verification) stages. KEM is responsible for generating high-entropy session keys and transmitting them securely, providing additional protection for the security of session keys under the threat of quantum computers.
[0066] ECDSA / RSA is responsible for signing transaction data to ensure the integrity of the original transaction data and the verification of the sender's identity. This combination takes advantage of the efficiency of KEM in key transmission and the mature stability of ECDSA / RSA in data signature, thus realizing an efficient and secure transaction verification mechanism, which not only improves the security level of identity authentication, but also enhances the trust and security of the entire network.
[0067] Since different blockchain implementations may use different mechanisms for identity management and verification, for example, the Hyperledger Fabric in this embodiment is a permissioned blockchain network that uses more traditional authentication methods, including digital certificates. These certificates are issued by recognized CA organizations and are used for identity authentication and transaction signature verification. Ethereum is a permissionless (public) blockchain network that does not rely on traditional digital certificates for identity authentication. For Ethereum or other blockchain implementations, if CA components and digital certificates are not involved, similar solutions can be used to implement the same design concept as this solution to achieve the same technical effect as this solution, so no further introduction is given here.
[0068] Next, based on the above analysis, a blockchain transaction signature and verification method supporting quantum security provided by an embodiment of the present application is introduced in detail.
[0069] For example, Figure 3 A flowchart of a blockchain transaction signature and verification method supporting quantum security provided by an embodiment of the present application is shown. The method is applied to a client device conducting a transaction.
[0070] Exemplarily, before conducting a transaction, both parties conducting the transaction: the client device and the target node need to register in the blockchain, wherein the target node is any blockchain node in the blockchain.
[0071] Specifically, taking the client device as an example (also applicable to the target node), on the one hand, the client device generates an asymmetric encryption key pair: a second encryption public key and a second encryption private key. And sends the second encryption public key and the client's identity authentication information to the CA organization (i.e., the certificate issuing organization). In response to the identity authentication information being verified by the CA organization, the first digital certificate including the second encryption public key issued by the CA organization is received.
[0072] On the other hand, the client device generates a KEM encapsulation key pair: a second encapsulation public key and a second encapsulation private key (i.e., a second KEM encapsulation public key and a second KEM encapsulation private key). The second encapsulation public key and the identity authentication information of the client are sent to the CA organization. In response to the identity authentication information being verified by the CA organization, a second digital certificate including the second KEM second encapsulation public key issued by the CA is received. It can be understood that the digital certificate of the client device includes the first digital certificate and the second digital certificate.
[0073] The public key in an asymmetric encryption key pair or a KEM-wrapped key pair can be made public in the blockchain, while the private key remains confidential. Data encrypted with the private key can only be decrypted with the public key, and vice versa.
[0074] Further, the client device sends the first digital certificate and the second digital certificate to the MSP of the blockchain. In response to the first digital certificate and the second digital certificate being verified by the member management service provider, a registration confirmation message sent by the member management service provider is received. Based on the registration role and authority included in the registration confirmation message, such as a full node or a regional node, registration is performed in the blockchain.
[0075] Correspondingly, the target node generates a first encryption public key and a first encryption private key pair, and a first encapsulation public key and a first encapsulation private key pair (ie, a first KEM encapsulation public key and a first KEM encapsulation private key pair) by performing a similar identity registration process.
[0076] Exemplarily, before conducting a transaction, the client device also needs to check the legitimacy of the digital certificate of the target node that is first sent by the target node or in the local cache.
[0077] Exemplarily, before conducting a transaction, the client device also needs to update the digital certificate in the local cache according to a preset policy.
[0078] Based on the above operations, the blockchain transaction signature and verification after entering the transaction mainly includes the following steps:
[0079] Step S301, using the first encrypted public key of the target node in the blockchain to generate a session key and a sealed ciphertext. The session key and sealed ciphertext are generated based on a post-quantum key sealing algorithm, and the sealed ciphertext is an encrypted representation of the session key encrypted based on the first sealed public key of the target node.
[0080] In this embodiment, the target node is any blockchain node in the blockchain, and the blockchain can be a Hyperledger Fabric blockchain. The first encrypted public key is Figure 2 The first ECDSA / RSA public key generated by the target node Bob in the identity authentication process is as follows: Figure 2 The first KEM-encapsulated public key generated by the target node Bob is shown.
[0081] Exemplarily, the post-quantum key encapsulation algorithm is a KEM encapsulation algorithm. In this solution, the KEM encapsulation algorithm is used to securely exchange keys through an untrusted channel in a public network environment. The KEM encapsulation algorithm includes three main steps:
[0082] The first step is key encapsulation: the sending client device Alice uses the first encryption public key of the target node Bob to generate a pair of "session key" and "encapsulation ciphertext" based on the KEM encapsulation algorithm.
[0083] Specifically, the first encryption public key of the target node Bob in the blockchain is used to generate a session key based on the KEM encapsulation algorithm, and the session key is encapsulated using the first KEM encapsulation public key generated by the target node Bob to obtain an encapsulated ciphertext. The session key is a symmetric encryption key used for subsequent communications, and the encapsulated ciphertext is an encrypted representation of the session key, which can only be decrypted by the receiving target node Bob.
[0084] Step 2, key transmission: The sender client device Alice sends the encapsulated ciphertext to the receiver target node Bob. Because it is encrypted with the first KEM encapsulation public key of the receiver target node Bob, only the receiver target node Bob can decrypt it to recover the session key.
[0085] The third step is key decapsulation: the receiver uses its first KEM encapsulation private key to decrypt the received encapsulated ciphertext to obtain the session key. Then, the communicating parties can use this session key for subsequent symmetric encryption communication.
[0086] In the following step S304, the client device executes the second step to make the target node execute the third step. In this process, the asymmetric encapsulation and transmission of the session key can ensure that the session keys obtained by both parties of the transaction are consistent and fresh, and the relevant information of the session key will not be leaked. In this way, the anti-quantum attack security performance of the system can be improved.
[0087] Step S302: Use the second encryption private key of the client device to sign the original data for the transaction to obtain the first data.
[0088] In this embodiment, the second encrypted private key is a second ECDSA / RSA private key generated by the client device during the identity authentication process.
[0089] For example, the original data m for transaction can be signed by using the second ECDSA / RSA private key, that is, the first encryption protection is provided to obtain the first data. The first encryption process is an encryption process based on an asymmetric encryption algorithm.
[0090] By using asymmetric encryption for digital signatures, the sender client device Alice uses its second ECDSA / RSA private key to sign the original data of the transaction, and the recipient target node Bob can verify the validity of the signature through the second ECDSA / RSA public key to ensure the source and integrity of the original data of the transaction.
[0091] Step S303: Use the session key to symmetrically encrypt the first data to obtain the second data.
[0092] In this embodiment, the session key is used to perform symmetric encryption on the first data to obtain the second data. Symmetric encryption is a second encryption protection performed by the client device on the original data to obtain the second data, that is, the encrypted transaction data C.
[0093] Exemplarily, the first data is symmetrically encrypted using the session key generated in step S301. Since the KEM algorithm is combined with the ECDSA / RSA algorithm, a KEM-ECDSA / RSA double encryption mechanism is implemented in the transaction signature link.
[0094] Step S304, sending the second data and the encapsulated ciphertext to the target node, so that the target node decrypts the second data according to the first encapsulated private key corresponding to the first encapsulated public key and the second encrypted public key corresponding to the second encrypted private key to obtain the original data.
[0095] In this embodiment, the second data and the encapsulated ciphertext are sent to the target node through an untrusted channel. The first encapsulated public key and the first encapsulated private key are respectively the first KEM encapsulated public key and the first KEM encapsulated private key of the target node Bob. The second encrypted private key and the second encrypted public key are respectively the second ECDSA / RSA private key and the second ECDSA / RSA public key of the client device Alice.
[0096] Thus, the target node Bob uses the first KEM encapsulation private key to decapsulate the encapsulated ciphertext to obtain the session key, and uses the session key to decrypt the encrypted transaction data C using the session key generated in step S301 for the first time to obtain the ECDSA / RSA signed transaction data. Then, the second encryption public key is used to symmetrically decrypt the ECDSA / RSA signed transaction data to obtain the original transaction data m.
[0097] By combining the KEM algorithm with the ECDSA / RSA algorithm, the KEM-ECDSA / RSA dual decryption mechanism is implemented in the transaction verification process. This improves the security of data transmission in untrusted channels and enables the system to resist quantum attacks.
[0098] For example, in addition to transaction signature and verification, the dual verification mechanism can also be used in the following situations in the blockchain, for example:
[0099] Smart contract deployment: When deploying or executing a smart contract, the initiator is usually required to sign the contract code and initial parameters.
[0100] Consensus mechanism: In some consensus algorithms, such as Practical Byzantine Fault Tolerance (PBFT) or its variants, nodes send messages to each other during the consensus process, and these messages need to be signed and verified to ensure that they have not been tampered with.
[0101] Node Permission and Revocation: In many private or consortium chains, new nodes joining the blockchain network must provide proof of identity signed by a trusted CA. In addition, when a node's behavior does not comply with the policy or is considered malicious, its certificate can be revoked, which is also a process that requires a signature operation.
[0102] Data sharing and privacy protection: If the blockchain platform supports data privacy, the data owner needs to grant access rights through signature when sharing private data with authorized parties, and the recipient may need to sign and confirm the access request.
[0103] Chaincode / smart contract upgrade: When upgrading a chaincode or smart contract, the entity that submits the upgrade proposal needs to sign the proposal, and other nodes need to verify this signature to ensure that the proposal is initiated by an authorized entity.
[0104] Status update: In some blockchain systems, when updating and maintaining the network status, such as updating the ledger or synchronizing the status between nodes, a signature may be required to prove the legitimacy of the status update.
[0105] Interactive verification (cross-chain operations or side chains): When conducting cross-chain cloud games or interacting with side chains, the information, assets or other data transmitted between chains need to be signed and verified to maintain the security and mutual trust of multi-chain operations.
[0106] For example, the KEM algorithm in this solution can flexibly switch between traditional signature verification and authentication options based on ECDSA / RSA and options that support additional quantum-safe algorithms through configuration options. This provides the possibility of a smooth quantum-safe transition or upgrade for blockchain systems.
[0107] Compared with the prior art, the solution involved in this application mainly includes the following advantages:
[0108] 1. Anti-quantum attack capability: By combining KEM and ECDSA / RSA algorithms, this solution significantly improves the security protection capability of the blockchain system against potential quantum computing attacks, ensuring long-term data security and system reliability.
[0109] 2. Computing and storage optimization: This solution reduces the computing complexity and storage resource requirements by optimizing the encryption and decryption process, so that even resource-constrained devices can efficiently participate in the blockchain network, expanding the application scope of blockchain technology.
[0110] 3. Enhanced security: By introducing a two-factor authentication mechanism, this solution significantly improves the security of the identity authentication process and provides a more robust security guarantee for blockchain transactions and communications.
[0111] For example, Figure 4 A flowchart of another blockchain transaction signature and verification method supporting quantum security provided by an embodiment of the present application is shown. The method is applied to the target node in the blockchain for the transaction, and mainly includes the following steps:
[0112] Step S401, receiving the second data and the encapsulated ciphertext sent by the client device. The second data is obtained by encrypting the original data of the transaction twice based on the second encryption private key and the session key of the client device respectively, the session key and the encapsulated ciphertext are generated by the first encryption public key of the target node based on the post-quantum key encapsulation algorithm, and the encapsulated ciphertext is an encrypted representation of the session key encrypted based on the first encapsulated public key of the target node.
[0113] Step S402: Decrypt the encapsulated ciphertext using the first encapsulated private key of the target node to obtain a session key.
[0114] Step S403: Decrypt the second data twice using the session key and the second encryption public key of the client device to obtain the original data.
[0115] The contents of the above steps S401-S403 are similar to those of steps S301-S304, and will not be described in detail.
[0116] Based on the method in the above embodiment, illustratively, Figure 5 The following is a diagram showing a framework of a blockchain transaction signature and verification device supporting quantum security provided by an embodiment of the present application. The device is deployed on a client device that performs a transaction, such as Figure 5 As shown, the device 500 includes:
[0117] The session key generation module 510 is used to generate a session key and a sealed ciphertext using the first encrypted public key of the target node in the blockchain. The session key and the sealed ciphertext are generated based on the post-quantum key sealing algorithm, and the sealed ciphertext is an encrypted representation of the session key after being encrypted based on the first sealed public key of the target node.
[0118] The one-time encryption module 520 is used to use the second encryption private key of the client device to sign the original data of the transaction to obtain the first data.
[0119] The secondary encryption module 530 is used to symmetrically encrypt the first data using the session key to obtain the second data.
[0120] The sending module 540 is used to send the second data and the encapsulated ciphertext to the target node, so that the target node decrypts the second data according to the first encapsulated private key corresponding to the first encapsulated public key and the second encrypted public key corresponding to the second encrypted private key to obtain the original data.
[0121] For example, Figure 6 The following is a framework diagram of another blockchain transaction signature and verification device supporting quantum security provided by an embodiment of the present application. The device is deployed on the target node in the blockchain where the transaction is being conducted, such as Figure 6 As shown, the device 600 includes:
[0122] The receiving module 610 is used to receive the second data and the encapsulated ciphertext sent by the client device. The second data is obtained by encrypting the original data of the transaction twice based on the second encryption private key and the session key of the client device respectively, the session key and the encapsulated ciphertext are generated by the first encryption public key of the target node based on the post-quantum key encapsulation algorithm, and the encapsulated ciphertext is an encrypted representation of the session key encrypted based on the first encapsulated public key of the target node.
[0123] The one-time decryption module 620 is used to decrypt the encapsulated ciphertext using the first encapsulation private key of the target node to obtain a session key.
[0124] The secondary decryption module 630 is used to decrypt the second data twice in succession using the session key and the second encryption public key of the client device to obtain the original data.
[0125] Based on the method in the above embodiment, an embodiment of the present application provides an electronic device. The electronic device may include: at least one memory for storing a program; at least one processor for executing the program stored in the memory. Wherein, when the program stored in the memory is executed, the processor is used to execute the method described in the above embodiment. Exemplarily, the electronic device may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, a server, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook, and a cellular phone, a personal digital assistant (personal digital assistant, PDA), an augmented reality (augmented reality, AR) device, a virtual reality (virtual reality, VR) device, an artificial intelligence (artificial intelligence, AI) device, a wearable device, a vehicle-mounted device, a smart home device and / or a smart city device. The embodiment of the present application does not impose any special restrictions on the specific type of the electronic device.
[0126] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
[0127] It is understood that the various numerical numbers involved in the embodiments of the present application are only for the convenience of description and are not used to limit the scope of the embodiments of the present application. It should be understood that in the embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0128] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present application should be included in the scope of protection of the present application.
Claims
1. A blockchain transaction signature and verification method supporting quantum security, characterized in that: The method is applied to a client device for conducting a transaction, and the method comprises: Generate a session key and an encapsulation ciphertext using the first encrypted public key of the target node in the blockchain; the session key and the encapsulation ciphertext are generated based on a post-quantum key encapsulation algorithm, the encapsulation ciphertext is an encrypted representation of the session key encrypted based on the first encapsulation public key of the target node, and the session key is generated by the first ECDSA / RSA public key of the target node through a KEM encapsulation function; Using the second encryption private key of the client device to sign the original data for the transaction to obtain first data; Using the session key to symmetrically encrypt the first data to obtain second data; The second data and the encapsulated ciphertext are sent to the target node, so that the target node decrypts the second data according to the first encapsulated private key corresponding to the first encapsulated public key and the second encrypted public key corresponding to the second encrypted private key to obtain the original data.
2. The method according to claim 1, characterized in that Before the transaction is performed, the method further includes: registering in said blockchain; Check the legitimacy of the digital certificate of the target node that is first sent by the target node or in the local cache; the digital certificate of the target node includes the first encryption public key and the first encapsulation public key.
3. The method according to claim 2, characterized in that Before the transaction is conducted, the method further includes: updating the digital certificate in the local cache according to a preset strategy.
4. The method according to claim 2, characterized in that: The registering in the blockchain comprises: Generate the second encrypted public key and the second encrypted private key; Sending the second encrypted public key and the identity authentication information of the client to a certificate issuing authority; In response to the identity authentication information being verified by the certificate issuing authority, receiving a first digital certificate issued by the certificate issuing authority and including the second encrypted public key; Registering in the blockchain using at least the first digital certificate.
5. The method according to claim 4, characterized in that The registering in the blockchain using at least the first digital certificate comprises: Generate a second encapsulation public key of the client device and a second encapsulation private key corresponding to the second encapsulation public key; Sending the second encapsulated public key and the identity authentication information of the client to a certificate issuing authority; In response to the identity authentication information being verified by the certificate issuing authority, receiving a second digital certificate issued by the certificate issuing authority and including the second encapsulated public key; The first digital certificate and the second digital certificate are used to register in the blockchain.
6. The method according to claim 5, characterized in that The registering in the blockchain using the first digital certificate and the second digital certificate comprises: Sending the first digital certificate and the second digital certificate to a member management service provider of the blockchain; In response to the first digital certificate and the second digital certificate being verified by the member management service provider, receiving a registration confirmation message sent by the member management service provider; Registration is performed in the blockchain based on the registration role and authority included in the registration confirmation message.
7. A blockchain transaction signature and verification method supporting quantum security, characterized in that: The method is applied to a target node in a blockchain for a transaction, and the method comprises: Receive second data and encapsulated ciphertext sent by the client device; the second data is obtained by double-encrypting the original data of the transaction based on the second encryption private key and the session key of the client device respectively, the session key and the encapsulated ciphertext are generated by the first encryption public key of the target node based on the post-quantum key encapsulation algorithm, the encapsulated ciphertext is an encrypted representation of the session key encrypted based on the first encapsulation public key of the target node, and the session key is generated by the first ECDSA / RSA public key of the target node through the KEM encapsulation function; Decrypting the encapsulated ciphertext using the first encapsulated private key of the target node to obtain the session key; The second data is decrypted twice in succession using the session key and the second encryption public key of the client device to obtain the original data.
8. A blockchain transaction signature and verification device supporting quantum security, characterized in that: The device is deployed on a client device for conducting transactions, and comprises: A session key generation module, used to generate a session key and an encapsulation ciphertext using the first encrypted public key of the target node in the blockchain; the session key and the encapsulation ciphertext are generated based on a post-quantum key encapsulation algorithm, the encapsulation ciphertext is an encrypted representation of the session key after being encrypted based on the first encapsulation public key of the target node, and the session key is generated by the first ECDSA / RSA public key of the target node through a KEM encapsulation function; A one-time encryption module, used to sign the original data for the transaction using the second encryption private key of the client device to obtain the first data; A secondary encryption module, used to symmetrically encrypt the first data using the session key to obtain second data; A sending module is used to send the second data and the encapsulated ciphertext to the target node, so that the target node decrypts the second data according to the first encapsulated private key corresponding to the first encapsulated public key and the second encrypted public key corresponding to the second encrypted private key to obtain the original data.
9. A blockchain transaction signature and verification device supporting quantum security, characterized in that: The device is deployed at a target node in a blockchain for a transaction, and includes: A receiving module, used to receive second data and encapsulated ciphertext sent by a client device; the second data is obtained by respectively performing secondary encryption on the original data of the transaction based on the second encryption private key and the session key of the client device, the session key and the encapsulated ciphertext are generated by the first encryption public key of the target node based on the post-quantum key encapsulation algorithm, the encapsulated ciphertext is an encrypted representation of the session key encrypted based on the first encapsulated public key of the target node, and the session key is generated by the first ECDSA / RSA public key of the target node through a KEM encapsulation function; A one-time decryption module, used to decrypt the encapsulated ciphertext using the first encapsulated private key of the target node to obtain the session key; The secondary decryption module is used to decrypt the second data twice in succession using the session key and the second encryption public key of the client device to obtain the original data.
10. An electronic device, characterized in that: include: at least one memory for storing a program; At least one processor, configured to execute the program stored in the memory; wherein, when the program stored in the memory is executed, the processor is configured to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Zero-trust network access method and system based on quantum security
CN118413389A