Key offline distribution method, system and equipment

By distributing the key and the encrypted ciphertext protecting the key between the key using device and the distributed device, the problem of multiple key distribution caused by insufficient storage space of the smart password key is solved, and the simultaneous distribution of the key is realized, improving Improve work efficiency.

CN118631452AActive Publication Date: 2024-09-10数盾信息科技股份有限公司
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411075106.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-09-10
Estimated Expiration
2044-08-07

AI Technical Summary

Technical Problem

In existing key offline distribution technology, the storage space of smart cryptographic keys is limited, which results in the need to distribute the keys multiple times in batches when the number of keys exceeds, which increases the operational complexity and makes it impossible to achieve simultaneous distribution of keys.

Method used

By receiving the key distribution request from the key using device, the key to be distributed and the protection key are obtained, encrypted to generate ciphertext files, written into storage devices with different capacities, and distributed through these devices to realize the key distributed at the same time.

Benefits of technology

It reduces the number and complexity of system interactions, improves the efficiency of offline key distribution, and solves the problem of multiple distributions when the number of keys exceeds the storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118631452A
    Figure CN118631452A
Patent Text Reader

Abstract

The invention provides a key offline distribution method, system and equipment, and relates to the field of key management. The key offline distribution method comprises the following steps: receiving a key distribution request sent by key using equipment; obtaining a to-be-distributed key and a protection key according to the key distribution request; performing encryption processing on the to-be-distributed key according to the protection key to generate a to-be-distributed key ciphertext file; performing encryption processing on the protection key to generate a protection key ciphertext; writing the protection key ciphertext into a first storage device, and writing the to-be-distributed key ciphertext file into a second storage device; and distributing the protection key ciphertext to distributed equipment through the first storage equipment, and distributing the to-be-distributed key ciphertext file to the distributed equipment through the second storage equipment. According to the scheme provided by the invention, the keys are simultaneously distributed when the number of the keys exceeds the storage space of the intelligent password keys in the offline distribution process of the keys, so that the working efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of key management, and in particular to a key offline distribution method, system and device. Background Art

[0002] At present, offline key distribution is an indispensable function in key management systems. Offline key distribution means that the key management system stores the key of the key management system in a secure medium in a non-network online way, and then gives the secure medium to the administrator of the distributed device or application, who imports it into the distributed device or application. In traditional offline distribution technology, the secure medium uses a smart password key (Ukey), and the password of the smart password key is used to protect the distributed key. However, due to the limited storage space of the smart password key, the maximum is 2M and the minimum is 128K. The number of keys that can be stored in it during offline distribution is limited, and the key distribution capacity is limited. For distributed devices that have key requirements exceeding the capacity, it is impossible to complete the distribution of massive keys through one offline distribution. If massive keys are distributed in multiple times, the operation complexity is increased. Summary of the invention

[0003] The present invention provides a key offline distribution method, system and device, which solves the problem that in the existing key offline distribution process, when the number of keys distributed exceeds the storage space of the intelligent password key, multiple batch distributions are required and the keys cannot be distributed simultaneously.

[0004] In order to solve the above technical problems, the technical solution of the present invention is as follows: An embodiment of the present invention provides a key offline distribution method, which is applied to a key management system. The method includes: receiving a key distribution request sent by a key using device; According to the key distribution request, obtaining keys to be distributed and protection keys, wherein the number of keys to be distributed is greater than a preset value; Encrypting the key to be distributed according to the protection key to generate a ciphertext file of the key to be distributed; Encrypting the protection key to generate a protection key ciphertext; Writing the protection key ciphertext into a first storage device, and writing the to-be-distributed key ciphertext file into a second storage device; the storage capacity of the first storage device is smaller than the storage capacity of the second storage device; The protection key ciphertext is distributed to the distributed device through the first storage device, and the key ciphertext file to be distributed is distributed to the distributed device through the second storage device.

[0005] Optionally, encrypting the key to be distributed according to the protection key to generate a ciphertext file of the key to be distributed includes: Based on the protection key, each key to be distributed is encrypted by a preset symmetric algorithm to obtain ciphertext data of each key to be distributed; Write all the ciphertext data of the key to be distributed into the preset file to generate the ciphertext file of the key to be distributed.

[0006] Optionally, based on the protection key, each key to be distributed is encrypted by a preset symmetric algorithm to obtain ciphertext data of each key to be distributed, including: The data for protecting the key and the data for distributing the key are split respectively to obtain a plurality of first data blocks and a plurality of second data blocks; Perform bitwise XOR processing on each first data block and a preset fixed parameter to obtain a new protection key; Performing XOR processing on the second data block and the new protection key to obtain a third data block; Splitting the third data block to obtain a preset number of fourth data blocks; Performing nonlinear transformation processing on the fourth data block to obtain a fifth data block; Based on a preset number of fourth data blocks, performing a ring left shift process on the fifth data block to obtain a sixth data block; Performing XOR processing on the sixth data block to obtain a seventh data block; Performing XOR processing on the sixth data block, the seventh data block and the second data block to obtain a cycle value; Based on the round value and the second data block, ciphertext data of the key to be distributed is determined.

[0007] Optionally, encrypting the protection key to generate a protection key ciphertext includes: Obtain the encryption public key certificate of the distributed device; Parsing the encrypted public key certificate to obtain the public key of the encrypted public key certificate; Based on the public key, the protection key is encrypted using a preset algorithm to generate a protection key ciphertext.

[0008] Optionally, based on the public key, the protection key is encrypted by a preset algorithm to generate a protection key ciphertext, including: Get the length value of the protection key and a random number; By using a preset elliptic curve and a random number, a reference point on the preset elliptic curve is determined; Based on a preset elliptic curve, determining a public key point parameter of a point of the public key on the preset elliptic curve; Determine the target point according to the public key point parameters and the preset elliptic curve; Determine the derived key value by using a preset function, the target point and the length value of the protection key; XORing the derived key value with the protection key to obtain a first ciphertext; The protection key and the target point are combined to obtain a second ciphertext; The reference point, the first ciphertext and the second ciphertext are combined to generate a protection key ciphertext.

[0009] An embodiment of the present invention further provides a key offline distribution method, which is applied to a distributed device, and the method includes: Acquire a protection key ciphertext from the first storage device; wherein the protection key ciphertext is obtained by encrypting the protection key by the key management system; Obtaining a key ciphertext file to be distributed from a second storage device; Decrypting the protection key ciphertext to obtain the protection key; The key to be distributed ciphertext in the key to be distributed ciphertext file is decrypted by using the protection key to obtain the key to be distributed.

[0010] Optionally, decrypting the protection key ciphertext to obtain the distribution protection key includes: Acquire a private key corresponding to the encrypted public key certificate; wherein the private key corresponding to the encrypted public key certificate is stored in a storage device of the distributed device; The protection key is decrypted using a preset algorithm using the private key corresponding to the encrypted public key certificate to obtain the protection key.

[0011] An embodiment of the present invention further provides a key offline distribution system, comprising: A key management system, used for receiving a key distribution request sent by a key-using device; obtaining a key to be distributed and a protection key according to the key distribution request, wherein the number of the key to be distributed is greater than a preset value; encrypting the key to be distributed according to the protection key to generate a ciphertext file of the key to be distributed; encrypting the protection key to generate a ciphertext of the protection key; writing the ciphertext of the protection key to a first storage device, and writing the ciphertext file of the key to be distributed to a second storage device; the storage capacity of the first storage device is smaller than the storage capacity of the second storage device; distributing the protection key ciphertext to the distributed device through the first storage device, and distributing the ciphertext file of the key to be distributed to the distributed device through the second storage device, so that the distributed device decrypts the protection key ciphertext to obtain a distribution protection key; decrypting the distribution key ciphertext file through the distribution protection key to obtain the key to be distributed.

[0012] An embodiment of the present invention further provides a computing device, comprising: a processor and a memory storing a computer program, wherein when the computer program is executed by the processor, the above-mentioned offline key distribution method is executed.

[0013] An embodiment of the present invention further provides a computer-readable storage medium, comprising: storing instructions, which, when executed on a computer, enable the computer to execute the above-mentioned offline key distribution method.

[0014] The above solution of the present invention includes at least the following beneficial effects: The key offline distribution method of the present invention receives a key distribution request sent by a key use device; obtains the key to be distributed and the protection key according to the key distribution request, and the number of the key to be distributed is greater than a preset value; encrypts the key to be distributed according to the protection key to generate a key ciphertext file to be distributed; encrypts the protection key to generate a protection key ciphertext; writes the protection key ciphertext to a first storage device, and writes the key ciphertext file to be distributed to a second storage device; the storage capacity of the first storage device is smaller than the storage capacity of the second storage device; distributes the protection key ciphertext to the distributed device through the first storage device, and distributes the key ciphertext file to be distributed to the distributed device through the second storage device. In the process of offline key distribution, the keys are distributed simultaneously when the number of keys exceeds the storage space of the smart password key, which reduces the number and complexity of system interactions and improves work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a schematic diagram of the process of the offline key distribution method of the present invention; Figure 2 It is a structural diagram of the key offline distribution system of the present invention. DETAILED DESCRIPTION

[0016] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.

[0017] like Figure 1 As shown, an embodiment of the present invention provides a key offline distribution method, which is applied to a key management system. The method includes: Step 11, receiving a key distribution request sent by a key use device; Step 12: acquiring keys to be distributed and protection keys according to the key distribution request, wherein the number of keys to be distributed is greater than a preset value; Step 13, encrypting the key to be distributed according to the protection key to generate a ciphertext file of the key to be distributed; Step 14, encrypting the protection key to generate a protection key ciphertext; Step 15, writing the protection key ciphertext into a first storage device, and writing the key ciphertext file to be distributed into a second storage device; the storage capacity of the first storage device is smaller than the storage capacity of the second storage device; Step 16: distribute the protection key ciphertext to the distributed device through the first storage device, and distribute the to-be-distributed key ciphertext file to the distributed device through the second storage device.

[0018] In this embodiment, the first storage device is a smart password key; step 11 may specifically be to set a key distribution request automatic trigger device in the key management system, and the trigger condition is that the first storage device is connected to the key management system, that is, when the first storage device is connected to the key management system, the key distribution request automatic trigger device automatically sends a key distribution request to the key management system; according to the key distribution request, obtaining the key to be distributed may specifically be to pre-store the required key to be distributed in the storage device in the key management system, and when the system receives the key distribution request, obtain the key to be distributed through the storage device; according to the key distribution request, obtaining the protection key may specifically be to generate a 16-byte random number as the protection key through the random number generator device of the key management system.

[0019] In this example, the number of keys to be distributed being greater than the preset value means that the number of keys to be distributed is greater than the normal storage number of the smart password key. For example, the normal storage number of the smart password key is 10 keys to be distributed, that is, at most 10 keys can be distributed at a time; then, more than 10 keys can be distributed each time through the solution of the present invention; thereby solving the problem that the original smart password key is affected by the storage space and cannot distribute keys exceeding the preset value; the key offline distribution method of the present invention generates a key ciphertext file to be distributed by encrypting the key to be distributed according to the protection key; encrypting the protection key to generate a protection key ciphertext; writing the protection key ciphertext into a first storage device, and writing the key ciphertext file to be distributed into a second storage device; the storage capacity of the first storage device is smaller than the storage capacity of the second storage device; the design of distributing the protection key ciphertext to the distributed device through the first storage device, and distributing the key ciphertext file to be distributed to the distributed device through the second storage device solves the problem that in the existing key offline distribution process, when the number of distributed keys exceeds the storage space of the smart password key, multiple batch distributions are required, and the keys cannot be distributed simultaneously. In the offline key distribution process, when the number of keys exceeds the storage space of the smart password key, the keys can be distributed simultaneously, which reduces the number and complexity of system interactions and improves work efficiency.

[0020] In an optional embodiment of the present invention, step 13 may include: Step 131, based on the protection key, encrypt each key to be distributed by a preset symmetric algorithm to obtain ciphertext data of each key to be distributed; Step 132, write all the ciphertext data of the key to be distributed into a preset file to generate a ciphertext file of the key to be distributed.

[0021] In this embodiment, during use, the preset symmetric algorithm encapsulated by the key management system can be called, and each key to be distributed can be encrypted in a loop to obtain ciphertext data, and recorded in the memory of the key management system. At the end of the loop, all ciphertext data will be written to the preset file, and finally the ciphertext file of the key to be distributed is obtained; if the amount of data is too large, the keys to be distributed can be calculated in batches according to the above to obtain different ciphertext files.

[0022] In an optional embodiment of the present invention, step 131 may include: Step 131, splitting the key protection data and the key to be distributed data to obtain a plurality of first data blocks and a plurality of second data blocks respectively; Step 132, performing bitwise XOR processing on each first data block and a preset fixed parameter to obtain a new protection key; Step 133, performing XOR processing on the second data block and the new protection key to obtain a third data block; Step 134, splitting the third data block to obtain a preset number of fourth data blocks; Step 135, performing nonlinear transformation processing on the fourth data block to obtain a fifth data block; Step 136, based on the preset number of the fourth data blocks, performing a ring left shift process on the fifth data block to obtain a sixth data block; Step 137, performing XOR processing on the sixth data block to obtain a seventh data block; Step 138, performing XOR processing on the sixth data block, the seventh data block and the second data block to obtain a loop value; Step 139: Determine the ciphertext data of the key to be distributed based on the cycle value and the second data block.

[0023] In this embodiment, the key protection data p is split into data blocks of the same length (first data block), and then the first data block is bitwise XORed with a preset fixed parameter f to form a new key k (new protection key); the key distribution data d is split into data blocks of the same length (second data blocks) d1, d2...dn, and then the second data blocks except the first data block d1 in the second data block are XORed with the new key k to obtain data M (third data block), so that the length of M is consistent with the length of d, and then M is split into data blocks Mi (fourth data block) of the same length, and the number of blocks N is recorded, and a nonlinear transformation is performed on each fourth data block, and the nonlinear transformation base is 16 * 16, each row and column corresponds to a fixed value (i.e., a preset value), each fourth data block is nonlinearly transformed to form a new value M+ (fifth data block), and then the left shift operation is cyclically performed on M+ to obtain a new value Mbi (sixth data block), which is performed N times in total, and then the new values ​​Mbi are XORed one by one in turn to obtain the result Ly (seventh data block), M+ is XORed with Ly and the first block of data d1 split by the above d to obtain a temporary value Ei (cyclic value), so that the length of the Ei value is consistent with the length of d1; The loop is performed in sequence (i.e., steps 131 to 138 are looped in sequence), and the Ei value is placed after dn, starting from d2 to Ei to form a new value Pi, and the above operation is repeated (i.e., steps 131 to 138 are repeated). After 64 rounds of calculation, a new value Ein is obtained, and a reverse transformation operation is performed on Ein and the adjacent previous Ein-1, Ein-2, etc. to form a value with the same length as d to obtain the final value E, which is the ciphertext data of the key to be distributed.

[0024] In this embodiment, the preset symmetric algorithm may be a preset grouping algorithm, the group length of the preset symmetric algorithm is 128 bits, the key length is 128 bits, and the algorithm adopts a 64-round nonlinear iterative structure; wherein, an example of the algorithm pattern is: input hexadecimal plaintext "0123456789ABCDEFFEDCBA9876543210"; input hexadecimal key "0123456789ABCDEFFEDCBA9876543210"; after calculation, the hexadecimal ciphertext output is: "681EDF34D206965E86B3E94F536E4246".

[0025] In an optional embodiment of the present invention, step 14 may include: Step 141, obtaining the encryption public key certificate of the distributed device; Step 142, parsing the encryption public key certificate to obtain the public key of the encryption public key certificate; Step 143: Based on the public key, the protection key is encrypted by a preset algorithm to generate a protection key ciphertext.

[0026] In an optional embodiment of the present invention, step 143 may include: Step 1431, obtaining the length value of the protection key and a random number; Step 1432, determining a reference point on the preset elliptic curve by using the preset elliptic curve and the random number; Step 1433, based on a preset elliptic curve, determining a public key point parameter of a point of the public key on the preset elliptic curve; Step 1434, determining a target point according to the public key point parameters and a preset elliptic curve; Step 1435, determining a derived key value by using a preset function, the target point, and the length value of the protection key; Step 1436, performing XOR processing on the derived key value and the protection key to obtain a first ciphertext; Step 1437, combining the protection key and the target point to obtain a second ciphertext; Step 1438, merge the reference point, the first ciphertext and the second ciphertext to generate a protection key ciphertext.

[0027] In this embodiment, a random number r is first generated, and the data for protecting the key is P1, then L is recorded as the length of P1; a point Z1=[r]O=(xa, ya) (reference point) on the preset elliptic curve is calculated, where O is the base point of the elliptic curve, [ r ] OIt means multiplying the base point O by the random number r to obtain a point Z1 on the elliptic curve, i.e., the reference point (xa, ya), and converting the calculated Z1 value into a data value; calculating the specific position of the public key value S=[h]Pb on the preset elliptic curve (public key point parameter), doubling the position of the point by [r]Pb, and calculating the specific value of the doubled data (xb, yb); wherein Pb is the elliptic curve point corresponding to the private key, and h is a preset integer; by calculating [r]Pb, the doubled point (xb, yb), i.e., the target point, is obtained; initializing a fixed-length counter, and calculating a new derived key value t by a preset function F1(xa || yb, L) (F1 is a key derivation function); performing XOR processing on the original data protecting the key and the calculated t value, recorded as Z2 (the first ciphertext); then calculating the summary of the data obtained by combining the above data with xb || P1 || yb, recorded as Z3 (the second ciphertext); finally, using Z1 || Z3 || The final ciphertext data obtained by the Z2 merging method is the protection key ciphertext.

[0028] In an optional embodiment of the present invention, the protection key ciphertext is written into the first storage device, specifically: Read the encrypted public key certificate in the smart password key through the driver control of the smart password key or the corresponding management tool; Parsing the encrypted public key certificate to obtain the public key of the encrypted public key certificate; The protection key ciphertext is encrypted by using the public key of the encryption public key certificate and stored in the smart password key.

[0029] An embodiment of the present invention provides a key offline distribution method, which is applied to a distributed device, and the method includes: Step 21, obtaining a protection key ciphertext from the first storage device; wherein the protection key ciphertext is obtained by encrypting the protection key by the key management system; Step 22, obtaining the encrypted key file to be distributed from the second storage device; Step 23, decrypting the protection key ciphertext to obtain the protection key; Step 24: decrypt the key ciphertext to be distributed in the key ciphertext file to be distributed by using the protection key to obtain the key to be distributed.

[0030] In this embodiment, step 21 may specifically include: calling the private key corresponding to the smart password key set in the distributed device through the application; decrypting the smart password key through the private key corresponding to the smart password key to obtain the protection key ciphertext. In this example, after the distributed device obtains the plaintext of the protection key, it uses a preset symmetric algorithm decryption program to decrypt each key ciphertext to be distributed in a cyclic manner based on the protection key to obtain the original text of the key to be distributed. When decrypting, the order of using the round keys is the reverse order of the encryption round keys, and the same algorithm structure as the encryption process can be used for decryption.

[0031] In an optional embodiment of the present invention, step 23 may include: Step 231, obtaining a private key corresponding to the encrypted public key certificate; wherein the private key corresponding to the encrypted public key certificate is stored in a storage device of the distributed device; Step 232: Decrypt the protection key ciphertext using a preset algorithm using the private key corresponding to the encrypted public key certificate to obtain the protection key.

[0032] In an optional embodiment of the present invention, step 232 may include: Step 2321, obtaining a reference point, a first ciphertext, and a second ciphertext in the protection key ciphertext; Step 2322, determining the target point according to the preset elliptic curve, using the private key and the reference point; Step 2323, determining a derived key value according to the target point by using a preset function; Step 2324, performing XOR processing on the derived key value and the first ciphertext to obtain comparison data; Step 2325, merge the comparison data and the target point, and compare the merged data with the second ciphertext. When the comparison data is the same as the second ciphertext, the comparison data is output as the protection key.

[0033] In this embodiment, the distributed device obtains the private key Pr corresponding to the encryption public key certificate of its own device. Since the ciphertext is combined in the manner of Z1 || Z3 || Z2, Z1 is first taken out, and Z1 is calculated according to the established preset elliptic curve to obtain a point on the elliptic curve, and it is determined whether the value satisfies the elliptic curve equation. If not, the program is exited; if it does, the point on the elliptic curve is calculated according to the [h]Z1 function, and the private key Pr is used to calculate Z1 using [Pr]Z1 to obtain another coordinate (xb, yb), i.e., the target point; a new derived key value t is calculated by the preset function F1 (xb || yb, L) function, and if the t value is all 0, the program is exited, otherwise Z2 and t values ​​are XORed to obtain comparison data P'; the summary value of the comparison data is calculated in the manner of combining xb || P' || yb, and it is determined whether it is consistent with Z3. If not, the program is exited, and if it is consistent, P' is the decrypted data, that is, the comparison data is output as the plain text of the protection key.

[0034] The offline key distribution method of the present invention generates a ciphertext file of the key to be distributed by encrypting the key to be distributed according to the protection key; encrypting the protection key to generate a protection key ciphertext; writing the protection key ciphertext into a first storage device, and writing the ciphertext file of the key to be distributed into a second storage device; the storage capacity of the first storage device is smaller than the storage capacity of the second storage device; the design of distributing the protection key ciphertext to the distributed device through the first storage device, and distributing the ciphertext file of the key to be distributed to the distributed device through the second storage device solves the problem that in the existing offline key distribution process, when the number of distributed keys exceeds the storage space of the smart password key, multiple batch distributions are required, and the simultaneous distribution of keys cannot be performed. The method realizes the simultaneous distribution of keys when the number of keys exceeds the storage space of the smart password key during the offline key distribution process, reduces the number and complexity of system interactions, and improves work efficiency.

[0035] like Figure 2 As shown, an embodiment of the present invention provides a key offline distribution system 20, comprising: A key management system 21 is used to receive a key distribution request sent by a key-using device; obtain a key to be distributed and a protection key according to the key distribution request, wherein the number of the key to be distributed is greater than a preset value; encrypt the key to be distributed according to the protection key to generate a ciphertext file of the key to be distributed; encrypt the protection key to generate a ciphertext of the protection key; write the ciphertext of the protection key into a first storage device, and write the ciphertext file of the key to be distributed into a second storage device; the storage capacity of the first storage device is smaller than the storage capacity of the second storage device; distribute the protection key ciphertext to the distributed device through the first storage device, and distribute the ciphertext file of the key to be distributed to the distributed device through the second storage device, so that the distributed device decrypts the protection key ciphertext to obtain a distributed protection key; decrypts the ciphertext file of the distribution key through the distribution protection key to obtain the key to be distributed.

[0036] It should be noted that the system is a device corresponding to the above method, and all implementation methods in the above method are applicable to the embodiments of the device and can achieve the same technical effects.

[0037] The embodiment of the present invention further provides a computing device, comprising: a processor and a memory storing a computer program, wherein the computer program executes the above method when executed by the processor. All implementations in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.

[0038] The embodiment of the present invention also provides a computer-readable storage medium storing instructions, which, when executed on a computer, enable the computer to execute the above method. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effect.

[0039] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0040] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0041] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0042] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0043] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0044] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.

[0045] In addition, it should be pointed out that in the apparatus and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. Moreover, the steps of performing the above series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order, and some steps can be performed in parallel or independently of each other. For those of ordinary skill in the art, it is understandable that all or any steps or components of the method and apparatus of the present invention can be implemented in hardware, firmware, software or a combination thereof in any computing device (including processors, storage media, etc.) or a network of computing devices, which can be achieved by those of ordinary skill in the art using their basic programming skills after reading the description of the present invention.

[0046] Therefore, the purpose of the present invention can also be achieved by running a program or a group of programs on any computing device. The computing device can be a well-known general device. Therefore, the purpose of the present invention can also be achieved by simply providing a program product containing a program code that implements the method or device. That is to say, such a program product also constitutes the present invention, and the storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any well-known storage medium or any storage medium developed in the future. It should also be pointed out that in the device and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. In addition, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order. Some steps can be performed in parallel or independently of each other.

[0047] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A key offline distribution method, characterized in that: Applied to a key management system, the method comprises: receiving a key distribution request sent by a key using device; According to the key distribution request, obtaining keys to be distributed and protection keys, wherein the number of keys to be distributed is greater than a preset value; Encrypting the key to be distributed according to the protection key to generate a ciphertext file of the key to be distributed; Encrypting the protection key to generate a protection key ciphertext; Writing the protection key ciphertext into a first storage device, and writing the to-be-distributed key ciphertext file into a second storage device; the storage capacity of the first storage device is smaller than the storage capacity of the second storage device; The protection key ciphertext is distributed to the distributed device through the first storage device, and the key ciphertext file to be distributed is distributed to the distributed device through the second storage device.

2. The offline key distribution method according to claim 1, characterized in that: The key to be distributed is encrypted according to the protection key to generate a ciphertext file of the key to be distributed, including: Based on the protection key, each key to be distributed is encrypted by a preset symmetric algorithm to obtain ciphertext data of each key to be distributed; Write all the ciphertext data of the key to be distributed into the preset file to generate the ciphertext file of the key to be distributed.

3. The offline key distribution method according to claim 2, characterized in that: Based on the protection key, each key to be distributed is encrypted by a preset symmetric algorithm to obtain ciphertext data of each key to be distributed, including: The data for protecting the key and the data for distributing the key are split respectively to obtain a plurality of first data blocks and a plurality of second data blocks; Perform bitwise XOR processing on each first data block and a preset fixed parameter to obtain a new protection key; Performing XOR processing on the second data block and the new protection key to obtain a third data block; Splitting the third data block to obtain a preset number of fourth data blocks; Performing nonlinear transformation processing on the fourth data block to obtain a fifth data block; Based on a preset number of fourth data blocks, performing a ring left shift process on the fifth data block to obtain a sixth data block; Performing XOR processing on the sixth data block to obtain a seventh data block; Performing XOR processing on the sixth data block, the seventh data block and the second data block to obtain a cycle value; Based on the round value and the second data block, ciphertext data of the key to be distributed is determined.

4. The offline key distribution method according to claim 1, characterized in that: The protection key is encrypted to generate a protection key ciphertext, including: Obtain the encryption public key certificate of the distributed device; Parsing the encrypted public key certificate to obtain the public key of the encrypted public key certificate; Based on the public key, the protection key is encrypted using a preset algorithm to generate a protection key ciphertext.

5. The offline key distribution method according to claim 4, characterized in that: Based on the public key, the protection key is encrypted by a preset algorithm to generate a protection key ciphertext, including: Get the length value of the protection key and a random number; By using a preset elliptic curve and a random number, a reference point on the preset elliptic curve is determined; Based on a preset elliptic curve, determining a public key point parameter of a point of the public key on the preset elliptic curve; Determine the target point according to the public key point parameters and the preset elliptic curve; Determine the derived key value by using a preset function, the target point and the length value of the protection key; XORing the derived key value with the protection key to obtain a first ciphertext; The protection key and the target point are combined to obtain a second ciphertext; The reference point, the first ciphertext and the second ciphertext are combined to generate a protection key ciphertext.

6. A key offline distribution method, characterized in that: Applied to the distributed device, the method comprises: Acquire a protection key ciphertext from the first storage device; wherein the protection key ciphertext is obtained by encrypting the protection key by the key management system; Obtaining a key ciphertext file to be distributed from a second storage device; Decrypting the protection key ciphertext to obtain the protection key; The key to be distributed ciphertext in the key to be distributed ciphertext file is decrypted by using the protection key to obtain the key to be distributed.

7. The offline key distribution method according to claim 6, characterized in that: Decrypting the protection key ciphertext to obtain the distribution protection key includes: Acquire a private key corresponding to the encrypted public key certificate; wherein the private key corresponding to the encrypted public key certificate is stored in a storage device of the distributed device; The protection key is decrypted using a preset algorithm using the private key corresponding to the encrypted public key certificate to obtain the protection key.

8. A key offline distribution system, characterized in that: include: A key management system, used for receiving a key distribution request sent by a key using device; According to the key distribution request, obtaining keys to be distributed and protection keys, wherein the number of keys to be distributed is greater than a preset value; Encrypting the key to be distributed according to the protection key to generate a ciphertext file of the key to be distributed; Encrypting the protection key to generate a protection key ciphertext; Writing the protection key ciphertext into the first storage device, and writing the to-be-distributed key ciphertext file into the second storage device; The storage capacity of the first storage device is smaller than the storage capacity of the second storage device; The protection key ciphertext is distributed to the distributed device through the first storage device, and the to-be-distributed key ciphertext file is distributed to the distributed device through the second storage device, so that the distributed device decrypts the protection key ciphertext to obtain the distribution protection key; the distribution key ciphertext file is decrypted through the distribution protection key to obtain the to-be-distributed key.

9. A computing device, characterized in that include: A processor and a memory storing a computer program, wherein when the computer program is executed by the processor, the method according to any one of claims 1 to 7 is performed.

10. A computer-readable storage medium, characterized in that: Instructions are stored, and when the instructions are executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • System validation method based on two-card three-password technique

    CN102811124A

  • Implementation system for SM2 elliptic curve public key encryption algorithm in binary field F2m

    CN107425968A

  • Key backup and recovery methods, and encryption equipment

    CN109495247A

  • Data encryption and decryption and key distribution method and device, equipment and readable storage medium

    CN110474898A

  • Lightweight block cipher GFCS implementation method and device and readable storage medium

    CN112202547A