[go: up one dir, main page]

CN110492990B - Private key management method, device and system in blockchain scenario - Google Patents

Private key management method, device and system in blockchain scenario Download PDF

Info

Publication number
CN110492990B
CN110492990B CN201810458967.2A CN201810458967A CN110492990B CN 110492990 B CN110492990 B CN 110492990B CN 201810458967 A CN201810458967 A CN 201810458967A CN 110492990 B CN110492990 B CN 110492990B
Authority
CN
China
Prior art keywords
private key
blockchain
tee
password
computer system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810458967.2A
Other languages
Chinese (zh)
Other versions
CN110492990A (en
Inventor
文白林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201810458967.2A priority Critical patent/CN110492990B/en
Priority to PCT/CN2019/086111 priority patent/WO2019218919A1/en
Publication of CN110492990A publication Critical patent/CN110492990A/en
Application granted granted Critical
Publication of CN110492990B publication Critical patent/CN110492990B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/02Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
    • H04L63/0209Architectural arrangements, e.g. perimeter networks or demilitarized zones
    • H04L63/0218Distributed architectures, e.g. distributed firewalls
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/06Network architectures or network communication protocols for network security for supporting key management in a packet data network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • H04L9/0822Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) using key encryption key
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0891Revocation or update of secret information, e.g. encryption key update or rekeying
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0894Escrow, recovery or storing of secret information, e.g. secret key escrow or cryptographic key storage

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

本申请为区块链场景下的私钥管理方法、装置及系统,提供一种计算机系统,该计算机系统上部署有富执行环境REE和可信执行环境TEE,该计算机系统还部署有基于区块链技术的区块链功能单元,且TEE中部署有所述区块链功能单元中的私钥管理模块和交易数据处理模块,其中所述私钥管理模块用于创建私钥,以及将所述私钥存储在TEE中;所述交易数据处理模块用于利用所述私钥对区块链功能单元涉及的摘要数据执行加密。通过将区块链场景下涉及到的私钥放置到TEE侧进行创建、存储和使用,借助TrustZone架构的可信执行环境提供私钥的安全性,从而一定程度上解决了私钥在不可信环境中带来的安全风险问题,提高了区块链系统的安全性。

Figure 201810458967

The present application provides a private key management method, device and system in a blockchain scenario, and provides a computer system on which a rich execution environment REE and a trusted execution environment TEE are deployed, and a block-based The blockchain functional unit of the blockchain technology, and the private key management module and the transaction data processing module in the blockchain functional unit are deployed in the TEE, wherein the private key management module is used to create a private key, and the The private key is stored in the TEE; the transaction data processing module is used to encrypt the digest data involved in the blockchain functional unit by using the private key. By placing the private key involved in the blockchain scenario on the TEE side for creation, storage and use, the security of the private key is provided by the trusted execution environment of the TrustZone architecture, thus solving the problem of the private key in an untrusted environment to a certain extent. The security risk problem brought by the system improves the security of the blockchain system.

Figure 201810458967

Description

Private key management method, device and system under block chain scene
Technical Field
The present application relates to a block chain technology, and in particular, to a method, an apparatus, and a system for managing a private key in a block chain.
Background
The block chain index is generated and stored by taking a block (block) as a unit, and is connected into a chain (chain) data structure according to a time sequence, all nodes need to participate in data verification, storage and maintenance of a block chain system together, the creation of a new block needs to be identified and confirmed together, and the new block is broadcasted to each node to realize the whole network synchronization, and then cannot be changed or deleted. The blockchain is a set innovation of various prior arts, and mainly solves the problems of multi-party trust and efficient collaboration. The technologies for constructing the block chain mainly include hash operation (SHA256), digital signature, P2P (peer-to-peer) network and consensus algorithm. Typical application scenarios of the blockchain technology include cryptocurrency, finance, supply chain, internet of things and the like.
Digital signature technology is used to guarantee the security of data transmission to a certain extent. Taking the encrypted digital currency scenario as an example, each node's block stores currency transaction information that includes one or more transaction processes, such as an address of an a wallet transferring 100 digital coins (e.g., bitcoins) to a B wallet address. Before transaction information is transmitted between different nodes, a hash operation needs to be performed on a transaction process to obtain a summary of the transaction process, the summary is encrypted by using a private key of a sender, and the encrypted summary and transaction data (or encrypted transaction data) are sent to a receiver. The receiving party decrypts the received ciphertext digest by using the corresponding public key to obtain a digest a, performs hash operation on the received transaction data to obtain a digest b, compares the digest a with the digest b, and determines that the currency transaction information is safe when the digest a is the same as the digest b. Therefore, the integrity of information transmission can be ensured by the digital signature technology, and the identity authentication of the sender can be verified at the same time, so that the repudiation in the transaction is prevented. However, how to ensure the security of the private key in the process of digital signature and avoid the private key of the sender being obtained by a malicious third party is urgently needed to be solved in the field of block chaining.
The most common way of managing the private key is to host the private key on a server of a service provider, and a user logs in the server to perform related operations by using an account login way before using the private key. However, this approach has some drawbacks: if the server is attacked by hackers or other bugs are generated, the private key is easily leaked or lost; user accounts may also be stolen; the security of the account is also affected by a browser vulnerability in the process of logging in the server by the user; man-in-the-middle attacks and HTTPS certificate hijacking during network transmission are also common security risks. Another way is for the device to create and store the private key itself at the block chain node. At present, most of security designs of the encrypted digital currency wallets completely depend on security boundaries of an operating system, a private key is stored and processed, the private key is encrypted by using a fixed key and even directly stored in a plaintext, and illegal access is avoided by completely depending on the security boundaries of the operating system.
Disclosure of Invention
The application provides a private key management method, a private key management device and a private key management system, which can be particularly applied to application scenarios related to a block chain and used for improving the security of a private key, so that the security of information stored in the block chain is improved.
Several aspects of the present application are described below, and it is to be understood that the same or similar elements may be referred to one another in the following implementations of the several aspects.
In a first aspect, the present application provides a computer system having a rich execution environment REE and a trusted execution environment TEE deployed thereon, and further having a blockchain functional unit based on blockchain technology, such as digital wallet software, deployed thereon. The TEE is provided with a private key management module and a transaction data processing module in the block chain functional unit. The private key management module is used for creating a private key and storing the private key in the TEE. The transaction data processing module is used for encrypting the summary data related to the block chain functional unit by using the private key.
In some implementations, the generation of the summary data is in the TEE; in other implementations, the generation of the summary data is in the REE, and the REE then sends the summary data to the TEE.
In some implementations, the private key management module is specifically configured to encrypt the private key before storing the private key, where the stored private key is an encrypted private key.
In some implementations, the private key management module is specifically configured to encrypt the private key using a password, where the password is updated or periodically updated when a condition is met, re-encrypt the private key using a new password after the update, and store the private key encrypted with the new password.
In some implementations, the password update condition includes performing encryption of the digest data once.
In some implementations, the cryptogram is a random number generated by a hardware random number generator. In other implementations, the random number may also be generated by a software random number generator.
In a second aspect, the present application provides a method for managing a private key, which is applied in a blockchain scenario. The method is applied to a computer system, such as a terminal device, deployed with a rich execution environment REE and a trusted execution environment TEE. A blockchain functional unit, such as digital wallet software, is also deployed on the computer system. The method comprises the following steps: creating a private key related to the block chain functional unit at the TEE, and storing the private key at the TEE side; and encrypting the summary data involved in the block chain functional unit by using the private key at the TEE side.
In some implementations, the summary data is generated on the TEE side; in other implementations, the digest data is generated at the REE side and sent to the TEE to perform encryption of the digest data at the TEE side.
In some implementations, prior to storing the private key, the method further includes: performing encryption on the private key. It will be readily appreciated that after encryption, the original private key is not stored, but rather the encrypted private key, and decryption is required before the next use of the private key.
In some implementations, encrypting the private key and storing the encrypted private key includes: and encrypting the private key by using a password, updating or periodically updating the password when the condition is met, re-encrypting the private key by using a new password after updating, and storing the private key encrypted by using the new password.
In some implementations, the password being updated when the condition is satisfied includes: updating the password after performing encryption of the digest data once with the private key.
In some implementations, the periodically updating the password includes: the password is updated at regular intervals and the private key is re-encrypted and stored.
In some implementations, the cryptogram is a random number generated by a hardware random number generator. In other implementations, the random number may also be generated by a software random number generator.
In a third aspect, the present application provides a computer system, which includes a memory for storing a computer program and a processor for reading and executing the computer program to implement the method provided in any of the foregoing implementation manners.
In a fourth aspect, the present application provides a blockchain system, wherein the computer system provided in any aspect of the present application is included in the blockchain system. The computer system may be a terminal device or other type of computer system.
Therefore, the private key management method, device and system provided by the application can be used for creating, storing and using the private key related in the blockchain scene by placing the private key on the TEE side, and the private key management method, device and system are assisted by
Figure BDA0001660401400000031
The trusted execution environment of the architecture provides the security of the private key, so that the problem of security risk brought by the private key in an untrusted environment is solved to a certain extent, and the security of the block chain system is improved. Furthermore, the private key is encrypted during storage and execution, and the safety is further ensured. Moreover, the password for encrypting the private key is changed periodically or under condition triggering, so that the security of the password is higher, and the security of the private key is higher.
Drawings
In order to more clearly illustrate the technical solutions provided by the present application, the following briefly introduces the accompanying drawings. It is to be expressly understood that the drawings described below are only illustrative of some embodiments of the invention.
FIG. 1a is a schematic diagram of a network architecture of a blockchain scenario;
FIG. 1b is a system architecture diagram of a terminal device;
FIG. 2 is a schematic diagram of an interaction flow of CA and TA;
fig. 3 is a functional deployment diagram of digital wallet software;
FIG. 4 is a schematic flow chart of a transaction data sender process in the digital wallet software;
FIG. 5 is a schematic process flow diagram of a transaction data receiver in the digital wallet software;
FIG. 6 is a flow chart diagram of a private key creation method;
FIG. 7 is a flow chart illustrating a private key encryption method;
FIG. 8 is a schematic diagram of a computer system.
Detailed Description
There is an increasing demand for terminal devices to handle important services. These trends have made terminal devices a key target for attacks by viruses such as malware, trojans and rootkits, from being able to pay, download and view the latest hollywood docks for a certain period of time, to being able to remotely pay bills and manage bank accounts via cell phones. In order to guarantee the security of the terminal equipment, the method is presented
Figure BDA0001660401400000032
Is a representative terminal device security framework. In the prior art
Figure BDA0001660401400000033
Under the framework, system-level security is obtained by dividing software and hardware resources of a system on chip (SoC) into two worlds, namely a normal world and a secure world (also called a secure domain and a non-secure domain), which respectively correspond to a Rich Execution Environment (REE) and a Trusted Execution Environment (TEE). The TEE and the REE run on the same device, and the TEE can ensure storage, processing and protection of sensitive data in a trusted environment and provide a secure execution environment for authorized Trusted Applications (TAs). However, the management and use of the private key by the mobile terminal in the blockchain scenario are based on the REE, and the security is not high because the REE has a problem of multiple attack surfaces, and after the private key management and use is moved to the TEE, the problems of creation and use of the private key in the TEE and how the digital signature flow interacts between the REE and the TEE need to be solved.
Fig. 1a is a schematic diagram of a network architecture of a block chain scenario in which the key management method provided in this embodiment is applied. The block chain system is composed of a plurality of terminal devices to form a point-to-point (peer-to-peer) decentralized network structure. A terminal device may be considered a node of a blockchain. The automobile in the figure represents an in-vehicle terminal device.
Fig. 1b is a schematic diagram of a system architecture of any one of the terminal devices in fig. 1 a. The terminal equipment comprises REE and TEE, wherein REE and TEE are respectively operated with
Figure BDA0001660401400000041
An operating system and a TEE-side operating system (e.g., an open-source OP-TEE operating system).
Figure BDA0001660401400000042
The operating system and the TEE OS are divided into two states, a user state and a kernel state. CA (client application) in REE and TA in TEE form a framework similar to client/server, TA is used as a server, CA is used as a client, CA initiates access operation, the CA and the TA exchange data through a message channel of a hardware layer, and the CA suspends the system after initiating a request and waits for the TA to return a result. The development of the CA needs to call a TEE client (client) API (application program interface) to realize communication with a corresponding TA; the TA needs to call the TEE internal (internal) API to implement the relevant functionality using the programming resources provided by the TEE.
A typical CA and TA interaction flow is shown in fig. 2:
s201: the CA first makes the necessary context initialization. The specific command implemented is TEEC _ InitializeContext.
S202: specifying the specific path (TA _ path) where the TA file is located, and opening the session. The specific command implemented is TEEC _ OpenSession (ta _ path).
S203: after session establishment is successful, a session handle (Return sessionhandle) is returned, at which time the TA has run in the TEE, waiting to receive commands from the CA.
S204: the CA sends a command, and the underlying interface calls an smc (secure monitor call) instruction to trigger the processor to switch to the secure mode, and passes the command to the TA in the TEE for processing (by way of shared memory). The specific command implemented is TEEC _ InvokeCommand (cmd).
S205: after the TA has processed the command, it returns a result (Return result) to the CA and the processor switches back to the non-secure mode.
It should be noted that, the processor also has a monitoring mode between the secure mode and the non-secure mode, and during the switching process, the processor switches from the secure mode to the monitoring mode first, then switches to the non-secure mode, and vice versa. For a more detailed handover process, reference may be made to the prior art, which is not described herein again.
In the prior art, a block chain-based application is implemented on a mobile device, and a private key management module and a data processing module in the application are implemented in an REE. The data processing module is used for performing hash operation, digital signature, abstract comparison and other processing on the data so as to identify whether the data is tampered and verify identity information of a sender.
Taking digital wallet software as an example, referring to fig. 3, it mainly includes five modules: a user management module 301, an asset management module 302, a key management module 305, a transaction data processing module 304, and a network management module 303. The user management module 301 is configured to authenticate correctness of a user name and a password when the user logs in. The asset management module 302 is used to view digital asset information, transfer funds to third parties, and the like. The network management module 303 is used for connecting to a network and transmitting/receiving network data packets. The key management module is used for creating and storing a private key and a public key. The transaction data processing module 304 is configured to perform hash operation and digital signature processing on outgoing transaction data, perform transaction summary data comparison on incoming transaction data, identify whether the transaction data is tampered with, and verify identity information of a sender. As shown in fig. 3, the present embodiment places the function of digital signature in the transaction data processing module (equivalent to the transaction data processing module 304_ B) and the key management module 305 on the TEE side for implementation, and still places the other functions (equivalent to the transaction data processing module 304_ a) and the other modules on the REE side for implementation.
The embodiment changes the digital wallet software from being implemented only on the REE side to being implemented on the REE and TEE sides together. The digital wallet software implements the functions of the aforementioned key management module and transaction data processing module through one or more TAs on the TEE side, and the functions of the other modules may be implemented through one or more CAs on the REE side.
It should be noted that, in this embodiment, 4 modules on the REE side are implemented by one CA, and 2 modules on the TEE side are implemented by one TA, while in other embodiments, different functional modules may also be implemented by multiple CAs or TAs. In addition, the division of the modules is also only an example, and the present application is not limited thereto.
Fig. 4 illustrates the processing flow of transaction data by taking wallet a paying 100 digital coins to wallet B as an example. In the embodiment, the procedure for calling the TEE side module by the REE side module is referred to the procedure for calling the TA by the CA described above, and the specific calling procedure is not described in detail.
S401: wallet a (also understood as terminal device a) hashes the transaction data using SHA256 algorithm on the REE side, generating a 256-bit transaction digest. The transaction data includes address information of wallet a, address information of wallet B, and payment amount information. The transaction data may be embodied as a string of characters.
S402: wallet a then sends the transaction digest to the TA on the TEE side over a data channel between the CA and TA. The concrete implementation is as follows: the CA on the REE side calls a TEEC _ InvokeCommand (cmd) function to send transaction summary data, wherein cmd is as follows: SEND _ DIGEST command.
If fig. 3 is taken as an example, steps S401 and S402 may be performed by the transaction data processing module 304_ a.
S403: the TA on the TEE side encrypts the transaction digest by using a private key of the wallet a and an Elliptic Curve Digital Signature Algorithm (ECDSA), and generates a Digital Signature (or called Signature data) smaller than 320 bit.
S404: the TA on the TEE side returns the signature data and the public key of wallet a to the re side CA. The wallet a public key and private key are created by TA on the TEE side, and they are created before use, but the specific time is not limited in this embodiment, for example, the public key may be created after the private key is created, or may be created before returning to the REE side. The public key of wallet a may be specifically obtained from the private key of wallet a and the ECDSA algorithm.
If fig. 3 is taken as an example, steps S403 and S404 may be performed by the transaction data processing module 304_ B.
S405: after the CA on the REE side obtains the public key and the signature data, the transaction data, the public key and the signature data are packaged into a network data packet together and sent to the network management module. The network management module broadcasts the network data packet to other blockchain nodes of the whole network.
If fig. 3 is taken as an example, step S405 may be executed by the transaction data processing module 304_ a.
Fig. 5, which is continued from fig. 4, is a processing procedure after wallet B (also understood as terminal device B) receives the network data packet. The processing procedure after the other nodes receive the network data packet is similar to that described below and will not be described in detail.
S501: CA analyzes three parts of data: transaction data, public key, and signature data.
S502: and the CA calls an SHA256 algorithm to carry out hash operation on the transaction data to obtain 256-bit abstract data.
S503: and the CA calls an ECDSA signature verification algorithm to decrypt the signature data to obtain the original transaction summary data.
S504: comparing whether the summary data generated in S502 and S503 are equal, if so, indicating that the transaction data is not tampered, and receiving the transaction data; otherwise, the transaction data is discarded.
In the above transaction data processing flow, the creation and storage of the private key is a critical link, and if the private key is leaked, the security of the transaction data cannot be guaranteed. Fig. 6 is a schematic flowchart of a process for creating a private key by a TA provided in the present application, which can also be understood as a schematic flowchart of a process for creating a private key by a private key management module.
S601: TA invokes a random number generator to generate a256 bit random number R1. Specifically, the random number generator is a hardware random number generator or a software random number generator, and generally, the hardware random number generator has better randomness and higher safety. The implementation of the software random number generator and the hardware random number generator is prior art in the field, where the software random number generator is a software functional unit, and the hardware random number generator is a hardware, and the specific implementation is prior art, and this embodiment only needs to be called, which is not described herein.
S602: the random number R1 is hashed to obtain a 256-bit private key using a Hash algorithm, which may be sha (secure Hash algorithm) 256.
S603: the private key obtained in S602 is encrypted by using another random number R2 (which may also be understood as a random password, a cipher, or a key), and the specific Encryption algorithm may be an aes (advanced Encryption standard)256 algorithm or other Encryption algorithms, which is not limited in this embodiment. The other random number may be generated by invoking the random number generator described above or another random number generator.
S603: the value of R2 and the encrypted key are stored.
To improve further security, the value of R2 in this embodiment may be updated. R2 is updated by performing the corresponding decryption algorithm on the encrypted key and then re-encrypting the private key with the new value.
Please refer to fig. 7, which is a flowchart illustrating a process of updating the random number R2.
S701: as shown in connection with fig. 4, the TA, after receiving the transaction digest, decrypts the currently stored key using the currently stored value of R2.
S702: the TA encrypts the transaction digest using the decrypted key to obtain signature data.
S703: the random number generator is triggered to generate a new random number as the value of R2.
S704: the private key is re-encrypted using the updated R2.
S705: the re-encrypted private key and the new R2 are stored.
While the update of R2 in the implementation shown in fig. 7 is performed after the digital signature (S702) is executed, in other embodiments, the update of R2 may be performed periodically, for example, every 3 seconds, or periodically in combination with the manner shown in fig. 7, or other update methods determined by the need.
The method provided by the embodiment uses the trusted execution environment of the TrustZone architecture to provide the security of the private key, can solve the problem of security risk brought by the creation, storage and use of the private key in the untrusted environment to a certain extent, and improves the security of transaction data or other types of data in a block chain application scene.
Fig. 8 is a schematic structural diagram of a computer system according to this embodiment. The computer system may be a terminal device. As shown, the computer system includes a communication module 510, a sensor 520, a user input module 530, an output module 540, a processor 550, an audio-visual input module 560, a memory 570, and a power supply 580.
The communication module 510 may include at least one module that enables communication between the computer system and a communication system or other computer system. For example, the communication module 510 may include one or more of a wired network interface, a broadcast receiving module, a mobile communication module, a wireless internet module, a local area communication module, and a location (or position) information module, etc. The various modules are implemented in various ways in the prior art, and are not described in the application.
The sensor 520 may sense a current state of the system, such as an open/close state, a position, whether there is contact with a user, a direction, and acceleration/deceleration, and the sensor 520 may generate a sensing signal for controlling the operation of the system.
A user input module 530 for receiving input digital information, character information, or contact touch operation/non-contact gesture, and receiving signal input related to user setting and function control of the system, etc. The user input module 530 includes a touch panel and/or other input devices.
The output module 540 includes a display panel for displaying information input by a user, information provided to the user or various menu interfaces of the system, and the like. Alternatively, the display panel may be configured in the form of a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), or the like. In other embodiments, the touch panel can be overlaid on the display panel to form a touch display screen. In addition, the output module 540 may further include an audio output module, an alarm, a haptic module, and the like.
And an audio/video input module 560 for inputting an audio signal or a video signal. The audio/video input module 560 may include a camera and a microphone.
The power supply 580 may receive external power and internal power under the control of the processor 550 and provide power required for the operation of the various components of the system.
Processor 550 may include one or more processors, for example, processor 150 may include one or more central processors, or one central processor and one graphics processor. When the processor 150 includes multiple processors, the multiple processors may be integrated on the same chip or may be separate chips. A processor may include one or more physical cores, where a physical core is the smallest processing module.
The memory 570 stores computer programs including an operating system program 572, application programs 571, and the like. Typical operating systems are those for desktop or notebook computers such as Windows from Microsoft corporation, MacOS from apple Inc., and others such as those developed by Google Inc
Figure BDA0001660401400000071
Android of
Figure BDA0001660401400000072
System, etc. for a mobile terminal. The method provided by the foregoing embodiments can be implemented by software, and can be considered as a specific implementation of the application 571.
The memory 570 may be one or more of the following types: flash (flash) memory, hard disk type memory, micro multimedia card type memory, card type memory (e.g., SD or XD memory), Random Access Memory (RAM), Static Random Access Memory (SRAM), Read Only Memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, or optical disk. In other embodiments, the memory 570 may be a network storage device on the internet, and the system may perform an update or read operation on the memory 570 on the internet.
The processor 550 is used to read the computer program in the memory 570 and then execute a method defined by the computer program, such as the processor 550 reading the operating system program 572 to run the operating system on the system and implement various functions of the operating system, or reading the one or more application programs 571 to run an application on the system.
The memory 570 also stores other data 573 in addition to computer programs, such as blocks, private keys, transaction data, and random numbers, etc., referred to in this application.
The connection relationship of each module in fig. 8 is only an example, and the method provided in any embodiment of the present application may also be applied to terminal devices in other connection manners, for example, all modules are connected through a bus.
It should be noted that the method provided in this embodiment may also be applied to a non-terminal computer device, such as a cloud server.
It should be noted that, the division of the modules or units in the foregoing embodiments is only provided as an exemplary illustration, the functions of the described modules are only exemplary, and the application is not limited thereto. Those skilled in the art may combine the functions of two or more modules, or split the functions of one module to obtain more modules with finer granularity, and other variations, as required.
The same or similar parts between the various embodiments described above may be referred to one another. In the present application, "a plurality" means two or more, or "at least two" unless otherwise specified.
The above-described embodiments of the apparatus are merely illustrative, wherein the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. In addition, in the drawings of the embodiment of the apparatus provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, and may be specifically implemented as one or more communication buses or signal lines. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only some specific embodiments of the present application, but the scope of the present application is not limited thereto.

Claims (7)

1.一种计算机系统,其特征在于,所述计算机系统上部署有富执行环境REE和可信执行环境TEE,所述计算机系统还部署有基于区块链技术的区块链功能单元,且TEE中部署有所述区块链功能单元中的私钥管理模块和交易数据处理模块,其中1. A computer system, characterized in that, a rich execution environment REE and a trusted execution environment TEE are deployed on the computer system, and the computer system is also deployed with a block chain functional unit based on block chain technology, and the TEE The private key management module and transaction data processing module in the blockchain functional unit are deployed in the 所述私钥管理模块用于:创建私钥,以及将所述私钥存储在TEE中;The private key management module is used for: creating a private key, and storing the private key in the TEE; 所述交易数据处理模块用于:利用所述私钥对区块链功能单元涉及的摘要数据执行加密;The transaction data processing module is used for: using the private key to perform encryption on the digest data involved in the blockchain functional unit; 所述私钥管理模块具体用于:在存储所述私钥之前利用密码对所述私钥执行加密,其中,存储的所述私钥为加密后的私钥;所述密码在条件满足时更新或周期性更新,更新后利用新密码重新对所述私钥执行加密,且存储新密码加密后的私钥。The private key management module is specifically configured to: encrypt the private key with a password before storing the private key, wherein the stored private key is the encrypted private key; the password is updated when conditions are met Or periodically updated, after the update, the private key is re-encrypted with the new password, and the private key encrypted with the new password is stored. 2.根据权利要求1所述的计算机系统,其特征在于,所述私钥管理模块具体用于:在利用所述私钥执行完一次对所述摘要数据的加密之后更新所述密码。2 . The computer system according to claim 1 , wherein the private key management module is specifically configured to: update the password after the encryption of the digest data is performed once by using the private key. 3 . 3.根据权利要求1或2所述的计算机系统,其特征在于,所述密码为硬件随机数产生器产生的随机数。3. The computer system according to claim 1 or 2, wherein the password is a random number generated by a hardware random number generator. 4.一种区块链技术中私钥的管理方法,其特征在于,所述方法应用于部署有富执行环境REE和可信执行环境TEE的计算机系统,所述计算机系统上还部署有区块链功能单元,所述方法包括:在TEE创建所述区块链功能单元所涉及的私钥,以及将所述私钥存储在TEE侧;在TEE侧利用所述私钥对所述区块链功能单元涉及的摘要数据执行加密;4. A method for managing private keys in blockchain technology, wherein the method is applied to a computer system deployed with a rich execution environment REE and a trusted execution environment TEE, and a block is also deployed on the computer system A chain function unit, the method includes: creating a private key involved in the blockchain function unit on the TEE, and storing the private key on the TEE side; using the private key on the TEE side to pair the blockchain The digest data involved in the functional unit performs encryption; 在存储所述私钥之前所述方法还包括:利用密码对所述私钥执行加密,其中,存储的所述私钥为加密后的私钥;所述密码在条件满足时更新或周期性更新,更新后利用新密码重新对所述私钥执行加密,且存储新密码加密后的私钥。Before storing the private key, the method further includes: encrypting the private key with a password, wherein the stored private key is an encrypted private key; the password is updated or periodically updated when conditions are met , after the update, the private key is re-encrypted with the new password, and the private key encrypted by the new password is stored. 5.根据权利要求4所述的方法,其特征在于,所述密码在条件满足时更新包括:在利用所述私钥执行完一次对所述摘要数据的加密之后更新所述密码。5 . The method according to claim 4 , wherein updating the password when a condition is satisfied comprises: updating the password after performing one encryption of the digest data with the private key. 6 . 6.一种计算机系统,其特征在于,所述计算机系统包括存储器和处理器,所述存储器用于存储计算机程序,所述处理器用于读取并执行所述计算机程序以实现如权利要求4或5所述的方法。6. A computer system, characterized in that the computer system comprises a memory and a processor, the memory is used to store a computer program, and the processor is used to read and execute the computer program to realize the method as claimed in claim 4 or 5 the method described. 7.一种区块链系统,其特征在于,所述区块链系统中包括如权利要求6所述的计算机系统。7. A blockchain system, characterized in that, the blockchain system includes the computer system according to claim 6.
CN201810458967.2A 2018-05-15 2018-05-15 Private key management method, device and system in blockchain scenario Active CN110492990B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810458967.2A CN110492990B (en) 2018-05-15 2018-05-15 Private key management method, device and system in blockchain scenario
PCT/CN2019/086111 WO2019218919A1 (en) 2018-05-15 2019-05-09 Private key management method and apparatus in blockchain scenario, and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810458967.2A CN110492990B (en) 2018-05-15 2018-05-15 Private key management method, device and system in blockchain scenario

Publications (2)

Publication Number Publication Date
CN110492990A CN110492990A (en) 2019-11-22
CN110492990B true CN110492990B (en) 2021-10-15

Family

ID=68539534

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810458967.2A Active CN110492990B (en) 2018-05-15 2018-05-15 Private key management method, device and system in blockchain scenario

Country Status (2)

Country Link
CN (1) CN110492990B (en)
WO (1) WO2019218919A1 (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111178884B (en) * 2019-12-16 2024-04-12 平安壹钱包电子商务有限公司 Information processing method, device, equipment and readable storage medium
CN111192050B (en) * 2019-12-31 2023-08-11 成都库珀创新科技有限公司 Digital asset private key storage and extraction method and device
CN110851851B (en) * 2020-01-15 2020-11-06 蚂蚁区块链科技(上海)有限公司 Authority management method, device and equipment in block chain type account book
CN111429254B (en) * 2020-03-19 2021-09-10 腾讯科技(深圳)有限公司 Business data processing method and device and readable storage medium
CN111400743B (en) * 2020-04-07 2023-08-15 百度国际科技(深圳)有限公司 Transaction processing method, device, electronic equipment and medium based on blockchain network
CN111538782B (en) * 2020-04-14 2023-08-08 浙江浙燃能源有限公司 Energy big data management system based on block chain
CN111565108B (en) * 2020-07-15 2020-11-24 北京信安世纪科技股份有限公司 Signature processing method, device and system
CN111881474B (en) * 2020-07-24 2023-09-15 杭州弦冰科技有限公司 Private key management method and device based on trusted computing environment
CN111737724B (en) * 2020-08-26 2021-01-01 腾讯科技(深圳)有限公司 Data processing method and device, intelligent equipment and storage medium
CN113014539B (en) * 2020-11-23 2022-05-17 杭州安芯物联网安全技术有限公司 Internet of things equipment safety protection system and method
CN113395159B (en) * 2021-01-08 2024-03-12 腾讯科技(深圳)有限公司 Data processing method based on trusted execution environment and related device
CN113221141B (en) * 2021-05-06 2022-07-19 杭州复杂美科技有限公司 Wallet encryption storage method, signature method, computer device and storage medium
CN113656841A (en) * 2021-07-28 2021-11-16 复旦大学 A blockchain terminal security system based on trustzone
CN114157431A (en) * 2021-10-27 2022-03-08 上海朝夕网络技术有限公司 Block chain transaction processing method based on multivariate signature method and computer equipment
CN114465761A (en) * 2021-12-22 2022-05-10 航天信息股份有限公司 System and method for safety communication and terminal management

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106549749A (en) * 2016-12-06 2017-03-29 杭州趣链科技有限公司 A kind of block chain method for secret protection encrypted based on additive homomorphism
CN106850200A (en) * 2017-01-25 2017-06-13 中钞信用卡产业发展有限公司北京智能卡技术研究院 A kind of method for using the digital cash based on block chain, system and terminal
CN106991334A (en) * 2016-11-24 2017-07-28 阿里巴巴集团控股有限公司 A kind of method, system and device of data access
CN107896150A (en) * 2017-12-21 2018-04-10 善林(上海)金融信息服务有限公司 Link block chain network and the system of Internet of Things
CN107920052A (en) * 2017-08-02 2018-04-17 唐盛(北京)物联技术有限公司 A kind of encryption method and intelligent apparatus

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9973341B2 (en) * 2015-01-23 2018-05-15 Daniel Robert Ferrin Method and apparatus for the limitation of the mining of blocks on a block chain
US10318746B2 (en) * 2015-09-25 2019-06-11 Mcafee, Llc Provable traceability
WO2018058441A1 (en) * 2016-09-29 2018-04-05 Nokia Technologies Oy Method and apparatus for trusted computing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106991334A (en) * 2016-11-24 2017-07-28 阿里巴巴集团控股有限公司 A kind of method, system and device of data access
CN106549749A (en) * 2016-12-06 2017-03-29 杭州趣链科技有限公司 A kind of block chain method for secret protection encrypted based on additive homomorphism
CN106850200A (en) * 2017-01-25 2017-06-13 中钞信用卡产业发展有限公司北京智能卡技术研究院 A kind of method for using the digital cash based on block chain, system and terminal
CN107920052A (en) * 2017-08-02 2018-04-17 唐盛(北京)物联技术有限公司 A kind of encryption method and intelligent apparatus
CN107896150A (en) * 2017-12-21 2018-04-10 善林(上海)金融信息服务有限公司 Link block chain network and the system of Internet of Things

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
TrustZone-backed Bitcoin Wallet;Miraje Gentilal;《Proceedings of the Fourth Workshop on Cryptography and Security in Computing Systems》;20170131;摘要,第1-4节,图1 *

Also Published As

Publication number Publication date
WO2019218919A1 (en) 2019-11-21
CN110492990A (en) 2019-11-22

Similar Documents

Publication Publication Date Title
CN110492990B (en) Private key management method, device and system in blockchain scenario
US10579793B2 (en) Managed securitized containers and container communications
KR102451109B1 (en) Generate key proofs that provide device anonymity
US10129240B2 (en) Distributing security codes through a restricted communications channel
US10938792B2 (en) Layered encryption for end to end communication
US10601590B1 (en) Secure secrets in hardware security module for use by protected function in trusted execution environment
CN111737366B (en) Private data processing method, device, equipment and storage medium of block chain
EP3937045B1 (en) Hash updating methods and apparatuses of blockchain integrated station
JP2020528224A (en) Secure execution of smart contract operations in a reliable execution environment
US20160080157A1 (en) Network authentication method for secure electronic transactions
US20180091487A1 (en) Electronic device, server and communication system for securely transmitting information
KR102186114B1 (en) Method, system, and medium for using dynamic public key infrastructure to transmit and receive encrypted messages
US10045212B2 (en) Method and apparatus for providing provably secure user input/output
JP6756056B2 (en) Cryptographic chip by identity verification
US20240113898A1 (en) Secure Module and Method for App-to-App Mutual Trust Through App-Based Identity
EP4175218A1 (en) Method to establish a secure channel
CN116050537A (en) Federal learning method and device, readable storage medium and electronic equipment
CN113630412B (en) Resource downloading method, resource downloading device, electronic equipment and storage medium
CN112308236B (en) Method, device, electronic equipment and storage medium for processing user request
CN111400743B (en) Transaction processing method, device, electronic equipment and medium based on blockchain network
US20250013737A1 (en) Method to store data persistently by a software payload
US20250015989A1 (en) Method to establish a secure channel
CN108154037B (en) Inter-process data transmission method and device
CN113672973A (en) Database system of embedded equipment based on RISC-V architecture of trusted execution environment
Siriwardana et al. Secure Communication in Dolphin: Integrating Trusted Execution Environments for Enhanced Caller Privacy

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant