A method for PLC data encryption communication based on chaotic system mobile key

By using a mobile key method based on chaotic systems, a switching chaotic system model is constructed and a key stream is generated, which solves the problems of insufficient security and real-time performance of encryption algorithms in PLC data communication and realizes efficient and secure data transmission.

CN120433941BActive Publication Date: 2025-10-17INSPUR GENERSOFT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510886236.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2025-10-17
Estimated Expiration
2045-06-30

AI Technical Summary

Technical Problem

The encryption algorithm in the PLC data communication process is not secure enough and its real-time performance does not match. The traditional static key management method is difficult to adapt to cross-segment data exchange. Dynamic key updates cause synchronization difficulties and production rhythm out of sync.

Method used

A mobile key method based on chaotic system is adopted. A switching chaotic system model is constructed through multiple chaotic systems. The switching strategy is executed using the initial value to generate the key stream, and encryption and decryption are performed through XOR operation. The mobile bit number of the key stream is generated in combination with a random number generator to expand the key.

Benefits of technology

It improves the security and real-time performance of encryption and decryption algorithms, enhances anti-attack capabilities, adapts to communication needs in complex industrial environments, and ensures the stable operation and data security of the PLC system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120433941B_ABST
    Figure CN120433941B_ABST
Patent Text Reader

Abstract

The application provides a PLC data encryption communication method based on a chaotic system mobile key, relates to the technical field of industrial control and information security, and comprises the following steps: a switching chaotic system model is constructed through a plurality of chaotic systems, a switching strategy is executed according to an initial value as a switching signal based on a basic judgment model in the switching chaotic system model; the initial value of the chaotic system obtained through the switching strategy is used to generate a key stream, the key stream is shifted, and the shifted key stream and plaintext are subjected to XOR operation to obtain encrypted ciphertext data. The key length is increased and the key space is expanded by shifting the key stream, so that the security of the encryption and decryption algorithm is improved. Due to the high sensitivity of the chaotic system to the initial condition, it is possible to automatically generate a differentiated encryption matrix each time of communication, protocol packaging delay is effectively reduced, and stable operation can be ensured even in a high real-time requirement scene.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of industrial control and information security, and particularly relates to a PLC data encryption communication method based on a chaotic system mobile key. BACKGROUND

[0002] With the rapid development of industrial automation technology, programmable logic controllers (PLCs) as the core units of industrial control systems play a crucial role in intelligent manufacturing, energy transmission and other critical infrastructures. However, these systems face increasingly serious security challenges, especially communication security issues. Currently, the contradiction between the openness and real-time requirements of most PLC system communication protocols is particularly prominent, making them vulnerable to threats such as man-in-the-middle attacks. Although there are some encryption schemes such as TLS 1.3 and AES-128, they often perform poorly in industrial environments due to issues such as latency or electromagnetic interference, failing to meet the requirements of high-speed response.

[0003] The inventors found that the deficiencies in the prior art are the lack of security of encryption algorithms and the mismatch of real-time performance in the PLC data communication process. Specifically, how to maintain low-latency communication while ensuring efficient encryption is a key problem that needs to be solved. In addition, traditional static key management methods are difficult to adapt to cross-segment data exchange requirements, while dynamic key updates may cause synchronization difficulties and production rhythm out of step. SUMMARY

[0004] The 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 solution adopted by the application is:

[0006] The application provides a PLC data encryption communication method based on a chaotic system mobile key, comprising:

[0007] A switching chaotic system model is constructed by multiple chaotic systems, and a switching strategy is executed according to the initial value as a switching signal based on the basic decision model in the switching chaotic system model;

[0008] 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.

[0009] The shifted key stream and the plaintext are subjected to XOR operation to obtain encrypted ciphertext data.

[0010] According to one embodiment of the application, after obtaining the encrypted ciphertext data, it further comprises:

[0011] The initial value of the switched chaotic system is obtained by switching the basic decision model in the switched chaotic system model, and the size of the key stream is used to determine the switching strategy.

[0012] The chaotic system obtained by switching according to the switching strategy is used to shift the key stream to obtain a shifted key stream.

[0013] The ciphertext data is subjected to inverse XOR operation by the shifted key stream to obtain plaintext.

[0014] According to an embodiment of the present application, the key distribution strategy includes:

[0015] The initial value of the chaotic system in the switched chaotic system model is randomly generated by a random number generator as a key;

[0016] An integer is generated by a random integer generator as a key stream shift number to expand the key.

[0017] The expanded key is synchronized during power-on, encryption and decryption.

[0018] According to an embodiment of the present application, the initial value is used as a switching signal to execute the switching strategy based on the basic decision model in the switched chaotic system model.

[0019] The initial value of the basic decision model is divided into threshold intervals according to the numerical range of the initial value, and each threshold interval corresponds to a chaotic system.

[0020] The initial value of the basic decision model is compared with the threshold interval to switch to the corresponding chaotic system.

[0021] According to an embodiment of the present application, the initial value of the chaotic system obtained by switching according to the switching strategy is used to generate a key stream, and the key stream is shifted.

[0022] The initial value of the chaotic system is iterated to generate a chaotic sequence.

[0023] The chaotic value is quantized into a binary key stream.

[0024] The key stream is cyclically left or right shifted by the shift number.

[0025] According to an embodiment of the present application, the initial value of the basic decision model in the switched chaotic system model is compared with the threshold interval, and the switched chaotic system model is run to obtain the same chaotic system as during encryption.

[0026] The initial value of the basic decision model in the switched chaotic system model is compared with the threshold interval, and the switched chaotic system model is run to obtain the same chaotic system as during encryption.

[0027] 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:

[0028] The corresponding chaotic sequence is obtained through the same chaotic system as that used in encryption;

[0029] The chaotic sequence is cyclically shifted using the shifting bit number to obtain the shifted key stream.

[0030] A second embodiment of the present application provides a PLC data encryption communication system based on a chaotic system mobile key, comprising:

[0031] 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;

[0032] 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;

[0033] The XOR module is used to perform an XOR operation on the shifted key stream and the plaintext to obtain the encrypted ciphertext data.

[0034] 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 described above when the program is executed by a processor.

[0035] 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.

[0036] Due to the adoption of the above technical solution, the beneficial effects achieved by this application are as follows:

[0037] 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.

[0038] 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.

[0039] The application is not only applicable to different types of PLC systems, but also can be flexibly adjusted to adapt to communication requirements in various complex industrial environments, and lays a foundation for realizing a "control-communication-physical" three-in-one protection system. BRIEF DESCRIPTION OF DRAWINGS

[0040] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:

[0041] Figure 1 A flowchart of a PLC data encryption communication method based on a chaotic system mobile key provided for an embodiment of the application;

[0042] Figure 2 A structural schematic diagram of an electronic device provided for an embodiment of the application.

[0043] Reference Signs:

[0044] 810, processor; 820, communication interface; 830, memory; 840, communication bus. DETAILED DESCRIPTION

[0045] In order to more clearly illustrate the overall concept of the application, the following will be described in detail with reference to the accompanying drawings.

[0046] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the application. However, the application can be practiced without the specific details. In other instances, well-known methods, procedures, components, and circuits have not been described in detail since such can be readily understood by persons skilled in the art. It can be appreciated that the scope of the application is indicated by the appended claims and not by the detailed description. Further, it should be understood that the features of the various embodiments and of the various claims can be combined with each other, if not contradictory.

[0047] In the present application, unless specifically defined otherwise and limited, the first feature is "on" or "under" the second feature, which can be direct contact between the first and second features, or indirect contact between the first and second features through an intermediate medium. In the description of the specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the application. In the specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples.

[0048] Embodiment 1

[0049] As Figure 1As shown, a PLC data encryption communication method based on chaotic system mobile key includes:

[0050] S100, a switching chaotic system model is constructed by multiple chaotic systems, and a basic decision model in the switching chaotic system model is used to execute a switching strategy according to an initial value as a switching signal.

[0051] As described above, multiple different chaotic systems (such as Lorenz, Chen, and Rossler chaotic systems) are used to create a complex encryption framework. This framework utilizes the unique properties of each chaotic system to generate a key stream, and automatically selects the appropriate chaotic system for switching based on the input initial value according to specific rules or conditions (i.e., the basic decision model). This not only increases the size of the key space, but also improves the security and unpredictability of the encryption algorithm.

[0052] For example, assume there are two chaotic systems: Lorenz and Chen systems. First, define a basic decision model that contains a series of threshold intervals, each corresponding to a specific chaotic system. If the initial value falls within a certain interval, the corresponding chaotic system is selected to generate the key stream. For example, if the initial value is 0.3, it may fall into the interval corresponding to the Lorenz system according to the basic decision model; if the initial value is 0.8, the Chen system will be selected. This way allows the encryption process to dynamically switch from one chaotic system to another, making it more difficult for attackers to guess the key stream.

[0053] It should be noted that in specific implementation scenarios, in addition to the above-mentioned Lorenz and Chen chaotic systems, other types of chaotic systems (such as Duffing systems) can also be introduced to further expand the key space and the diversity of the encryption algorithm. Each additional chaotic system can adjust the threshold intervals in the basic decision model according to its characteristics, making the entire encryption system more complex and secure.

[0054] In specific implementation scenarios, in addition to the above-mentioned schemes, an adaptive mechanism can be designed to allow the system to automatically adjust the switching strategy based on real-time data traffic, network status, or other environmental factors. For example, in high-risk environments, automatically prefer to select more complex chaotic systems, or immediately replace the currently used chaotic system when abnormal activity is detected, enhancing the defense capabilities of the system.

[0055] In specific implementation scenarios, in addition to the above-mentioned schemes, in addition to the basic key stream shifting operation, a multi-level key management strategy can also be implemented, including but not limited to time synchronization key update, event-triggered key reset, etc., to ensure the security of communication even in extreme situations.

[0056] In specific implementation scenarios, the above scheme can be further optimized for PLC data communication, but the core idea is also applicable to other data transmission scenarios that require high security, such as communication between Internet of Things devices and financial transaction systems. By adjusting the basic decision model and switching strategy, the security requirements of different application scenarios can be met.

[0057] S200, generate a key stream by switching the initial value of the chaotic system obtained by the switching strategy, and shift the key stream.

[0058] As mentioned above, a continuous key stream is generated using the selected chaotic system (determined according to the switching strategy) and its initial conditions. The key stream is essentially a pseudo-random number sequence generated by the chaotic system. To enhance the security of the encryption algorithm, further shift operations are performed on the generated key stream, i.e., by moving the bit positions in the key stream to create a new key stream. This shift can be a circular left shift or right shift, and the number of shifts can be dynamically adjusted as needed.

[0059] For example, the Chen chaotic system is selected as the currently used chaotic system, and its initial value is (0.1, 0.2, 0.3). Based on this initial value, the Chen chaotic system will generate a series of chaotic numerical values. These values are then quantized into binary format to form the original key stream. Next, according to the preset shift rule (for example, according to the integer part in the private key), the key stream is circularly left shifted or right shifted. If the specified shift number is 5, the first 5 bits from each byte of the key stream are extracted and moved to the end (for left shift), or vice versa (for right shift). The key stream processed in this way not only retains the original chaotic characteristics, but also adds an additional layer of security.

[0060] It should be noted that in specific implementation scenarios, in addition to simple circular shifting, more complex shifting logic such as segmented shifting and cross-shifting can also be introduced based on the above scheme. This will make the transformation of the key stream more diverse, thereby increasing the difficulty of predicting the key stream for attackers. For example, in segmented shifting, the key stream is divided into multiple segments, and each segment applies a different shift amount.

[0061] In specific implementation scenarios, the above scheme can be further optimized for PLC data communication, but the core idea is also applicable to other data transmission scenarios that require high security, such as communication between Internet of Things devices and financial transaction systems. By adjusting the basic decision model and switching strategy, the security requirements of different application scenarios can be met.

[0062] S300, the shifted key stream and the plaintext are subjected to an XOR operation to obtain encrypted ciphertext data.

[0063] As mentioned above, the original plaintext is encrypted by a key stream that is generated beforehand and subjected to a shifting process. Specifically, the XOR operation is a basic binary operation that results in 0 when two corresponding bits are the same and 1 when they are different. In this process, each plaintext character (represented in binary form) is subjected to an XOR operation with the bit at the corresponding position in the key stream to generate a corresponding ciphertext character. This has the advantage that, as long as the key stream is sufficiently random and secret, it is difficult for an attacker to infer the original information from the ciphertext even if the attacker obtains the ciphertext.

[0064] For example, there is a simple plaintext "HELLO" whose ASCII codes are 72, 69, 76, 76, and 79 (corresponding to each letter). At the same time, assume that the shifted key stream is 10101010, 11110000, 00001111, 11001100, and 00110011 (each byte represents a part of the key stream). The corresponding bits of each pair of plaintext and key stream are subjected to an XOR operation:

[0065] H (72) XOR 10101010 = new value

[0066] E (69) XOR 11110000 = new value

[0067] L (76) XOR 00001111 = new value

[0068] L (76) XOR 11001100 = new value

[0069] O (79) XOR 00110011 = new value

[0070] The encrypted ciphertext data can be obtained. When decrypting, the original plaintext can be restored by performing the XOR operation again using the same key stream.

[0071] It should be noted that in specific implementation scenarios, multiple XOR operations can be implemented on the basis of the above scheme in order to further enhance security. For example, after the initial XOR operation, a second XOR operation is performed on the resulting data using another independently generated key stream. This method increases the difficulty of cracking, because an attacker needs to know all the key streams involved in the XOR operation in order to decrypt the information.

[0072] In specific implementation scenarios, error detection and correction mechanisms can be added based on the above scheme. Redundant information can be introduced into the key stream or encrypted data to automatically identify and correct errors that occur during transmission, ensuring that the data reaches the receiving end accurately.

[0073] In some embodiments of the present application, after obtaining the encrypted ciphertext data, the following steps are further included:

[0074] By switching the basic decision model in the chaotic system model, the switching strategy is determined according to the size of the key stream;

[0075] According to the chaotic system obtained by switching the strategy, the key stream is shifted to obtain the shifted key stream.

[0076] The ciphertext data is subjected to inverse XOR operation by the shifted key stream to obtain the plaintext.

[0077] As mentioned above, at the beginning of the decryption phase, it is necessary to re-determine which chaotic system to use to generate the key stream for decryption. This step relies on the "basic decision model" used in the previous encryption process. This model is based on certain characteristics of the key stream (such as size, distribution, etc.) to determine which chaotic system should be selected for subsequent operations. For example, if the numerical value of the key stream falls within a certain specific interval, the corresponding chaotic system is selected as the system used for the current decryption.

[0078] The initial value of this chaotic system is iterated according to the same rules as during encryption to generate the corresponding key stream. The previously recorded key stream shift parameter (i.e., the specific number of shifts applied during encryption) is used to perform the same type of shift operation (such as cyclic left or right shift) on the newly generated key stream. The purpose of this is to ensure that the key stream used for decryption is exactly the same as that used for encryption, thereby ensuring that the original plaintext information can be accurately recovered.

[0079] The encrypted data (i.e., ciphertext) is subjected to inverse XOR operation using the key stream processed through the above steps. Since in the encryption phase, the plaintext is converted into ciphertext by XOR operation with a specific key stream, in the decryption process, only the same key stream is applied to the ciphertext to perform XOR operation to recover the original plaintext. This is because XOR operation is self-reflexive, i.e., A XOR B XOR B = A. This means that as long as the key stream remains unchanged, whether it is encryption or decryption, the conversion and restoration of the text can be achieved through simple XOR operation.

[0080] In some embodiments of the present application, a key distribution strategy is also included, specifically:

[0081] The initial value of the chaotic system in the switching chaotic system model is randomly generated by a random number generator as a key;

[0082] An integer is generated by a random integer generator as a key stream shift number to expand the key;

[0083] The expanded key is synchronized during power-on, encryption and decryption.

[0084] As described above, in the key generation phase, a plurality of random number values are generated by a high-precision random number generator, which will be used as the initial value of each chaotic system in the switching chaotic system model. Since the chaotic system is extremely sensitive to the initial condition, even a slight change will lead to 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 part of the key, and will be securely distributed and stored between the two communicating parties.

[0085] In addition to the initial value of the chaotic system, an additional variable parameter, the shift number of the key stream, is also introduced. This parameter is generated by a random integer generator and is used to control the shift operation (such as cyclic left or right shift) of the subsequently generated key stream before use. The shift number as an independent key parameter further expands the key space and enhances the complexity and attack resistance of the encryption system. This parameter needs to be securely transmitted to the receiver together with the initial value to ensure the correct execution of the decryption process.

[0086] In order to ensure that both parties use the same key parameters during encryption and decryption, the key information must be synchronized before the device is powered on, performs encryption or performs decryption. That is, the sender and receiver need to use the same initial value and key stream shift number to generate the key stream at the same time point. This synchronization mechanism can be achieved by pre-sharing the key, or combined with external authentication mechanisms or time stamps to enhance security. Ensuring that the parameters relied upon by both parties when generating the key stream remain consistent, thus ensuring the correctness and integrity of the communication process.

[0087] In some embodiments of the present application, the basic decision model in the switching chaotic system model is used as a switching signal according to the initial value, specifically:

[0088] According to the value range of the initial value of the basic decision model, threshold intervals are divided, and each threshold interval corresponds to a chaotic system;

[0089] By comparing the initial value of the basic decision model with the threshold interval, the corresponding chaotic system is switched.

[0090] As mentioned above, in the process of constructing the switching chaotic system model, a "basic judgment model" for judging and controlling the switching behavior is set. The core function of this model is to determine how to switch between multiple chaotic systems according to the input initial value. In order to achieve this function, the basic judgment model internally predefines several numerical range intervals, i.e. "threshold intervals", each of which corresponds to a specific chaotic system.

[0091] In actual operation, the system inputs the initial value of the currently used chaotic system into the basic judgment model, and the model identifies and judges the numerical range of the initial value. For example, if the initial value falls within the first threshold interval, chaotic system A is selected; if it falls within the second threshold interval, chaotic system B is selected, and so on. In this way, the purpose of dynamically selecting different chaotic systems according to the initial value is achieved.

[0092] This switching mechanism based on the numerical range of the initial value makes the entire encryption process highly uncertain and complex. Since the chaotic system itself is extremely sensitive to the initial value, and the initial value determines which chaotic system to use, even a slight change in the initial value can result in a completely different final key stream. This structure not only enhances the security of the encryption system, but also enhances its attack resistance and the diversity of the key space.

[0093] By setting threshold intervals matching the initial value and dynamically selecting the corresponding chaotic system, a flexible, secure and controllable switching strategy is achieved, providing a solid foundation for subsequent key stream generation and data encryption.

[0094] In some embodiments of the present application, the initial value of the chaotic system obtained by the switching strategy is used to generate a key stream, and the key stream is shifted, specifically:

[0095] Generate a chaotic sequence through iteration of the initial value of the chaotic system;

[0096] Quantify the chaotic value into a binary key stream;

[0097] Use the number of moving bits to perform a cyclic left or right shift on the key stream.

[0098] As mentioned above, according to the selected chaotic system and its initial value (which is determined according to the aforementioned base decision model and switching strategy), the iterative calculation is started to generate the chaotic sequence. Each chaotic system has its specific mathematical formula or algorithm to describe its behavior, such as the Lorenz system, Chen system, etc. The characteristic of these systems is extremely sensitive to initial conditions, even extremely small changes will lead to significant differences in the generated sequence. Therefore, by repeatedly iterating the equations of the chaotic system, a series of continuous chaotic numerical values can be generated step by step from the initial value.

[0099] The chaotic numerical values generated in the above steps are converted into a format suitable for encryption, i.e. a binary form of the key stream. This step involves mapping the chaotic numerical values to integers within a specific range or directly converting them to binary representation. Since the chaotic numerical values are floating-point numbers, certain processing is required, such as rounding or normalization, to ensure that the final generated key stream can meet 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.

[0100] After obtaining the binary format of the key stream, in order to enhance the security of the key and increase the potential key space, a shift operation is performed on the key stream. The "shift number" mentioned here is a pre-set parameter that determines how many positions the bits in the key stream need to move left or right. For example, if the specified shift number is 3, it means that each byte in the key stream needs to move 3 positions to the left, and the bits that exceed the boundary will be moved to the beginning; conversely, for right shift operation, the bits are moved to the end. This shift operation not only increases the complexity of the key stream, but also makes it difficult for attackers to guess the complete key stream structure even if they obtain part of the key information.

[0101] In some embodiments of the present application, the switching strategy is determined according to the size of the key stream by switching the base decision model in the chaotic system model, specifically:

[0102] The initial value of the base decision model in the switched chaotic system model is compared with the threshold interval, and the switched chaotic system model is run to obtain the same chaotic system as in encryption.

[0103] As mentioned above, in the decryption process, in order to ensure that the chaotic system used in the encryption stage can be accurately reproduced, the corresponding chaotic system needs to be selected according to the same switching logic as the encryption end. A pre-set "base decision model" is used, which contains multiple threshold intervals inside, each interval corresponding to a specific chaotic system.

[0104] In actual execution of the decryption operation, first, the initial value for generating the key stream is input into the basic determination model, and the initial value is compared with each preset threshold interval. For example, if the initial value falls within the first interval range, the chaotic system A is selected; if it falls within the second interval, the chaotic system B is selected, and so on. In this way, the system can accurately identify which chaotic system is used in the encryption stage, and the same chaotic system is run in the decryption stage, thereby ensuring the consistency of the generated key stream.

[0105] In both the encryption and decryption stages, as long as the same initial value is input, the basic determination model will output the same judgment result, and then drive the switching chaotic system model to select the same chaotic system. This switching strategy based on matching of the initial value and the threshold interval not only ensures the consistency and repeatability of the encryption and decryption process, but also enhances the security and controllability of the entire system.

[0106] In some embodiments of the present application, the chaotic system obtained according to the switching strategy is used to shift the key stream to obtain a shifted key stream, specifically:

[0107] The corresponding chaotic sequence is obtained by the same chaotic system as in the encryption;

[0108] The chaotic sequence is circularly shifted by the number of shift bits to obtain the shifted key stream.

[0109] As described above, in the decryption process, in order to accurately restore the key stream used in encryption, it is necessary to ensure that the same chaotic system as the encryption end is used. The selection of this chaotic system is based on the aforementioned switching strategy, that is, the specific chaotic system selected by the basic determination model after judging the initial value.

[0110] After determining the chaotic system to be used in the decryption stage, the chaotic system is iteratively operated in the same way and initial condition as in the encryption stage to generate a corresponding chaotic sequence. The chaotic sequence is consistent with the original chaotic sequence generated by the encryption end in structure and numerical distribution, thereby laying a foundation for subsequent generation of the key stream for decryption.

[0111] After obtaining the chaotic sequence, it needs to be binary quantized to convert it into a binary key stream that can be used for XOR operation. At this time, a key parameter, the number of shift bits, needs to be introduced. This parameter is generated by a random integer generator in the encryption stage and has been synchronized to the decryption end in a secure manner.

[0112] 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.

[0113] 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.

[0114] A second embodiment of the present application provides a PLC data encryption communication system based on a chaotic system mobile key, comprising:

[0115] 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;

[0116] 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;

[0117] The XOR module is used to perform an XOR operation on the shifted key stream and the plaintext to obtain the encrypted ciphertext data.

[0118] 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.

[0119] 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.

[0120] 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:

[0121] The switching chaotic system model is constructed through multiple chaotic systems, and a switching strategy is executed according to initial values as switching signals based on a basic judgment model in the switching chaotic system model;

[0122] The initial values of the chaotic system switched through the switching strategy are used to generate a key stream, and the key stream is shifted.

[0123] The shifted key stream is subjected to an exclusive OR operation with plaintext to obtain encrypted ciphertext data.

[0124] In addition, the logical instructions in the memory 830 described above can be implemented in the form of a software function unit and sold or used as an independent product, and can be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the present application or the part of the prior art that contributes essentially or the part of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk, and various media that can store program codes.

[0125] On the other hand, the present application also provides a computer program product, which comprises a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program is executed by a processor, and the computer can execute the method provided by the above-mentioned method, and the method comprises:

[0126] The switching chaotic system model is constructed through multiple chaotic systems, and a switching strategy is executed according to initial values as switching signals based on a basic judgment model in the switching chaotic system model;

[0127] The initial values of the chaotic system switched through the switching strategy are used to generate a key stream, and the key stream is shifted.

[0128] The shifted key stream is subjected to an exclusive OR operation with plaintext to obtain encrypted ciphertext data.

[0129] In another aspect, the present application also provides a non-transitory computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the cigarette case image recognition method provided by the above-mentioned method, and the method comprises:

[0130] The switching chaotic system model is constructed through multiple chaotic systems, and a switching strategy is executed according to initial values as switching signals based on a basic judgment model in the switching chaotic system model;

[0131] 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.

[0132] The shifted key stream and the plaintext are subjected to XOR operation to obtain encrypted ciphertext data.

[0133] Embodiment 2

[0134] In an intelligent factory environment, the cloud platform needs to monitor and control the working status of multiple PLC devices in real time. In order to ensure the security of data transmission, the following technical solutions are used to protect the communication data between the PLC and the host computer.

[0135] At the PLC end, an initial value of a chaotic system (such as 0.1, 0.2, 0.3) is randomly generated, and a chaotic system (such as Lorenz system) is determined by a basic judgment model. An integer is generated as the moving bit number of the key stream (such as 5) using a random integer generator, and it is used as an additional key parameter.

[0136] The chaotic sequence is generated from the initial value using the selected chaotic system, and the values are quantized into binary format to form the original key stream. The generated key stream is subjected to a left circular shift operation with a shift number of 5. Ensure that the cloud platform and the PLC end can synchronize these key parameters (initial value and shift number), which can be done through pre-shared keys or security protocols.

[0137] When the cloud platform needs to query the working status of an end 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 the status information using the generated key stream (i.e., generates ciphertext data through XOR operation).

[0138] The encrypted status information is transmitted to the cloud platform through the upper-level management device. During transmission, since the data has been encrypted, any attempt to steal or tamper with the data will become very difficult.

[0139] After receiving the encrypted data packet, the cloud platform uses the pre-synchronized key parameters (initial value and shift number) to repeatedly generate the same key stream. The received ciphertext data is subjected to inverse XOR operation using the key stream to restore the original plaintext data, i.e., the working status of the end device.

[0140] If the working state of the end device changes, the IOService process of the PLC updates the corresponding device state data in the shared memory. The NetService process detects the change and sends a device state broadcast message to the host computer. Similarly, the NetService processes the new device state data and transmits it to the cloud platform through the upper management device to ensure data security.

[0141] Embodiment 3

[0142] The switching chaotic system model is mainly composed of Lorenz chaotic system and Chen chaotic system. First, the Lorenz nonlinear system is a typical chaotic system,

[0143]

[0144] where, , , is the state of the system, is the output of the system. When , , , the Lorenz system exhibits chaotic phenomena. Note that the amplitude of the Lorenz chaotic system state is in . Second, the state space expression of the Chen nonlinear system is given as follows:

[0145]

[0146] where, , , is the state of the system, is the output of the system. When , , , the Chen system exhibits chaotic phenomena.

[0147] For the Lorenz chaotic system and the Chen chaotic system, the plaintext to be encrypted is injected into the output equation of the two systems, respectively. Please note that this scheme uses a mobile key, that is, the mobile key is defined as an integer , and in the output of the chaotic system, the data is moved back by , and then the subsequent output is combined with the plaintext in turn. For details, please refer to the following:

[0148] Lorenz plaintext injection system :

[0149] :

[0150] Chen plaintext injection system :

[0151] :

[0152] Then two plaintext injection systems and are composed into a switching chaotic system, that is

[0153]

[0154] where is the switching signal, which indicates that at time , the chaotic system or is activated.

[0155] The switching strategy of the switching signal is given as follows:

[0156] In the encryption module, the present scheme considers the Lorenz chaotic system as the basis for the determination model. Under the condition that the initial value of the chaotic system is set as , the encryption end determines the state of the Lorenz chaotic system . If , then ; if , then . The mathematical expression is as follows:

[0157]

[0158] Note that the present 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 with the previous patent scheme, the present scheme needs to shift the key stream. Specifically, the state equation of the Rossler chaotic system is as follows:

[0159] :

[0160] where , , is the state of the system, is the output of the system. When , , , , the Rossler system exhibits chaotic phenomena.

[0161] The Lorenz chaotic system is still taken as the basic model, but the switching signal of the switching strategy needs to be updated as follows:

[0162] When the state of the Lorenz chaotic system is , then ; when the state of the Lorenz chaotic system is , then ; when the state of the Lorenz chaotic system is , then . The mathematical expression is as follows:

[0163]

[0164] Switching chaotic system decryption module

[0165] After the ciphertext is received by the decryption module , the switching strategy of the chaotic system needs to be determined first. Based on the key, the Lorenz system basic model is run, and the switching strategy of the chaotic system is determined by judging the size of the key stream . Then, the key stream is shifted. Since the key is known, in the key stream , it is necessary to move positions. Finally, the ciphertext is subtracted from the shifted key stream to obtain the measured plaintext. The general decryption equation is as follows:

[0166]

[0167] Key distribution with key stream moving bit number

[0168] The chaotic sequence generated by the chaotic system is extremely sensitive to the initial value of the system, and slight initial value perturbation can drastically change the chaotic sequence generated by the chaotic system. Therefore, the initial value of the chaotic system is usually taken as the key of chaotic encryption. Since the switching chaotic system is used as the key stream generator in the present scheme, the key is selected as:

[0169]

[0170] At the same time, in order to increase the security of the system, the method of shifting and expanding the key is adopted in the present scheme. The key expansion distribution strategy is: the encryption and decryption power synchronization random key stream moving bit number . It is noted that the key stream moving bit number is known in the present scheme.The range of the integer is [10, 20], and is an integer. Of course, this range can be re-limited according to specific scenes and applications. Specifically, the key distribution module adopts a random number generator while distributing keys to the encryption module and the decryption module. In engineering applications, the random number generator randomly generates three numbers as system initial values of the encryption and decryption modules each time the system is powered on, and simultaneously randomly generates an integer within [10, 20] as That is . This is equivalent to the key increasing by one bit, greatly increasing the security of the encryption and decryption algorithm.

[0171] The places not mentioned in the present application can be realized by using or referring to the existing technology.

[0172] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment mainly describes the difference from other embodiments.

[0173] The above only describes the embodiments of the present application and is not intended to limit the present application. Those skilled in the art can make various changes and modifications to the present application. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in 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. Based on the basic judgment model in the switching chaotic system model, the switching strategy is executed 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; 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; Perform an XOR operation on the shifted key stream and the plaintext to obtain the encrypted ciphertext data; 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.

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 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.

4. 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.

5. 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.

6. A PLC data encryption communication system based on chaotic system mobile key, characterized in that: include: The switching module is used to construct a switching chaotic system model through multiple chaotic systems. Based on the basic judgment model in the switching chaotic system model, the switching strategy is executed 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; 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; 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.

7. 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 5 are implemented.

8. 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 5 are implemented.

Citation Information

Patent Citations

  • Chaos encrypting and decrypting method without multiply and divide of chaos function and circuit thereof

    CN101232367A

  • Chaotic block encryption method and system based on model random selection, and medium

    CN119544184A