Data encryption method, device, equipment and storage medium
By encrypting the encrypted data using public key algorithms and base conversion rules on edge devices, the problems of poor encryption performance and poor anti-exhaustion attack capabilities in the prior art are solved, and efficient and secure data encryption is achieved, which is suitable for edge devices.
Patent Information
- Application Number
- CN202311527623.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-15
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2043-11-15
AI Technical Summary
The base encoding mechanism in the prior art has poor encryption performance and poor anti-exhaustion attack capabilities, and has high requirements for the computing power of edge devices.
The binary code of the encrypted data is randomly split through the public key algorithm to generate public key data containing salt and pepper noise, and a primer sequence is generated based on the binary code and public key data. The public key data and primer sequence are base-converted using preset base conversion rules, and finally the base sequence is merged into an encrypted ciphertext.
It improves the complexity of encryption algorithms and anti-exhaustion attack capabilities, reduces the computing power requirements for edge devices, makes encrypted ciphertext difficult to crack and is suitable for a wide range of edge devices.
Smart Images

Figure CN117544305B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data security technology, and in particular to a data encryption method, device, equipment and storage medium. Background Art
[0002] In edge computing, since there are risks of data loss, data leakage, illegal operation, etc. when sending private data of users to edge servers, data encryption mechanism is usually adopted. Since the ciphertext obtained by the relevant encryption algorithm is usually not very operable, it will cause certain obstacles to the further processing of data. In recent years, base encryption method has become a new research topic.
[0003] However, the relevant data encryption mechanism has the following defects: the relevant base coding mechanism is very fragile. Although base coding is a key step in encryption, most of the relevant coding methods use fixed coding, which has poor coding encryption performance and poor anti-exhaustive attack capabilities. The relevant encryption algorithm scheme has high computing power requirements, and ordinary edge devices cannot support encryption work. Summary of the invention
[0004] The main purpose of the present invention is to provide a data encryption method, device, equipment and storage medium, aiming to solve the technical problems of poor encryption performance, poor anti-exhaustive attack capability and high computing power requirements of edge devices in the encryption algorithm of the prior art.
[0005] To achieve the above object, the present invention provides a data encryption method, which is applied to an edge computing device and comprises the following steps:
[0006] Randomly split the binary code corresponding to the data to be encrypted according to the public key algorithm to obtain at least two public key data, wherein the public key data contains salt and pepper noise;
[0007] Generate a primer sequence corresponding to each public key data according to the binary code and the public key data;
[0008] Performing base conversion on the public key data and the primer sequence according to a preset base conversion rule to obtain a base sequence corresponding to each of the public key data, wherein the preset base conversion rule includes a correspondence between the public key data, the primer sequence and the base;
[0009] The base sequences corresponding to each of the public key data are combined to obtain the encrypted ciphertext corresponding to the data to be encrypted.
[0010] Optionally, generating a primer sequence corresponding to each public key data according to the binary code and the public key data includes:
[0011] A Hadamard product operation is performed according to the binary code and the public key data to obtain a primer sequence corresponding to each public key data.
[0012] Optionally, after the step of merging the base sequences corresponding to each of the public key data to obtain the encrypted ciphertext corresponding to the data to be encrypted, the method further includes:
[0013] The encrypted ciphertext is forwarded to a data computing device, so that the data computing device decrypts the encrypted ciphertext according to the preset base conversion rule to obtain decrypted data, and the data computing device is a core network or a cloud device.
[0014] Optionally, forwarding the encrypted ciphertext to a data computing device so that the data computing device decrypts the encrypted ciphertext according to the preset base conversion rule to obtain decrypted data includes:
[0015] The encrypted ciphertext is forwarded to a data computing device so that the data computing device splits the encrypted ciphertext according to a private key algorithm corresponding to the public key algorithm to obtain at least two split base sequences, converts each of the split base sequences into the primer sequence and the public key data according to the preset base conversion rule, and generates decrypted data according to the primer sequence and the public key data, and the decrypted data is consistent with the binary code corresponding to the data to be encrypted.
[0016] Optionally, converting each of the split base sequences into the primer sequence and the public key data according to the preset base conversion rule, and generating decryption data according to the primer sequence and the public key data, includes:
[0017] Converting each of the split base sequences into a first binary sequence and a second binary sequence according to the preset base conversion rule;
[0018] Determine the primer sequence and the public key data according to the first binary sequence and the second binary sequence by using a median filtering algorithm in the private key algorithm;
[0019] The primer sequence and the public key data are decrypted, and the decrypted primer sequence and the decrypted public key data are combined to generate decrypted data.
[0020] Optionally, determining the primer sequence and the public key data according to the first binary sequence and the second binary sequence by using a median filtering algorithm in the private key algorithm includes:
[0021] Determining whether the first binary sequence contains salt and pepper noise by using a median filter algorithm in the private key algorithm;
[0022] If included, the first binary sequence is determined as the public key data, and the second binary sequence is determined as the primer sequence.
[0023] Optionally, after the step of determining whether the first binary sequence contains salt and pepper noise by using a median filtering algorithm in the private key algorithm, the method further includes:
[0024] If not, the first binary sequence is determined as the primer sequence, and the second binary sequence is determined as the public key data.
[0025] In addition, to achieve the above object, the present invention also provides a data encryption device, the data encryption device comprising:
[0026] A public key data generation module, used for randomly splitting the binary code corresponding to the encrypted data according to the public key algorithm to obtain at least two public key data, wherein the public key data contains salt and pepper noise;
[0027] A primer sequence generation module, used to generate a primer sequence corresponding to each public key data according to the binary code and the public key data;
[0028] A base sequence conversion module, used to perform base conversion on the public key data and the primer sequence according to a preset base conversion rule to obtain a base sequence corresponding to each public key data, wherein the preset base conversion rule includes a correspondence between the public key data, the primer sequence and the base;
[0029] The base sequence merging module is used to merge the base sequences corresponding to each of the public key data to obtain the encrypted ciphertext corresponding to the data to be encrypted.
[0030] In addition, to achieve the above-mentioned purpose, the present invention also proposes a data encryption device, which includes: a memory, a processor, and a data encryption program stored in the memory and executable on the processor, wherein the data encryption program is configured to implement the steps of the data encryption method described above.
[0031] In addition, to achieve the above-mentioned purpose, the present invention further proposes a storage medium, on which a data encryption program is stored, and when the data encryption program is executed by a processor, the steps of the data encryption method described above are implemented.
[0032] In the present invention, it is disclosed that the binary code corresponding to the data to be encrypted is randomly split according to the public key algorithm to obtain at least two public key data containing salt and pepper noise; the primer sequence corresponding to each public key data is generated according to the binary code and the public key data; the public key data and the primer sequence are base-converted according to the preset base conversion rule including the correspondence between the public key data, the primer sequence and the base to obtain the base sequence corresponding to each public key data; the base sequence corresponding to each public key data is merged to obtain the encrypted ciphertext corresponding to the data to be encrypted. Since the present invention performs base conversion on the public key data containing salt and pepper noise and the primer sequence corresponding to the public key data according to the preset base conversion rule, the person without the private key cannot recognize the binary number corresponding to the salt and pepper noise and the primer sequence. This uncertainty causes the binary data of the four bases of the base rule to be not fixed. By using this method to disguise the password, the cracker cannot perform exhaustive and forced cracking, and the encryption algorithm does not require much computing power of the edge device, and can be applied in a wide range. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a structural diagram of a data encryption device in a hardware operating environment involved in an embodiment of the present invention;
[0034] Figure 2 This is a flow chart of a first embodiment of a data encryption method of the present invention;
[0035] Figure 3 A schematic diagram of the encryption position in the edge computing device in the data encryption method of the present invention;
[0036] Figure 4 A schematic diagram of a specific encryption position in a database in the data encryption method of the present invention;
[0037] Figure 5 It is a flow chart of the data encryption method of the present invention;
[0038] Figure 6 This is a flow chart of a second embodiment of a data encryption method according to the present invention;
[0039] Figure 7 It is a schematic diagram of the overall process of encryption and decryption in the data encryption method of the present invention;
[0040] Figure 8 It is a schematic diagram of a process of converting a base sequence in an encrypted ciphertext into a primer sequence and public key data in the data encryption method of the present invention;
[0041] Fig. 9 A schematic diagram of a process for generating decryption data according to a primer sequence and public key data in a data encryption method of the present invention;
[0042] Fig.10It is a structural block diagram of the first embodiment of the data encryption device of the present invention.
[0043] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION
[0044] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0045] Reference Figure 1 , Figure 1 The present invention is a schematic diagram of the data encryption device structure of the hardware operating environment involved in the embodiment of the present invention.
[0046] like Figure 1 As shown, the data encryption device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM), or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0047] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the data encryption device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0048] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a data encryption program.
[0049] exist Figure 1In the data encryption device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the data encryption device of the present invention can be set in the data encryption device, and the data encryption device calls the data encryption program stored in the memory 1005 through the processor 1001, and executes the data encryption method provided by the embodiment of the present invention.
[0050] The embodiment of the present invention provides a data encryption method, referring to Figure 2 , Figure 2 FIG. 1 is a flow chart of a first embodiment of a data encryption method according to the present invention.
[0051] In this embodiment, the data encryption method is applied to an edge computing device, and the data encryption method includes the following steps:
[0052] Step S10: randomly splitting the binary code corresponding to the data to be encrypted according to a public key algorithm to obtain at least two public key data, wherein the public key data contains salt and pepper noise.
[0053] It should be noted that the execution subject of the method of this embodiment can be an edge computing device with data encryption, network communication and program running functions; it can also be the above-mentioned data encryption device with the same or similar functions. This embodiment and the following embodiments will be described by taking the edge computing device as an example.
[0054] It is understandable that although edge computing devices can perform some simple data processing, relatively complex and core data still need to be calculated on the core network side or in the cloud. In order to ensure the security of core data from edge devices to the cloud, the data encryption method of this embodiment can be applied to edge computing devices, and can be suitable for edge devices such as gateways where the local computing space is not large.
[0055] It should be noted that the encrypted location of the core data in the edge computing device can be in the database of the core function layer. The encrypted location can be referenced Figure 3 , Figure 3 The figure is a schematic diagram of the encryption location in the edge computing device in the data encryption method of the present invention. Specifically, the encryption scheme can be implemented at the DBMS layer of the database. This encryption means that the data is encrypted before physical access, the encryption performance is strong, the encryption does not affect the original data function of the DBMS, and the encryption function can be seamlessly coupled with the management system. The specific location of the database can be referred to Figure 4 , Figure 4 It is a schematic diagram of the specific encryption position in the database in the data encryption method of the present invention.
[0056] It should be understood that the industrial data of smart factories, smart transportation or smart homes is transmitted to the data management component for processing. This part is the initial form of data transmission to the database, and data encryption is not involved for the time being. Multiple connections in the IoT environment can be supported simultaneously. The data management component includes two main functions: data collection and aggregation. During the data collection function, data is obtained from the devices at the physical layer and initial processing steps are applied. The data is then sent to the aggregation component to be aggregated into different blocks. Finally, some structured and aggregated data is sent to the DBMS layer, where it is converted into an encrypted data format through corresponding extraction techniques.
[0057] It is easy to understand that the execution process of DBMS layer encryption can be to first convert the acquired text or data text (i.e., the data to be encrypted) into a UTF-8 binary code, for example, 01100011010101010101010101010101010101010101000010110101. Then the binary code is split into multiple segments through the public key algorithm to generate multiple public key data containing salt and pepper noise. In the actual processing process, the smallest data unit corresponding to the text or data text can be processed; for example, for a 32-bit image, each pixel is converted into a 32-bit binary code, and the 32-bit binary code is split. During the splitting process, it can be randomly split into two or more segments. In this embodiment, the above-mentioned binary code is taken as an example, and the encryption process is explained by splitting into two segments as an example. The encryption process can refer to Figure 5 , Figure 5 It is a flow chart of the data encryption method of the present invention.
[0058] Step S20: Generate a primer sequence corresponding to each public key data according to the binary code and the public key data.
[0059] Furthermore, in order to improve the complexity of data encryption and further disguise the password, the binary code corresponding to the original data and the public key data can be subjected to a Hadamard product operation according to the formula provided in this embodiment to obtain a primer sequence, so as to facilitate subsequent base conversion according to the primer sequence and improve the encryption performance. Therefore, the step S20 includes: performing a Hadamard product operation according to the binary code and the public key data to obtain a primer sequence corresponding to each of the public key data.
[0060] It is understandable that a Hadamard product operation can be performed based on the binary code and the public key data to generate a primer sequence corresponding to each public key data. The operation process is as follows:
[0061] Let the binary code corresponding to the original data be:
[0062] A n=[a1,a2,a3,a4,a5,...,a n ],
[0063] Let the public key data mixed with salt and pepper noise be:
[0064] B n =[β1,β2,β3,β4,β5,...,β n ],
[0065] Let the primer sequence be Y, then:
[0066] Y n =(A n -1)⊙(B n -1).
[0067] Step S30: performing base conversion on the public key data and the primer sequence according to a preset base conversion rule to obtain a base sequence corresponding to each public key data, wherein the preset base conversion rule includes a correspondence between public key data, primer sequence and base.
[0068] It should be noted that the base conversion rules used in the relevant encryption technology include four bases {A, T, C, G}, and the corresponding relationship with the binary code is shown in Table 1 below:
[0069] Arrays Base sequence 00 A 01 T 10 C 11 G
[0070] Among them, two bits of binary code correspond to one base, and the corresponding relationship is fixed.
[0071] It should be understood that the public key data and primer sequence can be base converted according to the preset base conversion rules to obtain the base sequence corresponding to each of the public key data. Unlike the existing base encryption technology, since the positions of the primer sequence and the public key data mixed with salt and pepper noise are not necessarily consistent with Table 1, that is, when the base is G or C, the person without the private key cannot identify the binary number corresponding to the noise and primer data. This uncertainty causes the binary data of the four bases of the base to be not fixed. This method of password camouflage makes it impossible for the cracker to perform exhaustive and forced cracking.
[0072] It is worth noting that the preset base conversion rules in the present invention include the corresponding relationship between the public key data, the primer sequence and the base, and the preset base conversion rules are defined as shown in Table 2 below:
[0073] Primer sequences Public key data mixed with salt and pepper noise Base 0 0 A 0 1 G 1 0 C 1 1 T
[0074] Step S40: Merge the base sequences corresponding to each of the public key data to obtain the encrypted ciphertext corresponding to the data to be encrypted.
[0075] It should be understood that, since corresponding base sequences are generated according to multiple pieces of public key data, all base sequences can be combined together to obtain a complete encrypted ciphertext corresponding to the data to be encrypted.
[0076] In this embodiment, it is disclosed that the binary code corresponding to the data to be encrypted is randomly split according to the public key algorithm to obtain at least two public key data containing salt and pepper noise; the primer sequence corresponding to each public key data is generated according to the binary code and the public key data; the public key data and the primer sequence are base-converted according to the preset base conversion rule including the correspondence between the public key data, the primer sequence and the base to obtain the base sequence corresponding to each public key data; the base sequence corresponding to each public key data is merged to obtain the encrypted ciphertext corresponding to the data to be encrypted. Since the present embodiment performs base conversion on the public key data containing salt and pepper noise and the primer sequence corresponding to the public key data according to the preset base conversion rule, the person without the private key cannot identify the binary number corresponding to the salt and pepper noise and the primer sequence. This uncertainty causes the binary data of the four bases of the base rule to be not fixed. By using this method to disguise the password, the cracker cannot perform exhaustive and forced cracking, and the encryption algorithm does not require much computing power of the edge device, and can be applied in a wide range.
[0077] refer to Figure 6 , Figure 6 FIG. 4 is a flow chart of a second embodiment of a data encryption method according to the present invention.
[0078] Furthermore, after the data is encrypted in the above manner, the encrypted ciphertext can be forwarded to the core network or cloud device. In order to successfully decrypt and obtain the original data, the above-mentioned preset base conversion rules can be deployed in the core network or cloud device, and then decrypted according to the rules to obtain the original data before encryption, thereby obtaining the data more securely.
[0079] Therefore, based on the above first embodiment, in this embodiment, after step S40, the following is further included:
[0080] Step S50: forwarding the encrypted ciphertext to a data computing device, so that the data computing device decrypts the encrypted ciphertext according to the preset base conversion rule to obtain decrypted data, and the data computing device is a core network or a cloud device.
[0081] It should be understood that since edge computing devices can perform some simple data processing, but relatively complex and core data is calculated on the core network side or in the cloud, the edge computing device can encrypt the data and then report the encrypted ciphertext to the base station. The encrypted data after the base station is then reported to the core network side or in the cloud. After receiving the encrypted ciphertext, the core network side or the cloud can decrypt the ciphertext according to the private key and the above-mentioned preset base conversion rules to obtain the data before encryption, thereby ensuring the security of the data. The overall encryption and decryption process from edge computing devices to core network / cloud devices can be referred to Figure 7 , Figure 7 The figure is a schematic diagram of the overall encryption and decryption process in the data encryption method of the present invention. Similarly, the decryption scheme is also applicable to the DBMS layer of the database system database in the core network / cloud.
[0082] Furthermore, the core network or cloud device can split the encrypted ciphertext according to the private key algorithm corresponding to the above-mentioned public key algorithm, and obtain the corresponding base sequence after the split, and then reversely convert the split base sequence into a primer sequence and public key data according to the preset base conversion rule, and then generate decrypted data, that is, the binary code corresponding to the data to be encrypted. Therefore, the step S50 includes: forwarding the encrypted ciphertext to a data computing device, so that the data computing device splits the encrypted ciphertext according to the private key algorithm corresponding to the public key algorithm, obtains at least two split base sequences, converts each of the split base sequences into the primer sequence and the public key data according to the preset base conversion rule, and generates decrypted data according to the primer sequence and the public key data, and the decrypted data is consistent with the binary code corresponding to the data to be encrypted.
[0083] It should be understood that the encrypted ciphertext can be forwarded to a data computing device so that the data computing device splits the encrypted ciphertext into a plurality of split base sequences according to a private key algorithm corresponding to the public key algorithm. This embodiment can be described by taking the above-mentioned encrypted base sequence as an example. Also, taking splitting into two segments as an example, reference can be made to Figure 8 , Figure 8 The present invention is a flow chart of converting the base sequence in the encrypted ciphertext into the primer sequence and the public key data in the data encryption method of the present invention. Then, the two base sequences can be converted into the primer sequence and the public key data according to the above-mentioned preset base conversion rule, and the decrypted data consistent with the binary code corresponding to the data to be encrypted is generated according to the primer sequence and the public key data.
[0084] Furthermore, considering that after the private key algorithm splits the encrypted ciphertext into multiple base sequences, it is necessary to determine which is the primer sequence and which is the public key data, the median filtering algorithm in the private key algorithm can be used to determine and determine the primer sequence and the public key data. At the same time, the primer sequence and the public key data can also be decrypted and merged to obtain decrypted data. Therefore, the step S50 also includes: converting each of the split base sequences into a first binary sequence and a second binary sequence according to the preset base conversion rule; determining the primer sequence and the public key data according to the first binary sequence and the second binary sequence by the median filtering algorithm in the private key algorithm; decrypting the primer sequence and the public key data, and merging the decrypted primer sequence and the decrypted public key data to generate decrypted data.
[0085] It can be understood that, since in the above steps, two binary code sequences are obtained after the base sequence is converted, which can be respectively called the first binary sequence and the second binary sequence, then the primer sequence and the public key data in the two binary sequences can be determined by the median filtering algorithm in the private key algorithm. After the binary sequence corresponding to the primer sequence and the public key data is determined, the primer sequence can be converted into the original binary code in reverse according to the steps of generating the primer sequence in the above encryption process, and finally the multiple binary codes are merged to obtain the decrypted data consistent with the binary code corresponding to the data to be encrypted. The process of using the private key to determine the primer sequence and the public key data mixed with salt and pepper noise, as well as the process of generating the decrypted data can be referred to. Fig. 9 , Fig. 9 The present invention is a flow chart of generating decryption data according to primer sequence and public key data in the data encryption method of the present invention.
[0086] Furthermore, in order to more accurately determine which binary sequence belongs to the primer sequence and which binary sequence belongs to the public key data, it is possible to determine whether the first binary sequence contains salt and pepper noise according to the median filtering algorithm in the private key algorithm. The sequence containing salt and pepper noise is the public key data, and the sequence not containing salt and pepper noise is the primer sequence. Therefore, step S50 further includes: determining whether the first binary sequence contains salt and pepper noise according to the median filtering algorithm in the private key algorithm; if it does, determining the first binary sequence as the public key data, and determining the second binary sequence as the primer sequence.
[0087] It is understandable that we can first determine whether one of the two binary sequences contains salt and pepper noise to determine whether it is public key data. If it contains salt and pepper noise, it means that it is public key data generated according to the public key algorithm, and the other one is the primer sequence.
[0088] Furthermore, similarly, if the first binary sequence does not contain salt and pepper noise, it indicates that the first binary sequence is a primer sequence, and correspondingly, the second binary sequence is the public key data. Therefore, the step S50 further includes: if it does not contain, determining the first binary sequence as the primer sequence, and determining the second binary sequence as the public key data.
[0089] It is easy to understand that, similarly, if the first binary sequence does not contain salt and pepper noise, it means that the first binary sequence is a primer sequence, and correspondingly, the second binary sequence is the public key data.
[0090] In this embodiment, it is disclosed that after the data is encrypted in the above manner, the encrypted ciphertext is forwarded to a data computing device such as a core network or a cloud device, so that the data computing device decrypts the encrypted ciphertext according to a preset base conversion rule to obtain decrypted data, thereby obtaining the original data before encryption and obtaining the data more securely.
[0091] In addition, an embodiment of the present invention further provides a storage medium, on which a data encryption program is stored. When the data encryption program is executed by a processor, the steps of the data encryption method described above are implemented.
[0092] Reference Fig.10 , Fig.10 It is a structural block diagram of the first embodiment of the data encryption device of the present invention.
[0093] like Fig.10 As shown, the data encryption device proposed in the embodiment of the present invention includes:
[0094] A public key data generation module 1001 is used to randomly split the binary code corresponding to the encrypted data according to the public key algorithm to obtain at least two public key data, wherein the public key data contains salt and pepper noise;
[0095] A primer sequence generating module 1002, configured to generate a primer sequence corresponding to each public key data according to the binary code and the public key data;
[0096] A base sequence conversion module 1003 is used to perform base conversion on the public key data and the primer sequence according to a preset base conversion rule to obtain a base sequence corresponding to each public key data, wherein the preset base conversion rule includes a correspondence between the public key data, the primer sequence and the base;
[0097] The base sequence merging module 1004 is used to merge the base sequences corresponding to each of the public key data to obtain the encrypted ciphertext corresponding to the data to be encrypted.
[0098] This embodiment randomly splits the binary code corresponding to the data to be encrypted according to the public key algorithm to obtain at least two public key data containing salt and pepper noise; generates a primer sequence corresponding to each public key data according to the binary code and the public key data; performs base conversion on the public key data and the primer sequence according to a preset base conversion rule including the correspondence between the public key data, the primer sequence and the base to obtain the base sequence corresponding to each public key data; and merges the base sequence corresponding to each public key data to obtain the encrypted ciphertext corresponding to the data to be encrypted. Since this embodiment performs base conversion on the public key data containing salt and pepper noise and the primer sequence corresponding to the public key data according to the preset base conversion rule, a person without a private key cannot recognize the binary numbers corresponding to the salt and pepper noise and the primer sequence. This uncertainty causes the binary data of the four bases of the base rule to be not fixed. By using this method to disguise the password, the cracker cannot perform exhaustive and forced cracking, and the encryption algorithm does not require much computing power from the edge device and can be applied in a wide range of applications.
[0099] Based on the above-mentioned first embodiment of the data encryption device of the present invention, a second embodiment of the data encryption device of the present invention is proposed.
[0100] In this embodiment, the primer sequence generating module 1002 is further used to perform a Hadamard product operation on the binary code and the public key data to obtain a primer sequence corresponding to each public key data.
[0101] As an implementation mode, the base sequence merging module 1004 is also used to forward the encrypted ciphertext to a data computing device so that the data computing device decrypts the encrypted ciphertext according to the preset base conversion rule to obtain decrypted data. The data computing device is a core network or a cloud device.
[0102] As an implementation mode, the base sequence merging module 1004 is also used to forward the encrypted ciphertext to a data computing device, so that the data computing device splits the encrypted ciphertext according to a private key algorithm corresponding to the public key algorithm to obtain at least two split base sequences, converts each of the split base sequences into the primer sequence and the public key data according to the preset base conversion rule, and generates decrypted data according to the primer sequence and the public key data, and the decrypted data is consistent with the binary code corresponding to the data to be encrypted.
[0103] As an implementation mode, the base sequence merging module 1004 is also used to convert each of the split base sequences into a first binary sequence and a second binary sequence according to the preset base conversion rule; determine the primer sequence and the public key data according to the first binary sequence and the second binary sequence through the median filtering algorithm in the private key algorithm; decrypt the primer sequence and the public key data, and merge the decrypted primer sequence and the decrypted public key data to generate decrypted data.
[0104] As an implementation mode, the base sequence merging module 1004 is also used to determine whether the first binary sequence contains salt and pepper noise through the median filtering algorithm in the private key algorithm; if it does, the first binary sequence is determined as the public key data, and the second binary sequence is determined as the primer sequence.
[0105] As an implementation manner, the base sequence merging module 1004 is further configured to, if not included, determine the first binary sequence as the primer sequence and determine the second binary sequence as the public key data.
[0106] Other embodiments or specific implementations of the data encryption device of the present invention can refer to the above-mentioned method embodiments and will not be described in detail here.
[0107] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0108] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0109] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0110] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A data encryption method, characterized in that: The data encryption method is applied to edge computing equipment, and the data encryption method includes: Randomly split the binary code corresponding to the data to be encrypted according to the public key algorithm to obtain at least two public key initial data, and add salt and pepper noise to the public key initial data to obtain public key data corresponding to each of the public key initial data; Performing a Hadamard product operation on the binary code and the public key data to generate a primer sequence corresponding to each public key data; Performing base conversion on the public key data and the primer sequence according to a preset base conversion rule to obtain a base sequence corresponding to each of the public key data, wherein the preset base conversion rule includes a correspondence between the public key data, the primer sequence and the base; The base sequences corresponding to each of the public key data are combined to obtain the encrypted ciphertext corresponding to the data to be encrypted.
2. The data encryption method according to claim 1, characterized in that: After the step of merging the base sequences corresponding to each of the public key data to obtain the encrypted ciphertext corresponding to the data to be encrypted, the method further includes: The encrypted ciphertext is forwarded to a data computing device, so that the data computing device decrypts the encrypted ciphertext according to the preset base conversion rule to obtain decrypted data, and the data computing device is a core network or a cloud device.
3. The data encryption method according to claim 2, characterized in that: The step of forwarding the encrypted ciphertext to a data computing device so that the data computing device decrypts the encrypted ciphertext according to the preset base conversion rule to obtain decrypted data includes: The encrypted ciphertext is forwarded to a data computing device so that the data computing device splits the encrypted ciphertext according to a private key algorithm corresponding to the public key algorithm to obtain at least two split base sequences, converts each of the split base sequences into the primer sequence and the public key data according to the preset base conversion rule, and generates decrypted data according to the primer sequence and the public key data, and the decrypted data is consistent with the binary code corresponding to the data to be encrypted.
4. The data encryption method according to claim 3, characterized in that: The step of converting each of the split base sequences into the primer sequence and the public key data according to the preset base conversion rule, and generating decryption data according to the primer sequence and the public key data, comprises: Converting each of the split base sequences into a first binary sequence and a second binary sequence according to the preset base conversion rule; Determine the primer sequence and the public key data according to the first binary sequence and the second binary sequence by using a median filtering algorithm in the private key algorithm; The primer sequence and the public key data are decrypted, and the decrypted primer sequence and the decrypted public key data are combined to generate decrypted data.
5. The data encryption method according to claim 4, characterized in that: The determining the primer sequence and the public key data according to the first binary sequence and the second binary sequence by using a median filtering algorithm in the private key algorithm includes: Determining whether the first binary sequence contains salt and pepper noise by using a median filter algorithm in the private key algorithm; If included, the first binary sequence is determined as the public key data, and the second binary sequence is determined as the primer sequence.
6. The data encryption method according to claim 5, characterized in that: After the step of determining whether the first binary sequence contains salt and pepper noise by using the median filtering algorithm in the private key algorithm, the method further includes: If not, the first binary sequence is determined as the primer sequence, and the second binary sequence is determined as the public key data.
7. A data encryption device, characterized in that: The data encryption device comprises: A public key data generation module, used to randomly split the binary code corresponding to the encrypted data according to the public key algorithm to obtain at least two public key initial data, and add salt and pepper noise to the public key initial data to obtain public key data corresponding to each of the public key initial data; A primer sequence generation module, used for performing a Hadamard product operation on the binary code and the public key data to generate a primer sequence corresponding to each public key data; A base sequence conversion module, used to perform base conversion on the public key data and the primer sequence according to a preset base conversion rule to obtain a base sequence corresponding to each public key data, wherein the preset base conversion rule includes a correspondence between the public key data, the primer sequence and the base; The base sequence merging module is used to merge the base sequences corresponding to each of the public key data to obtain the encrypted ciphertext corresponding to the data to be encrypted.
8. A data encryption device, characterized in that: The device comprises: a memory, a processor, and a data encryption program stored in the memory and executable on the processor, wherein the data encryption program is configured to implement the steps of the data encryption method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium stores a data encryption program, and when the data encryption program is executed by the processor, the steps of the data encryption method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
A multi-channel color image chaotic encryption method based on DNA coding
CN109918923A
Enterprise information image encryption method based on double scrambling and controlled DNA coding
CN116961904A