Disclosure of Invention
The invention mainly aims to provide a recovery method, a recovery device and a computer readable storage medium of a blockchain wallet, aiming at solving the problems of low property security of a user and poor usability of the blockchain wallet.
In order to achieve the above object, the present invention provides a recovery method for a blockchain wallet, including the steps of:
when a recovery request of a blockchain wallet is received, acquiring a password and a recovery graphic code of the blockchain wallet according to the recovery request;
identifying the recovery graphic code to obtain encrypted information;
decrypting the encrypted information by adopting a first encryption algorithm to obtain a plurality of recovery words, and encrypting the recovery words by adopting a second encryption algorithm to obtain public and private keys;
and generating the blockchain wallet according to the public and private keys and the password.
Preferably, before the step of obtaining the password of the blockchain wallet and the saved recovery information according to the recovery request, the method further includes:
when a request for creating a blockchain wallet is received, acquiring a password of the blockchain wallet input by a user, and generating a plurality of recovery words according to the password;
encrypting the recovery words by adopting a first encryption algorithm to obtain encrypted information, and generating a recovery graphic code according to the encrypted information;
encrypting a plurality of recovery words by adopting the second encryption algorithm to obtain the public and private keys;
and saving the recovery graphic code, and generating the blockchain wallet according to the public and private keys and the password.
Preferably, the step of obtaining the password and the recovery graphic code of the blockchain wallet according to the recovery request comprises:
outputting a wallet recovery interface according to the recovery request;
and when a completion operation triggered based on the wallet recovery interface is received, acquiring the password and the recovery graphic code according to the wallet recovery interface.
Preferably, after the step of outputting the wallet restoring interface according to the restoring request, the method further includes:
determining a recovery word acquisition mode of the wallet recovery interface when a completion operation triggered based on the wallet recovery interface is received;
when the recovery word obtaining mode is a graphic code obtaining mode, the step of obtaining the password and the recovery graphic code according to the wallet recovery interface is executed;
and when the recovery word obtaining mode is a word input mode, obtaining the password and the recovery words according to the wallet recovery interface, and performing the step of encrypting a plurality of recovery words by adopting a second encryption algorithm to obtain public and private keys.
Preferably, after the step of generating the block chain wallet according to the public and private keys and the password, the method further includes:
and feeding back the blockchain wallet to the terminal sending the recovery request.
Preferably, the first encryption algorithm is an advanced encryption standard algorithm, and the second encryption algorithm is an elliptic curve encryption algorithm.
Preferably, the recovery graphic code is a two-dimensional code or a bar code.
In order to achieve the above object, the present invention also provides a recovery apparatus for a blockchain wallet, the recovery apparatus comprising:
the acquisition module is used for acquiring the password and the recovery graphic code of the blockchain wallet according to the recovery request when receiving the recovery request of the blockchain wallet;
the identification module is used for identifying the recovery graphic code to obtain encrypted information;
the encryption and decryption module is used for decrypting the encrypted information by adopting a first encryption algorithm to obtain a plurality of recovery words, and encrypting the recovery words by adopting a second encryption algorithm to obtain public and private keys;
and the generating module is used for generating the block chain wallet according to the public and private keys and the password.
To achieve the above object, the present invention also provides a recovery apparatus for a blockchain wallet, including a processor, a memory, and a recovery program for a blockchain wallet stored on the memory and executable on the processor, wherein the recovery program for a blockchain wallet, when executed by the processor, implements the steps of the recovery method for a blockchain wallet as described above.
To achieve the above object, the present invention also provides a computer-readable storage medium storing a recovery program for a blockchain wallet, which when executed by a processor, implements the steps of the recovery method for a blockchain wallet as described above.
According to the recovery method of the blockchain wallet, the device and the computer readable storage medium thereof, when a recovery request of the blockchain wallet is received, a recovery device of the blockchain wallet acquires the password of the blockchain wallet and the recovery graphic code according to the recovery request, so that the graphic code is recovered and the password regenerates the blockchain wallet; the block chain wallet can be regenerated by the recovery device according to the recovery graphic code without inputting recovery words by a user, so that the situation that the user forgets to recover the words due to overlong and disorder recovery words of the user is avoided, the block chain wallet can be effectively recovered, the property safety of the user is ensured, and the usability of the block chain wallet is improved.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main solution of the embodiment of the invention is as follows: when a recovery request of a blockchain wallet is received, acquiring a password and a recovery graphic code of the blockchain wallet according to the recovery request; identifying the recovery graphic code to obtain encrypted information; decrypting the encrypted information by adopting a first encryption algorithm to obtain a plurality of recovery words, and encrypting the recovery words by adopting a second encryption algorithm to obtain public and private keys; and generating the blockchain wallet according to the public and private keys and the password.
The block chain wallet recovery device can regenerate the block chain wallet according to the recovery graphic code without inputting recovery words by a user, so that the situation that the user forgets to recover the words due to overlong and disorder recovery words of the user is avoided, the block chain wallet can be effectively recovered, the property safety of the user is ensured, and the usability of the block chain wallet is improved.
As an implementation, the recovery apparatus of a blockchain wallet may be as shown in fig. 1.
The embodiment of the invention relates to a recovery device of a blockchain wallet, which comprises: a processor 101, e.g. a CPU, a memory 102, a communication bus 103. Wherein a communication bus 103 is used for enabling the connection communication between these components.
The memory 102 may be a high-speed RAM memory or a non-volatile memory (e.g., a disk memory). As shown in fig. 1, a memory 103, which is a type of computer storage medium, may include a recovery procedure for a blockchain wallet; and the processor 101 may be configured to invoke a recovery procedure for the blockchain wallet stored in the memory 102 and perform the following operations:
when a recovery request of a blockchain wallet is received, acquiring a password and a recovery graphic code of the blockchain wallet according to the recovery request;
identifying the recovery graphic code to obtain encrypted information;
decrypting the encrypted information by adopting a first encryption algorithm to obtain a plurality of recovery words, and encrypting the recovery words by adopting a second encryption algorithm to obtain public and private keys;
and generating the blockchain wallet according to the public and private keys and the password.
Further, the processor 101 may be configured to invoke a recovery procedure for the blockchain wallet stored in the memory 102 and perform the following operations:
when a request for creating a blockchain wallet is received, acquiring a password of the blockchain wallet input by a user, and generating a plurality of recovery words according to the password;
encrypting the recovery words by adopting a first encryption algorithm to obtain encrypted information, and generating a recovery graphic code according to the encrypted information;
encrypting a plurality of recovery words by adopting the second encryption algorithm to obtain the public and private keys;
and saving the recovery graphic code, and generating the blockchain wallet according to the public and private keys and the password.
Further, the processor 101 may be configured to invoke a recovery procedure for the blockchain wallet stored in the memory 102 and perform the following operations:
outputting a wallet recovery interface according to the recovery request;
and when a completion operation triggered based on the wallet recovery interface is received, acquiring the password and the recovery graphic code according to the wallet recovery interface.
Further, the processor 101 may be configured to invoke a recovery procedure for the blockchain wallet stored in the memory 102 and perform the following operations:
determining a recovery word acquisition mode of the wallet recovery interface when a completion operation triggered based on the wallet recovery interface is received;
when the recovery word obtaining mode is a graphic code obtaining mode, the step of obtaining the password and the recovery graphic code according to the wallet recovery interface is executed;
and when the recovery word obtaining mode is a word input mode, obtaining the password and the recovery words according to the wallet recovery interface, and performing the step of encrypting a plurality of recovery words by adopting a second encryption algorithm to obtain public and private keys.
Further, the processor 101 may be configured to invoke a recovery procedure for the blockchain wallet stored in the memory 102 and perform the following operations:
and feeding back the blockchain wallet to the terminal sending the recovery request.
Further, the processor 101 may be configured to invoke a recovery procedure for the blockchain wallet stored in the memory 102 and perform the following operations:
the first encryption algorithm is an advanced encryption standard algorithm, and the second encryption algorithm is an elliptic curve encryption algorithm.
Further, the processor 101 may be configured to invoke a recovery procedure for the blockchain wallet stored in the memory 102 and perform the following operations:
the recovery graphic code is a two-dimensional code or a bar code.
According to the scheme, the recovery device of the blockchain wallet acquires the password and the recovery graphic code of the blockchain wallet according to the recovery request when receiving the recovery request of the blockchain wallet, so that the recovery graphic code and the password regenerate the blockchain wallet; the block chain wallet can be regenerated by the recovery device according to the recovery graphic code without inputting recovery words by a user, so that the situation that the user forgets to recover the words due to overlong and disorder recovery words of the user is avoided, the block chain wallet can be effectively recovered, the property safety of the user is ensured, and the usability of the block chain wallet is improved.
Based on the hardware architecture of the household appliance and the control terminal, the embodiment of the recovery method of the blockchain wallet is provided.
Referring to fig. 2, fig. 2 is a first embodiment of a recovery method of a blockchain wallet of the present invention, the recovery method of a blockchain wallet including the steps of:
step S10, when receiving a recovery request of the blockchain wallet, acquiring a password and a recovery graphic code of the blockchain wallet according to the recovery request;
in the present invention, the execution subject is the recovery device of the blockchain wallet, and the recovery device of the blockchain wallet can be regarded as a background server.
The user may delete the blockchain wallet due to a malfunction or lose the blockchain wallet by replacing the terminal. Based on the method, the user can log in a page of the block chain wallet on the terminal and send a recovery request to a recovery device of the block chain wallet based on the page; after the recovery device of the blockchain wallet receives the recovery request, a wallet recovery interface is output to the terminal, so that the terminal displays the wallet recovery interface, a user can input a password of the blockchain wallet on the wallet recovery interface and upload a recovery graphic code, the recovery graphic code is generated when the blockchain wallet is generated, and the user can store the recovery graphic code; after the user inputs the password and uploads the recovery graphic code to the wallet recovery interface, the user can click a determination button on the wallet recovery interface, so that the information of the wallet recovery interface is triggered to complete the operation, and the recovery device of the blockchain wallet acquires the password and the recovery graphic code according to the wallet recovery interface.
The recovery graphic Code may be a two-dimensional Code (QR Code) or a barcode. And the password of the blockchain wallet is more than 8 digits.
Step S20, identifying the recovery graphic code to obtain encrypted information;
step S30, decrypting the encrypted information by adopting a first encryption algorithm to obtain a plurality of recovery words, and encrypting the recovery words by adopting a second encryption algorithm to obtain public and private keys;
step S40, generating the blockchain wallet according to the public and private keys and the password;
after obtaining the recovery graphic code, the recovery device of the block chain wallet recognizes the recovery graphic code by using a corresponding graphic code technology to obtain encrypted information (the recovery graphic code is a two-dimensional code, and the graphic code technology is a two-dimensional code technology), and the encrypted information is a plurality of encrypted recovery words.
The recovery device of the block chain wallet is stored with a first encryption algorithm and a second encryption algorithm, the first encryption algorithm can be an advanced standard encryption algorithm, namely an AES symmetric encryption algorithm, and the second encryption algorithm can be an elliptic curve encryption algorithm, namely an ECC encryption algorithm. After the recovery device of the blockchain wallet acquires the password and the encrypted information, decrypting the encrypted information by adopting an AES (advanced encryption standard) symmetric encryption algorithm to obtain a plurality of recovery words, wherein the number of the recovery words is not limited, preferably 12, and the recovery words are recovery words adopted when the blockchain wallet is generated; the block chain wallet encrypts a plurality of recovery words by adopting an ECC elliptic curve encryption algorithm to obtain public and private keys; and finally, the recovery device of the blockchain wallet generates the blockchain wallet again according to the public and private keys and the password, so that the blockchain wallet is recovered. The blockchain wallet is bound with the terminal of the user, and after the blockchain wallet is generated by the recovery device of the blockchain wallet, the blockchain wallet is fed back to the terminal sending the recovery request.
It should be noted that a switching button for recovering a word obtaining mode may be disposed on the wallet recovery interface, where the obtaining mode includes a graphic code obtaining mode and a word input mode, the graphic code obtaining mode refers to uploading of a recovery graphic code by a user, and the word input mode refers to inputting of a recovery word by the user. If the recovery word obtaining mode of the wallet recovery interface is a graphic code obtaining mode, the recovery graphic code needs to be identified to obtain encrypted information, and therefore the encrypted information is decrypted by adopting a first encryption algorithm to obtain a recovery word; and if the recovery word acquisition mode is a word input mode, directly acquiring the recovery word input by the user.
In the technical solution provided in this embodiment, when receiving a recovery request from a blockchain wallet, a recovery device of the blockchain wallet obtains a password and a recovery pattern code of the blockchain wallet according to the recovery request, so as to recover the pattern code and regenerate the blockchain wallet by using the password; the block chain wallet can be regenerated by the recovery device according to the recovery graphic code without inputting recovery words by a user, so that the situation that the user forgets to recover the words due to overlong and disorder recovery words of the user is avoided, the block chain wallet can be effectively recovered, the property safety of the user is ensured, and the usability of the block chain wallet is improved.
Referring to fig. 3, fig. 3 is a block chain wallet recovering method according to a second embodiment of the present invention, and based on the first embodiment, before the step S10, the method further includes:
step S50, when a request for creating a blockchain wallet is received, acquiring a password of the blockchain wallet input by a user, and generating a plurality of recovery words according to the password;
step S60, a first encryption algorithm is adopted to encrypt a plurality of recovery words to obtain encrypted information, and recovery graphic codes are generated according to the encrypted information;
step S70, encrypting a plurality of the recovered words by using the second encryption algorithm to obtain the public and private keys;
step S80, saving the recovery graphic code, and generating the blockchain wallet according to the public and private keys and the password;
the recovery means of the blockchain wallet may also generate a blockchain wallet according to a wallet creation request of the user.
Specifically, the user can log in an official website of the blockchain wallet at the terminal, and send a creation request of the blockchain wallet to a recovery device of the blockchain wallet based on the official website;
after receiving the recovery request, the recovery device of the blockchain wallet feeds back a password input interface of the blockchain wallet to the terminal so that a user can input a created password of the blockchain wallet on the password input interface;
after obtaining the password of the blockchain wallet input by the user, the recovery device of the blockchain wallet randomly generates a plurality of recovery words, namely English words, according to the password;
the recovery device of the block chain wallet encrypts a plurality of recovery words by respectively adopting an AES (advanced encryption Standard) symmetric encryption algorithm and an ECC (error correction code) elliptic curve encryption algorithm, so as to respectively obtain encrypted recovery words (obtained by encrypting the recovery words by the AES symmetric encryption algorithm) and public and private keys;
the recovery device of the block chain wallet adopts a graphic code technology to package encrypted recovery words to obtain recovery graphic codes, wherein the graphic code technology can be a two-dimensional code technology or a bar code technology;
and the recovery device of the block chain wallet generates the block chain wallet according to the generated public and private keys and the password, and simultaneously prompts a user to store a recovery graphic code for subsequent recovery operation of the block chain wallet.
In the technical scheme provided by this embodiment, when receiving a request for creating a blockchain wallet, a recovery device of a blockchain wallet acquires a password of the blockchain wallet input by a user to generate a recovery word according to the password, encrypts the recovery word respectively by using a first encryption algorithm and a second encryption algorithm to obtain an encrypted recovery word and a public private key, generates the blockchain wallet according to the public private key and the password, and obtains and stores a recovery graphic code according to the encrypted recovery word for the user to recover the blockchain wallet according to the recovery graphic code; providing conditions for the recovery of subsequent blockchain wallets.
The invention also provides a recovery device of the blockchain wallet.
Referring to fig. 4, fig. 4 is a schematic diagram of a first functional module of the recovery apparatus for a blockchain wallet of the present invention, which includes an obtaining module 10, an identifying module 20, an encrypting/decrypting module 30, and a generating module 40, wherein,
the acquiring module 10 is configured to, when receiving a recovery request of a blockchain wallet, acquire a password and a recovery graphic code of the blockchain wallet according to the recovery request;
in the present invention, the execution subject is the recovery device of the blockchain wallet, and the recovery device of the blockchain wallet can be regarded as a background server.
The user may delete the blockchain wallet due to a malfunction or lose the blockchain wallet by replacing the terminal. Based on the method, the user can log in a page of the block chain wallet on the terminal and send a recovery request to a recovery device of the block chain wallet based on the page; after the recovery device of the blockchain wallet receives the recovery request, a wallet recovery interface is output to the terminal, so that the terminal displays the wallet recovery interface, a user can input a password of the blockchain wallet on the wallet recovery interface and upload a recovery graphic code, the recovery graphic code is generated when the blockchain wallet is generated, and the user can store the recovery graphic code; after the user inputs the password and uploads the recovery graphic code to the wallet recovery interface, the user can click a determination button on the wallet recovery interface, so that the information of the wallet recovery interface is triggered to complete the operation, and the recovery device of the blockchain wallet acquires the password and the recovery graphic code according to the wallet recovery interface.
The recovery graphic code may be a two-dimensional code or a bar code. And the password of the blockchain wallet is more than 8 digits.
The identification module 10 is configured to identify the recovered graphic code to obtain encrypted information;
the encryption and decryption module 30 is configured to decrypt the encrypted information by using a first encryption algorithm to obtain a plurality of recovery words, and encrypt the plurality of recovery words by using a second encryption algorithm to obtain a public key and a private key;
the generating module 40 is configured to generate the blockchain wallet according to the public and private keys and the password.
After the recovery device of the block chain wallet obtains the recovery graphic code, the recognition module 20 recognizes the recovery graphic code by using a corresponding graphic code technology to obtain encrypted information (the recovery graphic code is a two-dimensional code, and the graphic code technology is a two-dimensional code technology), where the encrypted information is a plurality of encrypted recovery words.
The recovery device of the block chain wallet is stored with a first encryption algorithm and a second encryption algorithm, the first encryption algorithm can be an advanced standard encryption algorithm, namely an AES symmetric encryption algorithm, and the second encryption algorithm can be an elliptic curve encryption algorithm, namely an ECC encryption algorithm. After the recovery device of the blockchain wallet acquires the password and the encrypted information, decrypting the encrypted information by adopting an AES (advanced encryption standard) symmetric encryption algorithm to obtain a plurality of recovery words, wherein the number of the recovery words is not limited, preferably 12, and the recovery words are recovery words adopted when the blockchain wallet is generated; the block chain wallet encrypts a plurality of recovery words by adopting an ECC elliptic curve encryption algorithm to obtain public and private keys; and finally, the recovery device of the blockchain wallet generates the blockchain wallet again according to the public and private keys and the password, so that the blockchain wallet is recovered. The blockchain wallet is bound with the terminal of the user, and after the blockchain wallet is generated by the recovery device of the blockchain wallet, the blockchain wallet is fed back to the terminal sending the recovery request.
It should be noted that a switching button for recovering a word obtaining mode may be disposed on the wallet recovery interface, where the obtaining mode includes a graphic code obtaining mode and a word input mode, the graphic code obtaining mode refers to uploading of a recovery graphic code by a user, and the word input mode refers to inputting of a recovery word by the user. If the recovery word obtaining mode of the wallet recovery interface is a graphic code obtaining mode, the recovery graphic code needs to be identified to obtain encrypted information, and therefore the encrypted information is decrypted by adopting a first encryption algorithm to obtain a recovery word; and if the recovery word acquisition mode is a word input mode, directly acquiring the recovery word input by the user.
In the technical solution provided in this embodiment, when receiving a recovery request from a blockchain wallet, a recovery device of the blockchain wallet obtains a password and a recovery pattern code of the blockchain wallet according to the recovery request, so as to recover the pattern code and regenerate the blockchain wallet by using the password; the block chain wallet can be regenerated by the recovery device according to the recovery graphic code without inputting recovery words by a user, so that the situation that the user forgets to recover the words due to overlong and disorderly recovery words of the user is avoided, the block chain wallet can be effectively recovered, and the property safety of the user is ensured.
Referring to fig. 5, fig. 5 is a second embodiment of the device for recovering a blockchain wallet according to the present invention, which further includes a saving module 50 according to the first embodiment;
the obtaining module 10 is further configured to, when a request for creating a blockchain wallet is received, obtain a password of the blockchain wallet input by a user, and generate a plurality of recovery words according to the password;
the encryption and decryption module 30 encrypts the plurality of recovery words by adopting a first encryption algorithm to obtain encrypted information, and generates a recovery graphic code according to the encrypted information;
the encryption and decryption module 30 is further configured to encrypt the recovery words by using the second encryption algorithm to obtain the public and private keys;
the saving module 50 is configured to save the recovery graphic code, and generate the blockchain wallet according to the public and private keys and the password;
the recovery means of the blockchain wallet may also generate a blockchain wallet according to a wallet creation request of the user.
Specifically, the user can log in an official website of the blockchain wallet at the terminal, and send a creation request of the blockchain wallet to a recovery device of the blockchain wallet based on the official website;
after receiving the recovery request, the recovery device of the blockchain wallet feeds back a password input interface of the blockchain wallet to the terminal so that a user can input a created password of the blockchain wallet on the password input interface;
the obtaining module 10 randomly generates a plurality of recovery words, namely english words, according to the password after obtaining the password of the blockchain wallet input by the user;
the encryption and decryption module 30 encrypts the plurality of recovery words respectively by using an AES symmetric encryption algorithm and an ECC elliptic curve encryption algorithm, so as to respectively obtain encrypted recovery words (obtained by encrypting the recovery words by the AES symmetric encryption algorithm) and public and private keys;
the recovery device of the block chain wallet adopts a graphic code technology to package encrypted recovery words to obtain recovery graphic codes, wherein the graphic code technology can be a two-dimensional code technology or a bar code technology;
the generating module 40 generates a blockchain wallet according to the generated public and private keys and the password, and the saving module 50 saves the recovery graphic code and outputs the saved path for the user to extract and save the recovery graphic code.
In the technical scheme provided by this embodiment, when receiving a request for creating a blockchain wallet, a recovery device of a blockchain wallet acquires a password of the blockchain wallet input by a user to generate a recovery word according to the password, encrypts the recovery word respectively by using a first encryption algorithm and a second encryption algorithm to obtain an encrypted recovery word and a public private key, generates the blockchain wallet according to the public private key and the password, and obtains and stores a recovery graphic code according to the encrypted recovery word for the user to recover the blockchain wallet according to the recovery graphic code; providing conditions for the recovery of subsequent blockchain wallets.
The present invention also provides a recovery apparatus for a blockchain wallet, including a processor, a memory, and a recovery program for a blockchain wallet stored on the memory and executable on the processor, wherein the recovery program for a blockchain wallet, when executed by the processor, implements the steps of the recovery method for a blockchain wallet as described in the above embodiments.
To achieve the above object, the present invention also provides a computer-readable storage medium storing a recovery program for a blockchain wallet, which when executed by a processor, implements the steps of the recovery method for a blockchain wallet as described in the above embodiments.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.