Data processing method and apparatus, and related device
By storing user private keys in a secure storage device of a secure processor and having the secure processor perform the signing, the problem of insufficient security in computer systems in blockchain networks is solved, the security of user private keys is improved, and losses caused by private key leakage are prevented.
Patent Information
- Application Number
- CN202211580966.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-09
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-12-09
AI Technical Summary
In blockchain networks, insufficient security in computer systems can lead to the leakage of users' private keys, resulting in user losses.
The user's private key is stored in a secure storage device configured by the security processor, which is prohibited from accessing the processor. The security processor performs transaction data signing to prevent the computer system from accessing or retrieving the user's private key.
This improves the security of user private keys and avoids user losses due to private key leakage.
Smart Images

Figure CN116192368B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of virtual machines, and particularly relate to a data processing method and device and related equipment. BACKGROUND
[0002] A blockchain is a distributed network composed of computer systems on the Internet, which collectively save transaction accounts and transaction information generated by the blockchain. In the blockchain, the blockchain data is scattered and saved in the entire network and is protected, and each computer on the chain can serve as a node to obtain information in the blockchain through information exchange, so that the data in the blockchain cannot be tampered with through the network. Therefore, more and more users choose to use the blockchain network for transactions.
[0003] However, in the blockchain network, user losses may still occur due to insufficient security of the computer system. SUMMARY
[0004] Therefore, embodiments of the present application provide a data processing method, device and related equipment to improve the security of the computer system.
[0005] To achieve the above object, the embodiments of the present application provide the following technical solutions:
[0006] A data processing method, the method comprising:
[0007] generating to-be-signed data;
[0008] sending a secure channel establishment request to establish a secure channel with a secure processor, the secure processor being configured to store a user private key to a secure storage device that is inaccessible to the processor;
[0009] after the secure channel is established, sending the to-be-signed data to the secure processor based on the secure channel, so that the secure processor signs the to-be-signed data based on the user private key;
[0010] obtaining signed data transmitted by the secure channel.
[0011] Optionally, after the secure channel establishment request is sent, and before the to-be-signed data is sent to the secure processor based on the secure channel, the method further comprises:
[0012] sending a key generation request to the secure processor based on the secure channel, so that the secure processor generates a user key pair, the user key pair comprising a matching user public key and user private key, wherein the user private key is stored in the secure storage device;
[0013] The security processor obtains a user public key transmitted based on the security channel.
[0014] Optionally, the sending of the security channel establishment request to establish the security channel with the security processor comprises:
[0015] The security channel establishment request is signed based on a first preset key.
[0016] The signed security channel establishment request is sent to the security processor, wherein the security processor is configured with a second preset key, and the second preset key matches the first preset key.
[0017] Optionally, the first preset key is a blockchain private key, and the second preset key is a blockchain public key, and the blockchain private key and the blockchain public key are obtained based on a blockchain certificate in blockchain software obtained based on a blockchain network.
[0018] Before the signing of the security channel establishment request based on the first preset key, the method further comprises:
[0019] The blockchain certificate in the blockchain software is imported into the security processor, so that the security processor obtains the blockchain public key based on the blockchain certificate, and the blockchain certificate at least comprises the blockchain public key.
[0020] Optionally, before the importing of the blockchain certificate in the blockchain software into the security processor, the method further comprises:
[0021] After the installation of the blockchain software, the blockchain certificate in the blockchain software is signed by using a fixed key of the processor.
[0022] Optionally, after the obtaining of the user public key transmitted by the security processor based on the security channel, the method further comprises:
[0023] The user public key is synchronized to all nodes in the blockchain network.
[0024] Optionally, before the sending of the to-be-signed data to the security processor based on the security channel, the method further comprises:
[0025] The security channel key of the processor side corresponding to the security channel is received, wherein the security channel key of the processor side corresponding to the security channel is encrypted based on the blockchain public key.
[0026] The security channel key of the processor side corresponding to the security channel is decrypted based on the blockchain private key.
[0027] Optionally, the to-be-signed data comprises transaction data of the blockchain and a hash value of the corresponding transaction data.
[0028] Optionally, after the signed signature data transmitted by the secure channel is acquired, the method further comprises:
[0029] broadcasting the signed signature data to a block chain network.
[0030] Optionally, after the signed signature data transmitted by the secure channel is acquired, or after the user public key based on the secure channel transmission is acquired, the method further comprises:
[0031] issuing a channel destruction request to make the secure processor destroy the secure channel.
[0032] Embodiments of the present application also provide a data processing method applied to a secure processor, the secure processor being configured to store a user private key to a secure storage device of the secure processor, the secure storage device being inaccessible by a processor, and the method comprising:
[0033] acquiring a secure channel establishment request, the secure channel establishment request being used to establish a secure channel with the processor;
[0034] establishing the secure channel based on the secure channel establishment request;
[0035] signing, by the user private key stored by the secure storage device, to-be-signed data transmitted by the secure channel, to obtain signed signature data;
[0036] sending the signed signature data based on the secure channel.
[0037] Optionally, after the secure channel is established based on the secure channel establishment request, and before the to-be-signed data transmitted by the secure channel is signed, the method further comprises:
[0038] generating a user key pair based on a key generation request transmitted by the secure channel, the user key pair comprising a user public key and a user private key matched with each other, wherein the user private key is used to be stored to the secure storage device;
[0039] sending the user public key to the processor based on the secure channel.
[0040] Optionally, the acquiring of the secure channel establishment request comprises:
[0041] acquiring the secure channel establishment request signed by a first preset key;
[0042] verifying the secure channel establishment request based on a second preset key, and if the verification is passed, the secure channel establishment request is legal.
[0043] Optionally, the first preset key is a blockchain private key, the second preset key is a blockchain public key, and the blockchain private key and the blockchain public key are obtained based on a blockchain certificate in blockchain software obtained by a blockchain network;
[0044] Before the first preset key is used to sign the secure channel establishment request, the method further includes:
[0045] The blockchain certificate in the blockchain software imported by the receiving processor includes at least the blockchain public key;
[0046] The blockchain public key is obtained based on the blockchain certificate.
[0047] Optionally, the blockchain public key is obtained based on the blockchain certificate, and the method includes:
[0048] The blockchain certificate in the blockchain software is verified by using a preset key of the processor.
[0049] Optionally, the secure channel is established based on the secure channel establishment request, and the method includes:
[0050] The secure channel key is generated based on the secure channel establishment request.
[0051] The secure channel key corresponding to the processor is sent to the processor, and the secure channel key corresponding to the processor is encrypted based on the blockchain public key.
[0052] Optionally, after the signed signature data is sent based on the secure channel, or after the user public key is sent to the processor based on the secure channel, the method further includes:
[0053] The secure channel is destroyed based on the received channel destruction request.
[0054] Embodiments of the application also provide a data processing device, which includes:
[0055] A signature data generation module is configured to generate to-be-signed data.
[0056] A request sending module is configured to send a secure channel establishment request to establish a secure channel with a secure processor, and the secure processor is configured to store a user private key in a secure storage device configured by the secure processor, and the secure storage device is configured to prohibit the processor from accessing.
[0057] A first data sending module is configured to send the to-be-signed data to the secure processor based on the secure channel after the secure channel is established, so that the secure processor signs the to-be-signed data based on the user private key.
[0058] The first data acquisition module is configured to acquire the signed signature data transmitted through the secure channel.
[0059] The embodiment of the present application further provides a data processing device, which is applied to a secure processor.
[0060] The request acquisition module is configured to acquire a secure channel establishment request, which is used to establish a secure channel with the processor.
[0061] The channel establishment module is configured to establish the secure channel based on the secure channel establishment request.
[0062] The second data signature module is configured to sign the to-be-signed data transmitted through the secure channel by using the user private key stored in the secure storage device, so as to obtain the signed signature data.
[0063] The second data sending module is configured to send the signed signature data based on the secure channel.
[0064] The embodiment of the present application further provides a processor, which is configured to execute the data processing method according to the embodiment of the present application.
[0065] The embodiment of the present application further provides a secure processor, which is configured to execute the data processing method according to the embodiment of the present application.
[0066] The embodiment of the present application further provides a computer device, which comprises the processor according to the embodiment of the present application and / or the secure processor according to the embodiment of the present application.
[0067] The embodiment of the present application provides a data processing method and device and related equipment, and the method comprises the following steps: generating to-be-signed data; sending a secure channel establishment request to establish a secure channel with a secure processor; the secure processor is configured to store a user private key in a secure storage device configured by the secure processor, and the secure storage device is prohibited to be accessed by the processor; after the secure channel is established, the to-be-signed data is sent to the secure processor based on the secure channel, so that the secure processor signs the to-be-signed data based on the user private key; and the signed signature data transmitted through the secure channel is acquired.
[0068] It can be seen that, by storing the user private key in the secure storage device configured for the secure processor, the secure storage device prohibits the processor from accessing, thereby avoiding the computer system from accessing or calling the user private key based on the secure processor performing the signature of the transaction data when signing the transaction data, thereby improving the security of the user private key and avoiding losses to the user due to leakage of the user private key. BRIEF DESCRIPTION OF DRAWINGS
[0069] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of the provided drawings.
[0070] Figure 1 Optional schematic diagram for a blockchain transaction;
[0071] Figure 2 Schematic diagram of a computer architecture;
[0072] Figure 3 Optional schematic diagram of a computer architecture provided by the embodiments of the present application;
[0073] Figure 4 Optional flowchart of a data processing method of the embodiments of the present application;
[0074] Figure 5 Optional flowchart of step S220 of the embodiments of the present application;
[0075] Figure 6 Optional flowchart of the secure processor configuring a blockchain public key of the embodiments of the present application;
[0076] Figure 7 Optional flowchart of step S230 of the embodiments of the present application;
[0077] Figure 8 Optional flowchart of the processor decrypting the secure channel key of the processor end of the embodiments of the present application;
[0078] Figure 9 Another optional flowchart of the data processing method of the embodiments of the present application;
[0079] Figure 10 Optional block diagram of the data processing device of the embodiments of the present application;
[0080] Figure 11 Another optional block diagram of the data processing device of the embodiments of the present application. DETAILED DESCRIPTION
[0081] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.
[0082] As described in the background, in the blockchain network, the user may still suffer loss due to the insufficient security of the computer system. Next, the transaction process of the blockchain will be described in detail.
[0083] Specifically, referring to the optional schematic diagram of the blockchain transaction, the transaction process using the blockchain can include: Figure 1
[0084] Step S100: When user A participates in a certain blockchain, the blockchain software running on the computer system generates account information corresponding to user A, and generates the public key and private key of user A, and synchronizes the public key information (also known as user public key) to the entire blockchain network;
[0085] Step S110: When user A needs to make a transaction, the blockchain software running on the computer system sends a transaction request to request a transaction, and signs the transaction information n (which can include currency value, contract, record or other information) with the private key of user A, and broadcasts the signed transaction to all nodes of the blockchain network;
[0086] Step S120: The nodes of the blockchain network verify and confirm the transaction information n using the public key of user A;
[0087] Step S130: The nodes of the blockchain network add the verified transaction information n to the blockchain to form a permanent and tamper-proof block, thereby completing the transaction.
[0088] In combination with Figure 2 A computer architecture schematic diagram is shown, wherein the computer architecture can serve as a node of the blockchain network. A computer with an x86 CPU can be composed of a processor, a memory (such as DRAM), a computer system, and a blockchain software, etc. The blockchain software runs on the computer system, the computer system runs on the processor, and the blockchain data, keys (user public key, user private key, other keys, etc.) are all saved in the local memory.
[0089] However, in the above scheme, the key of the blockchain is also stored in the local memory. If other software running locally includes malicious software, the malicious software may maliciously access and steal the corresponding key information by exploiting computer system vulnerabilities, and maliciously forge transaction data, thereby causing losses to the user.
[0090] The inventors believe that in the above scheme, the user's private key (also referred to as user private key) as key information for providing transaction information signature is the most important key for verifying user information. Only transaction information signed with the user private key can be verified and confirmed by the blockchain network using the user's public key (also referred to as user public key), and it is believed that the security of the user private key can be improved to avoid losses to the user.
[0091] Under this idea, the embodiment of the present application provides a data processing scheme. By storing the user private key in a secure storage device configured for a secure processor, the secure storage device is prohibited from being accessed by the processor, thereby avoiding the computer system from accessing or calling the user private key by executing the signature of the transaction data through the secure processor when signing the transaction data, thereby improving the security of the user private key and avoiding losses to the user due to leakage of the user private key.
[0092] The data processing scheme provided by the embodiment of the present application will be described in detail below.
[0093] In an optional implementation, Figure 3 An optional computer architecture schematic diagram provided by the embodiment of the present application is shown, as shown in the figure, Figure 3 The computer further includes a secure firmware, a secure processor and a secure storage device configured for the secure processor in addition to the processor, the memory, the computer system and the blockchain software. The secure firmware can be understood as a component running on the secure processor. The secure processor can interact with the computer system running on the processor based on the secure firmware, thereby realizing secure transmission and processing of data.
[0094] The secure processor is a data processing device independent of the processor. The data processing process inside the secure processor is not controlled by the processor, and the secure storage device configured in the secure processor is not allowed to be accessed by the processor, thereby being able to guarantee the independence and security of data in hardware. In the embodiment of the present application, the user key can be stored in the secure storage device, and the access to the user private key can be executed based on the secure processor, thereby improving the security of the user private key.
[0095] The secure storage device can be a secure memory in the secure processor or a storage device fixed in the secure processor, and the application does not make specific limitations here. In a specific example, the data in the blockchain software can be divided into confidential data and non-confidential data, wherein the confidential data can include user public keys, user private keys and other keys, and the non-confidential data can include blockchain data. Correspondingly, the confidential data can be stored in the secure storage device, and the non-confidential data can be stored in the memory.
[0096] It should be noted that the task of the blockchain software is actually executed by the processor under the control of the computer system, and the task of the secure firmware is executed based on the secure processor. Correspondingly, the interaction between the blockchain software and the secure firmware can be understood as the interaction between the processor and the secure processor.
[0097] Based on the above computer architecture, the embodiment of the application further provides a data processing method, which is described with reference to Figure 4 An optional flowchart of a data processing method according to an embodiment of the application is shown, and the method comprises:
[0098] Step S200: The processor generates to-be-signed data;
[0099] The to-be-signed data can include transaction data of a blockchain and a hash value corresponding to the transaction data. Specifically, the transaction data can include transaction request information initiated by a user, currency value, contract, record and other information corresponding to the transaction. In order to distinguish blocks in the blockchain, the user further calculates the hash value corresponding to the transaction data. Correspondingly, the transaction data in the blockchain and the hash value corresponding to the transaction data are signed together as to-be-signed data.
[0100] Step S210: The processor sends a secure channel establishment request to establish a secure channel with the secure processor;
[0101] The secure channel is established to ensure the security of data interaction between the processor and the secure processor. In this example, the secure channel is used to transmit to-be-signed data, thereby ensuring the transmission security of the to-be-signed data.
[0102] The secure processor is configured to store the user private key in a secure storage device configured by the secure processor, and the secure storage device is inaccessible to the processor. It can be understood that by storing the user private key in the secure storage device configured by the secure processor and inaccessible to the processor, the access of the processor to the user private key can be avoided, thereby ensuring the security of the user private key.
[0103] In an optional example, the secure channel establishment request can be a request signed by the first preset key. Specifically, the processor can sign the secure channel establishment request based on the first preset key, and further send the signed secure channel establishment request to the secure processor. The first preset key can be a blockchain private key, which matches a blockchain public key. Correspondingly, the blockchain private key and the blockchain public key can be obtained based on a blockchain software and a blockchain certificate obtained from a blockchain network. The blockchain certificate can include a public key of the currently downloaded blockchain software and a measurement digest, and is signed by a fixed key of the processor, for example, a chip vendor key of the processor, so that the blockchain certificate corresponds to the currently downloaded blockchain software one by one.
[0104] In a further example, the secure channel establishment request can also be subjected to integrity verification based on an integrity key. Correspondingly, the processor and the secure processor can be preconfigured with the integrity key, for example, in the blockchain certificate. The integrity key is preconfigured based on interaction of the blockchain certificate, and the corresponding integrity verification is implemented based on the integrity key.
[0105] In a specific example, before step S210, the blockchain certificate in the blockchain software can also be imported into the secure processor, so that the secure processor obtains the blockchain public key based on the blockchain certificate. The blockchain certificate at least includes the blockchain public key. To ensure the security of the blockchain certificate, the blockchain certificate in the blockchain software can also be signed by the fixed key of the processor before being imported into the secure processor, so that the secure processor can verify the blockchain certificate based on the fixed key of the processor.
[0106] Specifically, the blockchain certificate can be imported into the secure processor by the processor after the installation of the blockchain software, and verified by the secure processor based on the chip vendor signature of the processor. After the verification is passed, it is considered that the blockchain certificate is legal, so as to store the blockchain certificate.
[0107] After the processor sends the secure channel establishment request to establish the secure channel with the secure processor, the secure processor obtains the secure channel establishment request.
[0108] Step S220: The secure processor obtains the secure channel establishment request.
[0109] In a specific example, when the secure channel establishment request is a request signed by the first preset key, the security processor, after obtaining the secure channel establishment request, can further verify the signature of the secure channel establishment request based on the second preset key matched with the first preset key, to determine whether the secure channel establishment request is legal, and then establish the secure channel when the secure channel establishment request is legal. If the verification passes, the secure channel establishment request is legal.
[0110] In a specific example, referring to the optional flowchart of step S220 shown in Figure 5 Step S220 can include:
[0111] Step S221: Obtain the secure channel establishment request signed by the first preset key.
[0112] Step S222: Verify the signature of the secure channel establishment request based on the second preset key. If the verification passes, the secure channel establishment request is legal.
[0113] When the first preset key is a blockchain private key, the second preset key is a blockchain public key. In a specific example, the security processor can determine the corresponding blockchain public key based on the blockchain certificate, and then verify the secure channel establishment request based on the blockchain public key.
[0114] Correspondingly, before step S220, the blockchain public key can be further configured to the security processor. Specifically, referring to the optional flowchart of configuring the blockchain public key of a security processor shown in Figure 6 The flowchart includes:
[0115] Step S321: Receive the blockchain certificate in the blockchain software imported by the processor, the blockchain certificate including at least the blockchain public key.
[0116] Step S322: Obtain the blockchain public key based on the blockchain certificate.
[0117] By obtaining the corresponding blockchain public key, the security processor verifies the secure channel establishment request based on the blockchain public key as the second preset key.
[0118] Meanwhile, to ensure the security of the blockchain certificate, before the blockchain certificate is imported to the security processor, the security processor can further verify the signature of the blockchain certificate based on the fixed key of the processor when the blockchain certificate in the blockchain software is signed by the fixed key of the processor.
[0119] Specifically, the blockchain certificate can be imported into the secure processor by the processor after the blockchain software is installed, and the secure processor verifies the signature based on the chip vendor signature of the processor. After the verification is passed, it is considered that the blockchain certificate is legal, so as to store the blockchain certificate.
[0120] Next, referring to Figure 4 , step S230 is performed: the secure processor establishes a secure channel based on the secure channel establishment request;
[0121] The secure channel can be understood as a temporary encrypted channel established for data transmission. In an optional example, the secure channel can be established by generating a channel key pair. Specifically, the secure channel key can include a channel encryption key and an integrity key, for example. The channel encryption key is used to encrypt the to-be-signed data to be transmitted, which can specifically include a matching processor-side key and a secure processor-side key. The key at one end can decrypt the ciphertext at the opposite end. For example, the secure processor-side key can decrypt the ciphertext encrypted by the processor-side key, and the processor-side key can decrypt the ciphertext encrypted by the secure processor-side key. The integrity key is used to protect the to-be-transmitted data. After generating the corresponding secure channel key, the secure processor can send the secure channel key corresponding to the processor side to the processor, so that the processor protects the data based on the secure channel key corresponding to the processor side.
[0122] Step S240: the processor sends the to-be-signed data to the secure processor based on the secure channel;
[0123] The to-be-signed data is sent to the secure processor, so that the secure processor signs the to-be-signed data based on the user private key.
[0124] In the example where the secure channel key includes a channel encryption key and an integrity key, the processor can encrypt the to-be-signed data using the processor-side key to obtain the ciphertext of the to-be-signed data, and perform integrity protection calculation on the ciphertext of the to-be-signed data using the integrity key to obtain the corresponding integrity verification code, and send the ciphertext and the integrity verification code to the secure processor.
[0125] Step S250: the secure processor uses the user private key stored in the secure storage device to sign the to-be-signed data transmitted by the secure channel to obtain signed signature data;
[0126] It can be understood that the security processor end has a matching key corresponding to the security channel key, that is, an integrity key and a security processor end key corresponding to a channel encryption key, and after receiving the data transmitted by the processor, the security processor can perform integrity verification on the ciphertext based on the integrity key. After verifying the integrity verification code successfully, the ciphertext of the to-be-signed data is decrypted using the security processor end key corresponding to the channel encryption key to obtain the corresponding to-be-signed data.
[0127] After obtaining the corresponding to-be-signed data, the user private key stored in the security storage device can be used to sign the to-be-signed data.
[0128] Step S260: The security processor sends the signed data based on the security channel.
[0129] After signing the to-be-signed data, the signed data can be further sent based on the security channel.
[0130] It can be understood that the transmission of data based on the security channel can be specifically data security protection of the signed data based on the matching key of the security channel key. For example, the signed data can be encrypted using the security processor end key to obtain the ciphertext of the signed data, and the integrity check code of the corresponding ciphertext is calculated using the integrity key. Correspondingly, the ciphertext and the integrity check code of the signed data are sent.
[0131] Step S270: The processor obtains the signed data transmitted by the security channel.
[0132] It can be understood that the data transmitted by the security channel is the security-protected data, and correspondingly, the obtained signed data is the ciphertext and the integrity check code of the signed data. Correspondingly, the processor can verify the integrity of the ciphertext of the signed data based on the integrity key at the processor end, and after successful integrity verification, the ciphertext of the signed data is decrypted using the processor end key to obtain the corresponding signed data.
[0133] In the embodiment of the application, after the processor end obtains the signed data, the following steps can be further performed:
[0134] Step S280: The processor broadcasts the signed data to the blockchain network.
[0135] By broadcasting the signed data to the blockchain network, the corresponding signed data can be obtained by the full network nodes of the blockchain network, and further verified and confirmed using the user public key of the user, and after confirmation, the transaction data corresponding to the signed data and the hash value of the corresponding transaction data are added to the blockchain to form permanent and tamper-proof block data.
[0136] In an optional example, after step S270 and before step S280, the processor can further send a channel destruction request to the secure processor to destroy the corresponding secure channel, so that the secure processor destroys the secure channel, for example, deletes information related to the secure channel, thereby avoiding other software running in the processor from utilizing the corresponding secure channel, and ensuring the security of the data of the secure processor.
[0137] In a specific example, when the secure channel is implemented by generating a channel key pair, the secure channel key can include a channel encryption key and an integrity key, for example. After receiving the channel destruction request, the secure processor can destroy the channel key. The channel destruction request can be transmitted based on the secure channel.
[0138] It can be understood that the secure channel can be established between the processor and the secure processor in a scenario requiring interaction, and the secure channel can be destroyed after the interaction is completed.
[0139] In a specific example, referring to the optional flow of step S230 shown in FIG. 2B, the specific flow of step S230, in which the secure processor establishes a secure channel based on the secure channel establishment request, can include the following steps. Figure 7
[0140] Step S231: The secure processor generates a secure channel key based on the secure channel establishment request.
[0141] In a specific example, the secure channel establishment request can be signed by a blockchain private key, and then the secure processor can verify the signature based on a blockchain public key, thereby ensuring the legality of the secure channel establishment request and generating a secure channel key when the secure channel establishment request is legal.
[0142] The generated secure channel key can include one or more, wherein a key pair for encryption and decryption can be generated based on the confidentiality of the data transmission data, and an integrity key can be generated based on the integrity of the transmission data. In an embodiment of the present application, the generated channel key includes a channel encryption key TEK and an integrity key TIK, wherein the channel encryption key TEK is used to encrypt the to-be-transmitted signed data, and specifically can include a matching processor-side key and a secure processor-side key; the integrity key TIK is used to protect the to-be-transmitted data.
[0143] Step S232: The secure processor sends the secure channel key corresponding to the processor side to the processor.
[0144] The secure processor can send the processor-side secure channel key after encrypting the processor-side secure channel key. It can be understood that in this example, the processor-side secure channel key includes a processor-side key in a channel encryption key TEK and an integrity key TIK.
[0145] Specifically, the processor-side secure channel key can be encrypted based on the blockchain public key, so that the processor can decrypt the processor-side secure channel key based on the blockchain private key, and then perform encrypted transmission of data based on the processor-side secure channel key.
[0146] It can be understood that before step S240 of the present application, the processor also receives the corresponding processor-side secure channel key, wherein the corresponding processor-side secure channel key is encrypted ciphertext, and the corresponding processor-side secure channel key is decrypted. Wherein, when the secure processor encrypts the secure channel key with the blockchain public key, the processor can decrypt the processor-side secure channel key based on the blockchain private key.
[0147] Specifically, before step S240, refer to Figure 8 The optional
[0148] flow of the processor decrypting the processor-side secure channel key is shown in the figure, which comprises:
[0149] Step S331: receiving a corresponding processor-side secure channel key, wherein the processor-side secure channel key is encrypted based on a blockchain public key;
[0150] Step S331: decrypting the corresponding processor-side secure channel key based on a blockchain private key.
[0151] It can be seen that the above-mentioned secure channel establishment process is also executed under the protection of the corresponding blockchain key, so as to ensure the security of the secure channel.
[0152] In further examples, to ensure the security of the user private key in the whole process, the present application embodiment further configures the secure processor to generate a corresponding user key pair, i.e. the secure processor generates a user public key and a user private key, so as to directly save the user private key in the processor to the secure storage device, thereby avoiding the user private key from being snooped.
[0153] Specifically, the secure channel can be established by first performing steps S210-S230, and after step S230, before step S240, refer to Figure 9 Another optional flowchart of the data processing method is shown in the figure, which can further comprise:
[0154] Step S300: The processor sends a key generation request to the secure processor based on the secure channel.
[0155] It can be understood that the key generation request is sent based on the secure channel, that is, the encryption and integrity protection of the key generation request are performed based on the secure channel key. Specifically, the key generation request can be encrypted by using the processor-side key to form ciphertext, the ciphertext of the key generation request is obtained, the integrity protection calculation of the ciphertext of the key generation request is performed by using the integrity key, the corresponding integrity verification code is obtained, and the ciphertext and the integrity verification code are sent to the secure processor.
[0156] Step S310: The secure processor generates a user key pair based on the key generation request transmitted based on the secure channel, the user key pair including a matching user public key and a user private key, wherein the user private key is stored in a secure storage device.
[0157] In this step, the secure processor can first obtain the ciphertext and the integrity verification code of the key generation request transmitted based on the secure channel, perform integrity verification on the ciphertext of the key generation request, and after the integrity verification code is verified successfully, decrypt the ciphertext of the key generation request by using the secure processor-side key of the corresponding channel encryption key to obtain the corresponding key generation request.
[0158] After the corresponding key generation request is determined, the corresponding user key pair can be generated based on the key generation request. The user public key can be sent to the processor through the secure channel, and the user private key is stored in the corresponding secure storage device.
[0159] Step S320: The secure processor sends the user public key to the processor based on the secure channel.
[0160] After the user key pair is generated, the user public key can be sent to the processor based on the secure channel. It can be understood that the user public key is sent based on the secure channel, that is, the encryption and integrity protection of the user public key are performed based on the secure channel key. Specifically, the user public key can be encrypted by using the secure processor-side key to form ciphertext, the ciphertext of the user public key is obtained, the integrity protection calculation of the ciphertext of the user public key is performed by using the integrity key, the corresponding integrity verification code is obtained, and the ciphertext and the integrity verification code are sent to the processor.
[0161] Step S330: The processor obtains the user public key transmitted based on the secure channel.
[0162] In this step, the processor can first acquire the ciphertext of the user public key and the integrity verification code transmitted through the secure channel, and perform integrity verification on the ciphertext of the user public key. After verifying the integrity verification code successfully, the processor decrypts the ciphertext of the user public key using the processor-side key corresponding to the channel encryption key to obtain the corresponding user public key.
[0163] Step S340: The processor broadcasts the user public key to the blockchain network.
[0164] By broadcasting the user public key to the blockchain network, the user public key is synchronized to all nodes in the blockchain network, so that the nodes in the blockchain network internally verify the data signed by the user private key based on the user public key.
[0165] In addition, it should be noted that the time required for user transactions is uncertain, and the processor generates transaction data and performs the signature process of the transaction data, which is not necessarily performed immediately after the user key pair is generated. To avoid attacks on the secure channel, the processor can issue a channel destruction request to make the secure processor destroy the secure channel, such as deleting information related to the secure channel, to ensure the security of the data of the secure processor, before the processor acquires the corresponding secure public key in step S330 and before step S340.
[0166] In a specific example, when the secure channel is implemented by generating a channel key pair, the secure channel key can include a channel encryption key and an integrity key, and the secure processor can destroy the channel key after receiving the channel destruction request.
[0167] It can be understood that when the user has a transaction requirement or other need for secure channel data transmission, if the secure channel has been destroyed, the secure channel can be generated again by performing steps S210-S230.
[0168] It should be noted that the above process is based on the execution of the hardware end, and at the software level, the signature of the transaction data can be performed by calling the secure firmware in the secure processor to avoid access or calling of the user private key by the computer system.
[0169] The above describes a plurality of embodiment schemes provided by the embodiments of the present application. The optional modes introduced in each embodiment scheme can be combined, cross-referenced without conflict, thereby extending a plurality of possible embodiment schemes, which can be considered as the embodiment schemes disclosed and disclosed by the embodiments of the present application.
[0170] The data processing apparatus provided by the embodiments of the present application is introduced from the perspective of a processor below. The data processing apparatus described below can be considered as functional modules required to be set by the processor to implement the data processing method provided by the embodiments of the present application. The content of the data processing apparatus described below can be mutually corresponding to the method content described above.
[0171] In an optional implementation, Figure 10 An optional block diagram of the data processing apparatus provided by the embodiments of the present application is shown. The data processing apparatus can be applied to a processor, such as Figure 10 As shown, the data processing apparatus can include:
[0172] A signature data generation module 100 is configured to generate to-be-signed data.
[0173] A request sending module 110 is configured to send a secure channel establishment request to establish a secure channel with a secure processor. The secure processor is configured to store a user private key to a secure storage device configured by the secure processor, and the secure storage device is prohibited from being accessed by the processor.
[0174] A first data sending module 120 is configured to send the to-be-signed data to the secure processor based on the secure channel after the secure channel is established, so that the secure processor signs the to-be-signed data based on the user private key.
[0175] A first data acquisition module 130 is configured to acquire signed data transmitted by the secure channel.
[0176] Optionally, the request sending module 110 is further configured to:
[0177] Send a key generation request to the secure processor based on the secure channel, so that the secure processor generates a user key pair including a matching user public key and a user private key, wherein the user private key is stored to the secure storage device.
[0178] The first data acquisition module 130 is further configured to acquire the user public key transmitted by the secure processor based on the secure channel.
[0179] Optionally, the request sending module 110 is configured to send a secure channel establishment request to establish a secure channel with a secure processor, including:
[0180] Signing the secure channel establishment request based on a first preset key;
[0181] Sending the signed secure channel establishment request to the secure processor, wherein the secure processor is configured with a second preset key, and the second preset key matches the first preset key.
[0182] Optionally, the first preset key is a blockchain private key, the second preset key is a blockchain public key, and the blockchain private key and the blockchain public key are obtained based on a blockchain certificate in blockchain software obtained by a blockchain network;
[0183] The data processing apparatus further includes:
[0184] The data import module 140 is configured to import the blockchain certificate in the blockchain software into the secure processor, so that the secure processor obtains the blockchain public key based on the blockchain certificate; and the blockchain certificate at least includes the blockchain public key.
[0185] Optionally, the data processing apparatus further includes a first data signature module 150 configured to sign the blockchain certificate in the blockchain software using a fixed key of the processor after the blockchain software is installed.
[0186] Optionally, the data processing apparatus further includes a data synchronization module 160 configured to synchronize the user public key to all nodes in the blockchain network.
[0187] Optionally, the first data obtaining module is further configured to receive a secure channel key corresponding to the processor side, wherein the secure channel key corresponding to the processor side is encrypted based on the blockchain public key; and the secure channel key corresponding to the processor side is decrypted based on the blockchain private key.
[0188] Optionally, the data to be signed includes transaction data of the blockchain and a hash value of the corresponding transaction data.
[0189] Optionally, the data synchronization module 160 is further configured to broadcast the signed signature data to the blockchain network.
[0190] Optionally, the request sending module 110 is further configured to send a channel destruction request to make the secure processor destroy the secure channel.
[0191] The data processing apparatus provided by the embodiment of the application is described below from the perspective of the secure processor. The data processing apparatus described below can be considered as functional modules required to be set by the secure processor to implement the data processing method provided by the embodiment of the application. The content of the data processing apparatus described below can be mutually corresponding and referred to with the method content described above.
[0192] In an optional implementation, Figure 11 Another optional block diagram of the data processing apparatus provided by the embodiment of the application is shown, which can be applied to a secure processor configured to store a user private key to a secure storage device of the secure processor, wherein the secure storage device prohibits processor access, such as Figure 11As shown, the data processing apparatus can comprise:
[0193] The request acquisition module 200 is configured to acquire a secure channel establishment request, the secure channel establishment request being used to establish a secure channel with the processor.
[0194] The channel establishment module 210 is configured to establish a secure channel based on the secure channel establishment request.
[0195] The second data signature module 220 is configured to sign data to be signed transmitted by the secure channel using the user private key stored by the secure storage device to obtain signed signature data.
[0196] The second data sending module 230 is configured to send the signed signature data based on the secure channel.
[0197] Optionally, the data processing apparatus further comprises:
[0198] The key generation module 240 is configured to generate a user key pair based on a key generation request transmitted by the secure channel, the user key pair comprising a matching user public key and a user private key, wherein the user private key is used to be stored in the secure storage device.
[0199] The second data sending module 230 is further configured to send the user public key to the processor based on the secure channel.
[0200] Optionally, the request acquisition module 200 is configured to acquire a secure channel establishment request, comprising:
[0201] Acquire the secure channel establishment request signed by a first preset key.
[0202] Verify the secure channel establishment request based on a second preset key, and if the verification is passed, the secure channel establishment request is legal.
[0203] Optionally, the first preset key is a blockchain private key, and the second preset key is a blockchain public key, wherein the blockchain private key and the blockchain public key are acquired based on a blockchain certificate in a blockchain software acquired from a blockchain network.
[0204] The data processing apparatus further comprises:
[0205] The second data acquisition module 250 is configured to receive a blockchain certificate in a blockchain software imported by the processor, the blockchain certificate comprising at least the blockchain public key, and acquire the blockchain public key based on the blockchain certificate.
[0206] Optionally, the second data acquisition module 250 is configured to acquire the blockchain public key based on the blockchain certificate, comprising:
[0207] The blockchain certificate in the blockchain software is verified by using a processor fixed key.
[0208] Optionally, the channel establishment module 210 is configured to establish a secure channel based on the secure channel establishment request, and the secure channel establishment request comprises:
[0209] The secure channel key is generated based on the secure channel establishment request;
[0210] The secure channel key corresponding to the processor side is sent to the processor, and the secure channel key corresponding to the processor side is encrypted based on a blockchain public key.
[0211] Optionally, the channel establishment module 210 is further configured to destroy the secure channel based on the received channel destruction request.
[0212] The processor according to the embodiment of the present application can be configured to execute the data processing method from the processor perspective, and the specific content can be referred to the description of the corresponding part above, and will not be further expanded here.
[0213] The secure processor according to the embodiment of the present application can be configured to execute the data processing method from the secure processor perspective, and the specific content can be referred to the description of the corresponding part above, and will not be further expanded here.
[0214] The computer device according to the embodiment of the present application can comprise the processor and / or the secure processor described above, the processor can be configured to execute the data processing method from the processor perspective, and / or the data transmission method from the secure processor perspective, and the optional structure of the computer device can be as shown in the Figure 3 , and will not be further expanded here.
[0215] Although the embodiments of the present application are disclosed as above, the present application is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present application, and the protection scope of the present application should be subject to the scope defined by the claims.
Claims
1. A data processing method, characterized by, The method comprises: generating to-be-signed data; sending a secure channel establishment request to establish a secure channel between the processor and the secure processor; the secure processor is configured to store the user private key in a secure storage device of the secure processor, the secure storage device is inaccessible by the processor, and the independence and security of the data are ensured in hardware; the data processing flow in the secure processor is not controlled by the processor; the secure channel is established by verifying the legality of the secure channel establishment request; the secure channel is used to transmit the to-be-signed data and the signed data, and the transmission security of the to-be-signed data and the signed data is ensured; after the secure channel is established, the to-be-signed data is sent to the secure processor based on the secure channel, so that the secure processor signs the to-be-signed data based on the user private key; obtaining the signed data transmitted by the secure channel.
2. The data processing method according to claim 1, characterized in that, Before the to-be-signed data is sent to the secure processor based on the secure channel, the method further comprises: based on the secure channel, sending a key generation request to the secure processor to make the secure processor generate a user key pair, the user key pair comprising a matching user public key and a user private key, wherein the user private key is stored in the secure storage device; obtaining the user public key transmitted by the secure processor based on the secure channel.
3. The data processing method of claim 1, wherein, The method of sending a secure channel establishment request to establish a secure channel between the processor and the secure processor comprises: signing the secure channel establishment request based on a first preset key; sending the signed secure channel establishment request to the secure processor, wherein the secure processor is configured with a second preset key, and the second preset key matches the first preset key.
4. The data processing method according to claim 3, characterized in that, The first preset key is a blockchain private key, and the second preset key is a blockchain public key, wherein the blockchain private key and the blockchain public key are obtained based on a blockchain certificate in blockchain software obtained from a blockchain network; Before the secure channel establishment request is signed based on the first preset key, the method further comprises: importing the blockchain certificate in the blockchain software into the secure processor, so that the secure processor obtains the blockchain public key based on the blockchain certificate; wherein the blockchain certificate comprises at least the blockchain public key.
5. The data processing method according to claim 4, characterized in that, Before the blockchain certificate in the blockchain software is imported into the secure processor, the method further comprises: after installing the blockchain software, signing the blockchain certificate in the blockchain software by using a fixed key of the processor.
6. The data processing method according to claim 2, characterized in that, After obtaining the user public key transmitted by the secure processor based on the secure channel, the method further comprises: synchronizing the user public key to all nodes in the blockchain network.
7. The data processing method according to claim 3, characterized in that, Before the to-be-signed data is sent to the secure processor based on the secure channel, the method further comprises: receiving a secure channel key corresponding to the processor side, wherein the secure channel key corresponding to the processor side is encrypted based on the blockchain public key; decrypting the secure channel key corresponding to the processor side based on the blockchain private key.
8. The data processing method of claim 1, wherein, The to-be-signed data comprises transaction data of a blockchain and a hash value of the corresponding transaction data.
9. The data processing method of claim 1, wherein, After obtaining the signed data transmitted by the secure channel, the method further comprises: Broadcast the signed signature data to a blockchain network.
10. The data processing method according to claim 2, characterized in that, After the signed signature data transmitted by the secure channel is obtained, or after the user public key based on the secure channel transmission is obtained, the method further comprises: issuing a channel destruction request to make the secure processor destroy the secure channel.
11. A data processing method, characterized by, The method is applied to a secure processor, and the secure processor is used to store a user private key to a secure storage device configured by the secure processor. The secure storage device is inaccessible to a processor, and the independence and security of data are guaranteed in hardware. The data processing flow inside the secure processor is not controlled by the processor. The method comprises: obtaining a secure channel establishment request, wherein the secure channel establishment request is used to establish a secure channel with the processor; the legality of the secure channel establishment request needs to be verified when the secure channel is established; the secure channel is used to transmit to-be-signed data and signed signature data, and the transmission security of the to-be-signed data and the signed signature data is ensured; establishing a secure channel based on the secure channel establishment request; signing the to-be-signed data transmitted by the secure channel by using the user private key stored in the secure storage device to obtain signed signature data; sending the signed signature data based on the secure channel.
12. The data processing method according to claim 11, characterized in that, After the secure channel is established based on the secure channel establishment request, and before the to-be-signed data transmitted by the secure channel is signed, the method further comprises: generating a user key pair based on a key generation request transmitted by the secure channel, wherein the user key pair comprises a user public key and a user private key that match each other, and the user private key is used to be stored in the secure storage device; sending the user public key to the processor based on the secure channel.
13. The data processing method of claim 11, wherein, The method of obtaining the secure channel establishment request comprises: obtaining the secure channel establishment request signed by a first preset key; verifying the secure channel establishment request based on a second preset key, and if the verification is passed, the secure channel establishment request is legal.
14. The data processing method according to claim 13, characterized in that, The first preset key is a blockchain private key, the second preset key is a blockchain public key, and the blockchain private key and the blockchain public key are obtained based on a blockchain certificate in blockchain software obtained based on a blockchain network; Before the secure channel establishment request signed by the first preset key is obtained, the method further comprises: receiving a blockchain certificate in blockchain software imported by the processor, wherein the blockchain certificate at least comprises the blockchain public key; obtaining the blockchain public key based on the blockchain certificate.
15. The data processing method according to claim 14, characterized in that, The method of obtaining the blockchain public key based on the blockchain certificate comprises: verifying the blockchain certificate in the blockchain software by using a fixed key of the processor.
16. The data processing method of claim 11, wherein, The method of establishing a secure channel based on the secure channel establishment request comprises: generating a secure channel key based on the secure channel establishment request; sending the secure channel key corresponding to the processor to the processor, wherein the secure channel key corresponding to the processor is encrypted based on the blockchain public key.
17. The data processing method of claim 12, wherein, After the signed signature data is sent based on the secure channel, or after the user public key is sent to the processor based on the secure channel, the method further comprises: destroying the secure channel based on the received channel destruction request.
18. A data processing apparatus, characterized by: include: The signature data generation module is used to generate data to be signed; The request sending module is used to send a secure channel establishment request in order to establish a secure channel between the processor and the secure processor; The security processor stores the user's private key in a secure storage device configured within it. This secure storage device is inaccessible to the processor, ensuring data independence and security at the hardware level. The data processing flow within the security processor is not controlled by the processor. The establishment of the secure channel requires verification of the legitimacy of the secure channel establishment request. The secure channel is used to transmit data to be signed and signed data, ensuring the secure transmission of both. The first data sending module is used to send the data to be signed to the security processor based on the security channel after the security channel is established, so that the security processor signs the data to be signed based on the user's private key; The first data acquisition module is used to acquire the signed data transmitted through the secure channel.
19. A data processing apparatus, characterized by An application is made to a security processor, which stores user private keys in a secure storage device configured on the security processor. The secure storage device is inaccessible to the processor, ensuring data independence and security at the hardware level. The data processing flow within the security processor is not controlled by the processor. The device includes: The request acquisition module is used to acquire a secure channel establishment request, which is used to establish a secure channel with the processor; the establishment of the secure channel requires verification of the legality of the secure channel establishment request; the secure channel is used to transmit data to be signed and signed data, ensuring the secure transmission of the data to be signed and the signed data. The channel establishment module is used to establish a secure channel based on the secure channel establishment request. The second data signature module is used to sign the data to be signed transmitted through the secure channel using the user's private key stored in the secure storage device, so as to obtain the signed data. The second data sending module is used to send the signed data based on the secure channel.
20. A processor, comprising: The processor is configured to perform the data processing method as described in any one of claims 1-10.
21. A secure processor, comprising: The security processor is configured to perform the data processing method as described in any one of claims 11-17.
22. A computer device, comprising: Includes the processor as claimed in claim 20, and / or the security processor as claimed in claim 21, the processor being configured to perform the data processing method as claimed in any one of claims 1-10, and / or the security processor being configured to perform the data processing method as claimed in any one of claims 11-17.
Citation Information
Patent Citations
Private key management method, device and system in blockchain scene
CN110492990A
Information processing method and information processing device
CN110519260A