Private key management method and device, medium and equipment
By encrypting and storing private keys on offline devices, the problem of private keys being vulnerable to attacks in the network environment is solved, and the security management of private keys and digital resources is realized, simplifying user operations.
Patent Information
- Application Number
- CN202311394583.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-25
- Publication Date
- 2025-04-25
AI Technical Summary
When using private keys to sign transactions in a network environment, it is vulnerable to cyber attacks, resulting in leakage of private keys and loss of digital resources.
Provide a private key management method, which uses offline devices to store and manage private keys, encrypts and stores private keys through the display wizard interface, and closes offline digital resource applications when a network connection or data transmission request is detected, ensuring the security of the private keys.
By encrypting and storing private keys on offline devices, private keys are avoided due to network attacks, security of private keys and digital resources is ensured, and user operations are simplified.
Smart Images

Figure CN119892343A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and specifically to private key management methods, devices, media and equipment. Background Art
[0002] Digital resources refer to resources that exist in the form of electronic data and are owned or controlled by an enterprise or individual. The decentralized blockchain technology used in related technologies to save and trade digital resources is also called a blockchain wallet. The blockchain wallet essentially manages public and private keys. Among them, the private key is used to sign transactions of digital resources, but when using the private key to sign transactions in a network environment, it is vulnerable to network attacks, resulting in the leakage of the private key and the loss of digital resources. Therefore, the security of private key storage and use is an issue that needs to be solved urgently. Summary of the invention
[0003] In order to improve the security of private key storage and use, this application provides a private key management method, device, medium and equipment. The technical solution is as follows:
[0004] In a first aspect, the present application provides a private key management method, which is applied to an offline device, and the method includes:
[0005] Displaying a wizard interface on the offline device, where the offline device is a device disconnected from the network;
[0006] In response to a program installation instruction triggered by the target object based on the wizard interface, installing and running an offline digital resource application on the offline device, and displaying an initialization interface of the offline digital resource application;
[0007] In response to an offline account import instruction triggered by the target object based on the initialization interface, generating an offline digital resource account corresponding to the target object in the offline digital resource application;
[0008] In response to a private key import instruction triggered by the target object based on the initialization interface, obtaining at least one private key corresponding to the offline digital resource account;
[0009] The at least one private key is encrypted, and the encrypted at least one private key is stored in a storage space corresponding to the offline digital resource application in the offline device.
[0010] Optionally, the method further includes:
[0011] Performing real-time detection on the network connection status of the offline device to obtain a first detection result;
[0012] When the first detection result indicates that there is a network connection request or the network has been connected, the offline digital resource application is closed.
[0013] Optionally, the method further includes:
[0014] Performing real-time detection on the data transmission status of the offline device to obtain a second detection result;
[0015] When the second detection result indicates that there is a data transmission request or the application is in a data transmission state, the offline digital resource application is closed.
[0016] Optionally, closing the offline digital resource application includes:
[0017] Clearing the at least one encrypted private key recorded in the storage space;
[0018] Generate random data, and write the random data into the storage space.
[0019] Optionally, the method further includes:
[0020] Based on the encrypted at least one private key, generate private key list information, wherein the private key list information indicates identification information of the encrypted at least one private key;
[0021] A main interface is displayed on the offline device, and private key list information is displayed in the main interface.
[0022] Optionally, a QR code scanning control is displayed in the main interface, and the method further includes:
[0023] In response to a scanning instruction triggered by the target object based on the QR code scanning control, first image information displayed on an online device is obtained; the first image information is a QR code image generated by an online digital resource application running on the online device in response to an interaction initiation instruction triggered by the target object; the online device is a device connected to a network; the online digital resource application is used to manage an online digital resource account corresponding to the target object; the online device does not store the at least one private key;
[0024] parsing the first image information to obtain interaction information;
[0025] Using the encrypted at least one private key to sign the interactive information offline to obtain signed interactive information;
[0026] According to the signed interactive information, second image information is generated and displayed, where the second image information is a QR code image, so that the online device can obtain the signed interactive information by scanning the second image information.
[0027] Optionally, a backup control is displayed in the main interface, and the method further includes:
[0028] In response to a backup instruction triggered by the target object based on the backup control, backing up the encrypted at least one private key to generate third image information, where the third image information is a two-dimensional code image and represents the encrypted at least one private key;
[0029] The third image information is displayed on the offline device, so that other offline devices can obtain the encrypted at least one private key by scanning the third image information.
[0030] In a second aspect, the present application provides a private key management device, which is applied to an offline device, and the device includes:
[0031] A first display module is used to display a wizard interface on the offline device, where the offline device is a device disconnected from the network;
[0032] An application installation and operation module, for responding to a program installation instruction triggered by a target object based on the wizard interface, installing and running an offline digital resource application on the offline device, and displaying an initialization interface of the offline digital resource application;
[0033] A first initialization module, configured to generate an offline digital resource account corresponding to the target object in the offline digital resource application in response to an offline account import instruction triggered by the target object based on the initialization interface;
[0034] A second initialization module, configured to obtain at least one private key corresponding to the offline digital resource account in response to a private key import instruction triggered by the target object based on the initialization interface;
[0035] The private key storage module is used to encrypt the at least one private key and store the encrypted at least one private key in a storage space corresponding to the offline digital resource application in the offline device.
[0036] In a third aspect, the present application provides a computer-readable storage medium, which stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by a processor to implement a private key management method as described in the first aspect.
[0037] In a fourth aspect, the present application provides a computer device, comprising a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement a private key management method as described in the first aspect.
[0038] In a fifth aspect, the present application provides a computer program product, which includes computer instructions, and when the computer instructions are executed by a processor, a private key management method as described in the first aspect is implemented.
[0039] The private key management method, device, medium and equipment provided by this application have the following technical effects:
[0040] The solution provided in this application is applied to offline devices for storage and other management of private keys, including a series of operations based on a graphical user interface displayed on the offline device to achieve the installation and operation of offline digital resource applications, the import of offline digital resource accounts and the import of private keys. The private keys are stored in offline devices to ensure that the private keys will not be leaked due to network attacks, thereby ensuring the security of private keys and digital resources.
[0041] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 It is a schematic diagram of an implementation environment of a private key management method provided in an embodiment of the present application;
[0044] Figure 2 It is a flowchart of a private key management method provided in an embodiment of the present application;
[0045] Figure 3 It is a flowchart of an initialization interface provided in an embodiment of the present application;
[0046] Figure 4 is a schematic diagram of an offline digital resource account import interface provided in an embodiment of the present application;
[0047] Figure 5 It is a flowchart of another initialization interface provided in an embodiment of the present application;
[0048] Figure 6 is a schematic diagram of a private key import interface provided in an embodiment of the present application;
[0049] Figure 7 is a schematic diagram of a main interface provided in an embodiment of the present application;
[0050] Figure 8 This is a schematic diagram of an interaction process provided by an embodiment of the present application;
[0051] Fig. 9 This is another interactive flow diagram provided by an embodiment of the present application;
[0052] Fig.10 is a schematic diagram of a private key management device provided in an embodiment of the present application;
[0053] Fig.11 It is a schematic diagram of the architecture of a digital resource application system provided by an embodiment of the present application;
[0054] Fig.12 It is a schematic diagram of the hardware structure of a device for implementing a private key management method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the scope of protection of this application. Examples of the embodiments are shown in the drawings, where the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions.
[0056] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0057] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0058] The private key management method of the embodiment of the present application involves blockchain technology. Blockchain is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer.
[0059] The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operational detection. Among them, the user management module is responsible for the identity information management of all blockchain participants. Including maintaining public and private key generation (account management), key management, and maintaining the correspondence between the user's real identity and the blockchain address (authority management), etc., and under authorization, supervising and auditing the transactions of certain real identities, and providing risk control rule configuration (risk control audit): The basic service module is deployed on all blockchain node devices to verify the validity of business requests, and record the valid requests to the storage after consensus is reached. For a new business request, the basic service first adapts the interface to parse and authenticate (interface adaptation), and then encrypts the business information through the consensus algorithm (consensus management), and transmits the complete and consistent information after encryption. The smart contract module is responsible for the registration and issuance of contracts, as well as contract triggering and contract execution. Developers can define the contract logic in a programming language and publish it to the blockchain (contract registration). According to the logic of the contract terms, the key or other events are called to trigger the execution and complete the contract logic. It also provides the function of contract upgrade and cancellation. The operation detection module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation and real-time status visualization output of the product during the product release process, such as alarm, network status detection, node equipment health status detection, etc.
[0060] The platform product service layer provides the basic capabilities and implementation framework of typical applications. Developers can superimpose business features based on these basic capabilities to complete the blockchain implementation of business logic. The application service layer provides application services based on blockchain solutions for business participants to use.
[0061] See also Figure 1 , which is a schematic diagram of an implementation environment of a private key management method provided in an embodiment of the present application, such as Figure 1As shown, the implementation environment is a distributed system 100 based on blockchain technology, which may include at least multiple nodes 200, online devices 300 and offline devices 400. Multiple nodes 200 and online devices 300 are connected in the form of network communication, and offline devices 400 are not connected to online devices 300 or any node 100. The node is any form of computing device in the access network, such as a server, a user terminal, etc. The nodes are formed based on a point-to-point protocol. The point-to-point protocol is an application layer protocol running on the Transmission Control Protocol (TCP) protocol. In a distributed system, any machine such as a server or a terminal can join and become a node. The node includes a hardware layer, an intermediate layer, an operating system layer, and an application layer.
[0062] See also Figure 1 The functions of each node in the blockchain system shown include:
[0063] 1) Routing: a basic function of a node, used to support communication between nodes.
[0064] In addition to the routing function, the node can also have the following functions:
[0065] 2) Applications are deployed in the blockchain to implement specific businesses based on actual business needs, record data related to the implementation of functions to form record data, carry digital signatures in the record data to indicate the source of the task data, and send the record data to other nodes in the blockchain system for other nodes to add the record data to a temporary block when they successfully verify the source and integrity of the record data.
[0066] For example, the services implemented by the application include:
[0067] 2.1) Wallet, used to provide the function of conducting electronic currency transactions, including initiating transactions (i.e., sending the transaction record of the current transaction to other nodes in the blockchain system. After the other nodes successfully verify the transaction, as a response to acknowledge the validity of the transaction, the transaction record data is stored in the temporary block of the blockchain; of course, the wallet also supports querying the remaining electronic currency in the electronic currency address;
[0068] 2.2) Shared ledger, which is used to provide functions such as storage, query and modification of account data. The record data of the operation on the account data is sent to other nodes in the blockchain system. After other nodes verify the validity, as a response to acknowledging the validity of the account data, the record data is stored in a temporary block, and a confirmation can also be sent to the node that initiated the operation.
[0069] 2.3) Smart contracts are computerized protocols that can execute the terms of a contract. They are implemented by deploying code on a shared ledger that is executed when certain conditions are met. The code is used to complete automated transactions based on actual business needs, such as querying the logistics status of the goods purchased by the buyer and transferring the buyer's electronic currency to the merchant's address after the buyer signs for the goods. Of course, smart contracts are not limited to executing contracts for transactions, but can also execute contracts for processing received information.
[0070] 3) Blockchain, including a series of blocks that are connected to each other in the order of their generation. Once a new block is added to the blockchain, it will not be removed. The block records the record data submitted by the nodes in the blockchain system.
[0071] In an embodiment of the present application, a private key management method provided by the present application is used to store the private key in the offline device 400. When a user initiates an interactive operation for a digital resource on the online device 300, the first image information displayed by the online device 300 is obtained by using the QR code scanning control of the offline device 400. The first image information is a QR code image generated by the online digital resource application running on the online device in response to the interactive initiation instruction triggered by the target object; the offline device 400 parses the first image information to obtain the interactive information, and uses the encrypted private key to sign the interactive information offline to obtain the signed interactive information; the offline device 400 generates and displays the second image information according to the signed interactive information, and the second image information is a QR code image; the online device 300 also uses its own QR code scanning control to obtain the second image information displayed by the offline device 400, and parses the second image information to obtain the signed interactive information. The online device 300 submits the signed interactive information to a node 200 in the distributed system 100 through the network for verification and transfer of digital resources.
[0072] In the embodiment of the present application, the offline device 400 is not connected to the online device 300 or any node 200 in the blockchain, which ensures the security of the private key stored in the offline device, thereby also ensuring the security of the digital resources. The exchange of interactive information and signed interactive information based on the QR code image is simple and convenient to operate, and no additional dedicated equipment is required. Only one of the devices needs to be kept offline, which reduces the equipment cost.
[0073] The embodiments of the present application can also be implemented in combination with cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software and network in a wide area network or a local area network to realize the calculation, storage, processing and sharing of data. It can also be understood as a general term for network technology, information technology, integration technology, management platform technology and application technology based on the cloud computing business model. Cloud technology needs to be supported by cloud computing. Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". Specifically, each node 200 can be a physical machine or a virtualized machine.
[0074] See also Figure 2 , which is a flowchart of a private key management method provided in an embodiment of the present application. The present application provides method operation steps as described in the embodiment or flowchart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only order of execution. When the actual system or server product is executed, it can be executed in sequence or in parallel according to the method shown in the embodiment or the accompanying drawings (for example, in a parallel processor or multi-threaded processing environment). Please refer to Figure 2 A private key management method provided in an embodiment of the present application may include the following steps:
[0075] S210: In the offline device display wizard interface, the offline device is a device that is disconnected from the network.
[0076] A private key management method provided in an embodiment of the present application includes processes such as storage, management, and application of private keys. The embodiment of the present application uses an offline device to store and back up private keys, and uses offline devices and online devices to use private keys. In the storage stage, the target object, that is, the user, needs to perform a series of operations based on the graphical user interface displayed by the offline device.
[0077] In the embodiment of the present application, the offline device is a device disconnected from the network, that is, the offline device needs to remain disconnected from any network and not have a SIM (Subscriber Identity Module) card inserted to ensure the security of the private key stored in the offline device. The offline device can be the target object's own mobile phone, tablet or other terminal, and there is no need to purchase special equipment. The security of special equipment will be affected by the manufacturer, and there may also be problems such as high cost, low convenience, and low compatibility.
[0078] In one embodiment of the present application, an application installation package of an offline digital resource application is installed in the offline device. After decompressing the application installation package and driving the installation program, a wizard interface is displayed on the offline device. The wizard interface is used to guide the target object to perform preset operations to achieve the installation and operation of the offline digital resource application.
[0079] S220: In response to the program installation instruction triggered by the target object based on the wizard interface, the offline digital resource application is installed and run on the offline device, and an initialization interface of the offline digital resource application is displayed.
[0080] In an embodiment of the present application, the target object may be the user who executes the instruction or operation, and may also be the owner of the private key, offline digital resource account, or digital resource.
[0081] In an embodiment of the present application, the offline digital resource application is an application running on an offline device for managing offline digital resource accounts and corresponding private keys. The offline digital resource application needs to run in an offline state. If the offline device detects an abnormal situation such as a network connection, the offline digital resource application needs to be closed in time to protect the security of the private key.
[0082] In the embodiment of the present application, the wizard interface is used to guide the target object to perform a preset installation operation to achieve the installation and startup of the offline digital resource application. The wizard interface may include a guide instruction, an operation button, or an operation demonstration window, etc. The target object may trigger the program installation instruction by clicking a preset button control according to the guide instruction or the operation demonstration, and the program installation instruction is used to instruct the offline device to load the application installation package of the offline digital resource application, thereby starting and running the offline digital resource application on the offline device. After starting the offline digital resource application, the target object is guided to import the offline digital resource account and the corresponding private key by displaying the initialization interface.
[0083] S230: In response to the offline account import instruction triggered by the target object based on the initialization interface, an offline digital resource account corresponding to the target object is generated in the offline digital resource application.
[0084] In the embodiment of the present application, the offline digital resource account is used to manage the private key corresponding to the digital resource owned by the target object in the offline digital resource application as the target object.
[0085] In the embodiment of the present application, the target object can input relevant account information based on the initialization interface, such as the account name and the account password for logging into the offline digital resource account in the offline digital resource application. In response to the triggered offline account import instruction, the offline digital resource application generates an offline digital resource account corresponding to the target object according to the relevant account information input by the target object.
[0086] Figure 3 An initialization interface is shown, such as Figure 3 As shown, the target object can trigger the offline account import instruction by clicking the area corresponding to "Import offline digital resource account" in the initialization interface, and the initialization interface can jump to the following Figure 4 As shown, the target object can input account-related information based on the initialization interface after the jump, and in response to the account registration instruction triggered by the target object clicking the "Register" button after completing the information input, an offline digital resource account corresponding to the target object is generated in the offline digital resource application based on the input account-related information.
[0087] Figure 5 Another initialization interface is shown, such as Figure 5 As shown in FIG. 1 , the target object can trigger the account creation instruction by clicking the area corresponding to “I don’t have an offline account”, and the offline digital resource application jumps the window in the initialization interface in response to the account creation instruction. The initialization interface after the jump can also be as shown in FIG. Figure 4 As shown, the target object can input account-related information based on the initialization interface after the jump, and in response to the account generation instruction triggered by the target object clicking the "Create" button after the information input is completed, an offline digital resource account corresponding to the target object is generated in the offline digital resource application, that is, the offline account import instruction can include an account creation instruction and an account generation instruction. After the offline digital resource account is generated, the window jumps again in the initialization interface to facilitate the target object to import the private key. It can be understood that when the offline digital resource application is run again later, Figure 5 The interface shown may also be a login interface, and the offline digital resource account can be logged in by clicking “I have an offline account” without regenerating it. Figure 3 , Figure 4 and Figure 5 It is an example of this application, not a limitation of the initialization interface.
[0088] S240: In response to a private key import instruction triggered by the target object based on the initialization interface, obtaining at least one private key corresponding to the offline digital resource account.
[0089] In an embodiment of the present application, after generating an offline digital resource account corresponding to the target object in the offline digital resource application, the corresponding private key can be imported for the digital resources owned by the target object, and the private key is used to sign the interactive information of the digital resources offline.
[0090] like Figure 3 As shown, the target object can trigger the private key import instruction by clicking the area corresponding to "Import Private Key" in the initialization interface. In response to the private key import instruction, the initialization interface can jump to the following Figure 6 As shown, the target object can be based on Figure 6 Enter relevant information on the initialization interface shown, including but not limited to the selection of digital resources (such as Figure 6 The selected digital resources stored on blockchain A), the private key corresponding to the digital resources, mnemonics, etc., can be entered manually or obtained by scanning the QR code. In response to the target object clicking the "Import" button after the information input is completed, the private key corresponding to the offline digital resource account is obtained.
[0091] It should be noted that at least one private key can be imported into the offline digital resource account, and the private key can correspond to the category of the blockchain in which the digital resource is stored. It should be noted that in the embodiment of the present application, the category of the blockchain imported into the offline digital resource account is used to correspond to the private key to be stored, and will not be associated with the specific resource amount and other information of the digital resource stored in the blockchain.
[0092] In the embodiment of the present application, the offline digital resource account is used to manage the private key corresponding to at least one type of digital resource owned by the target object, but does not directly manage the digital resources.
[0093] S250: Encrypt at least one private key, and store the encrypted at least one private key in a storage space corresponding to the offline digital resource application in the offline device.
[0094] In the embodiment of the present application, at least one private key is encrypted using a 256-bit Advanced Encryption Standard (AES) algorithm or other encryption algorithms, which can improve the security of private key storage. In the embodiment of the present application, the encrypted private key can be stored in a designated storage space, which is conducive to the management of private key storage, and it is convenient to clear the encrypted private key in a timely manner in the event of a risk, thereby avoiding the leakage of the private key.
[0095] In the above embodiment, the private key corresponding to the digital resource is stored in an offline device disconnected from the network, which greatly improves the security of the private key and avoids the loss of digital resources caused by the leakage of the private key.
[0096] In one embodiment of the present application, when running the offline digital resource application, the method may further include:
[0097] S310: Perform real-time detection on the network connection status of the offline device to obtain a first detection result.
[0098] Specifically, the wired network connection status, wireless network connection status, Bluetooth connection status or mobile network connection status of the offline device may be continuously detected, and the first detection result may indicate whether there is a network connection or whether there is a network connection request.
[0099] S320: When the first detection result indicates that there is a network connection request or the network has been connected, close the offline digital resource application.
[0100] When the first detection result indicates that there is a network connection request or the network has been connected, it indicates that there is a security risk. Closing the offline digital resource application in time can improve the security of private keys and digital resources.
[0101] S330: Or, perform real-time detection on the data transmission status of the offline device to obtain a second detection result.
[0102] Specifically, the data transmission status of the offline device can be continuously detected, and the second detection result can indicate whether there is data transmission including but not limited to data transmission based on Near Field Communication (NFC), data transmission based on Universal Serial Bus (USB), etc.
[0103] S340: When the second detection result indicates that there is a data transmission request or the application is in a data transmission state, close the offline digital resource application.
[0104] The second detection result indicates that there is a data transmission request or is in a data transmission state, which indicates that there is a security risk. Closing the offline digital resource application in time can improve the security of private keys and digital resources.
[0105] In the above embodiment, the detection service can be automatically started when the offline digital resource application is started. The detection service will continue to run in the background of the offline device, without affecting the normal use of the offline digital resource application by the user. The detection service periodically checks the network connection status and data transmission status on the offline device. For example, at regular intervals (such as 0.5 seconds), the detection service will automatically query the status of the main network connection type and the status of the main data transmission type on the device. When it is detected that there is a network connection request, it has been connected to the network, there is a data transmission request or it is in a data transmission state, in addition to being able to close the offline digital resource application in time, it can also try to automatically disconnect the network connection and data transmission, which can ensure that the offline digital resource account and private key are always kept in a state without network connection, and maximize the protection of the security of the private key. In addition, a prompt message can also be sent to the target object, and the prompt message can be a pop-up window, a sound prompt or a notification bar reminder on the mobile phone, etc., to remind the current possible risks, and the target object needs to manually disconnect the network connection or data transmission as soon as possible, and follow the safety suggestions provided by the offline digital resource application.
[0106] The closing of the offline digital resource application in step S320 or step S340 may include:
[0107] S350: Clear at least one encrypted private key recorded in the storage space.
[0108] S360: Generate random data, and write the random data into a storage space.
[0109] Specifically, when it detects that there is a network connection request, that the device is connected to the network, that there is a data transmission request, or that the device is in a data transmission state, the offline device will close the offline digital resource application, including releasing the memory storage space occupied by the encrypted private key and generating random data. The memory storage space will be overwritten with random data to avoid leakage of the private key and ensure the security of the private key and digital resources.
[0110] In one embodiment of the present application, the method may further include:
[0111] S410: Generate private key list information based on the at least one encrypted private key, where the private key list information indicates identification information of the at least one encrypted private key.
[0112] The identification information may include the corresponding private key corresponding to the blockchain category or digital resource category, private key number, etc.
[0113] S420: Displaying a main interface on the offline device, and displaying private key list information in the main interface.
[0114] In the above embodiment, Figure 7 A main interface is shown, in which private key list information is displayed. The private key list information displayed in the main interface can facilitate user use and management without exposing the private key.
[0115] In one embodiment of the present application, a QR code scanning control is displayed in the main interface, such as Figure 8 As shown, the method may also include:
[0116] S410: In response to a scanning instruction triggered by a target object based on a QR code scanning control, obtaining first image information displayed on an online device; the first image information is a QR code image generated by an online digital resource application running on the online device in response to an interaction initiation instruction triggered by the target object; the online device is a device connected to a network; the online digital resource application is used to manage an online digital resource account corresponding to the target object; and at least one private key is not stored in the online device.
[0117] In an embodiment of the present application, an online digital resource application is running in an online device, and in the online digital resource application, the target object manages the digital resources owned by the target object through an online digital resource account, including viewing the relevant information of the digital resources, transferring the digital resources, etc., but no private key is stored in the online device or the online digital resource application. When the target object initiates a transfer or payment for the digital resources in the online digital resource application, an interaction initiation instruction is generated, and the online device or the online digital resource application responds to the interaction initiation instruction, generates a corresponding two-dimensional code image according to the interaction information, and displays the two-dimensional code image. The first image information can be directly the two-dimensional code image corresponding to the interaction information, or it can be the encrypted two-dimensional code image corresponding to the interaction information.
[0118] like Figure 7 As shown, the scanning instruction can be triggered through the QR code scanning control in the main interface, that is, the "Scan Signature" button. The offline device responds to the scanning instruction and adjusts the camera component to scan or shoot the image, thereby obtaining the first image information displayed by the online device.
[0119] S420: Analyze the first image information to obtain interaction information.
[0120] After acquiring the first graphic information, the offline device or offline digital resource application parses the first image information through a preset QR code decoding program to obtain interactive information. The interactive information is the relevant information corresponding to the interactive operation such as transfer and payment of digital resources initiated by the target object in the online digital resource application of the online device, including the type of digital resources, the amount of digital resources, the address of the transfer object or the address of the payment object, the transfer time or the payment time, the handling fee, etc.
[0121] S430: Use the encrypted at least one private key to sign the interactive information offline to obtain the signed interactive information.
[0122] According to the interactive technology of digital resources in the blockchain, the target object needs to use the private key to interactively sign the interactive information, which is equivalent to encrypting the interactive information and can be used to verify the integrity and authenticity of the interactive information.
[0123] In an embodiment of the present application, based on the target private key in at least one private key selected by the target object, the offline device or offline digital resource application calls a signature program to sign the parsed interaction information. Since the signature operation is performed in an offline state, it can be called an offline signature.
[0124] S440: Generate and display second image information according to the signed interactive information, where the second image information is a QR code image, so that an online device can obtain the signed interactive information by scanning the second image information.
[0125] After generating the signed interactive information, the offline device or offline digital resource application encodes the signed interactive information through a preset QR code encoding program to obtain the second image information. It can be understood that the QR code decoding program and the QR code encoding program are inverse processes of each other.
[0126] In another embodiment of the present application, the offline device or offline digital resource application can encode the signed interaction information into text data, and the target object can manually input the text data into the online device or online digital resource application.
[0127] In the above embodiment, the interactive information and the signed interactive information are transmitted in the form of QR code data, which solves the data transmission problem between offline devices and online devices, avoids the leakage of private keys during the signing process, and also facilitates user operations.
[0128] In the above embodiment, the interaction process of digital resources is separated. The online device provides functions such as digital resource query and interaction initiation, and the offline device provides functions such as private key storage and offline signature, which can well protect the security of the private key.
[0129] In one embodiment of the present application, Figure 7 As shown, a backup control is also displayed in the main interface, and the method may further include:
[0130] S510: In response to a backup instruction triggered by a backup control of the target object, back up at least one encrypted private key to generate third image information, where the third image information is a QR code image and represents at least one encrypted private key.
[0131] S520: Display the third image information on the offline device, so that other offline devices can obtain the encrypted at least one private key by scanning the third image information.
[0132] In the above embodiment, in the embodiment of the present application, the target object can also be allowed to transmit the encrypted private key to other offline devices in the data form of a QR code image. The other offline devices obtain the encrypted private key by scanning the QR code image and parsing it, thereby realizing fast and secure recovery of private keys between offline devices. In case the current offline device has a hardware failure or the risky private key is cleared, the target object can re-import the offline digital resource account on other offline devices or parse out at least one backup private key to avoid affecting the interaction.
[0133] In another embodiment of the present application, in response to a backup instruction triggered by a target object based on a backup control, the offline device or offline digital resource application may export the encrypted at least one private key in the form of an encrypted file.
[0134] Fig. 9 It shows the interaction process between online devices and offline devices. Fig. 9 As shown, the target object can first install and run the offline digital resource application on the offline device, and import the offline digital resource account and private key into the offline digital resource application, and then install and run the online digital resource application on the online device, and import the online digital resource account into the online digital resource application. The embodiment of the present application is only an example of the sequence, and the target object can also first perform the installation and import operations on the online device. Fig. 9 As shown, the target object needs to initiate an interaction corresponding to the digital resource on the online device, and the online device or online digital resource application generates and displays the first image information according to the interaction information. The target object uses the offline device to scan the first image information to parse the interaction information, and uses the private key corresponding to the digital resource to sign the interaction offline to obtain the signed interaction information. The offline device or offline digital resource application generates and displays the second image information according to the signed interaction information. The online device or online digital resource application parses the signed interaction information by scanning the second image information. The online device submits the signed interaction information to the blockchain network to realize the interaction of digital resources. In another embodiment of the present application, the interaction information and the signed interaction information can be encoded as other text data, and the target object can obtain the text data by manual input or image extraction, thereby transmitting the text data to another device. The above interaction process realizes a simple, easy-to-use and secure private key storage and use scheme. The offline device and the online device are independent of each other and cooperate with each other, which improves the security of private keys and digital resources.
[0135] The present application also provides a private key management device 1000. Fig.10 As shown, the device 1000 may include:
[0136] A first display module 1010 is used to display a wizard interface on the offline device, where the offline device is a device disconnected from the network;
[0137] The application installation and operation module 1020 is used to install and operate the offline digital resource application on the offline device in response to the program installation instruction triggered by the target object based on the wizard interface, and to display the initialization interface of the offline digital resource application;
[0138] A first initialization module 1030, configured to generate an offline digital resource account corresponding to the target object in the offline digital resource application in response to an offline account import instruction triggered by the target object based on the initialization interface;
[0139] A second initialization module 1040, configured to obtain at least one private key corresponding to the offline digital resource account in response to a private key import instruction triggered by the target object based on the initialization interface;
[0140] The private key storage module 1050 is used to encrypt the at least one private key and store the encrypted at least one private key in a storage space corresponding to the offline digital resource application in the offline device.
[0141] In one embodiment of the present application, the apparatus 1000 may further include:
[0142] A first detection unit, configured to detect the network connection status of the offline device in real time to obtain a first detection result;
[0143] The first processing unit is configured to close the offline digital resource application when the first detection result indicates that there is a network connection request or the application has been connected to the network.
[0144] In one embodiment of the present application, the apparatus 1000 may further include:
[0145] A second detection unit, used to perform real-time detection on the data transmission status of the offline device to obtain a second detection result;
[0146] The second processing unit is configured to close the offline digital resource application when the second detection result indicates that there is a data transmission request or the application is in a data transmission state.
[0147] In one embodiment of the present application, the first processing unit or the second processing unit may include:
[0148] A private key clearing subunit, used to clear the at least one encrypted private key recorded in the storage space;
[0149] The storage overlay subunit is used to generate random data and write the random data into the storage space.
[0150] In one embodiment of the present application, the apparatus 1000 may further include:
[0151] a private key list information generating unit, configured to generate private key list information based on the encrypted at least one private key, wherein the private key list information indicates identification information of the encrypted at least one private key;
[0152] The private key list information display unit is used to display the main interface on the offline device and display the private key list information in the main interface.
[0153] In one embodiment of the present application, a QR code scanning control is displayed in the main interface, and the device 1000 may further include:
[0154] A first scanning unit is used to obtain first image information displayed on an online device in response to a scanning instruction triggered by the target object based on the two-dimensional code scanning control; the first image information is a two-dimensional code image generated by an online digital resource application running on the online device in response to an interaction initiation instruction triggered by the target object; the online device is a device connected to a network; the online digital resource application is used to manage an online digital resource account corresponding to the target object; the online device does not store the at least one private key;
[0155] A first parsing unit, configured to parse the first image information to obtain interaction information;
[0156] A signing unit, configured to use the encrypted at least one private key to perform offline signing on the interactive information to obtain signed interactive information;
[0157] The first display unit is used to generate and display second image information according to the signed interactive information, where the second image information is a QR code image, so that the online device can obtain the signed interactive information by scanning the second image information.
[0158] In one embodiment of the present application, a backup control is displayed in the main interface, and the device 1000 may further include:
[0159] a backup unit, configured to perform backup processing on the encrypted at least one private key in response to a backup instruction triggered by the target object based on the backup control, and generate third image information, wherein the third image information is a two-dimensional code image, and the third image information represents the encrypted at least one private key;
[0160] The second display unit is used to display the third image information on the offline device, so that other offline devices can obtain the encrypted at least one private key by scanning the third image information.
[0161] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0162] The present application embodiment provides an application system of digital resources, such as Fig.11 As shown, the application system includes online devices and offline devices, wherein the online digital resource application run by the online device may include functional modules such as an account information module, an interaction initiation module, a QR code processing module, and an interaction submission module, and the offline digital resource application run by the offline device may include functional modules such as a private key management module, an offline signature module, a QR code processing module, and a connection detection module.
[0163] Among them, the specific functional descriptions of the functional modules in the offline digital resource application are as follows:
[0164] Private key management module: responsible for generating, storing, encrypting and deleting private keys to ensure their security;
[0165] Offline signature module: responsible for offline signature processing of the interactive information parsed by the offline device;
[0166] QR code processing module: responsible for generating and parsing QR code images, used to transmit interactive information and signed interactive information with online devices.
[0167] Connection detection module: Continuously detects whether there is a connection to the network, Bluetooth and mobile data. If there is a connection attempt, the offline digital resource application is immediately closed.
[0168] Among them, the specific functional descriptions of the functional modules in the online digital resource application are as follows:
[0169] Account information module: query the address and remaining amount of digital resources of the target object and other account information;
[0170] Interaction initiation module: used to create, verify and generate interaction information;
[0171] Interaction submission module: receives the signed interaction information obtained through parsing and submits the signed interaction information to the blockchain network;
[0172] QR code processing module: responsible for generating and parsing QR code images, used to transmit interactive information and signed interactive information with offline devices.
[0173] An embodiment of the present application provides a computer device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement a private key management method provided in the above method embodiment.
[0174] Fig.12 A schematic diagram of the hardware structure of a device for implementing a private key management method provided in an embodiment of the present application is shown, and the device may participate in or include the apparatus or system provided in an embodiment of the present application. Fig.12As shown, the device 10 may include one or more (1002a, 1002b, ..., 1002n are used to illustrate) processors 1002 (the processor 1002 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1004 for storing data, and a transmission device 1006 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Fig.12 The structure shown is for illustration only and does not limit the structure of the electronic device. Fig.12 More or fewer components as shown, or with Fig.12 Different configurations are shown.
[0175] It should be noted that the one or more processors 1002 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the device 10 (or mobile device). As involved in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0176] The memory 1004 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the methods described in the embodiments of the present application. The processor 1002 executes various functional applications and data processing by running the software programs and modules stored in the memory 1004, that is, to implement the above-mentioned private key management method. The memory 1004 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1004 may further include a memory remotely arranged relative to the processor 1002, and these remote memories may be connected to the device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0177] The transmission device 1006 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the device 10. In one example, the transmission device 1006 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 1006 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0178] The display may be, for example, a touch screen liquid crystal display (LCD) that may enable a user to interact with a user interface of device 10 (or mobile device).
[0179] An embodiment of the present application also provides a computer-readable storage medium, which can be set in a server to store at least one instruction or at least one program related to a private key management method in a method embodiment. The at least one instruction or the at least one program is loaded and executed by the processor to implement a private key management method provided by the above method embodiment.
[0180] Optionally, in this embodiment, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0181] The embodiment of the present invention further provides a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes a private key management method provided in the above various optional implementations.
[0182] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of the present application are described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0183] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0184] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0185] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A private key management method, characterized in that: Applied to an offline device, the method comprises: Displaying a wizard interface on the offline device, where the offline device is a device disconnected from the network; In response to a program installation instruction triggered by the target object based on the wizard interface, installing and running an offline digital resource application on the offline device, and displaying an initialization interface of the offline digital resource application; In response to an offline account import instruction triggered by the target object based on the initialization interface, generating an offline digital resource account corresponding to the target object in the offline digital resource application; In response to a private key import instruction triggered by the target object based on the initialization interface, obtaining at least one private key corresponding to the offline digital resource account; The at least one private key is encrypted, and the encrypted at least one private key is stored in a storage space corresponding to the offline digital resource application in the offline device.
2. The method according to claim 1, characterized in that The method further comprises: Performing real-time detection on the network connection status of the offline device to obtain a first detection result; When the first detection result indicates that there is a network connection request or the network has been connected, the offline digital resource application is closed.
3. The method according to claim 1, characterized in that The method further comprises: Performing real-time detection on the data transmission status of the offline device to obtain a second detection result; When the second detection result indicates that there is a data transmission request or the application is in a data transmission state, the offline digital resource application is closed.
4. The method according to any one of claims 2 or 3, characterized in that: The shutting down the offline digital resource application comprises: Clearing the at least one encrypted private key recorded in the storage space; Generate random data, and write the random data into the storage space.
5. The method according to claim 1, characterized in that The method further comprises: Based on the encrypted at least one private key, generate private key list information, wherein the private key list information indicates identification information of the encrypted at least one private key; A main interface is displayed on the offline device, and private key list information is displayed in the main interface.
6. The method according to claim 5, characterized in that A QR code scanning control is displayed in the main interface, and the method further includes: In response to a scanning instruction triggered by the target object based on the QR code scanning control, first image information displayed on an online device is obtained; the first image information is a QR code image generated by an online digital resource application running on the online device in response to an interaction initiation instruction triggered by the target object; the online device is a device connected to a network; the online digital resource application is used to manage an online digital resource account corresponding to the target object; the online device does not store the at least one private key; parsing the first image information to obtain interaction information; Using the encrypted at least one private key to sign the interactive information offline to obtain signed interactive information; According to the signed interactive information, second image information is generated and displayed, where the second image information is a QR code image, so that the online device can obtain the signed interactive information by scanning the second image information.
7. The method according to claim 5, characterized in that The main interface displays a backup control, and the method further includes: In response to a backup instruction triggered by the target object based on the backup control, backing up the encrypted at least one private key to generate third image information, where the third image information is a two-dimensional code image and represents the encrypted at least one private key; The third image information is displayed on the offline device, so that other offline devices can obtain the encrypted at least one private key by scanning the third image information.
8. A private key management device, characterized in that: Applied to an offline device, the device comprises: A first display module is used to display a wizard interface on the offline device, where the offline device is a device disconnected from the network; An application installation and operation module, for responding to a program installation instruction triggered by a target object based on the wizard interface, installing and running an offline digital resource application on the offline device, and displaying an initialization interface of the offline digital resource application; A first initialization module, configured to generate an offline digital resource account corresponding to the target object in the offline digital resource application in response to an offline account import instruction triggered by the target object based on the initialization interface; A second initialization module, configured to obtain at least one private key corresponding to the offline digital resource account in response to a private key import instruction triggered by the target object based on the initialization interface; The private key storage module is used to encrypt the at least one private key and store the encrypted at least one private key in a storage space corresponding to the offline digital resource application in the offline device.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement a private key management method as described in any one of claims 1 to 7.
10. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement a private key management method as described in any one of claims 1 to 7.