CN109067526A - Level public private key pair generation method and device - Google Patents
Level public private key pair generation method and device Download PDFInfo
- Publication number
- CN109067526A CN109067526A CN201810932146.8A CN201810932146A CN109067526A CN 109067526 A CN109067526 A CN 109067526A CN 201810932146 A CN201810932146 A CN 201810932146A CN 109067526 A CN109067526 A CN 109067526A
- Authority
- CN
- China
- Prior art keywords
- key
- data
- sub
- father
- public key
- 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.)
- Pending
Links
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/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/06—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
- H04L9/0643—Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
-
- 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/30—Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
- H04L9/3066—Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy involving algebraic varieties, e.g. elliptic or hyper-elliptic curves
Abstract
The present invention provides a kind of level public private key pair generation method and devices, belong to field of information security technology.A kind of level public private key pair generation method provided by the invention and device, it specifically includes: father's public key is connected with sub-key indexed sequential, using father chain's code as Hash key, the cryptographic Hash of connection data is calculated according to preset algorithm, the data of the low order end preset length of cryptographic Hash are divided as subchain code, the data and father's public key for dividing the high order end preset length of cryptographic Hash do ECC multiplying, if the data of the high order end preset length of cryptographic Hash are less than the rank of elliptic curve basic point and ECC multiplication result is not infinite point, then using ECC multiplication result as sub- public key, reduce the ECC add operation in sub- public key generating process, to reduce the computation complexity of sub- public key generating process, improve computational efficiency.
Description
Technical field
The present invention relates to field of information security technology, in particular to a kind of level public private key pair generation method and dress
It sets.
Background technique
With the fast development of Internet technology, online transaction becomes more frequently, and digital cash is in network trading
The sabstitute money of electronic money form.In order to guarantee the safety of digital cash circulation, Elliptic Curve Cryptography is used, is based on
The design of Elliptic Curve Cryptography makes digital cash that can only be paid or be shifted by true owner.
BIP32 agreement based on Elliptic Curve Cryptography is provided by father's private key, father's public key, father chain's code and sub-key index
The method for generating sub- private key, sub- public key and subchain code, but the related operation complexity of elliptic curve will be much higher than other operations,
BIP32 agreement is related to multiple ECC multiplication, ECC add operation during generating sub- public key, so the agreement is generating
Computation complexity during sub- public key is higher, and computational efficiency is lower.
Summary of the invention
For above-mentioned problems of the prior art, the present invention provides a kind of level public private key pair generation method and dresses
It sets, under conditions of keeping same security intensity, can reduce and generate the complexity that sub- public key calculates, improve computational efficiency.
To achieve the goals above, technical scheme is as follows:
Technical solution of the present invention one proposes a kind of level public private key pair generation method, according to father's public key, father's private key, father chain
Code and sub-key index generate sub- public key and subchain code, which comprises
Father's public key is connect to obtain the first connection data with the sub-key indexed sequential;
With father chain's code for Hash key, the cryptographic Hash of the first connection data is calculated according to preset algorithm;
The cryptographic Hash of the first connection data is divided, subchain code and the first data are obtained;
ECC multiplying is carried out to first data and father's public key, obtains the first operation result;
If first data are less than the rank of default elliptic curve basic point and first operation result is not infinite
Far point, then using first operation result as sub- public key;
If first data are more than or equal to the rank of default elliptic curve basic point or first operation result is nothing
Poor far point, then by the sub-key index be incremented by, according to father's public key, the father chain code and be incremented by after sub-key index weight
Newly-generated sub- public key and subchain code.
Technical solution of the present invention two proposes that father's public key indexes suitable with the sub-key on the basis of technical solution one
Before sequence connects the step of obtaining the first connection data, the method also includes:
Judge whether the sub-key index is greater than or equal to preset value;
If so, prompt failure;
The step of obtaining the first connection data is connect with the sub-key indexed sequential if not, executing father's public key.
Technical solution of the present invention three proposes on the basis of technical solution one, the Hash to the first connection data
The step of value is divided, and subchain code and the first data are obtained, comprising:
Using the data of the low order end preset length of the cryptographic Hash of the first connection data as subchain code;By described first
The data of the high order end preset length of the cryptographic Hash of data are connected as the first data;The low order end preset length and the height
The length for the cryptographic Hash that the sum of position end preset length connects data for described first.
Technical solution of the present invention four proposes on the basis of technical solution one, the method also includes:
High-order cover is carried out to father's private key, father's private key after the cover is connect with the sub-key indexed sequential
Obtain the second connection data;
With father chain's code for Hash key, the cryptographic Hash of the second connection data is calculated according to preset algorithm;
The cryptographic Hash of the second connection data is divided, subchain code and the second data are obtained;
Using the rank of the elliptic curve basic point as modulus, to the product of father's private key and second data before the cover
Modular arithmetic is done, the second operation result is obtained;
If second data are less than the rank of the elliptic curve basic point and second operation result is not 0,
Using second operation result as sub- private key;
If second data are more than or equal to the rank of the elliptic curve basic point or second operation result is 0,
Then by the sub-key index be incremented by, according to father's private key, the father chain code and it is described be incremented by after sub-key index again
Generate sub- private key and subchain code;
ECC multiplying is done to the basic point of the sub- private key and the elliptic curve, obtains sub- public key.
Technical solution of the present invention five proposes on the basis of technical solution four, carries out high-order benefit to father's private key described
Position, it is described before father's private key after the cover is connect to obtain the second connection data step with the sub-key indexed sequential
Method further include:
Judge whether the sub-key index is greater than or equal to preset value;
If so, execution is described to carry out high-order cover to father's private key, by the father's private key and sub-key indexed sequential after cover
The step of connection obtains the second connection data;
If not, the basic point of father's private key and the elliptic curve is done ECC multiplying, the ECC multiplication is transported
It calculates result and sub-key is linked in sequence to obtain the second connection data.
Technical solution of the present invention six proposes on the basis of technical solution four, the Hash to the second connection data
The step of value is divided, and subchain code and the second data are obtained, comprising:
Using the data of the low order end preset length of the cryptographic Hash of the second connection data as subchain code;By described second
The data of the high order end preset length of the cryptographic Hash of data are connected as the second data;The low order end preset length and the height
The length for the cryptographic Hash that the sum of position end preset length connects data for described second.
Technical solution of the present invention seven proposes on the basis of technical solution one, the method also includes:
ECC multiplying is done to the basic point of father's private key and the elliptic curve, obtains father's public key;
Father's public key is connect to obtain third connection data with the sub-key indexed sequential;
With father chain's code for Hash key, the cryptographic Hash of the third connection data is calculated according to preset algorithm;
The cryptographic Hash of third connection data is divided, subchain code and third data are obtained;
ECC multiplying is carried out to the third data and father's public key, obtains third operation result;
If the third data are less than the rank of the default elliptic curve basic point and the third operation result is not
Infinite point, then using the third operation result as sub- public key;
If the third data are more than or equal to the rank of the elliptic curve basic point or the third operation result is nothing
Poor far point, then by the sub-key index be incremented by, according to father's public key, the father chain code and it is described be incremented by after sub-key rope
Draw and regenerates sub- public key and subchain code.
Technical solution of the present invention eight proposes on the basis of technical solution seven, indexes in father's public key and the sub-key
Before sequential connection obtains the step of third connection data, the method also includes:
Judge whether the sub-key index is greater than or equal to preset value;
If so, prompt failure;
If not, executing father's public key connect the step of obtaining third connection data with the sub-key indexed sequential.
Technical solution of the present invention nine proposes on the basis of technical solution seven, the Hash to third connection data
The step of value is divided, and subchain code and third data are obtained, comprising:
Using the data of the low order end preset length of the cryptographic Hash of third connection data as subchain code;By the third
The data of the high order end preset length of the cryptographic Hash of data are connected as third data;The low order end preset length and the height
The sum of position end preset length connects the length of the cryptographic Hash of data for the third.
Technical solution of the present invention ten also proposed a kind of level public private key pair generating means, according to father's public key, father's private key, father
Chain code and the sub- public key of sub-key index generation and subchain code, described device include:
First connection unit, for the first comparing unit be it is no when, by father's public key and the sub-key indexed sequential
Connection obtains the first connection data;
First hash units, for, for Hash key, calculating first connection according to preset algorithm with father chain's code
The cryptographic Hash for the first connection data that unit obtains;
First division unit, the low level of the cryptographic Hash for dividing the first splicing data that first hash units obtain
Hold the data of preset length as subchain code;The data of high order end preset length are as the first data;The default length of the low order end
Degree is the length of the described first cryptographic Hash for connecting data with the sum of the high order end preset length;
First arithmetic element obtains the first operation knot for doing ECC multiplying to first data and father's public key
Fruit;
First selecting unit is more than or equal to the basic point rank or described first of default elliptic curve for first data
When operation result is infinite point, the first increment unit is selected;First data are less than the basic point rank of default elliptic curve simultaneously
And first operation result selects first key acquiring unit when not being infinite point;
First increment unit is incremented by for indexing sub-key;
First key acquiring unit, for using the first operation result as sub- public key.
Compared with prior art, level public private key pair generation method provided in an embodiment of the present invention and device, by father's public key
It is connected with sub-key indexed sequential, makes father chain's code as Hash key, the cryptographic Hash of connection data is calculated according to preset algorithm, draw
Divide the data of the low order end preset length of cryptographic Hash as subchain code, divides data and the father of the high order end preset length of cryptographic Hash
Public key does ECC multiplying, if the data of the high order end preset length of cryptographic Hash are less than the rank of elliptic curve basic point and ECC
Multiplication result is not infinite point, then using operation result as sub- public key, the ECC reduced in sub- public key generating process adds
Method operation improves computational efficiency to reduce the computation complexity for generating sub- public key.
To enable the above objects, features and advantages of the present invention to be clearer and more comprehensible, preferred embodiment is cited below particularly, and cooperate
Appended attached drawing, is described in detail below.
Detailed description of the invention
It, below will be to specific in order to illustrate more clearly of the specific embodiment of the invention or technical solution in the prior art
Embodiment or attached drawing needed to be used in the description of the prior art be briefly described, it should be apparent that, it is described below
Attached drawing is some embodiments of the present invention, for those of ordinary skill in the art, before not making the creative labor
It puts, is also possible to obtain other drawings based on these drawings.
Fig. 1 is the flow chart of the first level public private key pair generation method provided in an embodiment of the present invention;
Fig. 2 is the flow chart of second of level public private key pair generation method provided in an embodiment of the present invention;
Fig. 3 is the flow chart of the third level public private key pair generation method provided in an embodiment of the present invention;
Fig. 4 is a kind of structural block diagram of level public private key pair generating means provided in an embodiment of the present invention;
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with attached drawing to the present invention
Technical solution be clearly and completely described, it is clear that described embodiments are some of the embodiments of the present invention, rather than
Whole embodiments.The component of embodiments of the present invention, which are generally described and illustrated herein in the accompanying drawings can be matched with a variety of different
It sets to arrange and design.Therefore, the detailed description of the embodiment of the present invention provided in the accompanying drawings is not intended to limit below
The range of claimed invention, but it is merely representative of selected embodiment of the invention.Based on the embodiments of the present invention, originally
Field those of ordinary skill every other embodiment obtained without making creative work, belongs to the present invention
The range of protection.
Currently, the BIP32 agreement based on Elliptic Curve Cryptography generates sub- public key in father's public key, father's private key generates sub- public key
During, be used for multiple times the dot product on elliptic curve, put add operation, make the generating process computation complexity of sub- public key compared with
Height, computational efficiency are lower.Based on this, the embodiment of the present invention proposes a kind of level public private key pair generation method and device, with drop
The low computation complexity for generating sub- public key, improves computational efficiency.Level public private key pair generation method provided in an embodiment of the present invention,
Sub- public key and subchain code can be generated according to father's public key, father chain's code and sub-key index, can also according to father's private key, father chain's code and
Sub-key index generates sub- public key and subchain code.For example, generating sub- public key and son according to father's private key, father chain's code and sub-key index
Chain code can be realized by following two mode.First way are as follows: according to father's private key generate father's public key, further according to father's public key,
Father chain's code and sub-key index generate sub- public key and subchain code;The second way are as follows: according to father's private key, father chain's code and sub-key rope
Sub- private key and subchain code are caused into, generates sub- public key further according to sub- private key.Detailed process is discussed in detail in the following embodiments.
Before illustrating, ECC and HMAC-SHA512 and the symbol used are briefly described, as follows:
ECC (ELLiptic Curve Cryptography, Elliptic Curve Cryptography): one based on elliptic curve mathematics
Kind public key cryptography method.
HMAC-SHA512:HMAC operation, using hash algorithm SHA512, result is 512.
K: private key is indicated, type is integer
C: chain code is indicated.In the calculating process for obtaining sub-key by father's key, to prevent the sub-key father that places one's entire reliance upon close
Key introduces the extension of 32 bytes, referred to as chain code.
kpar: indicate father's private key
cpar: indicate father chain's code
Point (p): it returns and the coordinate pair that dot product operates acquisition is executed by integer p and basic point.
ser32(i): 32 signless integer i sequences are turned into 4 byte sequences, big end sequence.
ser256(p): integer p sequence is turned into 32 byte sequences, big end sequence.
serp(P): coordinate pair P=(x, y) is serialized as byte sequence using the compressed format of SEC1: (0x02 or
0x03)||ser256(x), wherein first byte depends on the y-coordinate being omitted.
parse256(P): 32 byte sequence P are converted into 256 digits, big end sequence.
Mod: modular arithmetic.
| |: a byte sequence is attached to another byte sequence end by attended operation.
Below in conjunction with attached drawing, describe in detail to the embodiment of the present invention.
Embodiment one
Fig. 1 shows the process that sub- public key and subchain code are generated according to father's public key, father chain's code and sub-key index.Such as Fig. 1
Shown, level public private key pair generation method provided in an embodiment of the present invention may include steps of:
Step S101, judges whether current sub-key index is greater than or equal to preset value, is to prompt to fail, otherwise executes
Step S102.
Father's public key and current sub- cipher key are linked in sequence by step S102.
Step S103 calculates the cryptographic Hash of connection data according to preset algorithm with father chain's code for Hash key.
Specifically, according to formula I=HMAC-SHA512 (Key=cpar, Data=serp(Kpar)||ser32(i)) it calculates
Connect the cryptographic Hash of data;
Step S104, using the data of the low order end preset length for the cryptographic Hash being calculated as subchain code.
Specifically, ci=IR, wherein ciFor subchain code, IRFor the data of the low order end preset length of cryptographic Hash I.
The data of the high order end preset length of obtained cryptographic Hash and father's public key are carried out ECC multiplying by step S105.
Specifically, Ki=parse256(IL)*Kpar, wherein ILFor the data of the high order end preset length of cryptographic Hash I.
Step S106, if the data of the high order end preset length for the cryptographic Hash being calculated are more than or equal to elliptic curve base
The rank or ECC multiplication result of point are infinite points, then follow the steps S108.
Specifically, if parse256(IL) >=n or KiIt is that infinite point thens follow the steps S108, wherein n is oval bent
The rank of line basic point.
Step S107, if the data of the high order end preset length for the cryptographic Hash being calculated are less than elliptic curve basic point
Rank and ECC multiplication result is not infinite point, thens follow the steps S109.
Specifically, if parse256(IL) < n and KiIt is not infinite point, thens follow the steps S109.
Current sub-key is indexed and is incremented by by step S108, return step S101.
Specifically, current sub-key index is added 1 certainly.
Step S109, using ECC multiplication result as sub- public key.
This embodiment offers sub- public key and subchain code is generated according to father's public key, father chain's code and sub-key index, pass through ECC
Multiplying calculates sub- public key, reduces the complexity of calculating, improves computational efficiency.
Embodiment two
Fig. 2 shows sub- private key and subchain code is generated according to father's private key, father chain's code and sub-key index, further according to sub- private key
Generate the process of sub- public key.As shown in Fig. 2, level public private key pair generation method provided in an embodiment of the present invention, may include as
Lower step:
Step S201, judges whether current sub-key index is greater than or equal to preset value, is to then follow the steps S202, otherwise
Execute step S203.
Step S202 carries out high-order cover to father's private key, and father's private key after cover is connected with current sub- cipher key sequence
It connects.
The basic point of father's private key and elliptic curve is carried out ECC multiplying by step S203, and by operation result and currently sub
Cipher key is linked in sequence.
Step S204 calculates the cryptographic Hash of connection data according to preset algorithm with father chain's code for Hash key.
Specifically, by I=HMAC-SHA512 (Key=cpar, Data=0x00 | | ser256(kpar)||ser32(i)) or
I=HMAC-SHA512 (Key=cpar, Data=serp(point(kpar))||ser32(i)) cryptographic Hash of connection data is calculated.
Step S205, using the data of the low order end preset length of obtained cryptographic Hash as subchain code.
Specifically, ci=IR, wherein ciFor subchain code, IRFor the data of the low order end preset length of cryptographic Hash I.
Step S206, using the rank of elliptic curve basic point as mould, by the data of the high order end preset length of obtained cryptographic Hash
Modular arithmetic is done with the product of father's private key before cover.
Specifically, ki=parse256(IL)*kpar(modn)。
Step S207, if the data of the high order end preset length of obtained cryptographic Hash are more than or equal to elliptic curve basic point
The value of rank or modular arithmetic is 0, thens follow the steps S209.
Specifically, if parse256(IL) >=n or ki=0, then follow the steps S209.
Step S208, if the data of the high order end preset length of obtained cryptographic Hash are less than the rank of elliptic curve basic point simultaneously
And the value of modular arithmetic is not 0, thens follow the steps S210;.
Specifically, if parse256(IL) < n and ki!=0, then follow the steps S210.
Current sub-key is indexed and is incremented by by step S209, return step S201.
Specifically, current sub-key is done quoted from adding 1.
Step S210, using modular arithmetic result as sub- private key.
The basic point of sub- private key and elliptic curve is done ECC multiplying, obtains sub- public key by step S211.
This embodiment offers generate sub- private key, sub- public key and subchain code according to father's private key, father chain's code and sub-key index.
Embodiment three
Fig. 3, which is shown, generates father's public key according to father's private key, generates sub- public key and subchain code further according to father's public key and father chain's code
Process, as shown in figure 3, level public private key pair generation method provided in an embodiment of the present invention, may include steps of:
The basic point of father's private key and elliptic curve is done the operation of ECC multiplication, obtains father's public key by step S301.
Specifically, Ki=point (ki)。
Step S302, judges whether current sub- cipher key is more than or equal to preset value, is to prompt to fail, otherwise executes step
Rapid S303.
Step S303, will calculate resulting father's public key and current sub- cipher key is linked in sequence;
Step S304 calculates the cryptographic Hash of connection data according to preset algorithm with father chain's code for Hash key.
Specifically, according to formula I=HMAC-SHA512 (Key=cpar, Data=serp(Kpar)||ser32(i)) it calculates
Connect the cryptographic Hash of data.
Step S305, using the data of the low order end preset length of obtained cryptographic Hash as subchain code.
Specifically, ci=IR, wherein ciFor subchain code, IRFor the data of the low order end preset length of cryptographic Hash I.
The data of the high order end preset length of obtained cryptographic Hash and father's public key are carried out ECC multiplying by step S306.
Specifically, Ki=parse256(IL)*Kpar, wherein ILFor the data of the high order end preset length of cryptographic Hash I.
Step S307, if the data of the high order end preset length for the cryptographic Hash being calculated are more than or equal to elliptic curve base
The rank or ECC multiplication result of point are infinite points, then follow the steps S309.
Specifically, if parse256(IL) >=n or KiIt is infinite point, thens follow the steps S309.
Step S308, if the data of the high order end preset length for the cryptographic Hash being calculated are less than elliptic curve basic point
Rank and ECC multiplication result is not infinite point, thens follow the steps S310.
Specifically, if parse256(IL) < n and KiIt is not infinite point, thens follow the steps S310.
Current sub-key is indexed and is incremented by by step S309, return step S302.
Specifically, current sub-key index is added 1 certainly.
Step S310, using ECC multiplication result as sub- public key.
This embodiment offers according to father's private key, father chain's code and sub-key index generate father's public key, sub- public key and subchain code,
Sub- public key is calculated by ECC multiplying, the complexity of calculating is reduced, improves computational efficiency.
Corresponding to the above method embodiment, the embodiment of the invention also provides a kind of level public private key pair devices, such as
Shown in Fig. 4, which includes:
First comparing unit 411, for comparing whether current sub-key index is more than or equal to preset value;
First prompt unit 412 is when being, to prompt failure for the first comparing unit 411;
When first connection unit 413 for the first comparing unit 411 is no, father's public key and sub-key indexed sequential are connected
It connects to obtain the first connection data;
First hash units 414, for, for Hash key, calculating the first connection unit according to preset algorithm with father chain's code
The cryptographic Hash of 413 the first obtained connection data;
First division unit 415, for divide the first splicing data that the first hash units 414 obtain cryptographic Hash it is low
The data of position end preset length are as subchain code;Divide the cryptographic Hash for the first splicing data that the first hash units 414 obtain
The data of high order end preset length are as the first data;The sum of low order end preset length and high order end preset length connect for first
The cryptographic Hash length of data;
First arithmetic element 416 obtains the first operation result for doing ECC multiplying to the first data and father's public key;
First selecting unit 417 is more than or equal to rank or the first operation result of elliptic curve basic point for the first data
When being infinite point, the first increment unit 418 is selected;First data are less than the rank of elliptic curve basic point and the first operation result
When not being infinite point, first key acquiring unit is selected;
Sub-key is indexed and is incremented by by the first increment unit 418;
First key acquiring unit 419, using the first operation result as sub- public key.
Optionally, above-mentioned apparatus can also be according to father's private key, and father chain's code and sub-key index generate sub- private key, sub- public key and
Subchain code, comprising:
Second comparing unit, for comparing whether current sub-key index is more than or equal to preset value;
Second connection unit is high-order cover to be carried out to father's private key, by the benefit when being for the second comparing unit result
Father's private key behind position connect to obtain the second connection data with sub-key indexed sequential;
Second hash units, for calculating the second connection data according to preset algorithm using father chain's code as Hash key
Cryptographic Hash;
Second division unit, the low order end of the cryptographic Hash of the second connection data for being obtained to second hash units
For the data of preset length as subchain code, the high order end for dividing the cryptographic Hash for the second connection data that the second hash units obtain is pre-
If the data of length are as the second data;The Kazakhstan that the sum of low order end preset length and high order end preset length connect data for second
The length of uncommon value;
Second arithmetic element, for using the rank of elliptic curve basic point as modulus, to the father's private key and the second data before cover
Product do modular arithmetic, obtain the second operation result;
Second selecting unit, is more than or equal to the rank of elliptic curve basic point for the second data or the second operation result is 0
When, select the second increment unit;Second data are less than the rank of elliptic curve basic point and the second operation result when not being 0, selection
Second key acquiring unit;
Sub-key is indexed and is incremented by by the second increment unit;
Second key acquiring unit, the second operation result that the second arithmetic element is obtained is as sub- private key;
The basic point of sub- private key and elliptic curve is done ECC multiplying, obtains third operation result by third arithmetic element;
Third key acquiring unit, the third operation result that third arithmetic element is obtained is as sub- public key.
Third connection unit, for the second comparing unit result be it is no when, the basic point of father's private key and elliptic curve is done into ECC
ECC multiplication result connect to obtain third connection data with sub-key indexed sequential by multiplying;
Third hash units, for calculating third connection data according to preset algorithm using father chain's code as Hash key
Cryptographic Hash;
Third division unit, it is pre- for dividing the low order end of cryptographic Hash for the third connection data that third hash units obtain
If the data of length, as subchain code, the high order end for dividing the cryptographic Hash for the third connection data that third hash units obtain is default
The data of length are as third data;The sum of low order end preset length and high order end preset length connect the Hash of data for third
The length of value;
4th arithmetic element, for being done to the product of father's private key and third data using the rank of elliptic curve basic point as modulus
Modular arithmetic obtains the 4th operation result;
Third selecting unit, is more than or equal to the rank of elliptic curve basic point for third data or the 4th operation result is 0
When, select third increment unit;Third data are less than the rank of elliptic curve basic point and the 4th operation result when not being 0, selection
4th key acquiring unit;
Third increment unit is incremented by for indexing sub-key;
4th key acquiring unit, the 4th operation result for obtaining the 4th arithmetic element is as sub- private key;
5th arithmetic element obtains the 5th operation knot for the basic point of sub- private key and elliptic curve to be done ECC multiplying
Fruit;
5th key acquiring unit, the 5th operation result that the 5th arithmetic element is obtained is as sub- public key.
In the present embodiment, described device can also generate father's public key according to father's private key, father chain's code and sub-key index, and son is public
Key and subchain code, comprising:
6th arithmetic element does ECC multiplying for the basic point to father's private key and elliptic curve, obtains the 6th operation knot
Fruit, as father's public key;
Third comparing unit, for comparing whether current sub-key index is more than or equal to preset value;
Second prompt unit, the result for third comparing unit are when being, to prompt failure;
4th connection unit, for third comparing unit result be it is no when, by the resulting father's public key of the 6th arithmetic element with
The connection of sub-key indexed sequential obtains the 4th connection data;
4th hash units, for it is single to calculate the 4th connection according to preset algorithm using father chain's code as Hash key
The cryptographic Hash for the 4th connection data that member obtains;
4th division unit, it is pre- for dividing the low order end of cryptographic Hash for the 4th connection data that the 4th hash units obtain
If the data of length are as subchain code, the data of high order end preset length are as the 4th data;Low order end preset length and a high position
Hold the sum of preset length for the length of the cryptographic Hash of the 4th connection data;
7th arithmetic element is obtained for the 4th data and the resulting father's public key of the 6th arithmetic element to be done ECC multiplying
To the 7th operation result;
4th selecting unit is more than or equal to the rank of elliptic curve basic point for the 4th data or the 7th operation result is nothing
When poor far point, the 4th increment unit is selected;4th data are less than the rank of elliptic curve basic point and the 7th operation result is not nothing
When poor far point, the 6th key acquiring unit is selected;
4th increment unit, cipher key index is incremented by;
6th key acquiring unit, the 7th operation result that the 7th arithmetic element is obtained is as sub- public key.
Present embodiments provide a kind of level public private key pair generating means, for according to father's private key, father's public key, father chain code with
And sub-key index generates sub- private key, sub- public key and subchain code, and under conditions of same security intensity, by ECC multiplying,
The complexity calculated in sub- public key generating process is reduced, computational efficiency is improved.
Further, the embodiment of the invention also provides a kind of computer readable storage mediums, and it is public to be stored with above-mentioned level
Private will be to the computer software instructions used in generating means.
Level public private key pair generation method and device provided by the embodiment of the present invention, technical characteristic having the same,
It can solve identical technical problem, reach identical technical effect.
It should be noted that in embodiment provided by the present invention, it should be understood that disclosed device and method, it can
To realize by another way.The apparatus embodiments described above are merely exemplary, for example, the unit is drawn
Point, only a kind of logical function partition, there may be another division manner in actual implementation, in another example, multiple units or group
Part can be combined or can be integrated into another system, or some features can be ignored or not executed.It is described to be used as separation unit
The unit that part illustrates may or may not be physically separated, and component shown as a unit can be or can also
Not to be physical unit, it can it is in one place, or may be distributed over multiple network units.It can be according to reality
Needs some or all of the units may be selected to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in embodiment provided by the invention can integrate in one processing unit, it can also
To be that each unit physically exists alone, can also be integrated in one unit with two or more units.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product
It is stored in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially in other words
The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter
Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a
People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention.
And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited
The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.
In addition, term " first ", " second ", " third " are used for description purposes only, it is not understood to indicate or imply phase
To importance.
Finally, it should be noted that embodiment described above, only a specific embodiment of the invention, to illustrate the present invention
Technical solution, rather than its limitations, scope of protection of the present invention is not limited thereto, although with reference to the foregoing embodiments to this hair
It is bright to be described in detail, those skilled in the art should understand that: anyone skilled in the art
In the technical scope disclosed by the present invention, it can still modify to technical solution documented by previous embodiment or can be light
It is readily conceivable that variation or equivalent replacement of some of the technical features;And these modifications, variation or replacement, do not make
The essence of corresponding technical solution is detached from the spirit and scope of technical solution of the embodiment of the present invention, should all cover in protection of the invention
Within the scope of.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. a kind of level public private key pair generation method, which is characterized in that according to father's public key, father's private key, father chain's code and sub-key rope
Cause into sub- public key and subchain code, which comprises
Father's public key is connect to obtain the first connection data with the sub-key indexed sequential;
With father chain's code for Hash key, the cryptographic Hash of the first connection data is calculated according to preset algorithm;
The cryptographic Hash of the first connection data is divided, subchain code and the first data are obtained;
ECC multiplying is carried out to first data and father's public key, obtains the first operation result;
If first data are less than the rank of default elliptic curve basic point and first operation result is not infinite point,
Then using first operation result as sub- public key;
If first data are more than or equal to the rank of default elliptic curve basic point or first operation result is infinity
Point, then by the sub-key index be incremented by, according to father's public key, the father chain code and be incremented by after sub-key index give birth to again
At sub- public key and subchain code.
2. the method according to claim 1, wherein being connect in father's public key with the sub-key indexed sequential
Before the step of obtaining the first connection data, the method also includes:
Judge whether the sub-key index is greater than or equal to preset value;
If so, prompt failure;
The step of obtaining the first connection data is connect with the sub-key indexed sequential if not, executing father's public key.
3. the method according to claim 1, wherein the cryptographic Hash to the first connection data is drawn
The step of dividing, obtaining subchain code and the first data, comprising:
Using the data of the low order end preset length of the cryptographic Hash of the first connection data as subchain code;Described first is connected
The data of the high order end preset length of the cryptographic Hash of data are as the first data;The low order end preset length and the high order end
The sum of preset length is the length of the cryptographic Hash of the first connection data.
4. the method according to claim 1, wherein the method also includes:
High-order cover is carried out to father's private key, father's private key after the cover is connect to obtain with the sub-key indexed sequential
Second connection data;
With father chain's code for Hash key, the cryptographic Hash of the second connection data is calculated according to preset algorithm;
The cryptographic Hash of the second connection data is divided, subchain code and the second data are obtained;
Using the rank of the elliptic curve basic point as modulus, mould is done to the product of father's private key and second data before the cover
Operation obtains the second operation result;
If second data are less than the rank of the elliptic curve basic point and second operation result is not 0, by institute
The second operation result is stated as sub- private key;
If second data are more than or equal to the rank of the elliptic curve basic point or second operation result is 0, will
Sub-key index is incremented by, according to father's private key, father chain code and it is described be incremented by after sub-key index regenerate
Sub- private key and subchain code;
ECC multiplying is done to the basic point of the sub- private key and the elliptic curve, obtains sub- public key.
5. according to the method described in claim 4, it is characterized in that, high-order cover is carried out to father's private key described, by institute
Before father's private key after stating cover connect to obtain the second connection data step with the sub-key indexed sequential, the method is also wrapped
It includes:
Judge whether the sub-key index is greater than or equal to preset value;
If so, execution is described to carry out high-order cover to father's private key, father's private key after cover is connect with sub-key indexed sequential
The step of obtaining the second connection data;
If not, the basic point of father's private key and the elliptic curve is done ECC multiplying, by the ECC multiplying knot
Fruit connect to obtain the second connection data with sub-key indexed sequential.
6. according to the method described in claim 4, it is characterized in that, the cryptographic Hash to the second connection data is drawn
The step of dividing, obtaining subchain code and the second data, comprising:
Using the data of the low order end preset length of the cryptographic Hash of the second connection data as subchain code;Described second is connected
The data of the high order end preset length of the cryptographic Hash of data are as the second data;The low order end preset length and the high order end
The sum of preset length is the length of the cryptographic Hash of the second connection data.
7. the method according to claim 1, wherein the method also includes:
ECC multiplying is done to the basic point of father's private key and the elliptic curve, obtains father's public key;
Father's public key is connect to obtain third connection data with the sub-key indexed sequential;
With father chain's code for Hash key, the cryptographic Hash of the third connection data is calculated according to preset algorithm;
The cryptographic Hash of third connection data is divided, subchain code and third data are obtained;
ECC multiplying is carried out to the third data and father's public key, obtains third operation result;
If the third data are less than the rank of the elliptic curve basic point and the third operation result is not infinite point,
Then using the third operation result as sub- public key;
If the third data are more than or equal to the rank of the elliptic curve basic point or the third operation result is infinity
Point, then by the sub-key index be incremented by, according to father's public key, the father chain code and it is described be incremented by after sub-key index weight
Newly-generated sub- public key and subchain code.
8. the method according to the description of claim 7 is characterized in that being connect in father's public key with the sub-key indexed sequential
Before the step of obtaining third connection data, the method also includes:
Judge whether the sub-key index is greater than or equal to preset value;
If so, prompt failure;
If not, executing father's public key connect the step of obtaining third connection data with the sub-key indexed sequential.
9. the method according to the description of claim 7 is characterized in that the cryptographic Hash to third connection data is drawn
The step of dividing, obtaining subchain code and third data, comprising:
Using the data of the low order end preset length of the cryptographic Hash of third connection data as subchain code;The third is connected
The data of the high order end preset length of the cryptographic Hash of data are as third data;The low order end preset length and the high order end
The sum of preset length is the length for the cryptographic Hash that the third connects data.
10. a kind of level public private key pair generating means, which is characterized in that according to father's public key, father's private key, father chain's code and sub-key rope
It causes into sub- public key and subchain code, described device includes:
First connection unit obtains the first connection data for father's public key to be connect with the sub-key indexed sequential;
First hash units, for, for Hash key, calculating the first connection data according to preset algorithm with father chain's code
Cryptographic Hash;
First division unit divides for the cryptographic Hash to the first connection data, obtains subchain code and the first data;
First arithmetic element obtains the first operation knot for carrying out ECC multiplying to first data and father's public key
Fruit;
First selecting unit is more than or equal to the basic point rank for presetting elliptic curve or first operation for first data
The result is that selecting the first increment unit when infinite point;First data are less than the basic point rank of default elliptic curve and institute
When to state the first operation result not be infinite point, first key acquiring unit is selected;
First key acquiring unit, using first operation result as sub- public key;
First increment unit, by the sub-key index be incremented by, according to father's public key, the father chain code and be incremented by after son it is close
Key index regenerates sub- public key and subchain code.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810932146.8A CN109067526A (en) | 2018-08-15 | 2018-08-15 | Level public private key pair generation method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810932146.8A CN109067526A (en) | 2018-08-15 | 2018-08-15 | Level public private key pair generation method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109067526A true CN109067526A (en) | 2018-12-21 |
Family
ID=64686934
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810932146.8A Pending CN109067526A (en) | 2018-08-15 | 2018-08-15 | Level public private key pair generation method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109067526A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110351292A (en) * | 2019-03-05 | 2019-10-18 | 腾讯科技(深圳)有限公司 | Private key management method, device, equipment and storage medium |
CN111447063A (en) * | 2020-05-13 | 2020-07-24 | 江苏恒宝智能系统技术有限公司 | Method and device for generating cold wallet derived key |
CN112184216A (en) * | 2020-08-20 | 2021-01-05 | 深圳华数云计算技术有限公司 | Digital currency transaction method, device, digital currency transaction system and storage medium |
CN114039726A (en) * | 2021-11-08 | 2022-02-11 | 腾讯科技(深圳)有限公司 | Key generation method, key acquisition method, related device and medium |
CN114584291A (en) * | 2022-02-18 | 2022-06-03 | 杭州代码狗科技有限公司 | Key protection method, device, equipment and storage medium based on HMAC algorithm |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100088523A1 (en) * | 2008-10-07 | 2010-04-08 | Microsoft Corporation | Trusted platform module security |
US20140281554A1 (en) * | 2013-03-13 | 2014-09-18 | Atmel Corporation | Generating keys using secure hardware |
CN106411506A (en) * | 2016-08-31 | 2017-02-15 | 飞天诚信科技股份有限公司 | Key derivation method and device applicable to digital currency |
CN106850216A (en) * | 2017-03-31 | 2017-06-13 | 西安电子科技大学 | A kind of key revocation method of key management tree in cloud database |
WO2017145049A1 (en) * | 2016-02-23 | 2017-08-31 | nChain Holdings Limited | Consolidated blockchain-based data transfer control method and system |
CN107480986A (en) * | 2017-08-14 | 2017-12-15 | 飞天诚信科技股份有限公司 | A kind of method and hardware wallet that digital cash wallet is realized using hardware |
CN108199835A (en) * | 2018-01-19 | 2018-06-22 | 北京江南天安科技有限公司 | A kind of multi-party joint private key decryption method and system |
-
2018
- 2018-08-15 CN CN201810932146.8A patent/CN109067526A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100088523A1 (en) * | 2008-10-07 | 2010-04-08 | Microsoft Corporation | Trusted platform module security |
US20140281554A1 (en) * | 2013-03-13 | 2014-09-18 | Atmel Corporation | Generating keys using secure hardware |
WO2017145049A1 (en) * | 2016-02-23 | 2017-08-31 | nChain Holdings Limited | Consolidated blockchain-based data transfer control method and system |
CN106411506A (en) * | 2016-08-31 | 2017-02-15 | 飞天诚信科技股份有限公司 | Key derivation method and device applicable to digital currency |
CN106850216A (en) * | 2017-03-31 | 2017-06-13 | 西安电子科技大学 | A kind of key revocation method of key management tree in cloud database |
CN107480986A (en) * | 2017-08-14 | 2017-12-15 | 飞天诚信科技股份有限公司 | A kind of method and hardware wallet that digital cash wallet is realized using hardware |
CN108199835A (en) * | 2018-01-19 | 2018-06-22 | 北京江南天安科技有限公司 | A kind of multi-party joint private key decryption method and system |
Non-Patent Citations (1)
Title |
---|
PASCAL URIEN: ""Towards secure elements for trusted transactions in blockchain and blochchain IoT (BIoT) Platforms"", 《2018 FOURTH INTERNATIONAL CONFERENCE ON MOBILE AND SECURE SERVICES (MOBISECSERV)》 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110351292A (en) * | 2019-03-05 | 2019-10-18 | 腾讯科技(深圳)有限公司 | Private key management method, device, equipment and storage medium |
CN110351292B (en) * | 2019-03-05 | 2020-08-25 | 腾讯科技(深圳)有限公司 | Private key management method, device, equipment and storage medium |
CN111447063A (en) * | 2020-05-13 | 2020-07-24 | 江苏恒宝智能系统技术有限公司 | Method and device for generating cold wallet derived key |
CN111447063B (en) * | 2020-05-13 | 2021-02-26 | 江苏恒宝智能系统技术有限公司 | Method and device for generating cold wallet derived key |
CN112184216A (en) * | 2020-08-20 | 2021-01-05 | 深圳华数云计算技术有限公司 | Digital currency transaction method, device, digital currency transaction system and storage medium |
CN114039726A (en) * | 2021-11-08 | 2022-02-11 | 腾讯科技(深圳)有限公司 | Key generation method, key acquisition method, related device and medium |
CN114584291A (en) * | 2022-02-18 | 2022-06-03 | 杭州代码狗科技有限公司 | Key protection method, device, equipment and storage medium based on HMAC algorithm |
CN114584291B (en) * | 2022-02-18 | 2023-12-29 | 杭州代码狗科技有限公司 | Key protection method, device, equipment and storage medium based on HMAC algorithm |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109067526A (en) | Level public private key pair generation method and device | |
CN108540291B (en) | Identity-based data integrity verification method in cloud storage | |
CN105245343B (en) | A kind of online static signature system and method based on multivariable cryptographic technique | |
CN110069939A (en) | Encryption data consistency desired result method, apparatus, computer equipment and storage medium | |
CN109272316B (en) | Block implementing method and system based on block chain network | |
CN110311776A (en) | Data processing method, device, computer equipment and storage medium | |
CN114491613A (en) | Efficient searchable agent privacy set intersection method and device | |
CN108847931A (en) | Block chain key generation method and device based on biometric | |
CN104753666B (en) | Cipher key processing method and device | |
CN110751284B (en) | Heterogeneous information network embedding method and device, electronic equipment and storage medium | |
CN109412813B (en) | The endorsement method of elliptic curve, sign test method and apparatus | |
JP3551853B2 (en) | Secure parameter generation apparatus, generation method, and recording medium in algebraic curve cryptography having a definition equation of the form αYa + βXb + 1 = 0 | |
CN116318660A (en) | Message expansion and compression method and related device | |
CN107204856B (en) | A kind of method and device detecting elliptic curve loophole | |
CN110515591A (en) | Random digit generation method and device based on block chain | |
CN105956921A (en) | Method and device for selecting bankcard number by user himself/herself | |
CN109951275A (en) | Key generation method, device, computer equipment and storage medium | |
CN109614577A (en) | A kind of Burgers equation solution method and device | |
CN108599951A (en) | Encryption method and device | |
CN115225266A (en) | Multi-party threshold privacy set intersection method and system based on cloud server assistance | |
CN108847929A (en) | The thresholding restoration methods and system of private key storage | |
CN108846672B (en) | Personalized address generation method and device, electronic equipment and storage medium | |
CN112861189A (en) | Signature generation method, signature verification device, signature verification equipment and medium | |
CN107483204B (en) | Optimization processing method and device for SM2 cryptographic algorithm | |
CN113992329B (en) | SM 2-based transaction signature method, device, equipment and medium under block chain |
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 | ||
AD01 | Patent right deemed abandoned |
Effective date of abandoning: 20221101 |
|
AD01 | Patent right deemed abandoned |