A key update method, system, computer device and computer storage medium
By using an automated key update method, the problem of inconsistent key deployment information is solved, ensuring the accuracy and security of key updates and improving the reliability and efficiency of financial transactions.
Patent Information
- Application Number
- CN202310117306.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-09
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2043-02-09
AI Technical Summary
Existing technologies cannot effectively check whether the key deployment information is consistent during the key update process, resulting in inconsistent keys or configuration errors, which affects transaction security. Furthermore, the need for manual management of expired keys can easily lead to invalidation or incorrect replacement.
By acquiring key information, determining its expiration time, generating and comparing initial message digests, and ensuring consistency of key deployment information, the key is automatically updated. This includes the generation and verification processes of symmetric and asymmetric keys, ensuring the correctness of the key before and after deployment.
It enables correctness checks and automatic updates before and after key deployment, avoiding key expiration and configuration errors, and improving transaction security and efficiency.
Smart Images

Figure CN116015656B_ABST
Abstract
Description
Technical Field
[0001] This article relates to the field of financial technology, and in particular to a key update method, system, computer device, and computer storage medium. Background Technology
[0002] In the information age, everything is closely related to information security. In the financial sector, the data of individuals and businesses is even more critical, making key encryption protection essential. The development and upgrading of application systems inevitably involve key application, deployment, and replacement. These operations involve numerous personnel and collaborating institutions, with complex procedures. After key generation, its validity and correctness must be verified through real transactions. Key expiration requires manual assessment and manual renewal.
[0003] Typically, it's necessary to verify the correctness of keys before and after deployment. Current technologies often directly update old keys with new ones without checking for changes in deployment information or the deployment environment. There's a lack of effective mechanisms to verify the correctness of key deployment information. Because keys in R&D, testing, and production environments are inconsistent, existing technologies can only verify basic information such as key type and format, and cannot simulate financial transactions. This easily leads to key inconsistencies or misconfigurations, affecting transactions. Furthermore, keys need to be manually replaced upon expiration, posing a risk of expiration or incorrect replacement due to mismanagement.
[0004] To address issues such as key inconsistency and configuration errors caused by environmental changes in current technologies, a key update method, system, computer equipment, and computer storage media are needed. Summary of the Invention
[0005] To address the problems of the prior art, this embodiment provides a key update method, system, computer device, and computer storage medium.
[0006] This embodiment provides a key update method applied to a key management party, comprising: acquiring key information, including key expiration time, key generation time, key type, and key algorithm; determining whether the key has expired based on the key expiration time and the current time; if expired, sending a key check instruction to the key deployment party; receiving initial message digests generated by each key deployment party based on the key check instruction; generating a check message digest based on the key identifier and key deployment party information pre-stored in the key management party; determining whether the initial message digests belonging to each key deployment party are consistent with the check message digests belonging to the management party; if consistent, determining that the deployment information is accurate, generating a new key corresponding to each key deployment party, and performing a key update operation.
[0007] According to one aspect of the embodiments herein, the initial message digest is used to compare with the inspection message digest to determine whether the key deployment information and key identifier have changed before key deployment.
[0008] According to one aspect of the embodiments herein, before performing the key update operation, the method further includes: obtaining the time difference between the key generation time and the current time; determining whether the time difference is less than or equal to a preset key update cycle; if so, initiating the key update operation.
[0009] According to one aspect of the embodiments herein, the key deployment party includes a first key deployment party and a second key deployment party. The key update operation includes: generating a first key and a second key based on the key type and key algorithm in the key information; sending the first key to the first key deployment party and the second key to the second key deployment party; receiving a first plaintext and a first digest randomly generated by the first key deployment party, and receiving a second plaintext and a second digest obtained by the second key deployment party using the second key to decrypt a second ciphertext, wherein the second ciphertext is obtained by the first key deployment party encrypting the first plaintext using the first key; receiving the determination result of the key deployment party on whether the first plaintext and the second plaintext are consistent; if consistent, encrypting the first plaintext, the deployment information of the first key deployment party stored by the key management party, and the first deployment party identifier using the first key to obtain a third ciphertext and a third digest; processing the second plaintext, the deployment information of the second key deployment party stored by the key management party, and the second deployment party identifier using the second key to obtain a fourth ciphertext and a fourth digest; determining whether the third digest is consistent with the first digest and whether the fourth digest is consistent with the second digest; if consistent, updating the key.
[0010] This embodiment provides a key update method. The method is applied to a key deployment party and generates an initial message digest by: a first key deployment party generating a first message and a first message digest from its historical key, current key identifier, and key deployment information according to a key check instruction; and a second key deployment party generating a second message and a second message digest from its historical key, current key identifier, and key deployment information according to the key check instruction. The first message digest and the second message digest together form the initial message digest.
[0011] According to one aspect of the embodiments herein, upon receiving the first key and the second key, the key deployer performs the following operations: the first key deployer determines the first ciphertext, the first message, and the first digest based on the first key, the randomly generated first plaintext, the key deployer identifier, and the key deployment information; the first key deployer generates the second ciphertext based on the first key and the first plaintext, and transmits it to the second key deployer; the second key deployer receives and decrypts the second ciphertext using the second key to obtain the second plaintext; determines whether the second plaintext is consistent with the first plaintext; if consistent, determines the second digest based on the second key, the second plaintext, the second deployer identifier, and the second deployer information; and sends the first plaintext, the first digest, the second plaintext, and the second digest to the key manager.
[0012] According to one aspect of the embodiments herein, the method includes: generating a first message digest and a second message digest by using a key hash function on a first message and a second message respectively, wherein the first message includes a historical key of a first key deployer, a key identifier of the first key deployer, and key deployment information, and the second message includes a historical key of a second key deployer, a key identifier of the second key deployer, and key deployment information.
[0013] According to one aspect of the embodiments herein, the method includes: encrypting a first plaintext using a key algorithm to obtain a first ciphertext.
[0014] This embodiment provides a key update system, comprising: a key manager, configured to determine whether key update conditions are met; if the key update conditions are met, sending a key check instruction to a key deployer and receiving a digest generated by the key deployer according to the key check instruction, and determining whether the deployment information of the key update system is accurate; if accurate, generating a new key and performing a key update operation on the key deployer; and at least one key deployer, wherein each key deployer is configured to generate a digest according to the key check instruction sent by the key manager and send it to the key manager; and generate a new digest according to the new key in the key update operation.
[0015] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the key update method.
[0016] This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the key update method.
[0017] This solution effectively checks the correctness of keys before and after deployment and automatically performs key updates through key checking and key update technologies. It solves security problems such as key expiration, incorrect key deployment, and key mismatch that lead to key failure, effectively ensuring the correctness of key use and deployment, avoiding system-level problems caused by key failure or abnormal key deployment, and improving business security and efficiency. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments or prior art described herein, the accompanying drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this article. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 The diagram shown is a schematic of a key update system according to an embodiment of this paper;
[0020] Figure 2 The diagram shown is a flowchart of a key update method according to an embodiment of this paper;
[0021] Figure 3 The diagram shows another method for determining whether to perform a key update operation according to an embodiment of this paper.
[0022] Figure 4 The diagram shown is a flowchart of a key update method according to an embodiment of this paper;
[0023] Figure 5 The diagram shown is a flowchart of a method for generating an initial message digest according to an embodiment of this paper;
[0024] Figure 6 The diagram shown is a flowchart of a method for encryption and decryption using a new key, as described in an embodiment of this paper.
[0025] Figure 7 The diagram shown is a schematic of another key update system according to an embodiment of this paper;
[0026] Figure 8 The diagram shown is a structural schematic of a computer device according to an embodiment of this article.
[0027] Explanation of symbols in the attached drawings:
[0028] 101. Key Management Party;
[0029] 102, 01, 02, 002, 003, Key Deployment Party;
[0030] 110, 210, 310, Key Receiving Deployment Submodule;
[0031] 120, 220, 320, Key Check Submodule;
[0032] 1021, First Deployer;
[0033] 102n, the nth key deployer;
[0034] 001. Key Management Module;
[0035] 802. Computer equipment;
[0036] 804, Processor;
[0037] 806. Memory;
[0038] 808. Drive mechanism;
[0039] 810. Input / Output Module;
[0040] 812. Input devices;
[0041] 814. Output devices;
[0042] 816. Presentation equipment;
[0043] 818. Graphical User Interface;
[0044] 820. Network interface;
[0045] 822. Communication link;
[0046] 824. Communication bus. Detailed Implementation
[0047] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments herein will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments herein, and not all of the embodiments. Based on the embodiments herein, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this document.
[0048] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings herein are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0049] This specification provides the operational steps of the methods described in the embodiments or flowcharts, but based on conventional or non-inventive labor, more or fewer operational steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible execution order. In actual system or device products, the methods shown in the embodiments or drawings can be executed sequentially or in parallel.
[0050] It should be noted that the key update method described in this paper can be used in the fintech field, as well as in other fields. This paper does not limit the application areas of the key update method, system, and device.
[0051] Figure 1 The diagram illustrates a key update system according to an embodiment of this paper. The system includes a key manager 101 and at least one key deployer 102. The key manager 101 determines whether key update conditions are met. If the conditions are met, it sends a key check instruction to the key deployer and receives a digest generated by the key deployer based on the key check instruction, determining whether the deployment information of the key update system is accurate. If accurate, it generates a new key and performs a key update operation on the key deployer. Each of the at least one key deployer 102 generates a digest based on the key check instruction sent by the key manager and sends it to the key manager 101. A new digest is generated based on the new key in the key update operation.
[0052] In this application, the key deployer 102 may include multiple deployers, such as a first key deployer 1021, a second key deployer 1022 (not shown in the figure), and an nth key deployer 102n. Multiple deployers can be used to verify whether the deployment information in the key update system and the environment in which the key resides have changed. Before the key update, this application checks whether the old key and deployment within the system are correct based on the deployer's old key. Subsequently, the administrator generates new keys for different deployers and updates the deployer's key. After the new key is deployed, the system checks whether the deployment is correct and whether the new key is correct.
[0053] Figure 2 The diagram shown is a flowchart of a key update method according to an embodiment of this paper. This method is applied to a key management party 101 and includes:
[0054] Step 201: Obtain key information, which includes key expiration time, key generation time, key type, and key algorithm. The key information is information pre-stored in the key management entity 101 related to the keys of at least one key deployment entity. The key type includes symmetric keys and asymmetric keys, and the key algorithm includes SM2, SM4, DES, etc.
[0055] Step 202: Determine whether the key has expired based on the key expiration time and the current time. In this step, the current time is the system real-time time. The key expiration time is a pre-set key validity period. This step compares the key expiration time and the current time to determine whether the key expiration time has exceeded the current time, thus determining whether the key has expired. For example, if the key expiration time is November 30, 2022, and the current time is November 25, 2022, then the key expiration time has not exceeded the current time, and it can be determined that the key has not expired. In this application, the method for determining whether the key has expired is not limited to the method in this step; other methods for determining whether the key has expired can be used, as described elsewhere in this application.
[0056] Step 203: If the key has expired, send a key check instruction to the key deployment party. If the key is determined to have expired, the key management party sends a key check instruction to the key deployment party to check whether the key deployment information in the key update system is consistent and accurate, and to check whether the old keys of each key deployment party are consistent with the old keys stored by the key management party.
[0057] Step 204: Receive the initial message digests generated by each key deployment party based on the key inspection instructions. After sending the key inspection instructions to each key deployment party, the key deployment party will generate corresponding message digests based on the key inspection instructions and send them to the key management party respectively. The key management party receives the initial message digests sent by each key deployment party.
[0058] Step 205: Generate an inspection message digest based on the key identifier and key deployment information pre-stored by the key manager. The key manager generates a message based on the information pre-registered by the key deployment party with the key manager, and further generates a message digest. The information pre-registered with the key manager includes: the key deployment party's key, the key deployment party's deployment information, and the key identifier. For example, the key manager generates message C5 based on the pre-registered information and uses a key hash function to generate a message digest C6 from message C5.
[0059] Step 206: Determine whether the initial message digest belonging to each key deployment party is consistent with the check message digest belonging to the management party. If they are consistent, the deployment information is confirmed to be accurate, a new key corresponding to each key deployment party is generated, and a key update operation is performed. For example, the key deployment parties in this step include two deployment parties, namely key deployment party 01 and key deployment party 02. According to the description in step 205, the key management party generates message C5 and message digest C6 corresponding to key deployment party 01, and message C7 and message digest C8 corresponding to key deployment party 02, respectively, based on the information pre-registered in the key management party. It is then determined whether the initial message digest belonging to key deployment party 01 is consistent with the check message digest C6 belonging to the key management party, and whether the initial message digest belonging to key deployment party 02 is consistent with the check message digest C8 belonging to the management party. If they are consistent, the key deployment information in the key update system is confirmed to be accurate, and the key management party can generate new keys for each key deployment party and perform a key update operation.
[0060] Figure 3 The diagram shows another method for determining whether to perform a key update operation according to an embodiment of this paper, which specifically includes the following steps:
[0061] Step 301: Obtain the time difference between the key generation time and the current time. In this application, the key generation time is obtained through key information stored by the key manager. For example, if the key generation time is November 20, 2022, and the current time is November 25, 2022, then the time difference can be determined to be 5 days.
[0062] Step 302: Determine whether the time difference is less than or equal to the preset key update period. In some embodiments of this specification, the key update period can be preset to determine in advance whether the key needs to be updated before it expires. For example, a reminder can be set to be issued 30 days before the key expires.
[0063] Step 303: If yes, initiate a key update operation. If the time difference is less than or equal to the key update cycle, issue a reminder to initiate the key update operation, allowing for advance preparation and improving the efficiency of the key update operation.
[0064] If not, it is determined that the key does not meet the key update conditions, and the key update process is terminated.
[0065] Figure 4 The flowchart shown is a method for key updating according to an embodiment of this paper. This method is executed by a key management party, and the key deployment parties include a first key deployment party and a second key deployment party. The method specifically includes the following steps:
[0066] Step 401: Generate a first key and a second key based on the key type and key algorithm in the key information. In this step, the key manager generates the first key and the second key for the first key deployer and the second key deployer, respectively. Specifically, the key manager determines the types of the first key and the second key based on the key type and algorithm in the key information. Specifically, based on the key type, it determines whether the key is a symmetric key or an asymmetric key. If the key is a symmetric key, it is divided into a public-private key pair, with the first key being the public key and the second key being the private key; if the key is a symmetric key, the first key is the public key and the second key is a copy of the key.
[0067] Step 402: Send the first key to the first key deployment party and send the second key to the second key deployment party.
[0068] Step 403: Receive the first plaintext and first digest randomly generated by the first key deployer, and the second plaintext and second digest obtained by the second key deployer decrypting the second ciphertext using the second key. The second ciphertext is obtained by the first key deployer encrypting the first plaintext using the first key.
[0069] After the first key deployer receives the first key and the second key deployer receives the second key, the first key deployer uses a quantum random generator to randomly generate first plaintext, denoted as D1, and processes the first plaintext using the first key to obtain a first digest D6. The first key deployer also directly encrypts the first plaintext using the first key to obtain a second ciphertext D7, and sends the second ciphertext to the second key deployer. The second key deployer decrypts the second ciphertext using the second key to obtain a second plaintext D8, and then uses the second key to encrypt the second plaintext along with the deployment information and identifier of the second key deployer, obtaining ciphertext, denoted as D8. This process is then processed to obtain a second digest, denoted as D12. This process will be... Figure 6 The specific details are described in the text, and this step will not be repeated here.
[0070] Step 404: Receive the key deployment party's judgment result regarding the consistency of the first plaintext and the second plaintext. In this step, the key management party receives the key deployment party's consistency judgment result for the first plaintext and the second plaintext. Both the first plaintext and the second plaintext are generated from the first key; therefore, if the first plaintext and the second plaintext are consistent, it indicates the correctness of the first key. Furthermore, the judgment regarding the consistency of the first plaintext and the second plaintext can be handled by either of the key deployment parties.
[0071] Step 405: If they match, use the first key to encrypt the first plaintext, the deployment information of the first deployer stored by the key manager, and the first deployer identifier to obtain the third ciphertext and the third digest. Then, use the second key to process the second plaintext, the deployment information of the second deployer stored by the key manager, and the second deployer identifier to obtain the fourth ciphertext and the fourth digest.
[0072] If the key manager receives a result showing that the first plaintext and the second plaintext match, then the key deployment information can be confirmed to be correct. The key manager then processes the data to verify whether the keys before and after deployment are consistent.
[0073] Specifically, the key manager assembles a message, denoted as E3, based on the identifier and information of the first key deployer pre-registered with the key deployer. Message E3 is then encrypted using the first key to obtain the third ciphertext, denoted as E4. The first plaintext and the third ciphertext are then combined to form a new message, denoted as E5. The new message is processed using a key hash function to obtain the third digest, denoted as E6. Similarly, the key manager assembles a message, denoted as E9, based on the identifier and information of the second key deployer pre-registered with the key deployer. Message E9 is then encrypted using the second key to obtain the fourth ciphertext, denoted as E10. The second plaintext and the fourth ciphertext are then combined to form a new message, denoted as E11. The new message is processed using a key hash function to obtain the fourth digest, denoted as E12.
[0074] Step 406: Determine whether the third digest is consistent with the first digest, and whether the fourth digest is consistent with the second digest. Specifically, determine whether the third digest E6 is consistent with the first digest D6, and whether the fourth digest E12 is consistent with the second digest D12. This step can determine whether the key deployment information in the system is correct after key deployment; and determine whether the new key of the key manager is correct during the encryption and decryption process using the new key.
[0075] Step 407: If they match, update the key. If they match, deploy the first and second keys generated by the key manager to the key deployer. If they do not match, do not perform a key update operation.
[0076] Figure 5 The diagram shown is a flowchart of a method for generating an initial message digest according to an embodiment of this paper. The method is applied to a key deployment party and specifically includes the following steps:
[0077] Step 501: The first key deployer generates a first message and a first message digest based on its historical key, current key identifier, and key deployment information, according to the key check instruction. When the first key deployer receives the key check instruction, it assembles the first message, denoted as C1, using its old key (i.e., historical key) and local information (current key identifier and current key deployment information). A first message digest, denoted as C2, is generated from the first message using a key hash function (e.g., SM3), and sent to the key manager for check.
[0078] Step 502: The second key deployer, according to the key inspection instruction, generates a second message and a second message digest from its historical key, current key identifier, and key deployment information. The first message digest and the second message digest together form the initial message digest. When the second key deployer receives the key inspection instruction, it assembles a first message, denoted as C3, based on its old key (i.e., historical key) and local information (the current key identifier and current key deployment information of the first key deployer). A second message digest, denoted as C4, is generated from the first message using a key hash function (e.g., SM3), and sent to the key management party for inspection. The first message digest and the second message digest together form the initial message digest. Steps 501 and 502, by forming the first and second message digests based on the first and second messages, process messages of a certain length into concise digests containing key information, facilitating key inspection by the key management party and improving inspection efficiency and subsequent finer-grained key processing.
[0079] Figure 6 The diagram shown is a flowchart illustrating a method for encryption and decryption using a new key, as described in this embodiment. This method describes the process after the key deployer receives a new key generated by the key manager, and specifically includes the following steps:
[0080] Step 601: The first key deployer determines the first ciphertext, the first message, and the first digest based on the first key, the randomly generated first plaintext, the key deployer identifier, and the key deployment information. In this step, the first key deployer receives the first key sent by the key manager and randomly generates the first plaintext, denoted as D1, using a random quantum generator. The randomly generated first plaintext can be hexadecimal data, such as 0123456789ABCDEDF. The first key deployer uses the first plaintext, the identifier of the first key deployer, and the key deployment information of the first key deployer to assemble a new plaintext, denoted as D3. Further, the new plaintext D3 is encrypted into the first ciphertext, denoted as D4, using the first key and an encryption algorithm. The first plaintext and the first ciphertext are assembled into the first message, denoted as D5. The first message is processed using a key hash function to generate the first digest, denoted as D6.
[0081] Step 602: The first key deployer generates a second ciphertext based on the first key and the first plaintext, and transmits it to the second key deployer. The first key deployer also directly encrypts the first plaintext using the first key to obtain the second ciphertext, denoted as D7. The second ciphertext is then transmitted to the second key deployer for verification.
[0082] Step 603: The second key deployer receives and decrypts the second ciphertext using the second key to obtain the second plaintext. This step is handled by the second key deployer. After receiving the second ciphertext transmitted by the first key deployer, the second key deployer decrypts it using the second key generated for the second key deployer by the key manager to obtain the second plaintext, denoted as D8. In this step, if the key is an asymmetric key, then the first key is the public key and the second key is the private key.
[0083] Step 604: Determine whether the second plaintext is consistent with the first plaintext.
[0084] This step can be performed by either the first key deployer or the second key deployer. For example, the second key deployer can determine whether the first plaintext and the second plaintext are identical to ascertain the security of the link between the key deployers, and also to determine whether the first and second keys updated by the key manager are correct. If the information transmission link between the first and second key deployers is secure and risk-free, then the second plaintext should theoretically be identical to the first plaintext.
[0085] Step 605: If they match, determine the second digest based on the second key, the second plaintext, the second deployer identifier, and the second deployer information.
[0086] If the first plaintext matches the second plaintext, the second key deployer assembles the second plaintext, its identifier, and its key deployment information into a new plaintext, denoted as D9. This new plaintext is then encrypted using the second key and encryption algorithm to obtain the second ciphertext, denoted as D10. The second plaintext and second ciphertext are then assembled into a message, denoted as D11. Finally, D11 is processed using a key hash function to generate a second digest, denoted as D12.
[0087] Step 606: Send the first plaintext, first digest, second plaintext, and second digest to the key management party. Send the first plaintext and first digest of the first key deployment party, and the second plaintext and second digest of the second key deployment party to the key management party.
[0088] This solution uses key checking and key updating techniques to address security issues such as key expiration, incorrect key deployment, and key mismatch that lead to key failure, thus preventing system-level problems caused by key failure or abnormal key deployment.
[0089] Figure 7 The diagram illustrates another key update system according to an embodiment of this paper, including: a key management module 001, a key deployment party 01 (numbered 002 in the diagram), and a key deployment party 02 (numbered 003 in the diagram). The key management module 001 further includes a key distribution submodule 110 and a key inspection submodule 120. The key distribution submodule 110 is used to update keys, receive key update notifications from the key management module 001, and send the updated first key and second key from the key management module 001 to the key deployment party 01 and key deployment party 02, respectively. The key inspection submodule 120 is used to read key information registered in the key management module 001, initiate key update operations, and receive the initial message digest, first digest, first plaintext, second digest, and second plaintext generated by the key deployment party 01 and key deployment party 02.
[0090] In the figure, the key receiving and deployment submodule 210 is used to receive the first key updated by the key management module 001 and deploy the first key according to the key deployment information.
[0091] The key checking submodule 220 is used to receive an old key checking request sent by the key management module 001, randomly generate the first plaintext using a quantum random number generator, and encrypt the first plaintext into the second ciphertext using the first key.
[0092] The key receiving and deployment submodule 310 is used to receive the second key updated by the key management module 001 and deploy the second key according to the key deployment information.
[0093] The key inspection submodule 320 is used to receive the old key inspection request sent by the key management module 001, receive the second ciphertext sent by the key deployment party 01, and use the second key to decrypt the second ciphertext to obtain the second plaintext.
[0094] like Figure 8 As shown, a computer device provided in this embodiment is illustrated, and the key update method can be applied to the computer device. The computer device 802 may include one or more processors 804, such as one or more central processing units (CPUs), each of which can implement one or more hardware threads. The computer device 802 may also include any memory 806 for storing information of any kind, such as code, settings, data, etc. Non-limitingly, for example, the memory 806 may include any type of RAM, any type of ROM, flash memory, hard disk, optical disk, etc. More generally, any memory can use any technology to store information. Further, any memory can provide volatile or non-volatile retention of information. Further, any memory can represent a fixed or removable component of the computer device 802. In one case, when the processor 804 executes associated instructions stored in any memory or combination of memories, the computer device 802 can perform any operation of the associated instructions. The computer device 802 also includes one or more drive mechanisms 808 for interacting with any memory, such as hard disk drive mechanisms, optical disk drive mechanisms, etc.
[0095] Computer device 802 may also include an input / output module 810 (I / O) for receiving various inputs (via input device 812) and providing various outputs (via output device 814). A specific output mechanism may include a presentation device 816 and an associated graphical user interface (GUI) 818. In other embodiments, the input / output module 810 (I / O), input device 812, and output device 814 may be omitted, and the device may function solely as a computer device within a network. Computer device 802 may also include one or more network interfaces 820 for exchanging data with other devices via one or more communication links 822. One or more communication buses 824 couple the components described above together.
[0096] Communication link 822 can be implemented in any way, such as via a local area network, a wide area network (e.g., the Internet), a point-to-point connection, or any combination thereof. Communication link 822 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc., governed by any protocol or combination of protocols.
[0097] Corresponding to Figures 1 to 6In addition to the methods described above, this embodiment also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the above-described methods.
[0098] This embodiment also provides a computer-readable instruction, wherein when a processor executes the instruction, the program therein causes the processor to perform the following: Figures 1 to 6 The method shown.
[0099] It should be understood that in the various embodiments of this document, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this document.
[0100] It should also be understood that, in the embodiments herein, the term "and / or" is merely a description of the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following associated objects have an "or" relationship.
[0101] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this document.
[0102] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0103] In the embodiments provided herein, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the couplings or direct couplings or communication connections shown or discussed may be indirect couplings or communication connections through some interfaces, devices, or units, or they may be electrical, mechanical, or other forms of connection.
[0104] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments described herein, depending on actual needs.
[0105] Furthermore, the functional units in the various embodiments of this document can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0106] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this paper, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this paper. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0107] This document uses specific embodiments to illustrate the principles and implementation methods of this document. The descriptions of the embodiments above are only for the purpose of helping to understand the methods and core ideas of this document. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this document. Therefore, the content of this specification should not be construed as a limitation of this document.
Claims
1. A key update method, characterized in that, The method includes: Obtain key information, including key expiration time, key generation time, key type, and key algorithm; Determine whether the key has expired based on the key's expiration time and the current time; If the key expires, a key check instruction will be sent to the key deployment party; Receive the initial message digest generated by each key deployment party based on the key inspection instruction; Based on the key identifier and key deployment information pre-stored by the key manager, an inspection message digest is generated; wherein, the initial message digest is used to compare with the inspection message digest to determine whether the key deployment information and key identifier have changed before key deployment; Determine whether the initial message digest belonging to each key deployment party is consistent with the inspection message digest belonging to the management party. If they are consistent, the deployment information is confirmed to be accurate. Generate a new key corresponding to each key deployment party and perform a key update operation. The method further includes the following steps before performing the key update operation: Obtain the time difference between the key generation time and the current time; Determine whether the time difference is less than or equal to the preset key update period; If so, initiate a key update operation; The key deployment party includes a first key deployment party and a second key deployment party, and the key update operation includes: Generate a first key and a second key based on the key type and key algorithm in the key information; Send the first key to the first key deployment party, and send the second key to the second key deployment party; The receiving key first deployer randomly generates a first plaintext and a first digest, and the receiving key second deployer decrypts the second ciphertext using a second key to obtain a second plaintext and a second digest. The second ciphertext is obtained by the first key deployer encrypting the first plaintext using the first key. The receiving key deployment party determines whether the first plaintext and the second plaintext are consistent; If they match, the first plaintext, the deployment information of the first deployer stored by the key manager, and the first deployer identifier are encrypted using the first key to obtain the third ciphertext and the third digest. Then, the second plaintext, the deployment information of the second deployer stored by the key manager, and the second deployer identifier are processed using the second key to obtain the fourth ciphertext and the fourth digest. Determine whether the third summary is consistent with the first summary, and whether the fourth summary is consistent with the second summary; If they match, update the key.
2. A key deployment method, characterized in that, The method includes: According to the key check instruction, the first key deployer generates a first message and a first message digest from the historical key, current key identifier and key deployment information of the first key deployer. According to the key check instruction, the second key deployer generates a second message and a second message digest from the historical key, current key identifier and key deployment information of the second key deployer. The first message digest and the second message digest constitute the initial message digest. After the first key deployer receives the first key and the second key deployer receives the second key, the first key deployer determines the first ciphertext, the first message, and the first digest based on the first key, the randomly generated first plaintext, the key deployer identifier, and the key deployment information. The first key deployer generates a second ciphertext based on the first key and the first plaintext, and transmits it to the second key deployer. The second key deployment party receives and uses the second key to decrypt the second ciphertext to obtain the second plaintext; Determine whether the second plaintext is consistent with the first plaintext; If they match, the second digest is determined based on the second key, the second plaintext, the second deployer identifier, and the second deployer information; Send the first plaintext, the first digest, the second plaintext, and the second digest to the key manager.
3. The key deployment method according to claim 2, characterized in that, The method includes: generating a first message digest and a second message digest by using a key hash function on the first message and the second message respectively. The first message includes the historical key of the first key deployer, the key identifier of the first key deployer, and key deployment information. The second message includes the historical key of the second key deployer, the key identifier of the second key deployer, and key deployment information.
4. The key deployment method according to claim 3, characterized in that, The method includes: encrypting the first plaintext using a key algorithm to obtain the first ciphertext.
5. A key update system, characterized in that, The system includes: Key management party Used to determine whether the key update conditions are met; If the key update conditions are met, a key check instruction is sent to the key deployment party, and a digest generated by the key deployment party based on the key check instruction is received to determine whether the deployment information of the key update system is accurate. If accurate, generate a new key and perform a key update operation on the key deployment party; At least one key deployment party, wherein each key deployment party is used to generate a digest according to the key check instruction sent by the key manager and send it to the key manager; the key deployment party includes a key receiving deployment submodule; Generate a new digest based on the new key in the key update operation; The key deployment party further includes a first key deployment party and a second key deployment party, and the key update operation includes: Generate a first key and a second key based on the key type and key algorithm in the key information; Send the first key to the first key deployment party, and send the second key to the second key deployment party; The receiving key first deployer randomly generates a first plaintext and a first digest, and the receiving key second deployer decrypts the second ciphertext using a second key to obtain a second plaintext and a second digest. The second ciphertext is obtained by the first key deployer encrypting the first plaintext using the first key. The receiving key deployment party determines whether the first plaintext and the second plaintext are consistent; If they match, the first plaintext, the deployment information of the first deployer stored by the key manager, and the first deployer identifier are encrypted using the first key to obtain the third ciphertext and the third digest. Then, the second plaintext, the deployment information of the second deployer stored by the key manager, and the second deployer identifier are processed using the second key to obtain the fourth ciphertext and the fourth digest. Determine whether the third summary is consistent with the first summary, and whether the fourth summary is consistent with the second summary; If they match, update the key; The key management module further includes a key distribution submodule and a key checking submodule; The key distribution submodule is used to update keys, receive key update notifications from the key management module, and send the first key and the second key updated by the key management module to the first key deployment party and the second key deployment party, respectively. The key inspection submodule is used to read the key information registered in the key management module, to initiate key update operations, and to receive the initial message digest, first digest, first plaintext, second digest, and second plaintext generated by the first key deployment party and the second key deployment party. The key receiving and deployment submodule is used to receive the first key updated by the key management module and deploy the first key according to the key deployment information; The key checking submodule is used to receive an old key checking request sent by the key management module, randomly generate a first plaintext using a quantum random number generator, and encrypt the first plaintext into a second ciphertext using a first key. The key receiving and deployment submodule is used to receive the second key updated by the key management module and deploy the second key according to the key deployment information; The key inspection submodule is used to receive the old key inspection request sent by the key management module, receive the second ciphertext sent by the key deployment party, and use the second key to decrypt the second ciphertext to obtain the second plaintext.
6. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Internet of Things equipment and method and device for improving data transmission security thereof
CN110149209A
Encryption method, device and equipment based on key update distribution and storage medium
CN112202557A