A key distributed processing method, system, terminal and storage medium
By splitting and encrypting the storage key on the target device, and recovering the target key through local private key decryption when needed, the problem of easy cracking in the prior art is solved, improving the security of the key and reducing user losses.
Patent Information
- Application Number
- CN202411801532.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-04-04
AI Technical Summary
In the prior art, the protection method of keys is fixedly stored in a device, which is easy to be cracked, with a low security factor, resulting in user losses.
By obtaining the target key of the target device, the decryption process obtains the key information, and a plurality of partial key information and the target distributed storage device are generated based on the distributed storage device information and key information. Each part of the key information is encrypted to obtain multiple target key information and stored in the corresponding target distributed storage device. Whenever a ciphertext is obtained, the local private key is decrypted and spliced to obtain the recovery target key, which is used to decrypt the ciphertext.
By splitting and encrypting the storage key, the security of the key is improved, and the risk of the key being cracked is reduced, thereby reducing the loss of the user.
Smart Images

Figure CN119766426A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of key protection technology, and in particular to a key distributed processing method, system, terminal and storage medium. Background Art
[0002] At present, with the popularization of the Internet, more and more data is transmitted on the Internet. At the same time, users pay more attention to information security. One aspect of information security is the key aspect. The key aspect is mainly to encrypt the data when the information is sent, so that the data will not be directly exposed when it is obtained;
[0003] However, the existing technology for protecting keys is to store them in a fixed device, but the stored keys are easy to be cracked and have a low security factor, thus causing losses to users.
[0004] Therefore, the prior art still needs to be improved and developed. Summary of the invention
[0005] The main purpose of the present invention is to provide a key distributed processing method, system, terminal and computer-readable storage medium, aiming to solve the problem that the protection of keys in the prior art is fixedly stored in a device, but the stored keys are easy to be cracked and the security factor is not high, thus causing losses to users.
[0006] To achieve the above object, the present invention provides a key distributed processing method, the key distributed processing method comprising the following steps:
[0007] Obtaining a target key of a target device and performing a decryption process to obtain key information, obtaining information of each distributed storage device, and generating a plurality of partial key information and a target distributed storage device according to the distributed storage device information and the key information;
[0008] Encrypting each of the partial key information to obtain multiple target key information;
[0009] Obtain storage interval information of each target distributed storage device, and store all the target key information in the corresponding target distributed storage device according to the target cryptographic algorithm and the storage interval information of each target distributed storage device;
[0010] Whenever a ciphertext is obtained, target key information on multiple target distributed storage devices is obtained, decrypted and concatenated using a local private key to obtain a recovery target key, and the ciphertext is decrypted according to the recovery target key.
[0011] Optionally, the step of obtaining a target key of a target device and performing a decryption process to obtain key information specifically includes:
[0012] Obtaining a target key of a target device, wherein the target key is a key for decrypting ciphertext in the target device;
[0013] The target key is decrypted to obtain key information, wherein the key information includes byte data, byte quantity and hash value of the target key.
[0014] Optionally, generating a plurality of partial key information and a target distributed storage device according to the distributed storage device information and the key information specifically includes:
[0015] Obtaining distributed storage device information, wherein the distributed storage device information includes the number of distributed storage devices and storage resources of the distributed storage devices;
[0016] Determine the number of target distributed storage devices and the corresponding target distributed storage devices according to the number of distributed storage devices, the storage resources of the distributed storage devices and the number of bytes, determine the number of padding bytes according to the number of target distributed storage devices, and generate target bytes according to the number of padding bytes and the byte data;
[0017] The target bytes are divided according to the number of the target distributed storage devices to obtain multiple target key information.
[0018] Optionally, determining the number of target distributed storage devices and corresponding target distributed storage devices according to the number of distributed storage devices, the storage resources of the distributed storage devices and the number of bytes, determining the number of padding bytes according to the number of target distributed storage devices, and generating target bytes according to the number of padding bytes and the byte data, specifically includes:
[0019] Calculating the number of target distributed storage devices required to store the corresponding byte data according to the number of bytes and the storage resources of the distributed storage device;
[0020] Selecting a target number of distributed storage devices from the distributed storage devices as the target distributed storage devices;
[0021] The total number of bytes is calculated according to the number of target distributed storage devices and the storage resources of the distributed storage devices, and the number of bytes to be padded is calculated according to the total number of bytes and the number of bytes;
[0022] The byte data is padded according to the padded byte quantity to obtain target bytes.
[0023] Optionally, dividing the target bytes according to the number of the target distributed storage devices to obtain a plurality of partial key information specifically includes:
[0024] The target byte is divided according to the number of the target distributed storage devices to obtain a plurality of key component data, and a key component length, a key component block signature and a key component index of each key component data are generated according to each key component data and the corresponding target distributed storage device;
[0025] Generate an original key digest according to the hash value in the key information;
[0026] Multiple partial key information are generated based on the original key summary, each of the key component data and the corresponding key component length, the key component block signature and the key component index.
[0027] Optionally, whenever the ciphertext is obtained, target key information on multiple target distributed storage devices is obtained, the local private key is used to decrypt and concatenate to obtain a recovery target key, and the ciphertext is decrypted according to the recovery target key, specifically including:
[0028] Whenever a ciphertext is obtained, each target distributed storage device sends the corresponding target key information to the local device;
[0029] Decrypting all received target key information to obtain multiple target key information, and concatenating all key component data according to the key component index in each target key information to obtain the recovered target key;
[0030] Calculate the hash value of the target key to be restored, and determine whether the target key to be restored is invalid based on the hash value of the target key and the original key digest in the target key information;
[0031] When the recovery target key is not invalid, the ciphertext is decrypted according to the recovery target key.
[0032] Optionally, the calculating of the hash value of the target key to be restored, and judging whether the target key to be restored is invalid according to the hash value of the target key and the original key digest in the target key information, includes:
[0033] Calculate the hash value of the recovery target key;
[0034] Determine whether the hash value of the target key is consistent with the hash value in the original key digest in the target key information;
[0035] When the hash value of the target key is consistent with the hash value in the original key digest in the target key information, the restored target key is not invalid;
[0036] When the hash value of the target key and the hash value in the original key digest in the target key information are equal, the restored target key becomes invalid.
[0037] In addition, to achieve the above-mentioned purpose, the present invention further provides a key distributed processing system, wherein the key distributed processing system comprises:
[0038] A partial key information generation module is used to obtain a target key of a target device, perform decryption processing to obtain key information, obtain information of each distributed storage device, and generate multiple partial key information and a target distributed storage device according to the distributed storage device information and the key information;
[0039] A target key information generation module is used to encrypt each of the partial key information to obtain multiple target key information;
[0040] A storage module, used to obtain storage interval information of each target distributed storage device, and store all the target key information in the corresponding target distributed storage device according to the target cryptographic algorithm and the storage interval information of each target distributed storage device;
[0041] The application module is used to obtain multiple key component data ciphertexts generated by encrypting the target key information based on the local public key of multiple target distributed storage devices whenever the ciphertext is obtained, and decrypt and splice them using the local private key to obtain the recovery target key, and decrypt the ciphertext according to the recovery target key.
[0042] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a key distribution processing program stored on the memory and executable on the processor, and when the key distribution processing program is executed by the processor, the steps of the key distribution processing method as described above are implemented.
[0043] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a key distribution processing program, and when the key distribution processing program is executed by a processor, the steps of the key distribution processing method as described above are implemented.
[0044] In the present invention, the target key of the target device is obtained, and decrypted to obtain key information, each distributed storage device information is obtained, and multiple partial key information and target distributed storage devices are generated according to the distributed storage device information and the key information; each partial key information is encrypted to obtain multiple target key information; the storage interval information of each target distributed storage device is obtained, and all the target key information are stored in the corresponding target distributed storage device according to the target cryptographic algorithm and the storage interval information of each target distributed storage device; whenever the ciphertext is obtained, the target key information on multiple target distributed storage devices is obtained, and the local private key is used to decrypt and splice to obtain the recovery target key, and the ciphertext is decrypted according to the recovery target key. The present invention splits the corresponding target key into different partial key information and encrypts and stores them, so that even if some key information is leaked, it will not cause the leakage of the ciphertext. At the same time, when the corresponding ciphertext is obtained, the present invention promptly obtains the corresponding target key information, thereby recovering the target key and decrypting the ciphertext; in this way, the present invention improves the security of the key, reduces the risk of the key being cracked, and thus reduces the loss of the user. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a flow chart of a preferred embodiment of the key distribution processing method of the present invention;
[0046] Figure 2 It is a structural diagram of a preferred embodiment of the key distributed processing system of the present invention;
[0047] Figure 3 It is a structural diagram of a preferred embodiment of the terminal of the present invention. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0049] At present, with the popularization of the Internet, more and more data are transmitted on the Internet, and users also pay more attention to information security. One aspect of information security is the key. The key is mainly used to encrypt data when sending information, so that the data will not be directly exposed when it is obtained. However, the protection of the key in the existing technology is fixedly stored in a device, and the stored key is easy to be cracked and the security factor is not high, thereby causing losses to users.
[0050] In response to one or more of the above-mentioned problems, the present invention obtains the target key of the target device, performs decryption processing to obtain key information, obtains the information of each distributed storage device, and generates multiple partial key information and target distributed storage devices based on the distributed storage device information and the key information; encrypts each of the partial key information to obtain multiple target key information; obtains the storage interval information of each target distributed storage device, and stores all the target key information in the corresponding target distributed storage device according to the target cryptographic algorithm and the storage interval information of each target distributed storage device; whenever a ciphertext is obtained, the target key information on multiple target distributed storage devices is obtained, decrypted and spliced using a local private key to obtain a recovery target key, and the ciphertext is decrypted according to the recovery target key.
[0051] The key distributed processing method described in the preferred embodiment of the present invention is as follows: Figure 1 As shown, the key distributed processing method includes the following steps:
[0052] Step S10, obtain the target key of the target device, perform decryption processing to obtain key information, obtain information of each distributed storage device, and generate multiple partial key information and target distributed storage devices based on the distributed storage device information and the key information.
[0053] Specifically, in the present invention, information is exchanged between the target device and the local device. After the local device receives the ciphertext sent by the target device, it can use the target key to decrypt it. However, the target key is fixedly stored in a device, and there is a problem that the stored key is easy to be cracked and the security factor is not high, thus causing losses to the user. In the present invention, the target key of the target device is first obtained, and the key is decrypted to obtain the corresponding key information. The key information is the information used to decrypt the ciphertext, and then the corresponding ciphertext information is stored in multiple distributed storage devices respectively. Among them, the distributed storage device can be a sub-device corresponding to the local device, and can also include the local device itself.
[0054] Furthermore, the step of obtaining the target key of the target device and performing decryption processing to obtain the key information specifically includes:
[0055] Obtaining a target key of a target device, wherein the target key is a key for decrypting ciphertext in the target device;
[0056] The target key is decrypted to obtain key information, wherein the key information includes byte data, byte quantity and hash value of the target key.
[0057] Specifically, in the present invention, after obtaining the target key of the target device, decryption can obtain the byte data, byte quantity and hash value of the corresponding target key, and the target key is the key for decrypting the ciphertext in the target device.
[0058] Further, the generating a plurality of partial key information and a target distributed storage device according to the distributed storage device information and the key information specifically includes:
[0059] Obtaining distributed storage device information, wherein the distributed storage device information includes the number of distributed storage devices and storage resources of the distributed storage devices;
[0060] Determine the number of target distributed storage devices and the corresponding target distributed storage devices according to the number of distributed storage devices, the storage resources of the distributed storage devices and the number of bytes, determine the number of padding bytes according to the number of target distributed storage devices, and generate target bytes according to the number of padding bytes and the byte data;
[0061] The target bytes are divided according to the number of the target distributed storage devices to obtain multiple target key information.
[0062] Specifically, in the present invention, the distributed storage device information of all distributed storage devices that can store the corresponding information is first obtained, wherein the distributed storage device information includes the number of distributed storage devices and the storage resources of the distributed storage devices. The number of distributed storage devices is the total number of all distributed storage devices, and the storage resources of the distributed storage devices are the number of bytes of the keys that can be stored in these distributed storage devices. The storage resources of each distributed storage device are 4 bytes to 128 bytes, and are multiples of 4 bytes, such as 4, 8, 12, 16 and other bytes. The specific distributed storage device storage resources can be negotiated by the local device and the relevant slave devices, and the negotiation result is used as the size of the distributed storage device storage resources of each device.
[0063] After obtaining the distributed storage device information, the target distributed storage device number and the corresponding target distributed storage device are determined according to the number of distributed storage devices, the storage resources of the distributed storage devices and the number of bytes, so as to complete the byte data, obtain the target bytes, and divide the target bytes for storage.
[0064] Further, the determining the number of target distributed storage devices and the corresponding target distributed storage devices according to the number of distributed storage devices, the storage resources of the distributed storage devices and the number of bytes, determining the number of padding bytes according to the number of target distributed storage devices, and generating target bytes according to the number of padding bytes and the byte data specifically includes:
[0065] Calculating the number of target distributed storage devices required to store the corresponding byte data according to the number of bytes and the storage resources of the distributed storage device;
[0066] Selecting a target number of distributed storage devices from the distributed storage devices as the target distributed storage devices;
[0067] The total number of bytes is calculated according to the number of target distributed storage devices and the storage resources of the distributed storage devices, and the number of bytes to be padded is calculated according to the total number of bytes and the number of bytes;
[0068] The byte data is padded according to the padded byte quantity to obtain target bytes.
[0069] Specifically, in the present invention, the number of bytes is divided by the storage resources of the distributed storage device, and the result plus 1 is the corresponding target distributed storage device number. The target distributed storage device number of distributed storage devices is randomly selected from all distributed storage devices as the target distributed storage devices. Since the number of bytes stored in each distributed storage device is the same, the corresponding bytes need to be expanded, that is, at this time, the corresponding total number of bytes can be obtained by multiplying the storage resources of the distributed storage device by the number of target distributed storage devices, and the number of padding bytes can be obtained by subtracting the total number of bytes from the corresponding number of bytes. When padding the byte data, padding is performed according to the number of padding bytes to obtain the target bytes. When the total number of bytes and the corresponding number of bytes are subtracted to obtain the number of padding bytes as 0, the corresponding number of padding bytes is the number corresponding to the storage resources of a distributed storage device.
[0070] In one embodiment of the present invention, for byte data with a byte quantity of 32 bytes, when there are two slave devices and the current local device is also used as a target distributed storage device, the distributed storage device storage resource of each target distributed storage device is 12 bytes, and the total byte quantity of the three devices is 36 bytes, so the original 32 bytes of byte data need to be padded to obtain the target bytes of 36 bytes. When there are 32 bytes of byte data, there are 6 slave devices, and the local device is also used as a distributed storage device, then there are a total of 7 corresponding distributed storage devices, and the corresponding distributed storage device storage resource is negotiated to be 8 bytes, 32 divided by 8 and added 1 to obtain the target distributed storage device quantity of 5, then 5 target distributed storage devices are required, the corresponding total byte number is 40, and the padded byte quantity is 8, so it is necessary to padded accordingly to obtain the target bytes.
[0071] Furthermore, the target bytes are divided according to the number of the target distributed storage devices to obtain a plurality of partial key information, specifically including:
[0072] The target byte is divided according to the number of the target distributed storage devices to obtain a plurality of key component data, and a key component length, a key component block signature and a key component index of each key component data are generated according to each key component data and the corresponding target distributed storage device;
[0073] Generate an original key digest according to the hash value in the key information;
[0074] Multiple partial key information are generated based on the original key summary, each of the key component data and the corresponding key component length, the key component block signature and the key component index.
[0075] Specifically, in the present invention, after obtaining the target bytes, the target bytes are divided according to the number of target distributed storage devices. Since the number of target bytes is a multiple of the storage resources of the distributed storage devices, the number of key component data obtained by the corresponding division is the same as the number of target distributed storage devices, and the byte length of each key component data is the same as the storage resources of the distributed storage device. According to each key component data and the corresponding target distributed storage device, the key component length, key component block signature and key component index of each key component data are generated, and the original key digest is generated accordingly.
[0076] Among them, the key component length is the length of the key component data; the key component block signature is the signature calculated by the local device based on the original key summary, key component index, key component length, key component data, etc.; the key component data is the key component data unit split from the original key to each device; the key component index is the index number that identifies this key component data in the target byte, and the target byte is restored by splicing multiple key components according to the index number; the original key summary is the hash value in the key information before the original key is split.
[0077] The original key summary, each of the key component data and the corresponding key component length, key component block signature and key component index are stored together to obtain the corresponding partial key information.
[0078] Step S20: encrypt each of the partial key information to obtain multiple target key information.
[0079] Specifically, an asymmetric encryption method is used to encrypt each partial key information on a local device to obtain multiple target key information. Among them, in asymmetric encryption, the master device or slave device generates a public-private key pair, the public key is distributed to the corresponding slave device or master device, and the private key is saved by itself. When the corresponding public-private key is generated by the slave device, the master device uses the slave device public key to encrypt the key components that need to be distributed and stored in each slave device; that is, when the local device generates a public-private key pair, the public key is distributed to the corresponding slave device, and the public key is used to encrypt each partial key information and send it to the corresponding target distributed storage device; and when the slave device generates a public-private key pair, each slave device sends the corresponding public-private key pair to the local device, and multiple public keys are used to encrypt the corresponding partial key information.
[0080] Step S30: Obtain storage interval information of each target distributed storage device, and store all the target key information in the corresponding target distributed storage device according to the target cryptographic algorithm and the storage interval information of each target distributed storage device.
[0081] Specifically, after obtaining the storage interval information of each target distributed storage device, the target cryptographic algorithm is used to store each target key information in the corresponding target distributed storage device. Among them, the storage interval information of each target distributed storage device is whether there is a secure storage area. When there is a secure storage area, it is stored in the secure storage area. There is no secure storage area. The key ciphertext is stored in the flash. In the present invention, the target cryptographic algorithm adopts a lightweight cryptographic algorithm.
[0082] Step S40: Whenever a ciphertext is obtained, the target key information on multiple target distributed storage devices is obtained, and the local private key is used to decrypt and concatenate the information to obtain a recovery target key, and the ciphertext is decrypted according to the recovery target key.
[0083] Specifically, each time the local device obtains the ciphertext, it obtains the key information on the target distributed storage device. When the connection is made, the target key can be obtained to decrypt the ciphertext, and after each decryption, the recovered target key is destroyed to ensure the security of the target key.
[0084] Furthermore, whenever the ciphertext is obtained, the target key information on multiple target distributed storage devices is obtained, the local private key is used to decrypt and concatenate, the target key is obtained, and the ciphertext is decrypted according to the target key, specifically including:
[0085] Whenever a ciphertext is obtained, each target distributed storage device sends the corresponding target key information to the local device;
[0086] Decrypting all received target key information to obtain multiple target key information, and concatenating all key component data according to the key component index in each target key information to obtain the recovered target key;
[0087] Calculate the hash value of the target key to be restored, and determine whether the target key to be restored is invalid based on the hash value of the target key and the original key digest in the target key information;
[0088] When the recovery target key is not invalid, the ciphertext is decrypted according to the recovery target key.
[0089] Specifically, in the present invention, whenever a ciphertext is obtained, the local device correspondingly requires each distributed storage device to send the corresponding target key information to the local device. When the corresponding public-private key is generated by the local device, the corresponding private key is used to decrypt the target key information to obtain multiple target key information; when the corresponding public-private key is generated by a slave device, the corresponding private key of each slave device is used to decrypt the corresponding target key information to obtain multiple target key information. When the local device also serves as the target distributed storage device, the local device also performs the encryption and decryption process as a slave device.
[0090] Then, all the key component data are spliced according to the key component index in the target key information to obtain the recovery target key. When it is determined that the recovery target key has not expired, the ciphertext is decrypted according to the recovery target key.
[0091] Further, the calculating of the hash value of the target key to be restored, and judging whether the target key to be restored is invalid according to the hash value of the target key and the original key digest in the target key information, includes:
[0092] Calculate the hash value of the recovery target key;
[0093] Determine whether the hash value of the target key is consistent with the hash value in the original key digest in the target key information;
[0094] When the hash value of the target key is consistent with the hash value in the original key digest in the target key information, the restored target key is not invalid;
[0095] When the hash value of the target key and the hash value in the original key digest in the target key information are equal, the restored target key becomes invalid.
[0096] Specifically, when determining whether the recovery target key is invalid, the hash value of the recovery target key is calculated to determine whether the hash value of the recovery target key is consistent with the hash value stored in each original key summary. If they are consistent, it means that the recovery target key is not invalid at this time, and the ciphertext can be decrypted by the recovery target key.
[0097] The present invention obtains the target key of the target device, performs decryption processing to obtain key information, obtains each distributed storage device information, generates multiple partial key information and target distributed storage devices according to the distributed storage device information and the key information; encrypts each of the partial key information to obtain multiple target key information; obtains the storage interval information of each target distributed storage device, stores all the target key information in the corresponding target distributed storage device according to the target cryptographic algorithm and the storage interval information of each target distributed storage device; whenever a ciphertext is obtained, obtains the target key information on multiple target distributed storage devices, decrypts and splices them using a local private key, obtains the recovery target key, and decrypts the ciphertext according to the recovery target key. The present invention splits the corresponding target key into different partial key information, and encrypts and stores them, so that even if some key information is leaked, it will not cause the leakage of the ciphertext. At the same time, when the corresponding ciphertext is obtained, the present invention promptly obtains the corresponding target key information, thereby recovering the target key and decrypting the ciphertext; in this way, the present invention improves the security of the key, reduces the risk of the key being cracked, and thus reduces the loss of the user.
[0098] Furthermore, if Figure 2 As shown, based on the above-mentioned key distributed processing method, the present invention also provides a key distributed processing system accordingly, wherein the key distributed processing system includes:
[0099] The partial key information generation module 21 is used to obtain the target key of the target device, perform decryption processing to obtain key information, obtain information of each distributed storage device, and generate multiple partial key information and target distributed storage devices according to the distributed storage device information and the key information;
[0100] A target key information generating module 22 is used to encrypt each of the partial key information to obtain a plurality of target key information;
[0101] The storage module 23 is used to obtain the storage interval information of each target distributed storage device, and store all the target key information in the corresponding target distributed storage device according to the target cryptographic algorithm and the storage interval information of each target distributed storage device;
[0102] Application module 24 is used to obtain multiple key component data ciphertexts generated by encrypting the target key information based on the local public key of multiple target distributed storage devices whenever ciphertext is obtained, and decrypt and splice them using the local private key to obtain the recovery target key, and decrypt the ciphertext according to the recovery target key.
[0103] Furthermore, if Figure 3 As shown, based on the above-mentioned key distributed processing method and system, the present invention also provides a terminal accordingly, and the terminal includes a processor 10, a memory 20 and a display 30. Figure 3 Only some components of the terminal are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0104] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the terminal. Further, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software and various types of data installed in the terminal, such as the program code of the installation terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a key distribution processing program 40 is stored on the memory 20, and the key distribution processing program 40 can be executed by the processor 10, thereby realizing the key distribution processing method in the present invention.
[0105] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing the key distributed processing method.
[0106] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the terminal and to display a visual user interface. The components 10-30 of the terminal communicate with each other via a system bus.
[0107] In one embodiment, when the processor 10 executes the key distribution processing program 40 in the memory 20, the steps in the above key distribution processing method are implemented.
[0108] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a key distribution processing program, and when the key distribution processing program is executed by a processor, the following steps of the key distribution processing method are implemented:
[0109] Obtain a query instruction, and obtain a unique identifier of each test device according to the query instruction;
[0110] Obtaining a preset number of tests and setting parameters, and when the number of unique identifiers is the same as the number of tests, setting local log parameters corresponding to each test device according to the setting parameters, performing device testing according to the local log parameters, and storing each device test result;
[0111] According to the stored device test results, abnormal test information of each test device is obtained, and the test devices having the abnormal test information are summarized according to the unique identifier and sent to the target device.
[0112] The obtaining of the query instruction, and obtaining the unique identifier of each test device according to the query instruction, specifically includes:
[0113] Obtaining a target key of a target device and performing a decryption process to obtain key information, obtaining information of each distributed storage device, and generating a plurality of partial key information and a target distributed storage device according to the distributed storage device information and the key information;
[0114] Encrypting each of the partial key information to obtain multiple target key information;
[0115] Obtain storage interval information of each target distributed storage device, and store all the target key information in the corresponding target distributed storage device according to the target cryptographic algorithm and the storage interval information of each target distributed storage device;
[0116] Whenever a ciphertext is obtained, target key information on multiple target distributed storage devices is obtained, decrypted and concatenated using a local private key to obtain a recovery target key, and the ciphertext is decrypted according to the recovery target key.
[0117] The step of obtaining the target key of the target device and performing decryption processing to obtain the key information specifically includes:
[0118] Obtaining a target key of a target device, wherein the target key is a key for decrypting ciphertext in the target device;
[0119] The target key is decrypted to obtain key information, wherein the key information includes byte data, byte quantity and hash value of the target key.
[0120] The step of generating a plurality of partial key information and a target distributed storage device according to the distributed storage device information and the key information specifically includes:
[0121] Obtaining distributed storage device information, wherein the distributed storage device information includes the number of distributed storage devices and storage resources of the distributed storage devices;
[0122] Determine the number of target distributed storage devices and the corresponding target distributed storage devices according to the number of distributed storage devices, the storage resources of the distributed storage devices and the number of bytes, determine the number of padding bytes according to the number of target distributed storage devices, and generate target bytes according to the number of padding bytes and the byte data;
[0123] The target bytes are divided according to the number of the target distributed storage devices to obtain multiple target key information.
[0124] The step of determining the number of target distributed storage devices and the corresponding target distributed storage devices according to the number of distributed storage devices, the storage resources of the distributed storage devices and the number of bytes, determining the number of padding bytes according to the number of target distributed storage devices, and generating target bytes according to the number of padding bytes and the byte data specifically includes:
[0125] Calculating the number of target distributed storage devices required to store the corresponding byte data according to the number of bytes and the storage resources of the distributed storage device;
[0126] Selecting a target number of distributed storage devices from the distributed storage devices as the target distributed storage devices;
[0127] The total number of bytes is calculated according to the number of target distributed storage devices and the storage resources of the distributed storage devices, and the number of bytes to be padded is calculated according to the total number of bytes and the number of bytes;
[0128] The byte data is padded according to the padded byte quantity to obtain target bytes.
[0129] The step of dividing the target bytes according to the number of the target distributed storage devices to obtain a plurality of partial key information specifically includes:
[0130] The target byte is divided according to the number of the target distributed storage devices to obtain a plurality of key component data, and a key component length, a key component block signature and a key component index of each key component data are generated according to each key component data and the corresponding target distributed storage device;
[0131] Generate an original key digest according to the hash value in the key information;
[0132] Multiple partial key information are generated based on the original key summary, each of the key component data and the corresponding key component length, the key component block signature and the key component index.
[0133] Wherein, whenever the ciphertext is obtained, the target key information on multiple target distributed storage devices is obtained, the local private key is used to decrypt and splice, the target key is obtained, and the ciphertext is decrypted according to the target key, which specifically includes:
[0134] Whenever a ciphertext is obtained, each target distributed storage device sends the corresponding target key information to the local device;
[0135] Decrypting all received target key information to obtain multiple target key information, and concatenating all key component data according to the key component index in each target key information to obtain the recovered target key;
[0136] Calculate the hash value of the target key to be restored, and determine whether the target key to be restored is invalid based on the hash value of the target key and the original key digest in the target key information;
[0137] When the recovery target key is not invalid, the ciphertext is decrypted according to the recovery target key.
[0138] The step of calculating the hash value of the target key to be restored, and judging whether the target key to be restored is invalid according to the hash value of the target key and the original key digest in the target key information, includes:
[0139] Calculate the hash value of the recovery target key;
[0140] Determine whether the hash value of the target key is consistent with the hash value in the original key digest in the target key information;
[0141] When the hash value of the target key is consistent with the hash value in the original key digest in the target key information, the restored target key is not invalid;
[0142] When the hash value of the target key and the hash value in the original key digest in the target key information are equal, the restored target key becomes invalid.
[0143] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or terminal including the element.
[0144] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable storage medium that can be read by a computer, and the program can include the processes of the above-mentioned method embodiments when executed. The computer-readable storage medium can be a memory, a disk, an optical disk, etc.
[0145] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A key distributed processing method, characterized in that: The key distributed processing method comprises: Obtaining a target key of a target device and performing a decryption process to obtain key information, obtaining information of each distributed storage device, and generating a plurality of partial key information and a target distributed storage device according to the distributed storage device information and the key information; Encrypting each of the partial key information to obtain multiple target key information; Obtain storage interval information of each target distributed storage device, and store all the target key information in the corresponding target distributed storage device according to the target cryptographic algorithm and the storage interval information of each target distributed storage device; Whenever a ciphertext is obtained, target key information on multiple target distributed storage devices is obtained, decrypted and concatenated using a local private key to obtain a recovery target key, and the ciphertext is decrypted according to the recovery target key.
2. The key distributed processing method according to claim 1, characterized in that: The step of obtaining the target key of the target device and performing decryption processing to obtain key information specifically includes: Obtaining a target key of a target device, wherein the target key is a key for decrypting ciphertext in the target device; The target key is decrypted to obtain key information, wherein the key information includes byte data, byte quantity and hash value of the target key.
3. The key distributed processing method according to claim 2, characterized in that: The generating a plurality of partial key information and a target distributed storage device according to the distributed storage device information and the key information specifically includes: Obtaining distributed storage device information, wherein the distributed storage device information includes the number of distributed storage devices and storage resources of the distributed storage devices; Determine the number of target distributed storage devices and the corresponding target distributed storage devices according to the number of distributed storage devices, the storage resources of the distributed storage devices and the number of bytes, determine the number of padding bytes according to the number of target distributed storage devices, and generate target bytes according to the number of padding bytes and the byte data; The target bytes are divided according to the number of the target distributed storage devices to obtain multiple target key information.
4. The key distributed processing method according to claim 3, characterized in that: The step of determining the number of target distributed storage devices and corresponding target distributed storage devices according to the number of distributed storage devices, the storage resources of the distributed storage devices and the number of bytes, determining the number of padding bytes according to the number of target distributed storage devices, and generating target bytes according to the number of padding bytes and the byte data, specifically includes: Calculating the number of target distributed storage devices required to store the corresponding byte data according to the number of bytes and the storage resources of the distributed storage device; Selecting a target number of distributed storage devices from the distributed storage devices as the target distributed storage devices; The total number of bytes is calculated according to the number of target distributed storage devices and the storage resources of the distributed storage devices, and the number of bytes to be padded is calculated according to the total number of bytes and the number of bytes; The byte data is padded according to the padded byte quantity to obtain target bytes.
5. The key distributed processing method according to claim 3, characterized in that: The target bytes are divided according to the number of the target distributed storage devices to obtain a plurality of partial key information, specifically including: The target byte is divided according to the number of the target distributed storage devices to obtain a plurality of key component data, and a key component length, a key component block signature and a key component index of each key component data are generated according to each key component data and the corresponding target distributed storage device; Generate an original key digest according to the hash value in the key information; Multiple partial key information are generated based on the original key summary, each of the key component data and the corresponding key component length, the key component block signature and the key component index.
6. The key distributed processing method according to claim 1, characterized in that: Whenever the ciphertext is obtained, the target key information on multiple target distributed storage devices is obtained, the local private key is used to decrypt and concatenate, and the target key is obtained to restore the ciphertext, and the ciphertext is decrypted according to the target key to restore the ciphertext, specifically including: Whenever a ciphertext is obtained, each target distributed storage device sends the corresponding target key information to the local device; Decrypting all received target key information to obtain multiple target key information, and concatenating all key component data according to the key component index in each target key information to obtain the recovered target key; Calculate the hash value of the target key to be restored, and determine whether the target key to be restored is invalid based on the hash value of the target key and the original key digest in the target key information; When the recovery target key is not invalid, the ciphertext is decrypted according to the recovery target key.
7. The key distributed processing method according to claim 6, characterized in that: The calculating of the hash value of the target key for restoration, and judging whether the target key for restoration is invalid according to the hash value of the target key and the original key digest in the target key information, comprises: Calculate the hash value of the recovery target key; Determine whether the hash value of the target key is consistent with the hash value in the original key digest in the target key information; When the hash value of the target key is consistent with the hash value in the original key digest in the target key information, the restored target key is not invalid; When the hash value of the target key and the hash value in the original key digest in the target key information are equal, the restored target key becomes invalid.
8. A key distributed processing system, characterized in that: The key distributed processing system comprises: A partial key information generation module is used to obtain a target key of a target device, perform decryption processing to obtain key information, obtain information of each distributed storage device, and generate multiple partial key information and a target distributed storage device according to the distributed storage device information and the key information; A target key information generation module is used to encrypt each of the partial key information to obtain multiple target key information; A storage module, used to obtain storage interval information of each target distributed storage device, and store all the target key information in the corresponding target distributed storage device according to the target cryptographic algorithm and the storage interval information of each target distributed storage device; The application module is used to obtain multiple key component data ciphertexts generated by encrypting the target key information based on the local public key of multiple target distributed storage devices whenever the ciphertext is obtained, and decrypt and splice them using the local private key to obtain the recovery target key, and decrypt the ciphertext according to the recovery target key.
9. A terminal, characterized in that: The terminal includes: a memory, a processor, and a key distribution processing program stored in the memory and executable on the processor. When the key distribution processing program is executed by the processor, the steps of the key distribution processing method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a key distribution processing program, and when the key distribution processing program is executed by a processor, the steps of the key distribution processing method according to any one of claims 1 to 7 are implemented.