A key management method and system
By using key management methods and systems in the Internet environment to generate and verify data keys, combined with the key management service system, the problems of key management complexity and security risks in data encryption technology are solved, and high security is achieved. Transparent data encryption and decryption processing.
Patent Information
- Application Number
- CN202210265466.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-17
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-03-17
AI Technical Summary
Existing data encryption technology is difficult to effectively manage and protect sensitive data in the Internet environment, and there are security risks. Especially in terms of key management, it is highly complex and difficult to achieve transparent data encryption and decryption processing.
Using key management methods and systems, the data key is generated and verified through the server, and stored using security plug-ins. The client receives the encrypted key ciphertext and algorithm for decryption, and manages the key in conjunction with the key management service system, and supports Blacklist and whitelist policies and real-time monitoring enable transparent data encryption and decryption.
It improves the security of keys and the level of data protection, simplifies the key management process, provides transparent data encryption and decryption processing methods, ignores the complexity of key algorithms, and enhances the system through real-time monitoring and black and white list policies. Security.
Smart Images

Figure CN114650131B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data encryption, and in particular to a key management method and system. Background Art
[0002] With the rapid development of Internet technology, various businesses have gradually realized informatization and networking. While Internet technology brings convenience to the development of various businesses, it also brings security risks, which may cause users' sensitive data to be leaked and tampered. Therefore, in today's networked era, data security is an important issue that cannot be easily ignored.
[0003] Therefore, how to encrypt data based on a key is a key technical problem that technicians in this field need to solve. Summary of the invention
[0004] The embodiments of the present application provide a key management method and system. In order to have a basic understanding of some aspects of the disclosed embodiments, a simple summary is given below. This summary is not a general review, nor is it intended to identify key / important components or describe the scope of protection of these embodiments. Its only purpose is to present some concepts in a simple form as a preface to the detailed description that follows.
[0005] In a first aspect, an embodiment of the present application provides a key management method for a server, including:
[0006] Generate data key;
[0007] Receive the client's interface call information for the data key;
[0008] The interface call information is verified. If the verification passes, the encrypted data key ciphertext and encryption algorithm are sent to the client.
[0009] In one embodiment, generating the data key includes:
[0010] Generate a master key based on a preset key generation algorithm and a root key;
[0011] Generate data keys based on the master key.
[0012] In one embodiment, after the data key is generated, the method further includes:
[0013] Use security plug-ins to store data keys in the database;
[0014] The system code data and the configuration data are stored in the server.
[0015] In one embodiment, verifying the interface call information includes:
[0016] Perform permission verification on the client name information and IP address information in the interface call information;
[0017] If the permission check passes, determine whether the private key of the interface key in the interface call information matches the public key of the interface key stored locally;
[0018] If they match, the verification is confirmed to be successful.
[0019] In one embodiment, it further includes:
[0020] Receive local basic information and key usage statistics reported by the client;
[0021] Monitor the status of the installed client based on local basic information and key usage statistics, and process and display the key usage statistics.
[0022] In a second aspect, an embodiment of the present application provides a key management method for a client, including:
[0023] Call the data key acquisition interface;
[0024] Receive the encrypted data key ciphertext and encryption algorithm returned by the server;
[0025] The data key ciphertext is decrypted according to the corresponding decryption algorithm and interface key to obtain the data key plaintext.
[0026] In one embodiment, before calling the data key acquisition interface, the method further includes:
[0027] Open a key management service system account and upload access blacklist and whitelist;
[0028] Query the interface key corresponding to the client according to the key management service system account.
[0029] In one embodiment, after receiving the data key ciphertext and encryption algorithm encrypted by the interface returned by the server, the method further includes:
[0030] Generate a unified data processing template based on encryption algorithm;
[0031] Use data processing templates to encrypt business data.
[0032] In one embodiment, it further includes:
[0033] Collect local basic information and key usage statistics at preset intervals;
[0034] Report the collected local basic information and key usage statistics to the server.
[0035] In a third aspect, an embodiment of the present application provides a key management system, including a client and a server, wherein the client is used to call an acquisition interface of a data key;
[0036] The server verifies the interface call information of the data key. If the verification is successful, the server returns the encrypted data key ciphertext and encryption algorithm.
[0037] The client is used to receive the data key ciphertext and encryption algorithm after interface encryption, and decrypt the data key ciphertext through the corresponding decryption algorithm and interface key to obtain the data key plaintext;
[0038] The client is used to generate a unified data processing template according to the encryption algorithm, and use the data processing template to encrypt the business data;
[0039] The client is used to collect local basic information and key usage statistics at every preset period, and report the collected local basic information and key usage statistics to the server;
[0040] The server is used to monitor the status of the installed client based on local basic information and key usage statistics, and process and display the key usage statistics.
[0041] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0042] According to the key management method provided in the embodiment of the present application, sensitive data can be encrypted, and the key management service (KMS) system can be used to manage the key. The key management server generates a key plaintext, encrypts the key plaintext to obtain a key ciphertext, and sends the key ciphertext and the encryption algorithm to the client. By sending the encryption algorithm to the client, a transparent data encryption and decryption processing method can be provided, which ignores the complexity of the key algorithm and can be used directly.
[0043] Furthermore, the key management method provided in the embodiment of the present application adds a three-party separate storage mechanism for code, configuration, and key on the basis of plug-in, which improves the security of key storage; the client can also regularly report basic information and key usage statistics, which can help tenants monitor each access client in real time. Tenants can use the platform to visualize data, help tenants process data online and assist in troubleshooting problems after system access. The system also supports black and white list security policies, which can restrict access to client SDKs to block access by abnormal IPs and improve the security of the system.
[0044] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0046] Figure 1 is a flowchart of a key management method according to an exemplary embodiment;
[0047] Figure 2 is a schematic diagram of a key management method for a server according to an exemplary embodiment;
[0048] Figure 3 is a schematic diagram showing a key management method for a client according to an exemplary embodiment;
[0049] Figure 4 is a schematic diagram of a key management method according to an exemplary embodiment;
[0050] Figure 5 is a schematic diagram of a key management method of a client according to an exemplary embodiment;
[0051] Figure 6 The diagram is a schematic structural diagram of a key management device according to an exemplary embodiment. DETAILED DESCRIPTION
[0052] The following description and the drawings sufficiently illustrate specific embodiments of the invention to enable those skilled in the art to practice them.
[0053] It should be clear that the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are only examples of systems and methods consistent with some aspects of the present invention as detailed in the attached claims.
[0055] The key management system of the embodiment of the present application provides a cloud solution for key generation, key storage, key use, auditing, and monitoring. After the tenant applies for a KMS account and installs the client SDK (software development kit) in the key management service system, he can safely download the managed key and process the data. At the same time, the software development kit installed by the client will automatically collect data including basic information, key usage statistics, etc. and report it to the server. The server determines the online status of the client through the survival strategy, and can realize the overall monitoring of each access client based on the reported data.
[0056] In a possible implementation, a key management system includes a client and a server. The client is used to call the interface for obtaining the data key; the server is used to verify the interface call information of the data key, and if the verification is successful, the interface encrypted data key ciphertext and encryption algorithm are returned; the client is used to receive the interface encrypted data key ciphertext and encryption algorithm, and decrypt the data key ciphertext through the corresponding decryption algorithm and interface key to obtain the data key plaintext; the client is used to generate a unified data processing template according to the encryption algorithm, and use the data processing template to encrypt the business data; the client is used to collect local basic information and key usage statistics at every preset period, and report the collected local basic information and key usage statistics to the server; the server is used to monitor the status of the installed client according to the local basic information and key usage statistics, and process and display the key usage statistics.
[0057] Its specific management methods include Figure 1 shown.
[0058] S101 The client calls the data key acquisition interface.
[0059] In one possible implementation, before obtaining the data key, the client can apply to open a KMS account in the key management service system and provide access to the blacklist and whitelist. After the KMS system creates an account for the tenant, the tenant can log in to the system to view the interface keys assigned to each client.
[0060] Furthermore, the client may call the data key acquisition interface to request to obtain the data key.
[0061] S102 The server verifies the interface call information of the data key. If the verification is successful, the server returns the encrypted data key ciphertext and encryption algorithm after the interface encryption.
[0062] In a possible implementation, after receiving the call information from the client, the server obtains the client's interface signature and IP address, performs permission verification based on the configured account security policy, and performs interface verification based on the interface key. If the permission verification passes, the private key of the interface key in the interface call information sent by the client is paired with the public key of the interface key stored locally. If the key pair is correct, the verification is successful.
[0063] Before the server sends the data key to the client, it also generates the data key.
[0064] Specifically, the key management server uses a built-in algorithm library, such as the DES encryption algorithm, AES encryption algorithm, SM4 encryption algorithm, RSA encryption algorithm, or SM2 encryption algorithm to generate a master key, and ensures that the key generation is random, saves the user master key after encrypting it with the root key, and returns the client master key ID.
[0065] The client saves the returned master key ID and uses the master key ID to call the data key service to generate a data key. After the server obtains the master key according to the master key ID, it generates a data key based on the master key.
[0066] Furthermore, after the server creates the data key, the system saves the data key based on the security plug-in method. At the same time, when generating the key, the data key is stored in the database in a way that the key, code, and configuration are separated, and the system code data and configuration data are stored in the server, which further improves the security level of key storage and ensures the security of key storage. Among them, the database can be located in other servers. Furthermore, the server sends the data key ciphertext and encryption algorithm encrypted by the interface to the client. For example, the encrypted data key ciphertext and the name of the SM4 encryption algorithm used are sent to the client together.
[0067] S103 The client receives the data key ciphertext and encryption algorithm after interface encryption, and decrypts the data key ciphertext using the corresponding decryption algorithm and interface key to obtain the data key plaintext.
[0068] Specifically, the client SDK uses the interface key and the corresponding decryption algorithm to decrypt the returned data key ciphertext to obtain the key plaintext resident in the memory to ensure the security of the key in the transmission process. The transmission process uses SSL transmission to ensure the security of data transmission, and the interface key will be used to encrypt the data key to ensure the security of the entire transmission process.
[0069] S104 The client generates a unified data processing template according to the encryption algorithm, and uses the data processing template to encrypt the business data.
[0070] In a possible implementation, the client not only receives the ciphertext encrypted with the data key sent by the server, but also receives the encryption algorithm used for encryption. In this way, the client SDK can obtain the encryption algorithm used for encryption without having to perform complex analysis on the ciphertext. The client can directly decrypt according to the encryption algorithm used. Ignoring the complexity of the key algorithm, this also facilitates quick access for tenants.
[0071] Furthermore, the client can also use the received encryption algorithm to generate a unified data processing template, and use the same encryption algorithm to encrypt data on other clients based on the generated data processing template. For example, after the software development kit installed on the client receives the returned ciphertext and SM4 encryption algorithm, it can not only directly use the corresponding SM4 decryption algorithm for decryption, but also generate a unified data processing template based on the encryption algorithm, and can directly use the same encryption algorithm to encrypt other business data and return the encrypted business data. The specific details of the current key algorithm implementation are shielded, and it can be used as is, which improves the convenience of data processing.
[0072] S105 The client collects local basic information and key usage statistics information at every preset period, and reports the collected local basic information and key usage statistics information to the server.
[0073] In a possible implementation, when creating a client, the heartbeat and reporting mechanism is enabled by default, local basic information and key usage statistics are collected regularly according to a preset period, and the collected data is regularly reported to the server.
[0074] Specifically, the client regularly collects basic data such as the service name, server address, current version number, etc. and reports it to the server. It also regularly collects encryption and decryption usage of locally stored keys and reports it to the server. For example, statistical data such as how many times each key stored in the local server has performed encryption and decryption operations is reported to the server.
[0075] S106 The server monitors the status of the installed client according to the local basic information and the key usage statistics information, and processes and displays the key usage statistics information.
[0076] In a possible implementation, the server analyzes the online status of the client according to a preset survival strategy. For example, if a client does not report data within a preset time period, the client may be offline or under attack. This helps managers monitor the status of the client.
[0077] Furthermore, the server processes and displays the received reported data to help tenants control data processing as a whole and provide data basis for data security decisions, thereby improving the security and controllability of the entire system.
[0078] Furthermore, the system solves the problem of cross-tenant data processing. When uploading the blacklist and whitelist, the number limit and time limit of cross-tenant calls can be uploaded. For example, a client is required to be called only 5 times and can only be called within a certain time period to ensure the controllability of cross-tenant data calls.
[0079] Furthermore, the system provides an online visual data processing method and an online data processing interface. Users can directly upload, encrypt, decrypt, and download data online through the interface. The entire processing process can be controlled by authority and approval to ensure data security and controllability.
[0080] The present application also provides a key management method for a server. Figure 2 As shown, the method includes:
[0081] S201 generates a data key.
[0082] In an optional implementation, generating the data key includes: generating a master key according to a preset key generation algorithm and a root key; and generating the data key according to the master key.
[0083] S202 receives the interface call information of the client for the data key.
[0084] S203 verifies the interface call information. If the verification is successful, the encrypted data key ciphertext and encryption algorithm of the interface are sent to the client.
[0085] Specifically, after the server receives the call information from the client, it will obtain the client's interface signature and IP address, perform permission verification based on the configured account security policy, and perform interface verification based on the interface key. If the permission verification passes, the private key of the interface key in the interface call information sent by the client is paired with the public key of the interface key stored locally. If the key pair is correct, the verification is successful.
[0086] In an optional implementation, after the data key is generated, the method further includes: storing the data key in a database by means of a security plug-in, and storing the system code data and configuration data in a server, thereby further improving the security level of key storage and ensuring the security of key storage.
[0087] In an optional implementation, the server is further used to: receive local basic information and key usage statistics reported by the client; monitor the status of the installed client according to the local basic information and key usage statistics, and process and display the key usage statistics.
[0088] The present application also provides a key management method for a client. Figure 3 As shown, the method includes:
[0089] S301 calls the data key acquisition interface;
[0090] S302 receives the encrypted data key ciphertext and encryption algorithm returned by the server;
[0091] S303: Decrypt the data key ciphertext according to the corresponding decryption algorithm and the interface key to obtain the data key plaintext.
[0092] In an optional implementation, before calling the data key acquisition interface, the client is also used to open a KMS account and upload an access blacklist and whitelist, and query the interface key corresponding to the client according to the KMS account.
[0093] In an optional implementation, after receiving the interface-encrypted data key ciphertext and encryption algorithm returned by the server, it also includes: generating a unified data processing template according to the encryption algorithm, and using the data processing template to encrypt the business data.
[0094] In an optional implementation, the method further includes: collecting local basic information and key usage statistical information according to a preset period, and reporting the collected local basic information and key usage statistical information to the server.
[0095] Specifically, the client regularly collects basic data such as the service name, server address, current version number, etc. and reports it to the server. It also regularly collects encryption and decryption usage of locally stored keys and reports it to the server. For example, statistical data such as how many times each key stored in the local server has performed encryption and decryption operations is reported to the server.
[0096] The management method for key generation, key custody, key usage, auditing, and monitoring provided in the embodiment of the present application can safely download the managed key and perform data processing after the client SDK (software development kit) is installed. At the same time, the software development kit installed on the client will automatically collect data including basic information, key usage statistics, etc. and report it to the server. The server determines the online status of the client through the survival strategy, and can realize overall monitoring of each access client based on the reported data.
[0097] In order to facilitate understanding of the key management method provided in the embodiment of the present application, Figure 4 Provide explanation.
[0098] like Figure 4 As shown in the figure, the tenant first applies for a KMS account in the KMS key management system, configures a KMS account for each client, and generates an interface key for each client. You can log in to the system to view the interface key.
[0099] Furthermore, the client can call the interface for obtaining the data key. After receiving the key acquisition request, the server first verifies the client's permissions and the interface, and pairs the private key of the interface key in the interface call information sent by the client with the public key of the interface key stored locally. If the key pair is correct, the verification is successful. Then, the key generation service is performed at the service layer, the master key is generated first, and then the key is encrypted based on the master key to obtain the data key. The data key is stored in the storage layer. When storing, it is stored based on the security plug-in method.
[0100] Furthermore, if the client request interface verification is passed, the interface encrypted data key ciphertext and encryption algorithm are sent to the client. The client uses the interface key and the corresponding decryption algorithm to decrypt the data key plaintext.
[0101] Figure 5 It is the client's usage process, such as Figure 5 As shown in the figure, the client SDK can obtain the data key from the server and accept the data key returned by the KMS key management server. The returned data key is cached locally.
[0102] Furthermore, the client can call the SDK to encrypt business data. The SDK obtains the locally cached data key, obtains the corresponding encryption algorithm according to the data key type, uses the corresponding encryption algorithm and key to encrypt the business data, and returns the encrypted ciphertext.
[0103] According to the key management method provided in the embodiment of the present application, the client can not only receive the data key ciphertext, but also receive the encryption algorithm, and use the received encryption algorithm to encrypt the remaining business data, ignoring the complexity of the algorithm. At the same time, the software development kit installed on the client will automatically collect data including basic information, key usage statistics, etc. and report them to the server. The server determines the online status of the client through the survival strategy, and can realize the overall monitoring of each access client based on the reported data.
[0104] The embodiment of the present application also provides an electronic device corresponding to the key management method provided in the above embodiment, so as to execute the above key management method.
[0105] Please refer to Figure 6 , which shows a schematic diagram of an electronic device provided by some embodiments of the present application. Figure 6 As shown, the electronic device includes: a processor 600, a memory 601, a bus 602 and a communication interface 603, and the processor 600, the communication interface 603 and the memory 601 are connected via the bus 602; the memory 601 stores a computer program that can be run on the processor 600, and when the processor 600 runs the computer program, it executes the key management method provided in any of the aforementioned embodiments of the present application.
[0106] The memory 601 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 603 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0107] The bus 602 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. Among them, the memory 601 is used to store programs, and the processor 600 executes the program after receiving the execution instruction. The key management method disclosed in any implementation of the aforementioned embodiment of the present application may be applied to the processor 600, or implemented by the processor 600.
[0108] The processor 600 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 600. The above processor 600 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 601, and the processor 600 reads the information in the memory 601 and completes the steps of the above method in combination with its hardware.
[0109] The electronic device provided in the embodiment of the present application and the key management method provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, operated or implemented therein.
[0110] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0111] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention patent shall be subject to the attached claims.
Claims
1. A key management method, characterized in that: For the server, including: Generate data key; Receive the client's interface call information for the data key; Verify the interface call information, including performing authority verification on the name information and IP address information of the client in the interface call information; if the authority verification passes, determine whether the private key of the interface key in the interface call information matches the public key of the interface key stored locally; if they match, determine that the verification is passed; if the verification passes, send the encrypted data key ciphertext and encryption algorithm of the interface to the client; so that the client generates a unified data processing template based on the encryption algorithm, and uses the data processing template to encrypt the business data; Receive local basic information and key usage statistics reported by the client; the local basic information includes service name, server address, and current version number; The status of the installed client is monitored according to the local basic information and the key usage statistics information, and the key usage statistics information is processed and displayed.
2. The method according to claim 1, characterized in that Generating a data key involves: Generate a master key based on a preset key generation algorithm and a root key; A data key is generated based on the master key.
3. The method according to claim 1, characterized in that After the data key is generated, it also includes: The data key is stored in a database by means of a security plug-in; The system code data and the configuration data are stored in the server.
4. A key management method, characterized in that: For clients, including: Open a key management service system account and upload access blacklist and whitelist; Query the interface key corresponding to the client according to the key management service system account; Call the data key acquisition interface; so that the server receives the interface call information of the client for the data key; so that the server verifies the interface call information, including performing authority verification on the name information and IP address information of the client in the interface call information; if the authority verification passes, determine whether the private key of the interface key in the interface call information matches the public key of the interface key stored locally; if they match, determine that the verification is passed; if the verification is passed, send the interface encrypted data key ciphertext and encryption algorithm to the client; Receive the encrypted data key ciphertext and encryption algorithm returned by the server; Decrypt the data key ciphertext according to the corresponding decryption algorithm and the interface key to obtain the data key plaintext; Generate a unified data processing template based on the encryption algorithm, and use the data processing template to encrypt the business data; Local basic information and key usage statistics are collected at preset intervals, wherein the local basic information includes the service name, server address, and current version number; the collected local basic information and key usage statistics are reported to the server, so that the server monitors the status of the installed client according to the local basic information and key usage statistics, and processes and displays the key usage statistics.
5. A key management system, characterized in that: Including client and server, Among them, the server is used to generate data keys; The client is used to open a key management service system account and upload an access blacklist and whitelist; query the interface key corresponding to the client according to the key management service system account; call the data key acquisition interface; The server is used to verify the interface call information of the data key, including performing permission verification on the name information and IP address information of the client in the interface call information; if the permission verification passes, it is determined whether the private key of the interface key in the interface call information matches the public key of the interface key stored locally; if they match, it is determined that the verification is passed; if the verification passes, the encrypted data key ciphertext and encryption algorithm after the interface is returned; The client is used to receive the data key ciphertext and encryption algorithm encrypted by the interface, and decrypt the data key ciphertext by using the corresponding decryption algorithm and interface key to obtain the data key plaintext; The client is used to generate a unified data processing template according to the encryption algorithm, and use the data processing template to encrypt the business data; The client is used to collect local basic information and key usage statistics at every preset period, wherein the local basic information includes a service name, a server address, and a current version number; and report the collected local basic information and key usage statistics to the server; The server is used to monitor the status of the installed client according to the local basic information and the key usage statistics information, and process and display the key usage statistics information.
