PLC data encryption communication method based on chaotic system mobile key
Through the mobile key method based on chaotic system, using the switching chaotic system model and XOR operation, the problem of insufficient security and mismatch of real-time performance in PLC data communication is solved, and high security and low latency data transmission is achieved, which is suitable for different types of PLC systems and complex industrial environments.
Patent Information
- Application Number
- CN202510886236.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2045-06-30
AI Technical Summary
In PLC data communication, encryption algorithms are insufficient in security and mismatch in real-time performance. Traditional static key management methods are difficult to adapt to cross-network data exchange, and dynamic key updates may cause synchronization difficulties and production beats to be lost.
Using a mobile key method based on the chaotic system, a switching chaotic system model is constructed through multiple chaotic systems, a switching strategy is used to generate a key stream, and encrypt and decrypt it through XOR operation. Combined with a random number generator to generate the initial value and the key stream shift number to realize dynamic key management.
It improves the security and real-time nature of the encryption and decryption algorithm, enhances the ability to resist attacks, adapts to communication needs in complex industrial environments, and ensures the stability and security of instant communication.
Smart Images

Figure CN120433941A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of industrial control and information security technology, and specifically relates to a PLC data encryption communication method based on a chaotic system mobile key. Background Art
[0002] With the rapid development of industrial automation technology, programmable logic controllers (PLCs), as the core units of industrial control systems, play a vital role in critical infrastructure such as smart manufacturing and energy distribution. However, these systems face increasingly severe security challenges, particularly communications security. Currently, the contradiction between the openness of communication protocols and real-time requirements is particularly prominent in most PLC systems, making them vulnerable to threats such as man-in-the-middle attacks. Although some encryption schemes exist, such as TLS 1.3 and AES-128, they often perform poorly in industrial environments due to issues such as latency and electromagnetic interference, and cannot meet the requirements of high-speed response.
[0003] The inventors discovered that the existing technology suffers from insufficient encryption algorithm security and inadequate real-time performance during PLC data communication. Specifically, ensuring efficient encryption while maintaining low-latency communication is a critical issue that needs to be addressed. Furthermore, traditional static key management methods struggle to adapt to cross-segment data exchange requirements, while dynamic key updates can lead to synchronization difficulties and production cadence desynchronization. Summary of the Invention
[0004] The present application provides a PLC data encryption communication method based on a chaotic system mobile key to solve one of the above technical problems.
[0005] The technical solutions adopted in this application are: The present invention provides a method for PLC data encryption communication based on a chaotic system mobile key, comprising: A switching chaotic system model is constructed through multiple chaotic systems, and a switching strategy is executed based on the basic judgment model in the switching chaotic system model and the initial value as the switching signal; The initial value of the chaotic system obtained by switching the switching strategy is used to generate a key stream and shift the key stream; The shifted key stream is XORed with the plaintext to obtain the encrypted ciphertext data.
[0006] According to one embodiment of the present application, after obtaining the encrypted ciphertext data, the method further includes: By switching the basic decision model in the chaotic system model, the switching strategy is determined according to the size of the key stream; According to the chaotic system obtained by switching the switching strategy, the key stream is shifted to obtain the shifted key stream; The ciphertext data is subjected to a reverse XOR operation using the shifted key stream to obtain the plaintext.
[0007] According to an embodiment of the present application, a key distribution strategy is also included, specifically: An initial value of a chaotic system in a switching chaotic system model is randomly generated by a random number generator as a key; Generate an integer as a key stream by using a random integer generator to shift the number of bits to expand the key; The expanded key is synchronized during power-up, encryption, and decryption.
[0008] According to one embodiment of the present application, the basic decision model in the switching chaotic system model is used to execute the switching strategy according to the initial value as the switching signal, specifically: The threshold intervals are divided according to the numerical range of the initial value of the basic judgment model, and each threshold interval corresponds to a chaotic system; By comparing the initial value of the basic judgment model with the threshold interval, the corresponding chaotic system is switched.
[0009] According to one embodiment of the present application, the initial value of the chaotic system obtained by switching the switching strategy generates a key stream, and the key stream is shifted, specifically: Generate chaotic sequences through iteration of initial values of chaotic systems; quantize the chaotic value into a binary key stream; Circularly shifts the key stream left or right using the number of shift bits.
[0010] According to one embodiment of the present application, the switching strategy is determined according to the size of the key stream by switching the basic decision model in the chaotic system model, specifically: The initial value of the basic judgment model in the switching chaotic system model is compared with the threshold interval, and the switching chaotic system model is run to obtain the same chaotic system as that during encryption.
[0011] According to an embodiment of the present application, the chaotic system obtained by switching according to the switching strategy shifts the key stream to obtain a shifted key stream, specifically: The corresponding chaotic sequence is obtained through the same chaotic system as that used in encryption; The chaotic sequence is cyclically shifted using the shifting bit number to obtain the shifted key stream.
[0012] A second embodiment of the present application provides a PLC data encryption communication system based on a chaotic system mobile key, comprising: A switching module is used to construct a switching chaotic system model through multiple chaotic systems, and execute a switching strategy based on the basic judgment model in the switching chaotic system model and the initial value as a switching signal; A shift module is used to generate a key stream based on the initial value of the chaotic system obtained by switching the switching strategy, and shift the key stream; The XOR module is used to perform an XOR operation on the shifted key stream and the plaintext to obtain the encrypted ciphertext data.
[0013] A third aspect of the present application provides a computer-readable storage medium having a program stored thereon, which implements the steps in the method when executed by a processor.
[0014] In a fourth aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor implements the steps in the method described above when executing the program.
[0015] Due to the adoption of the above technical solution, the beneficial effects achieved by this application are as follows: This application utilizes multiple chaotic systems to construct a switching chaotic system model and generates a key stream based on the initial values through a switching strategy. By shifting the key stream, the key length is increased, the key space is expanded, and the security of the encryption and decryption algorithm is improved. Due to the chaotic system's high sensitivity to initial conditions, it is possible to automatically generate a differentiated encryption matrix for each communication, effectively reducing protocol encapsulation delays and ensuring stable operation even in demanding real-time scenarios.
[0016] This application introduces the key stream shift bit number as part of the private key, and combines the random number generator to generate the initial value of the chaotic system and the key stream shift bit number, which simplifies the key distribution process and enhances the system's anti-attack capability.
[0017] This application is not only applicable to different types of PLC systems, but can also be flexibly adjusted to adapt to the communication needs in various complex industrial environments, laying the foundation for the realization of the "control-communication-physical" three-in-one protection system. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 A schematic diagram of a flow chart of a PLC data encryption communication method based on a chaotic system mobile key provided in an embodiment of the present application; Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0019] Reference numerals: 810 , processor; 820 , communication interface; 830 , memory; 840 , communication bus. DETAILED DESCRIPTION
[0020] In order to more clearly illustrate the overall concept of the present application, a detailed description is given below in an illustrative manner in conjunction with the accompanying drawings.
[0021] The following description sets forth many specific details to facilitate a thorough understanding of the present application. However, the present application may also be implemented in other ways than those described herein, and therefore, the scope of protection of the present application is not limited by the specific embodiments disclosed below. It should be noted that the embodiments of the present application and the features of each embodiment may be combined with each other unless there is a conflict.
[0022] In this application, unless otherwise expressly specified and limited, a first feature "above" or "below" a second feature may be that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in an appropriate manner in any one or more embodiments or examples.
[0023] Example 1 like Figure 1 As shown, a PLC data encryption communication method based on a chaotic system mobile key includes: S100: Construct a switching chaotic system model through multiple chaotic systems, and execute a switching strategy based on a basic judgment model in the switching chaotic system model and an initial value as a switching signal.
[0024] As described above, a complex cryptographic framework is created using multiple chaotic systems (such as Lorenz, Chen, and Rossler chaotic systems). This framework leverages the unique properties of each chaotic system to generate a key stream. Based on specific rules or conditions (i.e., a fundamental decision model), the appropriate chaotic system is automatically selected for switching based on the initial input value. This not only increases the size of the key space but also improves the security and unpredictability of the encryption algorithm.
[0025] For example, consider two chaotic systems: the Lorenz and Chen systems. First, a basic decision model is defined, consisting of a series of threshold intervals, each corresponding to a specific chaotic system. If the initial value falls within a specific interval, the corresponding chaotic system is selected to generate the key stream. For example, if the initial value is 0.3, then according to the basic decision model, it is likely to fall into the interval corresponding to the Lorenz system; if the initial value is 0.8, the Chen system will be selected. This approach allows the encryption process to dynamically switch from one chaotic system to another, making it more difficult for an attacker to guess the key stream.
[0026] It should be noted that in specific implementation scenarios, in addition to the Lorenz and Chen chaotic systems mentioned above, other types of chaotic systems (such as the Duffing system) can be introduced to further expand the key space and the diversity of encryption algorithms. Each new chaotic system can adjust the threshold range in the basic judgment model based on its characteristics, making the entire encryption system more complex and secure.
[0027] In specific implementation scenarios, building on the above solution, an adaptive mechanism can be designed to allow the system to automatically adjust its switching strategy based on real-time data traffic, network status, or other environmental factors. For example, in high-risk environments, a more complex chaotic system could be automatically selected, or the current chaotic system could be immediately replaced when abnormal activity is detected, thereby enhancing the system's defense capabilities.
[0028] In specific implementation scenarios, in addition to the basic key stream shift operation, based on the above scheme, multi-level key management strategies can also be implemented, including but not limited to time-synchronized key updates, event-triggered key resets, etc., to ensure that communication security can be maintained even in extreme situations.
[0029] In specific implementation scenarios, the above solution can also be used. Although this solution is optimized primarily for PLC data communication, its core concept is also applicable to other data transmission scenarios requiring high security, such as communication between IoT devices and financial transaction systems. By appropriately adjusting the basic judgment model and switching strategy, the security requirements of different application scenarios can be met.
[0030] S200 , generating a key stream by switching the initial value of the chaotic system obtained by the switching strategy, and shifting the key stream.
[0031] As described above, a selected chaotic system (determined by the switching strategy) and its initial conditions are used to generate a continuous key stream. This key stream is essentially a conversion of the pseudo-random number sequence generated by the chaotic system. To enhance the security of the encryption algorithm, a shift operation is further performed on the generated key stream. This operation involves shifting the bit positions within the key stream to create a new key stream. This shift can be a cyclic left or right shift, and the amount of shift can be adjusted dynamically as needed.
[0032] For example, let's choose the Chen chaotic system as the chaotic system currently in use, with initial values of (0.1, 0.2, 0.3). Based on this initial value, the Chen chaotic system will generate a series of chaotic values. These values are then quantized into binary format to form the original key stream. Next, this key stream is circularly shifted left or right according to a preset shift rule (for example, determined by the integer portion of the private key). If the specified shift number is 5, the first 5 bits of each byte of the key stream are extracted and shifted to the end (for left shift), or vice versa (for right shift). This processed key stream not only retains the original chaotic properties but also adds an additional layer of security.
[0033] It should be noted that in specific implementation scenarios, in addition to simple cyclic shifts, more complex shifting logic, such as segmented shifts and cross shifts, can be introduced based on the above scheme. This will further diversify the keystream transformation methods, making it more difficult for attackers to predict the keystream. For example, in segmented shifts, the keystream is divided into multiple segments, and a different shift amount is applied to each segment.
[0034] In specific implementation scenarios, the above solution can also be used to dynamically adjust the keystream shift based on real-time conditions. For example, the shift number can be automatically adjusted based on the size and type of communication data or changes in the external environment (such as temperature and humidity). This approach can effectively counter specific types of attacks and adapt to the needs of different application scenarios.
[0035] S300 , performing an XOR operation on the shifted key stream and the plaintext to obtain encrypted ciphertext data.
[0036] As described above, the original plaintext is encrypted using the previously generated and shifted keystream. Specifically, the exclusive OR (XOR) operation is a basic binary operation that results in a 0 when two corresponding bits are the same and a 1 when they are different. During this process, each plaintext character (represented in binary form) is XORed with the corresponding bit in the keystream to generate the corresponding ciphertext character. The advantage of this is that, as long as the keystream is sufficiently random and confidential, even if an attacker obtains the ciphertext, it is difficult to infer the original information from it.
[0037] For example, consider the plaintext "HELLO," whose ASCII codes are 72, 69, 76, 76, and 79 (corresponding to each letter). Also, assume the shifted keystream is 10101010, 11110000, 00001111, 11001100, and 00110011 (each byte represents a portion of the keystream). Perform the XOR operation on each pair of plaintext and keystream bits: H (72) XOR 10101010 = new value E (69) XOR 11110000 = new value L (76) XOR 00001111 = new value L (76) XOR 11001100 = new value O (79) XOR 00110011 = new value The encrypted ciphertext data can be obtained. When decrypting, just use the same key stream to perform the XOR operation again to restore the original plaintext.
[0038] It should be noted that in specific implementation scenarios, the above scheme can be used to further enhance security by performing multiple XOR operations. For example, after the initial XOR operation, the result can be XORed again using another independently generated key stream. This approach increases the difficulty of cracking because the attacker needs to know all the key streams involved in the XOR operation simultaneously to decrypt the information.
[0039] In specific implementation scenarios, it may be necessary to add error detection and correction mechanisms to the above solutions. This can be done by introducing redundant information into the key stream or encrypted data so that errors in transmission can be automatically identified and corrected, ensuring that data reaches the receiving end accurately.
[0040] In some embodiments of the present application, after obtaining the encrypted ciphertext data, the method further includes: By switching the basic decision model in the chaotic system model, the switching strategy is determined according to the size of the key stream; According to the chaotic system obtained by switching the switching strategy, the key stream is shifted to obtain the shifted key stream; The ciphertext data is subjected to a reverse XOR operation using the shifted key stream to obtain the plaintext.
[0041] As mentioned above, at the beginning of the decryption phase, it is necessary to re-determine which chaotic system should be used to generate the keystream for decryption. This step relies on the "base decision model" used in the previous encryption process. This model determines which chaotic system should be used for subsequent operations based on certain characteristics of the keystream (such as size and distribution). For example, if the keystream value falls within a certain range, the corresponding chaotic system is selected as the current decryption system.
[0042] The initial values of the chaotic system are iteratively processed according to the same rules used during encryption to generate the corresponding key stream. Using the previously recorded key stream shift parameters (i.e., the specific shift number applied during encryption), the same type of shift operation (such as a circular left or right shift) is performed on the newly generated key stream. This ensures that the key stream used during decryption is exactly the same as that used during encryption, thereby ensuring that the original plaintext information can be accurately recovered.
[0043] The encrypted data (i.e., ciphertext) is then subjected to a reverse XOR operation using the keystream processed through the above steps. Since the plaintext is converted into ciphertext by XORing it with a specific keystream during encryption, the original plaintext can be recovered during decryption by simply applying the same keystream to the ciphertext. This is because the XOR operation is reflexive: A XOR B XOR B = A. This means that as long as the keystream remains unchanged, a simple XOR operation can be used to convert and restore the text, whether used for encryption or decryption.
[0044] In some embodiments of the present application, a key distribution strategy is also included, specifically: An initial value of a chaotic system in a switching chaotic system model is randomly generated by a random number generator as a key; Generate an integer as a key stream by using a random integer generator to shift the number of bits to expand the key; The expanded key is synchronized during power-up, encryption, and decryption.
[0045] As mentioned above, during the key generation phase, a high-precision random number generator is used to generate multiple sets of random values. These values serve as the initial values for each chaotic system in the switching chaotic system model. Because chaotic systems are extremely sensitive to initial conditions, even slight changes can result in completely different output sequences. Therefore, using high-quality random numbers as initial values can effectively improve the unpredictability and security of the key. These initial values will be securely distributed and stored between the communicating parties as part of the key.
[0046] In addition to the initial value of the chaotic system, an additional variable parameter is introduced: the number of keystream shifts. This parameter, generated by a random integer generator, controls the shifting of subsequently generated keystreams (e.g., circular left or right shifts) before use. This shift, as an independent key parameter, further expands the key space and enhances the complexity and resilience of the encryption system. This parameter, along with the initial value, must be securely transmitted to the recipient to ensure the correct execution of the decryption process.
[0047] To ensure that both communicating parties use the same key parameters during encryption and decryption, key information synchronization must be completed before powering on the device, performing encryption operations, or performing decryption operations. This means that the sender and receiver must generate the keystream using the same initial value and keystream shift number at the same time. This synchronization can be achieved using a pre-shared key or combined with external authentication mechanisms or timestamps for enhanced security. Ensuring that both parties use the same parameters when generating the keystream ensures the correctness and integrity of the communication process.
[0048] In some embodiments of the present application, the basic decision model in the switching chaotic system model is used to execute the switching strategy according to the initial value as the switching signal, specifically: The threshold intervals are divided according to the numerical range of the initial value of the basic judgment model, and each threshold interval corresponds to a chaotic system; By comparing the initial value of the basic judgment model with the threshold interval, the corresponding chaotic system is switched.
[0049] As mentioned above, when constructing a switching chaotic system model, a "basic decision model" is established to judge and control switching behavior. The core function of this model is to determine how to switch between multiple chaotic systems based on the initial input values. To achieve this, the basic decision model pre-sets several numerical ranges, also known as "threshold intervals," each of which corresponds to a specific chaotic system.
[0050] During actual operation, the system inputs the initial value of the currently used chaotic system into the basic judgment model, which then identifies and determines the numerical range of the initial value. For example, if the initial value falls within the first threshold range, chaotic system A is selected; if it falls within the second threshold range, chaotic system B is selected, and so on. This achieves the goal of dynamically selecting different chaotic systems based on the initial value.
[0051] This switching mechanism, based on the range of initial values, introduces a high degree of uncertainty and complexity into the entire encryption process. Since the chaotic system itself is extremely sensitive to the initial value, which in turn determines which chaotic system is used, even a slight change in the initial value can result in a completely different final keystream. This structure not only enhances the security of the encryption system but also strengthens its resistance to attacks and the diversity of the key space.
[0052] By setting a threshold interval that matches the initial value and dynamically selecting the corresponding chaotic system based on it, a flexible, secure and controllable switching strategy is implemented, providing a solid foundation for subsequent key stream generation and data encryption.
[0053] In some embodiments of the present application, the initial value of the chaotic system obtained by switching the switching strategy generates a key stream, and the key stream is shifted, specifically: Generate chaotic sequences through iteration of initial values of chaotic systems; quantize the chaotic value into a binary key stream; Circularly shifts the key stream left or right using the number of shift bits.
[0054] As described above, based on the selected chaotic system and its initial values (determined based on the aforementioned basic judgment model and switching strategy), iterative calculations are initiated to generate a chaotic sequence. Each chaotic system has its own specific mathematical formula or algorithm to describe its behavior, such as the Lorenz system and the Chen system. These systems are characterized by their extreme sensitivity to initial conditions; even minimal changes can lead to significant differences in the generated sequence. Therefore, this characteristic can be exploited by repeatedly iteratively calculating the chaotic system's equations, gradually generating a series of continuous chaotic values starting from the initial values.
[0055] The chaotic values generated in the above steps are converted into a format suitable for encryption, namely a binary key stream. This step involves mapping the chaotic values to integers within a specific range or directly converting them into binary representation. Because the chaotic values are floating-point numbers, they require certain processing, such as rounding or normalization, to ensure that the resulting key stream meets the requirements of the encryption algorithm. This process ensures that the complexity and unpredictability of the original chaotic sequence are preserved and can be effectively applied to data encryption.
[0056] After obtaining the binary keystream, a shift operation is performed on the keystream to enhance key security and increase the potential key space. The "shift number" mentioned here is a pre-set parameter that determines how many positions in the keystream bits need to be shifted left or right. For example, if the specified shift number is 3, this means that each byte in the keystream is shifted left by 3 positions, and bits that exceed the boundary are moved to the beginning; vice versa, a right shift operation moves bits to the end. This shift operation not only increases the complexity of the keystream but also makes it difficult for an attacker to infer the complete keystream structure even if they obtain partial key information.
[0057] In some embodiments of the present application, the switching strategy is determined according to the size of the key stream by switching the basic decision model in the chaotic system model, specifically: The initial value of the basic judgment model in the switching chaotic system model is compared with the threshold interval, and the switching chaotic system model is run to obtain the same chaotic system as that during encryption.
[0058] As mentioned above, during the decryption process, to ensure accurate replication of the chaotic system used during the encryption phase, the corresponding chaotic system must be selected based on the same switching logic as the encryption end. This is achieved using a pre-defined "basic decision model" that includes multiple threshold intervals, each corresponding to a specific chaotic system.
[0059] During the actual decryption operation, the initial value used to generate the keystream is first input into the basic decision model and compared with various preset threshold intervals. For example, if the initial value falls within the first interval, chaotic system A is selected; if it falls within the second interval, chaotic system B is selected, and so on. In this way, the system can accurately identify which chaotic system was used during the encryption phase and run the same chaotic system during the decryption phase, ensuring the consistency of the generated keystream.
[0060] Whether in the encryption or decryption phase, as long as the same initial value is input, the basic judgment model will output the same judgment result, thereby driving the switching chaotic system model to select the same chaotic system. This switching strategy, based on matching the initial value with the threshold range, not only ensures the consistency and repeatability of the encryption and decryption process, but also enhances the security and controllability of the entire system.
[0061] In some embodiments of the present application, the chaotic system obtained by switching according to the switching strategy shifts the key stream to obtain a shifted key stream, specifically: The corresponding chaotic sequence is obtained through the same chaotic system as that used in encryption; The chaotic sequence is cyclically shifted using the shifting bit number to obtain the shifted key stream.
[0062] As mentioned above, during the decryption process, in order to accurately restore the keystream used during encryption, it is necessary to ensure that the same chaotic system as the encryption end is used. The selection of this chaotic system is determined based on the aforementioned switching strategy, that is, the specific chaotic system is selected after judging the initial value through the basic judgment model.
[0063] Once the chaotic system to be used in the decryption phase is determined, it is iterated using the same method and initial conditions as in the encryption phase to generate a corresponding chaotic sequence. This chaotic sequence maintains consistency in structure and numerical distribution with the original chaotic sequence generated by the encryption end, laying the foundation for the subsequent generation of the key stream for decryption.
[0064] After obtaining the chaotic sequence, it needs to be quantized to convert it into a binary key stream that can be used for XOR operations. At this point, a key parameter—the number of shift bits—is also required. This parameter is generated by a random integer generator during the encryption phase and securely synchronized to the decryption end.
[0065] Using this shift bit number, a circular shift is performed on the currently generated keystream. A circular shift involves shifting the entire keystream bit sequence left or right by a specified number of bits, reinserting any bits that exceed the boundary at the other end, thus forming a new keystream arrangement. For example, if the shift bit number is 3, each bit in the keystream is shifted right (or left) by three bits, with any bits that overflow from the first bit being padded to the end.
[0066] The resulting shifted keystream is identical in content and order to the keystream used by the encryptor during encryption. Only with this consistency can the receiver use the keystream to perform a reverse XOR operation on the ciphertext data and accurately restore the original plaintext information.
[0067] A second embodiment of the present application provides a PLC data encryption communication system based on a chaotic system mobile key, comprising: A switching module is used to construct a switching chaotic system model through multiple chaotic systems, and execute a switching strategy based on the basic judgment model in the switching chaotic system model and the initial value as a switching signal; A shift module is used to generate a key stream based on the initial value of the chaotic system obtained by switching the switching strategy, and shift the key stream; The XOR module is used to perform an XOR operation on the shifted key stream and the plaintext to obtain the encrypted ciphertext data.
[0068] The system provided in the second aspect embodiment of the present application can implement the method in any embodiment of the first aspect above, and thus can achieve any technical effect in the above cigarette box image recognition method, which will not be repeated here.
[0069] An embodiment of a third aspect of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of any one of the embodiments of the first aspect when executing the program.
[0070] Figure 2 An example of a physical structure diagram of an electronic device is shown below. Figure 2 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other via the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the method in any embodiment of the first aspect above, the method including: A switching chaotic system model is constructed through multiple chaotic systems, and a switching strategy is executed based on the basic judgment model in the switching chaotic system model and the initial value as the switching signal; The initial value of the chaotic system obtained by switching the switching strategy is used to generate a key stream and shift the key stream; The shifted key stream is XORed with the plaintext to obtain the encrypted ciphertext data.
[0071] Furthermore, the logic instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as standalone products, stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for causing a computer device (such as a personal computer, server, or network device) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memories, random access memories, magnetic disks, or optical disks.
[0072] On the other hand, the present invention further provides a computer program product, comprising a computer program. The computer program may be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the method provided by each of the above methods, including: A switching chaotic system model is constructed through multiple chaotic systems, and a switching strategy is executed based on the basic judgment model in the switching chaotic system model and the initial value as the switching signal; The initial value of the chaotic system obtained by switching the switching strategy is used to generate a key stream and shift the key stream; The shifted key stream is XORed with the plaintext to obtain the encrypted ciphertext data.
[0073] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for cigarette box image recognition provided by the above methods is implemented, and the method includes: A switching chaotic system model is constructed through multiple chaotic systems, and a switching strategy is executed based on the basic judgment model in the switching chaotic system model and the initial value as the switching signal; The initial value of the chaotic system obtained by switching the switching strategy is used to generate a key stream and shift the key stream; The shifted key stream is XORed with the plaintext to obtain the encrypted ciphertext data.
[0074] Example 2 In a smart factory environment, a cloud platform needs to monitor and control the operating status of multiple PLC devices in real time. To ensure data transmission security, the following technical solutions are used to protect the communication data between the PLC and the host computer.
[0075] On the PLC side, a random initial value for the chaotic system (e.g., 0.1, 0.2, 0.3) is generated, and the chaotic system to be used (e.g., the Lorenz system) is determined using the basic decision model. A random integer generator is used to generate an integer as the number of shift bits in the key stream (e.g., 5), which is used as an additional key parameter.
[0076] Using the selected chaotic system, iteratively generate a chaotic sequence starting from the initial value and quantize these values into binary format to form the original key stream. Perform a cyclic left shift of 5 on the generated key stream. Ensure that these key parameters (initial value and shift number) are synchronized between the cloud platform and the PLC. This can be achieved through a pre-shared key or a secure protocol.
[0077] When the cloud platform needs to query the operating status of a terminal device, it sends a query command to the host computer. After receiving the command, the host computer communicates with the IOService process through the NetService process to obtain the status information of the specified device. After obtaining the device status information, the NetService process encrypts it using the generated key stream (i.e., generates ciphertext data through an XOR operation).
[0078] The encrypted status information is transmitted to the cloud platform through the upper-level management device. During the transmission process, any attempt to steal or tamper with the data will become very difficult because the data has been encrypted.
[0079] After receiving the encrypted data packet, the cloud platform uses the pre-synchronized key parameters (initial value and shift bit number) to repeatedly generate the same key stream. This key stream is then used to perform a reverse XOR operation on the received ciphertext data to restore the original plaintext data, which is the working status of the terminal device.
[0080] If the operating status of a terminal device changes, the PLC's IOService process updates the corresponding device status data in shared memory. Upon detecting the change, the NetService process broadcasts a device status message to the host computer. Similarly, NetService encrypts the new device status data and transmits it to the cloud platform via the upper-level management device to ensure data security.
[0081] Example 3 The switching chaotic system model is mainly composed of the Lorenz chaotic system and the Chen chaotic system. First, the Lorenz nonlinear system is a typical chaotic system.
[0082] in, , , is the state of the system, is the output of the system. , , When , the Lorenz system shows chaotic phenomenon. Note that the state of the Lorenz chaotic system The amplitude is Secondly, the state space expression of Chen's nonlinear system is given as follows:
[0083] in, , , is the state of the system, is the output of the system. , , When , the Chen system shows chaotic phenomenon.
[0084] For Lorenz chaotic system and Chen chaotic system, this scheme injects the plaintext to be encrypted into the output equations of the two systems respectively. Please note that this scheme adopts the mobile key method, that is, the mobile key is defined as an integer , in the chaotic system output, move backward The data is then combined with the plaintext in subsequent outputs. The consensus is as follows: Lorenz plaintext injection system : :
[0085] Chen plaintext injection system : :
[0086] Then inject two plaintexts into the system and Composed of switching chaotic system, that is
[0087] in, Is the switching signal, indicating that at time , chaotic system or is activated.
[0088] Switching signal The switching strategy is given as follows: In the encryption module, this scheme considers the Lorenz chaotic system as the basic judgment model, and sets the initial value of the chaotic system. Under these conditions, the encryption end determines the state of the Lorenz chaotic system. ,if ,but ;if ,but The mathematical expression is as follows:
[0089] Note that this encryption scheme can still be extended to multiple chaotic systems for switching. Specifically, consider the Lorenz chaotic system, the Chen chaotic system, and the Rossler chaotic system. However, compared to the previous patented scheme, this scheme requires shifting the key stream. Specifically, the state equation of the Rossler chaotic system is as follows: :
[0090] in, , , is the state of the system, is the output of the system. , , , When , the Rossler system exhibits chaotic phenomena.
[0091] The Lorenz chaotic system is still used as the basic model, but the switching signal The switching strategy needs to be updated as follows: When the state of the Lorenz chaotic system ,but ; When the state of the Lorenz chaotic system ,but ; The state of the Lorenz chaotic system ,but The mathematical expression is as follows:
[0092] Switch the chaos system decryption module The decryption module receives the ciphertext After that, we first need to determine the switching strategy of the chaotic system. Based on the key, run the Lorenz system basic model and judge the key flow. The size of the key is used to determine the switching strategy of the chaotic system. Then, the key stream is shifted. is known, so in the key stream Need to move Finally, the shifted keystream is subtracted from the ciphertext to obtain the measured plaintext. The generalized decryption equation is as follows:
[0093] Key distribution with keystream shifting The chaotic sequence generated by a chaotic system is extremely sensitive to the system's initial value. A slight perturbation of the initial value can drastically change the chaotic sequence generated by the chaotic system. Therefore, the initial value of the chaotic system is usually used as the key for chaotic encryption. Since this scheme uses a switching chaotic system as the key stream generator, the key is selected as:
[0094] At the same time, in order to increase the security of the system, this scheme adopts the method of shifting and expanding the key. The key expansion distribution strategy is: encryption and decryption power-off synchronization random key stream shift bit . Note that in this scheme, the number of bits of the prophet key stream shift The range is [10,20] and is an integer. Of course, this range can be re-restricted according to specific scenarios and applications. Specifically, the key distribution module uses a random number generator to distribute keys to the encryption module and decryption module at the same time. In engineering applications, each time the system is powered on, the random number generator randomly generates three numbers as the system initial values of the encryption and decryption modules, and at the same time, randomly generates an integer in [10,20] as ,Right now This is equivalent to adding one bit to the key, greatly increasing the security of the encryption and decryption algorithm.
[0095] Anything not described in this application can be achieved by adopting or drawing on existing technologies.
[0096] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
[0097] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A PLC data encryption communication method based on chaotic system mobile key, characterized in that: include: A switching chaotic system model is constructed through multiple chaotic systems, and a switching strategy is executed based on the basic judgment model in the switching chaotic system model and the initial value as the switching signal; The initial value of the chaotic system obtained by switching the switching strategy is used to generate a key stream and shift the key stream; The shifted key stream is XORed with the plaintext to obtain the encrypted ciphertext data.
2. The method according to claim 1, characterized in that After obtaining the encrypted ciphertext data, it also includes: By switching the basic decision model in the chaotic system model, the switching strategy is determined according to the size of the key stream; According to the chaotic system obtained by switching the switching strategy, the key stream is shifted to obtain the shifted key stream; The ciphertext data is subjected to a reverse XOR operation using the shifted key stream to obtain the plaintext.
3. The method according to claim 1, characterized in that It also includes key distribution strategies, specifically: An initial value of a chaotic system in a switching chaotic system model is randomly generated by a random number generator as a key; Generate an integer as a key stream by using a random integer generator to shift the number of bits to expand the key; The expanded key is synchronized during power-up, encryption, and decryption.
4. The method according to claim 1, wherein The basic judgment model in the switching chaotic system model is used to execute the switching strategy according to the initial value as the switching signal, specifically: The threshold intervals are divided according to the numerical range of the initial value of the basic judgment model, and each threshold interval corresponds to a chaotic system; By comparing the initial value of the basic judgment model with the threshold interval, the corresponding chaotic system is switched.
5. The method according to claim 1, wherein The initial value of the chaotic system obtained by switching the switching strategy is used to generate a key stream, and the key stream is shifted, specifically: Generate chaotic sequences through iteration of initial values of chaotic systems; quantize the chaotic value into a binary key stream; Circularly shifts the key stream left or right using the number of shift bits.
6. The method according to claim 2, characterized in that The switching strategy is determined according to the size of the key stream by switching the basic decision model in the chaotic system model, specifically: The initial value of the basic judgment model in the switching chaotic system model is compared with the threshold interval, and the switching chaotic system model is run to obtain the same chaotic system as that during encryption.
7. The method according to claim 2, characterized in that The chaotic system obtained by switching according to the switching strategy shifts the key stream to obtain the shifted key stream, which is specifically: The corresponding chaotic sequence is obtained through the same chaotic system as that used in encryption; The chaotic sequence is cyclically shifted using the shifting bit number to obtain the shifted key stream.
8. A PLC data encryption communication system based on chaotic system mobile key, characterized in that: include: A switching module is used to construct a switching chaotic system model through multiple chaotic systems, and execute a switching strategy based on the basic judgment model in the switching chaotic system model and the initial value as a switching signal; A shift module is used to generate a key stream based on the initial value of the chaotic system obtained by switching the switching strategy, and shift the key stream; The XOR module is used to perform an XOR operation on the shifted key stream and the plaintext to obtain the encrypted ciphertext data.
9. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, the steps in the method according to any one of claims 1 to 7 are implemented.
10. An electronic device comprising a memory, a processor, and a program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps in the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Chaos encrypting and decrypting method without multiply and divide of chaos function and circuit thereof
CN101232367A
Feedback switching encryption method based on double-chaotic system
CN110012313A
Data stream encryption method and device based on fixed-point heterogeneous chaotic system
CN116318803A
Ciphertext domain reversible information hiding method and system based on chaotic encryption
CN117459205A
QR code encryption and decryption method and system based on chaos theory and AES algorithm
CN119094102A