Configuration encryption method and device and computer readable storage medium

By using the encryption plug-in and the encryption machine in the configuration center to generate and store the encryption configuration file, and only managing the key on the encryption machine, the problem in the existing technology that the configuration file is encrypted but the key is not protected is solved, and security is improved.

CN118606964APending Publication Date: 2024-09-06SHENZHEN XINGUODU TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410556242.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-07
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Although the existing configuration center provides an encryption function when storing configuration files, it does not protect the keys. As a result, personnel with database authority can decrypt the configuration files, resulting in low security.

Method used

By obtaining the confidentiality attribute of the initial configuration file, using the encryption plug-in to communicate with the encryption machine, the encryption configuration file is generated and stored, and the key is only managed in the encryption machine to ensure that only the encryption configuration file, not the key, is stored in the database.

Benefits of technology

It effectively reduces the occurrence of security incidents, improves the security of configuration files, and prevents personnel with database authority from deciphering configuration files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118606964A
    Figure CN118606964A
Patent Text Reader

Abstract

The embodiment of the invention discloses a configuration encryption method and device and a computer readable storage medium. The security can be improved. The method comprises the steps of obtaining an initial configuration file; determining the confidentiality attribute of the initial configuration file; when the confidentiality attribute is represented as confidentiality, obtaining an encryption plug-in according to the initial configuration file; sending an encryption request to an encryption machine by using the encryption plug-in, so that the encryption machine encrypts the initial configuration file to generate an encrypted configuration file; receiving the encryption configuration file returned by the encryption machine; and storing the encrypted configuration file into a database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data processing technology, and in particular to a configuration encryption method, device, and computer-readable storage medium. Background Art

[0002] During project development, it is often necessary to put configuration files into the configuration center to separate configuration content from code.

[0003] However, in general, the configuration center stores configuration files in plain text by default, which means that people with database permissions can view the contents of the configuration files of various projects at will, which can easily lead to security incidents. Some configuration centers can provide configuration encryption functions, but they only encrypt the configuration files without any protection for the keys. The ciphertext and key are directly stored in the database. Although the configuration files are encrypted, people with database permissions can obtain the ciphertext and key, and use the key to decrypt the ciphertext and finally obtain the plain text of the configuration files. Therefore, the security is still relatively low. Summary of the invention

[0004] The embodiments of the present application provide a configuration encryption method, device, and computer-readable storage medium, which can improve security.

[0005] A first aspect of an embodiment of the present application provides a configuration encryption method, including:

[0006] Get the initial configuration file;

[0007] Determining a confidentiality attribute of the initial configuration file;

[0008] When the confidentiality attribute is characterized as confidentiality, obtaining an encryption plug-in according to the initial configuration file;

[0009] Using the encryption plug-in to send an encryption request to the encryption machine, so that the encryption machine encrypts the initial configuration file to generate an encrypted configuration file;

[0010] Receiving the encryption configuration file returned by the encryption machine;

[0011] The encrypted configuration file is stored in a database.

[0012] Optionally, obtaining the encryption plug-in according to the initial configuration file includes:

[0013] Parsing the name of the initial configuration file to determine the target encryption method;

[0014] Get the encryption plug-in name corresponding to the target encryption method;

[0015] Obtain an encryption plug-in according to the encryption plug-in name.

[0016] Optionally, the using the encryption plug-in to send an encryption request to an encryption machine includes:

[0017] Determine whether there is an encryption key corresponding to the initial configuration file;

[0018] If it exists, the encryption plug-in is used to send an encryption request to the encryption machine to encrypt the initial configuration file using the encryption key.

[0019] Optionally, after determining whether there is an encryption key corresponding to the initial configuration file, the method further includes:

[0020] If it does not exist, sending a key generation request to the encryption machine, so that the encryption machine generates an encryption key corresponding to the initial configuration file according to the key generation request;

[0021] After receiving the key generation response from the encryption machine, the encryption plug-in is used to send an encryption request to the encryption machine to encrypt the initial configuration file using the encryption key.

[0022] Optionally, the determining whether there is an encryption key corresponding to the initial configuration file includes:

[0023] Get the name of the initial configuration file;

[0024] It is determined whether there is an encryption key corresponding to the initial configuration file according to the name of the initial configuration file.

[0025] Optionally, judging whether there is an encryption key corresponding to the initial configuration file according to the name of the initial configuration file includes:

[0026] Matching the historical configuration encryption record by the name of the initial configuration file to obtain a matching result;

[0027] It is determined according to the matching result whether there is an encryption key corresponding to the initial configuration file.

[0028] Optionally, the determining the confidentiality attribute of the initial configuration file includes:

[0029] The confidentiality attribute is determined according to the name of the initial configuration file.

[0030] Optionally, after storing the encrypted configuration file in the database, the method further includes:

[0031] When the configuration needs to be read, the encrypted configuration file is obtained from the database;

[0032] Obtaining a decryption plug-in according to the encrypted configuration file;

[0033] Sending a decryption request to the encryption machine through the decryption plug-in, so that the encryption machine decrypts the encrypted configuration file to generate a decrypted configuration file;

[0034] Receive the decryption configuration file returned by the encryption machine.

[0035] A second aspect of an embodiment of the present application provides a configuration encryption device, including:

[0036] A first acquisition unit, used to acquire an initial configuration file;

[0037] A determination unit, configured to determine a confidentiality attribute of the initial configuration file;

[0038] A second acquisition unit, configured to acquire an encryption plug-in according to the initial configuration file when the confidentiality attribute is characterized as confidentiality;

[0039] A sending unit, configured to send an encryption request to an encryption machine using the encryption plug-in, so that the encryption machine encrypts the initial configuration file to generate an encrypted configuration file;

[0040] A receiving unit, configured to receive the encrypted configuration file returned by the encryption machine;

[0041] The storage unit is used to store the encrypted configuration file in a database.

[0042] Optionally, the second acquiring unit is specifically configured to:

[0043] Parsing the name of the initial configuration file to determine the target encryption method;

[0044] Get the encryption plug-in name corresponding to the target encryption method;

[0045] Obtain an encryption plug-in according to the encryption plug-in name.

[0046] Optionally, the sending unit includes:

[0047] A determination module, used to determine whether there is an encryption key corresponding to the initial configuration file;

[0048] The first sending module is used to use the encryption plug-in to send an encryption request for encrypting the initial configuration file using the encryption key to the encryption machine when the judgment module determines that there is an encryption key corresponding to the initial configuration file.

[0049] Optionally, the sending unit further includes:

[0050] A second sending module is used to send a key generation request to the encryption machine when the judgment module determines that the encryption key corresponding to the initial configuration file does not exist, so that the encryption machine generates the encryption key corresponding to the initial configuration file according to the key generation request;

[0051] The third sending module is used to use the encryption plug-in to send an encryption request to the encryption machine to encrypt the initial configuration file using the encryption key after receiving the key generation response from the encryption machine.

[0052] Optionally, the judging module includes:

[0053] An acquisition submodule is used to acquire the name of the initial configuration file;

[0054] The judgment submodule is used to judge whether there is an encryption key corresponding to the initial configuration file according to the name of the initial configuration file.

[0055] Optionally, the judgment submodule is specifically used for:

[0056] Matching the historical configuration encryption record by the name of the initial configuration file to obtain a matching result;

[0057] It is determined according to the matching result whether there is an encryption key corresponding to the initial configuration file.

[0058] Optionally, the determining unit is specifically configured to:

[0059] The confidentiality attribute is determined according to the name of the initial configuration file.

[0060] Optionally, the configuration encryption device further includes a decryption unit, and the decryption unit is used to:

[0061] When the configuration needs to be read, the encrypted configuration file is obtained from the database;

[0062] Obtaining a decryption plug-in according to the encrypted configuration file;

[0063] Sending a decryption request to the encryption machine through the decryption plug-in, so that the encryption machine decrypts the encrypted configuration file to generate a decrypted configuration file;

[0064] Receive the decryption configuration file returned by the encryption machine.

[0065] A third aspect of an embodiment of the present application provides a configuration encryption device, including:

[0066] Processor, memory, input-output unit, and bus;

[0067] The processor is connected to the memory, the input and output unit, and the bus;

[0068] A program is stored in the memory, and the processor calls the program to execute the method in the first aspect and any possible implementation manner of the first aspect.

[0069] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, on which a program is stored. When the program is executed on a computer, the computer executes the method in the first aspect and any possible implementation of the first aspect.

[0070] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0071] The configuration encryption method provided in the embodiment of the present application first uses an encryption machine to generate an encrypted configuration file for the initial configuration file, and then stores the encrypted configuration file in a database. Since the database only stores the encrypted configuration file but not the encryption key, even if a person with database authority accesses the database and obtains the encrypted configuration file, he or she cannot decipher the initial configuration file. Therefore, the occurrence of security accidents can be reduced and security is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] Figure 1 A schematic diagram of a flow chart of an embodiment of a method for configuring encryption in an embodiment of the present application;

[0073] Figure 2 A schematic diagram of a process for obtaining an encryption plug-in in an embodiment of the present application;

[0074] Figure 3 A schematic diagram of a flow chart of an embodiment of sending an encryption request to an encryption machine in an embodiment of the present application;

[0075] Figure 4 A schematic diagram of a flow chart of an embodiment of reading an encrypted configuration file in an embodiment of the present application;

[0076] Figure 5 A schematic diagram of the structure of an embodiment of configuring an encryption device in an embodiment of the present application;

[0077] Figure 6 This is a structural diagram of another embodiment of configuring an encryption device in the embodiments of the present application. DETAILED DESCRIPTION

[0078] Embodiments of the present application provide a configuration encryption method, device, and computer-readable storage medium for improving security.

[0079] The method of the present application can be applied to a server, a terminal or other devices with logic processing capabilities, and the present application does not limit this. For the convenience of description, the following description is made by taking the execution subject as a server as an example.

[0080] The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0081] See also Figure 1 In the embodiment of the present application, an embodiment of the configuration encryption method includes:

[0082] 101. Obtain an initial configuration file;

[0083] In actual applications, during the project development process, after the user writes the initial configuration file, the initial configuration file will be sent to the server. The server obtains the initial configuration file and manages the initial configuration file.

[0084] 102. Determine the confidentiality attribute of the initial configuration file;

[0085] After the server obtains the initial configuration file, it first needs to determine the confidentiality attribute of the initial configuration file. When the confidentiality attribute of the initial configuration file is characterized as confidential, the initial configuration file needs to be encrypted. When the confidentiality attribute of the initial configuration file is characterized as normal, the initial configuration file does not need to be encrypted and can be directly processed in plain text.

[0086] Furthermore, in order to improve processing efficiency, the confidentiality attribute information may be included in the name of the initial configuration file. After the server obtains the initial configuration file, it directly parses the name of the initial configuration file to quickly determine the confidentiality attribute of the initial configuration file.

[0087] 103. When the confidentiality attribute is characterized as confidentiality, obtaining an encryption plug-in according to the initial configuration file;

[0088] When the confidentiality attribute of the initial configuration file is characterized as confidentiality, the server needs to perform encryption operations on the initial configuration file, and then perform subsequent processing after obtaining the ciphertext. In the embodiment of the present application, the server uses an encryption machine to encrypt the initial configuration file. Specifically, the server uses an encryption plug-in to communicate with the encryption machine and requests the encryption machine to perform encryption, decryption and other operations. During the encryption and decryption process, the encryption machine will not feed back the key (including encryption key and decryption key, etc.) to the server, and the key is saved by the encryption machine. Therefore, in order to request the encryption machine to encrypt the initial configuration file, the server needs to first obtain the encryption plug-in according to the initial configuration file.

[0089] 104. Use the encryption plug-in to send an encryption request to the encryption machine;

[0090] After obtaining the encryption plug-in, the server can use the encryption plug-in to send an encryption request to the encryption machine. While sending the encryption request, the server also needs to send the initial configuration file to the encryption machine. In the embodiment of the present application, the server can first package the initial configuration file in the encryption request and then send the encryption request to the encryption machine, or it can not package the initial configuration file in the encryption request, and when sending the encryption request, it also sends the initial configuration file to the encryption machine. This embodiment of the present application does not limit this.

[0091] 105. Receive the encryption configuration file returned by the encryption machine;

[0092] Regardless of whether the server packages the initial configuration file in the encryption request and only sends the encryption request to the encryption machine, or sends the initial configuration file and the encryption request together independently of the encryption request, the encryption machine can directly or indirectly obtain the initial configuration file when it receives the encryption request. In response to the encryption request, the encryption machine will encrypt the initial configuration file to obtain the encrypted configuration file, which is the ciphertext of the initial configuration file. After obtaining the encrypted configuration file, the encryption machine will send the encrypted configuration file back to the server, and the server can receive the encrypted configuration file.

[0093] 106. Store the encrypted configuration file in the database.

[0094] After obtaining the encrypted configuration file, the server can store the encrypted configuration file in the database for persistent storage.

[0095] In this embodiment, after the server obtains the initial configuration file, it first determines the confidentiality attribute of the initial configuration file. If the confidentiality attribute is characterized as confidentiality, the server obtains the encryption plug-in according to the initial configuration file, and then uses the encryption plug-in to communicate with the encryption machine, requests the encryption machine to encrypt the initial configuration file and receives the encrypted configuration file returned by the encryption machine, and finally stores the encrypted configuration file in the database for persistent storage. The server stores only the ciphertext of the initial configuration file (i.e., the encrypted configuration file) in the server, and the encryption key and decryption key are managed by the encryption machine. Personnel with database authority can only obtain the encrypted configuration file when accessing the database, but cannot obtain the decryption key of the encrypted configuration file managed by the encryption machine, so personnel with database authority cannot obtain the initial configuration file. Therefore, the configuration encryption method provided in the embodiment of the present application can reduce the occurrence of security incidents and improve security.

[0096] See also Figure 2 According to some embodiments of the present application, step 103 of obtaining an encryption plug-in according to an initial configuration file may include the following steps 201 to 203.

[0097] 201. Parse the name of the initial configuration file to determine the target encryption method;

[0098] In a possible embodiment, information about the encryption mode (target encryption mode) of the initial configuration file is included in the name of the initial configuration file. The server can determine the target encryption mode by parsing the name of the initial configuration file.

[0099] 202. Obtain the encryption plug-in name corresponding to the target encryption method;

[0100] In the embodiment of the present application, different encryption methods correspond to different encryption plug-ins, and the server can determine the encryption plug-in name according to the target encryption method.

[0101] 203. Obtain the encryption plug-in according to the encryption plug-in name.

[0102] After the server determines the encryption plug-in name, it can use the encryption plug-in name to query whether the corresponding encryption plug-in is deployed in the plug-in library. If so, the encryption plug-in can be dynamically loaded; if not, the corresponding information can be fed back to the user, such as reminding the user to use other encryption methods to perform encryption operations on the initial configuration file, or reminding the user to add the plug-in corresponding to the encryption plug-in name to the plug-in library, or only prompting an error message, etc.

[0103] In this embodiment, multiple encryption methods are provided, and the user can flexibly select the encryption method of the initial configuration file. In addition, the server dynamically loads the encryption plug-in, and only loads the encryption plug-in when needed, which can save system resources of the server.

[0104] See also Figure 3 According to some embodiments of the present application, step 104 of sending an encryption request to the encryption machine using the encryption plug-in may include the following steps 301 to 306.

[0105] 301. Get the name of the initial configuration file;

[0106] In some embodiments of the present application, a project often includes multiple configuration files. For different configuration files, users can choose the same or different encryption methods. For different versions of the same configuration file, they have the same name. If the server has encrypted the configuration file before, then when the user uploads another version of the configuration file in the future, the encryption method of the configuration file may not be declared. The server can use the encryption plug-in that was used for the historical version of the configuration file to encrypt the configuration file. For multiple configuration files, the server distinguishes them by the name of the configuration file. Therefore, when receiving the initial configuration file, the server needs to obtain the name of the initial configuration file.

[0107] Furthermore, in addition to distinguishing by the name of the configuration file, for configuration files with the same name, it is also possible to determine whether the same encryption key is used for encryption based on the version number. For example, for configuration files with the same name in the same major version (for example, version 1.1.1, version 1.2.1, version 1.3.2 belong to the same major version, version 2.1.1 and version 1.1.1 belong to different major versions, and the first digit of the version number is the same, which means they are the same major version), the same encryption method is used.

[0108] 302. Match the historical configuration encryption record by the name of the initial configuration file to obtain a matching result;

[0109] After the server obtains the name of the initial configuration file, it can use the name of the initial configuration file to match the historical configuration encryption record to obtain a matching result, and the matching result includes "record" or "no record". When the matching result is characterized as "record", it indicates that the server has encrypted the historical version of the initial configuration file. When the matching result is characterized as "no record", it indicates that the server is performing processing on the initial configuration file for the first time. In the embodiment of the present application, the encryption operation of the configuration file and the management of keys (including encryption keys and decryption keys) are all performed by the encryption machine. The keys will not be returned to the server, and extremely high permissions are required to use the server to query the encryption machine whether the keys exist. Therefore, under normal circumstances, after the server uses the encryption plug-in to encrypt a configuration file, the corresponding configuration encryption record will be saved, thereby forming a historical configuration encryption record. When it is necessary to determine whether there are keys for different versions of the configuration file, the server makes a judgment by querying the historical configuration encryption record.

[0110] 303. Determine whether there is an encryption key corresponding to the initial configuration file according to the matching result. If yes, execute step 304. If no, execute steps 305 to 306.

[0111] The server determines whether there is an encryption key corresponding to the initial configuration file based on the matching result. When the matching result is characterized as "recorded", it can be determined that there is an encryption key corresponding to the initial configuration file, and the server can execute step 304 at this time; when the matching result is characterized as "no record", it can be determined that there is no encryption key corresponding to the initial configuration file, and the server can execute steps 305 to 306 at this time.

[0112] 304. Using the encryption plug-in, an encryption request for encrypting the initial configuration file using the encryption key is sent to the encryption machine;

[0113] When the server determines that there is an encryption key corresponding to the initial configuration file, the server can directly use the encryption plug-in to send an encryption request to the encryption machine to encrypt the initial configuration file using the encryption key.

[0114] 305. Send a key generation request to the encryption machine, so that the encryption machine generates an encryption key corresponding to the initial configuration file according to the key generation request;

[0115] When the server determines that there is no encryption key corresponding to the initial configuration file, it can send a key generation request to the encryption machine. After receiving the key generation request, the encryption machine can generate the encryption key corresponding to the initial configuration file according to the key generation request.

[0116] 306. After receiving the key generation response from the encryption machine, use the encryption plug-in to send an encryption request to the encryption machine to encrypt the initial configuration file using the encryption key.

[0117] After the encryption machine generates the encryption key corresponding to the initial configuration file according to the key generation request, it can send a key generation response to the server, which indicates that the encryption machine has generated the encryption key. After receiving the key generation response, the server can use the encryption plug-in to send an encryption request to the encryption machine to encrypt the initial configuration file using the encryption key.

[0118] In this embodiment, it is possible to determine whether an encryption key exists according to the name of the configuration file. After the server encrypts the initial configuration file with the same name, the user does not need to specify the encryption method of the subsequent version of the initial configuration file, which provides convenience for the user and improves the user experience. At the same time, it can also save the storage resources of the encryption machine.

[0119] See also Figure 4 According to some embodiments of the present application, after the encrypted configuration file is stored in the database in step 106, the encrypted configuration file may be further read, and the reading of the encrypted configuration file includes the following steps 401 to 404:

[0120] 401. When the configuration needs to be read, the encrypted configuration file is obtained from the database;

[0121] After the initial configuration file is released (ie, after the encrypted configuration file is stored in the database), if the server needs to read the configuration file, it can obtain the encrypted configuration file from the database.

[0122] 402. Obtain the decryption plug-in according to the encrypted configuration file;

[0123] After obtaining the encrypted configuration file, the server needs to decrypt the encrypted configuration file before reading the configuration information. The process of obtaining the decryption plug-in is similar to steps 201 to 203 in the aforementioned embodiment and will not be repeated here.

[0124] 403. Send a decryption request to the encryption machine through the decryption plug-in;

[0125] After the server obtains the decryption plug-in, it can use the decryption plug-in to send a decryption request to the encryption machine to request the encryption machine to decrypt the encrypted configuration file. Because the encrypted configuration file is obtained by encryption by the encryption machine, the encryption machine manages the encryption key of the initial configuration file and the decryption key of the encrypted configuration file. Therefore, after the encryption machine receives the decryption request, it can use the decryption key to perform a decryption operation on the encrypted configuration file to obtain a decrypted configuration file.

[0126] 404. Receive the decryption configuration file returned by the encryption machine.

[0127] The encryption machine uses the decryption key to perform a decryption operation on the encrypted configuration file. After obtaining the decrypted configuration file, the decrypted configuration file can be returned to the server as a decryption response corresponding to the decryption request. The server can receive the decrypted configuration file. At this point, the server can perform an operation to read the decrypted configuration file.

[0128] In this embodiment, the encryption of the initial configuration file and the decryption of the encrypted configuration file are both performed by the encryption machine. The server cannot obtain the relevant encryption key and decryption key. Even if the server is invaded, the invader cannot obtain the encryption key and the decryption key, which is conducive to improving security.

[0129] See also Figure 5 In the embodiment of the present application, an embodiment of configuring an encryption device includes:

[0130] A first acquisition unit 501 is used to acquire an initial configuration file;

[0131] A determination unit 502, configured to determine a confidentiality attribute of an initial configuration file;

[0132] The second acquisition unit 503 is used to acquire the encryption plug-in according to the initial configuration file when the confidentiality attribute is characterized as confidentiality;

[0133] The sending unit 504 is used to send an encryption request to the encryption machine using the encryption plug-in, so that the encryption machine encrypts the initial configuration file to generate an encrypted configuration file;

[0134] The receiving unit 505 is used to receive the encryption configuration file returned by the encryption machine;

[0135] The storage unit 506 is used to store the encrypted configuration file in the database.

[0136] In this embodiment, after the first acquisition unit 501 acquires the initial configuration file, the determination unit 502 first determines the confidentiality attribute of the initial configuration file. If the confidentiality attribute is characterized as confidentiality, the second acquisition unit 503 acquires the encryption plug-in according to the initial configuration file, and the sending unit 504 uses the encryption plug-in to communicate with the encryption machine, requesting the encryption machine to encrypt the initial configuration file, and the receiving unit 505 receives the encrypted configuration file returned by the encryption machine, and finally the storage unit 506 stores the encrypted configuration file in the database for persistent storage. The server stores only the ciphertext of the initial configuration file (i.e., the encrypted configuration file) in the server, and the encryption key and the decryption key are managed by the encryption machine. The personnel with database authority can only obtain the encrypted configuration file when accessing the database, but cannot obtain the decryption key of the encrypted configuration file managed by the encryption machine, so the personnel with database authority cannot get the initial configuration file. Therefore, the configuration encryption method provided in the embodiment of the present application can reduce the occurrence of security accidents and improve security.

[0137] Optionally, the second obtaining unit 503 may be specifically configured to:

[0138] Parse the name of the initial configuration file to determine the target encryption method;

[0139] Get the encryption plug-in name corresponding to the target encryption method;

[0140] Get the encryption plugin based on the encryption plugin name.

[0141] Optionally, the sending unit 504 may include:

[0142] A judgment module, used to judge whether there is an encryption key corresponding to the initial configuration file;

[0143] The first sending module is used to use the encryption plug-in to send an encryption request for encrypting the initial configuration file using the encryption key to the encryption machine when the judgment module determines that the encryption key corresponding to the initial configuration file exists.

[0144] Optionally, the sending unit 504 may further include:

[0145] A second sending module is used to send a key generation request to the encryption machine when the judgment module determines that the encryption key corresponding to the initial configuration file does not exist, so that the encryption machine generates the encryption key corresponding to the initial configuration file according to the key generation request;

[0146] The third sending module is used to use the encryption plug-in to send an encryption request for encrypting the initial configuration file using the encryption key to the encryption machine after receiving the key generation response from the encryption machine.

[0147] Optionally, the judgment module may include:

[0148] Get the submodule to get the name of the initial configuration file;

[0149] The judgment submodule is used to judge whether there is an encryption key corresponding to the initial configuration file according to the name of the initial configuration file.

[0150] Optionally, the judgment submodule can be specifically used for:

[0151] Match the historical configuration encryption record with the name of the initial configuration file to obtain a matching result;

[0152] It is determined based on the matching result whether there is an encryption key corresponding to the initial configuration file.

[0153] Optionally, the determining unit 502 may be specifically configured to:

[0154] The confidentiality attribute is determined by the name of the initial configuration file.

[0155] Optionally, the configuration encryption device further includes a decryption unit, and the decryption unit is used to:

[0156] When the configuration needs to be read, the encrypted configuration file is obtained from the database;

[0157] Obtaining a decryption plug-in according to the encrypted configuration file;

[0158] Sending a decryption request to the encryption machine through the decryption plug-in, so that the encryption machine decrypts the encrypted configuration file to generate a decrypted configuration file;

[0159] Receive the decryption configuration file returned by the encryption machine.

[0160] See also Figure 6 Another embodiment of configuring the encryption device in the embodiment of the present application includes:

[0161] Processor 601, memory 602, input and output unit 603 and bus 604;

[0162] The processor 601 is connected to the memory 602, the input and output unit 603 and the bus 604;

[0163] The memory 602 stores a program, and the processor 601 calls the program to execute Figures 1 to 3 Steps in the illustrated embodiment.

[0164] In this embodiment, the function of the processor 601 is the same as that of the aforementioned Figures 1 to 3 The steps in the illustrated embodiments correspond to each other and will not be described again here.

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

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

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

[0168] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0169] If the integrated unit is implemented in the form of 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 the present application is essentially 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, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

Claims

1. A configuration encryption method, It is characterized in that include: Get the initial configuration file; Determining a confidentiality attribute of the initial configuration file; When the confidentiality attribute is characterized as confidentiality, obtaining an encryption plug-in according to the initial configuration file; Using the encryption plug-in to send an encryption request to the encryption machine, so that the encryption machine encrypts the initial configuration file to generate an encrypted configuration file; Receiving the encryption configuration file returned by the encryption machine; The encrypted configuration file is stored in a database.

2. The method according to claim 1, It is characterized in that The obtaining of the encryption plug-in according to the initial configuration file comprises: Parsing the name of the initial configuration file to determine the target encryption method; Get the encryption plug-in name corresponding to the target encryption method; Obtain an encryption plug-in according to the encryption plug-in name.

3. The method according to claim 1, It is characterized in that The sending of the encryption request to the encryption machine by using the encryption plug-in comprises: Determine whether there is an encryption key corresponding to the initial configuration file; If it exists, the encryption plug-in is used to send an encryption request to the encryption machine to encrypt the initial configuration file using the encryption key.

4. The method according to claim 3, It is characterized in that After determining whether there is an encryption key corresponding to the initial configuration file, the method further includes: If it does not exist, sending a key generation request to the encryption machine, so that the encryption machine generates an encryption key corresponding to the initial configuration file according to the key generation request; After receiving the key generation response from the encryption machine, the encryption plug-in is used to send an encryption request to the encryption machine to encrypt the initial configuration file using the encryption key.

5. The method according to claim 3 or 4, It is characterized in that The determining whether there is an encryption key corresponding to the initial configuration file includes: Get the name of the initial configuration file; It is determined whether there is an encryption key corresponding to the initial configuration file according to the name of the initial configuration file.

6. The method according to claim 5, It is characterized in that The determining, according to the name of the initial configuration file, whether there is an encryption key corresponding to the initial configuration file comprises: Matching the historical configuration encryption record by the name of the initial configuration file to obtain a matching result; It is determined according to the matching result whether there is an encryption key corresponding to the initial configuration file.

7. The method according to claim 1, It is characterized in that After storing the encrypted configuration file in the database, the method further includes: When the configuration needs to be read, the encrypted configuration file is obtained from the database; Obtaining a decryption plug-in according to the encrypted configuration file; Sending a decryption request to the encryption machine through the decryption plug-in, so that the encryption machine decrypts the encrypted configuration file to generate a decrypted configuration file; Receive the decryption configuration file returned by the encryption machine.

8. A configuration encryption device, It is characterized in that include: A first acquisition unit, used to acquire an initial configuration file; A determination unit, configured to determine a confidentiality attribute of the initial configuration file; A second acquisition unit, configured to acquire an encryption plug-in according to the initial configuration file when the confidentiality attribute is characterized as confidentiality; A sending unit, configured to send an encryption request to an encryption machine using the encryption plug-in, so that the encryption machine encrypts the initial configuration file to generate an encrypted configuration file; A receiving unit, configured to receive the encrypted configuration file returned by the encryption machine; The storage unit is used to store the encrypted configuration file in a database.

9. A configuration encryption device, It is characterized in that include: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and output unit, and the bus; A program is stored in the memory, and the processor calls the program to execute the method according to any one of claims 1 to 7. 10 . A computer-readable storage medium having a program stored thereon, wherein when the program is executed on a computer, the computer is caused to execute the method according to claim 1 .