Communication control method and device
By using random algorithms in the key negotiation configuration file in the communication system to generate and process character strings, we ensure the negotiation and use of communication keys, solve the problem of business interruption caused by inconsistent key updates, and improve the reliability and security of communication sex.
Patent Information
- Application Number
- CN202411215036.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-08-30
AI Technical Summary
When the existing communication system is updated with keys, the communication parties must keep pace with each other, otherwise it will easily lead to service interruption and affect communication reliability.
By configuring the same key negotiation configuration file between both parties in the communication, a random algorithm is used to generate a string, and the string is processed according to the version identification of the key negotiation configuration file, verification information and configuration items are generated, and key negotiation requests are generated. Messages and confirmation messages ensure the negotiation and use of communication keys.
It realizes that even if the key negotiation configuration file is not synchronized during the update process, communication services will not be interrupted, and communication reliability and security are improved.
Smart Images

Figure CN118972052A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication security technology, and in particular to a communication control method and device. Background Art
[0002] Currently, both parties in communication usually use symmetric encryption to encrypt and decrypt messages, and use configuration files or databases to manage the keys used.
[0003] In order to improve security, the key needs to be updated. However, when updating the key, both parties must keep the same pace, otherwise the communication service will be interrupted.
[0004] Therefore, there is an urgent need for a technical solution that can improve communication reliability. Summary of the invention
[0005] In view of this, the present application provides a communication control method and device to improve communication reliability. As follows:
[0006] A communication control method is applied to a first device, wherein the first device is configured with a first key negotiation configuration file, and a second device is configured with a second key negotiation configuration file, wherein the first key negotiation configuration file is the same as the second key negotiation configuration file, and the key negotiation configuration file includes a plurality of key configuration items, wherein the key configuration items include an algorithm identifier and an encryption and decryption key, and the algorithm identifier represents a corresponding encryption and decryption algorithm;
[0007] Wherein, the method comprises:
[0008] Generate a first character string according to a random algorithm;
[0009] Processing the first character string according to the version identifier of the first key agreement configuration file to obtain verification information and a first configuration item in the first key agreement configuration file;
[0010] generating a key agreement request message based at least on the first character string and the verification information;
[0011] The key negotiation request message is sent to the second device, so that the second device, when the second device passes the legitimacy verification of the verification information in the key negotiation request message, uses the encryption and decryption algorithm corresponding to the second configuration item to encrypt the communication key according to the corresponding encryption and decryption key to generate a key negotiation confirmation message, wherein the key negotiation confirmation message at least includes: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file;
[0012] receiving the key negotiation confirmation message sent by the second device;
[0013] The communication key in the key negotiation confirmation message is decrypted according to the first configuration item, so that the first device and the second device perform encrypted communication using the communication key.
[0014] The above method preferably processes the first character string according to the version identifier of the first key agreement configuration file to obtain verification information and the first configuration item in the first key agreement configuration file, including:
[0015] Obtaining first summary information according to the version identifier of the first key agreement configuration file and the first character string;
[0016] Obtaining a first index identifier according to the first summary information;
[0017] Obtaining, according to the first index identifier, a corresponding first configuration item in the first key agreement configuration file;
[0018] According to the first configuration item, the first index identifier and the first character string are processed to obtain second summary information; the first summary information and the second summary information constitute verification information.
[0019] Preferably, the method above, obtaining the first summary information according to the version identifier of the first key agreement configuration file and the first character string, includes:
[0020] Obtaining a second character string according to the version identifier of the first key agreement configuration file and the first character string;
[0021] The second character string is processed using a digest algorithm to obtain first digest information.
[0022] Preferably, the above method processes the first index identifier and the first character string according to the first configuration item to obtain second summary information, including:
[0023] Convert the first index identifier into a character string to obtain a third character string;
[0024] Encrypting the first character string using the encryption and decryption algorithm corresponding to the first configuration item according to the corresponding encryption and decryption key to obtain a fourth character string;
[0025] Obtain a fifth character string according to the third character string and the fourth character string;
[0026] The fifth character string is processed using a digest algorithm to obtain second digest information.
[0027] A communication control method is applied to a second device, the second device is configured with a second key negotiation configuration file, the first device is configured with a first key negotiation configuration file, the first key negotiation configuration file is the same as the second key negotiation configuration file, and the key negotiation configuration file includes a plurality of key configuration items, the key configuration items include an algorithm identifier and an encryption and decryption key, and the algorithm identifier represents a corresponding encryption and decryption algorithm;
[0028] Wherein, the method comprises:
[0029] receiving a key negotiation request message sent by the first device; the key negotiation request message is generated by the first device according to a first character string and verification information, the first character string is generated according to a random algorithm, the verification information is obtained by processing the first character string according to a version identifier of the first key negotiation configuration file, and the first device further processes the first character string according to the version identifier of the first key negotiation configuration file to obtain a first configuration item in the first key negotiation configuration file;
[0030] Performing legitimacy verification on the verification information in the key negotiation request message according to the version identifier of the second key negotiation configuration file;
[0031] When the verification information in the key negotiation request message passes the legitimacy verification, encrypt the communication key according to the corresponding encryption and decryption key using the encryption and decryption algorithm corresponding to the second configuration item to generate a key negotiation confirmation message, wherein the key negotiation confirmation message at least includes: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file;
[0032] The key negotiation confirmation message is sent to the first device, so that the first device decrypts the communication key in the key negotiation confirmation message according to the first configuration item, so that the first device and the second device perform encrypted communication using the communication key.
[0033] The above method preferably performs legitimacy verification on the verification information in the key negotiation request message according to the version identifier of the second key negotiation configuration file, including:
[0034] Obtaining third summary information according to the version identifier of the second key agreement configuration file and the first character string;
[0035] Comparing the third summary information with the first summary information in the verification information to obtain a first verification result; the first summary information is obtained according to the version identifier of the first key agreement configuration file and the first character string;
[0036] When the first verification result indicates that the first summary information has passed verification, obtaining a second index identifier according to the third summary information; when the first verification result indicates that the first summary information has not passed verification, determining that the validity verification of the verification information has not passed;
[0037] Obtaining, according to the second index identifier, a corresponding second configuration item in the second key agreement configuration file;
[0038] According to the second configuration item, the second index identifier and the first character string are processed to obtain fourth summary information;
[0039] The fourth summary information is compared with the second summary information in the verification information to obtain a second verification result; the second verification result indicates whether the second summary information is verified; the second summary information is obtained by the first device processing the first index identifier and the first character string according to the first configuration item, and the first index identifier is obtained by the first device according to the first summary information; the first configuration item is obtained by the first device in the first key agreement configuration file according to the first index identifier;
[0040] If the second verification result indicates that the second summary information has passed verification, it is determined that the verification information has passed legality verification; if the second verification result indicates that the second summary information has not passed verification, it is determined that the verification information has not passed legality verification.
[0041] Preferably, the method above, obtaining the third summary information according to the version identifier of the second key agreement configuration file and the first character string, includes:
[0042] Obtaining a sixth character string according to the version identifier of the second key agreement configuration file and the first character string;
[0043] The sixth character string is processed using a digest algorithm to obtain third digest information.
[0044] Preferably, the above method processes the second index identifier and the first character string according to the second configuration item to obtain fourth summary information, including:
[0045] Performing string conversion on the second index identifier to obtain a seventh string;
[0046] Encrypting the first character string using the encryption and decryption algorithm corresponding to the second configuration item according to the corresponding encryption and decryption key to obtain an eighth character string;
[0047] Obtaining a ninth character string according to the seventh character string and the eighth character string;
[0048] The ninth character string is processed using a digest algorithm to obtain fourth digest information.
[0049] A communication control device is configured on a first device, the first device is configured with a first key negotiation configuration file, and a second device is configured with a second key negotiation configuration file, the first key negotiation configuration file is the same as the second key negotiation configuration file, and the key negotiation configuration file includes a plurality of key configuration items, the key configuration items include an algorithm identifier and an encryption and decryption key, and the algorithm identifier represents a corresponding encryption and decryption algorithm;
[0050] Wherein, the device comprises:
[0051] A character string generating unit, used for generating a first character string according to a random algorithm;
[0052] a character string processing unit, configured to process the first character string according to a version identifier of the first key agreement configuration file to obtain verification information and a first configuration item in the first key agreement configuration file;
[0053] A message generating unit, configured to generate a key agreement request message based at least on the first character string and the verification information;
[0054] a message sending unit, configured to send the key negotiation request message to the second device, so that the second device, when the second device passes the legitimacy verification of the verification information in the key negotiation request message, uses the encryption and decryption algorithm corresponding to the second configuration item to encrypt the communication key according to the corresponding encryption and decryption key to generate a key negotiation confirmation message, wherein the key negotiation confirmation message at least includes: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file;
[0055] A message receiving unit, configured to receive the key negotiation confirmation message sent by the second device;
[0056] A key decryption unit is used to decrypt the communication key in the key negotiation confirmation message according to the first configuration item, so that the first device and the second device can use the communication key to perform encrypted communication.
[0057] A communication control device is configured in a second device, the second device is configured with a second key negotiation configuration file, the first device is configured with a first key negotiation configuration file, the first key negotiation configuration file is the same as the second key negotiation configuration file, and the key negotiation configuration file includes a plurality of key configuration items, the key configuration items include an algorithm identifier and an encryption and decryption key, and the algorithm identifier represents a corresponding encryption and decryption algorithm;
[0058] Wherein, the device comprises:
[0059] a message receiving unit, configured to receive a key negotiation request message sent by the first device; the key negotiation request message is generated by the first device according to a first character string and verification information, the first character string is generated according to a random algorithm, the verification information is obtained by processing the first character string according to a version identifier of the first key negotiation configuration file, and the first device further processes the first character string according to the version identifier of the first key negotiation configuration file to obtain a first configuration item in the first key negotiation configuration file;
[0060] a message verification unit, configured to verify the legitimacy of the verification information in the key negotiation request message according to the version identifier of the second key negotiation configuration file; and trigger the message generation unit when the legitimacy verification of the verification information in the key negotiation request message passes;
[0061] The message generating unit is configured to encrypt the communication key according to the corresponding encryption and decryption key using the encryption and decryption algorithm corresponding to the second configuration item to generate a key negotiation confirmation message, wherein the key negotiation confirmation message at least includes: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file;
[0062] A message sending unit is used to send the key negotiation confirmation message to the first device, so that the first device decrypts the communication key in the key negotiation confirmation message according to the first configuration item, so that the first device and the second device use the communication key to perform encrypted communication.
[0063] It can be seen from the above technical scheme that in a communication control method and device disclosed in the present application, the same key negotiation configuration file is configured on both communicating parties, and multiple key configuration items are set in the key negotiation configuration file. The key configuration item includes an algorithm identifier representing the encryption and decryption algorithm and a corresponding encryption key. Based on this, on the communication initiator, that is, the first device, a character string is first randomly obtained, and then the first character string is processed according to the version identifier of the key negotiation configuration file on the first device, so that verification information and the first configuration item can be obtained. Then, a key negotiation request message generated according to the first character string and the verification information is sent to the communication receiver, that is, the second device. Therefore, when the second device passes the legitimacy check of the verification information, the character string in the key negotiation request message is processed according to the version identifier of the key negotiation file on the second device to obtain the second configuration item and generate a key negotiation confirmation message based on it and then send it to the first device. The key negotiation confirmation message includes the encrypted communication key. Therefore, after the first device receives the key negotiation confirmation message, it can decrypt the communication key according to the first configuration item to realize key negotiation, and then the communication key can be used for encrypted communication with the second device. It can be seen that in the present application, the communicating parties negotiate the communication key based on the character string obtained by the initiator according to the key configuration items in their respective key negotiation configuration files. If the negotiation passes, that is, the legitimacy verification passes, the two parties use the communication key generated by the receiving party to communicate. If the negotiation fails, the two parties do not communicate. Therefore, even if the key negotiation configuration files of the communicating parties are not synchronized during the process of updating the configuration items, the communication service already established between the two parties will not be interrupted, thereby improving the reliability of secure communication. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] The above and other features, advantages and aspects of the embodiments of the present application will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0065] Figure 1 A flow chart of a communication control method provided in Embodiment 1 of the present application;
[0066] Figure 2 A partial flow chart of a communication control method provided in Embodiment 1 of the present application;
[0067] Figure 3 A flow chart of a communication control method provided in Embodiment 2 of the present application;
[0068] Figure 4 A partial flow chart of a communication control method provided in Embodiment 2 of the present application;
[0069] Figure 5 A schematic diagram of the structure of a communication control device provided in Embodiment 3 of the present application;
[0070] Figure 6 A schematic diagram of the structure of a communication control device provided in Embodiment 4 of the present application;
[0071] Figure 7 This is a schematic diagram of the system composition of the information system in the communication scenario between information systems in a civil aviation airport applicable to this application;
[0072] Figure 8 This application is applicable to the communication scenario between information systems in civil aviation airports, and the workflow diagram for encrypted communication between information systems under normal circumstances;
[0073] Fig. 9 This application is applicable to the communication scenario between information systems in a civil aviation airport, and an example flowchart of key negotiation failure between information systems;
[0074] Fig.10 This is a detailed process diagram of generating a key negotiation request message in a communication scenario between information systems in a civil aviation airport in which this application is applicable;
[0075] Fig.11 This is a detailed process diagram of generating a key negotiation confirmation message in a communication scenario between information systems in a civil aviation airport for which this application is applicable;
[0076] Fig.12 It is a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION
[0077] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be construed as being limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present application. It should be understood that the drawings and embodiments of the present application are only for exemplary purposes and are not intended to limit the scope of protection of the present application.
[0078] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0079] It should be noted that the concepts such as "first" and "second" mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0080] It should be noted that the modifications of "one" and "plurality" mentioned in the present application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0081] refer to Figure 1 As shown, it is a flow chart for implementing a communication control method provided in the first embodiment of the present application. The method can be applied to a first device, such as a terminal or server equipped with information system A. Information system A can be a system for implementing specific functions, such as an airport business system. The first device is configured with a first key negotiation configuration file, and the second device is also configured with a second key negotiation configuration file. The second device can be a terminal or server equipped with information system B. Information system B can be a system for implementing specific functions, and the first key negotiation configuration file and the second key negotiation configuration file are the same. Among them, there are multiple key configuration items in each of the two key negotiation configuration files. The key configuration items include an algorithm identifier and an encryption and decryption key. The algorithm identifier can represent the corresponding encryption and decryption algorithm. A key configuration item can use the encryption and decryption algorithm represented by its algorithm identifier to encrypt and decrypt data according to the corresponding encryption and decryption key. At least one of the algorithm identifiers and encryption and decryption keys of different key configuration items is different. The algorithm identifier can be represented by numbers, letters or other symbols to uniquely represent the corresponding encryption and decryption algorithm. In the key negotiation configuration file, the key configuration item can be stored as a tuple, such as (n, key), where n is the algorithm identifier, representing the nth encryption and decryption algorithm, and key is the encryption and decryption key corresponding to the nth encryption and decryption algorithm. In addition, the administrator can set the key negotiation configuration files of the first device and the second device respectively, or the first device and the second device can download the key negotiation configuration file pre-configured by the administrator from a specific server to maintain the consistency of the first key negotiation configuration file and the second key negotiation configuration file. The technical solution in this embodiment is mainly used to improve the reliability of secure communication between the first device and the second device.
[0082] Specifically, the method in this embodiment may include the following steps:
[0083] Step 101: Generate a first character string according to a random algorithm.
[0084] The first character string can be represented by S. In step 101, the first character string is generated according to a random algorithm, and the first character string generated in each communication is different to avoid being predicted, thereby improving security.
[0085] Step 102: Process the first character string according to the version identifier of the first key agreement configuration file to obtain verification information and a first configuration item in the first key agreement configuration file.
[0086] The version identifier of the first key negotiation configuration file may be represented by V. As the first key negotiation configuration file and the second key negotiation configuration file are updated, V is also updated. If the first key negotiation configuration file and the second key negotiation configuration file are not updated synchronously, the version identifiers of the first key negotiation configuration file and the second key negotiation configuration file are different; if the first key negotiation configuration file and the second key negotiation configuration file are updated synchronously, the version identifiers of the first key negotiation configuration file and the second key negotiation configuration file are the same.
[0087] Specifically, in this embodiment, the first character string may be concatenated, a digest may be calculated, a hash value may be calculated, etc. according to the version identifier to obtain verification information and the first configuration item may be retrieved from the first key agreement configuration file according to the hash value generated in the process. The verification information here may include one or more pieces of information.
[0088] Step 103: Generate a key agreement request message at least according to the first character string and the verification information.
[0089] The key negotiation request message includes at least the first string and the verification information. In addition, the key negotiation request message may also include a message type, indicating that the message is a key negotiation request message sent by the first device, such as A1. For example, in step 103, the message type A1, the first string S and the verification information D are concatenated to obtain the key negotiation request message.
[0090] Step 104: Send a key negotiation request message to the second device.
[0091] After receiving the key negotiation request message, the second device verifies the legitimacy of the verification information in the key negotiation request message. When the legitimacy verification of the verification information in the key negotiation request message is passed, the communication key is encrypted using the encryption and decryption algorithm corresponding to the second configuration item according to the corresponding encryption and decryption key to generate a key negotiation confirmation message, which at least includes: the encrypted communication key. The second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file. Moreover, the second configuration item is obtained by the second device in the process of verifying the legitimacy of the verification information in the key negotiation request message.
[0092] It should be noted that the second device can generate a communication key through a random algorithm. The communication key can be represented by K. The communication key generated for each communication is different and encrypted communication is performed using the key configuration item determined by the randomly generated first character string, thereby avoiding detection and improving security.
[0093] In addition, the key negotiation confirmation message may also include a message type to indicate that the message is a key negotiation confirmation message sent by the second device, such as B1. For example, the message type B1 and the encrypted communication key K1 are concatenated to obtain the key negotiation confirmation message.
[0094] Among them, when the second device fails to pass the legitimacy verification of the verification information in the key negotiation request message, it generates a key negotiation rejection message. The key negotiation rejection message may include a message type to characterize that the message is a key negotiation rejection message sent by the second device, such as the message type is B2, which characterizes a rejection type message sent by the second device.
[0095] Step 105: Receive a key negotiation confirmation message sent by the second device.
[0096] Step 106: According to the first configuration item, decrypt the communication key in the key negotiation confirmation message, so that the first device and the second device perform encrypted communication using the communication key.
[0097] Among them, since the second device sends a key negotiation confirmation message, it indicates that the second device has passed the legitimacy verification of the key negotiation request message sent by the first device. At this time, the second key negotiation configuration file in the second device is the same as the first key negotiation configuration file in the first device, and the second configuration item obtained by the second device and the first configuration item obtained by the first device are the same key configuration item. Therefore, on the first device, the encryption and decryption algorithm represented by the algorithm identifier in the first configuration item can be directly used to decrypt the encrypted communication key in the key negotiation confirmation message according to the encryption and decryption key in the first configuration item to obtain the plaintext communication key. Based on this, the first device and the second device can use the plaintext communication key to encrypt and transmit the communication data between the two to improve security.
[0098] It can be seen that in a communication control method provided in Example 1 of the present application, the communicating parties negotiate the communication key based on the character string obtained by the initiator according to the key configuration items in their respective key negotiation configuration files. If the negotiation passes, that is, the legitimacy verification passes, the two parties use the communication key generated by the receiving party to communicate. If the negotiation fails, the two parties do not communicate. Therefore, even if the key negotiation configuration files of the communicating parties are not synchronized during the process of updating the configuration items, the communication service already established between the two parties will not be interrupted, thereby improving the reliability of secure communication.
[0099] In one implementation, when obtaining the verification information and the first configuration item in step 102, it can be implemented in the following manner: Figure 2 As shown in:
[0100] Step 201: Obtain first summary information according to a version identifier and a first character string of a first key agreement configuration file.
[0101] In a specific implementation, in step 201, the second string can be first obtained according to the version identifier of the first key negotiation configuration file and the first string, for example, the version identifier of the first key negotiation configuration file is concatenated with the first string to obtain the second string; then, the second string is processed using a digest algorithm to obtain first digest information, for example, the digest algorithm Digest is used to take the second string as input to calculate the digest of the second string to obtain first digest information, and the first digest information can be represented by D1.
[0102] Step 202: Obtain a first index identifier according to the first summary information.
[0103] In a specific implementation, a hash value of the first summary information may be calculated to obtain a first index identifier in step 202. For example, a hash function Hash may be used, with the first summary information as input, and the obtained hash value is the first index identifier, which may be represented by index1.
[0104] It should be noted that the hash function Hash can ensure that the value range of index1 is in the interval [0, N-1]. That is, index1 = Hash (D1).
[0105] Step 203: According to the first index identifier, obtain the corresponding first configuration item in the first key agreement configuration file.
[0106] In a specific implementation, step 203 may retrieve the key configuration item in the first key agreement configuration file according to the first index identifier, and determine the key configuration item whose algorithm identifier matches the first index identifier as the first configuration item.
[0107] For example, the key configuration item in the first key negotiation configuration file is represented by C. After searching, C index1 =(n, key), the encryption algorithm corresponding to the encryption and decryption algorithm point code n (i.e. algorithm identifier) is Encrypt n , the decryption algorithm is Decrypt n , the encryption and decryption key is key.
[0108] Step 204: According to the first configuration item, the first index identifier and the first character string are processed to obtain second summary information, and the first summary information and the second summary information constitute verification information.
[0109] The second summary information can be represented by D2, based on which the verification information includes D1 and D2.
[0110] In a specific implementation, step 204 can be implemented in the following manner:
[0111] First, the first index identifier is converted into a string to obtain a third string, for example, index1 is converted into the third string; at the same time, the first string is encrypted using the encryption and decryption algorithm corresponding to the first configuration item according to the corresponding encryption and decryption key to obtain a fourth string, for example, using C index1 The encryption algorithm corresponding to n is Encrypt n According to C index The first string S is encrypted using the key in to obtain a fourth string; then, a fifth string is obtained according to the third string and the fourth string, for example, the third string and the fourth string are concatenated to obtain the fifth string; finally, the fifth string is processed using a digest algorithm to obtain second digest information, for example, a digest algorithm Digest is used to take the fifth string as input to calculate a digest of the fifth string to obtain second digest information.
[0112] It can be seen that in this embodiment, verification information is obtained through a digest algorithm, a hash function, etc., which increases the complexity of information acquisition, thereby preventing the verification information from being crackable and improving security.
[0113] refer to Figure 3 , which is a flow chart for implementing a communication control method provided in the second embodiment of the present application. The method can be applied to a second device, such as a terminal or server installed with information system B. Information system B can be a system that implements a specific function, such as an airport business system. The second device is configured with a second key negotiation configuration file, and the first device is also configured with a first key negotiation configuration file. The first device can be a terminal or server installed with information system A. Information system A can be a system that implements a specific function, and the first key negotiation configuration file and the second key negotiation configuration file are the same. Among them, there are multiple key configuration items in each of the two key negotiation configuration files. The key configuration items include an algorithm identifier and an encryption and decryption key. The algorithm identifier can represent the corresponding encryption and decryption algorithm. The technical solution in this embodiment is mainly used to improve the reliability of secure communication between the first device and the second device.
[0114] Specifically, the method in this embodiment may include the following steps:
[0115] Step 301: Receive a key negotiation request message sent by a first device.
[0116] The key negotiation request message is generated by the first device according to the first character string and verification information, the first character string is generated according to a random algorithm, the verification information is obtained by processing the first character string according to a version identifier of the first key negotiation configuration file, and the first device also processes the first character string according to the version identifier of the first key negotiation configuration file to obtain the first configuration item in the first key negotiation configuration file.
[0117] Step 302: According to the version identifier of the second key negotiation configuration file, the verification information in the key negotiation request message is verified for legitimacy. If the verification information in the key negotiation request message passes the legitimacy verification, step 303-step 304 is executed. If the verification information in the key negotiation request message fails to pass the legitimacy verification, step 305-step 306 is executed.
[0118] If the version identifier of the second key negotiation configuration file is different from the version identifier of the first key negotiation configuration file, the verification will definitely fail; if the version identifier of the second key negotiation configuration file is the same as the version identifier of the first key negotiation configuration file, the verification may pass.
[0119] Step 303: Use the encryption and decryption algorithm corresponding to the second configuration item to encrypt the communication key according to the corresponding encryption and decryption key to generate a key negotiation confirmation message.
[0120] The key negotiation confirmation message at least includes: an encrypted communication key. And the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file.
[0121] It should be noted that the second configuration item can be obtained by the second device in step 302 during the process of verifying the legitimacy of the verification information in the key agreement request message.
[0122] In addition, the key negotiation confirmation message may also include a message type to indicate that the message is a key negotiation confirmation message sent by the second device, such as B1. For example, the message type B1 and the encrypted communication key K1 are concatenated to obtain the key negotiation confirmation message.
[0123] In a specific implementation, the communication key may be a string generated by the second device according to a random algorithm. The communication key generated by the second device is different each time the communication is performed and encrypted communication is performed using a key configuration item determined by the randomly generated first string, thereby avoiding detection and improving security.
[0124] Step 304: Send a key negotiation confirmation message to the first device.
[0125] The first device decrypts the communication key in the key negotiation confirmation message according to the first configuration item, so that the first device and the second device perform encrypted communication using the communication key.
[0126] Step 305: Generate a key negotiation rejection message.
[0127] The key negotiation rejection message may include a message type to indicate that the message is a key negotiation rejection message sent by the second device. For example, the message type is B2, indicating that the message is a rejection type message sent by the second device.
[0128] Step 306: Send a key negotiation rejection message to the first device.
[0129] It should be noted that the key negotiation confirmation message and the key negotiation rejection message are both key negotiation response messages fed back by the second device to the first device. When the second device passes the legitimacy verification of the verification information, the second device feeds back a key negotiation confirmation message to the first device. When the second device fails the legitimacy verification of the verification information, the second device feeds back a key negotiation rejection message to the first device.
[0130] It can be seen that in a communication control method provided in Example 2 of the present application, the communicating parties negotiate the communication key based on the character string obtained by the initiator according to the key configuration items in their respective key negotiation configuration files. If the negotiation passes, that is, the legitimacy verification passes, the two parties use the communication key generated by the receiving party to communicate. If the negotiation fails, the two parties do not communicate. Therefore, even if the key negotiation configuration files of the communicating parties are not synchronized during the process of updating the configuration items, the communication service already established between the two parties will not be interrupted, thereby improving the reliability of secure communication.
[0131] In one implementation, step 302 can be implemented in the following ways when performing legality verification: Figure 4 As shown in:
[0132] Step 401: Obtain third summary information according to the version identifier of the second key agreement configuration file and the first character string.
[0133] In a specific implementation, in step 401, the sixth character string can be first obtained according to the version identifier of the second key negotiation configuration file and the first character string, for example, the version identifier of the second key negotiation configuration file is concatenated with the first character string to obtain the sixth character string; then the sixth character string is processed using a digest algorithm to obtain third digest information, for example, the digest algorithm Digest is used to take the sixth character string as input to calculate the digest of the sixth character string to obtain third digest information, and the third digest information can be represented by D3.
[0134] Step 402: compare the third summary information with the first summary information in the verification information to obtain a first verification result. If the first verification result indicates that the first summary information has been verified, step 403 is executed. If the first verification result indicates that the first summary information has not been verified, step 404 is executed.
[0135] The first summary information is obtained by the first device according to the version identifier of the first key agreement configuration file and the first character string, and the obtaining method is the same as the obtaining method in step 401.
[0136] In a specific implementation, if the third summary information is completely consistent with the first summary information in the verification information, then the first verification result indicates that the first summary information has been verified, and the subsequent verification process, i.e., step 403 and subsequent steps, is continued to be executed; if the third summary information is not completely consistent with the first summary information in the verification information, then the first verification result indicates that the first summary information has not been verified, and at this time, step 404 is executed.
[0137] Step 403: Obtain a second index identifier according to the third summary information, and execute step 405.
[0138] In a specific implementation, the hash value of the third summary information may be calculated in step 403 to obtain the second index identifier. For example, a hash function Hash may be used, with the third summary information as input, and the obtained hash value is the second index identifier, which may be represented by index2.
[0139] It should be noted that the hash function Hash can ensure that the value range of index2 is in the interval [0, N-1]. That is, index2 = Hash (D3).
[0140] Step 404: Determine whether the validity verification of the verification information has failed.
[0141] It should be noted that after step 404, steps 305 to 306 may be executed on the second device.
[0142] Step 405: Obtain a corresponding second configuration item in a second key agreement configuration file according to the second index identifier.
[0143] In a specific implementation, step 405 may retrieve the key configuration item in the second key agreement configuration file according to the second index identifier, and determine the key configuration item whose algorithm identifier matches the second index identifier as the second configuration item.
[0144] For example, the key configuration item in the second key negotiation configuration file is represented by C. After searching, C index2 =(n, key), the encryption algorithm corresponding to the encryption and decryption algorithm point code n (i.e. algorithm identifier) is Encrypt n , the decryption algorithm is Decrypt n , the encryption and decryption key is key.
[0145] Step 406: According to the second configuration item, the second index identifier and the first character string are processed to obtain fourth summary information.
[0146] The fourth summary information may be represented by D4.
[0147] In a specific implementation, step 406 can be implemented in the following manner:
[0148] First, the second index identifier is converted into a string to obtain a seventh string, for example, index2 is converted into the seventh string; at the same time, the first string is encrypted using the encryption and decryption algorithm corresponding to the second configuration item according to the corresponding encryption and decryption key to obtain an eighth string, for example, using C index2 The encryption algorithm corresponding to n is Encrypt n According to C index The first string S is encrypted using the key in to obtain an eighth string; then, a ninth string is obtained according to the seventh string and the eighth string, for example, the seventh string and the eighth string are concatenated to obtain a ninth string; finally, the ninth string is processed using a digest algorithm to obtain fourth digest information, for example, a digest algorithm Digest is used to take the ninth string as input to calculate a digest of the ninth string to obtain fourth digest information.
[0149] Step 407: compare the fourth summary information with the second summary information in the verification information to obtain a second verification result; the second verification result indicates whether the second summary information has been verified; if the second verification result indicates that the second summary information has been verified, execute step 408; if the second verification result indicates that the second summary information has not been verified, execute step 404.
[0150] The second summary information is obtained by the first device by processing the first index identifier and the first character string according to the first configuration item, and the first index identifier is obtained by the first device according to the first summary information; the first configuration item is obtained by the first device in the first key agreement configuration file according to the first index identifier.
[0151] In a specific implementation, if the fourth summary information is completely consistent with the second summary information in the verification information, then the second verification result indicates that the second summary information verification has passed, and step 408 is executed; if the fourth summary information is not completely consistent with the second summary information in the verification information, then the second verification result indicates that the second summary information verification has not passed, and step 404 is executed.
[0152] Step 408: Determine whether the legitimacy verification of the verification information has passed.
[0153] It should be noted that after step 408, steps 303 and 304 may be executed on the second device.
[0154] It can be seen that in this embodiment, the two summary information in the verification information are verified through summary algorithms, hash functions, etc., and the verification information is obtained through summary algorithms, hash functions, etc., thereby increasing the complexity of information acquisition and the security of information verification to avoid the crackability of verification information and improve security.
[0155] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0156] The names of the messages or information exchanged between multiple devices in the embodiments of the present application are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0157] Although operations are depicted in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or in a sequential order.Multitasking and parallel processing may be advantageous under certain circumstances.
[0158] It should be understood that the various steps described in the method implementation of the present application can be performed in different orders and / or performed in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present application is not limited in this respect.
[0159] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0160] refer to Figure 5 , is a structural diagram of a communication control device provided in Example 3 of the present application. The device can be configured in a first device, such as a terminal or server installed with information system A. The first device is configured with a first key negotiation configuration file, and the second device is also configured with a second key negotiation configuration file. The second device can be a terminal or server installed with information system B, and the first key negotiation configuration file and the second key negotiation configuration file are the same. Among them, there are multiple key configuration items in each of the two key negotiation configuration files, and the key configuration items include an algorithm identifier and an encryption and decryption key. The algorithm identifier can represent the corresponding encryption and decryption algorithm. The technical solution in this embodiment is mainly used to improve the reliability of secure communication between the first device and the second device.
[0161] Specifically, the device in this embodiment may include the following units:
[0162] The character string generating unit 501 is used to generate a first character string according to a random algorithm;
[0163] A string processing unit 502, configured to process the first string according to the version identifier of the first key agreement configuration file to obtain verification information and a first configuration item in the first key agreement configuration file;
[0164] A message generating unit 503, configured to generate a key agreement request message at least according to the first character string and the verification information;
[0165] a message sending unit 504, configured to send the key negotiation request message to the second device, so that the second device, when the second device passes the legitimacy verification of the verification information in the key negotiation request message, uses the encryption and decryption algorithm corresponding to the second configuration item to encrypt the communication key according to the corresponding encryption and decryption key to generate a key negotiation confirmation message, wherein the key negotiation confirmation message at least includes: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file;
[0166] The message receiving unit 505 is used to receive the key negotiation confirmation message sent by the second device;
[0167] The key decryption unit 506 is configured to decrypt the communication key in the key negotiation confirmation message according to the first configuration item, so that the first device and the second device can perform encrypted communication using the communication key.
[0168] It can be seen that in a communication control device provided in Example 3 of the present application, the communicating parties negotiate the communication key based on the character string obtained by the initiator according to the key configuration items in their respective key negotiation configuration files. If the negotiation passes, that is, the legitimacy verification passes, the two parties use the communication key generated by the receiving party to communicate. If the negotiation fails, the two parties do not communicate. Therefore, even if the key negotiation configuration files of the communicating parties are not synchronized during the process of updating the configuration items, the communication service already established between the two parties will not be interrupted, thereby improving the reliability of secure communication.
[0169] In one implementation, the string processing unit 502 is specifically used to: obtain first summary information based on the version identifier of the first key negotiation configuration file and the first string; obtain a first index identifier based on the first summary information; obtain a corresponding first configuration item in the first key negotiation configuration file according to the first index identifier; process the first index identifier and the first string according to the first configuration item to obtain second summary information; the first summary information and the second summary information constitute verification information.
[0170] In one implementation, when the string processing unit 502 obtains the first summary information based on the version identifier of the first key negotiation configuration file and the first string, it is specifically used to: obtain a second string based on the version identifier of the first key negotiation configuration file and the first string; and process the second string using a summary algorithm to obtain the first summary information.
[0171] In one implementation, when the string processing unit 502 processes the first index identifier and the first string according to the first configuration item to obtain the second summary information, it is specifically used to: convert the first index identifier into a string to obtain a third string; encrypt the first string according to the encryption and decryption algorithm corresponding to the first configuration item according to the corresponding encryption and decryption key to obtain a fourth string; obtain a fifth string according to the third string and the fourth string; and process the fifth string using a summary algorithm to obtain the second summary information.
[0172] It should be noted that the specific implementation of each unit in this embodiment can refer to the corresponding description in the previous text and will not be described in detail here.
[0173] refer to Figure 6 , is a structural diagram of a communication control device provided in Embodiment 4 of the present application, the device can be configured in a second device, the second device is configured with a second key negotiation configuration file, the first device is configured with a first key negotiation configuration file, the first key negotiation configuration file is the same as the second key negotiation configuration file, and the key negotiation configuration file includes a plurality of key configuration items, the key configuration items include an algorithm identifier and an encryption and decryption key, the algorithm identifier represents the corresponding encryption and decryption algorithm. The technical solution in this embodiment is mainly used to improve the reliability of secure communication between the first device and the second device.
[0174] Specifically, the device in this embodiment may include the following units:
[0175] The message receiving unit 601 is configured to receive a key negotiation request message sent by the first device; the key negotiation request message is generated by the first device according to a first character string and verification information, the first character string is generated according to a random algorithm, the verification information is obtained by processing the first character string according to a version identifier of the first key negotiation configuration file, and the first device further processes the first character string according to the version identifier of the first key negotiation configuration file to obtain a first configuration item in the first key negotiation configuration file;
[0176] A message verification unit 602 is used to verify the legitimacy of the verification information in the key negotiation request message according to the version identifier of the second key negotiation configuration file; if the legitimacy verification of the verification information in the key negotiation request message passes, trigger the message generation unit;
[0177] The message generating unit 603 is configured to encrypt the communication key according to the corresponding encryption and decryption key using the encryption and decryption algorithm corresponding to the second configuration item to generate a key negotiation confirmation message, wherein the key negotiation confirmation message at least includes: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file;
[0178] The message sending unit 604 is used to send the key negotiation confirmation message to the first device, so that the first device decrypts the communication key in the key negotiation confirmation message according to the first configuration item, so that the first device and the second device can use the communication key to perform encrypted communication.
[0179] In addition, when the message verification unit 602 fails to pass the legitimacy verification of the verification information, the trigger message generation unit 602 generates a key negotiation rejection message, and sends the key negotiation rejection message to the first device through the message sending unit 604 .
[0180] It can be seen that in a communication control device provided in Example 4 of the present application, the communicating parties negotiate the communication key based on the character string obtained by the initiator according to the key configuration items in their respective key negotiation configuration files. If the negotiation passes, that is, the legitimacy verification passes, the two parties use the communication key generated by the receiving party to communicate. If the negotiation fails, the two parties do not communicate. Therefore, even if the key negotiation configuration files of the communicating parties are not synchronized during the process of updating the configuration items, the communication service already established between the two parties will not be interrupted, thereby improving the reliability of secure communication.
[0181] In one implementation, the message verification unit 602 is specifically used to: obtain third summary information according to the version identifier of the second key negotiation configuration file and the first character string; compare the third summary information with the first summary information in the verification information to obtain a first verification result; the first summary information is obtained according to the version identifier of the first key negotiation configuration file and the first character string; when the first verification result indicates that the first summary information has been verified, obtain a second index identifier according to the third summary information; when the first verification result indicates that the first summary information has not been verified, determine that the legitimacy verification of the verification information has not passed; obtain a corresponding second configuration item in the second key negotiation configuration file according to the second index identifier; and compare the second index identifier, the first character string, and the first character string according to the second configuration item. The fourth summary information is processed by the first device according to the first configuration item, and the first index identifier and the first string are processed to obtain fourth summary information; the fourth summary information is compared with the second summary information in the verification information to obtain a second verification result; the second verification result indicates whether the second summary information is verified or not; the second summary information is obtained by the first device by processing the first index identifier and the first string according to the first configuration item, and the first index identifier is obtained by the first device according to the first summary information; the first configuration item is obtained by the first device in the first key agreement configuration file according to the first index identifier; if the second verification result indicates that the second summary information is verified, it is determined that the verification information is verified to be passed, and if the second verification result indicates that the second summary information is not verified, it is determined that the verification information is not verified to be passed.
[0182] Among them, when the message verification unit 602 obtains the third summary information according to the version identifier of the second key negotiation configuration file and the first character string, it is specifically used to: obtain a sixth character string according to the version identifier of the second key negotiation configuration file and the first character string; use a summary algorithm to process the sixth character string to obtain the third summary information.
[0183] Among them, when the message verification unit 602 processes the second index identifier and the first character string according to the second configuration item to obtain the fourth summary information, it is specifically used to: convert the second index identifier into a character string to obtain a seventh character string; use the encryption and decryption algorithm corresponding to the second configuration item to encrypt the first character string according to the corresponding encryption and decryption key to obtain an eighth character string; obtain a ninth character string according to the seventh character string and the eighth character string; and use the summary algorithm to process the ninth character string to obtain the fourth summary information.
[0184] It should be noted that the specific implementation of each unit in this embodiment can refer to the corresponding description in the previous text and will not be described in detail here.
[0185] The modules involved in the embodiments described in this application may be implemented by software or hardware. The name of the module does not limit the unit itself in some cases. For example, the analysis module may also be described as a "statistical analysis module".
[0186] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0187] Taking the communication scenario between various information systems in a civil aviation airport as an example, the communication control scheme implemented by the technical solution of this application is illustrated by example:
[0188] The present application proposes a method and device for communication between information systems. The communicating parties have the same key negotiation configuration. The communicating parties first negotiate the symmetric encryption key for subsequent communication based on the key negotiation configuration. After the negotiation is completed, the actual communication is completed through symmetric encryption.
[0189] The key used in the actual communication in this application is a completely random key, which can be used once and for all. Compared with fixed symmetric key encryption communication and symmetric encryption communication based on the same communication key library, it greatly improves security. The key configuration stored in the key negotiation configuration is only used for the negotiation process of the communication key. The key negotiation configuration contains a huge scale of key configuration, which overcomes the difficulty of upgrading and updating a single digital certificate in the standard SSL / TLS encrypted communication method.
[0190] In the information system communication method and device proposed in this application, the two communicating parties are regarded as two different information systems. The composition of the information system is as follows: Figure 7 As shown in Figure 1. Each information system includes a communication process, a management console, and a key negotiation configuration file. Among them:
[0191] Key negotiation configuration file: The configuration file that the communicating parties rely on when negotiating the communication key is an ordered set file consisting of two tuples in the form of (encryption and decryption algorithm code, key).
[0192] Communication process: Communicate with other information systems, and assume the roles of message sender and message receiver in this application. When acting as a message sender, encryption is completed, and when acting as a message receiver, decryption is completed.
[0193] Management console: used to manage key negotiation configuration files. Only high-level system maintenance personnel or trusted systems can operate in the management console after obtaining authorization. Any operation in the management console records a detailed audit log. Through the management console, you can reload all key negotiation configuration files online or update some key configuration items in the key negotiation configuration files. This can avoid the use of duplicate key negotiation configuration files for a considerable period of time, further improving the security of communication.
[0194] The implementation principle of this application is described below:
[0195] In this application, the communication process between information systems can be divided into two stages: key negotiation stage and communication stage.
[0196] Among them, in the key negotiation stage, the communicating parties rely on the same key negotiation configuration, use the same message digest algorithm and hash function, generate and transmit random strings and perform the same processing on the random strings to determine the encryption algorithm and encryption and decryption keys in the key negotiation stage; on this basis, generate random strings as the encryption and decryption keys in the communication stage, use the encryption algorithm and encryption and decryption keys in the key negotiation stage for encrypted transmission, and complete the key negotiation. In the communication stage, the communicating parties use the communication keys determined in the key negotiation stage to conduct symmetric encrypted communication.
[0197] The key negotiation phase is the key to ensure the security of the entire communication process. The fundamental goal of the key negotiation phase is for the communicating parties to reach an agreement on the communication key used in the communication phase. The interaction between the communicating parties in the key negotiation phase is directly related to the communication key, and the most sensitive information is transmitted, which must be carried out in a safe and reliable manner. During the key negotiation process, it is necessary to ensure that the communication key to be negotiated does not appear in plain text, and to ensure that any third party cannot calculate the communication key only through the interactive messages of the key negotiation. This requires that the interactive messages of the key negotiation, such as the request message, confirmation message, and rejection message mentioned above, cannot contain all the elements required to calculate the communication key, but can only contain some elements in an implicit manner, and the remaining elements depend on the data content and processing process that are known to both communicating parties but unknown to the third party.
[0198] In this application, the data content known to both communicating parties but unknown to the third party is the key negotiation configuration file. The key negotiation configuration file is an ordered set file consisting of a certain number of key negotiation configuration items. Each key configuration item is a tuple in the form of (encryption and decryption algorithm code, key). It is only used in the key negotiation phase and not in the communication phase, which further improves security. This application supports updating the key negotiation configuration file. During the update of the key negotiation configuration file, the established communication link is not affected because the communication process does not use the key negotiation configuration file. The key negotiation configuration files of the communicating parties must be the same version. If the versions of the key negotiation configuration files are inconsistent, the key negotiation process fails.
[0199] The entire key negotiation configuration file is denoted as C. The number of key configuration items that make up C is N. The value range of the key configuration item index in the key negotiation configuration file is [0, N-1]. The key configuration item numbered index is denoted as C. index The version number of the key negotiation configuration file is denoted as V. Each key configuration item is a tuple (n, key), where n is the encryption algorithm code and key is the key corresponding to it. If the number of encryption algorithms supported by both parties for key negotiation is M, then the possible value range of the encryption algorithm code n is [1, M]. The encryption algorithm corresponding to the encryption algorithm code n is Encrypt n , the decryption algorithm is Decrypt n . Encryption algorithm n and decryption algorithm Decrypt n For any string T1, if Encrypt n To encrypt T1 to get T2, use Decrypt n Decrypt T2 to get T1, that is: if T2 = Encrypt n (T1), then T1=Decrypt n (T2). Each party involved in the communication can check whether the encryption and decryption algorithms are compatible.
[0200] In the present application, the processing process known to both communicating parties but unknown to the third party includes the message digest algorithm (hereinafter referred to as Digest), the hash function (hereinafter referred to as Hash), and each encryption and decryption algorithm used for key negotiation.
[0201] The following is a description of the workflow implemented in this application:
[0202] (1) Workflow of communication between information systems:
[0203] Under normal circumstances, the workflow of communication between information systems is as follows: Figure 8shown.
[0204] Step 801: Information system A generates a key negotiation request message and records the key configuration item C used in this key negotiation. index .
[0205] The detailed process of information system A generating a key negotiation request message is shown in the following details.
[0206] Step 802: Information system A sends a key negotiation request message to information system B.
[0207] Step 803: Information system B generates a key negotiation confirmation message.
[0208] Step 804: Information system B responds to information system A with a key negotiation confirmation message including the encrypted communication key K1, and the negotiation of the communication key is completed.
[0209] The detailed process of information system B generating the key negotiation confirmation message is shown in the following details.
[0210] Step 805: After receiving the key negotiation confirmation message from information system B, information system A index , decrypt the encrypted communication key K1 to obtain the communication key K.
[0211] Step 806: Information system A uses the communication key K to symmetrically encrypt the content of the message to be sent, and sends the encrypted request message to information system B.
[0212] Step 807: Information system B uses the communication key K to decrypt the data request message from information system A, and uses the communication key K to symmetrically encrypt the message content to be sent, and sends an encrypted response message to information system A.
[0213] (2) Workflow of key negotiation failure:
[0214] The workflow for key negotiation failure is as follows Fig. 9 shown.
[0215] Step 901: Information system A generates a key negotiation request message and records the key configuration item C used in this key negotiation. index .
[0216] Step 902: Information system A sends a key negotiation request message to information system B.
[0217] Step 903: Information system B verifies the key negotiation request message, and generates a key negotiation rejection message if the verification fails.
[0218] Step 904: Information system B responds to information system A with a key negotiation rejection message, and the communication key negotiation ends in failure.
[0219] The detailed process of information system B generating a key negotiation rejection message is shown in the following details.
[0220] (3) The detailed process of generating the key negotiation request message, such as Fig.10 As shown in:
[0221] Step 1001: Generate a random string S.
[0222] Step 1002: obtain the version number V of the key negotiation configuration file of information system A, concatenate V and S to obtain S1, and calculate the digest D1 of S1, where D1 is a string of fixed length.
[0223] If + is used to represent string concatenation, then S1=V+S.
[0224] Use the digest algorithm Digest, take S1 as input, calculate the digest of S1, and get D1.
[0225] That is, D1=Digest(S1)=Digest(V+S).
[0226] Step 1003: Calculate the hash value index of D1.
[0227] Use the hash function Hash, take D1 as input, and get the hash value index. The hash function Hash ensures that the value range of index is in the interval [0, N-1]. That is, index = Hash (D1).
[0228] Step 1004: Obtain key configuration item C index .
[0229] C index =(n,key), the encryption algorithm corresponding to the encryption and decryption algorithm code n is Encrypt n , the decryption algorithm is Decrypt n , the encryption and decryption key is key.
[0230] Step 1005: Convert index to string S2 according to C index S is encrypted to obtain S3, S2 and S3 are concatenated to obtain S4, and the summary D2 of S4 is calculated, where D2 is a string of fixed length.
[0231] If STRING is used to represent string conversion, then S2 = STRING (index).
[0232] C index=(n,key), according to the encryption algorithm Encrypt corresponding to the encryption and decryption algorithm code n n , using key as the encryption key, encrypt S to obtain S3, that is, S3 = Encrypt n (S,key).
[0233] S4=S2+S3=STRING(index)+Encrypt n (S,key)=STRING(Hash(D1))+Encrypt n (S
[0234] ,key).
[0235] Use the digest algorithm Digest, take S4 as input, calculate the digest of S4, and get D2.
[0236] D2=Digest(S4)=Digest(STRING(Hash(D1))+Encrypt n (S,key)).
[0237] Step 1006: Generate a key negotiation request message. The key negotiation request message consists of a message type, a random string S, and digests D1 and D2, and may not contain other content.
[0238] (4) The detailed process of generating the key negotiation confirmation message, such as Fig.11 As shown in:
[0239] Step 1101: obtain the version number V of the key negotiation configuration file of information system B, concatenate V and S to obtain S1, and calculate the digest D3 of S1.
[0240] If + is used to represent string concatenation, then S1=V+S.
[0241] Use the digest algorithm Digest, take S1 as input, calculate the digest of S1, and get D3.
[0242] D3=Digest(S1)=Digest(V+S).
[0243] Step 1102: Compare D3 and D1. If D3 and D1 are inconsistent, go to step 1103; if D3 and D1 are consistent, go to step 1104.
[0244] The process of calculating D1 by information system A is D1 = Digest A (V A +S A ); The process of calculating D3 by information system B is D3 = Digest B (VB +S B ). A is the version number of the key negotiation configuration file of information system A mentioned above, S A is the string S generated by the information system A in the previous text. V B is the version number of the key negotiation configuration file of the information system B mentioned above, S B is the string S generated by information system A in the previous text, which is sent to information system B through a key negotiation request message and is denoted as S B .
[0245] Under normal circumstances, information system A and information system B have the same key negotiation configuration file C, and thus have the same version number V of the key negotiation configuration file, namely V A =V B ; Information system A and information system B use the same digest algorithm Digest, namely Digest A =Digest B If no error occurs during the transmission process and no third party tampers with the key negotiation request message causing S to change, then S A =S B This way, information system A and information system B have exactly the same input when computing the summary.
[0246] Since the algorithms and inputs are the same, D1 and D3 calculated by information system A and information system B must be the same.
[0247] When D3 and D1 are inconsistent, it must be because the algorithms or inputs of information system A and information system B are different:
[0248] If the algorithms are different, the subsequent key negotiation process between information system A and information system B cannot proceed.
[0249] If the input is different, then V A ≠V B or S A ≠S B . V A ≠V B This indicates that the key negotiation configuration files of information system A and information system B are different, and there is no basis for key negotiation between information system A and information system B. A ≠S B This indicates that the transmission link is unreliable and that secure communication between information system A and information system B is simply not possible.
[0250] Step 1103: Generate a key negotiation rejection message, and the process ends.
[0251] Step 1104: Calculate the hash value index of D3.
[0252] Use the hash function Hash, take D3 as input, and get the hash value index. The hash function Hash ensures that the value range of index is in the interval [0, N-1].
[0253] Step 1105: Obtain key configuration item C index .
[0254] Step 1106: convert index into string S2, encrypt S according to Cindex to obtain S3, concatenate S2 and S3 to obtain S4, and calculate the digest D4 of S4.
[0255] If STRING is used to represent string conversion, then S2 = STRING (index).
[0256] C index =(n, key), according to the encryption algorithm Encrypt corresponding to the encryption and decryption algorithm code n n , using key as the encryption key, encrypt S to obtain S3, that is, S3 = Encrypt n (S,key).
[0257] S4=S2+S3=STRING(index)+Encrypt n (S,key)=STRING(Hash(D3))+Encryptn(
[0258] S, key).
[0259] Use the digest algorithm Digest, take S4 as input, calculate the digest of S4, and get D4.
[0260] D4=Digest(S4)=Digest(STRING(Hash(D3))+Encrypt n (S,key)).
[0261] Step 1107: Compare D4 and D2. If D4 and D2 are inconsistent, go to step 1103; if D3 and D1 are consistent, go to step 1108.
[0262] The process of calculating D2 by information system A is:
[0263] D2=Digest(S4)=Digest(STRING(Hash A (D1))+Encryptn A (S, key));
[0264] The process of calculating D3 by information system B is:
[0265] D4=Digest(S4)=Digest(STRING(Hash B (D3))+Encryptn B (S, key)).
[0266] In step 1102, it is obtained that D3=D1, confirming that information system A and information system B use the same message digest algorithm and have the same key negotiation configuration file.
[0267] Under normal circumstances, information system A and information system B use the same hash function Hash, that is, Hash A =Hash B . Thus Hash A (D1)=Hash B (D3). Information system A and information system B get the same index, the same C index =(n, key).
[0268] Under normal circumstances, Encrypt nA =Encrypt nB .
[0269] So Encrypt nA (S, key) = Encrypt nB (S, key). Finally, D4 = D2.
[0270] When D4 and D2 are inconsistent, it must be because the hash algorithms of information system A and information system B are different (thus the calculated index is different, and the obtained C index different), or for the same C index =(n, key) corresponds to a different encryption algorithm, or the input S and D2 change:
[0271] If the algorithms are different, the subsequent key negotiation process between information system A and information system B cannot proceed.
[0272] If the inputs are different, it means that the transmission link is unreliable and secure communication between information system A and information system B is simply not possible.
[0273] Step 1108: Generate a random string as the communication key K, according to the key configuration item C index Encrypt K to get K1.
[0274] C index =(n, key), according to the encryption algorithm Encrypt corresponding to the encryption and decryption algorithm code nn , use key as the encryption key, encrypt K to get K1, that is, K1 = Encrypt n (K, key).
[0275] Step 1109: Generate a key negotiation confirmation message. The key negotiation confirmation message consists of the message type and the encrypted communication key K1, and does not contain other content.
[0276] Among them, the key negotiation configuration file in this application can be stored in the form of a configuration file or a database, and is uniformly managed by the management console.
[0277] The following uses the configuration file format as an example to illustrate the key negotiation configuration file.
[0278] First, the lines starting with # in the key negotiation configuration file are commented out.
[0279] Secondly, except for blank lines and comment lines, the key negotiation configuration file consists of the key configuration version number, the number of key configuration items, and the key configuration items.
[0280] The following is a sample snippet of a key negotiation configuration file. The first line indicates the version number V of the key negotiation configuration file (version 1.0 in the example), the second line indicates the number of key configuration items N (65536 in the example), and the following are key configuration items. Each key configuration item consists of an encryption and decryption algorithm code (in the example, 1 indicates the AES algorithm, 2 indicates the SM2 algorithm, and so on), and an encrypted and textualized key.
[0281] "#KeyList 1.0 65536
[0284] 1. QmFpSml1WGluU2h1U2hhblpob25nR3VpSHVhbmdKaVo=
[0285] 2. aHVvU2h1UWl1WmhlbmdGZWlIdVRvbmdQZW5nSmlaaHU=
[0286] #...
[0287] 1,b0JhaUppdUVyTnZYaVhpYW9RaWFuUmVuWWlHYW9HZVE=".
[0288] After obtaining authorization, high-level system maintenance personnel or trusted systems can use management commands through the management console to update the key negotiation configuration file. The main management commands are shown in Table 1:
[0289] Table 1 Management commands
[0290]
[0291]
[0292] The following are examples of normal communication and negotiation failure scenarios:
[0293] Scenario 1: Normal communication scenario
[0294] First, information system A sends a key negotiation request message;
[0295] Information system A randomly generates a string:
[0296] S="Inu?_876nzc8bde9.xzQw3u39@03zji3eo+ / ?zma8bde9Ac";
[0297] And follow the detailed process of generating the key negotiation request message as follows Fig.10 As shown, a key agreement message is generated, which includes a message type, a random string S, and digests D1 and D2.
[0298] During the process of generating a key negotiation request message:
[0299] D1="41ef9b3fb5e278bde98a40cf278e4369199a3d1c";
[0300] index=1;
[0301] C index =(2,aHVvU2h1UWl1WmhlbmdGZWlIdVRvbmdQZW5nSmlaaHU=);
[0302] C index Indicates that the SM2 algorithm is used, and the key is:
[0303] "aHVvU2h1UWl1WmhlbmdGZWlIdVRvbmdQZW5nSmlaaHU=".
[0304] D2="0cf278e4369199a3d1c41ef9b3fb5e278bde98a4".
[0305] And, the key negotiation request message type is A1;
[0306] Random string S = "Inu?_876nzc8bde9.xzQw3u39@03zji3eo+ / ?zma8bde9Ac";
[0307] D1="41ef9b3fb5e278bde98a40cf278e4369199a3d1c";
[0308] D2="0cf278e4369199a3d1c41ef9b3fb5e278bde98a4";
[0309] The key negotiation request message sent by information system A is shown as follows, and is arranged according to message type, D1, D2, and S as follows:
[0310] "A141ef9b3fb5e278bde98a40cf278e4369199a3d1c0cf278e4369199a3d1c41ef9b3fb5e278bde98a4Inu?_876nzc8bde9.xzQw3u39@03zji3eo+ / ?zma8bde9Ac".
[0311] Secondly, information system B returns a key negotiation confirmation message:
[0312] After receiving the key negotiation request message, information system B generates the key negotiation response message in detail as follows: Fig.11 As shown, a key negotiation confirmation message is generated, which includes the encrypted communication key K1.
[0313] Information system B first verifies the key negotiation request message.
[0314] According to the random string in the key negotiation request message:
[0315] S = "Inu?_876nzc8bde9.xzQw3u39@03zji3eo+ / ?zma8bde9Ac", the version number of the key negotiation configuration file, and D3 = "41ef9b3fb5e278bde98a40cf278e4369199a3d1c", which is consistent with D1;
[0316] index=1;
[0317] C index =(2,aHVvU2h1UWl1WmhlbmdGZWlIdVRvbmdQZW5nSmlaaHU=);
[0318] C index Indicates that the SM2 algorithm is used, and the key is:
[0319] "aHVvU2h1UWl1WmhlbmdGZWlIdVRvbmdQZW5nSmlaaHU=";
[0320] D4 = "0cf278e4369199a3d1c41ef9b3fb5e278bde98a4", which is consistent with D2.
[0321] Randomly generate communication keys:
[0322] K="Z5*,1236(nhfcrEwvb09={.mnvxW / Ocrwq>mniv085211Qs";
[0323] According to C index Encrypt K to get:
[0324] K1="eFr46i42ZKNiVrEYeTY9BIszTkr6sSwL6d2Da / QKwwY=";
[0325] And, the key confirmation message type is B1.
[0326] Based on this, the key negotiation confirmation message sent by information system B is shown as follows, and is arranged according to message type and K1 as follows:
[0327] "B1eFr46i42ZKNiVrEYeTY9BIszTkr6sSwL6d2Da / QKwwY=".
[0328] Scenario 2: Key negotiation failure scenario:
[0329] First, information system A sends a key negotiation request message;
[0330] Information system A randomly generates a string:
[0331] S="Inu?_876nzc8bde9.xzQw3u39@03zji3eo+ / ?zma8bde9Ac",
[0332] And follow the detailed process of generating the key negotiation request message as follows Fig.10 As shown in , a key agreement message is generated, which includes a message type, a random string S, and digests D1 and D2.
[0333] In the process of generating the key negotiation request message,
[0334] D1="41ef9b3fb5e278bde98a40cf278e4369199a3d1c";
[0335] index=1;
[0336] C index=(2,aHVvU2h1UWl1WmhlbmdGZWlIdVRvbmdQZW5nSmlaaHU=);
[0337] C index Indicates that the SM2 algorithm is used, and the key is:
[0338] "aHVvU2h1UWl1WmhlbmdGZWlIdVRvbmdQZW5nSmlaaHU=";
[0339] D2="0cf278e4369199a3d1c41ef9b3fb5e278bde98a4".
[0340] The key negotiation message type is A1;
[0341] Random string S = "Inu?_876nzc8bde9.xzQw3u39@03zji3eo+ / ?zma8bde9Ac";
[0342] D1="41ef9b3fb5e278bde98a40cf278e4369199a3d1c";
[0343] D2="0cf278e4369199a3d1c41ef9b3fb5e278bde98a4";
[0344] Based on this, the key negotiation request message sent by information system A is shown as follows, and the message type, D1, D2, and S are arranged as follows:
[0345] "A141ef9b3fb5e278bde98a40cf278e4369199a3d1c0cf278e4369199a3d1c41ef9b3fb5e278bde98a4Inu?_876nzc8bde9.xzQw3u39@03zji3eo+ / ?zma8bde9Ac".
[0346] Secondly, information system B returns a key negotiation rejection message:
[0347] After receiving the key negotiation request message, information system B first verifies the key negotiation request message. Assume that the version number of the key negotiation configuration file of information system B is different from that of information system A.
[0348] According to the random string in the key negotiation request message:
[0349] S = "Inu?_876nzc8bde9.xzQw3u39@03zji3eo+ / ?zma8bde9Ac", version number of the key negotiation configuration file, calculated D3 = "40cf278e4369199a3d1c41ef9b3fb5e278bd888", which is different from D1.
[0350] Among them, the key negotiation rejection message type is B1. Based on this, the key negotiation rejection message sent by information system B is shown as follows:
[0351] B1.
[0352] In summary, this application proposes a method and device for communication between information systems. The two communicating parties have the same key negotiation configuration file. The two communicating parties first negotiate the symmetric encryption key for subsequent communication based on the key negotiation configuration file. After the negotiation is completed, the actual communication is completed through symmetric encryption. It has the following advantages:
[0353] First of all, the key used in the actual communication of this application is a completely random key, which can be used once for each time. Compared with fixed symmetric key encryption communication and symmetric encryption communication based on the same communication key library, it greatly improves security.
[0354] Secondly, the key configuration items stored in the key negotiation configuration file of this application are only used for the negotiation process of the communication key. The key negotiation configuration file contains a huge number of key configuration items, which overcomes the problem of difficulty in upgrading and updating a single digital certificate in the standard SSL / TLS encrypted communication method.
[0355] In addition, the present application supports updating the key negotiation configuration file in an online manner without affecting the established communication link, and can avoid using repeated key negotiation configuration files for a considerable period of time, further improving the security of communication.
[0356] Reference below Fig.12 , which shows a schematic diagram of the structure of an electronic device suitable for implementing an embodiment of the present application, and the electronic device serves as the first device or the second device in the foregoing text. Fig.12 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0357] like Fig.12As shown, the electronic device may include a processor (e.g., a central processing unit, a graphics processor, etc.) 1201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1202 or a program loaded from a storage device 1208 into a random access memory (RAM) 1203. In RAM 1203, various programs and data required for the operation of the electronic device are also stored. The processor 1201, ROM 1202, and RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.
[0358] Typically, the following devices may be connected to the I / O interface 1205: an input device 1206 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1207 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1208 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1209. The communication device 1209 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Fig.12 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0359] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a non-transitory computer storage medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1209, or installed from the storage device 1208, or installed from the ROM 1202.
[0360] When the electronic device is used as the first device, when the computer program is executed by the processor 1201, the above functions defined in the method of the embodiment of the present application are performed:
[0361] Generate a first character string according to a random algorithm;
[0362] Processing the first character string according to the version identifier of the first key agreement configuration file to obtain verification information and a first configuration item in the first key agreement configuration file;
[0363] generating a key agreement request message based at least on the first character string and the verification information;
[0364] The key negotiation request message is sent to the second device, so that the second device, when the second device passes the legitimacy verification of the verification information in the key negotiation request message, uses the encryption and decryption algorithm corresponding to the second configuration item to encrypt the communication key according to the corresponding encryption and decryption key to generate a key negotiation confirmation message, wherein the key negotiation confirmation message at least includes: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file;
[0365] receiving the key negotiation confirmation message sent by the second device;
[0366] The communication key in the key negotiation confirmation message is decrypted according to the first configuration item, so that the first device and the second device perform encrypted communication using the communication key.
[0367] The embodiments of the present application also claim to protect a computer storage medium for storing computer software instructions used for the above-mentioned electronic device, which includes a program designed for executing the above-mentioned aspects.
[0368] The computer storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device:
[0369] Generate a first character string according to a random algorithm;
[0370] Processing the first character string according to the version identifier of the first key agreement configuration file to obtain verification information and a first configuration item in the first key agreement configuration file;
[0371] generating a key agreement request message based at least on the first character string and the verification information;
[0372] The key negotiation request message is sent to the second device, so that the second device, when the second device passes the legitimacy verification of the verification information in the key negotiation request message, uses the encryption and decryption algorithm corresponding to the second configuration item to encrypt the communication key according to the corresponding encryption and decryption key to generate a key negotiation confirmation message, wherein the key negotiation confirmation message at least includes: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file;
[0373] receiving the key negotiation confirmation message sent by the second device;
[0374] The communication key in the key negotiation confirmation message is decrypted according to the first configuration item, so that the first device and the second device perform encrypted communication using the communication key.
[0375] When the electronic device is used as the second device, when the computer program is executed by the processor 1201, the above functions defined in the method of the embodiment of the present application are performed:
[0376] receiving a key negotiation request message sent by the first device; the key negotiation request message is generated by the first device according to a first character string and verification information, the first character string is generated according to a random algorithm, the verification information is obtained by processing the first character string according to a version identifier of the first key negotiation configuration file, and the first device further processes the first character string according to the version identifier of the first key negotiation configuration file to obtain a first configuration item in the first key negotiation configuration file;
[0377] Performing legitimacy verification on the verification information in the key negotiation request message according to the version identifier of the second key negotiation configuration file;
[0378] When the verification information in the key negotiation request message passes the legitimacy verification, encrypt the communication key according to the corresponding encryption and decryption key using the encryption and decryption algorithm corresponding to the second configuration item to generate a key negotiation confirmation message, wherein the key negotiation confirmation message at least includes: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file;
[0379] The key negotiation confirmation message is sent to the first device, so that the first device decrypts the communication key in the key negotiation confirmation message according to the first configuration item, so that the first device and the second device perform encrypted communication using the communication key.
[0380] The embodiments of the present application also claim to protect a computer storage medium for storing computer software instructions used for the above-mentioned electronic device, which includes a program designed for executing the above-mentioned aspects.
[0381] The computer storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device:
[0382] receiving a key negotiation request message sent by the first device; the key negotiation request message is generated by the first device according to a first character string and verification information, the first character string is generated according to a random algorithm, the verification information is obtained by processing the first character string according to a version identifier of the first key negotiation configuration file, and the first device further processes the first character string according to the version identifier of the first key negotiation configuration file to obtain a first configuration item in the first key negotiation configuration file;
[0383] Performing legitimacy verification on the verification information in the key negotiation request message according to the version identifier of the second key negotiation configuration file;
[0384] When the verification information in the key negotiation request message passes the legitimacy verification, encrypt the communication key according to the corresponding encryption and decryption key using the encryption and decryption algorithm corresponding to the second configuration item to generate a key negotiation confirmation message, wherein the key negotiation confirmation message at least includes: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file;
[0385] The key negotiation confirmation message is sent to the first device, so that the first device decrypts the communication key in the key negotiation confirmation message according to the first configuration item, so that the first device and the second device perform encrypted communication using the communication key.
[0386] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any suitable combination of the above. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. It should be noted that the computer-readable medium described above in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above. A computer-readable storage medium may be, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wire, optical cable, RF (radio frequency), etc., or any suitable combination of the foregoing.
[0387] The computer storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0388] According to one or more embodiments of the present application, Figure 1The illustrated embodiment provides a communication control method, which is applied to a first device, wherein the first device is configured with a first key negotiation configuration file, and the second device is configured with a second key negotiation configuration file, wherein the first key negotiation configuration file is the same as the second key negotiation configuration file, and the key negotiation configuration file includes a plurality of key configuration items, wherein the key configuration items include an algorithm identifier and an encryption and decryption key, and the algorithm identifier represents a corresponding encryption and decryption algorithm;
[0389] Wherein, the method comprises:
[0390] Generate a first character string according to a random algorithm;
[0391] Processing the first character string according to the version identifier of the first key agreement configuration file to obtain verification information and a first configuration item in the first key agreement configuration file;
[0392] generating a key agreement request message based at least on the first character string and the verification information;
[0393] The key negotiation request message is sent to the second device, so that the second device, when the second device passes the legitimacy verification of the verification information in the key negotiation request message, uses the encryption and decryption algorithm corresponding to the second configuration item to encrypt the communication key according to the corresponding encryption and decryption key to generate a key negotiation confirmation message, wherein the key negotiation confirmation message at least includes: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file;
[0394] receiving the key negotiation confirmation message sent by the second device;
[0395] The communication key in the key negotiation confirmation message is decrypted according to the first configuration item, so that the first device and the second device perform encrypted communication using the communication key.
[0396] According to one or more embodiments of the present application, Figure 3 The illustrated embodiment provides a communication control method, which is applied to a second device, wherein the second device is configured with a second key negotiation configuration file, and the first device is configured with a first key negotiation configuration file, wherein the first key negotiation configuration file is the same as the second key negotiation configuration file, and the key negotiation configuration file includes a plurality of key configuration items, wherein the key configuration items include an algorithm identifier and an encryption and decryption key, and the algorithm identifier represents a corresponding encryption and decryption algorithm;
[0397] Wherein, the method comprises:
[0398] receiving a key negotiation request message sent by the first device; the key negotiation request message is generated by the first device according to a first character string and verification information, the first character string is generated according to a random algorithm, the verification information is obtained by processing the first character string according to a version identifier of the first key negotiation configuration file, and the first device further processes the first character string according to the version identifier of the first key negotiation configuration file to obtain a first configuration item in the first key negotiation configuration file;
[0399] Performing legitimacy verification on the verification information in the key negotiation request message according to the version identifier of the second key negotiation configuration file;
[0400] When the verification information in the key negotiation request message passes the legitimacy verification, encrypt the communication key according to the corresponding encryption and decryption key using the encryption and decryption algorithm corresponding to the second configuration item to generate a key negotiation confirmation message, wherein the key negotiation confirmation message at least includes: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file;
[0401] The key negotiation confirmation message is sent to the first device, so that the first device decrypts the communication key in the key negotiation confirmation message according to the first configuration item, so that the first device and the second device perform encrypted communication using the communication key.
[0402] According to one or more embodiments of the present application, Figure 5 Provided is a communication control device, configured on a first device, the first device is configured with a first key negotiation configuration file, the second device is configured with a second key negotiation configuration file, the first key negotiation configuration file is the same as the second key negotiation configuration file, and the key negotiation configuration file includes a plurality of key configuration items, the key configuration items include an algorithm identifier and an encryption and decryption key, and the algorithm identifier represents a corresponding encryption and decryption algorithm;
[0403] Wherein, the device comprises:
[0404] A character string generating unit, used for generating a first character string according to a random algorithm;
[0405] a character string processing unit, configured to process the first character string according to a version identifier of the first key agreement configuration file to obtain verification information and a first configuration item in the first key agreement configuration file;
[0406] A message generating unit, configured to generate a key agreement request message based at least on the first character string and the verification information;
[0407] a message sending unit, configured to send the key negotiation request message to the second device, so that the second device, when the second device passes the legitimacy verification of the verification information in the key negotiation request message, uses the encryption and decryption algorithm corresponding to the second configuration item to encrypt the communication key according to the corresponding encryption and decryption key to generate a key negotiation confirmation message, wherein the key negotiation confirmation message at least includes: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file;
[0408] A message receiving unit, configured to receive the key negotiation confirmation message sent by the second device;
[0409] A key decryption unit is used to decrypt the communication key in the key negotiation confirmation message according to the first configuration item, so that the first device and the second device can use the communication key to perform encrypted communication.
[0410] According to one or more embodiments of the present application, Figure 6 Provided is a communication control device, configured in a second device, the second device is configured with a second key negotiation configuration file, the first device is configured with a first key negotiation configuration file, the first key negotiation configuration file is the same as the second key negotiation configuration file, and the key negotiation configuration file includes a plurality of key configuration items, the key configuration items include an algorithm identifier and an encryption and decryption key, and the algorithm identifier represents a corresponding encryption and decryption algorithm;
[0411] Wherein, the device comprises:
[0412] a message receiving unit, configured to receive a key negotiation request message sent by the first device; the key negotiation request message is generated by the first device according to a first character string and verification information, the first character string is generated according to a random algorithm, the verification information is obtained by processing the first character string according to a version identifier of the first key negotiation configuration file, and the first device further processes the first character string according to the version identifier of the first key negotiation configuration file to obtain a first configuration item in the first key negotiation configuration file;
[0413] a message verification unit, configured to verify the legitimacy of the verification information in the key negotiation request message according to the version identifier of the second key negotiation configuration file; and trigger the message generation unit when the legitimacy verification of the verification information in the key negotiation request message passes;
[0414] The message generating unit is configured to encrypt the communication key according to the corresponding encryption and decryption key using the encryption and decryption algorithm corresponding to the second configuration item to generate a key negotiation confirmation message, wherein the key negotiation confirmation message at least includes: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file;
[0415] A message sending unit is used to send the key negotiation confirmation message to the first device, so that the first device decrypts the communication key in the key negotiation confirmation message according to the first configuration item, so that the first device and the second device use the communication key to perform encrypted communication.
[0416] According to one or more embodiments of the present application, Fig.12 An electronic device is provided. When the electronic device is used as a first device, the electronic device includes:
[0417] Memory, such as ROM 1202, RAM 1203 and storage device 1208, is used to store computer programs and data generated by the operation of the computer programs;
[0418] A processor, configured to execute the computer program to implement:
[0419] Generate a first character string according to a random algorithm;
[0420] Processing the first character string according to the version identifier of the first key agreement configuration file to obtain verification information and a first configuration item in the first key agreement configuration file;
[0421] generating a key agreement request message based at least on the first character string and the verification information;
[0422] The key negotiation request message is sent to the second device, so that the second device, when the second device passes the legitimacy verification of the verification information in the key negotiation request message, uses the encryption and decryption algorithm corresponding to the second configuration item to encrypt the communication key according to the corresponding encryption and decryption key to generate a key negotiation confirmation message, wherein the key negotiation confirmation message at least includes: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file;
[0423] receiving the key negotiation confirmation message sent by the second device;
[0424] The communication key in the key negotiation confirmation message is decrypted according to the first configuration item, so that the first device and the second device perform encrypted communication using the communication key.
[0425] According to one or more embodiments of the present application, Fig.12 An electronic device is provided, and when the electronic device is used as a second device, the electronic device includes:
[0426] Memory, such as ROM 1202, RAM 1203 and storage device 1208, is used to store computer programs and data generated by the operation of the computer programs;
[0427] A processor, configured to execute the computer program to implement:
[0428] receiving a key negotiation request message sent by the first device; the key negotiation request message is generated by the first device according to a first character string and verification information, the first character string is generated according to a random algorithm, the verification information is obtained by processing the first character string according to a version identifier of the first key negotiation configuration file, and the first device further processes the first character string according to the version identifier of the first key negotiation configuration file to obtain a first configuration item in the first key negotiation configuration file;
[0429] Performing legitimacy verification on the verification information in the key negotiation request message according to the version identifier of the second key negotiation configuration file;
[0430] When the verification information in the key negotiation request message passes the legitimacy verification, encrypt the communication key according to the corresponding encryption and decryption key using the encryption and decryption algorithm corresponding to the second configuration item to generate a key negotiation confirmation message, wherein the key negotiation confirmation message at least includes: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file;
[0431] The key negotiation confirmation message is sent to the first device, so that the first device decrypts the communication key in the key negotiation confirmation message according to the first configuration item, so that the first device and the second device perform encrypted communication using the communication key.
[0432] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
[0433] Although several specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present application. Certain features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination.
[0434] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.
Claims
1. A communication control method, characterized in that: Applied to a first device, the first device is configured with a first key negotiation configuration file, the second device is configured with a second key negotiation configuration file, the first key negotiation configuration file is the same as the second key negotiation configuration file, and the key negotiation configuration file includes a plurality of key configuration items, the key configuration items include an algorithm identifier and an encryption and decryption key, and the algorithm identifier represents a corresponding encryption and decryption algorithm; Wherein, the method comprises: Generate a first character string according to a random algorithm; Processing the first character string according to the version identifier of the first key agreement configuration file to obtain verification information and a first configuration item in the first key agreement configuration file; generating a key agreement request message based at least on the first character string and the verification information; The key negotiation request message is sent to the second device, so that the second device, when the second device passes the legitimacy verification of the verification information in the key negotiation request message, uses the encryption and decryption algorithm corresponding to the second configuration item to encrypt the communication key according to the corresponding encryption and decryption key to generate a key negotiation confirmation message, wherein the key negotiation confirmation message at least includes: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file; receiving the key negotiation confirmation message sent by the second device; The communication key in the key negotiation confirmation message is decrypted according to the first configuration item, so that the first device and the second device perform encrypted communication using the communication key.
2. The method according to claim 1, processing the first character string according to the version identifier of the first key agreement configuration file to obtain verification information and a first configuration item in the first key agreement configuration file, comprising: Obtaining first summary information according to the version identifier of the first key agreement configuration file and the first character string; Obtaining a first index identifier according to the first summary information; Obtaining, according to the first index identifier, a corresponding first configuration item in the first key agreement configuration file; According to the first configuration item, the first index identifier and the first character string are processed to obtain second summary information; the first summary information and the second summary information constitute verification information.
3. The method according to claim 2, obtaining first summary information according to the version identifier of the first key agreement configuration file and the first character string, comprising: Obtaining a second character string according to the version identifier of the first key agreement configuration file and the first character string; The second character string is processed using a digest algorithm to obtain first digest information.
4. The method according to claim 2, processing the first index identifier and the first character string according to the first configuration item to obtain second summary information, comprising: Convert the first index identifier into a character string to obtain a third character string; Encrypting the first character string using the encryption and decryption algorithm corresponding to the first configuration item according to the corresponding encryption and decryption key to obtain a fourth character string; Obtain a fifth character string according to the third character string and the fourth character string; The fifth character string is processed using a digest algorithm to obtain second digest information.
5. A communication control method, characterized in that: Applied to a second device, the second device is configured with a second key negotiation configuration file, the first device is configured with a first key negotiation configuration file, the first key negotiation configuration file is the same as the second key negotiation configuration file, and the key negotiation configuration file includes a plurality of key configuration items, the key configuration items include an algorithm identifier and an encryption and decryption key, and the algorithm identifier represents a corresponding encryption and decryption algorithm; Wherein, the method comprises: receiving a key negotiation request message sent by the first device; the key negotiation request message is generated by the first device according to a first character string and verification information, the first character string is generated according to a random algorithm, the verification information is obtained by processing the first character string according to a version identifier of the first key negotiation configuration file, and the first device further processes the first character string according to the version identifier of the first key negotiation configuration file to obtain a first configuration item in the first key negotiation configuration file; Performing, according to the version identifier of the second key agreement configuration file, legality verification on the verification information in the key agreement request message; When the verification information in the key negotiation request message passes the legitimacy verification, encrypt the communication key according to the corresponding encryption and decryption key using the encryption and decryption algorithm corresponding to the second configuration item to generate a key negotiation confirmation message, wherein the key negotiation confirmation message at least includes: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file; The key negotiation confirmation message is sent to the first device, so that the first device decrypts the communication key in the key negotiation confirmation message according to the first configuration item, so that the first device and the second device perform encrypted communication using the communication key.
6. The method according to claim 5, performing legitimacy verification on the verification information in the key negotiation request message according to the version identifier of the second key negotiation configuration file, comprising: Obtaining third summary information according to the version identifier of the second key agreement configuration file and the first character string; Comparing the third summary information with the first summary information in the verification information to obtain a first verification result; the first summary information is obtained according to the version identifier of the first key agreement configuration file and the first character string; When the first verification result indicates that the first summary information has passed verification, obtaining a second index identifier according to the third summary information; If the first verification result indicates that the first summary information verification has not passed, determining that the legitimacy verification of the verification information has not passed; Obtaining, according to the second index identifier, a corresponding second configuration item in the second key agreement configuration file; According to the second configuration item, the second index identifier and the first character string are processed to obtain fourth summary information; The fourth summary information is compared with the second summary information in the verification information to obtain a second verification result; the second verification result indicates whether the second summary information is verified; the second summary information is obtained by the first device processing the first index identifier and the first character string according to the first configuration item, and the first index identifier is obtained by the first device according to the first summary information; the first configuration item is obtained by the first device in the first key agreement configuration file according to the first index identifier; If the second verification result indicates that the second summary information has passed verification, it is determined that the verification information has passed legality verification; if the second verification result indicates that the second summary information has not passed verification, it is determined that the verification information has not passed legality verification.
7. The method according to claim 6, obtaining third summary information according to the version identifier of the second key agreement configuration file and the first character string, comprising: Obtaining a sixth character string according to the version identifier of the second key agreement configuration file and the first character string; The sixth character string is processed using a digest algorithm to obtain third digest information.
8. The method according to claim 6, processing the second index identifier and the first character string according to the second configuration item to obtain fourth summary information, comprising: Performing string conversion on the second index identifier to obtain a seventh string; Encrypting the first character string using the encryption and decryption algorithm corresponding to the second configuration item according to the corresponding encryption and decryption key to obtain an eighth character string; Obtaining a ninth character string according to the seventh character string and the eighth character string; The ninth character string is processed using a digest algorithm to obtain fourth digest information.
9. A communication control device, characterized in that: The first device is configured with a first key negotiation configuration file, and the second device is configured with a second key negotiation configuration file, the first key negotiation configuration file is the same as the second key negotiation configuration file, and the key negotiation configuration file includes a plurality of key configuration items, the key configuration items include an algorithm identifier and an encryption and decryption key, and the algorithm identifier represents a corresponding encryption and decryption algorithm; Wherein, the device comprises: A character string generating unit, used for generating a first character string according to a random algorithm; a character string processing unit, configured to process the first character string according to a version identifier of the first key agreement configuration file to obtain verification information and a first configuration item in the first key agreement configuration file; A message generating unit, configured to generate a key agreement request message based at least on the first character string and the verification information; a message sending unit, configured to send the key negotiation request message to the second device, so that the second device, when the second device passes the legitimacy verification of the verification information in the key negotiation request message, uses the encryption and decryption algorithm corresponding to the second configuration item to encrypt the communication key according to the corresponding encryption and decryption key to generate a key negotiation confirmation message, wherein the key negotiation confirmation message at least includes: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file; A message receiving unit, configured to receive the key negotiation confirmation message sent by the second device; A key decryption unit is used to decrypt the communication key in the key negotiation confirmation message according to the first configuration item, so that the first device and the second device can use the communication key to perform encrypted communication.
10. A communication control device, characterized in that: The second device is configured with a second key negotiation configuration file, the first device is configured with a first key negotiation configuration file, the first key negotiation configuration file is the same as the second key negotiation configuration file, and the key negotiation configuration file includes a plurality of key configuration items, the key configuration items include an algorithm identifier and an encryption and decryption key, and the algorithm identifier represents a corresponding encryption and decryption algorithm; Wherein, the device comprises: a message receiving unit, configured to receive a key negotiation request message sent by the first device; the key negotiation request message is generated by the first device according to a first character string and verification information, the first character string is generated according to a random algorithm, the verification information is obtained by processing the first character string according to a version identifier of the first key negotiation configuration file, and the first device further processes the first character string according to the version identifier of the first key negotiation configuration file to obtain a first configuration item in the first key negotiation configuration file; a message verification unit, configured to verify the legitimacy of the verification information in the key negotiation request message according to the version identifier of the second key negotiation configuration file; and trigger the message generation unit when the legitimacy verification of the verification information in the key negotiation request message passes; The message generating unit is configured to encrypt the communication key according to the corresponding encryption and decryption key using the encryption and decryption algorithm corresponding to the second configuration item to generate a key negotiation confirmation message, wherein the key negotiation confirmation message at least includes: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key negotiation configuration file according to the version identifier of the second key negotiation configuration file; A message sending unit is used to send the key negotiation confirmation message to the first device, so that the first device decrypts the communication key in the key negotiation confirmation message according to the first configuration item, so that the first device and the second device use the communication key to perform encrypted communication.
Citation Information
Patent Citations
Key negotiation method, gateway, terminal equipment and storage medium
CN114884659A
Key negotiation updating method
CN115643007A
System and method for encryption and decryption based on quantum key distribution
WO2018017168A2
Key negotiation method and device
WO2018076365A1
