Encryption and decryption method of reserved format based on national secret ZUC algorithm and identifiable mechanism

By employing a format-preserving encryption method based on the national cryptographic ZUC algorithm and a distinguishable mechanism, the problem of existing data anonymization technologies failing to protect privacy and restore data is solved. This achieves an efficient and secure data encryption and decryption process, ensuring data format consistency.

CN120856470AActive Publication Date: 2025-10-28SHANDONG XINCHAO INFORMATION TECH CO LTD
View PDF 14 Cites 0 Cited by

Patent Information

Application Number
CN202511334136.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-18
Publication Date
2025-10-28
Estimated Expiration
2045-09-18

AI Technical Summary

Technical Problem

Existing data anonymization methods cannot effectively protect privacy information and cannot restore the data to its original form, resulting in significant limitations in application scenarios.

Method used

A format-preserving encryption method based on the ZUC algorithm and a distinguishable mechanism is adopted. The original data is split into independent fields to generate a mapping table and an inverse mapping table. The ZUC algorithm is used to generate a key stream for symmetric encryption, and the FPE technology is used to generate ciphertext that meets the format requirements. The 128-EIA3 algorithm is used for message authentication.

Benefits of technology

It reduces resource consumption in the encryption process, improves encryption efficiency, ensures that the ciphertext format is consistent with the plaintext, supports data format consistency requirements, and guarantees the security of personal sensitive information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120856470A_ABST
    Figure CN120856470A_ABST
Patent Text Reader

Abstract

The invention discloses a reserved format encryption and decryption method based on a national secret ZUC algorithm and an identifiable mechanism, and relates to the field of Chinese and English mixed reserved format encryption, and the method comprises the steps: carrying out the multi-field structured analysis of an original message space, generating a high-randomness key stream through the national secret ZUC algorithm, carrying out the symmetric encryption, and finally mapping a ciphertext back to the original message space. And the ciphertext format is completely consistent with the original text. The method has high security guarantee, is designed based on the correlation of fields in the format space, and designs a universal format-preserving encryption method and system. Personal sensitive information safety can be effectively guaranteed, and meanwhile the requirements of various databases for data format consistency are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of mixed Chinese and English format encryption, specifically to an encryption and decryption method based on the Chinese national cryptographic ZUC algorithm and a distinguishable mechanism for format encryption. Background Technology

[0002] Currently, commonly used data anonymization techniques include replacement, truncation, offsetting, encryption, masking, and rounding. These methods de-identify sensitive data from different dimensions, protecting privacy information to a certain extent. However, traditional data anonymization methods, on the one hand, are still based on real data, which can still leak some privacy information; on the other hand, they cannot be restored to real data, which greatly limits their application scenarios. Summary of the Invention

[0003] In order to overcome the shortcomings of the above technologies, this invention provides a method that can reduce the resource consumption of the format-preserving encryption and decryption process and improve encryption efficiency.

[0004] The technical solution adopted by this invention to overcome its technical problems is: A method for encryption and decryption based on the ZUC algorithm (Chinese national cryptographic standard) and a distinguishable mechanism, characterized in that it includes: A1. Obtaining raw data , the original data Split into An explicit text , For the first An explicit text, ; A2. Obtain the mapping table based on the fields. and inverse mapping table ; A3. According to the mapping table Get the first An explicit text Serial number ; A4. Using the ZUC algorithm, generate a keystream of the same length as the plaintext data based on the Key and IV in the ZUC algorithm. Through formula The symmetric ciphertext was calculated. In the formula This is a bitwise XOR operation; A5. Based on symmetric ciphertext Obtain message authentication code Passing the exam An explicit text FPE ciphertext ; A6. Will Concatenate the plaintext FPE ciphertext to obtain the FPE ciphertext. .

[0005] Furthermore, step A1 includes the following steps: A1-1. Transfer the original data Data format Split into Independent fields , For the first One field, ; A1-2. Transfer the original data Split according to the corresponding fields to obtain An explicit text .

[0006] Furthermore, step A2 includes the following steps: A2-1. [The following is a partial translation and can be left as is:] fields The corresponding message space name is defined as , No. fields The message space size is , , As a variable; A2-2. Use binary sort to sort the... An explicit text Elements from 1 to The sorting yields the first... Mapping table of plaintext and inverse mapping table .

[0007] Furthermore, step A3 includes the following steps: A3-1. The first An explicit text According to the mapping table Perform data mapping to obtain the first An explicit text In the mapping table Index number in ; A3-2. Using the formula Calculation yields the first An explicit text Serial number .

[0008] Furthermore, step A5 includes the following steps: A5-1. Through the formula The symmetric ciphertext was calculated. The index number corresponding to the original message space In the formula Modulo operation; A5-2. [The following appears to be a separate, unrelated section:] ...the first... An explicit text Serial number With input variables After the concatenation operation, the concatenation result, the Key in the 128-EIA3 algorithm, and the IV in the 128-EIA3 algorithm are used to calculate the message authentication code using the 128-EIA3 algorithm. ,variable The length is ; A5-3. Index number According to the inverse mapping table Perform mapping to obtain the first An explicit text In the reverse mapping table Index number in ; A5-4. Using the formula Calculation yields the first An explicit text FPE ciphertext .

[0009] A method for decrypting ciphertext, characterized by comprising: B1. Contain the FPE ciphertext Split into FPE ciphertext ; B2. Obtain the mapping table based on the fields. and inverse mapping table ; B3. According to the mapping table Obtain FPE ciphertext Corresponding serial number ; B4. According to the serial number Get the first An explicit text Serial number ; B5. Based on the inverse mapping table Get the first An explicit text ; B6. Will The plaintext is concatenated to obtain the original data. .

[0010] Furthermore, step B2 includes the following steps: B2-1. The first fields The corresponding message space name is defined as , No. fields The message space size is , , As a variable; B2-2. Use binary sort to sort the... An explicit text Elements from 1 to The sorting yields the first... Mapping table of plaintext and inverse mapping table .

[0011] Furthermore, step B3 includes the following steps: B3-1. The first An explicit text FPE ciphertext According to the mapping table Perform data mapping to obtain FPE ciphertext. In the mapping table Index number in ; B3-2. Through formula The FPE ciphertext was calculated. Corresponding serial number .

[0012] Furthermore, step B4 includes the following steps: B4-1. Using the ZUC algorithm, generate a keystream of the same length as the plaintext data based on the Key and IV in the ZUC algorithm. ; B4-2. Through formula Calculate the plaintext value In the formula For bitwise XOR operation, use the formula Calculate the plaintext value ; B4-3. Plaintext value With input variables After the concatenation operation, the concatenation result, the Key in the 128-EIA3 algorithm, and the IV in the 128-EIA3 algorithm are used to calculate the message authentication code using the 128-EIA3 algorithm. ; B4-4. Plaintext value With input variables After the concatenation operation, the concatenation result, the Key in the 128-EIA3 algorithm, and the IV in the 128-EIA3 algorithm are used to calculate the message authentication code using the 128-EIA3 algorithm. ; B4-5. When the message authentication code With message authentication code If they are equal, then the first... An explicit text Serial number When message authentication code With message authentication code If they are equal, then the first... An explicit text Serial number When message authentication code With message authentication code Not equal to and the message authentication code If they are not equal, then FPE ciphertext The message authentication code is deemed invalid. With message authentication code Equal to and the message authentication code If they are equal, then the FPE ciphertext is correct. It has been determined to be invalid.

[0013] Furthermore, step B5 includes the following steps: B5-1. Serial Number According to the inverse mapping table Perform a mapping to obtain its inverse mapping table. Index number in ; B5-2. Through formula Calculation yields the first An explicit text .

[0014] The beneficial effects of this invention are: by performing multi-field structured parsing on the original message space, generating a highly random key stream using the national cryptographic ZUC algorithm for symmetric encryption, and finally mapping the ciphertext back to the original message space, the ciphertext format is completely consistent with the original text. It offers high security, and is designed based on the correlation of fields in the format space, resulting in a general format-preserving encryption method and system. It can effectively guarantee the security of sensitive personal information while supporting the data format consistency requirements of various databases. Attached Figure Description

[0015] Figure 1 A schematic diagram illustrating the changes in the message space before and after symmetric encryption; Figure 2 This is a block diagram of the FPE system of the present invention; Figure 3 This is a flowchart of the FPE (Fragmented Execution Environment) encryption process of the present invention. Detailed Implementation

[0016] The following is in conjunction with the appendix Figure 1 Appendix Figure 2 Appendix Figure 3 The present invention will be further described below.

[0017] Format Preservation Encryption (FPE) is a special type of symmetric encryption technology. Its core characteristic is that it maintains complete consistency in the format (such as length, character type, and data structure) of the plaintext and ciphertext during the encryption process. The ciphertext and plaintext reside in the same message space, and the encryption process is reversible, allowing the original data to be recovered through decryption. FPE's various features make it particularly suitable for data anonymization, solving the problem that traditional data anonymization methods (such as masking, substitution, and hashing) may corrupt the data format, rendering the data unusable for direct testing and unable to be decrypted back to the original. Furthermore, FPE guarantees that encrypted data can be decrypted back to the original, making it highly suitable for scenarios requiring dynamic decryption.

[0018] The security goal of the FPE standard is PRP security, requiring attackers to be unable to distinguish the FPE scheme from random permutations within the message space. FPE technology is generally based on symmetric cryptographic algorithms, ensuring both algorithm confidentiality and relatively fast encryption speed. Traditional FPE technologies are typically based on block ciphers such as AES, SM4, or custom-designed Feistel ciphers. However, stream cipher algorithms like ZUC, with their lower computational complexity and simpler key management, are also suitable as the foundation for FPE.

[0019] The ZUC algorithm, also known as the Zu Chongzhi stream cipher algorithm, belongs to the synchronous stream cipher family and was the first Chinese cryptographic algorithm to be adopted as an international cryptographic standard. At the 3rd Generation Partnership Project (3GPP) meeting in September 2011, the Zu Chongzhi cryptographic algorithm (ZUC) designed in my country was approved as an international standard for the next-generation broadband wireless mobile communication system (LTE), i.e., the 4G international standard, and is widely used for secure data transmission in mobile communication networks.

[0020] Authenticable encryption is a cryptographic technique based on symmetric cryptography. It is used to achieve data confidentiality protection and provide data integrity and data source authentication. It includes two processes: encryption and decryption, and provides data confidentiality, data integrity and data source authentication.

[0021] Specifically, a method for encryption and decryption based on the ZUC algorithm (Chinese national cryptographic standard) and a verifiable mechanism, characterized by comprising: A1. Obtaining raw data , the original data Split into An explicit text , For the first An explicit text, .

[0022] A2. Obtain the mapping table based on the fields. and inverse mapping table .

[0023] A3. According to the mapping table Get the first An explicit text Serial number .

[0024] A4. Using the ZUC algorithm, generate a keystream of the same length as the plaintext data based on the Key and IV in the ZUC algorithm. Through formula The symmetric ciphertext was calculated. In the formula This is a bitwise XOR operation.

[0025] A5. Based on symmetric ciphertext Obtain message authentication code Passing the exam An explicit text FPE ciphertext .

[0026] A6. Will The plaintext FPE ciphertext is concatenated to obtain a complete FPE ciphertext that meets the format preservation requirements. .

[0027] Since FPE technology, as a type of encryption technology, inherently requires eliminating the correlation between data between fields, this invention, to avoid the potential mismatch between the message space after symmetric encryption and the original message space, treats independent fields and the non-independent fields affected by them as a single independent field, and then performs FPE encryption on each independent field independently.

[0028] In one embodiment of the present invention, step A1 includes the following steps: A1-1. Transfer the original data Data format Split into Independent fields , For the first One field, .

[0029] A1-2. Transfer the original data Split according to the corresponding fields to obtain An explicit text .

[0030] As attached Figure 1As shown, in one embodiment of the present invention, step A2 includes the following steps: A2-1. [The following is a partial translation and can be left as is:] fields The corresponding message space name is defined as , No. fields The message space size is , , For variables.

[0031] A2-2. Use binary sort to sort the... An explicit text Elements from 1 to The sorting yields the first... Mapping table of plaintext and inverse mapping table .

[0032] In one embodiment of the present invention, step A3 includes the following steps: A3-1. [The following is a partial translation and doesn't need a direct translation:] An explicit text According to the mapping table Perform data mapping to obtain the first An explicit text In the mapping table Index number in .

[0033] A3-2. Using the formula Calculate the first An explicit text Serial number .

[0034] As attached Figure 3 As shown, in one embodiment of the present invention, step A5 includes the following steps: A5-1. Symmetric ciphertext may not be in the original message space, therefore, the formula is used... The symmetric ciphertext was calculated. The index number corresponding to the original message space In the formula Modulo operation.

[0035] A5-2. Considering the limited length of plaintext, it is not suitable to use a hash function to generate it. Therefore, the present invention will... An explicit text Serial number With input variables After the concatenation operation, the concatenation result, the Key in the 128-EIA3 algorithm, and the IV in the 128-EIA3 algorithm are used to calculate the message authentication code using the 128-EIA3 algorithm. ,variable The length is Integrity protection is achieved using the 128-EIA3 algorithm based on the ZUC algorithm.

[0036] A5-3. Index number According to the inverse mapping table Perform mapping to obtain the first An explicit text In the reverse mapping table Index number in .

[0037] A5-4. Using the formula Calculate the first An explicit text FPE ciphertext .

[0038] A method for decrypting ciphertext, characterized by comprising: B1. Contain the FPE ciphertext Split into FPE ciphertext ; B2. Obtain the mapping table based on the fields. and inverse mapping table .

[0039] B3. According to the mapping table Obtain FPE ciphertext Corresponding serial number .

[0040] B4. According to the serial number Get the first An explicit text Serial number .

[0041] B5. Based on the inverse mapping table Get the first An explicit text .

[0042] B6. Will The plaintext is concatenated to obtain the correct, complete, and format-preserving original data. .

[0043] In one embodiment of the present invention, step B2 includes the following steps: B2-1. The first fields The corresponding message space name is defined as , No. fields The message space size is , , For variables.

[0044] B2-2. Use binary sort to sort the... An explicit text Elements from 1 to The sorting yields the first... Mapping table of plaintext and inverse mapping table .

[0045] In one embodiment of the present invention, step B3 includes the following steps: B3-1. The first An explicit text FPE ciphertext According to the mapping table Perform data mapping to obtain FPE ciphertext. In the mapping table Index number in .

[0046] B3-2. Through formula The FPE ciphertext was calculated. Corresponding serial number .

[0047] Because modular arithmetic is used in the encryption process, symmetric ciphertext exists. Message space and sequence number position The message spaces are not equal. Specifically, the value may correspond to the values ​​of two symmetric ciphertexts, leading to potentially incorrect decryption results. Therefore, this invention decrypts both symmetric ciphertexts and then uses a discriminative mechanism to authenticate them; the one that passes the authentication is the true plaintext. Specifically, in one embodiment of this invention, step B4 includes the following steps: B4-1. Using the ZUC algorithm, generate a keystream of the same length as the plaintext data based on the Key and IV in the ZUC algorithm. .

[0048] B4-2. Through formula Calculate the plaintext value In the formula For bitwise XOR operation, use the formula Calculate the plaintext value .

[0049] B4-3. Plaintext value With input variables After the concatenation operation, the concatenation result, the Key in the 128-EIA3 algorithm, and the IV in the 128-EIA3 algorithm are used to calculate the message authentication code using the 128-EIA3 algorithm. .

[0050] B4-4. Plaintext value With input variables After the concatenation operation, the concatenation result, the Key in the 128-EIA3 algorithm, and the IV in the 128-EIA3 algorithm are used to calculate the message authentication code using the 128-EIA3 algorithm. .

[0051] B4-5. When the message authentication code With message authentication code If they are equal, it means the plaintext value is equal to the plaintext value. If it is the correct plaintext, then the first... An explicit text Serial number When message authentication code With message authentication code If they are equal, it means the plaintext value is equal to the plaintext value. If it is the correct plaintext, then the first... An explicit text Serial number When message authentication code With message authentication code Not equal to and the message authentication code The inconsistency indicates that the FPE ciphertext is not equal. If tampered with, then the FPE ciphertext The message authentication code is deemed invalid. With message authentication code Equal to and the message authentication code If they are equal, it means the FPE ciphertext is correct. If it fails, the FPE ciphertext will be lost. It has been determined to be invalid.

[0052] In one embodiment of the present invention, step B5 includes the following steps: B5-1. Serial Number According to the inverse mapping table Perform a mapping to obtain its inverse mapping table. Index number in .

[0053] B5-2. Through formula Calculate the first An explicit text .

[0054] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for encryption and decryption based on the ZUC algorithm (Chinese national cryptographic standard) and a distinguishable mechanism, characterized in that: include: A1. Obtaining raw data , the original data Split into An explicit text , For the first An explicit text, ; A2. Obtain the mapping table based on the fields. and inverse mapping table ; A3. According to the mapping table Get the first An explicit text Serial number ; A4. Using the ZUC algorithm, generate a keystream of the same length as the plaintext data based on the Key and IV in the ZUC algorithm. Through formula The symmetric ciphertext was calculated. In the formula This is a bitwise XOR operation; A5. Based on symmetric ciphertext Obtain message authentication code Passing the exam An explicit text FPE ciphertext ; A6. Will Concatenate the plaintext FPE ciphertext to obtain the FPE ciphertext. .

2. The encryption and decryption method based on the ZUC algorithm and a distinguishable mechanism according to claim 1, characterized in that, Step A1 includes the following steps: A1-1. Transfer the original data Data format Split into Independent fields , For the first One field, ; A1-2. Transfer the original data Split according to the corresponding fields to obtain An explicit text .

3. The encryption and decryption method based on the ZUC algorithm and a distinguishable mechanism according to claim 2, characterized in that, Step A2 includes the following steps: A2-1. [The following is a partial translation and can be left as is:] fields The corresponding message space name is defined as , No. fields The message space size is , , As a variable; A2-2. Use binary sort to sort the... An explicit text Elements from 1 to The sorting yields the first... Mapping table of plaintext and inverse mapping table .

4. The encryption and decryption method based on the ZUC algorithm and a distinguishable mechanism according to claim 1, characterized in that, Step A3 includes the following steps: A3-1. [The following is a partial translation and doesn't need a direct translation:] An explicit text According to the mapping table Perform data mapping to obtain the first An explicit text In the mapping table Index number in ; A3-2. Using the formula Calculation yields the first An explicit text Serial number .

5. The encryption and decryption method based on the ZUC algorithm and a distinguishable mechanism for preserving the format according to claim 3, characterized in that, Step A5 includes the following steps: A5-1. Through the formula The symmetric ciphertext was calculated. The index number corresponding to the original message space In the formula Modulo operation; A5-2. [The following appears to be a separate, unrelated section:] ...the first... An explicit text Serial number With input variables After the concatenation operation, the concatenation result, the Key in the 128-EIA3 algorithm, and the IV in the 128-EIA3 algorithm are used to calculate the message authentication code using the 128-EIA3 algorithm. ,variable The length is ; A5-3. Index number According to the inverse mapping table Perform mapping to obtain the first An explicit text In the reverse mapping table Index number in ; A5-4. Using the formula Calculation yields the first An explicit text FPE ciphertext .

6. A method for decrypting ciphertext generated by the encryption method according to any one of claims 1 to 5, characterized in that, include: B1. Contain the FPE ciphertext Split into FPE ciphertext ; B2. Obtain the mapping table based on the fields. and inverse mapping table ; B3. According to the mapping table Obtain FPE ciphertext Corresponding serial number ; B4. According to the serial number Get the first An explicit text Serial number ; B5. Based on the inverse mapping table Get the first An explicit text ; B6. Will The plaintext is concatenated to obtain the original data. .

7. The decryption method according to claim 6, characterized in that, Step B2 includes the following steps: B2-1. The first fields The corresponding message space name is defined as , No. fields The message space size is , , As a variable; B2-2. Use binary sort to sort the... An explicit text Elements from 1 to The sorting yields the first... Mapping table of plaintext and inverse mapping table .

8. The decryption method according to claim 6, characterized in that, Step B3 includes the following steps: B3-1. The first An explicit text FPE ciphertext According to the mapping table Perform data mapping to obtain FPE ciphertext. In the mapping table Index number in ; B3-2. Through formula The FPE ciphertext was calculated. Corresponding serial number .

9. The decryption method according to claim 7, characterized in that, Step B4 includes the following steps: B4-1. Using the ZUC algorithm, generate a keystream of the same length as the plaintext data based on the Key and IV in the ZUC algorithm. ; B4-2. Through the formula Calculate the plaintext value In the formula For bitwise XOR operation, use the formula Calculate the plaintext value ; B4-3. Plaintext value With input variables After the concatenation operation, the concatenation result, the Key in the 128-EIA3 algorithm, and the IV in the 128-EIA3 algorithm are used to calculate the message authentication code using the 128-EIA3 algorithm. ; B4-4. Plaintext value With input variables After the concatenation operation, the concatenation result, the Key in the 128-EIA3 algorithm, and the IV in the 128-EIA3 algorithm are used to calculate the message authentication code using the 128-EIA3 algorithm. ; B4-5. When the message authentication code With message authentication code If they are equal, then the first... An explicit text Serial number When message authentication code With message authentication code If they are equal, then the first... An explicit text Serial number When message authentication code With message authentication code Not equal to and the message authentication code If they are not equal, then FPE ciphertext The message authentication code is deemed invalid. With message authentication code Equal to and the message authentication code If they are equal, then the FPE ciphertext is correct. It has been determined to be invalid.

10. The decryption method according to claim 6, characterized in that, Step B5 includes the following steps: B5-1. Serial Number According to the inverse mapping table Perform a mapping to obtain its inverse mapping table. Index number in ; B5-2. Through formula Calculation yields the first An explicit text .

Citation Information

Patent Citations

  • Digital chaotic password method based on chaotic number spectrum

    CN106788965A

  • Wireless secret communication system based on STM32

    CN108377180A

  • Variable-length authentication label generation method suitable for ZUC-256 stream cryptographic algorithm and communication method and system

    CN110034919A

  • Reserved format encryption method based on stream cipher

    CN110795762A

  • Password stream generation method and device

    CN112019322A