Communication control method and device
By generating a random string and performing version identification processing in the same key negotiation configuration file used by both communicating parties, the problem of communication interruption caused by inconsistent key updates is solved, and the reliability and security of communication are achieved.
Patent Information
- Application Number
- CN202411215036.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2044-08-30
AI Technical Summary
During the communication process, inconsistent key updates between the communicating parties can easily lead to interruption of communication services, and existing technologies are difficult to ensure the reliability of communication.
Using the same key negotiation configuration file, a random string is generated and processed according to the configuration file version identifier to generate verification information. After the legitimacy is verified, a key negotiation confirmation message is generated to achieve communication key negotiation and encrypted communication.
Even if the key agreement configuration file is not synchronized during the configuration item update process, the established communication services will not be interrupted, thus improving the reliability of secure communication.
Smart Images

Figure CN118972052B_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 communicating parties mostly use symmetric encryption to encrypt and decrypt messages, and use configuration files or databases to manage the keys used.
[0003] To improve security, keys need to be updated. However, when updating keys, both parties must keep the same pace, otherwise communication services may 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 apparatus 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 profile, and a second device is configured with a second key negotiation profile, wherein the first key negotiation profile and the second key negotiation profile are identical, and the key negotiation profiles include multiple key configuration items, each of the key configuration items including an algorithm identifier and an encryption / decryption key, wherein the algorithm identifier represents a corresponding encryption / decryption algorithm;
[0007] 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] Sending the key agreement request message to the second device, so that the second device, if the second device passes the legitimacy verification of the verification information in the key agreement request message, encrypts the communication key using the encryption and decryption algorithm corresponding to the second configuration item and the corresponding encryption and decryption key to generate a key agreement confirmation message, wherein the key agreement confirmation message includes at least: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file according to the version identifier of the second key agreement configuration file;
[0012] receiving the key agreement 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 digest information; the first digest information and the second digest 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] Performing string conversion on the first index identifier to obtain a third string;
[0024] Encrypting the first character string using the encryption and decryption algorithm corresponding to the first configuration item and the corresponding encryption and decryption key to obtain a fourth character string;
[0025] Obtaining 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, wherein the second device is configured with a second key agreement configuration file, and the first device is configured with a first key agreement configuration file, the first key agreement configuration file and the second key agreement configuration file are identical, and the key agreement configuration file includes multiple 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] The method comprises:
[0029] receiving a key agreement request message sent by the first device, where the key agreement request message is generated by the first device based on a first character string and verification information, where the first character string is generated according to a random algorithm, and the verification information is obtained by processing the first character string according to a version identifier of the first key agreement configuration file, and the first device further processes the first character string according to the version identifier of the first key agreement configuration file to obtain a first configuration item in the first key agreement configuration file;
[0030] 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;
[0031] If the verification information in the key agreement request message passes the legitimacy verification, encrypt the communication key using the encryption and decryption algorithm corresponding to the second configuration item according to the corresponding encryption and decryption key to generate a key agreement confirmation message, where the key agreement confirmation message includes at least the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file according to the version identifier of the second key agreement 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 agreement request message according to the version identifier of the second key agreement 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 digest information with the first digest information in the verification information to obtain a first verification result; the first digest information is obtained according to the version identifier of the first key agreement configuration file and the first character string;
[0036] If the first verification result indicates that the first digest information has passed verification, obtaining a second index identifier based on the third digest information; if the first verification result indicates that the first digest information has failed verification, determining that the validity verification of the verification information has failed;
[0037] Obtaining, according to the second index identifier, a corresponding second configuration item in the second key agreement configuration file;
[0038] Processing the second index identifier and the first character string according to the second configuration item to obtain fourth summary information;
[0039] comparing the fourth digest information with the second digest information in the verification information to obtain a second verification result; the second verification result indicates whether the second digest information passes verification; the second digest information is obtained by the first device by processing the first index identifier and the first string according to the first configuration item, the first index identifier being obtained by the first device based on the first digest information; and 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 digest information has passed verification, it is determined that the validity verification of the verification information has passed. If the second verification result indicates that the second digest information has failed verification, it is determined that the validity verification of the verification information has failed.
[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 and 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 apparatus is configured on a first device, wherein the first device is configured with a first key agreement configuration file, and a second device is configured with a second key agreement configuration file, wherein the first key agreement configuration file and the second key agreement configuration file are identical, and the key agreement configuration files include multiple key configuration items, wherein the key configuration items include an algorithm identifier and an encryption / decryption key, and the algorithm identifier represents a corresponding encryption / decryption algorithm;
[0050] Wherein, the device comprises:
[0051] A character string generating unit, configured to generate a first character string according to a random algorithm;
[0052] a string processing unit, 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;
[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 agreement request message to the second device, so that the second device, when the verification information in the key agreement request message is verified to be legitimate, encrypts the communication key using the encryption and decryption algorithm corresponding to the second configuration item according to the corresponding encryption and decryption key to generate a key agreement confirmation message, wherein the key agreement confirmation message includes at least: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file according to the version identifier of the second key agreement 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 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 perform encrypted communication using the communication key.
[0057] A communication control apparatus is configured on a second device, the second device being configured with a second key agreement configuration file, and the first device being configured with a first key agreement configuration file, the first key agreement configuration file and the second key agreement configuration file being identical, and the key agreement configuration file including a plurality of key configuration items, the key configuration items including an algorithm identifier and an encryption / decryption key, the algorithm identifier representing a corresponding encryption / decryption algorithm;
[0058] Wherein, the device comprises:
[0059] a message receiving unit, configured to receive a key agreement request message sent by the first device; the key agreement request message is generated by the first device based on a first character string and verification information, the first character string being generated according to a random algorithm, the verification information being obtained by processing the first character string according to a version identifier of the first key agreement configuration file, and the first device further processing the first character string according to the version identifier of the first key agreement configuration file to obtain a first configuration item in the first key agreement 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 if 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 using the encryption and decryption algorithm corresponding to the second configuration item according to the corresponding encryption and decryption key to generate a key agreement confirmation message, wherein the key agreement confirmation message includes at least: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file according to the version identifier of the second key agreement 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] As can be seen from the above technical solution, in a communication control method and device disclosed in the present application, the same key agreement configuration file is configured on both communicating parties, and multiple key configuration items are set in the key agreement configuration file. The key configuration item includes an algorithm identifier representing the encryption and decryption algorithm and the corresponding encryption key. Based on this, on the communication initiator, i.e., the first device, a random string is first obtained, and then the first string is processed according to the version identifier of the key agreement configuration file on the first device. In this way, verification information and the first configuration item can be obtained. Then, a key agreement request message generated according to the first string and the verification information is sent to the communication receiver, i.e., the second device. Therefore, if the second device passes the legitimacy verification of the verification information, the string in the key agreement request message is processed according to the version identifier of the key agreement file on the second device to obtain the second configuration item and generate a key agreement confirmation message based on the second configuration item and send it to the first device. The key agreement confirmation message includes the encrypted communication key. Therefore, after the first device receives the key agreement confirmation message, it can decrypt the communication key according to the first configuration item to achieve key agreement, and then use the communication key to perform encrypted communication with the second device. It can be seen that in this 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, then the two parties use the communication key generated by the receiving party to communicate. If the negotiation fails, then 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 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 various embodiments of the present application will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0065] Figure 1 A flow chart of a communication control method provided in Example 1 of the present application;
[0066] Figure 2 A partial flow chart of a communication control method provided in Example 1 of the present application;
[0067] Figure 3 A flow chart of a communication control method provided in Example 2 of the present application;
[0068] Figure 4 A partial flow chart of a communication control method provided in Example 2 of the present application;
[0069] Figure 5 A schematic structural diagram of a communication control device provided in Example 3 of the present application;
[0070] Figure 6 A schematic structural diagram of a communication control device provided in Example 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] Figure 9 This application is applicable to a communication scenario between information systems in a civil aviation airport, and is an example flowchart of a key negotiation failure between information systems;
[0074] Figure 10 This is a schematic diagram of the detailed process of generating a key agreement request message in a communication scenario between information systems in a civil aviation airport, as applied to this application;
[0075] Figure 11 This is a detailed diagram of the process of generating a key negotiation confirmation message in a communication scenario between information systems in a civil aviation airport, as applied to this application;
[0076] Figure 12 Schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION
[0077] The following describes embodiments of the present application in more detail 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 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 for illustrative purposes only and are not intended to limit the scope of protection of the present application.
[0078] As used herein, the term "including" and its variations are open-ended, 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," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0079] It should be noted that the concepts of "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 "multiple" mentioned in this application are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly indicated in the context, they 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 that implements a specific function, 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 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. 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 a key agreement configuration file, key configuration items can be stored as a two-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, an administrator can set the key agreement configuration files for the first device and the second device respectively, or the first device and the second device can download a key agreement configuration file pre-configured by the administrator from a specific server to maintain consistency between the first key agreement configuration file and the second key agreement configuration file. The technical solution in this embodiment is primarily 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. 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 profile can be represented by V. As the first key negotiation profile and the second key negotiation profile are updated, V is also updated. If the first key negotiation profile and the second key negotiation profile are updated asynchronously, the version identifiers of the first key negotiation profile and the second key negotiation profile are different. If the first key negotiation profile and the second key negotiation profile are updated synchronously, the version identifiers of the first key negotiation profile and the second key negotiation profile 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, and the like, based on the version identifier, to obtain verification information. The first configuration item may be retrieved from the first key agreement configuration file based on the hash value generated in this process. The verification information may include one or more items of information.
[0088] Step 103: Generate a key agreement request message based at least on the first character string and the verification information.
[0089] The key agreement request message includes at least the first character string and verification information. Furthermore, the key agreement request message may also include a message type, such as A1, indicating that the message is sent by the first device. For example, in step 103, the message type A1, the first character string S, and the verification information D are concatenated to obtain the key agreement request message.
[0090] Step 104: Send a key agreement request message to the second device.
[0091] After receiving the key agreement request message, the second device verifies the validity of the verification information in the key agreement request message. If the verification passes, the second device encrypts the communication key using the encryption and decryption algorithm corresponding to the second configuration item and the corresponding encryption and decryption key to generate a key agreement confirmation message. The key agreement confirmation message includes at least the encrypted communication key. The second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file based on the version identifier of the second key agreement configuration file. The second configuration item is obtained by the second device during the verification of the verification information in the key agreement 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 indicate that the message is a key negotiation rejection message sent by the second device, such as a message type of B2, which indicates 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: 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.
[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 items. 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 them 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 in accordance with 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 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 based on the version identifier of the first key agreement configuration file and the first string. For example, the version identifier of the first key agreement configuration file and the first string are concatenated 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 and calculate the digest of the second string to obtain first digest information. 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 in step 202 to obtain a first index identifier. 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 search for a 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 agreement configuration file is represented by C. After searching, C index1 =(n, key), the encryption algorithm corresponding to the encryption 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. The first summary information and the second summary information constitute verification information.
[0109] The second summary information can be represented by D2. Based on this, 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 based on the third and fourth strings, for example, the third and fourth strings are concatenated to obtain the fifth string; finally, the fifth string is processed using a digest algorithm to obtain second digest information, for example, the digest algorithm Digest is used to take the fifth string as input and 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 digest algorithms, hash functions, etc., which increases the complexity of information acquisition, thereby preventing the verification information from being crackable and improving security.
[0113] refer to Figure 3 , 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 equipped 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 profile, and the first device is also configured with a first key negotiation profile. The first device can be a terminal or server equipped with information system A. Information system A can be a system that implements a specific function, and the first key negotiation profile and the second key negotiation profile are the same. Among them, there are multiple key configuration items in each of the two key negotiation profiles. 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 based on 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 the version identifier of the first key negotiation configuration file. In addition, 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: Based on the version identifier of the second key agreement configuration file, the verification information in the key agreement request message is verified for validity. If the verification passes, steps 303 and 304 are executed. If the verification fails, steps 305 and 306 are executed.
[0118] Among them, if the version identifier of the second key negotiation configuration file is different from the version identifier of the first key negotiation configuration file, then 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, then the verification may pass.
[0119] Step 303: Use the encryption and decryption algorithm corresponding to the second configuration item and the corresponding encryption and decryption key to encrypt the communication key to generate a key negotiation confirmation message.
[0120] The key negotiation confirmation message includes at least 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.
[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 can 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 the 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 in accordance with 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 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, a sixth character string can be first obtained based on the version identifier of the second key agreement configuration file and the first character string. For example, the version identifier of the second key agreement configuration file and the first character string can be concatenated to obtain the sixth character string. Then, the sixth character string can be processed using a digest algorithm to obtain third digest information. For example, the digest algorithm Digest can be used to take the sixth character string as input and calculate the digest of the sixth character string to obtain third digest information. 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 passed verification, step 403 is executed. If the first verification result indicates that the first summary information has failed verification, 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 successfully, and the subsequent verification process, i.e., step 403 and subsequent steps, continues 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 failed to be verified, and in this case, 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, a hash value of the third digest 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 digest 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: According to the second index identifier, obtain the corresponding second configuration item in the second key agreement configuration file.
[0143] In a specific implementation, step 405 may search for a 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 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: Process the second index identifier and the first character string according to the second configuration item to obtain fourth summary information.
[0146] The fourth summary information can 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 the 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 the eighth string, for example, using C index2 The encryption algorithm corresponding to n is Encrypt n According to C index The first character string S is encrypted using the key in to obtain an eighth character string; then, a ninth character string is obtained based on the seventh character string and the eighth character string, for example, the seventh character string and the eighth character string are concatenated to obtain the ninth character string; finally, the ninth character string is processed using a digest algorithm to obtain fourth digest information, for example, the digest algorithm Digest is used to take the ninth character string as input and calculate a digest of the ninth character string to obtain fourth digest information.
[0149] Step 407: Compare the fourth digest information with the second digest information in the verification information to obtain a second verification result; the second verification result indicates whether the second digest information has been verified. If the second verification result indicates that the second digest information has been verified, execute step 408; if the second verification result indicates that the second digest 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 has been verified successfully, 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 has failed verification, and step 404 is executed.
[0152] Step 408: Determine whether the validity 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 digest information in the verification information are verified through digest algorithms, hash functions, etc., and the verification information is obtained through digest algorithms, hash functions, etc., thereby increasing the complexity of information acquisition and the security of information verification, so as 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 implementation 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, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that 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 flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the 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 the 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 embodiments of the present application can be performed in different orders and / or in parallel. In addition, the method embodiments 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 stand-alone 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 through 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 profile, and the second device is also configured with a second key negotiation profile. The second device can be a terminal or server installed with information system B, and the first key negotiation profile and the second key negotiation profile are the same. Among them, there are multiple key configuration items in each of the two key negotiation profiles. 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] A character string generating unit 501 is configured 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 based at least on the first character string and the verification information;
[0165] A message sending unit 504 is configured to send the key agreement request message to the second device, so that the second device, when the verification information in the key agreement request message is verified to be valid, encrypts the communication key using the encryption and decryption algorithm corresponding to the second configuration item according to the corresponding encryption and decryption key to generate a key agreement confirmation message, wherein the key agreement confirmation message includes at least: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file according to the version identifier of the second key agreement configuration file;
[0166] The message receiving unit 505 is configured 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 in accordance with 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 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 agreement 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 agreement 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 digest 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, the string processing unit 502 is specifically configured to: perform string conversion on the first index identifier to obtain a third string; encrypt the first 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 string; obtain a fifth string based on the third string and the fourth string; and process the fifth string using the digest 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 Example 4 of the present application. The device can be configured on a second device, wherein the second device is configured with a second key negotiation profile, and the first device is configured with a first key negotiation profile. The first key negotiation profile and the second key negotiation profile are identical, and the key negotiation profile includes multiple key configuration items, each of which includes an algorithm identifier and an encryption / decryption key. The algorithm identifier represents the corresponding encryption / 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] A message receiving unit 601 is configured to receive a key agreement request message sent by the first device; the key agreement request message is generated by the first device based on a first character string and verification information, the first character string being generated according to a random algorithm, the verification information being obtained by processing the first character string according to a version identifier of the first key agreement configuration file, and the first device further processing the first character string according to the version identifier of the first key agreement configuration file to obtain a first configuration item in the first key agreement configuration file;
[0176] a message verification unit 602, configured to verify the legitimacy of the verification information in the key agreement request message according to the version identifier of the second key agreement configuration file; and trigger the message generation unit if the legitimacy verification of the verification information in the key agreement request message passes;
[0177] The message generation unit 603 is configured to encrypt the communication key using the encryption and decryption algorithm corresponding to the second configuration item according to the corresponding encryption and decryption key to generate a key agreement confirmation message, where the key agreement confirmation message includes at least the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file according to the version identifier of the second key agreement 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 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 in accordance with 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 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 based on 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 based on 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 based on 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 second configuration item according to the second configuration item. The method further comprises processing the first device and the second device according to the first configuration item, processing the first index identifier and the first character string to obtain fourth digest information; comparing the fourth digest information with the second digest information in the verification information to obtain a second verification result; the second verification result indicates whether the second digest information is verified to be successful; the second digest 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 digest 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 digest information is verified to be successful, it is determined that the validity verification of the verification information is successful; if the second verification result indicates that the second digest information is verified to be unsuccessful, it is determined that the validity verification of the verification information is unsuccessful.
[0182] Among them, when the message verification unit 602 obtains the third summary information based on 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 based on the version identifier of the second key negotiation configuration file and the first character string; and use a digest algorithm to process the sixth character string to obtain the third summary information.
[0183] In particular, 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 configured to: perform string conversion on the second index identifier to obtain a seventh character string; encrypt 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; obtain a ninth character string based on the seventh character string and the eighth character string; and process the ninth character string using the digest algorithm 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 described in the embodiments of the present application may be implemented in software or hardware. In some cases, the name of a module does not limit the unit itself. For example, an 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, and 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 chip (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:
[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 keys used in actual communication in this application are completely random, enabling a one-time, one-time key. This significantly improves security compared to fixed symmetric key encryption and symmetric encryption based on the same communication key library. The key configuration stored in the key agreement configuration is used only for the negotiation of communication keys. This large-scale key configuration overcomes the difficulty of upgrading and updating single digital certificates in standard SSL / TLS encrypted communication methods.
[0190] In the information system communication method and device proposed in this application, the two communicating parties are regarded as two different information systems. Figure 7 As shown in Figure 1-1. Each information system includes a communication process, a management console, and a key negotiation configuration file.
[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: Communicates with other information systems and, in this application, acts as both the sender and receiver of messages. It performs encryption as a sender and decryption as a receiver.
[0193] Management console: Used to manage key negotiation configuration files. Only authorized high-level system maintenance personnel or trusted systems can operate in the management console. All operations in the management console are recorded in a detailed audit log. The management console allows you to reload the entire key negotiation configuration file online or update some key configuration items within a key negotiation configuration file. This prevents the use of duplicate key negotiation configuration files for a considerable period of time, further improving communication security.
[0194] The following describes the implementation principles of this application:
[0195] In this application, the communication process between information systems can be divided into two stages: key negotiation stage and communication stage.
[0196] During the key agreement phase, both communicating parties rely on the same key agreement configuration, using the same message digest algorithm and hash function. By generating and transmitting random strings and performing the same processing on the random strings, they determine the encryption algorithm and encryption / decryption keys for the key agreement phase. Based on this, they generate random strings as the encryption / decryption keys for the communication phase, and encrypt and transmit them using the encryption algorithm and encryption / decryption keys used in the key agreement phase, completing the key agreement. During the communication phase, both communicating parties use the communication key determined during the key agreement phase to conduct symmetric encrypted communication.
[0197] The key agreement phase is crucial for ensuring the security of the entire communication process. The fundamental goal of the key agreement phase is for both parties to reach agreement on the communication key to be used during the communication phase. The interactions between the two parties during the key agreement phase are directly related to the communication key and transmit the most sensitive information, which must be conducted securely and reliably. During the key agreement process, it is necessary to ensure that the negotiated communication key does not appear in plaintext, and that no third party can calculate the communication key solely through the key agreement exchange messages. This requires that the key agreement exchange messages, such as the request, confirmation, and rejection messages mentioned above, must not contain all the elements required to calculate the communication key. Instead, only some elements must be implicitly present, and the remaining elements rely on data content and processing known to both parties but unknown to third parties.
[0198] In this application, the data content that is known to both communicating parties but unknown to a 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 two-tuple in the form of (encryption and decryption algorithm code, key). It is only used in the key negotiation phase and is not used in the communication phase, further improving 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 you use 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 this application, the processing processes that are known to both communicating parties but unknown to the third party include 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 describes 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 described in detail below.
[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 containing 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) Key negotiation failure workflow:
[0214] The workflow for key negotiation failure is as follows Figure 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 with a key negotiation rejection message to information system A, and the communication key negotiation ends in failure.
[0219] The detailed process of information system B generating the key negotiation rejection message is described in detail below.
[0220] (3) The detailed process of generating the key negotiation request message, such as Figure 10 As shown in:
[0221] Step 1001: Generate a random string S.
[0222] Step 1002: Obtain the version number V of the key agreement 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 obtain 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 with D1 as input to obtain 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 Encrypt S to obtain S3, concatenate S2 and S3 to obtain S4, and calculate the summary D2 of S4, where D2 is a string of fixed length.
[0231] If STRING is used to represent character 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 obtain 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 Figure 11 As shown in:
[0239] Step 1101: Obtain the version number V of the key agreement 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 obtain 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 ). V A is the version number of the key negotiation configuration file of the 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 The string S generated by information system A in the previous text is sent to information system B through a key negotiation request message, 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 key negotiation configuration file version number V, 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 transmission 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 systems A and 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 impossible.
[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 to 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 character 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 obtain 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 for information system B to calculate D3 is:
[0265] D4=Digest(S4)=Digest(STRING(Hash B (D3))+Encryptn B (S, key)).
[0266] In step 1102, D3=D1 is obtained, confirming that information system A and information system B use the same message digest algorithm and have the same key agreement 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] Thus 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 impossible.
[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 agreement configuration file in this application can be stored in the form of a configuration file or a database and managed uniformly 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 comments.
[0279] Secondly, excluding 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 snippet of a key negotiation configuration file. The first line indicates the key negotiation configuration file's version number (V) (version 1.0 in the example), the next line indicates the number of key configuration items (N) (65536 in the example), and the following key configuration items. Each key configuration item consists of the encryption / decryption algorithm code (in the example, 1 indicates the AES algorithm, 2 indicates the SM2 algorithm, and so on) and the encrypted and textual 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 as shown in Table 1:
[0289] Table 1 Management commands
[0290]
[0291]
[0292] The following examples illustrate 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 Figure 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 key negotiation request message generation process:
[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] Moreover, the key agreement 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 below, arranged according to message type, D1, D2, and S:
[0310] "A141ef9b3fb5e278bde98a40cf278e4369199a3d1c0cf278e4369199a3d1c41ef9b3fb5e278bde98a4Inu?_876nzc8bde9.xzQw3u39@03zji3eo+ / ?zma8bde9Ac".
[0311] Next, 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: Figure 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] Based on the random string in the key negotiation request message:
[0315] S = "Inu?_876nzc8bde9.xzQw3u39@03zji3eo+ / ?zma8bde9Ac", the version number of the key agreement configuration file, and the calculated 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 the same as 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] Moreover, the key confirmation message type is B1.
[0326] Based on this, information system B sends a key negotiation confirmation message as shown below, arranged according to message type and K1:
[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 Figure 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, information system A sends a key agreement request message as shown below, arranged according to message type, D1, D2, and S:
[0345] "A141ef9b3fb5e278bde98a40cf278e4369199a3d1c0cf278e4369199a3d1c41ef9b3fb5e278bde98a4Inu?_876nzc8bde9.xzQw3u39@03zji3eo+ / ?zma8bde9Ac".
[0346] Next, 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] Based on the random string in the key negotiation request message:
[0349] S = "Inu?_876nzc8bde9.xzQw3u39@03zji3eo+ / ?zma8bde9Ac", the version number of the key agreement configuration file, and the calculated D3 = "40cf278e4369199a3d1c41ef9b3fb5e278bd888", which is different from D1.
[0350] The key negotiation rejection message type is B1. Based on this, information system B sends a key negotiation rejection message as follows:
[0351] B1.
[0352] In summary, this application proposes a method and apparatus for communication between information systems. The communicating parties share the same key negotiation profile. The two parties first negotiate the symmetric encryption key for subsequent communications based on the key negotiation profile. After the negotiation is complete, the actual communication is completed through symmetric encryption. This method 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 achieve one-time one-key, which greatly improves security compared with fixed symmetric key encryption communication and symmetric encryption communication based on the same communication key library.
[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, this application supports updating the key negotiation configuration file in an online manner without affecting the established communication link. It can avoid the use of repeated key negotiation configuration files for a considerable period of time, further improving the security of communication.
[0356] Reference below Figure 12 , which shows a structural schematic diagram 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 mentioned above. Figure 12 The electronic device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0357] like Figure 12As shown, the electronic device may include a processor (e.g., a central processing unit, a graphics processing unit, 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. Various programs and data required for the operation of the electronic device are also stored in the RAM 1203. 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 touchpad, 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 Figure 12 The electronic device is shown with various devices, but it should be understood that it is not required to implement or possess all of 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 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 via the communication device 1209, or installed from the storage device 1208, or installed from the ROM 1202.
[0360] When the electronic device serves 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] Sending the key agreement request message to the second device, so that the second device, if the second device passes the legitimacy verification of the verification information in the key agreement request message, encrypts the communication key using the encryption and decryption algorithm corresponding to the second configuration item and the corresponding encryption and decryption key to generate a key agreement confirmation message, wherein the key agreement confirmation message includes at least: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file according to the version identifier of the second key agreement configuration file;
[0365] receiving the key agreement 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 protection for a computer storage medium for storing computer software instructions 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] Sending the key agreement request message to the second device, so that the second device, if the second device passes the legitimacy verification of the verification information in the key agreement request message, encrypts the communication key using the encryption and decryption algorithm corresponding to the second configuration item and the corresponding encryption and decryption key to generate a key agreement confirmation message, wherein the key agreement confirmation message includes at least: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file according to the version identifier of the second key agreement configuration file;
[0373] receiving the key agreement 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 functions as the second device, when the computer program is executed by the processor 1201, the electronic device performs the above functions defined in the method of the embodiment of the present application:
[0376] receiving a key agreement request message sent by the first device, where the key agreement request message is generated by the first device based on a first character string and verification information, where the first character string is generated according to a random algorithm, and the verification information is obtained by processing the first character string according to a version identifier of the first key agreement configuration file, and the first device further processes the first character string according to the version identifier of the first key agreement configuration file to obtain a first configuration item in the first key agreement configuration file;
[0377] 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;
[0378] If the verification information in the key agreement request message passes the legitimacy verification, encrypt the communication key using the encryption and decryption algorithm corresponding to the second configuration item according to the corresponding encryption and decryption key to generate a key agreement confirmation message, where the key agreement confirmation message includes at least the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file according to the version identifier of the second key agreement 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 protection for a computer storage medium for storing computer software instructions 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 agreement request message sent by the first device, where the key agreement request message is generated by the first device based on a first character string and verification information, where the first character string is generated according to a random algorithm, and the verification information is obtained by processing the first character string according to a version identifier of the first key agreement configuration file, and the first device further processes the first character string according to the version identifier of the first key agreement configuration file to obtain a first configuration item in the first key agreement configuration file;
[0383] 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;
[0384] If the verification information in the key agreement request message passes the legitimacy verification, encrypt the communication key using the encryption and decryption algorithm corresponding to the second configuration item according to the corresponding encryption and decryption key to generate a key agreement confirmation message, where the key agreement confirmation message includes at least the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file according to the version identifier of the second key agreement 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 apparatus. 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. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, 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 mentioned above in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. A computer-readable storage medium may be, for example, but is not limited to, an electronic, 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 having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including, but not limited to, an electromagnetic signal, an optical signal, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a 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 thereof.
[0387] The computer storage medium may be included in the electronic device, or may exist independently without being incorporated into 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 profile, and the second device is configured with a second key negotiation profile, wherein the first key negotiation profile and the second key negotiation profile are identical, and the key negotiation profiles include multiple key configuration items, each of which includes an algorithm identifier and an encryption / decryption key, wherein the algorithm identifier represents a corresponding encryption / decryption algorithm;
[0389] 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] Sending the key agreement request message to the second device, so that the second device, if the second device passes the legitimacy verification of the verification information in the key agreement request message, encrypts the communication key using the encryption and decryption algorithm corresponding to the second configuration item and the corresponding encryption and decryption key to generate a key agreement confirmation message, wherein the key agreement confirmation message includes at least: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file according to the version identifier of the second key agreement configuration file;
[0394] receiving the key agreement 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 profile, and the first device is configured with a first key negotiation profile, wherein the first key negotiation profile and the second key negotiation profile are identical, and the key negotiation profile includes multiple key configuration items, each of which includes an algorithm identifier and an encryption / decryption key, wherein the algorithm identifier represents a corresponding encryption / decryption algorithm;
[0397] The method comprises:
[0398] receiving a key agreement request message sent by the first device, where the key agreement request message is generated by the first device based on a first character string and verification information, where the first character string is generated according to a random algorithm, and the verification information is obtained by processing the first character string according to a version identifier of the first key agreement configuration file, and the first device further processes the first character string according to the version identifier of the first key agreement configuration file to obtain a first configuration item in the first key agreement configuration file;
[0399] 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;
[0400] If the verification information in the key agreement request message passes the legitimacy verification, encrypt the communication key using the encryption and decryption algorithm corresponding to the second configuration item according to the corresponding encryption and decryption key to generate a key agreement confirmation message, where the key agreement confirmation message includes at least the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file according to the version identifier of the second key agreement 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 A communication control apparatus is provided, configured on a first device, wherein the first device is configured with a first key agreement configuration file, and a second device is configured with a second key agreement configuration file, wherein the first key agreement configuration file and the second key agreement configuration file are identical, and the key agreement configuration files include multiple key configuration items, wherein the key configuration items include an algorithm identifier and an encryption / decryption key, and the algorithm identifier represents a corresponding encryption / decryption algorithm;
[0403] Wherein, the device comprises:
[0404] A character string generating unit, configured to generate a first character string according to a random algorithm;
[0405] a string processing unit, 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;
[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 agreement request message to the second device, so that the second device, when the verification information in the key agreement request message is verified to be legitimate, encrypts the communication key using the encryption and decryption algorithm corresponding to the second configuration item according to the corresponding encryption and decryption key to generate a key agreement confirmation message, wherein the key agreement confirmation message includes at least: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file according to the version identifier of the second key agreement 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 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 perform encrypted communication using the communication key.
[0410] According to one or more embodiments of the present application, Figure 6 Provided is a communication control apparatus, configured on a second device, the second device being configured with a second key agreement profile, and the first device being configured with a first key agreement profile, the first key agreement profile and the second key agreement profile being identical, and the key agreement profile including a plurality of key configuration items, the key configuration items including an algorithm identifier and an encryption / decryption key, the algorithm identifier representing a corresponding encryption / decryption algorithm;
[0411] Wherein, the device comprises:
[0412] a message receiving unit, configured to receive a key agreement request message sent by the first device; the key agreement request message is generated by the first device based on a first character string and verification information, the first character string being generated according to a random algorithm, the verification information being obtained by processing the first character string according to a version identifier of the first key agreement configuration file, and the first device further processing the first character string according to the version identifier of the first key agreement configuration file to obtain a first configuration item in the first key agreement 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 if 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 using the encryption and decryption algorithm corresponding to the second configuration item according to the corresponding encryption and decryption key to generate a key agreement confirmation message, wherein the key agreement confirmation message includes at least: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file according to the version identifier of the second key agreement 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, Figure 12 An electronic device is provided. When serving 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 execution 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] Sending the key agreement request message to the second device, so that the second device, if the second device passes the legitimacy verification of the verification information in the key agreement request message, encrypts the communication key using the encryption and decryption algorithm corresponding to the second configuration item and the corresponding encryption and decryption key to generate a key agreement confirmation message, wherein the key agreement confirmation message includes at least: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file according to the version identifier of the second key agreement configuration file;
[0423] receiving the key agreement 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, Figure 12 An electronic device is provided. When serving 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 execution of the computer programs;
[0427] A processor, configured to execute the computer program to implement:
[0428] receiving a key agreement request message sent by the first device, where the key agreement request message is generated by the first device based on a first character string and verification information, where the first character string is generated according to a random algorithm, and the verification information is obtained by processing the first character string according to a version identifier of the first key agreement configuration file, and the first device further processes the first character string according to the version identifier of the first key agreement configuration file to obtain a first configuration item in the first key agreement configuration file;
[0429] 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;
[0430] If the verification information in the key agreement request message passes the legitimacy verification, encrypt the communication key using the encryption and decryption algorithm corresponding to the second configuration item according to the corresponding encryption and decryption key to generate a key agreement confirmation message, where the key agreement confirmation message includes at least the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file according to the version identifier of the second key agreement 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 acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts 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 construed as limiting the scope of this application. Certain features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented in multiple embodiments individually or in any suitable sub-combination.
[0434] The above description is merely a preferred embodiment of the present application and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this application is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but also encompasses other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this application.
Claims
1. A communication control method, characterized in that: Applied to a first device, the first device is configured with a first key agreement configuration file, and the second device is configured with a second key agreement configuration file, the first key agreement configuration file and the second key agreement configuration file are identical, and the key agreement configuration files include multiple 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; 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; Sending the key agreement request message to the second device, so that the second device, if the second device passes the legitimacy verification of the verification information in the key agreement request message, encrypts the communication key using the encryption and decryption algorithm corresponding to the second configuration item and the corresponding encryption and decryption key to generate a key agreement confirmation message, wherein the key agreement confirmation message includes at least: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file according to the version identifier of the second key agreement configuration file; receiving the key agreement 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 the 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 digest information; the first digest information and the second digest 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, wherein the first index identifier and the first character string are processed according to the first configuration item to obtain second summary information, comprising: Performing string conversion on the first index identifier to obtain a third string; Encrypting the first character string using the encryption and decryption algorithm corresponding to the first configuration item and the corresponding encryption and decryption key to obtain a fourth character string; Obtaining 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, where the second device is configured with a second key agreement profile, and the first device is configured with a first key agreement profile, where the first key agreement profile and the second key agreement profile are identical, and the key agreement profile includes multiple key configuration items, where the key configuration items include an algorithm identifier and an encryption / decryption key, where the algorithm identifier represents a corresponding encryption / decryption algorithm; The method comprises: receiving a key agreement request message sent by the first device, where the key agreement request message is generated by the first device based on a first character string and verification information, where the first character string is generated according to a random algorithm, and the verification information is obtained by processing the first character string according to a version identifier of the first key agreement configuration file, and the first device further processes the first character string according to the version identifier of the first key agreement configuration file to obtain a first configuration item in the first key agreement 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; If the verification information in the key agreement request message passes the legitimacy verification, encrypt the communication key using the encryption and decryption algorithm corresponding to the second configuration item according to the corresponding encryption and decryption key to generate a key agreement confirmation message, where the key agreement confirmation message includes at least the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file according to the version identifier of the second key agreement 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, wherein the step of performing validity verification on the verification information in the key agreement request message according to the version identifier of the second key agreement configuration file comprises: Obtaining third summary information according to the version identifier of the second key agreement configuration file and the first character string; Comparing the third digest information with the first digest information in the verification information to obtain a first verification result; the first digest information is obtained according to the version identifier of the first key agreement configuration file and the first character string; If the first verification result indicates that the first digest information has passed verification, obtaining a second index identifier according to the third digest information; If the first verification result indicates that the first summary information verification fails, determining that the legitimacy verification of the verification information fails; Obtaining, according to the second index identifier, a corresponding second configuration item in the second key agreement configuration file; Processing the second index identifier and the first character string according to the second configuration item to obtain fourth summary information; comparing the fourth digest information with the second digest information in the verification information to obtain a second verification result; the second verification result indicates whether the second digest information passes verification; the second digest information is obtained by the first device by processing the first index identifier and the first string according to the first configuration item, the first index identifier being obtained by the first device based on the first digest 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 digest information has passed verification, it is determined that the validity verification of the verification information has passed. If the second verification result indicates that the second digest information has failed verification, it is determined that the validity verification of the verification information has failed.
7. The method according to claim 6, obtaining third summary information according to the version identifier of the second key agreement profile 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, wherein the second index identifier and the first character string are processed 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 and 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: A first key agreement configuration file is configured on a first device, and a second key agreement configuration file is configured on a second device, where the first key agreement configuration file and the second key agreement configuration file are identical, and the key agreement configuration files include multiple key configuration items, each of the key configuration items includes an algorithm identifier and an encryption / decryption key, where the algorithm identifier represents a corresponding encryption / decryption algorithm; Wherein, the device comprises: A character string generating unit, configured to generate a first character string according to a random algorithm; a string processing unit, 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; 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 agreement request message to the second device, so that the second device, when the verification information in the key agreement request message is verified to be legitimate, encrypts the communication key using the encryption and decryption algorithm corresponding to the second configuration item according to the corresponding encryption and decryption key to generate a key agreement confirmation message, wherein the key agreement confirmation message includes at least: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file according to the version identifier of the second key agreement configuration file; a message receiving unit, configured to receive the key negotiation confirmation message sent by the second device; A key decryption unit 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 perform encrypted communication using the communication key.
10. A communication control device, characterized in that: Configuring a second device, where the second device is configured with a second key agreement configuration file, and the first device is configured with a first key agreement configuration file, where the first key agreement configuration file and the second key agreement configuration file are identical, and the key agreement configuration file includes multiple key configuration items, where the key configuration items include an algorithm identifier and an encryption / decryption key, and the algorithm identifier represents a corresponding encryption / decryption algorithm; Wherein, the device comprises: a message receiving unit, configured to receive a key agreement request message sent by the first device; the key agreement request message is generated by the first device based on a first character string and verification information, the first character string being generated according to a random algorithm, the verification information being obtained by processing the first character string according to a version identifier of the first key agreement configuration file, and the first device further processing the first character string according to the version identifier of the first key agreement configuration file to obtain a first configuration item in the first key agreement 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 if 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 using the encryption and decryption algorithm corresponding to the second configuration item according to the corresponding encryption and decryption key to generate a key agreement confirmation message, wherein the key agreement confirmation message includes at least: the encrypted communication key; the second configuration item is obtained by the second device processing the first character string in the second key agreement configuration file according to the version identifier of the second key agreement 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