CN112184223B - Block chain account protection method and device, electronic equipment and storage medium - Google Patents

Block chain account protection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112184223B
CN112184223B CN202011047727.7A CN202011047727A CN112184223B CN 112184223 B CN112184223 B CN 112184223B CN 202011047727 A CN202011047727 A CN 202011047727A CN 112184223 B CN112184223 B CN 112184223B
Authority
CN
China
Prior art keywords
algorithm
abstract
bytes
protection
blockchain account
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011047727.7A
Other languages
Chinese (zh)
Other versions
CN112184223A (en
Inventor
钱京
蔡光辉
陆道如
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Hengbao Intelligent System Technology Co Ltd
Original Assignee
Jiangsu Hengbao Intelligent System Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Hengbao Intelligent System Technology Co Ltd filed Critical Jiangsu Hengbao Intelligent System Technology Co Ltd
Priority to CN202011047727.7A priority Critical patent/CN112184223B/en
Publication of CN112184223A publication Critical patent/CN112184223A/en
Application granted granted Critical
Publication of CN112184223B publication Critical patent/CN112184223B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a blockchain account protection method, a blockchain account protection device, electronic equipment and a storage medium. The method is used for protecting the blockchain account, and comprises the following steps: when a mnemonic input by a user is received, prompt information of whether account protection is used or not is sent to the user; receiving a protection password input by the user, and calculating a summary according to the protection password; and carrying out hidden protection on the blockchain account corresponding to the mnemonic according to the abstract obtained by calculation. In the embodiment of the application, the blockchain account corresponding to the mnemonic is hidden and protected through the abstract calculated by the protection password input by the user, so that the blockchain account protected by the method cannot be obtained on the premise that the protection password set by the user is not known even if the mnemonic is mastered by other people, and the security of the account is greatly improved.

Description

Block chain account protection method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the technical field of blockchains, and in particular, to a blockchain account protection method, device, electronic apparatus, and storage medium.
Background
The blockchain wallet is not a conventional wallet and does not directly store cryptocurrency, which is stored on the blockchain network, but rather the blockchain wallet stores a private key, which is a credential of ownership of the cryptocurrency by the user, which is anonymous and not volatile. The blockchain wallet is used to manage the user's private key and to manage the user's cryptocurrency on the blockchain through private key signature transactions.
The existing blockchain wallet mostly adopts mnemonics to generate, adopts a layering deterministic wallet mode to generate a plurality of accounts, and adopts BIP32, BIP44 and BIP39 protocols when most accounts are generated, so that the design can better protect user privacy, avoid potential safety hazards and achieve the characteristic of anonymity. The blockchain wallet generated by the scheme brings convenience and potential safety hazard, and once the mnemonics are mastered by other people, the assets of the user are not protected at all.
Disclosure of Invention
The application provides a blockchain account protection method, a blockchain account protection device, electronic equipment and a storage medium, which are used for solving the problem that the blockchain account loses all protection after the existing mnemonics are mastered by others.
In a first aspect, an embodiment of the present application provides a blockchain account protection method, the method including: receiving a mnemonic word and a protection password input by a user, and calculating a summary according to the protection password; and carrying out hidden protection on the blockchain account corresponding to the mnemonic according to the abstract obtained by calculation.
In the embodiment of the application, the device receives the protection password input by the user, calculates the abstract according to the protection password by using a high confidentiality algorithm, and performs hidden protection on the blockchain account according to the abstract obtained by calculating the protection password of the user, so that when the mnemonic word of the user is mastered by other people, the blockchain account is still under the protection of the protection password, the blockchain account is still safe, and the potential safety hazard of the blockchain account is greatly reduced.
With reference to the foregoing technical solution provided in the first aspect, in some possible implementation manners, calculating a digest according to the protection secret code includes confusing the protection secret code with a preset secret key; and calculating the abstract according to the key obtained after confusion.
In the embodiment of the application, by presetting one or more keys, the protection password is confused with the preset keys before calculating the abstract, and the security of the abstract can be further improved by calculating the abstract through the confused data.
With reference to the foregoing technical solution provided in the first aspect, in some possible implementation manners, performing, according to the calculated summary, hidden protection on the blockchain account corresponding to the mnemonic, includes: selecting N bytes from the calculated abstract, determining the number of extended layers according to the selected N bytes, wherein N is a positive integer; and determining an algorithm coefficient of each extended layer according to the abstract, and extending the hierarchical structure of the blockchain account corresponding to the mnemonic according to the determined algorithm coefficient of each layer and the layer number, wherein the extended layer number is consistent with the extended layer number determined by the N bytes.
In the embodiment of the application, the number of extended layers is determined according to the N bytes selected from the abstract (for example, decimal numbers corresponding to the N bytes are used as the number of extended layers), and the abstract obtained by calculation is different because the protection passwords of different users are different, so that the number of extended layers of blockchain accounts of different users is not necessarily the same, and the security of the accounts is further improved.
In the embodiment of the application, the number of extended layers is determined by the first two bytes selected from the abstract, so that the required number of layers can be rapidly determined, and the efficiency is improved.
With reference to the technical solution provided in the first aspect, in some possible implementation manners, according to the summary obtained by calculation, performing hidden protection on the blockchain account corresponding to the mnemonic, including determining parameters of a preset layering algorithm according to the summary; and layering indexes of the last layer in the hierarchical structure of the blockchain account corresponding to the mnemonic according to the preset layering algorithm with the determined parameters.
In the embodiment of the present application, the parameters of the preset layering algorithm are determined according to the abstract, and then the index of the last layer in the layering structure of the blockchain account corresponding to the mnemonic is layered according to the preset layering algorithm with the parameters determined (for example, the index of the last layer in the layering structure of the first account of the layering is determined by the layering algorithm with x=0, the index of the last layer in the layering structure of the second account of the layering is determined by the layering algorithm with x=1, and so on), because the index of the last layer of the layering structure is determined by the layering algorithm and is often changed in a jumping manner, the correct account cannot be obtained without knowing the preset layering algorithm, and the security of the blockchain account is further improved.
With reference to the technical solution provided in the first aspect, in some possible implementation manners, performing hidden protection on the blockchain account corresponding to the mnemonic according to the calculated abstract includes selecting M bytes from the calculated abstract, and selecting a target hierarchical algorithm corresponding to the M bytes from a preset hierarchical algorithm library, where M is a positive integer; determining parameters of the target layering algorithm according to the abstract; and layering indexes of the last layer in the hierarchical structure of the blockchain account corresponding to the mnemonic according to the target layering algorithm with the parameters determined.
In the embodiment of the application, the applied target layering algorithm is determined according to M bytes selected from the abstracts, and the abstracts obtained by calculation are different because the protection passwords of different users are different, so that the target layering algorithms applied by the blockchain accounts of different users are not necessarily the same, and the security of the accounts is further improved.
With reference to the technical solution provided in the first aspect, in some possible implementation manners, performing hidden protection on the blockchain account corresponding to the mnemonic according to the calculated abstract includes selecting N bytes from the calculated abstract, and determining an extended layer number according to the N bytes, where N is a positive integer; determining an algorithm coefficient of each extended layer according to the abstract, and extending a hierarchical structure of a blockchain account corresponding to the mnemonic according to the determined algorithm coefficient of each layer and the layer number, wherein the extended layer number is consistent with the layer number determined to be extended by the N bytes; selecting M bytes from the calculated abstract, and selecting a target hierarchical algorithm corresponding to the M bytes from a preset hierarchical algorithm library; and determining parameters of the target layering algorithm according to the abstract, and layering indexes of the last layer in the hierarchical structure of the blockchain account corresponding to the mnemonic after extension according to the target layering algorithm with the parameters determined.
In the embodiment of the application, the hidden protection of the blockchain account comprises extending the blockchain account level and layering the last layer of the extended blockchain account level structure, and the two protection modes are overlapped and used, so that the security of the account is enhanced to the greatest extent.
With reference to the foregoing technical solution provided in the first aspect, in some possible implementation manners, determining, according to the digest, an extended algorithm coefficient of each layer includes encrypting the digest or performing hash computation on the digest; and determining the extended algorithm coefficient of each layer according to the encrypted abstract or the data obtained after hash calculation.
In the embodiment of the application, when determining the algorithm coefficient of each extended layer according to the abstract, the abstract may be encrypted first, or hash calculation is performed on the abstract, and then the algorithm coefficient of each extended layer is determined according to the encrypted abstract or the data obtained after hash calculation, so as to increase the difficulty of acquiring the determined algorithm coefficient, thereby improving the security of the account.
In a second aspect, an embodiment of the present application provides a blockchain account protection device, including: the system comprises a receiving module, a calculating module and a protecting module, wherein the receiving module is used for receiving mnemonics and protecting passwords input by a user; the computing module is used for computing a summary according to the received protection password input by the user; and the protection module is used for carrying out hidden protection on the blockchain account corresponding to the mnemonic according to the abstract obtained by calculation.
With reference to the foregoing technical solution provided in the second aspect, in some possible implementation manners, the protection module is further configured to: selecting N bytes from the calculated abstract, and determining the number of extended layers according to the selected N bytes, wherein N is a positive integer; and determining an algorithm coefficient of each extended layer according to the abstract, and extending the hierarchical structure of the blockchain account corresponding to the mnemonic according to the determined algorithm coefficient and the layer number of each layer, wherein the extended layer number is consistent with the extended layer number determined by N bytes. Wherein, optionally, in determining the number of extended layers, the protection module is further configured to: and selecting the first two bytes from the calculated abstract, and determining the number of extended layers according to the first two bytes. Optionally, in determining the algorithm coefficients of each layer of the extension, the protection module is further configured to: encrypting the abstract, or performing hash calculation on the abstract; and determining the algorithm coefficient of each extended layer according to the encrypted abstract or the data obtained after hash calculation.
With reference to the foregoing technical solution provided in the second aspect, in some possible implementation manners, the protection module is further configured to: determining parameters of a preset layering algorithm according to the abstract; and layering indexes of the last layer in the hierarchical structure of the blockchain account corresponding to the mnemonic according to a preset layering algorithm of the determined parameters.
With reference to the foregoing technical solution provided in the second aspect, in some possible implementation manners, the protection module is further configured to: selecting M bytes from the calculated abstract, and selecting a target hierarchical algorithm corresponding to the M bytes from a preset hierarchical algorithm library, wherein M is a positive integer; determining parameters of a target layering algorithm according to the abstract; and layering the index of the last layer in the hierarchical structure of the blockchain account corresponding to the mnemonic according to a target layering algorithm with the determined parameters.
With reference to the foregoing technical solution provided in the second aspect, in some possible implementation manners, the protection module is further configured to: selecting N bytes from the calculated abstract, and determining the number of extended layers according to the selected N bytes, wherein N is a positive integer; determining an algorithm coefficient of each extending layer according to the abstract, and extending a hierarchical structure of a blockchain account corresponding to the mnemonic according to the determined algorithm coefficient and the number of layers of each layer, wherein the number of extended layers is consistent with the number of extended layers determined by N bytes; selecting M bytes from the calculated abstract, and selecting a target hierarchical algorithm corresponding to the M bytes from a preset hierarchical algorithm library; and determining parameters of a target layering algorithm according to the abstract, and layering indexes of the last layer in the hierarchical structure of the blockchain account corresponding to the extended mnemonic according to the target layering algorithm with the determined parameters. The protection module is also used for: encrypting the abstract, or performing hash calculation on the abstract; and determining the algorithm coefficient of each extended layer according to the encrypted abstract or the data obtained after hash calculation.
In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, where the memory is connected to the processor; the memory is used for storing programs; the processor is configured to invoke the program stored in the memory to perform the method as the above-described first aspect embodiment and/or any possible implementation manner in combination with the first aspect embodiment.
In a fourth aspect, the present application provides a storage medium having stored thereon a computer program which, when executed, performs a method as the above-described first aspect embodiment and/or any one of the possible implementations in combination with the first aspect embodiment.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered limiting the scope, and that other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a blockchain account protection method according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of a blockchain account protection method according to yet another embodiment of the present application;
FIG. 3 is a flow chart of a blockchain account protection method according to yet another embodiment of the present application;
FIG. 4 is a flow chart of a blockchain account protection method according to yet another embodiment of the present application;
FIG. 5 is a block diagram illustrating a block chain account protecting device according to one embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Also, relational terms such as "first," "second," and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Furthermore, the term "and/or" in this application is merely an association relation describing an association object, and indicates that three relations may exist, for example, a and/or B may indicate: a exists alone, A and B exist together, and B exists alone.
Referring to fig. 1, a block chain account protection method according to an embodiment of the present application is described below with reference to fig. 1.
Step S101: and receiving the mnemonic and the protection password input by the user, and calculating the abstract according to the protection password.
After receiving the protection password input by the user, the device can calculate the abstract according to the protection password input by the user, wherein the algorithm used for calculating the abstract according to the protection password input by the user can be an abstract algorithm with high protection, for example, an SHA256 algorithm.
After receiving the mnemonic input by the user, in an optional implementation manner, a prompt message about whether to use account protection may also be sent to the user. In still another embodiment, the prompt message includes a password input box, and if the user selects to use account protection, a protection password point submission can be directly input in the password input box. Of course, the prompt information does not need to contain a password input box, and after the user selects to use account protection, the device sends the password input box to the user, and the user inputs protection password point in the password input box for submission.
After receiving the protection password input by the user, in an optional implementation manner, whether the security of the protection password input by the user is strong enough or not can be judged, a security threshold of the protection password is preset, and when the security of the protection password input by the user does not reach the threshold, the user is prompted to modify the password until the requirement is met. For example, the protection password security threshold may be at least three of numbers, capital letters, lowercase letters and special symbols, and the length of the password is greater than 10, and when the protection password input by the user only uses one or two of numbers, capital letters, lowercase letters and special symbols, it is judged that the protection password does not reach the preset protection password security threshold, and the user is prompted to modify the password.
In an alternative embodiment, the digest may be directly calculated based on the protection password input by the user, in another embodiment, the protection password input by the user is mixed with a preset key, and then the digest is calculated according to the key obtained after mixing, so that even if an attacker obtains the protection password input by the user, based on the same digest algorithm, the calculated digest is wrong without knowing the key of the previous device, and the complexity of obtaining the correct digest is further improved.
Step S102: and carrying out hidden protection on the blockchain account corresponding to the mnemonic according to the abstract obtained by calculation.
After the abstract is obtained by calculation, the blockchain account corresponding to the mnemonic is hidden and protected according to the abstract obtained by calculation, so that the account is hidden, even if the mnemonic is mastered by other people, the blockchain account cannot be obtained on the premise that the protection password set by the user is not known, and the safety of the account is greatly improved.
When the summary data obtained by calculation is used completely, in one implementation mode, the summary data can be reused to carry out hidden protection on the blockchain account, in another implementation mode, when the summary data obtained by calculation is used completely, a second summary is calculated according to the summary, and hidden protection on the blockchain account is continuously carried out according to the second summary.
In one embodiment, according to the summary obtained by calculation, the process of hiding and protecting the blockchain account corresponding to the mnemonic word may be: n bytes are selected from the abstract obtained through calculation, the number of extended layers is determined according to the selected N bytes, the algorithm coefficient of each layer which needs to be extended is determined according to the abstract, and then the hierarchical structure of the blockchain account corresponding to the mnemonic is extended according to the determined algorithm coefficient of each layer and the required number of extended layers, so that the number of extended layers is consistent with the number of extended layers determined by the N bytes. For example, N bytes are selected from the abstract, the range corresponding to the N bytes is an extension a layer, then the algorithm coefficient of each layer of the a layer to be extended is determined according to the abstract, and the corresponding account is extended by the a layer according to the determined a algorithm coefficients.
The N bytes may be the first N bytes or the last N bytes of the digest, or may be selected in the digest according to a preset selection rule, for example, from the J-th to the j+n-1-th bytes from front to back in the digest. Or, the N bytes used for determining the number of extension layers may be selected from the encrypted data or the data obtained after hash calculation, where the selecting method is the same as the selecting method for selecting the N bytes.
The algorithm coefficients of each layer to be extended are determined according to the abstract, and can be sequentially selected from front to back or from back to front in the abstract, for example, the algorithm coefficients of the first extended layer select the 1 st and 2 nd bytes of the abstract, and the algorithm coefficients of the second extended layer select the 3 rd and 4 th bytes of the abstract until the selection of all the algorithm coefficients is completed. Or the regular jump selection from the abstract, for example, the 3 rd and 4 th bytes of the abstract are selected from the algorithm coefficient of the first layer which extends from front to back, the 7 th and 8 th bytes of the abstract are selected from the algorithm coefficient of the second layer which extends from front to back, and the algorithm coefficients are selected each time at intervals of two bytes until all the algorithm coefficients are selected. The selected algorithm coefficients may be fixed length, e.g., the selected algorithm coefficients are two bytes each; or the selected algorithm coefficients are not fixed in length, but are changed regularly, for example, the algorithm coefficients of the extended first layer are two bytes, the algorithm coefficients of the extended second layer are three bytes, and the algorithm coefficients are sequentially increased backwards until the selection of all the algorithm coefficients is completed. The data already used in the digest (N bytes for determining the number of extension layers) may be removed before the algorithm coefficients are selected. Alternatively, the digest for the algorithm coefficient may be selected from data obtained by encrypting the digest or data obtained by performing hash calculation on the digest.
For ease of understanding, the description will be given taking, as an example, selecting the first two bytes from the calculated digest, and determining the number of extended layers according to the selection of the first two bytes: for example, the calculated summary is as follows: 1CA65BE33CC67930D3BF4CB2A7024D32E4216A3699F70D988CCF72350C153B378145372C01D8C29B0809E12B008B9F8D127C0A7CE123163F763A638B65AF62CB. If the extension range corresponding to 1CA6 is 5 layers, the algorithm coefficient of each layer may BE sequentially selected from the abstract, for example, the extended first layer algorithm coefficient is 5BE3, the second layer algorithm coefficient is 3CC6, the third layer algorithm coefficient is 7930, the fourth layer algorithm coefficient is D3BF, and the fifth layer algorithm coefficient is 4CB2, and the obtained account may BE expressed as: m/p urose '/count_type'/count '/change/address_index/ox5BE3'/ox3CC6'/ox 7930'/oxD3BF '/ox4CB 2'/protection_index. This example is only one embodiment of the present application and is not intended to limit the present application.
In another embodiment, according to the summary obtained by calculation, the process of hiding and protecting the blockchain account corresponding to the mnemonic may be: and determining parameters of a preset layering algorithm according to the abstract, and layering indexes of the last layer in the hierarchical structure of the blockchain account corresponding to the mnemonic according to the preset layering algorithm with the determined parameters.
The parameters of the preset hierarchical algorithm are determined according to the abstract, and may be sequentially selected from front to back or from back to front, or selected from the abstract in a regular jump manner, for example, the first parameter of the preset hierarchical algorithm selects the 3 rd and 4 th bytes of the abstract from front to back, the second parameter of the preset hierarchical algorithm selects the 7 th and 8 th bytes of the abstract from front to back, and each time the selected parameters are separated by two bytes until the parameters are all determined. The parameters of the selected preset layering algorithm may be fixed length, for example, the parameters of the selected preset layering algorithm are two bytes; or the parameters of the selected preset layering algorithm are not fixed in length, but change regularly, for example, the first parameter of the preset layering algorithm is two bytes, the second parameter of the preset layering algorithm is three bytes, and the parameters are sequentially increased until all the parameters are determined.
The preset layering algorithm may also be changed, and may be determined according to the calculated abstract, and at this time, the process of hiding and protecting the blockchain account corresponding to the mnemonic may be: selecting M bytes from the abstract obtained by calculation (M is a positive integer), and selecting a target layering algorithm corresponding to the M bytes from a preset layering algorithm library; determining parameters of a target layering algorithm according to the abstract; and layering the index of the last layer in the hierarchical structure of the blockchain account corresponding to the mnemonic according to a target layering algorithm with the determined parameters. The M bytes can be selected from the first M bytes or the last M bytes of the abstract, or can be selected from the abstract according to a preset selection rule, for example, the K-th to K+M-1 bytes from front to back in the abstract are selected. Or, the M bytes used for determining the extension layer number may also be selected from the data obtained after the digest is encrypted or the data obtained after the digest is hashed.
For ease of understanding, taking the first two bytes from the calculated summary as an example, and determining the target hierarchical algorithm according to the first two bytes selected, the following description will be given: for example, the calculated summary is as follows:
1CA65BE33CC67930D3BF4CB2A7024D32E4216A3699F70D988CCF72 350C153B378145372C01D8C29B0809E12B008B9F8D127C0A7CE123163F763A638B65AF62CB. The first two bytes 1CA6 of the abstract are selected, and the target hierarchical algorithm corresponding to the first two bytes 1CA6 in the preset hierarchical algorithm library is y=ax 2 +bx+c, and the values of the parameters a, b, c of the target layering algorithm y=ax2+bx+c are sequentially selected from the abstract, a=5be 3, b=3cc 6, c=7930, and then the target layering algorithm y=ox5be 3 x 2 +ox3CC6 x+ox7930, the layering rules for the account are: the first account x=0, then the account is: m/pull '/count_type'/count '/change/address_index/ox7930'; the second account x=1, then the account is: m/pull '/count_type'/count '/change/address_index/ox111D9', and so on. This example is only one embodiment of the present application and is not intended to limit the present application.
The hiding protection of the blockchain account corresponding to the mnemonic may include the extending protection and the layering protection, and in this case, in another embodiment, the hiding protection of the blockchain account corresponding to the mnemonic according to the calculated abstract may be: selecting N bytes from the calculated abstract, and determining the number of extended layers according to the selected N bytes, wherein N is a positive integer; determining an algorithm coefficient of each extending layer according to the abstract, and extending a hierarchical structure of a blockchain account corresponding to the mnemonic according to the determined algorithm coefficient and the number of layers of each layer, wherein the number of extended layers is consistent with the number of extended layers determined by N bytes; selecting M bytes from the calculated abstract, and selecting a target hierarchical algorithm corresponding to the M bytes from a preset hierarchical algorithm library; and determining parameters of a target layering algorithm according to the abstract, and layering indexes of the last layer in the hierarchical structure of the blockchain account corresponding to the extended mnemonic according to the target layering algorithm with the determined parameters. Where M and N may be equal. The target layering algorithm can also be selected from a preset layering algorithm library according to the selected N bytes.
For ease of understanding, taking the first two bytes from the summary obtained by calculation as an example, the number of extension layers and the target layering algorithm are determined according to the first two bytes selected, the following description is made: for example, the calculated summary is as follows:
1CA65BE33CC67930D3BF4CB2A7024D32E4216A3699F70D988CCF72350C153B378145372C01D8C29B0809E12B008B9F8D127C0A7CE123163F763A638B65AF62CB. The first two bytes 1CA6,1CA6 of this abstract are extended 5 layers within the agreed scope, then the algorithm coefficients of each layer can BE sequentially selected from the abstract skipping the used parts, for example, the extended first layer algorithm coefficient is 5BE3, the second layer algorithm coefficient is 3CC6, the third layer algorithm coefficient is 7930, the fourth layer algorithm coefficient is D3BF, and the fifth layer algorithm coefficient is 4CB2, and the resulting account can BE expressed as: m/p urose '/count_type'/count '/change/address_index/ox5BE3'/ox3CC6'/ox 7930'/oxD3BF '/ox4CB 2'/protection_index. The last two bytes 62CB,62CB of the abstract are selected, and the target hierarchical algorithm corresponding to the last two bytes 62CB in the preset hierarchical algorithm library is y=ax 2 +bx+c, target layering algorithm y=ax 2 The values of parameters a, b, c of +bx+c are selected in sequence, skipping the used parts in the abstract, a=a702, b=4d32, c=e411, then the target layering algorithm y=ox a702 x 2 +ox4D32 x+ oxE411, the layering rules of the account are: the first account x=0, then the account is: m/pull '/count_type'/count '/change/address_index/oxE411'; the second account x=1, then the account is: m/pull '/count_type'/count '/change/address_index/ox1D855', and so on. This example is only one embodiment of the present application and is not intended to limit the present application.
It should be noted that, the protection of the account by hiding may be performed by using only extension protection, and in an optional implementation manner, a blockchain account protection method provided in the embodiment of the present application may be shown in fig. 2. The specific content of this part corresponds to the content of the same part described above, and the same part described above is referred to here.
The blockchain account generated according to the scheme can be still protected as long as the protection password is not acquired by the blockchain account under the condition that the mnemonic word is mastered by other people.
In an alternative embodiment, only hierarchical protection may be used to hide the account, refer to fig. 3, which is a blockchain account protection method provided in the embodiment of the present application, where the specific content of the portion corresponds to the content of the same portion, and the portion is not described herein, but only referred to the same portion.
According to the blockchain account generated by the scheme, under the condition that the mnemonic is mastered by other people, the blockchain account can still be protected as long as the protection password is not acquired by the mnemonic.
In an alternative implementation, the protection of the account by hiding may use both extension protection and hierarchical protection, refer to fig. 4, which is a block chain account protection method provided in this embodiment, where the specific content of the part corresponds to the content of the same part, and where the specific content of the part is not described, refer to the same part.
The blockchain account generated according to the scheme can be still protected as long as the protection password is not acquired by the blockchain account under the condition that the mnemonic word is mastered by other people.
Referring to fig. 5, a blockchain account protection device 100 according to an embodiment of the present application includes a receiving module 110, a calculating module 120, and a protecting module 130.
The receiving module 110 is configured to receive a mnemonic and a protection password input by a user.
The computing module 120 is configured to compute a digest according to the received protection password input by the user. Optionally, the computing module 120 is further configured to mix the protection password with a preset key, and compute a digest according to the key obtained after the mixing.
The protection module 130 is configured to conceal and protect the blockchain account corresponding to the mnemonic according to the calculated abstract.
Optionally, the protection module 130 is further configured to: selecting N bytes from the calculated abstract, and determining the number of extended layers according to the selected N bytes, wherein N is a positive integer; and determining an algorithm coefficient of each extended layer according to the abstract, and extending the hierarchical structure of the blockchain account corresponding to the mnemonic according to the determined algorithm coefficient and the layer number of each layer, wherein the extended layer number is consistent with the extended layer number determined by N bytes. Wherein, optionally, in determining the number of extended layers, the protection module 130 is further configured to: and selecting the first two bytes from the calculated abstract, and determining the number of extended layers according to the first two bytes. Optionally, in determining the algorithm coefficients of each layer of the extension, the protection module 130 is further configured to: encrypting the abstract, or performing hash calculation on the abstract; and determining the algorithm coefficient of each extended layer according to the encrypted abstract or the data obtained after hash calculation.
Optionally, the protection module 130 is further configured to: determining parameters of a preset layering algorithm according to the abstract; and layering indexes of the last layer in the hierarchical structure of the blockchain account corresponding to the mnemonic according to a preset layering algorithm of the determined parameters.
Optionally, the protection module 130 is further configured to: selecting M bytes from the calculated abstract, and selecting a target hierarchical algorithm corresponding to the M bytes from a preset hierarchical algorithm library, wherein M is a positive integer; determining parameters of a target layering algorithm according to the abstract; and layering the index of the last layer in the hierarchical structure of the blockchain account corresponding to the mnemonic according to a target layering algorithm with the determined parameters.
Optionally, the protection module 130 is further configured to: selecting N bytes from the calculated abstract, and determining the number of extended layers according to the selected N bytes, wherein N is a positive integer; determining an algorithm coefficient of each extending layer according to the abstract, and extending a hierarchical structure of a blockchain account corresponding to the mnemonic according to the determined algorithm coefficient and the number of layers of each layer, wherein the number of extended layers is consistent with the number of extended layers determined by N bytes; selecting M bytes from the calculated abstract, and selecting a target hierarchical algorithm corresponding to the M bytes from a preset hierarchical algorithm library; and determining parameters of a target layering algorithm according to the abstract, and layering indexes of the last layer in the hierarchical structure of the blockchain account corresponding to the extended mnemonic according to the target layering algorithm with the determined parameters. The protection module 130 is further configured to: encrypting the abstract, or performing hash calculation on the abstract; and determining the algorithm coefficient of each extended layer according to the encrypted abstract or the data obtained after hash calculation.
The functions to be implemented by the protection device are described in detail in the foregoing, and are not described in detail herein.
Please refer to fig. 6, which is an electronic device provided in an embodiment of the present application. The electronic device 200 includes: transceiver 210, memory 220, communication bus 230, processor 240.
The transceiver 210, the memory 220, and the processor 240 are electrically connected directly or indirectly to each other to realize data transmission or interaction. For example, the components may be electrically coupled to each other via one or more communication buses 230 or signal lines. Wherein the transceiver 210 is configured to transmit and receive data. The memory 220 is used to store a computer program, such as the software functional modules shown in fig. 5, namely the blockchain account protection apparatus 100. The blockchain account protection apparatus 100 includes at least one software function module that may be stored in the memory 220 in the form of software or firmware (firmware) or cured in an Operating System (OS) of the electronic device 200. The processor 240 is configured to execute executable modules stored in the memory 220, such as software functional modules or computer programs included in the blockchain account protection apparatus 100. For example, the processor 240 is configured to receive a mnemonic and a protection password entered by a user, and calculate a digest according to the protection password; and the method is also used for hiding and protecting the blockchain account corresponding to the mnemonic according to the calculated abstract.
The Memory 220 may be, but is not limited to, a random access Memory (Random Access Memory, RAM), a Read Only Memory (ROM), a programmable Read Only Memory (Programmable Read-Only Memory, PROM), an erasable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), an electrically erasable Read Only Memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.
The processor 240 may be an integrated circuit chip with signal processing capabilities. The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor 240 may be any conventional processor or the like.
The electronic device 200 includes, but is not limited to, a smart phone, a tablet, a personal computer, a server, etc.
The embodiments of the present application also provide a non-volatile computer readable storage medium (hereinafter referred to as a storage medium) having a computer program stored thereon, which when executed by a computer such as the electronic device 200 described above, performs the blockchain account protection method described above.
It should be noted that, in the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described as different from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners as well. The apparatus embodiments described above are merely illustrative, for example, flow diagrams and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a notebook computer, a server, or an electronic device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the same, but rather, various modifications and variations may be made by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims (10)

1. A blockchain account protection method, comprising:
receiving a mnemonic word and a protection password input by a user, and calculating a abstract according to the protection password, wherein the method for calculating the abstract is an abstract algorithm;
according to the abstract obtained by calculation, hiding and protecting the blockchain account corresponding to the mnemonic;
and hiding and protecting the blockchain account corresponding to the mnemonic according to the calculated abstract, wherein the hiding and protecting comprises the following steps:
selecting N bytes from the calculated abstract, and determining the number of layers of the hierarchical structure extension of the blockchain account according to the corresponding relation between the selected N bytes and the number of extension layers according to the predetermined byte, wherein N is a positive integer;
firstly determining an algorithm coefficient of each extended layer according to the abstract, and then extending a hierarchical structure of a blockchain account corresponding to the mnemonic according to the determined algorithm coefficient of each layer and the layer number, wherein the number of extended layers is consistent with the number of extended layers determined by the N bytes, wherein bytes with the same number as the algorithm coefficients are selected from the abstract and used as values of the algorithm coefficients respectively, and the algorithm coefficients are used for generating indexes;
selecting M bytes from the calculated abstract, and selecting a target hierarchical algorithm corresponding to the M bytes from a preset hierarchical algorithm library, wherein the hierarchical algorithm library comprises the corresponding relation between the hierarchical algorithm and the bytes;
and determining parameters of the target layering algorithm according to the abstract, layering indexes of the last layer in the hierarchical structure of the blockchain account corresponding to the mnemonic after extension according to the target layering algorithm with the determined parameters, wherein bytes with the same number as the parameters of the target layering algorithm are selected from the abstract to be used as values of the parameters of the target layering algorithm respectively.
2. The blockchain account protection method of claim 1, wherein computing a digest from the protection secret includes:
the protection password is mixed with a preset secret key;
and calculating the abstract according to the key obtained after confusion.
3. The blockchain account protection method of claim 1, wherein selecting N bytes from the calculated summary and determining an extended number of layers from the N bytes selected, comprises:
and selecting the first two bytes from the calculated abstract, and determining the number of extended layers according to the first two bytes.
4. The blockchain account protection method of claim 1 or 3, wherein determining the extended algorithm coefficients for each layer according to the digest further comprises:
encrypting the abstract, or carrying out hash calculation on the abstract;
and determining the extended algorithm coefficient of each layer according to the encrypted digest or the data obtained by calculating the hash.
5. A blockchain account protection device, comprising:
the receiving module is used for receiving the mnemonic and the protection password input by the user;
the computing module is used for computing a summary according to the received protection password input by the user, and the method for computing the summary is a summary algorithm;
the protection module is used for carrying out hidden protection on the blockchain account corresponding to the mnemonic according to the abstract obtained by calculation;
the protection module is specifically used for: selecting N bytes from the calculated abstract, and determining the number of extended layers according to the corresponding relation between the selected N bytes and the number of extended layers according to the preset byte, wherein N is a positive integer; determining an algorithm coefficient of each extended layer according to the abstract, and extending a hierarchical structure of a blockchain account corresponding to the mnemonic according to the determined algorithm coefficient and layer number of each layer, wherein the number of extended layer is consistent with N bytes, the number of extended layer is determined to be consistent with N bytes, bytes with the same number as the algorithm coefficient are selected from the abstract to be used as values of the algorithm coefficient respectively, and the algorithm coefficient is used for generating an index;
selecting M bytes from the calculated abstract, and selecting a target hierarchical algorithm corresponding to the M bytes from a preset hierarchical algorithm library, wherein the hierarchical algorithm library comprises the corresponding relation between the hierarchical algorithm and the bytes; and determining parameters of the target layering algorithm according to the abstract, layering indexes of the last layer in the hierarchical structure of the blockchain account corresponding to the mnemonic after extension according to the target layering algorithm with the determined parameters, wherein bytes with the same number as the parameters of the target layering algorithm are selected from the abstract to be used as values of the parameters of the target layering algorithm respectively.
6. The blockchain account protection device of claim 5, wherein the computing module is specifically configured to confuse the protection password with a preset key, and compute a digest based on the confused key.
7. The blockchain account protection device of claim 5, wherein the protection module is further configured to, when determining the number of extended layers, select a first two bytes from the calculated summary and determine the number of extended layers based on the first two bytes selected.
8. The blockchain account protection device of claim 5, wherein in determining the algorithm coefficients for each layer of extension, the protection module is further to: encrypting the abstract, or performing hash calculation on the abstract; and determining the algorithm coefficient of each extending layer according to the encrypted digest or the data obtained by calculating the hash.
9. An electronic device, comprising: the device comprises a memory and a processor, wherein the memory is connected with the processor;
the memory is used for storing programs;
the processor is configured to invoke a program stored in the memory to perform the method of any of claims 1-4.
10. A storage medium having stored thereon a computer program which, when executed, performs the method of any of claims 1-4.
CN202011047727.7A 2020-09-28 2020-09-28 Block chain account protection method and device, electronic equipment and storage medium Active CN112184223B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011047727.7A CN112184223B (en) 2020-09-28 2020-09-28 Block chain account protection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011047727.7A CN112184223B (en) 2020-09-28 2020-09-28 Block chain account protection method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112184223A CN112184223A (en) 2021-01-05
CN112184223B true CN112184223B (en) 2023-05-26

Family

ID=73946351

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011047727.7A Active CN112184223B (en) 2020-09-28 2020-09-28 Block chain account protection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112184223B (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110084599B (en) * 2019-04-28 2021-04-20 百度在线网络技术(北京)有限公司 Key processing method, device, equipment and storage medium
CN111091381B (en) * 2019-12-20 2023-06-23 江苏恒宝智能系统技术有限公司 Hardware wallet and management method thereof
CN110930145B (en) * 2020-02-04 2020-05-12 江苏恒宝智能系统技术有限公司 Cold wallet generation method, transaction information processing method, device and storage medium
CN111523885B (en) * 2020-03-06 2023-08-01 杜晓楠 Encryption multi-account construction method for blockchain wallet, computer readable storage medium and blockchain encryption multi-account wallet

Also Published As

Publication number Publication date
CN112184223A (en) 2021-01-05

Similar Documents

Publication Publication Date Title
US11163907B2 (en) Decentralized token table generation
EP2751949B1 (en) Multiple table tokenization
US20210256165A1 (en) Protecting parallel multiplication operations from external monitoring attacks
US6000032A (en) Secure access to software modules
KR20070057968A (en) Sharing a secret by using random function
US20210160049A1 (en) Data encryption and decryption
CN114124480A (en) Communication authentication method, server, client, electronic device and storage medium
EP2991264B1 (en) Encrypted text matching system, method and program
US20210152331A1 (en) Protecting polynomial hash functions from external monitoring attacks
KR20110014630A (en) Exponent obfuscation
JP2012128398A (en) Method and system for selecting sequence of encrypted elements with privacy protected
CN110210211A (en) A kind of method of data protection and calculate equipment
CN110365626B (en) User login security authentication method for anti-collision library, terminal equipment and storage medium
RU2680761C1 (en) Secure data transformations
EP2991265B1 (en) Encrypted text matching system, method and program
JP5972181B2 (en) Tamper detection device, tamper detection method, and program
CN112184223B (en) Block chain account protection method and device, electronic equipment and storage medium
WO2013153628A1 (en) Calculation processing system and calculation result authentication method
KR20080012633A (en) Method and apparatus of adding points in prime finite field for implementation of fault detecting operation used in fast montgomery power ladder algorithm
EP2991266B1 (en) Encrypted text matching system, method, and computer readable medium
Vidhya et al. Fusion-based advanced encryption algorithm for enhancing the security of Big Data in Cloud
JP6844696B2 (en) Authentication tag generator, authentication tag verification device, method and program
KR20080012634A (en) Method and apparatus of adding points in binary finite field for implementation of fault detecting operation used in fast montgomery power ladder algorithm
KR101440680B1 (en) Homomorphic Encryption and Decryption Method using Chinese Remainder Theorem and apparatus using the same
CN115022035A (en) CAN communication encryption method and device, electronic equipment and storage medium

Legal Events

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