Method, device and storage medium for realizing confidential communication
Through regional encryption and decryption technology of data packets, the problem of high power consumption in existing secure communication technology is solved, and efficient secure communication in the Internet of Things environment is achieved, combining the needs of security and power consumption management.
Patent Information
- Application Number
- CN202080000365.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-24
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2040-03-24
AI Technical Summary
Existing secure communication technology increases the power consumption of the device due to the encryption and decryption process, resulting in high power consumption and is difficult to effectively manage in environments with high node distribution and dispersed data transmission such as the Internet of Things.
The first information and the second information of the data packet are respectively encrypted to generate an encrypted message, and partial decryption of the encrypted message is used to determine whether to perform complete decryption. Only two decryption operations are performed when necessary to enhance the security of confidential communication. And reduce decryption operations when not needed to save power consumption.
Through regional encryption and decryption technology, the security of confidential communication is improved, while power consumption is saved when complete decryption is not required, and the data forwarding efficiency and power utilization of the device are improved.
Smart Images

Figure CN113796044B
Abstract
Description
Technical Field
[0001] This article relates to but is not limited to the field of wireless communication technology, and in particular to methods, devices and storage media for implementing confidential communications. Background Art
[0002] The Internet of Things connects people, machines and things extensively. Due to the large number of distributed nodes, scattered data transmission and inadequate supervision, the security and privacy issues of the Internet of Things are more prominent and have become the focus of attention in the security management of the Internet of Things. Confidential communication refers to communication that has taken confidentiality measures. In addition to the use of secret codes, code words, passwords and other confidentiality measures, modern confidential communication mainly adopts channel confidentiality or information confidentiality. Channel confidentiality is the use of communication channels that make it difficult for eavesdroppers to intercept information, such as dedicated lines, instantaneous communication or radio spread spectrum communication. Information confidentiality is to conceal the transmitted information with agreed code passwords and other methods before sending it out. With the development of electronic technology, confidentiality machines have been used for confidentiality. Its characteristics are to transform and encrypt the transmitted information at the sending end, and restore the information at the receiving end according to the reverse process, so that even if the eavesdropper receives the signal, he will not understand what the signal represents.
[0003] Since confidential communications require encryption and decryption, the power of the device is consumed faster. SUMMARY OF THE INVENTION
[0005] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
[0006] The embodiments of the present disclosure provide a method, device and storage medium for implementing confidential communication.
[0007] In a first aspect, an embodiment of the present disclosure provides a method for implementing confidential communication, including:
[0008] Encrypting the first information and the second information of the data packet respectively to generate an encrypted message; wherein the area where the encrypted first information is located is the first encryption area, and the area where the encrypted second information is located is the second encryption area; the first information is used for the receiving device to determine whether to obtain the second information;
[0009] Send the encrypted message.
[0010] In a second aspect, an embodiment of the present disclosure provides a method for implementing confidential communication, including:
[0011] Receive an encrypted message; wherein the encrypted message is generated by encrypting the first information and the second information of the original data packet respectively, the area where the encrypted first information is located is the first encryption area, and the area where the encrypted second information is located is the second encryption area;
[0012] The first encrypted area of the encrypted message is decrypted, and after the first information is successfully obtained through decryption, it is determined whether to obtain the second information according to the first information.
[0013] In a third aspect, an embodiment of the present disclosure provides a device for implementing confidential communication, comprising: a communication module, a memory and a processor, wherein the communication module is connected to the processor, the memory stores a computer program, and when the computer program is executed by the processor, the steps of the method for implementing confidential communication provided in the first aspect are implemented or the steps of the method for implementing confidential communication provided in the second aspect are implemented.
[0014] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method for realizing confidential communication provided in the first aspect or the steps of the method for realizing confidential communication provided in the second aspect.
[0015] Other aspects will be apparent upon reading and understanding the drawings and detailed description.
[0016] BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings are used to provide an understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation on the technical solution of the present disclosure.
[0018] Figure 1 A flow chart of a method for implementing confidential communication provided by an embodiment of the present disclosure (sending device);
[0019] Figure 2 A flow chart of a method for implementing confidential communication provided by an embodiment of the present disclosure (receiving device);
[0020] Figure 3 A schematic diagram of a system for implementing confidential communication provided by an embodiment of the present disclosure;
[0021] Figure 4 A flowchart of a confidential communication between a sending device and a receiving device provided in an embodiment of the present disclosure;
[0022] Figure 5 A flowchart of another confidential communication between a sending device and a receiving device provided in an embodiment of the present disclosure;
[0023] Figure 6 A schematic diagram of a device for implementing confidential communication provided in an embodiment of the present disclosure.
[0024] Details
[0025] The present application describes multiple embodiments, but the description is exemplary rather than restrictive, and it is obvious to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present application. Although many possible feature combinations are shown in the drawings and discussed in the embodiments, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with any other feature or element in any other embodiment, or may replace any other feature or element in any other embodiment.
[0026] The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in the present application may also be combined with any conventional features or elements to form a unique invention scheme defined by the claims. Any features or elements of any embodiment may also be combined with features or elements from other invention schemes to form another unique invention scheme defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in the present application may be implemented individually or in any appropriate combination. Therefore, except for the limitations made according to the attached claims and their equivalents, the embodiments are not subject to other restrictions. In addition, various modifications and changes may be made within the scope of protection of the attached claims.
[0027] In addition, when describing representative embodiments, the specification may have presented the method and / or process as a specific sequence of steps. However, to the extent that the method or process does not rely on the specific order of the steps described herein, the method or process should not be limited to the steps of the specific order described. As will be understood by those of ordinary skill in the art, other sequences of steps are also possible. Therefore, the specific sequence of the steps set forth in the specification should not be interpreted as a limitation to the claims. In addition, the claims for the method and / or process should not be limited to the steps of performing them in the order written, and those skilled in the art can easily understand that these sequences can be changed and still remain within the spirit and scope of the embodiments of the present application.
[0028] Figure 1 A flow chart of a method for implementing confidential communication provided by an embodiment of the present disclosure is shown in FIG. Figure 1 As shown, the method for implementing confidential communication may include:
[0029] Step S10, encrypting the first information and the second information of the data packet respectively to generate an encrypted message; wherein the area where the encrypted first information is located is the first encryption area, and the area where the encrypted second information is located is the second encryption area; the first information is used for the receiving device to determine whether to obtain the second information;
[0030] Step S20: sending the encrypted message.
[0031] In this embodiment, the sending device encrypts the data packet in different regions to construct an encrypted message. When the receiving device decrypts, it can determine whether to perform complete decryption by partially decrypting the encrypted message. When complete decryption is required, the security of confidential communication is enhanced through two decryption operations. When complete decryption is not required, power consumption can be saved by reducing decryption operations.
[0032] In an exemplary embodiment, the first information may include any one or more of the following information in any combination: a receiving device identification, a sending device identification, and a message control word;
[0033] In an exemplary embodiment, the message control word may include any one or more of the following in any combination: registration request, registration response, location query, location report, or alarm;
[0034] In an exemplary implementation, the second information includes data information corresponding to the message control word. For example, if the message control word is a location report, the second information may include location information of the sending device. If the message control word is an alarm, the second information may include specific content of the alarm.
[0035] In an exemplary embodiment, encrypting the first information and the second information of the data packet to generate an encrypted message includes: encrypting the first information of the data packet using a hardware encryption method;
[0036] In an exemplary embodiment, encrypting the first information and the second information of the data packet to generate an encrypted information message includes: encrypting the second information of the data packet using a software encryption method;
[0037] In an exemplary embodiment, the first information and the second information may be encrypted in different ways; for example, the first information is encrypted by hardware and the second information is encrypted by software; the first information and the second information are both encrypted by hardware but with different keys; the first information and the second information are both encrypted by software but with different encryption algorithms; the first information and the second information are both encrypted by software, with the same encryption algorithm and different keys;
[0038] Compared with software encryption, hardware encryption is faster and can use DMA (Direct Memory Access) transmission to reduce the CPU computing resources, so that the CPU can handle other tasks during hardware encryption. Compared with hardware encryption, software encryption has the advantage of flexible encryption algorithm design, which can design more complex encryption algorithms and increase the security of encrypted messages.
[0039] The terminal can use a single-chip microcomputer with an AES (Advanced Encryption Standard) hardware accelerator. For example, a single-chip microcomputer with an AES hardware accelerator is an STM32 series. Considering the low power consumption, an STM32L series single-chip microcomputer can be used. When using an STM32L series single-chip microcomputer, only dozens of machine cycles are needed to complete fast AES encryption, and encryption is fast.
[0040] In an exemplary embodiment, the first information may also include: length information of the second encryption area, or position information of the starting byte of the second encryption area of the encrypted message in the encrypted message and length information of the second encryption area; carrying the length information of the second encryption area in the first information can enable the sending device to flexibly control the length of the second information, so that it can send both very long and very short second information.
[0041] The original data packet may include the first information and the second information, or may include: the first information, the second information and other information. Other information is optional, for example, other information may be a check word of the original data packet. Table 1 is an example of an original data packet. As shown in Table 1, the original data packet includes: the first information, the second information and other information, wherein the first information includes: a receiving device identifier, a sending device identifier, a message control word, and the length information of the second encryption area. The second information includes data information corresponding to the message control word. Other information includes a check word, which may be a check of all bytes of the original data packet, or a check of some bytes in the original data packet. The above encryption method is used to encrypt the first information and the second information of the original data packet respectively to generate an encrypted message, and the encrypted message may include a first encryption area, a second encryption area and a non-encrypted area. The area where the encrypted first information is located is the first encryption area, and the area where the encrypted second information is located is the second encryption area. The check word may not be encrypted, and the area where the check word is located is the non-encrypted area.
[0042]
[0043]
[0044] Table 1
[0045] In some other implementations of the original data packet, the first information may not include the length of the second encryption area, the second encryption area adopts a fixed length, or the sending device and the receiving device agree on the length of the second encryption area.
[0046] In an exemplary implementation, sending the encrypted message includes: sending the encrypted message via a broadcast communication mode, or sending the encrypted message to a receiving device via a point-to-point communication mode.
[0047] Figure 2 A flow chart of a method for implementing confidential communication provided by an embodiment of the present disclosure is shown in FIG. Figure 2 As shown, the method for implementing confidential communication may include:
[0048] Step S10, receiving an encrypted message; wherein the encrypted message is generated by encrypting the first information and the second information of the original data packet respectively, the area where the encrypted first information is located is the first encryption area, and the area where the encrypted second information is located is the second encryption area;
[0049] Step S20, decrypting the first encrypted area of the encrypted message, and after successfully decrypting and obtaining the first information, determining whether to obtain the second information according to the first information;
[0050] In this embodiment, when the receiving device receives an encrypted message, it can determine whether to perform complete decryption by partially decrypting the encrypted message. When complete decryption is required, the security of confidential communication is enhanced through two decryption operations. When complete decryption is not required, power consumption can be saved by reducing decryption operations.
[0051] In an exemplary embodiment, the first information may include any one or more of the following information in any combination: a receiving device identification, a sending device identification, and a message control word;
[0052] In an exemplary embodiment, the message control word may include any one or more of the following in any combination: registration request, registration response, location query, location report, or alarm;
[0053] In an exemplary implementation, the second information includes data information corresponding to the message control word. For example, if the message control word is a location report, the second information may include location information of the sending device. If the message control word is an alarm, the second information may include specific content of the alarm.
[0054] In an exemplary embodiment, the receiving of the encrypted message may include: receiving the entire encrypted message; or receiving the first encrypted area of the encrypted message;
[0055] In an exemplary embodiment, before the receiving device receives the first encrypted region of the encrypted message, the method further includes: determining length information of the first encrypted region of the encrypted message; wherein the length of the first encrypted region of the encrypted message is a fixed length or a length agreed upon by the sending device and the receiving device;
[0056] In an exemplary implementation, receiving the encrypted message includes receiving the entire encrypted message, and determining whether to obtain the second information according to the first information includes:
[0057] When it is determined that the encrypted message is a legitimate message based on the first information, the second encrypted area of the received encrypted message is decrypted to obtain the second information; when it is determined that the encrypted message is not a legitimate message based on the first information, the second encrypted area of the encrypted message is not decrypted.
[0058] In an exemplary embodiment, decrypting the first encryption region of the encrypted message includes: performing hardware decryption on the first encryption region of the encrypted message;
[0059] Compared with software decryption, hardware decryption is faster, and hardware decryption can use DMA (Direct Memory Access) transmission mode to reduce the CPU computing resources, so that the CPU can handle other tasks during hardware decryption. Compared with hardware decryption, software decryption has the advantage of flexible decryption algorithm design, and more complex decryption algorithms can be designed to increase the difficulty of decryption.
[0060] The terminal can use a single-chip microcomputer with an AES (Advanced Encryption Standard) hardware accelerator. For example, a single-chip microcomputer with an AES hardware accelerator is an STM32 series. Considering the low power consumption, an STM32L series single-chip microcomputer can be used. When using an STM32L series single-chip microcomputer, only dozens of machine cycles are needed to complete fast AES decryption, and the decryption is fast.
[0061] In an exemplary implementation, performing hardware decryption on the first encryption area of the encrypted message includes: performing hardware decryption on the first encryption area of the encrypted message by using a single-chip microcomputer including an Advanced Encryption Standard (AES) hardware accelerator.
[0062] In an exemplary embodiment, while decrypting the first encrypted area of the encrypted message, the method further includes: continuing to receive the remaining portion of the encrypted message except the first encrypted area; wherein, if the first encrypted area of the encrypted message is decrypted by hardware, the CPU can continue to receive the remaining portion of the encrypted message during hardware decryption. If the first encrypted area of the encrypted message is decrypted by software, the CPU can use a multi-threaded method to use one thread to receive data and another thread to decrypt data.
[0063] In an exemplary implementation, receiving the encrypted message includes receiving a first encrypted area of the encrypted message, and determining whether to obtain the second information according to the first information includes:
[0064] When it is determined that the encrypted message is a legitimate message according to the first information, determining whether the second encrypted area of the encrypted message has been completely received, and if so, decrypting the second encrypted area of the encrypted message to obtain the second information; if not, continuing to receive the second encrypted area of the encrypted message, and decrypting the second encrypted area of the encrypted message to obtain the second information;
[0065] When it is determined that the encrypted message is not a legal message based on the first information, it is determined whether the second encrypted area of the encrypted message has been received. If it has been received, the second encrypted area of the encrypted message is not decrypted; if it has not been received, the encrypted message is not received any more.
[0066] In an exemplary implementation, receiving the encrypted message includes receiving a first encrypted area of the encrypted message, and determining whether to obtain the second information according to the first information includes:
[0067] When it is determined that the encrypted message is a legitimate message according to the first information, receiving the remaining part of the encrypted message except the first encrypted area, and decrypting the second encrypted area of the encrypted message to obtain the second information;
[0068] When it is determined according to the first information that the encrypted message is not a legitimate message, the remaining part of the encrypted message except the first encryption area is not received.
[0069] In an exemplary implementation, if the encrypted message includes an unencrypted check word, after obtaining the second information, the method further includes: extracting the check word from the encrypted message, and verifying the obtained second information according to the check word.
[0070] In an exemplary implementation, decrypting the second encryption area of the encrypted message includes: decrypting the second encryption area of the encrypted message by software decryption.
[0071] In an exemplary embodiment, before decrypting the second encrypted area of the encrypted message, the method further includes:
[0072] Determine the length information of the second encryption area of the encrypted message; wherein the length of the second encryption area of the encrypted message is a fixed length, or a length agreed upon by the sending device and the receiving device, or the first information includes the length information of the second encryption area.
[0073] In an exemplary embodiment, a legitimate message may include any one or more of the following in any combination: a message in which the receiving device identifier in the first information matches the device identifier, a message in which the sending device identifier in the first information matches the identifier of any secure communication peer of the device, and an alarm message. An example of a secure communication peer is: a terminal bound to a gateway during registration is the secure communication peer of the gateway, and a gateway bound to a terminal during registration is the secure communication peer of the terminal. Among them, emergency alarm messages are not subject to the matching restriction of the sending device identifier and the receiving device identifier due to their high urgency.
[0074] Figure 3 An exemplary diagram of a system for implementing confidential communications provided in accordance with an embodiment of the present disclosure.
[0075] like Figure 3 As shown, the system for implementing confidential communication may include: at least one terminal (eg, terminals 1a, 1b, and 1c), at least one gateway (eg, gateways 2a and 2b), and a server (eg, server 3).
[0076] The terminal can communicate with the gateway using wireless communication technology or other communication technology. The gateway can communicate with the server using wireless communication technology or other communication technology. The server is used to send instructions to the terminal through the gateway and analyze the data uploaded by the terminal forwarded by the gateway. Wireless communication technology may include: Bluetooth, ZigBee, Near Field Communication Technology (NFC), or Wifi, etc. The gateway can send data packets to the terminal in a broadcasting manner or a point-to-point manner, and the terminal can also send data packets to the gateway in a broadcasting manner or a point-to-point manner.
[0077] The system for implementing confidential communication can be a logistics system, which uses a positioning tracker as a terminal. The tracker can be set on a package or carried by logistics personnel. When a terminal joins a wireless network, it binds to the corresponding gateway. The gateway maintains a device list, which records the identifier of each terminal bound to the gateway. After the terminal moves, the bound gateway can be changed according to the strength of the wireless signal. In a large logistics warehouse, there are many terminals, and multiple gateways are arranged in different areas. By adopting the confidential communication method of the above-mentioned terminal and gateway, the gateway will only perform a complete decryption operation when it determines that decryption needs to continue after partial decryption (decrypting the first encrypted area). Therefore, it can save the power consumption of the gateway and improve the data forwarding efficiency of the gateway. The system for implementing confidential communication can also be a positioning and tracking system for shared bicycles, or an access control system in a smart building.
[0078] like Figure 4 As shown, the confidential communication between the sending device and the receiving device may include the following steps S101 to S107:
[0079] Step S101, the sending device encrypts the first information and the second information of the data packet respectively to generate an encrypted message; the area where the encrypted first information is located is the first encryption area, and the area where the encrypted second information is located is the second encryption area; the first information is used for the receiving device to determine whether to obtain the second information;
[0080] The first information includes: a receiving device identifier, a sending device identifier, and a message control word;
[0081] Step S102, the sending device sends the encrypted message;
[0082] Step S103, the receiving device receives the encrypted message;
[0083] Step S104, the receiving device decrypts the first encrypted area of the encrypted message to obtain first information;
[0084] Step S105, the receiving device determines whether the encrypted message is a legitimate message according to the first information, and if so, executes step S106, otherwise, executes step S107;
[0085] Among them, legal messages may include any one or more of the following in any combination: a message in which the receiving device identifier in the first information matches the identifier of the current device, a message in which the sending device identifier in the first information matches the identifier of any secure communication peer of the current device, and an alarm message.
[0086] Step S106, the receiving device decrypts the second encrypted area of the encrypted message to obtain the second information, and ends;
[0087] Step S107: The receiving device does not decrypt the second encrypted area of the encrypted message, and the process ends.
[0088] In this embodiment, the sending device encrypts the data packet in different areas. When the receiving device decrypts the data packet, it can determine whether the data packet needs to be completely decrypted by partially decrypting the encrypted data packet. When complete decryption is required, the security of confidential communication is enhanced through two decryption operations. When complete decryption is not required, the second decryption operation is omitted, which can save power consumption.
[0089] like Figure 5 As shown, when the sending device sends an encrypted message, the first encryption area is sent before the second encryption area, and when the receiving device receives the encrypted message, the first encryption area of the encrypted message is received first. The confidential communication between the sending device and the receiving device may include the following steps S101-S107:
[0090] Step S101, the sending device encrypts the first information and the second information of the data packet respectively to generate an encrypted message; the area where the encrypted first information is located is the first encryption area, and the area where the encrypted second information is located is the second encryption area; the first information is used for the receiving device to determine whether to obtain the second information;
[0091] The first information includes: a receiving device identifier, a sending device identifier, and a message control word;
[0092] Step S102, the sending device sends the encrypted message, and the first encryption area is sent before the second encryption area;
[0093] Step S103, the receiving device receives the first encryption area of the encrypted message;
[0094] Step S104, the receiving device decrypts the first encrypted area of the encrypted message to obtain the first information, and continues to receive the remaining part of the encrypted message while decrypting;
[0095] If the first encrypted area of the encrypted message is decrypted by hardware, the CPU can continue to receive the remaining part of the encrypted message during the hardware decryption. If the first encrypted area of the encrypted message is decrypted by software, the CPU can use a multi-threaded method to use one thread to receive data and another thread to decrypt data.
[0096] Step S105, the receiving device determines whether the encrypted message is a legitimate message according to the first information, and if so, executes step S106, otherwise, executes step S108;
[0097] Among them, legal messages may include any one or more of the following in any combination: a message in which the receiving device identifier in the first information matches the identifier of the current device, a message in which the sending device identifier in the first information matches the identifier of any secure communication peer of the current device, and an alarm message.
[0098] Step S106, the receiving device determines whether the encrypted message has been completely received, if yes, executes step S107, otherwise returns to step S106;
[0099] Step S107, the receiving device decrypts the second encrypted area of the encrypted message to obtain the second information, and ends;
[0100] Step S108, the receiving device determines whether the encrypted message has been completely received, if yes, executes step S109, otherwise, executes step S110;
[0101] Step S109: the receiving device does not decrypt the second encrypted area of the encrypted message, and the process ends;
[0102] Step S110: The receiving device stops receiving the encrypted message, and the process ends.
[0103] In this embodiment, the sending device encrypts the data packet in different areas. When sending an encrypted message, the first encryption area is sent before the second encryption area. When the receiving device receives the encrypted message, it first receives the first encryption area of the encrypted message, and obtains the first information through hardware decryption. When it is determined that complete decryption is required based on the first information, the security of confidential communication is enhanced by continuing to receive the remaining part of the encrypted message and performing two decryption operations. When it is determined that complete decryption is not required based on the first information, power consumption is saved by no longer continuing to receive the remaining part of the encrypted message and / or no longer decrypting the second encryption area.
[0104] The embodiment of the present disclosure provides a device for implementing confidential communication, including: a communication module, a memory and a processor, wherein the communication module is connected to the processor, the memory stores a computer program, and the computer program, when executed by the processor, implements the steps of the method for implementing confidential communication. In an exemplary embodiment, the device for implementing confidential communication is a terminal or a gateway.
[0105] Figure 6 This is an example diagram of a device for implementing confidential communication provided by an embodiment of the present disclosure. Figure 6As shown, this exemplary embodiment provides a device for implementing confidential communication, comprising: a processor 100, a memory 200, a bus system 300 and a communication module 400; wherein the processor 100, the memory 200 and the communication module 400 are connected via the bus system 300, the memory 200 stores a computer program, and when the computer program is executed by the processor, the steps of the above-mentioned method for implementing confidential communication are implemented.
[0106] The communication module may communicate with the peer device using wireless communication technology or other communication technology. In this embodiment, the wireless communication technology may include: Bluetooth, ZigBee, Near Field Communication (NFC), or Wifi, etc. The communication module may communicate with the peer device in a broadcasting manner or a point-to-point manner.
[0107] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0108] The memory may include a read-only memory and a random access memory, and provides instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0109] In addition to the data bus, the bus system can also include a power bus, a control bus, and a status signal bus. Figure 6 In the specification, various buses are labeled as bus systems.
[0110] In the implementation process, the processing performed by the device for implementing confidential communication can be completed by the hardware integrated logic circuit in the processor or the instructions in the form of software. That is, the steps of the method in the embodiment of the present disclosure can be embodied as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, the specific content of the method will not be described in detail here.
[0111] An embodiment of the present disclosure provides a computer-readable storage medium storing a computer program, which implements the steps of the above-mentioned method for realizing confidential communication when executed by a processor.
[0112] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
Claims
1. A method for achieving confidential communication, comprising: Encrypt the first information and the second information of the data packet respectively to generate an encrypted message; wherein the area where the encrypted first information is located is the first encryption area, and the area where the encrypted second information is located is the second encryption area; the first information is used for the receiving device to determine whether to obtain the second information in the following manner: the receiving device decrypts the first encryption area of the encrypted message, and continues to receive the remaining part of the encrypted message while decrypting, and after successfully decrypting and obtaining the first information, when it is determined that the encrypted message is a legal message according to the first information, it is determined whether the second encryption area of the encrypted message has been received, and if it has been received, the second encryption area of the encrypted message is decrypted to obtain the second information; if it has not been received, the second encryption area of the encrypted message is continued to be received, and the second encryption area of the encrypted message is decrypted to obtain the second information; when it is determined that the encrypted message is not a legal message according to the first information, it is determined whether the second encryption area of the encrypted message has been received, and if it has been received, the second encryption area of the encrypted message is not decrypted; if it has not been received, the encrypted message is not continued to be received; The encrypted message is sent, and the first encryption area is sent before the second encryption area.
2. The method of claim 1, wherein: Encrypting the first information and the second information of the data packet respectively to generate an encrypted message includes: encrypting the first information of the data packet in a hardware encryption manner.
3. The method according to claim 1 or 2, wherein: The first information includes any one or more of the following information in any combination: a receiving device identification, a sending device identification, and a message control word; The second information includes data information corresponding to the message control word.
4. The method of claim 2, wherein: The first information and the second information are encrypted using different encryption methods.
5. A method for achieving confidential communication, comprising: A first encryption area receiving an encrypted message; wherein the encrypted message is generated by encrypting the first information and the second information of the original data packet respectively, the area where the encrypted first information is located is the first encryption area, and the area where the encrypted second information is located is the second encryption area; Decrypt the first encryption area of the encrypted message, and continue to receive the remaining part of the encrypted message while decrypting. After successfully decrypting and obtaining the first information, when it is determined that the encrypted message is a legal message based on the first information, determine whether the second encryption area of the encrypted message has been received. If it has been received, decrypt the second encryption area of the encrypted message to obtain the second information; if it has not been received, continue to receive the second encryption area of the encrypted message, and decrypt the second encryption area of the encrypted message to obtain the second information; when it is determined that the encrypted message is not a legal message based on the first information, determine whether the second encryption area of the encrypted message has been received. If it has been received, do not decrypt the second encryption area of the encrypted message; if it has not been received, do not continue to receive the encrypted message.
6. The method of claim 5, wherein: The first information includes any one or more of the following information in any combination: a receiving device identification, a sending device identification, and a message control word; The second information includes data information corresponding to the message control word.
7. The method of claim 5, wherein: Decrypting the first encryption area of the encrypted message includes: performing hardware decryption on the first encryption area of the encrypted message.
8. The method of claim 7, wherein: Performing hardware decryption on the first encryption area of the encrypted message includes: performing hardware decryption on the first encryption area of the encrypted message by using a single chip microcomputer having an Advanced Encryption Standard (AES) hardware accelerator.
9. A device for implementing confidential communication, comprising: A communication module, a memory and a processor, wherein the communication module is connected to the processor, the memory stores a computer program, and when the computer program is executed by the processor, the steps of the method for realizing confidential communication described in any one of claims 1-4 or 5-8 are implemented.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the method for realizing confidential communication described in any one of claims 1 to 4 or 5 to 8.
