Disclosure of Invention
The invention provides a key seed matrix and a certificateless anti-collision key generation method based on the key seed matrix, which aim to solve the technical problems in the prior art.
The technical scheme of the invention is realized as follows:
according to one aspect of the present invention, a key seed matrix generation method is provided.
The key seed matrix generation method comprises the following steps: the key seed matrices include a private key seed matrix skm and a public key seed matrix pkm, wherein,
the private key seed matrix skm generation method comprises the following steps: representing each element of the private key seed matrix skm as a binary integer of N bits; dividing each element into a high-order anti-collision carry region occupying H bits, an anti-collision carry region occupying J bits, a low-order anti-collision carry region occupying K bits and a low-order random number region occupying L bits in sequence from low to high according to the bits; wherein, L is more than J and is more than H and K; each bit in the high anti-collision carry-in area and the low anti-collision carry-in area is 0, and the low random number area independently generates random numbers with L bits by all elements in the low random number area to obtain a low random number area with L bits; the anti-collision area is used for promoting the binary values of the anti-collision areas of any two elements in the private key seed matrix to be different;
the public key seed matrix generation method comprises the following steps: and multiplying the elliptic curve base point G generated by the server by each element in the private key seed matrix skm to obtain the public key seed matrix pkm.
Wherein the configuration of the collision avoidance zone comprises: for the ith (i ═ 1,2, …,8) row in the private key seed matrix, the anti-collision zone of each element of the row randomly fills the non-repeating binary number of M bits from the M × (i-1) +1 bit to the M × i bit from low order to high order; the other bits of the anti-collision zone of each element of the row are filled with 0.
Preferably, N is 8 x 64; h and K are both 4; the J is 48; l is 200; and M is 6.
According to another aspect of the present invention, a certificateless anti-collision key generation method based on a key seed matrix is provided.
The key generation method comprises the following steps:
key generation center produces 200-bit random number xID(ii) a And according to the random number xIDComputing device partial public key PA(ii) a The secret key generation center calculates Z according to the equipment identification and the public key seed matrixAValue (Z)AThe value is the length of the equipment identifier, the SM2 algorithm elliptic curve parameter and the SM3 hash value after public key seed matrix splicing), and according to the ZAValue and device part public key PACalculating the Z value (Z value is Z)ADevice part public key PAThe concatenated SM3 hash value); the secret key generation center selects 8 elements according to the coordinates mapped to the private key seed matrix skm by the Z value to obtain the equipment identification private key SKTAnd according to the equipment identification private key SKTComputingDevice identification public key PKT(ii) a The key generation center identifies the public key PK according to the equipmentTComputing device integrity public key PK, from random number xIDAnd a device identification private key SKTA computing device integrity private key ds; after obtaining the device complete public key PK and the device complete private key ds, the key generation center issues the key pair (ds, PK) to the device side through the secure channel.
Wherein, the key generation center calculates Z according to the equipment identification and the public key seed matrix
AThe formula for the values is as follows: z
A=H(ID
L||ID||a||b||x
G||y
G||h
mpk) According to Z
AValue and device part public key P
AThe formula for calculating the Z value is as follows:
wherein the ID is equipment Identification (ID)
LLength is marked for equipment, a and b are the parameters of the SM2 algorithm elliptic curve, x
G,y
GX and y coordinates of point G, h
mpkThe SM3 hash value after concatenation for all elements of the public key seed matrix,
are respectively P
AH is the SM3 hash algorithm function.
Wherein the computing device partial public key PAThe formula of (1) is as follows: pA=PKx=[xID]G, according to the equipment identification private key SKTComputing device identification public key PKTThe formula of (1) is as follows: PKT=[SKT]G, the key generation center generates a public key PK according to the equipment identificationTThe formula for computing the device's full public key PK is as follows: PK is PA+PKTAccording to a random number xIDAnd a device identification private key SKTThe formula for the computing device full private key ds is as follows: ds ═ xID+SKT。
Wherein SKTIdentifying a private key for the device; x is the number ofIDIs a 200-bit random number; g is the base point, PK, of the elliptic curve of the SM2 algorithmxRefers to a random numberxIDThe random number public key of (2).
According to another aspect of the present invention, a certificateless anti-collision key generation method based on a key seed matrix is provided.
The key generation method comprises the following steps:
device side generates 200bit random number xIDAnd based on the random number xIDCalculating a random number xIDIs a random number public key PKxTo exchange PKxSending to a key generation center; key generation center receiving PKxAnd generates a 200-bit random number yID(ii) a The key generation center generates a key based on the random number yIDCalculating a random number yIDIs a random number public key PKyAnd according to PKxAnd PKyCalculating PA(ii) a The secret key generation center calculates Z according to the equipment identification and the public key seed matrixAA value; and according to ZAValue and device part public key PACalculating a Z value; the secret key generation center selects 8 elements according to the coordinates mapped to the private key seed matrix skm by the Z value to obtain the equipment identification private key SKTAnd according to the equipment identification private key SKTComputing device identification public key PKT(ii) a The key generation center identifies the public key PK according to the equipmentTComputing device integrity public key PK, from random number xIDAnd a device identification private key SKTA computing device integrity private key ds'; key generation center partial public key P of equipmentAThe equipment complete public key PK and the equipment complete private key ds' are issued to the equipment end through a secure channel; device ds' on the device side, device public key PAAnd after the device completes the public key PK, synthesizing a complete device private key ds.
Wherein, the key generation center calculates Z according to the equipment identification and the public key seed matrix
AThe formula for the values is as follows: z
A=H(ID
L||ID||a||b||x
G||y
G||h
mpk) According to Z
AValue and device part public key P
AThe formula for calculating the Z value is as follows:
wherein the ID is equipment Identification (ID)
LLength is marked for equipment, a and b are the parameters of the SM2 algorithm elliptic curve, x
G,y
GX and y coordinates of point G, h
mpkThe SM3 hash value after concatenation for all elements of the system master public key,
are respectively P
AX-coordinate and y-coordinate.
Wherein, according to the random number xIDCalculation of PKxThe formula of (1) is as follows: PKx=[xID]G, the key generation center generates a key according to the random number yIDCalculating PKyThe formula of (1) is as follows: PKy=[yID]G according to PKxAnd PKyCalculating PAThe formula of (1) is as follows: pA=PKx+PKyAccording to the device identification private key SKTComputing device identification public key PKTThe formula of (1) is as follows: PKT=[SKT]G, the key generation center generates a public key PK according to the equipment identificationTThe formula for computing the device's full public key PK is as follows: PK is PA+PKTAccording to a random number xIDAnd a device identification private key SKTThe formula for the computing device full private key ds' is as follows: ds ═ yID+SKTDevice end receiving part device ds', device part public key PAAfter the device completes the public key PK, a formula for synthesizing a complete device private key ds is as follows: ds ═ xID+ds'。
Wherein SKTIdentifying a private key for the device; x is the number ofIDIs a 200-bit random number; g is the base point of the elliptic curve of the SM2 algorithm, and H is the function of the SM3 hash algorithm.
Has the advantages that:
the invention realizes one-to-one correspondence (anti-collision) of the equipment identification ID and the equipment key by using an anti-collision summation method, simultaneously solves the collusion problem of a combined public key technology by introducing a random key, destroys the anti-collision property, realizes the elliptical curve parameter replacement prevention and partial public key replacement prevention by participating in identification mapping by SM2 elliptical curve parameters, public key seed matrixes and partial public keys, and can construct a certificateless cryptosystem
The invention not only reserves the advantages of the combined public key technology, but also solves the problem of summation collision of the combined public key technology by borrowing the construction of the anti-collision summation matrix. The introduction of the random key solves the collusion attack problem of the combined public key technology, and simultaneously, the random key participates in the calculation, realizes the implicit binding of the random key and the identification key, and solves the replacement problem of the random part of the public key of the certificateless cryptosystem. The invention combines the advantages of the combined public key technology and the certificateless cryptosystem and solves the problem between the two technologies. Standard algorithms such as SM2, ECC, etc. are compatible.
The certificateless password system constructed based on the invention has the advantages of convenient key management, high efficiency, certificateless management, light weight, low communication overhead, strong non-repudiation and the like, and is very suitable for identity authentication application in the fields of Internet of things and the like.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the following embodiments of the present invention, and it should be understood that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present invention.
According to an embodiment of the present invention, a key seed matrix generation method is provided. The method for generating the key seed matrix comprises the steps of generating a public and private key seed matrix and generating a device key.
The generation steps of the collision-resistant private key seed matrix skm (8 × 64) are as follows:
step 1, elements in the private key seed matrix skm are composed of a high anti-collision carry-in area with 4 bits, an anti-collision area with 48 bits, a low anti-collision carry-in area with 4 bits and a low random number area with 200bits, and the number of the elements is 256.
Step 2, taking the 4-bit high-order anti-collision carry-in area and the 4-bit low-order anti-collision carry-in area of all elements in the private key seed matrix skm and filling 0 in the areas;
step 3, filling an i (i ═ 1,2, …,8) th row in the private key seed matrix skm with non-repeating binary numbers of 6 bits from the 6 x (i-1) +1 th bit to the 6 x i th bit of each element of the row randomly from the lower bit to the upper bit; the other bits of the anti-collision area of each element of the row are all filled with 0;
and 4, independently generating 200-bit random numbers by all elements in the private key seed matrix skm to obtain 200-bit low-order random number areas.
The public key seed matrix pkm (8 x 64) is generated as follows: multiplying the SM2 elliptic curve base point G with each element of the private key seed matrix skm to obtain a public key seed matrix pkm.
The generation mode of the device key comprises a central centralized generation mode and a two-end generation mode, wherein the central centralized generation mode is used for independently generating a complete key and then issuing the complete key to the device end through a safety channel, and the two-end generation mode is used for jointly completing the generation of the key by the device end and the central generation mode.
The central centralized generation method comprises the following steps:
step 1, the center generates 200bits random number xID(ii) a Step 2, partial public key P of central computing equipmentA=PKx=[xID]G, wherein the point G is an SM2 algorithm elliptic curve base point; step 3, central calculation ZA=H(IDL||ID||a||b||xG||yG||hmpk) Wherein ID is device identification, IDLLength is marked for equipment, a and b are the parameters of the SM2 algorithm elliptic curve, xG,yGX and y coordinates of point G, hmpkThe SM3 hash value after concatenation for all elements of the public key seed matrix.
Step 4. center calculation
Wherein
Are respectively P
AX-coordinate and y-coordinate. Step 5, the center uses the coordinate mapped by the Z value to the private key seed matrix skm to select 8 elements to be added to obtain the equipment identification private key SK
T. Step 6, central calculation of standard public key PK
T=[SK
T]G. Step 7, the complete public key PK of the central computing device is equal to P
A+PK
T. Step 8, the center calculates the complete private key ds ═ x of the complete equipment
ID+SK
T. And 9, the center safely issues the key pair (ds, PK) to the device side.
The method for generating the two ends of the device key comprises the following steps: step 1, the equipment end generates 200bits random number xID. Step 2, calculating PK by the equipment sidex=[xID]G. Step 3, the device side sends PKxTo the center. Step 4. center receives PKxAnd generates a 200bits random number yID. Step 5. Central calculation of PKy=[yID]G. Step 6, central calculation PA=PKx+PKy。
Step 7, central calculation Z
A=H(ID
L||ID||a||b||x
G||y
G||h
mpk) Wherein ID is device identification, ID
LLength is marked for equipment, a and b are the parameters of the SM2 algorithm elliptic curve, x
G,y
GX and y coordinates of point G, h
mpkThe SM3 hash value after concatenation for all elements of the system master public key. Step 8, central calculation
Wherein
Are respectively P
AX-coordinate and y-coordinate. Step 9, the center uses the Z value to map to the seed matrix skm coordinate of the private key to select 8 elements to add to obtain the equipment identification private key SK
T. Step 10. Central computing device identification public Key PK
T=[SK
T]G. Step 11, the central computing device complete public key PK ═ P
A+PK
T. Step 12, the central computing part device private key ds ═ y
ID+SK
T. Step 13, the center will ds' and the public key P of the device part
AAnd the complete public key PK of the equipment is safely sent to the equipment end. Step 14, receiving partial device ds' at device end, device partial public key P
AThe device integrity public key PK. Step 15. equipment end closingComplete equipment private key ds ═ x
ID+ds'。
By means of the above technical solution of the present invention, the hash value h of the public key matrix (system primary public key)mpkParticipate in the hash calculation, can prevent the public key matrix from replacing the attack effectively, some public keys PAAnd the method participates in hash calculation, and can effectively prevent partial public key replacement attack. The low-order anti-collision carry-in area with 4 bits is provided, and the anti-collision characteristic can not be damaged by introducing part of the key, so that the invention not only keeps the advantages of the combined public key technology, but also solves the problem of summation collision of the combined public key technology by borrowing the structure of the anti-collision summation matrix. The introduction of the random key solves the collusion attack problem of the combined public key technology, and simultaneously, the random key participates in the calculation, realizes the implicit binding of the random key and the identification key, and solves the replacement problem of the random part of the public key of the certificateless cryptosystem. The invention combines the advantages of the combined public key technology and the certificateless cryptosystem and solves the problem between the two technologies. Standard algorithms such as SM2, ECC, etc. are compatible.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.