Data encryption and decryption method, device, equipment, storage medium and program product

By employing a multi-level encrypted connection and obfuscation data encryption method, combined with symmetric and asymmetric encryption algorithms and CRC32 checksum, the problem of balancing data encryption security and system performance is solved, achieving high data security and efficient data transmission.

CN119814452BActive Publication Date: 2025-11-18CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411998420.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-11-18
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

Existing data encryption schemes struggle to balance encryption security and system performance. Increased key length leads to longer encryption and decryption times, and with advancements in cryptographic techniques and computing power, existing encryption schemes are easier to crack, posing a security threat.

Method used

The plaintext data is encrypted using multi-level encryption connection processing to generate an encrypted string. Obfuscation processing is then used to obtain obfuscated ciphertext. The target encrypted data is generated by combining the signature string and the encryption key. Symmetric and asymmetric encryption algorithms, as well as CRC32 checksum, are used to ensure data security and integrity.

Benefits of technology

It improves data security and integrity, solves the problem of insufficient security of simple asymmetric encryption signatures, optimizes system performance, and enhances the ability to resist malicious attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814452B_ABST
    Figure CN119814452B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data encryption and decryption method, device, equipment, storage medium and program product, relating to the technical field of data processing. The data encryption method comprises: performing multi-level encryption connection processing on plaintext data to obtain an encrypted string and an encryption key, wherein the key for decrypting the encrypted string is encrypted to obtain the encryption key; performing obfuscation processing on the encrypted string to obtain obfuscated ciphertext; performing digital signature on the obfuscated ciphertext to obtain a signature string; generating target encrypted data based on the obfuscated ciphertext, the signature string, the encryption key and the processing parameters of the obfuscation processing, and sending the target encrypted data to a receiving end. Through the technical solution of the present disclosure, the problem of insufficient security of simple asymmetric encryption signature is solved, and the performance of system operation is effectively guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, and in particular to a data encryption method, a data decryption method, a data encryption device, a data decryption device, an electronic device, a computer-readable storage medium, and a computer program product. Background Technology

[0002] When different systems exchange information over a network, transmission in plaintext or with simple encryption is easily intercepted and spread across the network. Therefore, security issues such as preventing data leakage and tampering need to be considered from a distrust perspective. The encryption strength of existing data encryption methods increases with the length of the key used. On the one hand, longer key lengths lead to longer encryption and decryption times, making a balance difficult. On the other hand, with advancements in cryptographic techniques and computing power, the difficulty of cracking existing data encryption schemes is constantly decreasing, leading to an increasing number of security threats.

[0003] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0004] The purpose of this disclosure is to provide a data encryption method, a data encryption device, a data decryption method, a data encryption device, a data decryption device, an electronic device, a computer-readable storage medium, and a computer program product, which at least to some extent overcome the problem of the inability to simultaneously achieve encryption security and system performance in related technologies.

[0005] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.

[0006] According to one aspect of this disclosure, a data encryption method is provided, applied at a sending end, comprising: performing multi-level encryption concatenation processing on plaintext data to obtain an encryption string and an encryption key, wherein the key for decrypting the encryption string is encrypted to obtain the encryption key; performing obfuscation processing on the encryption string to obtain obfuscated ciphertext; performing digital signature processing on the obfuscated ciphertext to obtain a signature string; generating target encrypted data based on the obfuscated ciphertext, the signature string, the encryption key, and processing parameters of the obfuscation processing, and sending the target encrypted data to a receiving end.

[0007] In one embodiment of this disclosure, plaintext data is subjected to multi-level encryption concatenation processing to obtain an encrypted string, including: adding a pre-generated random number to the plaintext data to form merged data; segmenting the merged data based on a segmentation algorithm to obtain multiple segmented data; concatenating and encrypting the multiple segmented data based on a progressive encryption method to obtain an initial encrypted string; and performing concatenated encryption processing on the initial encrypted string to obtain the encrypted string.

[0008] In one embodiment of this disclosure, the multi-segment segmented data is concatenated and encrypted using a progressive encryption method to obtain an initial encrypted string. This includes: for a first segment of the multi-segment segmented data, encrypting the random number and the first segment of the segmented data to obtain a first encrypted segment; for a second segment of the multi-segment segmented data, encrypting the first encrypted segment, the second segment of the segmented data, and the random number to obtain a second encrypted segment; and for other segments of the multi-segment segmented data, progressively encrypting them based on the previous encrypted segment and the random number until the last segment of the segmented data is reached to obtain the initial encrypted string.

[0009] In one embodiment of this disclosure, the initial encryption string is subjected to concatenated encryption to obtain the encryption string, which includes: performing multi-level encryption on the initial encryption string and the random number based on a preset number of encryption attempts to obtain the encryption string.

[0010] In one embodiment of this disclosure, the multi-level encryption connection processing of plaintext data further includes: performing the multi-level encryption processing based on a symmetric encryption algorithm; and encrypting the key used to decrypt the encryption string to obtain the encryption key, including: encrypting the key of the symmetric encryption algorithm based on the public key of the asymmetric encryption algorithm to obtain the encryption key.

[0011] In one embodiment of this disclosure, obfuscating the encrypted string to obtain obfuscated ciphertext includes: performing a first obfuscation on the encrypted string to obtain a first processed ciphertext, and calculating a checksum of the first processed ciphertext; performing a second obfuscation on the first processed ciphertext based on the checksum to obtain a second processed ciphertext, which serves as the obfuscated ciphertext.

[0012] In one embodiment of this disclosure, the encrypted string is subjected to a first obfuscation process to obtain a first processed ciphertext, and a checksum of the first processed ciphertext is calculated. This includes: performing a misalignment process on the encrypted string according to a misalignment rule to obtain the first processed ciphertext; concatenating a pre-generated random number with the first processed ciphertext to obtain a concatenated ciphertext; and calculating the cyclic redundancy check (CRC) code of the concatenated ciphertext based on a CRC algorithm, using it as the checksum of the first processed ciphertext. The processing parameters of the first obfuscation process include the parameters of the misalignment process.

[0013] In one embodiment of this disclosure, the first processed ciphertext is subjected to a second obfuscation process based on the check code to obtain a second processed ciphertext, including: performing a remainder calculation with the first processed ciphertext as the denominator and the check code as the numerator to obtain a remainder; and performing a scrambling operation on the first processed ciphertext based on the length value of the remainder to obtain the second processed ciphertext, wherein the processing parameters of the second obfuscation process include the length value of the remainder.

[0014] In one embodiment of this disclosure, generating target encrypted data based on the obfuscated ciphertext, the signature string, the encryption key, and the processing parameters of the obfuscation process includes: generating the target encrypted data based on the obfuscated ciphertext, the signature string, the encryption key, the processing parameters of the obfuscation process, the pre-generated random number used, the remainder, and the corresponding position information.

[0015] In one embodiment of this disclosure, digitally signing the obfuscated ciphertext to obtain a signature string includes: digitally signing the obfuscated ciphertext and a pre-generated random number based on a private key to obtain the signature string.

[0016] According to another aspect of this disclosure, a data decryption method is provided, applied at a receiving end, comprising: in response to acquired target encrypted data, extracting obfuscated ciphertext, a signature string, an encryption key, and obfuscation processing parameters from the target encrypted data; decrypting the encryption key to obtain a decryption key; restoring the obfuscated ciphertext to an encrypted string based on the obfuscation processing parameters; performing multi-level decryption segmentation processing on the encrypted string based on the decryption key to obtain plaintext data; and verifying the plaintext data based on the signature string.

[0017] In one embodiment of this disclosure, restoring the obfuscated ciphertext to an encrypted string based on the obfuscation processing parameters includes: the target encrypted data further includes a remainder, the obfuscation processing parameters include the length value of the remainder, and the obfuscated ciphertext includes a second processed ciphertext; based on the length value of the remainder, the second processed ciphertext is restored by scrambling to obtain a first processed ciphertext; the obfuscation processing parameters further include misalignment processing parameters, and the first processed ciphertext is restored by misalignment based on the misalignment processing parameters to obtain the encrypted string.

[0018] In one embodiment of this disclosure, the encrypted string is subjected to multi-level decryption and segmentation processing based on the decryption key to obtain plaintext data, including: performing concatenated decryption processing on the encrypted string based on the decryption key to obtain an initial encrypted string; segmenting and decrypting the initial encrypted string based on the decryption key in a descending decryption manner to obtain multiple segmented data; and merging the multiple segmented data to obtain the plaintext data.

[0019] In one embodiment of this disclosure, in response to the acquired target encrypted data, the obfuscated ciphertext, the signature string, the encryption key, and the obfuscation processing parameters are extracted from the target encrypted data, including: in response to the acquired target encrypted data, extracting corresponding location information; and extracting the obfuscated ciphertext, the signature string, the encryption key, and the obfuscation processing parameters based on the corresponding location information.

[0020] According to another aspect of this disclosure, a data encryption device is provided, comprising: an encryption module for performing multi-level encryption concatenation processing on plaintext data to obtain an encryption string and an encryption key, wherein the encryption key is obtained by encrypting the key used to decrypt the encryption string; an obfuscation processing module for obfuscating the encryption string to obtain obfuscated ciphertext; a signature module for digitally signing the obfuscated ciphertext to obtain a signature string; and a generation module for generating target encrypted data based on the obfuscated ciphertext, the signature string, the encryption key, and the processing parameters of the obfuscation processing, and sending the target encrypted data to a receiving end.

[0021] According to another aspect of this disclosure, a data decryption apparatus is provided, comprising: an extraction module, configured to extract obfuscated ciphertext, a signature string, an encryption key, and obfuscation processing parameters from the acquired target encrypted data, respectively; a first decryption module, configured to decrypt the encryption key to obtain a decryption key; a restoration module, configured to restore the obfuscated ciphertext to an encrypted string based on the obfuscation processing parameters; a second decryption module, configured to perform multi-level decryption segmentation processing on the encrypted string based on the decryption key to obtain plaintext data; and a verification module, configured to verify the plaintext data based on the signature string.

[0022] According to another aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; the processor being configured to perform the above-described data encryption method or data decryption method by executing the executable instructions.

[0023] According to another aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the above-described data encryption method or data decryption method.

[0024] According to another aspect of this disclosure, a computer program product is provided, on which a computer program is stored, which, when executed by a processor, implements the above-described data encryption method or data decryption method.

[0025] The data encryption and decryption scheme provided in the embodiments of this disclosure obtains an encrypted string by performing multi-level encryption concatenation processing on the plaintext data to be encrypted, and then further obfuscates the encrypted string to obtain obfuscated ciphertext. The obfuscated ciphertext, signature string, encryption key and other processing parameters are combined to generate target encrypted data. These data undergo multiple encryption, obfuscation and signature processing to ensure the security and integrity of the data. This not only solves the problem of insufficient security of simple asymmetric encryption signature, but also effectively ensures the performance of system operation.

[0026] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0027] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0028] Figure 1 This diagram illustrates a data encryption system according to an embodiment of the present disclosure;

[0029] Figure 2 This diagram illustrates a data encryption method according to an embodiment of the present disclosure;

[0030] Figure 3 This diagram illustrates another data encryption method according to an embodiment of the present disclosure.

[0031] Figure 4 This diagram illustrates a flowchart of yet another data encryption method according to an embodiment of the present disclosure;

[0032] Figure 5 This illustration shows a flowchart of yet another data encryption method according to an embodiment of the present disclosure;

[0033] Figure 6 This illustration shows a flowchart of yet another data encryption method according to an embodiment of the present disclosure;

[0034] Figure 7 This diagram illustrates a data decryption method according to an embodiment of the present disclosure;

[0035] Figure 8 This illustration shows a flowchart of a data decryption method according to an embodiment of the present disclosure;

[0036] Figure 9 This diagram illustrates a data encryption device according to an embodiment of the present disclosure;

[0037] Figure 10 This diagram illustrates a data decryption apparatus according to an embodiment of the present disclosure.

[0038] Figure 11 A block diagram of a network system according to an embodiment of this disclosure is shown. Detailed Implementation

[0039] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that this disclosure will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0040] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0041] When different systems exchange data through communication networks, security issues such as preventing data leakage and tampering always need to be considered from a perspective of limited trust. Digital encryption technology is used to solve the problems of data leakage and data tampering, ensuring data privacy, integrity, and consistency.

[0042] RSA asymmetric encryption is one of many algorithms used to implement digital encryption and signature technologies. Its security strength increases with key length, but longer keys also increase encryption and decryption time. Therefore, a comprehensive consideration is needed, especially for systems with high user awareness, considering the sensitivity of the data to be protected, the cost of cracking it, and the required response time of the system. Furthermore, with the rapid development of cryptographic techniques and computing power, the difficulty of cracking the RSA algorithm is constantly decreasing, leading to increasing security threats to systems using RSA.

[0043] The solution provided in this application obtains an encrypted string by performing multi-level encryption concatenation on the plaintext data to be encrypted, and then further obfuscates the encrypted string to obtain obfuscated ciphertext. The obfuscated ciphertext, signature string, encryption key, and other processing parameters are then combined to generate the target encrypted data. These data undergo multiple encryption, obfuscation, and signature processes, ensuring the security and integrity of the data. This not only solves the problem of insufficient security of simple asymmetric encryption signatures, but also effectively guarantees the performance of the system.

[0044] Figure 1 This is a schematic diagram of the structure of a computer system provided in an exemplary embodiment of this application. The system includes: a plurality of terminals 120 and a server cluster 140.

[0045] Terminal 120 can be a mobile terminal such as a mobile phone, game console, tablet computer, e-book reader, smart glasses, MP4 (Moving Picture Experts Group Audio Layer IV) player, smart home device, AR (Augmented Reality) device, VR (Virtual Reality) device, etc. Alternatively, terminal 120 can also be a personal computer (PC), such as a laptop computer and a desktop computer, etc.

[0046] The terminal 120 may contain an application for providing data encryption.

[0047] Terminal 120 is connected to server cluster 140 via a communication network. Optionally, the communication network can be a wired network or a wireless network.

[0048] Server cluster 140 may be a single server, a combination of several servers, a virtualization platform, or a cloud computing service center. Server cluster 140 provides backend services for applications that provide statistics on service products. Optionally, server cluster 140 undertakes the primary computing task, and terminal 120 undertakes the secondary computing task; or, server cluster 140 undertakes the secondary computing task, and terminal 120 undertakes the primary computing task; or, terminal 120 and server cluster 140 collaborate on computing using a distributed computing architecture.

[0049] In some alternative embodiments, one of the server cluster 140 and the terminal 120 is used to store data encryption program information, and the other is used to store data decryption program.

[0050] In some alternative embodiments, one terminal 120 is used to store data encryption program information, and another terminal 120 is used to store data decryption program.

[0051] In some alternative embodiments, one of the server clusters 140 is used to store data encryption program information, and another is used to store data decryption program.

[0052] Optionally, the application clients installed on different terminals 120 may be the same, or the application clients installed on two terminals 120 may be clients of the same type of application on different control system platforms. Depending on the terminal platform, the specific form of the application client may also differ; for example, the application client may be a mobile client, a PC client, or a World Wide Web (WWW) client.

[0053] Those skilled in the art will understand that the number of terminals 120 described above can be more or less. For example, there may be only one terminal, or there may be dozens or hundreds of terminals, or even more. This application does not limit the number of terminals or the type of device.

[0054] Optionally, the system may also include a management device ( Figure 1 (Not shown), the management device is connected to the server cluster 140 via a communication network. Optionally, the communication network can be a wired network or a wireless network.

[0055] Optionally, the aforementioned wireless or wired networks use standard communication technologies and / or protocols. The network is typically the Internet, but can also be any network, including but not limited to Local Area Networks (LANs), Metropolitan Area Networks (MANs), Wide Area Networks (WANs), mobile, wired or wireless networks, private networks, or any combination of virtual private networks. In some embodiments, technologies and / or formats including Hyper Text Markup Language (HTML), Extensible Markup Language (XML), etc., are used to represent data exchanged over the network. Furthermore, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Networks (VPNs), and Internet Protocol Security (IPsec) can be used to encrypt all or some links. In other embodiments, custom and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.

[0056] To facilitate understanding, the following is an explanation of several terms used in this application.

[0057] SM2 is an elliptic curve public-key cryptography algorithm, and SM2 is an asymmetric encryption algorithm.

[0058] SM4 is a standard packet data algorithm for wireless local area networks (WLANs). It is a symmetric encryption algorithm with a key length and block length of 128 bits.

[0059] CRC32 (Cyclic Redundancy Check) is a commonly used check algorithm used to detect errors during data transmission or storage. It calculates a 32-bit check value by performing polynomial division on the data. The receiving end recalculates the check value and compares it with the check value at the sending end to determine whether the data has changed or is erroneous.

[0060] The following will describe in more detail the steps of the data encryption method in this example embodiment with reference to the accompanying drawings and embodiments.

[0061] Figure 2 A flowchart of a data encryption method according to an embodiment of this disclosure is shown.

[0062] like Figure 2 As shown, a data encryption method according to an embodiment of this disclosure includes:

[0063] Step S202 involves performing multi-level encryption concatenation processing on the plaintext data to obtain an encryption string and an encryption key. The key used to decrypt the encryption string is then encrypted to obtain the encryption key.

[0064] In some embodiments, multi-level encrypted connection processing refers to cascading encryption processing, that is, firstly, a portion of the data is encrypted at the first level, and then the encrypted data is combined with the unencrypted data for encryption processing again, and so on, until the connection processing of all plaintext data is completed.

[0065] In some embodiments, multi-level encrypted connection processing can employ different encryption algorithms and keys to perform multiple encryption operations to enhance data security.

[0066] In some embodiments, multi-level encrypted connection processing can be performed multiple times using the same encryption algorithm and key to reduce encryption and decryption time while ensuring encryption and decryption security.

[0067] In some embodiments, the SM4 algorithm is used for multi-level encryption.

[0068] In some embodiments, by encrypting layer by layer, an encrypted string can be generated, and an encryption key for decrypting the encrypted string can be generated.

[0069] In some embodiments, the key is the key used by the SM4 algorithm, and the SM2 algorithm is used to encrypt the key to obtain the encryption key.

[0070] Step S204: Obfuscate the encrypted string to obtain obfuscated ciphertext.

[0071] Step S206: Digitally sign the obfuscated ciphertext to obtain a signature string.

[0072] In some embodiments, digitally signing obfuscated ciphertext is used to verify the authenticity and integrity of the data. The digital signature uses a private key to sign the data, and the receiving end can use the corresponding public key to verify whether the signature of the data is valid.

[0073] Step S208: Generate target encrypted data based on the obfuscated ciphertext, signature string, encryption key, and obfuscation processing parameters, and send the target encrypted data to the receiving end.

[0074] Among them, the obfuscated ciphertext is the encrypted ciphertext, the signature string is used for verification, the encryption key decrypts the encrypted ciphertext, and the obfuscation processing parameters are used to restore the obfuscated ciphertext at the receiving end.

[0075] In this embodiment, an encrypted string is obtained by performing multi-level encryption concatenation on the plaintext data to be encrypted, and the encrypted string is further obfuscated to obtain obfuscated ciphertext. The obfuscated ciphertext, signature string, encryption key and other processing parameters are then combined to generate the target encrypted data. These data undergo multiple encryption, obfuscation and signature processes, ensuring the security and integrity of the data. This not only solves the problem of insufficient security of simple asymmetric encryption signature, but also effectively ensures the performance of the system.

[0076] In some embodiments, obfuscating the encrypted string to obtain obfuscated ciphertext includes: performing a first obfuscation on the encrypted string to obtain a first processed ciphertext, and calculating a checksum of the first processed ciphertext.

[0077] In some embodiments, obfuscation processing includes, but is not limited to, data misalignment processing, data disorder processing, data steganography processing, data obfuscation, data conversion, XOR operation, and other operations.

[0078] In some embodiments, the encryption string is first obfuscated to increase the complexity and security of the data.

[0079] In some embodiments, a checksum of the first processed ciphertext is calculated to ensure data integrity and accuracy.

[0080] In some embodiments, the first processed ciphertext is subjected to a second obfuscation process based on the check code to obtain a second processed ciphertext.

[0081] In some embodiments, a second obfuscation process is performed based on the checksum of the first processed ciphertext to further increase the obfuscation level and security of the data, and to generate a second processed ciphertext.

[0082] In some embodiments, the first obfuscation process is a misalignment process, and the second obfuscation process is a disordered order process.

[0083] like Figure 3 As shown, in one embodiment of this disclosure, plaintext data undergoes multi-level encryption concatenation processing to obtain an encrypted string, including:

[0084] Step S302: Add the pre-generated random number to the plaintext data to form merged data.

[0085] First, a set of random numbers is generated. Then, these random numbers are merged with the original plaintext data to form new merged data. By adding random numbers, the security of the data is effectively improved and the difficulty of cracking is increased.

[0086] In some embodiments, the same random number can be used in multiple steps that use random numbers, or different random numbers can be used in each step.

[0087] Step S304: The merged data is segmented based on a segmentation algorithm to obtain multiple segments of segmented data.

[0088] The merged data will be segmented according to a set segmentation algorithm to obtain multiple fragmented data blocks, each of which is called a segmented data.

[0089] In some embodiments, the segmentation algorithm includes, but is not limited to, adaptive segmentation algorithm, threshold-based segmentation algorithm, window-based segmentation algorithm, and feature point-based segmentation algorithm.

[0090] Step S306: Connect and encrypt the multi-segment data based on progressive encryption to obtain the initial encrypted string.

[0091] In this process, multiple data segments will be encrypted sequentially in a progressive manner, meaning that the encryption result of the previous data block will be used as the input for the encryption of the next data block, until all data segments are encrypted and an initial encrypted string is obtained.

[0092] Step S308: Perform concatenation encryption on the initial encrypted string to obtain an encrypted string.

[0093] The initial encrypted string will be further encrypted using a multi-layered encryption algorithm or multiple encryption process to obtain the final encrypted string.

[0094] In this embodiment, by adding random numbers and implementing multiple protection measures such as segmentation, progressive encryption, and cascaded encryption, the security of the data is effectively improved, the difficulty of cracking is increased, and the risk of data leakage is reduced. The use of progressive encryption and cascaded encryption makes the encryption process more complex, increases resistance to malicious attacks, and improves the security of the system.

[0095] like Figure 4 As shown, in one embodiment of this disclosure, multiple segments of segmented data are concatenated and encrypted using a progressive encryption method to obtain an initial encrypted string, including:

[0096] Step S402: For the first segment of the multi-segment data, encrypt the random number and the first segment of the data to obtain the first encrypted segment.

[0097] First, a random number is selected, and then this random number is encrypted with the first segment of data to generate the first encrypted segment.

[0098] Step S404: For the second segment of multi-segment data, encrypt the first encrypted segment, the second segment of data, and the random number to obtain the second encrypted segment.

[0099] In this process, the first encrypted segment, the second segment of data, and the previously used random number are all simultaneously used in the encryption operation to generate the second encrypted segment.

[0100] Step S406: For other segments of the multi-segment data, encrypt them sequentially based on the previous encrypted segment and the random number until the last segment is reached, and obtain the initial encrypted string.

[0101] The previous encrypted segment and the random number are used as the encryption input for the current segment of data. The encryption operation is performed sequentially until all the segmented data is processed and the initial encrypted string is obtained.

[0102] In some embodiments, the progressive encryption process may employ the SM4 algorithm for encryption.

[0103] In this embodiment, the encryption process of the previous encrypted segment is applied to the encryption process of the next encrypted segment to achieve a progressive encryption of the multi-segment data formed by dividing plaintext data. After the encryption operation of the last segment of data is completed, an initial encrypted string containing all the previous segmented data can be obtained. The progressive encryption method is used to process each segment of data, so that the encryption of each data block depends on the previous encryption result, which increases the security of data transmission. Furthermore, since each segment of data undergoes multiple layers of encryption processing, it helps to ensure the integrity of data during transmission and storage, and prevents data tampering and damage.

[0104] In one embodiment of this disclosure, the initial encryption string is subjected to concatenated encryption to obtain an encrypted string, including: performing multi-level encryption on the initial encryption string and a random number based on a preset number of encryption attempts to obtain the encrypted string.

[0105] The encryption count represents the number of concatenated encryption operations to be performed on the initial encryption string and the random number. The initial encryption string and the random number are used as initial input for the first encryption operation, yielding the first encryption result. This result is then used again with the random number as input for the second encryption operation, and so on, until the preset number of encryption operations is reached. After multiple concatenated encryption operations, the final encryption string is obtained.

[0106] In this embodiment, multiple cascaded encryptions increase the complexity and depth of encryption, thereby improving the ability to resist attacks without increasing the difficulty of decryption, and thus increasing the security of data transmission.

[0107] In one embodiment of this disclosure, the multi-level encryption connection processing of plaintext data further includes: performing multi-level encryption processing based on a symmetric encryption algorithm.

[0108] In some embodiments, the asymmetric encryption algorithm is the SM4 algorithm.

[0109] The encryption key is obtained by encrypting the key used to decrypt the encrypted string, including: encrypting the key of the symmetric encryption algorithm with the public key of the asymmetric encryption algorithm to obtain the encryption key.

[0110] In some embodiments, the asymmetric encryption algorithm is the SM2 algorithm.

[0111] In this embodiment, encryption is performed using the SM2 and SM4 algorithms, resulting in better encryption performance and more secure encrypted data.

[0112] like Figure 5 As shown, in one embodiment of this disclosure, the encrypted string undergoes a first obfuscation process to obtain a first processed ciphertext, and a checksum of the first processed ciphertext is calculated, including:

[0113] Step S502: The encrypted string is misaligned according to the misalignment rules to obtain the first processed ciphertext.

[0114] The first obfuscation process is misalignment. By rearranging the positions of the data, the original order of the data is disrupted, increasing its complexity and difficulty of understanding. Misalignment effectively improves data security and confidentiality.

[0115] Step S504: Concatenate the pre-generated random number with the first processed ciphertext to obtain the concatenated ciphertext.

[0116] In this process, a pre-generated random number is concatenated with the first processed ciphertext, which has undergone misalignment processing. The concatenated ciphertext is formed by combining the random number and the first processed ciphertext. This method makes the encryption result more random, increases the difficulty of cracking, and improves data security.

[0117] Step S506: Calculate the cyclic redundancy check code of the concatenated ciphertext based on the cyclic redundancy check algorithm, and use it as the check code of the first processed ciphertext. The processing parameters of the first obfuscation process include the parameters of the misalignment processing.

[0118] In some embodiments, a purely digital Cyclic Redundancy Check (CRC) code is obtained using the CRC32 algorithm. A CRC code is a verification method used to detect errors during data transmission or storage. It calculates a check code from the data and appends it to the data for verification at the receiving end. The CRC algorithm effectively detects whether errors or tampering have occurred during the transmission or storage of concatenated ciphertext, ensuring data integrity and reliability.

[0119] In this embodiment, the degree of data obfuscation is increased through misalignment processing and splicing operations, thereby protecting the privacy and security of the data.

[0120] In one embodiment of this disclosure, digitally signing the obfuscated ciphertext to obtain a signature string includes: digitally signing the obfuscated ciphertext and a pre-generated random number based on a private key to obtain a signature string.

[0121] In this embodiment, a public key and a private key pair are first generated. Then, the obfuscated ciphertext and a pre-generated random number are used as inputs, and the private key is used to perform digital signature calculation. Finally, a digital signature string is obtained. During the verification phase, the receiver can use the sender's public key to verify the signature string, ensuring the integrity and authenticity of the data.

[0122] In one embodiment of this disclosure, the first processed ciphertext is subjected to a second obfuscation process based on a checksum to obtain a second processed ciphertext, including:

[0123] The second obfuscation process is a disordered processing, which uses the first-processed ciphertext as the denominator and the check code as the numerator to perform a remainder calculation.

[0124] The first processed ciphertext is scrambled based on the length value of the remainder to obtain the second processed ciphertext, wherein the processing parameters of the second obfuscation process include the length value of the remainder.

[0125] In some embodiments, the first processed ciphertext is shuffled based on the length value of the remainder, that is, the original data is rearranged according to certain rules to obtain the second processed ciphertext.

[0126] In this embodiment, the verification code and modulo operation can be used to verify whether the data has been tampered with during transmission. The out-of-order processing changes the order of the first processed ciphertext, thereby increasing the complexity and incomprehensibility of the data, and further improving transmission security.

[0127] In one embodiment of this disclosure, generating target encrypted data based on obfuscated ciphertext, signature string, encryption key, and obfuscation processing parameters includes: generating target encrypted data based on obfuscated ciphertext, signature string, encryption key, obfuscation processing parameters, pre-generated random number, remainder, and corresponding position information.

[0128] In some embodiments, the target encrypted data may also include the location information of each of the aforementioned data.

[0129] like Figure 6 As shown, a data encryption method according to another embodiment of this disclosure, applied to a server, includes:

[0130] In step S602, the server generates two random numbers R1 and R2, a symmetric encryption key M1, and the number of encryption attempts C according to preset rules.

[0131] Step S604: Merge the plaintext data with at least one of the random numbers, and segment the data according to the segmentation algorithm to obtain multiple segmented data N1 to Nn.

[0132] Step S606: Encrypt M1 using an asymmetric encryption public key to obtain the encryption key Cm.

[0133] The asymmetric encryption uses the SM2 algorithm.

[0134] Step S608: The random number is merged with the segmented data N1, and an encryption string CR1 is generated using a symmetric encryption algorithm. Then, CR1+N2+R1 is used to generate the encryption string CR2. This process is repeated to perform segmented encryption, resulting in the initial encryption string CRn.

[0135] The symmetric encryption algorithm used is the SM4 algorithm.

[0136] Step S610: Concatenate encryption of CRn+R2 to obtain the encrypted string CRnc.

[0137] Step S612: The encrypted string CRnc is misaligned according to a preset rule to obtain the first processed ciphertext CRnc-K.

[0138] Step S614: Concatenate the random number R1 and the ciphertext CRnc-K in sequence, and obtain a pure digital cyclic redundancy check code using the CRC32 algorithm.

[0139] Step S616: Using the first processed ciphertext CRnc-K as the denominator and the check code as the numerator, perform a remainder operation to obtain the remainder L1.

[0140] Step S618: Based on the length value of L1, the first processed ciphertext CRnc-K is reordered to obtain the second processed ciphertext CRnc-L.

[0141] Step S620: Use the server's private key to digitally sign the ciphertext CRnc-L and the random number R1 to obtain the signature string S1.

[0142] Step S622: Combine the random numbers R1 and R2, the hexadecimal value of the ciphertext CRnc-L, the ciphertext CRnc-L, the remainder L1, the encryption key Cm, and the signature string S1 and send them to the client.

[0143] In this embodiment, the server first segments the plaintext data according to a predefined rule using a segmentation algorithm. Then, it uses the symmetric algorithm SM4 to encrypt and concatenate the segmented data. The final encrypted ciphertext is then misaligned according to a predefined rule. The key of the symmetric algorithm SM4 is encrypted using the asymmetric encryption algorithm SM2 and then scrambled. The encrypted string and random number are then signed using a national cryptographic algorithm. The signature string length and random number are then merged using the CRC32 redundancy algorithm to obtain the index value. The signature string is then scrambled using the index value. Finally, the encryption, signature, random number, and bit information from the predefined rule are merged and transmitted. This double-layer encryption using the digital encryption signature algorithm SM2 and the encryption algorithm SM4, along with data segmentation, progressive encryption, and encryption string obfuscation, and the introduction of the CRC32 algorithm to scramble the encrypted string, is followed by a national cryptographic digital signature. This approach solves the security problem of simple asymmetric encryption signatures while effectively ensuring system performance.

[0144] like Figure 7 As shown, a data decryption method according to an embodiment of this disclosure, applied at a receiving end, includes:

[0145] Step S702: In response to the acquired target encrypted data, the obfuscated ciphertext, signature string, encryption key, and obfuscation processing parameters are extracted from the target encrypted data.

[0146] Step S704: Decrypt the encryption key to obtain the decryption key.

[0147] In some embodiments, the encryption key is decrypted using the private key of the SM2 algorithm to obtain the decryption key.

[0148] Step S706: Based on the processing parameters of the obfuscation process, restore the obfuscated ciphertext to the encrypted string.

[0149] In some embodiments, the obfuscated ciphertext, i.e. the second processed ciphertext, is first restored to the first processed ciphertext using the parameters of the obfuscation process, and then the first processed ciphertext is restored to the encrypted string.

[0150] Step S708: Perform multi-level decryption and segmentation processing on the encrypted string based on the decryption key to obtain plaintext data.

[0151] The encrypted string is decrypted using a decryption key, and plaintext data is obtained by decrypting layer by layer.

[0152] Step S710: Verify the plaintext data based on the signature string.

[0153] Among them, plaintext data is verified based on the signature string to ensure that the data has not been tampered with or damaged during transmission and processing, thereby improving the integrity and reliability of the data.

[0154] In this embodiment, by extracting necessary information from the target encrypted data, decrypting the encryption key to obtain the decryption key, restoring the encrypted string before obfuscation based on the parameters of the obfuscation process, decrypting the encrypted string based on the decryption key, and finally verifying the plaintext data based on the signature string, the secure transmission, decryption processing, and integrity verification of the data can be effectively guaranteed, and the efficiency of the decryption process can be ensured.

[0155] In one embodiment of this disclosure, restoring the obfuscated ciphertext to an encrypted string based on obfuscation processing parameters includes: the target encrypted data further includes a remainder, the obfuscation processing parameters include the length value of the remainder, and the obfuscated ciphertext is a second processed ciphertext; based on the length value of the remainder, the second processed ciphertext is restored by reordering to obtain a first processed ciphertext; the obfuscation processing parameters further include misalignment processing parameters, and the first processed ciphertext is restored by misalignment based on the misalignment processing parameters to obtain an encrypted string.

[0156] In this embodiment, the parameters of the obfuscation process include the length value of the remainder. Based on the length value of the remainder, the second processed ciphertext is restored by scrambling to obtain the first processed ciphertext. The obfuscation process parameters also include the parameters of the misalignment process. Based on these parameters, the first processed ciphertext is restored by misalignment to finally obtain the encrypted string, thereby effectively realizing the restoration of encrypted data.

[0157] In one embodiment of this disclosure, the encrypted string is subjected to multi-level decryption and segmentation processing based on the decryption key to obtain plaintext data, including: performing concatenated decryption processing on the encrypted string based on the decryption key to obtain an initial encrypted string; segmenting and decrypting the initial encrypted string based on the decryption key in a descending decryption manner to obtain multiple segmented data; and merging the multiple segmented data to obtain plaintext data.

[0158] In this embodiment, the encrypted string is decrypted in a cascading manner using a decryption key, decrypting layer by layer until the initial encrypted string is restored. Based on the decryption key, the initial encrypted string is segmented and decrypted using a decreasing decryption method. Each segmentation and decryption operation yields a segment of data until multiple segments of data are obtained. Finally, the multiple segments of data are merged to ensure that the merged data is completely consistent with the original plaintext data, thus guaranteeing data integrity.

[0159] In one embodiment of this disclosure, in response to the acquired target encrypted data, the obfuscated ciphertext, signature string, encryption key, and obfuscation processing parameters are extracted from the target encrypted data, including: in response to the acquired target encrypted data, extracting corresponding location information; and extracting the obfuscated ciphertext, signature string, encryption key, and obfuscation processing parameters based on the corresponding location information.

[0160] like Figure 8 As shown, a data decryption method according to another embodiment of this disclosure, applied to a client, includes:

[0161] Step S802: Receive the target encrypted data and the location information of different information in the target encrypted data.

[0162] Step S804: Extract the second processed ciphertext and encryption key, as well as the parameters for obfuscation processing, from the target encrypted data.

[0163] Step S806: The parameters of the obfuscation process include the length value of the remainder. Based on the length value of the remainder, the second processed ciphertext is restored by scrambling to obtain the first processed ciphertext.

[0164] Step S808: The parameters for obfuscation processing also include parameters for misalignment processing. Based on the parameters for misalignment processing, the first processed ciphertext is restored to its original state to obtain the encrypted string.

[0165] Step S810: Perform concatenated decryption on the encrypted string based on the decryption key to obtain the initial encrypted string.

[0166] Step S812: Based on the decryption key, the initial encrypted string is segmented and decrypted using a decreasing decryption method to obtain multiple segments of data.

[0167] Step S814: Merge the multiple segments of data to obtain plaintext data.

[0168] Step S816: Verify the plaintext data based on the signature string.

[0169] Step S818: Verification passed, business operations are performed based on plaintext data.

[0170] Step S820: Verification failed, data discarded.

[0171] In this embodiment, the client first performs a forward-order operation on the out-of-order ciphertext and signature string to obtain the correct encryption key and signature string. Then, it decrypts the symmetric key encryption string using the asymmetric encryption private key to obtain the symmetric encryption key. Next, the encryption string can be decrypted in a cascaded and progressive manner to obtain the plaintext data. Finally, the signature string is verified.

[0172] It should be noted that the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may, for example, be executed synchronously or asynchronously in multiple modules.

[0173] The following reference Figure 9 The data encryption device 900 according to an embodiment of the present invention will be described. Figure 9 The data encryption device 900 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0174] The data encryption device 900 is manifested in the form of a hardware module. Components of the data encryption device 900 may include, but are not limited to: an encryption module 902, used to perform multi-level encryption concatenation processing on plaintext data to obtain an encryption string and an encryption key, wherein the key used to decrypt the encryption string is encrypted to obtain an encryption key; an obfuscation processing module 904, used to obfuscate the encryption string to obtain obfuscated ciphertext; a signature module 906, used to digitally sign the obfuscated ciphertext to obtain a signature string; and a generation module 908, used to generate target encrypted data based on the obfuscated ciphertext, the signature string, the encryption key, and the processing parameters of the obfuscation processing, and send the target encrypted data to the receiving end.

[0175] The following reference Figure 10 The data decryption apparatus 1000 according to an embodiment of the present invention will be described. Figure 10 The data decryption device 1000 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0176] The data decryption device 1000 is manifested as a hardware module. Components of the data decryption device 1000 may include, but are not limited to: an extraction module 1002, used to extract obfuscated ciphertext, a signature string, an encryption key, and obfuscation processing parameters from the acquired target encrypted data in response to the target encrypted data; a first decryption module 1004, used to decrypt the encryption key to obtain a decryption key; a restoration module 1006, used to restore the obfuscated ciphertext to an encrypted string based on the obfuscation processing parameters; a second decryption module 1008, used to perform multi-level decryption segmentation processing on the encrypted string based on the decryption key to obtain plaintext data; and a verification module 1010, used to verify the plaintext data based on the signature string.

[0177] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: entirely hardware implementations, entirely software implementations (including firmware, microcode, etc.), or implementations combining hardware and software aspects, collectively referred to herein as “circuits,” “modules,” or “systems.”

[0178] The following reference Figure 11 To describe an electronic device 1100 according to this embodiment of the present invention. Figure 11 The electronic device 1100 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0179] like Figure 11 As shown, the electronic device 1100 is manifested in the form of a general-purpose computing device. The components of the electronic device 1100 may include, but are not limited to: at least one processing unit 1110, at least one storage unit 1120, and a bus 1130 connecting different system components (including storage unit 1120 and processing unit 1110).

[0180] The storage unit stores program code that can be executed by the processing unit 1110, causing the processing unit 1110 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 1110 can perform actions such as... Figure 2 The scheme described in steps S202 to S210 shown.

[0181] Storage unit 1120 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 11201 and / or cache memory 11202, and may further include a read-only memory (ROM) 11203.

[0182] Storage unit 1120 may also include a program / utility 11204 having a set (at least one) of program modules 11205, such program modules 11205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0183] Bus 1130 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0184] Electronic device 1100 can also communicate with one or more external devices 1170 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 1100, and / or with any device that enables electronic device 1100 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 1150. Furthermore, electronic device 1100 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1160. As shown, network adapter 1160 communicates with other modules of electronic device 1100 via bus 1130. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0185] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or electronic device, etc.) to execute the methods according to the embodiments of this disclosure.

[0186] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the invention may also be implemented as a program product comprising program code that, when the program product is run on an electronic device, causes the electronic device to perform the steps of the various exemplary embodiments of the invention described in the "Exemplary Methods" section above.

[0187] According to embodiments of the present invention, a program product for implementing the above-described method may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on an electronic device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0188] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0189] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0190] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0191] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0192] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0193] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0194] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or electronic device, etc.) to execute the method according to the embodiments of this disclosure.

[0195] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the appended claims.

Claims

1. A data encryption method, characterized in that, Applied to the sending end, including: The plaintext data is subjected to multi-level encryption concatenation processing to obtain an encryption string and an encryption key, wherein the key for decrypting the encryption string is encrypted to obtain the encryption key; The process of obfuscating the encrypted string to obtain obfuscated ciphertext includes: performing misalignment processing on the encrypted string according to a misalignment rule to obtain a first processed ciphertext, and calculating the checksum of the first processed ciphertext; performing a remainder calculation with the first processed ciphertext as the denominator and the checksum of the first processed ciphertext as the numerator to obtain a remainder; and performing a scrambling operation on the first processed ciphertext based on the length value of the remainder to obtain a second processed ciphertext, which serves as the obfuscated ciphertext. The obfuscated ciphertext is digitally signed to obtain a signature string; Target encrypted data is generated based on the obfuscated ciphertext, the signature string, the encryption key, and the processing parameters of the obfuscation process, and the target encrypted data is sent to the receiving end.

2. The data encryption method according to claim 1, characterized in that, The plaintext data undergoes multi-level encryption concatenation to obtain an encrypted string, including: Pre-generated random numbers are added to the plaintext data to form merged data; The merged data is segmented based on a segmentation algorithm to obtain multiple segmented data. The multi-segment data is concatenated and encrypted using a progressive encryption method to obtain an initial encrypted string; The initial encrypted string is subjected to concatenated encryption to obtain the encrypted string.

3. The data encryption method according to claim 2, characterized in that, The multi-segment data is concatenated and encrypted using a progressive encryption method to obtain an initial encrypted string, including: For the first segment of the multi-segment segmented data, the random number and the first segment of segmented data are encrypted to obtain the first encrypted segment; For the second segment of the multi-segment segmented data, the first encrypted segment, the second segmented data, and the random number are encrypted to obtain the second encrypted segment. For other segments of the multi-segment data, encryption is performed sequentially based on the previous encrypted segment and the random number until the last segment is reached, thus obtaining the initial encrypted string.

4. The data encryption method according to claim 2, characterized in that, The initial encrypted string is subjected to concatenated encryption to obtain the encrypted string, which includes: Based on a preset number of encryption attempts, the initial encryption string and the random number are encrypted at multiple levels to obtain the encryption string.

5. The data encryption method according to claim 1, characterized in that, The multi-level encryption connection processing of plaintext data also includes: performing the multi-level encryption processing based on a symmetric encryption algorithm; The encryption key is obtained by encrypting the key used to decrypt the encryption string, including: encrypting the key of the symmetric encryption algorithm using the public key of the asymmetric encryption algorithm to obtain the encryption key.

6. The data encryption method according to claim 1, characterized in that, Calculating the checksum of the first processed ciphertext includes: The pre-generated random number is concatenated with the first processed ciphertext to obtain the concatenated ciphertext; The cyclic redundancy check (CRC) code of the concatenated ciphertext is calculated based on the CRC algorithm and used as the check code of the first processed ciphertext.

7. The data encryption method according to claim 1, characterized in that, Generate target encrypted data based on the obfuscated ciphertext, the signature string, the encryption key, and the processing parameters of the obfuscation process, including: The target encrypted data is generated based on the obfuscated ciphertext, the signature string, the encryption key, the obfuscation processing parameters, the pre-generated random number used, the remainder, and the corresponding position information.

8. The data encryption method according to any one of claims 1 to 7, characterized in that, The obfuscated ciphertext is digitally signed to obtain a signature string, which includes: The signature string is obtained by digitally signing the obfuscated ciphertext and the pre-generated random number based on the private key.

9. A data decryption method, characterized in that, Applied to the receiving end, including: In response to the acquired target encrypted data, the obfuscated ciphertext, signature string, encryption key, and obfuscation processing parameters are extracted from the target encrypted data respectively. The encryption key is decrypted to obtain the decryption key; The target encrypted data also includes a remainder, the parameters of the obfuscation process include the length value of the remainder, the obfuscated ciphertext includes a second processed ciphertext, and restoring the obfuscated ciphertext to an encrypted string based on the processing parameters of the obfuscation process includes: restoring the second processed ciphertext to a scrambled order based on the length value of the remainder to obtain a first processed ciphertext; the parameters of the obfuscation process also include parameters of the misalignment process, and restoring the first processed ciphertext to a misaligned order based on the parameters of the misalignment process to obtain the encrypted string; The encrypted string is subjected to multi-level decryption and segmentation based on the decryption key to obtain plaintext data; The plaintext data is verified based on the signature string.

10. The data decryption method according to claim 9, characterized in that, Based on the decryption key, the encrypted string is subjected to multi-level decryption and segmentation processing to obtain plaintext data, including: Based on the decryption key, the encrypted string is subjected to concatenated decryption to obtain the initial encrypted string; Based on the decryption key, the initial encrypted string is segmented and decrypted using a decreasing decryption method to obtain multiple segments of data. The multiple segments of data are merged to obtain the plaintext data.

11. The data decryption method according to claim 9 or 10, characterized in that, In response to the acquired target encrypted data, the obfuscated ciphertext, the signature string, the encryption key, and obfuscation processing parameters are extracted from the target encrypted data, including: In response to the acquired target encrypted data, the corresponding location information is extracted; Based on the corresponding location information, the obfuscated ciphertext, the signature string, the encryption key, and the obfuscation processing parameters are extracted respectively.

12. A data encryption device, characterized in that, Applied to the sending end, including: An encryption module is used to perform multi-level encryption connection processing on plaintext data to obtain an encryption string and an encryption key, wherein the encryption key is obtained by encrypting the key used to decrypt the encryption string. The obfuscation module is used to obfuscate the encrypted string to obtain obfuscated ciphertext, including: performing misalignment processing on the encrypted string according to the misalignment rule to obtain a first processed ciphertext, and calculating the checksum of the first processed ciphertext; performing a remainder calculation with the first processed ciphertext as the denominator and the checksum of the first processed ciphertext as the numerator; and performing a reordering operation on the first processed ciphertext based on the length value of the remainder to obtain a second processed ciphertext, which is used as the obfuscated ciphertext. The signature module is used to digitally sign the obfuscated ciphertext to obtain a signature string; The generation module is used to generate target encrypted data based on the obfuscated ciphertext, the signature string, the encryption key, and the processing parameters of the obfuscation process, and send the target encrypted data to the receiving end.

13. A data decryption device, characterized in that, Applied to the receiving end, including: The extraction module is used to extract the obfuscated ciphertext, signature string, encryption key, and obfuscation processing parameters from the acquired target encrypted data in response to the target encrypted data. The first decryption module is used to decrypt the encryption key to obtain the decryption key; The target encrypted data also includes a remainder, the parameters of the obfuscation processing include the length value of the remainder, the obfuscated ciphertext includes a second processed ciphertext, and the data decryption device further includes: a restoration module, used to restore the obfuscated ciphertext to an encrypted string based on the processing parameters of the obfuscation processing, including: restoring the second processed ciphertext in a random order based on the length value of the remainder to obtain a first processed ciphertext; the parameters of the obfuscation processing also include parameters of the misalignment processing, and restoring the first processed ciphertext in a misalignment based on the parameters of the misalignment processing to obtain the encrypted string; The second decryption module is used to perform multi-level decryption and segmentation processing on the encrypted string based on the decryption key to obtain plaintext data; The verification module is used to verify the plaintext data based on the signature string.

14. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the data encryption method of any one of claims 1 to 8 or the data decryption method of claims 9 to 11 by executing the executable instructions.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the data encryption method according to any one of claims 1 to 8 or the data decryption method according to claims 9 to 11.

16. A computer program product having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the data encryption method according to any one of claims 1 to 8 or the data decryption method according to claims 9 to 11.

Citation Information

Patent Citations

  • Encryption method and device, decryption method and device, electronic equipment and computer readable medium

    CN117294430A

  • Identity authentication method and electronic equipment

    CN117792765A