A method of the management of the key based on crypto chip
Technical field
The present invention relates to data structure techniques field, the method for specially a kind of key management based on crypto chip.
Background technique
Crypto chip etc. related fieldss, in order to realize the safe and secret of information, people are mainly using the means of encryption
Carry out confidential information, and the core encrypted is the privacy problem of key, key management directly affects the safety of communication.Privacy sharing
It is a kind of method that can solve cipher key management considerations, original secret can be divided into several shares by privacy sharing, then will
These shares give several people or tissue keeping.When needing to restore original private again, all required parts
Volume is recombined.If these shares when fractionation and recombination can part share first combine, then combination obtains
New share can continue to combine, to form the combination of hierarchical.In this process, the data of these shares are deposited
Storage, can use tree structure, but the storage organization of traditional tree such as child's chained list representation, parents' representation and brother
The modes such as child's chained list representation this application seem efficiency be not it is very high, especially in the more feelings of the quantity of share
Than more prominent under condition.
Summary of the invention
In view of the above-mentioned problems, the present invention provides a kind of method of key management based on crypto chip comprising key
The method of management and restructuring allocation, splits and the execution efficiency of recombination is high.
Its technical solution is such that
A method of the management of the key based on crypto chip is mainly used for the key management of crypto chip, feature
It is, comprising the following steps:
(1) it defines:
Crypto chip receives original private k, and original private k includes several share { k1, k2, k3..., kn};
(2) it splits:
Step A1: the original private k, which carries out function fractionation operation using Lagrange interpolation polynomial, obtains each part
Volume kij, the aggregate form of the share after fractionation are as follows: { k1r, k(r+1)2, k(t+1)u..., kvnWherein 1≤r < t, t < u≤v, v≤
N, r=2, v=4, n=5;
Step A2: several shares obtained after step A1 is split continue to tear open using Lagrange interpolation polynomial
Point, kvn{ k can be split intovy, k(y+1)z, k(z+1)a..., kbn, wherein v≤y < z, z < a < b, b≤n;
Step A3: repeating above step A2, until splitting terminates;
(3) it stores
Share set after fractionation is stored with tree structure, definition has tree G, and node number is n, each knot in tree
Point stores the information of each share, and each node is with four-tuple < Dic, Di, Di5, Die> form composition sequence list stored,
Define DicIndicate node DiThe locating number of plies, DiIndicate DiThe specific node data of node, Di5And DieRespectively indicate DiNode
Child node is in Dic+ 1 layer of beginning serial number from left to right and end serial number, 0≤i≤n;Original private k after fractionation can use tree G
It can store are as follows: f (G)={ < D1c, D1, D1s, Dle>,<D2c, D2, D2s, D2e> ..., < Dic, Di, Dis, Die>...,<Dnc, Dn,
Dns, Dne>, all four-tuple<D in f (G)ic, Di, Dis, Die>: be all according to tree G node from top to bottom, from a left side to
Right sequence is successively stored, i.e., is arranged by the sequence of the number of plies from small to large, if DisAnd DieEqual to 0, then it represents that DiNode
There is no child node;
(4) distribute: needing to split obtained each share after original private k fractionation and give each custodian:
Defining Travel (G) indicates that traversal sets all leaf nodes in G and exports ergodic sequence, and Travel (G) will set G's
Each node in the four-tuple table of f (G) is examined successively whether meet Dis=0 and Die=0, it will be corresponding if meeting
DiOutput, then by all D of outputiIt is distributed to each custodian;
(5) restore: the tree G obtained after original private k is split reassembles into original password k, comprising the following steps:
Step B1: reading the tree G in crypto chip, owns < D in f (G)ic, Di, Dis, Die> form four-tuple in
Successively obtain all Dis=0 and Die=0 Di;
Step B2: by all D of acquirementiIt is compared with all shares provided by recovery original private k are attempted, if
Lack in the share of offer or increase any share and thinks this time to restore to be unauthorized, recovery process termination;
Step B3: the share merging that user provides is reverted into upper one layer of share, the share of recovery and f (G) are compared
It is right, restore to combine and compare successfully and merge recovery if the share restored is identical as f (G), otherwise should terminate recovery journey
Sequence;
Step B4: repeating step B3, until original private k recovery terminates.
Further, calculate that father node, restoring the calculating of upper one layer of share, steps are as follows:
Step C1: defining Parent (G, M) indicates to calculate the father node of M node in tree G;
Step C2: successively more each D in f (G)iWhether value is equal to M;
Step C3: if not finding node M in f (G), M node is not present in tree G, and algorithm terminates;
Step C4: if finding M node in f (G), setting σ (G, A) is the same level knot for calculating A node in f (G)
Arrangement serial number in point;
The number of plies for defining M node is McIf Mc- 1=0, then M node is the root node for setting G, so M node is tied without father
Point;If Mc- 1 > 0 then successively compares and all in f (G) meets Dic=Mc- 1 DiWhether node meets Dis≤ σ (G, M)≤
DieIf met, Parent (G, M)=Di, if there is no some DiNode meets Dis≤ σ (G, M)≤Die, then f (G)
Store mistake.
Calculate child node, steps are as follows for the calculating of i.e. next layer share:
Step D1: defining Child (G, M) indicates to calculate the child node of M node in tree G;
Step D2: successively more each D in f (G)iWhether value is equal to M;
Step D3: if not finding M node in f (G), M node is not present in tree G, and algorithm terminates;
Step D4: if finding M node in f (G), four-tuple < M of M node is extractedc, M, Ms, Me>, obtain M knot
The locating number of plies M of pointc, MsAnd MeDistribution indicates the child node of M node in Mc+ 1 layer of beginning serial number from left to right and end sequence
Number, if MsAnd MeIt is equal to 0, then M node terminates without child node, algorithm;
Step D5: Child (G, M)={ D is calculatedj, Dj+1, Dj+2..., Dk, wherein the corresponding D of each nodejc,
D(j+1)c, D(j+2)c..., Dkc=Mc+ 1, Ms≤ j, j+1, j+2 ..., k≤Me。
Defining Height (G) indicates to calculate the height of tree G, calculates the height extraction < D of tree Gnc, Dn, Dns, Dne> in layer
Number DncFor the height of the tree, i.e. Height (G)=Dnc。
The beneficial effects of the present invention are: being had the advantage that using the storage organization of tree G of the invention
(1) hierachy number of the height or node that calculate tree is more efficient than traditional storage organization, and Height (G) is indicated
The height of tree G or the hierachy number of node G are calculated, using the storage organization of tree G, Height (G) is calculated very simply, only needs
Directly to extract < Dnc, Dn, Dns, Dne> in hierachy number Dnc, i.e. Height (G)=Dnc.The time complexity of the algorithmic procedure is
O (1), efficiency are apparently higher than other existing various storage modes.Locating for the height or node set by the above process
Hierachy number can be calculated when restoring original private according to the hierachy number amount for setting or being presently in node it is whole
The progress situation of a recovery process avoids the occurrence of to be supplied to the enough information feedbacks of operator and is unable to estimate recovery process
The case where progress.
(2) storage organization proposed by the present invention is stored using sequence list, has sequence list itself can be according to subscript
Number is written and is read the random access capabilities of data, greatly improves the efficiency of access, compared to traditional child's chained list table
Show that method, fraternal child's chained list are this more quick using the storage mode of chained list.In addition, relatively traditional child's chained list indicates
Method, this storage mode using chained list of fraternal child's chained list, it is empty that storage method proposed by the present invention does not need additional storage
Between store junction associated address information, to improve the utilization rate of memory space.Storage organization proposed by the present invention and side
Method has the higher service efficiency of traditional storage method over time and space.
Detailed description of the invention
Fig. 1 is the structure of the tree of embodiment 1.
Fig. 2 is the structure of the tree of embodiment 2.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments,
The present invention will be described in further detail.
A method of the management of the key based on crypto chip is mainly used for the key management of crypto chip, feature
It is, comprising the following steps:
(1) it defines:
Crypto chip receives original private k, and original private k includes several share { k1, k2, k3..., kn};
(2) it splits:
Step A1: the original private k, which carries out function fractionation operation using Lagrange interpolation polynomial, obtains each part
Volume kij, the aggregate form of the share after fractionation are as follows: { k1r, k(r+1)2, k(t+1)u..., kvnWherein 1≤r < t, t < u≤v, v≤
N, r=2, v=4, n=5;
Step A2: several shares obtained after step A1 is split continue to tear open using Lagrange interpolation polynomial
Point, kvn{ k can be split intovy, k(y+1)z, k(z+1)a..., kbn, wherein v≤y < z, z < a < b, b≤n;
Step A3: repeating above step A2, until splitting terminates;
(3) it stores
Share set after fractionation is stored with tree structure, definition has tree G, and node number is n, each knot in tree
Point stores the information of each share, and each node is with four-tuple < Dic, Di, Dis, Die> form composition sequence list stored,
Define DicIndicate node DiThe locating number of plies, DiIndicate DiThe specific node data of node, DisAnd DieRespectively indicate DiNode
Child node is in Dic+ 1 layer of beginning serial number from left to right and end serial number, 0≤i≤n;Original private k after fractionation can use tree G
It can store are as follows: f (G)={ < D1c, D1, D1s, Dle>,<D2c, D2, D2s, D2e> ..., < Dic, Di, Dis, Die>...,<Dnc, Dn,
Dns, Dne>, all four-tuple<D in f (G)ic, Di, DiS, Die>: be all according to tree G node from top to bottom, from a left side to
Right sequence is successively stored, i.e., is arranged by the sequence of the number of plies from small to large, if DisAnd DieEqual to 0, then it represents that DiNode
There is no child node;
(4) distribute: needing to split obtained each share after original private k fractionation and give each custodian:
Defining Travel (G) indicates that traversal sets all leaf nodes in G and exports ergodic sequence, and Travel (G) will set G's
Each node in the four-tuple table of f (G) is examined successively whether meet Dis=0 and Die=0, it will be corresponding if meeting
DiOutput, then by all D of outputiIt is distributed to each custodian;
(5) restore: the tree G obtained after original private k is split reassembles into original password k, comprising the following steps:
Step B1: reading the tree G in crypto chip, owns < D in f (G)ic, Di, Dis, Die> form four-tuple in
Successively obtain all Dis=0 and Die:=0 Di;
Step B2: by all D of acquirementiIt is compared with all shares provided by recovery original private k are attempted, if
Lack in the share of offer or increase any share and thinks this time to restore to be unauthorized, recovery process termination;
Step B3: the share merging that user provides is reverted into upper one layer of share, the share of recovery and f (G) are compared
It is right, restore to combine and compare successfully and merge recovery if the share restored is identical as f (G), otherwise should terminate recovery journey
Sequence;
Step B4: repeating step B3, until original private k recovery terminates.
Calculate that father node, restoring the calculating of upper one layer of share, steps are as follows:
Step C1: defining Parent (G, M) indicates to calculate the father node of M node in tree G;
Step C2: successively more each D in f (G)iWhether value is equal to M;
Step C3: if not finding node M in f (G), M node is not present in tree G, and algorithm terminates;
Step C4: if finding M node in f (G), setting σ (G, A) is the same level knot for calculating A node in f (G)
Arrangement serial number in point;
The number of plies for defining M node is McIf Mc- 1=0, then M node is the root node for setting G, so M node is tied without father
Point;If Mc- 1 > 0 then successively compares and all in f (G) meets Dic=Mc- 1 DiWhether node meets Dis≤ σ (G, M)≤
DieIf met, Parent (G, M)=Di, if there is no some DiNode meets Dis≤ σ (G, M)≤Die, then f (G)
Store mistake.
Calculate child node, steps are as follows for the calculating of i.e. next layer share:
Step D1: defining Child (G, M) indicates to calculate the child node of M node in tree G;
Step D2: successively more each D in f (G)iWhether value is equal to M;
Step D3: if not finding M node in f (G), M node is not present in tree G, and algorithm terminates;
Step D4: if finding M node in f (G), four-tuple < M of M node is extractedc, M, Ms, Me>, obtain M knot
The locating number of plies M of pointc, MsAnd MeDistribution indicates the child node of M node in Mc+ 1 layer of beginning serial number from left to right and end sequence
Number, if MsAnd MeIt is equal to 0, then M node terminates without child node, algorithm;
Step D5: Child (G, M)={ D is calculatedj, Dj+1, Dj+2..., Dk, wherein the corresponding D of each nodejc,
D(j+1)c, D(j+2)c..., Dkc=Mc+ 1, Ms≤ j, j+1, j+2 ..., k≤Me。
Defining Height (G) indicates to calculate the height of tree G, calculates the height extraction < D of tree Gnc, Dn, Dns, Dne> in layer
Number DncFor the height of the tree, i.e. Height (G)=Dnc。
The beneficial effects of the present invention are: being had the advantage that using the storage organization of tree G of the invention
(1) hierachy number of the height or node that calculate tree is more efficient than traditional storage organization, and Height (G) is indicated
The height of tree G or the hierachy number of node G are calculated, using the storage organization of tree G, Height (G) is calculated very simply, only needs
Directly to extract < Dnc, Dn, Dns, Dne> in hierachy number Dnc, i.e. Height (G)=Dnc.The time complexity of the algorithmic procedure is
O (1), efficiency are apparently higher than other existing various storage modes.Locating for the height or node set by the above process
Hierachy number can be calculated when restoring original private according to the hierachy number amount for setting or being presently in node it is whole
The progress situation of a recovery process avoids the occurrence of to be supplied to the enough information feedbacks of operator and is unable to estimate recovery process
The case where progress.
(2) storage organization proposed by the present invention is stored using sequence list, has sequence list itself can be according to subscript
Number is written and is read the random access capabilities of data, greatly improves the efficiency of access, compared to traditional child's chained list table
Show that method, fraternal child's chained list are this more quick using the storage mode of chained list.In addition, relatively traditional child's chained list indicates
Method, this storage mode using chained list of fraternal child's chained list, it is empty that storage method proposed by the present invention does not need additional storage
Between store junction associated address information, to improve the utilization rate of memory space.Storage organization proposed by the present invention and side
Method has the higher service efficiency of traditional storage method over time and space.
Embodiment 1, there are secret k, are split as (k, k using method of the invention12, k3, k45, k1, k2, k4, k5, with tree
Structure is as described in Figure 1, can use tree G storage are as follows: and f (G)=<1, k, 1,3>,<2, k12, 1,2 >, < 2, k3, 0,0 >, < 2, k45,
3,4>,<3, k1, 0,0>,<3, k2, 0,0 >, < 3, k4, 0,0>,<3, k5, 0,0 > }
Parent (G, k45) indicate to calculate k45The father node of node, σ (G, k45) it is to calculate node k45Same layer in f (G)
Arrangement serial number in minor node is all in 3, f (G) to meet Dic=Mc- 1 DiNode has a k, and k node is<1, k, 1,3>,
Meet Dis≤ σ (G, M)≤Die, therefore be Parent (G, k45) it is k.
It indicates to calculate node k45Child node, searching out f (G), there are k45Node, k45The number of plies of node is 2, at f (G)
Four-tuple in find k45The child node of node is in 3 layers of beginning serial number from left to right and terminates serial number 3,4, can be obtained
Child (G, k45) it is k4And k5。
Wherein Height (G) is 3.
Embodiment 2 splits to obtain { A, B, C, D, EF, G, H } using method of the invention there are secret T, as described in Figure 2,
Tree T storage can be used are as follows: f (T)=1, A, 1,3>,<2, B, 1,3>,<2, C, 4,4>,<2, D, 0,0>,<3, E, 0,0>,<3,
F, 0,0>,<3, G, 0,0>,<3, H, 0,0>} Parent (T, F) indicate calculate node F father node, σ (T, F) be calculate F knot
Arrangement serial number of the point in the same layer minor node in f (T), is 2, all in f (T) to meet Dic=Mc- 1 DicNode have B, C,
D point, B node are < 2, B, 1, and 3 > meet Dis≤ σ (G, M)≤Die, C and D point is not met, therefore Parent (G, k45) it is B.
The child node for indicating calculating F node, searching out f (T), there are node F, and the number of plies of F node is 3, in the quaternary of f (T)
K is found in group45The child node of node is 0 in 3 layers of beginning serial number from left to right and end serial number, and node F, which can be obtained, not to be had
Child node.
Wherein Height (T) is 3.