CN109586925B - Private key generation method, device and storage medium - Google Patents
Private key generation method, device and storage medium Download PDFInfo
- Publication number
- CN109586925B CN109586925B CN201910029029.5A CN201910029029A CN109586925B CN 109586925 B CN109586925 B CN 109586925B CN 201910029029 A CN201910029029 A CN 201910029029A CN 109586925 B CN109586925 B CN 109586925B
- Authority
- CN
- China
- Prior art keywords
- password
- mnemonic
- private key
- information
- generating
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 33
- 230000001343 mnemonic effect Effects 0.000 claims abstract description 33
- 239000012634 fragment Substances 0.000 claims description 12
- 238000004590 computer program Methods 0.000 claims description 8
- 238000012856 packing Methods 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 2
- 230000007812 deficiency Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3236—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/08—Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
- H04L9/0861—Generation of secret information including derivation or calculation of cryptographic keys or passwords
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3226—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using a predetermined code, e.g. password, passphrase or PIN
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2209/00—Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
- H04L2209/56—Financial cryptography, e.g. electronic payment or e-cash
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
- Storage Device Security (AREA)
Abstract
The invention provides a private key generation method and a private key generation system, wherein the method comprises the following steps: acquiring a first password input by a user, and decrypting according to the first password to obtain a mnemonic word; and generating a first private key according to the first password, the mnemonic word and the currency type. The invention can not store the private key in the storage medium, thereby improving the security of the block chain wallet.
Description
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a private key generation method, device, and storage medium.
Background
The existing blockchain wallet usually stores the private key in a storage medium, and the private key is at risk of being cracked or leaked, so that the assets of a user are lost.
Disclosure of Invention
In view of the above-mentioned drawbacks and deficiencies of the prior art, it would be desirable to provide a private key generation method, apparatus, and storage medium that improves the security of a blockchain wallet without saving the private key in the storage medium.
In a first aspect, the present invention provides a private key generation method, including:
acquiring a first password input by a user, and decrypting according to the first password to obtain a mnemonic word;
and generating a first private key according to the first password, the mnemonic word and the currency type.
In a second aspect, the present invention also provides an apparatus comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors to cause the one or more processors to perform a private key generation method provided in accordance with embodiments of the present invention.
In a third aspect, the present invention also provides a storage medium storing a computer program that causes a computer to execute the private key generation method provided according to the embodiments of the present invention.
According to the private key generation method, the private key generation device and the storage medium provided by the embodiments of the invention, the first password input by the user is acquired, and decryption is performed according to the first password to obtain the mnemonic word; the method for generating the first private key according to the first password, the mnemonic words and the currency type realizes that the private key is not stored in a storage medium, and improves the security of the block chain wallet.
The private key generation method, device and storage medium provided by some embodiments of the present invention further improve the security of the blockchain wallet by a method of dispersedly storing the pieces of mnemonic information to be decrypted.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
fig. 1 is a flowchart of a private key generation method according to an embodiment of the present invention.
Fig. 2 is a flowchart of step S12 in a preferred embodiment of the method shown in fig. 1.
Fig. 3 is a flowchart of step S122 in a preferred embodiment of the method shown in fig. 2.
Fig. 4 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 is a flowchart of a private key generation method according to an embodiment of the present invention. As shown in fig. 1, in this embodiment, the present invention provides a private key generation method, including:
s12: acquiring a first password input by a user, and decrypting according to the first password to obtain a mnemonic word;
s14: and generating a first private key according to the first password, the mnemonic word and the currency type.
Specifically, the user is taken as a user A, password1 is taken as a first password input by the user A, seed (A) is a mnemonic obtained after decryption according to password1, the currency type is token1, and the first private key is privkey1 for example;
in step S12, the wallet receives password1 input by user a, decrypts according to password1 to obtain seed (a);
in step S14, the wallet generates privkey1 based on password1, seed (a), and token 1.
The embodiment realizes that the private key is not stored in the storage medium, and improves the safety of the blockchain wallet.
Fig. 2 is a flowchart of step S12 in a preferred embodiment of the method shown in fig. 1. As shown in fig. 2, in a preferred embodiment, step S12 includes:
s122: generating a first hash value according to the first password;
s124: judging whether the first hash value is the same as the stored password hash value:
if yes, the decryption is carried out according to the first password to obtain the mnemonic words.
Specifically, as an example, password1 is used as a first password, hash1 is used as a first hash value generated according to the first password, and hash2 is used as a stored password hash value;
in step S122, the wallet generates a hash1 from password 1;
in step S124, the wallet determines whether the hash1 is the same as the hash 2:
if yes, then decrypt according to password1 to obtain seed (A).
Fig. 3 is a flowchart of step S122 in a preferred embodiment of the method shown in fig. 2. As shown in fig. 3, in a preferred embodiment, step S122 includes:
s1222, combining the first password and the second password in the program to generate a third password;
s1224 calculates a first hash value of the third password.
Specifically, as an example, password1 is used as a first password, password2 is used as a second password built in a program, password3 is used as a third password, and hash1 is used as a first hash value;
in step S1222, the wallet combines password1 with password2 to generate password 3;
in step S1224, the wallet calculates a first hash value of password3 resulting in a hash 1.
In a preferred embodiment, the segments of mnemonic information to be decrypted are stored in a distributed manner. The fragments of the mnemonic word information to be decrypted are dispersedly stored locally or in different storage media.
The above-described embodiments further improve blockchain wallet security.
In a preferred embodiment, decrypting based on the first password to obtain the mnemonic comprises:
acquiring each fragment of the mnemonic information, and generating the mnemonic information according to each fragment;
the mnemonic information is decrypted using the first password to obtain the mnemonic.
Specifically, for example, the mnemonic word information is encry (seed (a)), the encry (seed (a)) is divided into three fragments, namely fragment 1, fragment 2 and fragment 3, and fragment 1, fragment 2 and fragment 3 are dispersedly stored locally;
acquiring a segment 1, a segment 2 and a segment 3 from local, and generating encry (seed (A)) according to the segment 1, the segment 2 and the segment 3;
encrypt (seed (A)) is decrypted using password1 to obtain seed (A).
Fig. 4 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
As shown in fig. 4, as another aspect, the present application also provides an apparatus 400 including one or more Central Processing Units (CPUs) 401 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. In the RAM403, various programs and data necessary for the operation of the device 400 are also stored. The CPU401, ROM402, and RAM403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
The following components are connected to the I/O interface 405: an input section 406 including a keyboard, a mouse, and the like; an output section 407 including a display device such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 408 including a hard disk and the like; and a communication section 409 including a network interface card such as a LAN card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet. A driver 410 is also connected to the I/O interface 405 as needed. A removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 410 as necessary, so that a computer program read out therefrom is mounted into the storage section 408 as necessary.
In particular, according to an embodiment of the present disclosure, the private key generation method described in any of the above embodiments may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing a method of private key generation. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 409, and/or installed from the removable medium 411.
As yet another aspect, the present application also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus of the above-described embodiment; or it may be a separate computer readable storage medium not incorporated into the device. The computer-readable storage medium stores one or more programs for use by one or more processors in performing the private key generation methods described herein.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. 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.
The units or modules described in the embodiments of the present application may be implemented by software or hardware. The described units or modules may also be provided in a processor, for example, each of the described units may be a software program provided in a computer or a mobile intelligent device, or may be a separately configured hardware device. Wherein the designation of a unit or module does not in some way constitute a limitation of the unit or module itself.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the present application. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.
Claims (8)
1. A method of generating a private key, comprising:
acquiring a first password input by a user, and decrypting mnemonic word information according to the first password to obtain a mnemonic word;
and generating a first private key according to the first password, the mnemonic word and the currency type.
2. The method of claim 1, wherein decrypting mnemonic information to obtain a mnemonic according to the first password comprises:
generating a first hash value according to the first password;
judging whether the first hash value is the same as the stored password hash value:
if yes, the mnemonic word information is decrypted according to the first password to obtain the mnemonic word.
3. The method of claim 2, wherein generating the first hash value according to the first password comprises:
combining the first password with a second password built in a program to generate a third password;
calculating a first hash value of the third password.
4. A method according to any of claims 1-3, wherein the segments of mnemonic information to be decrypted are stored separately.
5. The method of claim 4, wherein decrypting mnemonic information to obtain a mnemonic according to the first password comprises:
acquiring all the fragments of the mnemonic word information, and generating the mnemonic word information according to all the fragments;
the mnemonic information is decrypted using a first password to obtain a mnemonic.
6. A transaction sending method, characterized in that a transaction is signed using the private key generated in any of claims 1-5 and sent to a blockchain network for packing.
7. A computer device, the device comprising:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method recited in any of claims 1-6.
8. A storage medium storing a computer program, characterized in that the program, when executed by a processor, implements the method according to any one of claims 1-6.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910029029.5A CN109586925B (en) | 2019-01-12 | 2019-01-12 | Private key generation method, device and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910029029.5A CN109586925B (en) | 2019-01-12 | 2019-01-12 | Private key generation method, device and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN109586925A CN109586925A (en) | 2019-04-05 |
| CN109586925B true CN109586925B (en) | 2021-08-06 |
Family
ID=65915000
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910029029.5A Active CN109586925B (en) | 2019-01-12 | 2019-01-12 | Private key generation method, device and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN109586925B (en) |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110599167A (en) * | 2019-09-09 | 2019-12-20 | 深圳四方精创资讯股份有限公司 | Identifier-based wallet private key management method, device and system and storage medium |
| CN111026582A (en) * | 2019-12-04 | 2020-04-17 | 杭州复杂美科技有限公司 | Mnemonic word backup method, mnemonic word importing method, equipment and storage medium |
| CN112865971B (en) * | 2021-03-29 | 2023-01-31 | 中信银行股份有限公司 | Private key generation method and device, electronic equipment and computer readable storage medium |
| CN113221141B (en) * | 2021-05-06 | 2022-07-19 | 杭州复杂美科技有限公司 | Wallet encryption storage method, signature method, computer device and storage medium |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101222712A (en) * | 2008-02-02 | 2008-07-16 | 代邦(江西)制卡有限公司 | Mobile terminal supporting virtual SIM card and its user identity authentication method |
| CN107453862A (en) * | 2017-05-15 | 2017-12-08 | 杭州复杂美科技有限公司 | Private key generation storage and the scheme used |
| CN108599935A (en) * | 2018-04-16 | 2018-09-28 | 北京知道创宇信息技术有限公司 | Key generation method, device and offline key generation device |
| CN108681890A (en) * | 2018-05-21 | 2018-10-19 | 北京橙鑫数据科技有限公司 | Processing method, processing equipment and the processing system of private information |
| CN109003059A (en) * | 2018-06-29 | 2018-12-14 | 北京金山安全软件有限公司 | Management method and device of digital currency wallet, electronic equipment and storage medium |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20160149711A1 (en) * | 2014-11-24 | 2016-05-26 | Wyzr Limited | Distributed identification system for peer to peer message transmission |
-
2019
- 2019-01-12 CN CN201910029029.5A patent/CN109586925B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101222712A (en) * | 2008-02-02 | 2008-07-16 | 代邦(江西)制卡有限公司 | Mobile terminal supporting virtual SIM card and its user identity authentication method |
| CN107453862A (en) * | 2017-05-15 | 2017-12-08 | 杭州复杂美科技有限公司 | Private key generation storage and the scheme used |
| CN108599935A (en) * | 2018-04-16 | 2018-09-28 | 北京知道创宇信息技术有限公司 | Key generation method, device and offline key generation device |
| CN108681890A (en) * | 2018-05-21 | 2018-10-19 | 北京橙鑫数据科技有限公司 | Processing method, processing equipment and the processing system of private information |
| CN109003059A (en) * | 2018-06-29 | 2018-12-14 | 北京金山安全软件有限公司 | Management method and device of digital currency wallet, electronic equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109586925A (en) | 2019-04-05 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12001525B1 (en) | Methods, systems, and devices for an encrypted and obfuscated algorithm in a computing environment | |
| CN109586925B (en) | Private key generation method, device and storage medium | |
| US11277257B2 (en) | Method and apparatus for performing operation using encrypted data | |
| CN108681676B (en) | Data management method and apparatus, system, electronic device, program, and storage medium | |
| US20120317036A1 (en) | Payment card processing system with structure preserving encryption | |
| US10733809B2 (en) | Information processing device and information processing method | |
| US11216570B2 (en) | Reducing compromise of sensitive data in virtual machine | |
| KR102194514B1 (en) | Method and apparatus for processing transactions | |
| US10410210B1 (en) | Secure generation and inversion of tokens | |
| US20210167959A1 (en) | Safe token storage | |
| CN110213251B (en) | Method for anonymously reporting reward distribution, method for obtaining reward, equipment and storage medium | |
| US10528708B2 (en) | Prevention of unauthorized resource updates | |
| Senthilnathan et al. | An enhancing reversible data hiding for secured data using shuffle block key encryption and histogram bit shifting in cloud environment | |
| US20210240840A1 (en) | Data protection using functional encryption | |
| US20160364722A1 (en) | Alternate primary account number generation | |
| CN109391607B (en) | Data encryption and decryption method, device and system | |
| CN110737905B (en) | Data authorization method, data authorization device and computer storage medium | |
| US11438136B2 (en) | Encryption apparatus and method for encrypting encryption target data in data based on homomorphic encryption algorithm | |
| CN111861462A (en) | Financial product transaction method and device based on block chain | |
| CN112784305A (en) | Encrypted voting method, computer device, and storage medium | |
| CN112115491A (en) | Symmetric encryption key protection method, device, equipment and storage medium | |
| US20250080509A1 (en) | System and method for encrypting and decrypting data | |
| CN113205333B (en) | Wallet encryption storage method, signature method, computer device and storage medium | |
| US10909245B1 (en) | Secure quarantine of potentially malicious content | |
| Liu et al. | A parallel encryption algorithm for dual-core processor based on chaotic map |
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 |