Format-preserved information de-identification method and device, equipment and storage medium
Patent Information
- Application Number
- CN202311487838.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-09
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-11-09
AI Technical Summary
[0008]本申请提供了一种基于格式保留的信息去标识方法、装置、设备及存储介质,解决了使用Cycle-Walking的不确定性问题,提高了保留格式加密算法效率,降低算法计算开销,扩大保留格式加密处理的问题域,使保留格式加密算法能够对任意类型的数据进行保留格式加密
[0060]本申请中,提供了一种基于格式保留的信息去标识方法、装置、设备及存储介质,通过设置截断表,消除Feistel结构中使用Cycle-Walking的不确定性,基于目标数据长度使得能够处理任意问题域的内容,丰富的保留格式加密的应用场景,解决了使用Cycle-Walking的不确定性问题,提高了保留格式加密算法效率,降低算法计算开销,扩大保留格式加密处理的问题域,使保留格式加密算法能够对任意类型的数据进行保留格式加密。
Smart Images

Figure CN117540415B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer encryption technology, and in particular to a method, apparatus, device and storage medium for de-identifying information based on format preservation. Background Technology
[0002] In the digital age, the collection and use of personal information is growing exponentially. Various services and applications collect personal data for purposes such as advertising targeting, user analysis, and personalized recommendations. However, with the accumulation of personal data, the risks of privacy breaches and misuse also increase. Once personally identifiable information is exposed, it can lead to problems such as privacy violations, identity theft, and fraud.
[0003] Personal information de-identification is a technological means of protecting personal privacy, aiming to eliminate the association of personally identifiable information during data processing, thereby reducing the risk of privacy leaks. This is driven by the urgent need for privacy protection, regulatory compliance requirements, and the impetus for technological development.
[0004] Personal information deidentification can be achieved using format-preserving encryption as a technical means. By using format-preserving encryption algorithms, personally identifiable information can be encrypted while maintaining the original data format. The advantage of this is that even during the removal or replacement of personally identifiable information, the encrypted data can still maintain the same format as the original data to meet specific application requirements.
[0005] In the medical field, researchers may need access to anonymized medical data for research and analysis while maintaining the data's format to ensure accurate analysis. In such cases, format-preserving encryption algorithms can be used to encrypt sensitive personally identifiable information (such as patient names and ID numbers) while maintaining the data's structure and format to meet research needs.
[0006] Currently, most format-preserving encryption methods employ three approaches to construct FPEs based on algorithms: Prefix, Cycle-Walking, and Generalized-Feistel. These three methods not only address the FPE problem on integer sets to some extent but also serve as fundamental approaches for constructing FPE models. Among them, Cycle-Walking and Generalized-Feistel have been widely used in subsequent encryption models.
[0007] The Generalized-Feistel method uses Cycle-Walking to increase the number of rounds, ensuring the format falls within an ideal range and preserving the format. While Cycle-Walking does not reduce the security of traditional block ciphers, it can lead to performance degradation when a single encryption may require multiple calls to the base block cipher. When the plaintext's binary length is much smaller than the block length, the increased number of iterations can cause performance issues. Using Cycle-Walking in the Generalized-Feistel method, or using it alone in other ways, is suitable for integer sets whose size is close to the block length. For example, if using the DES algorithm, it is suitable for integer sets of 54 to 64 bits. However, this method truncates the semantic groups, and the content generated while preserving the format may not satisfy the original format semantics, making it easy to identify that the current content is encrypted. Summary of the Invention
[0008] This application provides a method, apparatus, device, and storage medium for de-identifying information based on format preservation, which solves the uncertainty problem of using Cycle-Walking, improves the efficiency of format-preserving encryption algorithms, reduces algorithm computational overhead, expands the problem domain of format-preserving encryption processing, and enables format-preserving encryption algorithms to perform format-preserving encryption on data of any type.
[0009] In view of this, the first aspect of this application provides a method for de-identifying information based on format preservation, the method comprising:
[0010] S1. Pad the first data to be encrypted to the target data length to obtain the second data to be encrypted, P;
[0011] S2. Divide the second data to be encrypted into 2m data segments, obtaining P = P1||P2||…||P 2m , where |P j | indicates P j The length m, Y j For this time P j The corresponding value range, Y j ={y j1 ,y j2 ,…,y jsj}, S j For Y j The number of elements contained (j = 1, ..., m);
[0012] S3. Construct the F function PRF = trunc(3DES) in the Feistel structure. K(T),r), where T is the string formed by concatenating the input numbers, K is the key, 3DES is the encryption algorithm, and r is the number of bits to be truncated from the result.
[0013] S4. Input the second data to be encrypted into the Feistel structure, such that L0 = P1||…||P 2m-1 R0 = P2||…||P 2m The operation is performed in r rounds, where the operation process of the i-th (i = 1, ..., r) round is as follows:
[0014] L i =R i-1
[0015]
[0016] The first output result L is obtained. i =P1||…||P 2m -1, R i =P2||…||P 2m Where P1∈Y1,…,P 2m ∈Y 2m ,|Z j |=|P j |;
[0017] S5. Concatenate the first r bits of the first output result to obtain the second output result C = L. r ||R r ;
[0018] S6. Based on the value range of each part Y i Generate pseudo-random numbers r1, r2, ... r that fall within the range of the given values. 2m The generated content R = r1 + r2 + ... + r is concatenated to meet the target format. 2m ;
[0019] S7. Based on the second output result C and the generated content R, generate the truncated table content S, where S = RC.
[0020] Optionally, it also includes:
[0021] Based on the truncated table content S and the generated content R, the second output result RS = C = L is obtained. r ||R r Y j For this time P j The corresponding value range is divided into m data segments, P1∈Y1,…,P m ∈Y m ;
[0022] The second output result C=Lr ||R r The input is given to the Feistel structure, so that L r =P1||…||P 2m-1 R r =P2||P4||…||P 2m The operation is performed in r rounds, where the operation process of the i-th (i = 1, ..., r) round is as follows:
[0023] L r-i =R r-i+1
[0024]
[0025] The third output result L is obtained. r-i =P1||…||P m R r-i =P m+1 ||…||P 2m Where P1∈Y1, P2∈Y2,…,P 2m ∈Y 2m ;
[0026] Based on the third output result, the second data to be encrypted, P = L0||R0, is obtained.
[0027] Delete the data in the second data to be encrypted that exceeds the target data length by removing the data that exceeds the target data length, and obtain the first data to be encrypted.
[0028] Optionally, it also includes:
[0029] Randomly generate the initialization key using Python standard library functions;
[0030] The number of rounds is obtained by using a left circular shift subkey generation algorithm based on the initialization key;
[0031] If the number of rounds matches the number of bits in the first data to be encrypted, the verification is successful.
[0032] A second aspect of this application provides an information de-identification apparatus based on format preservation, the apparatus comprising:
[0033] The padding unit is used to pad the first data to be encrypted to the target data length to obtain the second data to be encrypted, P.
[0034] The first processing unit is used to divide the second data to be encrypted into 2m data segments, obtaining P = P1||P2||…||P 2m , where |P j | indicates P j The length m, Y j For this time Pj The corresponding value range, Y j ={y j1 ,y j2 ,…,y jsj}, S j For Y j The number of elements contained (j = 1, ..., m);
[0035] The building block is used to construct the F function PRF = trunc(3DES) in the Feistel structure. K (T),r), where T is the string formed by concatenating the input numbers, K is the key, 3DES is the encryption algorithm, and r is the number of bits to be truncated from the result.
[0036] The second processing unit is used to input the second data to be encrypted into the Feistel structure, such that L0 = P1||…||P 2m-1 R0 = P2||…||P 2m The operation is performed in r rounds, where the operation process of the i-th (i = 1, ..., r) round is as follows:
[0037] L i =R i-1
[0038]
[0039] The first output result L is obtained. i =P1||…||P 2m-1 R i =P2||…||P 2m Where P1∈Y1,…,P 2m ∈Y 2m ,|Z j |=|P j |;
[0040] The truncation unit is used to concatenate the first r bits of the truncated first output result to obtain the second output result C=L. r ||R r ;
[0041] The first generation unit is used to generate data based on the value range Y of each part. i Generate pseudo-random numbers r1, r2, ... r that fall within the range of the given values. 2m The generated content R = r1 + r2 + ... + r is concatenated to meet the target format. 2m ;
[0042] The second generation unit is used to generate truncated table content S based on the second output result C and the generated content R, where S = RC.
[0043] Optionally, it also includes:
[0044] The third processing unit is used to obtain the second output result RS=C=L based on the truncated table content S and the generated content R. r ||R r Y j For this time P j The corresponding value range is divided into m data segments, P1∈Y1,…,P m ∈Y m ;
[0045] The fourth processing unit is used to process the second output result C=L r ||R r The input is given to the Feistel structure, so that L r =P1||…||P 2m-1 R r =P2||P4||…||P 2m The operation is performed in r rounds, where the operation process of the i-th (i = 1, ..., r) round is as follows:
[0046] L r-i =R r-i+1
[0047]
[0048] The third output result L is obtained. r-i =P1||…||P m R r-i =P m+1 ||…||P 2m Where P1∈Y1, P2∈Y2,…,P 2m ∈Y 2m ;
[0049] The third generation unit is used to obtain the second data to be encrypted, P = L0||R0, based on the third output result.
[0050] The deletion unit is used to delete data in the second data to be encrypted that exceeds the target data length by a certain number of bits, so as to obtain the first data to be encrypted.
[0051] Optionally, it also includes:
[0052] The key initialization unit is used to randomly generate an initialization key using Python standard library functions.
[0053] The calculation unit is used to obtain the number of rounds based on the initialization key using a left circular shift subkey generation algorithm;
[0054] The verification unit is used to verify that the number of rounds is consistent with the number of bits in the first data to be encrypted, and the verification is successful.
[0055] A third aspect of this application provides a device for de-identifying a format-preserving information, the device including a processor and a memory:
[0056] The memory is used to store program code and transmit the program code to the processor;
[0057] The processor is configured to execute, according to instructions in the program code, the steps of the method for de-identifying information based on format preservation as described in the first aspect above.
[0058] A fourth aspect of this application provides a computer-readable storage medium for storing program code for performing the method described in the first aspect above.
[0059] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0060] This application provides a method, apparatus, device, and storage medium for information de-identification based on format preservation. By setting a truncation table, it eliminates the uncertainty of using Cycle-Walking in the Feistel structure. Based on the target data length, it enables the processing of content in any problem domain, enriches the application scenarios of format preservation encryption, solves the uncertainty problem of using Cycle-Walking, improves the efficiency of format preservation encryption algorithms, reduces the computational overhead of algorithms, expands the problem domain of format preservation encryption processing, and enables format preservation encryption algorithms to perform format preservation encryption on data of any type. Attached Figure Description
[0061] Figure 1 This is a flowchart of the method for de-identifying information based on format preservation in the embodiments of this application;
[0062] Figure 2 This is a schematic diagram of the structure of the information de-identification device based on format preservation in the embodiments of this application;
[0063] Figure 3 This is a schematic diagram of the structure of the device for identifying information based on format preservation in the embodiments of this application. Detailed Implementation
[0064] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0065] This application designs a method, apparatus, device, and storage medium for information de-identification based on format preservation, which solves the uncertainty problem of using Cycle-Walking, improves the efficiency of format-preserving encryption algorithms, reduces algorithm computational overhead, expands the problem domain of format-preserving encryption processing, and enables format-preserving encryption algorithms to perform format-preserving encryption on data of any type.
[0066] In addition to possessing the properties of basic data types, digital feature data also exhibits specific integrity and constraints inherent in custom data, such as ID card numbers, social security numbers, and phone numbers. Generally, this type of data can be divided into several subsets, each with certain specific construction rules. Let S be the feature data, which can be divided into n data segments, and Si be the subsets.
[0067]
[0068] Therefore, it is not possible to effectively encrypt it directly using a basic data type preservation encryption algorithm. The technical solution of this application utilizes the idea of segmented encryption, and simultaneously sets up a truncation table in the algorithm to process the data, thereby implementing a preservation-format encryption algorithm that provides secure protection for characteristic data.
[0069] For easier understanding, please refer to Figure 1 , Figure 1 This is a flowchart of the method for de-identifying information based on format preservation in the embodiments of this application, such as... Figure 1 As shown, specifically:
[0070] S1. Pad the first data to be encrypted to the target data length to obtain the second data to be encrypted, P;
[0071] S2. Divide the second data to be encrypted into 2m data segments, obtaining P = P1||P2||…||P 2m , where |P j | indicates P j The length m, Y j For this time P j The corresponding value range, Y j ={y j1 ,y j2 ,…,y jsj}, Sj For Y j The number of elements contained (j = 1, ..., m);
[0072] S3. Construct the F function PRF = trunc(3DES) in the Feistel structure. K (T),r), where T is the string formed by concatenating the input numbers, K is the key, 3DES is the encryption algorithm, and r is the number of bits to be truncated from the result.
[0073] S4. Input the second data to be encrypted into the Feistel structure, such that L0 = P1||…||P 2m-1 R0 = P2||…||P 2m The operation is performed in r rounds, where the operation process of the i-th (i = 1, ..., r) round is as follows:
[0074] L i =R i-1
[0075]
[0076] The first output result L is obtained. i =P1||…||P 2m-1 R i =P2||…||P 2m Where P1∈Y1,…,P 2m ∈Y 2m ,|Z j |=|P j |;
[0077] S5. Concatenate the first r bits of the first output result to obtain the second output result C = L. r ||R r ;
[0078] S6. Based on the value range of each part Y i Generate pseudo-random numbers r1, r2, ... r that fall within the range of values. 2m The generated content R = r1 + r2 + ... + r is concatenated to meet the target format. 2m ;
[0079] S7. Based on the second output result C and the generated content R, generate the truncation table content S, where S = RC.
[0080] It should be noted that the encryption process of the algorithm is as follows:
[0081] (1) Pad the encrypted data P to the length that conforms to the encryption standard, and then divide it into 2m data segments, i.e., P = P1||P2||…||P 2m ,|P j| indicates P j The length m, Y j For this time P j The corresponding value range, Y j ={y j1 ,y j2 ,…,y jsj}, S j For Y j The number of elements contained (j = 1, ..., m).
[0082] (2) Construct the F function in the Feistel structure, expressed as PRF = trunc(3DES) K (T),r): Input a string T formed by concatenating numbers, encrypt it using a key K and the 3DES algorithm, and truncate the first r bits of the result.
[0083] (3) Input the content to be encrypted into a balanced Feistel structure: L0 = P1||…||P 2m-1 R0 = P2||…||P 2m Perform r rounds of computation. The computation process for the i-th (i = 1, ..., r) round is as follows:
[0084] L i =R i-1
[0085]
[0086] The output result L is obtained i =P1||…||P 2m-1 R i =P2||…||P 2m Where P1∈Y1,…,P 2m ∈Y 2m ,|Z j |=|P j |. The output result of concatenating strings is C=L r ||R r .
[0087] (4) Based on the value range Y of each part i Generate pseudo-random numbers r1, r2, ... r that fall within the range of this value. 2m The concatenation forms the formatted content R = r1 + r2 + ... + r 2m .
[0088] (5) Verify whether the result conforms to the format Ω, generate the content R that conforms to the result by computer pseudo-randomization, and generate the truncated table content S = RC, and store the truncated table content S.
[0089] Furthermore, it also includes:
[0090] Based on the truncated table content S and the generated content R, the second output result is RS = C = L. r ||R r Y j For this time P j The corresponding value range is divided into m data segments, P1∈Y1,…,P m ∈Y m ;
[0091] The second output result C = L r ||R r Input into the Feistel structure, so that L r =P1||…||P 2m-1 R r =P2||P4||…||P 2m The operation is performed in r rounds, where the operation process of the i-th (i = 1, ..., r) round is as follows:
[0092] L r-i =R r-i+1
[0093]
[0094] The third output result L is obtained. r-i =P1||…||P m R r-i =P m+1 ||…||P 2m Where P1∈Y1, P2∈Y2,…,P 2m ∈Y 2m ;
[0095] Based on the third output result, the second data to be encrypted is P = L0||R0;
[0096] Delete the data in the second data to be encrypted that exceeds the target data length by removing the data that is longer than the target data length, and obtain the first data to be encrypted.
[0097] It should be noted that the decryption process of the algorithm is as follows:
[0098] (1) Restore the ciphertext. Based on the truncated table content S and the pseudo-random generation result R that conforms to the format Ω, the ciphertext RS=C=L is obtained. r ||R r Y j For this time P j The corresponding value range is divided into m data segments, P1∈Y1,…,P m ∈Y m After the data restoration is complete, its decryption stream
[0099] The specific steps of the process are as follows.
[0100] (2) Input content C=L r ||R r Input Balanced Feistel Structure: L r =P1||P3||…||P 2m-1 and R r =P2||P4||…||P 2m The calculation process for the i-th round (i = 1, ..., r):
[0101] L r-i =R r-i+1
[0102]
[0103] The output obtained through the above encryption is: L r-i =P1||…||P m R r-i =P m+1 ||…||P 2m Where P1∈Y1, P2∈Y2,…,P 2m ∈Y 2m .
[0104] (3) Obtain the original data result C=L0||R0, delete the data that exceeds the encryption standard length by several digits, obtain the decryption result of the data, and output the plaintext.
[0105] Furthermore, it also includes:
[0106] Randomly generate the initialization key using Python standard library functions;
[0107] The number of rounds is obtained by using a subkey generation algorithm based on the initialization key and employing left circular shift.
[0108] If the number of rounds matches the number of bits in the first data to be encrypted, the verification is successful.
[0109] It should be noted that the specific experiment on the format-preserving encryption algorithm was conducted in a Python 3.7 environment, using the 3DES encryption algorithm from the Python standard library function Crypto.Cipher, with an ID card number as an example.
[0110] The initialization key is randomly generated using Python standard library functions. The initial key is set to K = c43f8a6ff6351013. The subkey generation algorithm uses left circular shift, with the number of shifts performed in each round being:
[0111] As shown in Table 1
[0112] Table 1 shows the number of left circular shift bits generated for subkey generation.
[0113]
[0114] The number of rounds shown in this Feistel structure is r=4 (in practice, to achieve the required level of security, more rounds should be set, at least 16 rounds).
[0115] This application uses the People's Republic of China resident identity card number as an example to demonstrate a specific implementation scheme.
[0116] The encryption process for a valid ID number is as follows:
[0117] The ID card number P = 110999200001016688 is divided into eight parts: P1 = 11, P2 = 09, P3 = 99, P4 = 2000, P5 = 01, P6 = 01, P7 = 668, P8 = 8. The corresponding value ranges of P1, P2, P3, P4, P5, P6, P7, and P8 are Y1 = {11, ..., 99}, Y2 = {0, ..., 99}, Y3 = {0, ..., 99}, Y4 = {1950, ..., 2023}, Y5 = {0, ..., 99}, Y6 = {0, ..., 99}, Y7 = {0, ..., 999}, and Y8 = {0, ..., 9, X}.
[0118] Input the ID number into the balanced Feistel network for computation:
[0119] When r = 1, the first round of calculations is performed:
[0120] L1=R0=9920||0166||0000
[0121]
[0122]
[0123] When r = 2, perform the second round of calculation:
[0124]
[0125]
[0126] When r = 3, perform the second round of calculation:
[0127] L3=R2=0x6f77425c||0x435c741d||0x0271011e
[0128]
[0129] r3~r 14Round operations are performed in the same manner;
[0130] When r = 15, perform the second round of calculation:
[0131] L15=R14=0x4d27457f||0x7f452b26||0x50064774
[0132]
[0133]
[0134] When r = 16, the sixteenth round of calculation is performed:
[0135] L16=R15=0x7f28322c||0x03121c19||0x40294e04
[0136]
[0137] Encryption using the Feistel structure and 3DES encryption algorithm yields the encrypted hexadecimal representation of the ID number: 0x7f28322c0a71742c03121c1928705a4f40294e0465423047.
[0138] Based on the value range Y1 to Y8 of each part of the ID card number, a random function conforming to the value range Y1 to Y8 is generated using a Python pseudo-random number generator. The random numbers selected in this verification experiment are as follows, generating an ID card number R = 111666199912318866 that conforms to the ID card number format and also meets the real-world application scenario.
[0139] Therefore, the generated truncated content is:
[0140] S=0xec711f7061dff0430e2e8d1d8142a37faf0082f7c24717a0.
[0141] The process of decrypting a valid ID number is as follows:
[0142] Query the truncated table T to restore the ciphertext, obtaining the decryptable ciphertext. Input the ciphertext into a balanced Feistel network for decryption:
[0143] The sixteen-bit ciphertext is restored to the six parts of the original calculation result, which are P1 = 0x7f28322c, P2 = 0x03121c19, P3 = 0x40294e04, P4 = 0x0a71742c, P5 = 0x28705a4f, and P6 = 0x65423047.
[0144] When r = 1, the first round of calculations is performed:
[0145] L15=R16=0x0a71742c||0x28705a4f||0x65423047
[0146]
[0147] When r = 2, perform the second round of calculation:
[0148] L14=R15=0x7f28322c||0x03121c19||0x40294e04
[0149]
[0150] The operations from r3 to r15 are performed in the same manner;
[0151] When r = 16, the sixteenth round of calculation is performed:
[0152] L0=R1=0x0a71742c||0x28705a4f||0x65423047
[0153]
[0154] The algorithm represents the parsed result in hexadecimal as: 0x393932303131303930313636303030313030303038383030. Converting this to decimal gives 110999200001016688000000. After removing the initial padding, the algorithm finally yields the original plaintext result: 110999200001016688, achieving format-preserving encryption.
[0155] Please see Figure 2 , Figure 2 This is a schematic diagram of the structure of the information de-identification device based on format preservation in the embodiments of this application, such as... Figure 2 As shown, specifically:
[0156] The padding unit 201 is used to pad the first data to be encrypted to the target data length to obtain the second data to be encrypted P;
[0157] The first processing unit 202 is used to divide the second data to be encrypted into 2m data segments, obtaining P = P1||P2||…||P 2m , where |P j | indicates P j The length m, Y j For this time P j The corresponding value range, Y j={y j1 ,y j2 ,…,y jsj}, S j For Y j The number of elements contained (j = 1, ..., m);
[0158] Construction unit 203 is used to construct the F function PRF = trunc(3DES) in the Feistel structure. K (T),r), where T is the string formed by concatenating the input numbers, K is the key, 3DES is the encryption algorithm, and r is the number of bits to be truncated from the result.
[0159] The second processing unit 204 is used to input the second data to be encrypted into the Feistel structure, such that L0 = P1||…||P 2m-1 R0 = P2||…||P 2m The operation is performed in r rounds, where the operation process of the i-th (i = 1, ..., r) round is as follows:
[0160] L i =R i-1
[0161]
[0162] The first output result L is obtained. i =P1||…||P 2m-1 R i =P2||…||P 2m Where P1∈Y1,…,P 2m ∈Y 2m ,|Z j |=|P j |;
[0163] The truncation unit 205 is used to concatenate the first r bits of the truncated first output result to obtain the second output result C=L. r ||R r ;
[0164] The first generation unit 206 is used to generate data based on the value range Y of each part. i Generate pseudo-random numbers r1, r2, ... r that fall within the range of values. 2m The generated content R = r1 + r2 + ... + r is concatenated to meet the target format. 2m ;
[0165] The second generation unit 207 is used to generate truncation table content S based on the second output result C and the generated content R, where S = RC.
[0166] Furthermore, it also includes:
[0167] The third processing unit is used to obtain the second output result RS=C=L based on the truncated table content S and the generated content R. r ||R r Y j For this time P j The corresponding value range is divided into m data segments, P1∈Y1,…,P m ∈Y m ;
[0168] The fourth processing unit is used to process the second output result C=L r ||R r Input into the Feistel structure, so that L r =P1||…||P 2m-1 R r =P2||P4||…||P 2m The operation is performed in r rounds, where the operation process of the i-th (i = 1, ..., r) round is as follows:
[0169] L r-i =R r-i+1
[0170]
[0171] The third output result L is obtained. r-i =P1||…||P m R r-i =P m+1 ||…||P 2m Where P1∈Y1, P2∈Y2,…,P 2m ∈Y 2m ;
[0172] The third generation unit is used to obtain the second data to be encrypted, P = L0||R0, based on the third output result.
[0173] The deletion unit is used to delete data in the second data to be encrypted that exceeds the target data length by a certain number of bits, so as to obtain the first data to be encrypted.
[0174] Furthermore, it also includes:
[0175] The key initialization unit is used to randomly generate an initialization key using Python standard library functions.
[0176] The calculation unit is used to obtain the number of rounds based on the initialization key using a left circular shift subkey generation algorithm;
[0177] The verification unit is used to verify that the number of rounds is consistent with the number of bits in the first data to be encrypted, and the verification is successful.
[0178] This application also provides another method for identifying devices based on format-preserving information, such as... Figure 3 As shown, for ease of explanation, only the parts related to the embodiments of this application are shown. For specific technical details not disclosed, please refer to the method section of the embodiments of this application. The terminal can be any terminal device including mobile phones, tablets, personal digital assistants (PDAs), point-of-sale (POS) terminals, in-vehicle computers, etc. Taking a mobile phone as an example:
[0179] Figure 3 This is a block diagram illustrating a portion of the structure of a mobile phone related to the terminal provided in the embodiments of this application. (Reference) Figure 3 The mobile phone includes: a radio frequency (RF) circuit 1010, a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a wireless fidelity (WiFi) module 1070, a processor 1080, and a power supply 1090, etc. Those skilled in the art will understand that... Figure 3 The mobile phone structure shown does not constitute a limitation on the mobile phone and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0180] The following is combined with Figure 3 A detailed introduction to each component of a mobile phone:
[0181] The RF circuit 1010 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and processes it with the processor 1080; additionally, it transmits uplink data to the base station. Typically, the RF circuit 1010 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, etc. Furthermore, the RF circuit 1010 can also communicate wirelessly with networks and other devices. The aforementioned wireless communications may use any communication standard or protocol, including but not limited to Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, and Short Messaging Service (SMS).
[0182] The memory 1020 can be used to store software programs and modules. The processor 1080 executes various mobile phone functions and data processing by running the software programs and modules stored in the memory 1020. The memory 1020 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 1020 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0183] The input unit 1030 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of the mobile phone. Specifically, the input unit 1030 may include a touch panel 1031 and other input devices 1032. The touch panel 1031, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel 1031), and drive the corresponding connection devices according to a pre-set program. Optionally, the touch panel 1031 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 1080, and can also receive and execute commands sent by the processor 1080. In addition, the touch panel 1031 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1031, the input unit 1030 may also include other input devices 1032. Specifically, other input devices 1032 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.
[0184] The display unit 1040 can be used to display information input by the user or information provided to the user, as well as various menus of the mobile phone. The display unit 1040 may include a display panel 1041, which may optionally be configured as a Liquid Crystal Display (LCD), Organic Light-Emitting Diode (OLED), or similar display panel 1041. Further, a touch panel 1031 may cover the display panel 1041. When the touch panel 1031 detects a touch operation on or near it, it transmits the information to the processor 1080 to determine the type of touch event. Subsequently, the processor 1080 provides corresponding visual output on the display panel 1041 according to the type of touch event. Although in Figure 3 In this embodiment, the touch panel 1031 and the display panel 1041 are two separate components to realize the input and output functions of the mobile phone. However, in some embodiments, the touch panel 1031 and the display panel 1041 can be integrated to realize the input and output functions of the mobile phone.
[0185] The mobile phone may also include at least one sensor 1050, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 1041 according to the ambient light level, and the proximity sensor can turn off the display panel 1041 and / or the backlight when the phone is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used for applications that recognize the phone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, taps), etc. Other sensors that may be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.
[0186] The audio circuit 1060, speaker 1061, and microphone 1062 provide an audio interface between the user and the mobile phone. The audio circuit 1060 converts the received audio data into electrical signals and transmits them to the speaker 1061, where the speaker 1061 converts them into sound signals for output. On the other hand, the microphone 1062 converts the collected sound signals into electrical signals, which are then received by the audio circuit 1060, converted into audio data, and then processed by the processor 1080 before being transmitted via the RF circuit 1010 to, for example, another mobile phone, or the audio data can be output to the memory 1020 for further processing.
[0187] WiFi is a short-range wireless transmission technology. Through the WiFi module 1070, mobile phones can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 3 The WiFi module 1070 is shown, but it is understood that it is not an essential component of a mobile phone and can be omitted as needed without changing the essence of the invention.
[0188] The processor 1080 is the control center of the mobile phone, connecting various parts of the phone through various interfaces and lines. It executes software programs and / or modules stored in the memory 1020 and calls data stored in the memory 1020 to perform various functions and process data, thereby providing overall monitoring of the phone. Optionally, the processor 1080 may include one or more processing units; preferably, the processor 1080 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 1080.
[0189] The mobile phone also includes a power supply 1090 (such as a battery) that supplies power to various components. Preferably, the power supply can be logically connected to the processor 1080 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.
[0190] Although not shown, mobile phones may also include a camera, Bluetooth module, etc., which will not be described in detail here.
[0191] In this embodiment of the application, the processor 1080 included in the terminal also has the following functions:
[0192] S1. Pad the first data to be encrypted to the target data length to obtain the second data to be encrypted, P;
[0193] S2. Divide the second data to be encrypted into 2m data segments, obtaining P = P1||P2||…||P 2m , where |P j | indicates P j The length m, Y j For this time P j The corresponding value range, Y j ={y j1 ,y j2 ,…,y jsj}, S j For Y j The number of elements contained (j = 1, ..., m);
[0194] S3. Construct the F function PRF = trunc(3DES) in the Feistel structure. K (T),r), where T is the string formed by concatenating the input numbers, K is the key, 3DES is the encryption algorithm, and r is the number of bits to be truncated from the result.
[0195] S4. Input the second data to be encrypted into the Feistel structure, such that L0 = P1||…||P 2m-1 R0 = P2||…||P 2m The operation is performed in r rounds, where the operation process of the i-th (i = 1, ..., r) round is as follows:
[0196] L i =R i-1
[0197]
[0198] The first output result L is obtained. i =P1||…||P 2m-1 R i =P2||…||P 2m Where P1∈Y1,…,P2m ∈Y 2m ,|Z j |=|P j |;
[0199] S5. Concatenate the first r bits of the first output result to obtain the second output result C = L. r ||R r ;
[0200] S6. Based on the value range of each part Y i Generate pseudo-random numbers r1, r2, ... r that fall within the range of values. 2m The generated content R = r1 + r2 + ... + r is concatenated to meet the target format. 2m ;
[0201] S7. Based on the second output result C and the generated content R, generate the truncation table content S, where S = RC.
[0202] This application also provides a computer-readable storage medium for storing program code that executes any one of the implementation methods of the format-preserving information de-identification method described in the foregoing embodiments.
[0203] This application provides a method, apparatus, device, and storage medium for information de-identification based on format preservation. By setting a truncation table, the uncertainty of using Cycle-Walking in the Feistel structure is eliminated. Based on the target data length, it enables the processing of content in any problem domain, enriches the application scenarios of format preservation encryption, solves the uncertainty problem of using Cycle-Walking, improves the efficiency of format preservation encryption algorithm, reduces algorithm computational overhead, expands the problem domain of format preservation encryption processing, and enables the format preservation encryption algorithm to perform format preservation encryption on data of any type.
[0204] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0205] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0206] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0207] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0208] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0209] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0210] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.
[0211] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for de-identifying information based on format preservation, characterized in that, include: S1. Pad the first data to be encrypted to the target data length to obtain the second data to be encrypted, P; S2. Divide the second data to be encrypted into 2m data segments, obtaining P = P1||P2||…||P 2m , where |P j | indicates P j The length m, Y j For this time P j The corresponding value range, Y j ={y j1 ,y j2 ,…,y jsj }, S j For Y j The number of elements contained (j = 1, ..., m); S3. Construct the F function PRF = trunc(3DES) in the Feistel structure. K (T),r), where T is the string formed by concatenating the input numbers, K is the key, 3DES is the encryption algorithm, and r is the number of bits to be truncated from the result. S4. Input the second data to be encrypted into the Feistel structure, such that L0 = P1||…||P 2m-1 R0 = P2||…||P 2m The operation is performed in r rounds, where the operation process of the i-th (i = 1, ..., r) round is as follows: L i =R i-1 The first output result L is obtained. i =P1||…||P 2m-1 R i =P2||…||P 2m Where P1∈Y1,…,P 2m ∈Y 2m ,|Z j |=|P j |; S5. Concatenate the first r bits of the first output result to obtain the second output result C = L. r ||R r ; S6. Based on the value range of each part Y i Generate pseudo-random numbers r1, r2, ... r that fall within the range of values. 2m The generated content R = r1 + r2 + ... + r is concatenated to meet the target format. 2m ; S7. Based on the second output result C and the generated content R, generate the truncated table content S, where S = RC.
2. The information de-identification method based on format preservation according to claim 1, characterized in that, Also includes: Based on the truncated table content S and the generated content R, the second output result RS = C = L is obtained. r ||R r Y j For this time P j The corresponding value range is divided into m data segments, P1∈Y1,…,P m ∈Y m ; The second output result C=L r ||R r The input is given to the Feistel structure, so that L r =P1||…||P 2m-1 R r =P2||P4||…||P 2m The operation is performed in r rounds, where the operation process of the i-th (i = 1, ..., r) round is as follows: L r-i =R r-i+1 The third output result L is obtained. r-i =P1||…||P m R r-i =P m+1 ||…||P 2m Where P1∈Y1, P2∈Y2,…,P 2m ∈Y 2m ; Based on the third output result, the second data to be encrypted, P = L0||R0, is obtained. Delete the data in the second data to be encrypted that exceeds the target data length by removing the data that exceeds the target data length, and obtain the first data to be encrypted.
3. The information de-identification method based on format preservation according to claim 2, characterized in that, Also includes: Randomly generate the initialization key using Python standard library functions; The number of rounds is obtained by using a left circular shift subkey generation algorithm based on the initialization key; If the number of rounds matches the number of bits in the first data to be encrypted, the verification is successful.
4. An information de-identification device based on format preservation, characterized in that, include: The padding unit is used to pad the first data to be encrypted to the target data length to obtain the second data to be encrypted, P. The first processing unit is used to divide the second data to be encrypted into 2m data segments, obtaining P = P1||P2||…||P 2m , where |P j | indicates P j The length m, Y j For this time P j The corresponding value range, Y j ={y j1 ,y j2 ,…,y jsj }, S j For Y j The number of elements contained (j = 1, ..., m); The building block is used to construct the F function PRF = trunc(3DES) in the Feistel structure. K (T),r), where T is the string formed by concatenating the input numbers, K is the key, 3DES is the encryption algorithm, and r is the number of bits to be truncated from the result. The second processing unit is used to input the second data to be encrypted into the Feistel structure, such that L0 = P1||…||P 2m-1 R0 = P2||…||P 2m The operation is performed in r rounds, where the operation process of the i-th (i = 1, ..., r) round is as follows: L i =R i-1 The first output result L is obtained. i =P1||…||P 2m-1 R i =P2||…||P 2m Where P1∈Y1,…,P 2m ∈Y 2m ,|Z j |=|P j |; The truncation unit is used to concatenate the first r bits of the truncated first output result to obtain the second output result C=L. r ||R r ; The first generation unit is used to generate data based on the value range Y of each part. i Generate pseudo-random numbers r1, r2, ... r that fall within the range of values. 2m The generated content R = r1 + r2 + ... + r is concatenated to meet the target format. 2m ; The second generation unit is used to generate truncated table content S based on the second output result C and the generated content R, where S = RC.
5. The information de-identification device based on format preservation according to claim 4, characterized in that, Also includes: The third processing unit is used to obtain the second output result RS=C=L based on the truncated table content S and the generated content R. r ||R r Y j For this time P j The corresponding value range is divided into m data segments, P1∈Y1,…,P m ∈Y m ; The fourth processing unit is used to process the second output result C=L r ||R r The input is fed into the Feistel structure such that Lr = P1||…||P 2m-1 R r =P2||P4||…||P 2m The operation is performed in r rounds, where the operation process of the i-th (i = 1, ..., r) round is as follows: L r-i =R r-i+1 The third output result L is obtained. r-i =P1||…||P m R r-i =P m+1 ||…||P 2m Where P1∈Y1, P2∈Y2,…,P 2m ∈Y 2m ; The third generation unit is used to obtain the second data to be encrypted, P = L0||R0, based on the third output result. The deletion unit is used to delete data in the second data to be encrypted that exceeds the target data length by a certain number of bits, so as to obtain the first data to be encrypted.
6. The information de-identification device based on format preservation according to claim 5, characterized in that, Also includes: The key initialization unit is used to randomly generate an initialization key using Python standard library functions. The calculation unit is used to obtain the number of rounds based on the initialization key using a left circular shift subkey generation algorithm; The verification unit is used to verify that the number of rounds is consistent with the number of bits in the first data to be encrypted, and the verification is successful.
7. A device for de-identifying information based on format preservation, characterized in that, The device includes a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the format-preserving information de-identification method according to any one of claims 1-3 according to the instructions in the program code.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program code for executing the format-preserving information de-identification method according to any one of claims 1-3.
Citation Information
Patent Citations
Method for encrypting format-preserved numeric type personally identifiable information
CN103595539A
Format-reserved encryption algorithm based on multi-segmented Feistel network
CN105959098A