Encryption communication method and device, equipment, storage medium and product
By determining the number of encryption/decryption attempts based on device information and keys on IoT devices, using a symmetric encryption algorithm to encrypt data multiple times, and combining this with a two-way confirmation mechanism, the problem of low security in plaintext transmission of the MQTT protocol is solved, achieving efficient and secure encrypted communication.
Patent Information
- Application Number
- CN202510555603.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-12-16
AI Technical Summary
The existing IoT device communication protocol MQTT transmits data in plaintext by default, which has low security, and existing encryption schemes are difficult to implement efficient and secure encrypted communication on resource-constrained devices.
By determining the number of encryption/decryption attempts based on device information and keys, the data is encrypted multiple times using a symmetric encryption algorithm, and combined with a two-way confirmation mechanism, a reliable end-to-end communication connection is ensured between the device and the platform server.
It enables efficient and secure encrypted communication on resource-constrained IoT devices, simplifies system management complexity, prevents data leakage, and improves data transmission security.
Smart Images

Figure CN121150985A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication security technology, and in particular to an encrypted communication method, apparatus, device, storage medium and product. Background Technology
[0002] With technological advancements, an increasing number of terminal devices require data transmission via the Internet of Things (IoT). For resource-constrained IoT devices, the lightweight and low-bandwidth MQTT (Message Queuing Telemetry Transport) protocol is typically chosen as the communication protocol. However, MQTT transmits data in plaintext by default, resulting in lower security.
[0003] Existing solutions typically rely on complex encryption algorithms and additional security mechanisms, such as certificate authentication and asymmetric key encryption. While these methods offer high security, they are computationally complex and difficult to implement on resource-constrained IoT devices. Some solutions employ symmetric key encryption, which, although simple, offers lower security and is vulnerable to man-in-the-middle attacks, resulting in inadequate security for data transmission.
[0004] Therefore, there is an urgent need for an encrypted communication method that consumes few resources and has high security. Summary of the Invention
[0005] To address the above technical issues, this application provides an encrypted communication method, apparatus, device, storage medium, and product, applicable to resource-constrained IoT devices, which can effectively improve the security of device communication.
[0006] This application provides an encrypted communication method, including:
[0007] The number of encryption / decryption attempts for the device is determined based on the device information and key.
[0008] Based on the number of encryption / decryption attempts, the key is used to encrypt the data to be transmitted multiple times to obtain first encrypted data, which is used for communication transmission.
[0009] As an improvement to the above scheme, determining the number of encryption / decryption attempts based on the device information and key includes:
[0010] Obtain the device information and key;
[0011] The device information is encrypted using the key to obtain binary ciphertext;
[0012] The number of encryption / decryption operations of the device is calculated based on the binary ciphertext.
[0013] As an improvement to the above scheme, the step of calculating the number of encryption / decryption operations of the device based on the binary ciphertext includes:
[0014] The binary ciphertext is converted to a different number system to obtain the first string;
[0015] Select several characters from the first string and concatenate them to obtain the second string;
[0016] The number of encryption / decryption operations of the device is calculated based on the decimal number corresponding to the second string.
[0017] As an improvement to the above scheme, the encrypted communication method further includes:
[0018] Obtain the second encrypted data sent by the platform server;
[0019] Based on the number of encryption / decryption attempts, the second encrypted data is decrypted multiple times using the key to obtain the information instructions issued by the platform server to the device.
[0020] As an improvement to the above solution, the data to be transmitted includes device verification information and information commands; the encrypted communication method further includes:
[0021] Based on the first encrypted data corresponding to the device verification information, a two-way confirmation is performed with the platform server to establish an information command connection and initiate information command transmission.
[0022] As an improvement to the above solution, the step of establishing an information command connection by performing two-way confirmation with the platform server based on the first encrypted data corresponding to the device verification information includes:
[0023] The first encrypted data corresponding to the device verification information is sent to the platform server so that the platform server can authenticate the device based on the first encrypted data. When the authentication is successful, the platform server sends the second encrypted data, which is obtained by encrypting the platform verification information multiple times, to the device.
[0024] Receive the second encrypted data;
[0025] Based on the encryption / decryption count and the key, the second encrypted data is decrypted to obtain the platform verification information;
[0026] The platform server is authenticated based on the platform verification information. When the authentication is successful, an information command connection is established with the platform server.
[0027] This application also provides an encrypted communication device, including:
[0028] The encryption / decryption count module is used to determine the number of encryption / decryption attempts for the device based on the device information and the key.
[0029] The data encryption module is used to encrypt the data to be transmitted multiple times using the key according to the number of encryption / decryption cycles to obtain first encrypted data, which is used for communication transmission.
[0030] This application also provides a computer device, including a processor and a memory, wherein the memory stores a computer program and the computer program is configured to be executed by the processor, and the processor executes the computer program to implement the encrypted communication method described in any of the above claims.
[0031] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to execute any of the encrypted communication methods described above.
[0032] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the encrypted communication method described in any of the above claims.
[0033] Compared to existing technologies, the beneficial effects of the encrypted communication method, apparatus, device, storage medium, and product provided in this application are as follows: By determining the number of encryption / decryption operations based on the device information and key, and then using the key to encrypt the data to be transmitted multiple times according to the number of encryption / decryption operations, the first encrypted data is obtained for encrypted communication. This is suitable for resource-constrained IoT devices. By associating device information with the number of encryption / decryption operations and performing multiple encryption operations, the security of device communication can be effectively improved. By encrypting device information with the key to obtain binary ciphertext, and then performing multiple conversions and calculations on the binary ciphertext to obtain the number of encryption / decryption operations, the confidentiality effect of encrypted communication is further improved. By performing two-way confirmation between the device and the platform server before communication, a reliable end-to-end communication connection is ensured between the platform server and the device. The device connection process is simple and efficient, simplifying the management complexity of the system. The multiple encryption / decryption mechanism effectively prevents data leakage and improves the security of data transmission. Attached Figure Description
[0034] Figure 1 This is a flowchart illustrating an encrypted communication method provided in an embodiment of this application;
[0035] Figure 2 This is a schematic diagram of a device connection establishment process provided in an embodiment of this application;
[0036] Figure 3This is a schematic diagram of the information instruction transmission process of an encrypted communication method provided in an embodiment of this application;
[0037] Figure 4 This is a schematic diagram of the structure of an encrypted communication device provided in an embodiment of this application;
[0038] Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0039] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0040] Please see Figure 1 , Figure 1 This is a flowchart illustrating an encrypted communication method provided in an embodiment of this application. The encrypted communication method includes:
[0041] S1: Determine the number of encryption / decryption attempts for the device based on the device information and key;
[0042] S2: Based on the number of encryption / decryption attempts, the key is used to encrypt the data to be transmitted multiple times to obtain first encrypted data, which is used for communication transmission.
[0043] Specifically, this application applies to IoT hardware devices, including sensors, actuators, microcontrollers, gateways, etc. These devices can be used to collect information data, execute action control commands, and conduct network communication. The IoT hardware devices communicate with the IoT platform server through an MQTT Broker, i.e., an MQTT proxy server. The MQTT broker server is a core component of the MQTT protocol, primarily responsible for managing message transmission between clients, including message routing, client management, and session management. The IoT platform server is the core of the IoT system, integrating capabilities such as device access, device management, secure data communication, message subscription, message forwarding, and data application.
[0044] Before communicating with the platform server via MQTT, the device encrypts the data to be transmitted multiple times. During data encryption, the device information is first obtained, including but not limited to device ID, device serial number, device model, or device MAC address. Preferably, in this embodiment, the device information used is the device ID, a unique identifier generated and assigned to each IoT hardware device by the IoT platform server. Then, a pre-set key is obtained; this key is a symmetric encryption algorithm key, also generated and assigned to each IoT hardware device by the IoT platform server. The device information and the key are stored simultaneously in the platform database and the hardware device.
[0045] Furthermore, based on device information and the key, the encryption / decryption count k corresponding to the device is calculated according to preset encryption rules. Then, the key is used to encrypt the data to be transmitted k times in iterations. The output of each round of encryption is used as the input for the next round of encryption, finally obtaining the first encrypted data. Different devices have different device IDs, and therefore the number of encryption / decryption counts will also be different. This allows for improved security of encrypted communication using symmetric encryption algorithms while maintaining the simplicity of symmetric encryption.
[0046] The encryption algorithm used in this application is a symmetric encryption algorithm, which is relatively simple, computationally efficient, and resource-efficient, enabling encrypted communication on resource-constrained IoT devices. Specifically, symmetric encryption algorithms include, but are not limited to, AES, DES, 3DES, Blowfish, and ChaCha20. Among these, the AES algorithm has high security, computational efficiency, and standardization, and good hardware support. Therefore, the AES algorithm is preferred for data encryption. It is suitable for 8-bit microcontrollers or ordinary 32-bit microprocessors and can be implemented in dedicated hardware. The hardware implementation can achieve a throughput (the number of encryption / decryption bits per second) in the billions, making it suitable for RFID systems as well.
[0047] It should be noted that when IoT terminal devices have sufficient resources, the encryption algorithm used to encrypt data can be more complex and secure, such as asymmetric encryption or hybrid encryption. In this case, determining the corresponding number of encryption and decryption times based on the device information can further improve the security of encrypted communication.
[0048] As one optional embodiment, determining the number of encryption / decryption attempts based on the device information and key includes:
[0049] Obtain the device information and key;
[0050] The device information is encrypted using the key to obtain binary ciphertext;
[0051] The number of encryption / decryption operations of the device is calculated based on the binary ciphertext.
[0052] Specifically, after obtaining the device information and key, the device information is encrypted once using the key through an encryption algorithm to obtain binary ciphertext; then, the binary ciphertext is converted into an integer of appropriate size through a preset calculation rule to obtain the number of encryption / decryption attempts.
[0053] Optionally, the encryption / decryption count can be calculated from the binary ciphertext. This can be achieved by directly converting the binary ciphertext to a corresponding integer, then performing a modulo operation on that integer to obtain a suitable integer value as the encryption / decryption count. Alternatively, the hash value of the binary ciphertext can be calculated, and then converted to an integer to obtain the encryption / decryption count. Another option is to take the first few bytes of the binary ciphertext, convert them to an integer, and use that as the encryption / decryption count. Finally, the sum of all the bytes in the binary ciphertext can be used to obtain an integer value as the encryption / decryption count.
[0054] As one optional embodiment, calculating the number of encryption / decryption operations of the device based on the binary ciphertext includes:
[0055] The binary ciphertext is converted to a different number system to obtain the first string;
[0056] Select several characters from the first string and concatenate them to obtain the second string;
[0057] The number of encryption / decryption operations of the device is calculated based on the decimal number corresponding to the second string.
[0058] Specifically, the binary ciphertext obtained by encrypting device information using a key is converted into a preset number system, such as octal, decimal, or hexadecimal. In this embodiment, hexadecimal is used as an example. The binary ciphertext is converted into a hexadecimal string, i.e., the first string. Several characters are selected from the first string according to preset rules and concatenated into a new string, i.e., the second string. For example, the first and last characters of the first string can be selected and concatenated into the second string, or the first and last three characters can be selected and concatenated into the second string. The second string is converted into the corresponding decimal number, and then the remainder operation is performed on the decimal number. For example, the decimal number is divided by 4, the remainder is taken, and then 1 is added. Finally, the encryption and decryption count is obtained.
[0059] The embodiments of this application can calculate the unique number of encryption and decryption operations for each IoT hardware device from device information and key. The calculation is simple and highly secure, and can be implemented in IoT devices with limited resources. Furthermore, multiple conversion mechanisms and calculation methods are combined when calculating the number of encryption and decryption operations, which further enhances the security of encrypted communication.
[0060] As one optional embodiment, the encrypted communication method further includes:
[0061] Obtain the second encrypted data sent by the platform server;
[0062] Based on the number of encryption / decryption attempts, the second encrypted data is decrypted multiple times using the key to obtain the information instructions issued by the platform server to the device.
[0063] Specifically, the device and the platform server encrypt data according to the same encryption rules. When the platform server communicates with a device, the platform server first retrieves the corresponding key from the platform database based on the device information. Then, based on the device information and the corresponding key, it calculates the encryption / decryption count. Following this count, it uses the key to encrypt the information to be transmitted multiple times, obtaining the second encrypted data. Finally, the second encrypted data is sent to the corresponding device via MQTT. After receiving the second encrypted data, the device obtains its corresponding encryption / decryption count and key. Based on the count, it uses the key to decrypt the second encrypted data multiple times, with the output of each decryption round serving as the input for the next round. Finally, the decrypted data is obtained. This decrypted data primarily consists of information commands issued by the platform server to the device, used for device control.
[0064] It's important to note that after the device calculates its encryption / decryption count for the first time, it stores the count. This count can be used directly for subsequent data encryption without repeated calculations. Similarly, after the platform server calculates the device's encryption / decryption count for the first time, it stores it in the platform database and establishes a mapping with the corresponding device information. This allows subsequent retrieval of the corresponding encryption / decryption count from the database using the device information. The device and platform server can calculate consistent encryption / decryption counts based on the same device information and key, ensuring the consistency between the data and the data obtained after encryption and decryption. Furthermore, the data remains in encrypted form throughout transmission, effectively enhancing data security.
[0065] As one optional embodiment, the data to be transmitted includes device verification information and information commands; the encrypted communication method further includes:
[0066] Based on the first encrypted data corresponding to the device verification information, a two-way confirmation is performed with the platform server to establish an information command connection and initiate information command transmission.
[0067] Specifically, before the device and the platform server conduct encrypted communication, a connection is established through a two-way confirmation mechanism, which means performing two-way identity authentication between the device and the platform server to ensure that the IoT platform server and the IoT hardware device establish a reliable end-to-end communication connection.
[0068] Please see Figure 2 , Figure 2 This is a schematic diagram of a device connection establishment process provided in an embodiment of this application. First, the IoT hardware device with device ID "deviceId" is powered on and connected to WiFi. This device acts as a client to access the MQTTBroker proxy server and establishes an MQTT connection with the MQTT Broker. Simultaneously, the IoT platform server also acts as a client and establishes an MQTT connection with the MQTT Broker proxy server, thereby enabling MQTT communication with the device. Further, the IoT platform server subscribes to the topic " / topic / toc / #" from the MQTT Broker, indicating that it subscribes to all topic messages sent from the device to the platform server; the IoT hardware device subscribes to the topic " / topic / tod / {deviceId}" from the MQTT Broker, indicating that it subscribes to topic messages sent from the platform server to the device with device ID "deviceId". Specifically, in the IoT hardware device, the encryption / decryption count (count) corresponding to the device is calculated based on the device ID and the corresponding key (deviceKey); in the IoT platform server, the encryption / decryption count for all devices is calculated based on the device ID and the corresponding key (deviceKey) and stored in the platform database.
[0069] Further, the step of establishing an information command connection by performing two-way confirmation with the platform server based on the first encrypted data corresponding to the device verification information includes:
[0070] The first encrypted data corresponding to the device verification information is sent to the platform server so that the platform server can authenticate the device based on the first encrypted data. When the authentication is successful, the platform server sends the second encrypted data, which is obtained by encrypting the platform verification information multiple times, to the device.
[0071] Receive the second encrypted data;
[0072] Based on the encryption / decryption count and the key, the second encrypted data is decrypted to obtain the platform verification information;
[0073] The platform server is authenticated based on the platform verification information. When the authentication is successful, an information command connection is established with the platform server.
[0074] The device verification information and platform verification information can be set according to actual needs.
[0075] Specifically, the device verification information is set to "CONNECT", and the platform verification information is set to "CONNECTED". When an IoT hardware device needs to communicate with the IoT platform server via MQTT, it first publishes a data packet containing a device connection command to the topic " / topic / toc / {deviceId}". The content of the data packet is the ciphertext of "CONNECT" (i.e., device verification information) encrypted multiple times with the key deviceKey using AES (i.e., the first encrypted data), where the number of encryption and decryption times is count. The message also indicates to the platform server that this message is a connection command from the device with deviceId.
[0076] After receiving a data packet with the topic " / topic / toc / {deviceId}", the IoT platform server searches for the corresponding key and encryption / decryption count in the platform database based on the device information deviceId in the topic. It then performs multiple AES decryptions on the data packet based on the key and the number of decryption counts. If the decrypted payload data is "CONNECT", the device authentication is successful, and a feedback data packet is sent to the device. If the decrypted payload data is not "CONNECT", or if the key is incorrect and the data packet decryption fails, the device authentication fails, and the device connection fails.
[0077] When device authentication is successful, the platform server publishes a feedback data packet for device connection establishment to the topic " / topic / tod / {deviceId}". The payload of the feedback data packet is the ciphertext of "CONNECTED" (i.e., platform authentication information) encrypted multiple times with the key deviceKey using AES (i.e., the second encrypted data), where the number of encryption and decryption is count. The server then indicates to the device with deviceId that this message is feedback data from the platform connection establishment process.
[0078] When an IoT hardware device receives a feedback data packet from the topic " / topic / tod / {deviceId}", the device uses the key deviceKey to perform AES decryption multiple times on the feedback data packet, with the number of encryption and decryption attempts being count. If the decrypted payload data is "CONNECTED", the platform authentication is successful, and the device and the platform server complete two-way confirmation and establish an information command connection. If the decrypted payload data is not "CONNECTED", or if the key is incorrect and the data packet decryption fails, authentication fails, the device connection fails, and it cannot transmit data to the platform server.
[0079] Furthermore, after the device establishes an information command connection with the platform server, the device can send the information data it has collected to the platform server, and the platform server can send action control commands to the device. All data transmissions must undergo multiple encryption and decryption processes to achieve secure communication.
[0080] Specifically, please refer to Figure 3 , Figure 3 This is a schematic diagram of the information command transmission process of an encrypted communication method provided in this application embodiment. After the IoT platform server successfully establishes a connection with the IoT hardware device, information command transmission is initiated.
[0081] When a device wants to send collected information to the platform server, it first uses a key to encrypt the collected information (i.e., the information command) multiple times using AES, obtaining an encrypted data packet with the number of encryption / decryption attempts counted. Then, it publishes this data packet to the topic " / topic / toc / {deviceId}", indicating to the platform server that the message is information collected by the device with device ID deviceId. When the IoT platform server receives the data packet with the topic " / topic / toc / {deviceId}", it looks up the key and the corresponding number of encryption / decryption attempts counted based on deviceId, uses the key to decrypt the data packet multiple times using AES, obtains the decrypted collected information, and records the collected information into the platform database.
[0082] When the platform server needs to send an action control command to the device, it first uses a key to encrypt the action control command (i.e., the information command) multiple times using AES, obtaining an encrypted data packet. The number of encryption and decryption times is count. Then, the data packet is published to the topic " / topic / tod / {deviceId}", indicating to the device with device ID deviceId that the message is an action control command issued to it by the platform server. When the device receives the data packet with the topic " / topic / tod / {deviceId}", it uses the key to decrypt the data packet multiple times using AES, obtaining the decrypted action control command, and then executes the relevant action according to the action control command.
[0083] The encrypted communication method and connection mechanism of this application are simple and efficient, suitable for resource-constrained IoT devices. They can avoid the resource consumption caused by complex encryption algorithms, and the connection establishment process between the device and the platform server and the symmetric algorithm do not require additional certificate management and key distribution mechanisms, simplifying the management complexity of the system. Through the two-way confirmation mechanism and the multiple encryption and decryption mechanism, man-in-the-middle attacks and data leakage can be effectively prevented, improving the security of data transmission. Therefore, the embodiments of this application can effectively ensure the security of device communication while reducing device resource consumption. They are applicable to various programming languages and IoT hardware devices, and have high versatility and scalability.
[0084] Accordingly, this application also provides an encrypted communication device capable of implementing all the processes of the encrypted communication method in the above embodiments.
[0085] Please see Figure 4 , Figure 5 This is a schematic diagram of the structure of an encrypted communication device provided in an embodiment of this application. The encrypted communication device includes:
[0086] The encryption / decryption count module 401 is used to determine the encryption / decryption count of the device based on the device information and the key.
[0087] The data encryption module 402 is used to encrypt the data to be transmitted multiple times using the key according to the number of encryption / decryption cycles to obtain first encrypted data, which is used for communication transmission.
[0088] Preferably, the encryption / decryption count module 401 is specifically used for:
[0089] Obtain the device information and key;
[0090] The device information is encrypted using the key to obtain binary ciphertext;
[0091] The number of encryption / decryption operations of the device is calculated based on the binary ciphertext.
[0092] Preferably, calculating the number of encryption / decryption operations of the device based on the binary ciphertext includes:
[0093] The binary ciphertext is converted to a different number system to obtain the first string;
[0094] Select several characters from the first string and concatenate them to obtain the second string;
[0095] The number of encryption / decryption operations of the device is calculated based on the decimal number corresponding to the second string.
[0096] Preferably, the encrypted communication device is further used for:
[0097] Obtain the second encrypted data sent by the platform server;
[0098] Based on the number of encryption / decryption attempts, the second encrypted data is decrypted multiple times using the key to obtain the information instructions issued by the platform server to the device.
[0099] Preferably, the data to be transmitted includes device verification information and information commands; the encrypted communication device is further used for:
[0100] Based on the first encrypted data corresponding to the device verification information, a two-way confirmation is performed with the platform server to establish an information command connection and initiate information command transmission.
[0101] Preferably, the step of establishing an information command connection by performing two-way confirmation with the platform server based on the first encrypted data corresponding to the device verification information includes:
[0102] The first encrypted data corresponding to the device verification information is sent to the platform server so that the platform server can authenticate the device based on the first encrypted data. When the authentication is successful, the platform server sends the second encrypted data, which is obtained by encrypting the platform verification information multiple times, to the device.
[0103] Receive the second encrypted data;
[0104] Based on the encryption / decryption count and the key, the second encrypted data is decrypted to obtain the platform verification information;
[0105] The platform server is authenticated based on the platform verification information. When the authentication is successful, an information command connection is established with the platform server.
[0106] In specific implementation, the working principle, control process and technical effects of the encrypted communication device provided in this application are the same as those of the encrypted communication method in the above embodiments, and will not be repeated here.
[0107] See Figure 5 , Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device includes: a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor 501. When the processor 501 executes the computer program, it implements the steps in the above-described encrypted communication method embodiments. Alternatively, when the processor 501 executes the computer program, it implements the functions of each module / unit in the above-described device embodiments.
[0108] For example, the computer program may be divided into one or more modules / units, which are stored in the memory 502 and executed by the processor 501 to complete this application. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the computer device.
[0109] The computer device may include, but is not limited to, a processor 501 and a memory 502. Those skilled in the art will understand that the schematic diagram is merely an example of a computer device and does not constitute a limitation on the computer device. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, the computer device may also include input / output devices, network access devices, buses, etc.
[0110] The processor 501 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor 501 is the control center of the computer device, connecting various parts of the entire computer device through various interfaces and lines.
[0111] The memory 502 can be used to store the computer programs and / or modules. The processor 501 implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory 502 and calling the data stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc.; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory 502 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0112] Wherein, if the modules / units integrated into the computer device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by the processor 501, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms.
[0113] This application also provides a computer-readable storage medium, which includes a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to execute the encrypted communication method described in any of the above embodiments.
[0114] This application also provides a computer program product, including a computer program / instruction, which, when executed by the computer program / instruction processor, implements the encrypted communication method described in any of the above embodiments.
[0115] The methods in this application can be implemented, in whole or in part, by software, hardware, firmware, or any combination thereof. When implemented in software, they can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed on a computer, the processes or functions described in this application are performed, in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, network equipment, user equipment, core network equipment, OAM, or other programmable devices.
[0116] The computer program or instructions may be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, the computer program or instructions may be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access, or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; or an optical medium, such as a digital video optical disc; or a semiconductor medium, such as a solid-state drive. The computer-readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.
[0117] The computer programs / instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper cables, fiber optic cables, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer-readable program instructions from the network and forwards those instructions to computer-readable storage media within the respective computing / processing device.
[0118] The computer program instructions used to perform the operations of this application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuits, such as programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), are personalized by utilizing state information from the computer-readable program instructions. These electronic circuits can execute the computer-readable program instructions to implement various aspects of this application.
[0119] Various aspects of this application are described herein with reference to flowchart illustrations and / or block diagrams according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0120] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0121] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0122] Each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the figures. For example, two consecutive blocks may actually be executed substantially in parallel, or they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation in hardware, implementation in software, and implementation using a combination of software and hardware are equivalent.
[0123] This application provides an encrypted communication method, apparatus, device, storage medium, and product. Its advantages include: determining the number of encryption / decryption attempts based on the device information and key; then, using the key to encrypt the data to be transmitted multiple times based on the number of encryption / decryption attempts to obtain the first encrypted data for encrypted communication. This is suitable for resource-constrained IoT devices. By associating device information with the number of encryption / decryption attempts and performing multiple encryptions, the security of device communication can be effectively improved. Encrypting device information with the key to obtain binary ciphertext, and then performing multiple conversions and calculations on the binary ciphertext to obtain the number of encryption / decryption attempts, further enhances the confidentiality of encrypted communication. By performing bidirectional confirmation between the device and the platform server before communication, a reliable end-to-end communication connection is ensured between the platform server and the device. Furthermore, the device connection process is simple and efficient, simplifying system management complexity. The use of multiple encryption / decryption mechanisms effectively prevents data leakage and improves data transmission security.
[0124] The above description is the preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications are also considered to be within the scope of protection of this application.
Claims
1. An encrypted communication method, characterized in that, include: The number of encryption / decryption attempts for the device is determined based on the device information and key. Based on the number of encryption / decryption attempts, the key is used to encrypt the data to be transmitted multiple times to obtain first encrypted data, which is used for communication transmission.
2. The encrypted communication method as described in claim 1, characterized in that, The step of determining the number of encryption / decryption attempts for the device based on the device information and key includes: Obtain the device information and key; The device information is encrypted using the key to obtain binary ciphertext; The number of encryption / decryption operations of the device is calculated based on the binary ciphertext.
3. The encrypted communication method as described in claim 2, characterized in that, The step of calculating the number of encryption / decryption operations of the device based on the binary ciphertext includes: The binary ciphertext is converted to a different number system to obtain the first string; Select several characters from the first string and concatenate them to obtain the second string; The number of encryption / decryption operations of the device is calculated based on the decimal number corresponding to the second string.
4. The encrypted communication method as described in claim 1, characterized in that, The encrypted communication method further includes: Obtain the second encrypted data sent by the platform server; Based on the number of encryption / decryption attempts, the second encrypted data is decrypted multiple times using the key to obtain the information instructions issued by the platform server to the device.
5. The encrypted communication method as described in claim 1, characterized in that, The data to be transmitted includes device verification information and information commands; the encrypted communication method further includes: Based on the first encrypted data corresponding to the device verification information, a two-way confirmation is performed with the platform server to establish an information command connection and initiate information command transmission.
6. The encrypted communication method as described in claim 5, characterized in that, The step of establishing an information command connection by performing two-way confirmation with the platform server based on the first encrypted data corresponding to the device verification information includes: The first encrypted data corresponding to the device verification information is sent to the platform server so that the platform server can authenticate the device based on the first encrypted data. When the authentication is successful, the platform server sends the second encrypted data, which is obtained by encrypting the platform verification information multiple times, to the device. Receive the second encrypted data; Based on the encryption / decryption count and the key, the second encrypted data is decrypted to obtain the platform verification information; The platform server is authenticated based on the platform verification information. When the authentication is successful, an information command connection is established with the platform server.
7. An encrypted communication device, characterized in that, include: The encryption / decryption count module is used to determine the number of encryption / decryption attempts for the device based on the device information and the key. The data encryption module is used to encrypt the data to be transmitted multiple times using the key according to the number of encryption / decryption cycles to obtain first encrypted data, which is used for communication transmission.
8. A computer device, characterized in that, The device includes a processor and a memory, wherein the memory stores a computer program and the computer program is configured to be executed by the processor, wherein the processor, when executing the computer program, implements the encrypted communication method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the device containing the computer-readable storage medium executes the computer program, it implements the encrypted communication method as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the encrypted communication method as described in any one of claims 1 to 6.