Method and device for enhancing security of ff1 format preserving encryption

By using the SM3 algorithm to generate derived keys in format retention encryption and combining the SM4 algorithm to process intermediate quantities, the existing format retention encryption is solved in terms of cracking difficulty, and the complexity and security of encryption are improved.

WO2025030711A1PCT designated stage expired Publication Date: 2025-02-13CHINA TELECOM QUANTUM TECH CO LTD

Patent Information

Application Number
PCT/CN2023/133848
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-08-07
Filing Date
2023-11-24
Publication Date
2025-02-13

AI Technical Summary

Technical Problem

The existing format retention encryption scheme has insufficient cracking difficulty, especially in the case of key attacks and ciphertext groups colliding, which may lead to plaintext leakage.

Method used

By randomly selecting the key and using the hash algorithm with key cryptography based on the SM3 algorithm to generate the derived key. Different derived keys are called in each round of encryption operations, and intermediate quantities are generated in combination with SM3 and SM4 algorithms to randomly expand the keys. space.

Benefits of technology

It improves the cracking difficulty of format retention encryption, enhances the complexity of the algorithm and information redundancy, and reduces the risk of key attacks and ciphertext group collisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023133848_13022025_PF_FP_ABST
    Figure CN2023133848_13022025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present invention are a method and device for enhancing the security of FF1 format preserving encryption. The method comprises: randomly selecting a key, and transforming the key by using an SM3 algorithm-based keyed cryptographic hash algorithm, so as to obtain a derived key; when encrypting plaintext data by using a format preserving encryption FF1 algorithm, for data B, performing hash value calculation involving the derived key, so as to serve as an intermediate quantity R, wherein the plaintext data comprises data A and the data B; processing the intermediate quantity R and the derived key by using a symmetric block cryptographic operation, so as to generate an intermediate quantity S; and on the basis of the intermediate quantity S and the data A, generating ciphertext data. The present invention can increase the difficulty in cracking format preserving encryption.
Need to check novelty before this filing date? Find Prior Art

Description

Method and device for enhancing FF1 format to retain encryption security Technical Field The present invention relates to the technical field of cryptographic application, and in particular to a method and device for enhancing the security of FF1 format-retaining encryption. Background Art Format Preserving Encryption (FPE) is a special symmetric encryption algorithm that ensures that the format of the encrypted ciphertext is exactly the same as the format of the plaintext before encryption. It is often used in data desensitization projects to keep the encrypted data format unchanged, thus having the advantages of not having to change the database paradigm and being transparent to upper-layer applications. The FPE algorithm ensures that the length of the encrypted data remains unchanged, the encryption process is reversible, and the encrypted data can be decrypted and restored to the original data using a key. Some FPE algorithm schemes have been proposed and are beginning to be applied. For example, in 2011, the U.S. NIST recommended that the format-preserving encryption algorithms FF1 and FF3 derived from the FFX scheme be established as the AES standard working mode. Since the format-preserving encryption scheme allows a smaller plaintext and ciphertext space, when an attacker obtains many plaintext and ciphertext pairs, it is possible that more plaintext messages will be leaked due to ciphertext group collisions. The attacker may even be able to try some known plaintext attacks against the key. In the related art, the patent application document with publication number CN110768797A adopts a key distribution method using a symmetric block cipher algorithm to generate a derived key. The derived key is used to encrypt the data throughout the process, and the key used in each round of encryption operation is the same. The patent application document with publication number CN111783112A proposes to use the round key Key_Loop to perform a separate encryption operation on fixed data P that needs to be repeatedly encrypted, but the key used in each round of encryption operation is the same. The patent application document with publication number CN115174039A proposes to generate an intermediate quantity S by the HMAC-SM3 / CMAC-SM4 method, but this scheme generates a sufficiently long intermediate quantity at one time, and each round of calls uses it in turn. Moreover, none of the above-mentioned related schemes calls the derived key in each round of encryption and decryption iteration. Summary of the invention The technical problem to be solved by the present invention is how to increase the difficulty of cracking format-preserving encryption. The present invention solves the above technical problems by the following technical means: In a first aspect, the present invention proposes a method for enhancing the security of FF1 format-preserving encryption, the method comprising: Randomly select a key and transform the key using a keyed cryptographic hash algorithm based on the SM3 algorithm to obtain a derived key; When the format-preserving encryption FF1 algorithm is used to perform each round of encryption operation on the plaintext data, the data B is subjected to the derivative operation. The hash value of the key is calculated to obtain an intermediate quantity R, wherein the plaintext data includes data A and data B; Using a symmetric block cipher operation, the intermediate quantity R and the derived key are processed to generate an intermediate quantity S; Based on the intermediate quantity S and data A, ciphertext data is generated. Furthermore, the keys are multiple fresh keys generated by a quantum key distribution network and synchronized among quantum network nodes throughout the network, and are shared among users in the same encryption and decryption domain. Furthermore, the key is identified by a key ID. Furthermore, the randomly selected key and the key is transformed using a keyed cryptographic hash algorithm based on the SM3 algorithm to obtain a derived key, including: Randomly select an ID k Key ID k _Key; The key ID is encrypted using a key cryptographic hash algorithm based on the SM3 algorithm. k _Key is transformed, and the formula is expressed as: pkey i =KF(ID k _Key,ID k ,salt i ,n`,i) P1 = HMAC_SM3 (ID k _Key,ID k ||salt i ||i||“FF1key derivation”) P2 = HMAC_SM3 (ID k _Key,P1) … P n` =HMAC_SM3(ID k _Key,P n`-1 ); In the formula, pkey i To derive the key, salt i is the salt value, n' is the number of iterations of key derivation, KF() is the key derivation function, P1~P n` is the intermediate quantity calculated by the key derivation function, "FF1key derivation" is a fixed string, HMAC_SM3 is a keyed cryptographic hash algorithm based on the SM3 algorithm, || indicates concatenation, Represents XOR operation, i=0,1,2...,9. Furthermore, for a plaintext data X of length n, let v=nu, A=X[1…u], B=X[u+1,n], when the plaintext data is encrypted using the format-preserving encryption FF1 algorithm, the data B is hashed with the derived key as the intermediate value R, and the formula is expressed as: R=SM3(pkey i ,P||Q) P=[1]||[2]||[1]||[radix] 3 ||

[0010] ||[u mod 256]||[n] 4 ||[t] 4 Q=T||[0] (-t-b-1)mod16 ||[i]||[NUM radix (B)] b Where SM3(k, data) means the hash value of data data with key k is calculated using SM3 algorithm, pkey i is a derived key, || indicates concatenation, radix indicates the base, NUM radix () indicates a radix-based number, [] indicates a single-byte character, i indicates the number of iterations of the format-preserving encryption algorithm, mod indicates the modulus operator, LOG(radix) means to find the logarithm of the base radix with base 2. Indicates rounding up. Indicates rounding down, T is the length is the default string for t, [s] N Represents the N-byte string representation of s. Furthermore, the adopting of symmetric block cipher operation to process the intermediate quantity R and the derived key to generate the intermediate quantity S includes: The intermediate quantity R and the derived key are processed using the SM4 algorithm to obtain a grouping result, which is expressed as follows: In the formula, SM4(k, data) means that the SM4 algorithm is used to perform a symmetric block cipher operation with key k on the data data, and pkey i is the derived key, || represents concatenation, Represents the exclusive OR operation, Indicates rounding down. LOG(radix) means to find the logarithm of the base radix with base 2; The first d bytes of the grouping result are used as the intermediate quantity S. Further, generating ciphertext data based on the intermediate quantity S and the data A includes: Let C = STR radix m (c), where c = (NUM radix (A)+y)mod radix m , y=NUM(S), when i is an even number, m=u, when i is an odd number, m=v, v=nu, n is the length of the plaintext data, NUM radix () indicates the number representation based on radix, NUM() indicates the conversion of byte string to integer, STR radix m (c) represents the integer c as a string with radix as the base and length m, and mod represents the modulus operator; Let data A=B, data B=C, and obtain the ciphertext data Y=A||B, where || represents concatenation. In a second aspect, the present invention proposes a data decryption method based on the FF1 format preservation algorithm, the method comprising: obtaining ciphertext data, and selecting a key based on a key identifier carried in the ciphertext data; The key is transformed by using a keyed cryptographic hash algorithm based on the SM3 algorithm to obtain a derived key; When the format-preserving decryption FF1 algorithm is used to perform each round of decryption operation on the ciphertext data, a hash value calculation with the derived key is performed on the ciphertext A' to obtain an intermediate quantity R, wherein the ciphertext data includes the ciphertext A' and the ciphertext B'; Using a symmetric block cipher operation, the intermediate quantity R and the derived key are processed to generate an intermediate quantity S; Based on the intermediate quantity S and the ciphertext B', plaintext data is generated. Furthermore, the keys are multiple fresh keys generated by a quantum key distribution network and synchronized among quantum network nodes throughout the network, and are shared among users in the same encryption and decryption domain. Furthermore, the key is transformed using a keyed cryptographic hash algorithm based on the SM3 algorithm to obtain a derived key, which is expressed as follows: pkey i =KF(ID k _Key,IDk ,salt i ,n`,i) P1 = HMAC_SM3 (ID k _Key,ID k ||salt i ||i||“FF1key derivation”) P2 = HMAC_SM3 (ID k _Key,P1) … P n` =HMAC_SM3(ID k _Key,P n`-1 ); In the formula, pkey i To derive the key, salt i is the salt value, n' is the number of iterations of key derivation, ID k _Key is the key, KF() is the key derivation function, P1~P n` is the intermediate quantity calculated by the key derivation function, "FF1key derivation" is a fixed string, HMAC_SM3 is a keyed cryptographic hash algorithm based on the SM3 algorithm, || indicates concatenation, Represents XOR operation, i=0,1,2...,9. Furthermore, for the ciphertext data Y of length n, let v=nu, A`=Y[1…u], B`=Y[u+1,n], when the ciphertext data is decrypted using the format-preserving decryption FF1 algorithm, the ciphertext A` is hashed with the derived key as the intermediate quantity R, and the formula is expressed as: R=SM3(pkey i ,P||Q) P=[1]||[2]||[1]||[radix] 3 ||

[0010] ||[u mod 256]||[n] 4 ||[t] 4 Q=T||[0] (-t-b-1)mod16 ||[i]||[NUM radix (A`)] b Where SM3(k, data) means the hash value of data data with key k is calculated using SM3 algorithm, pkey iis a derived key, || indicates concatenation, radix indicates the base, NUM radix () indicates a radix-based numeric representation, [] indicates a single-byte character, i indicates the number of iterations of the format-preserving encryption, and mod indicates the modulus operator. LOG(radix) means to find the logarithm of the base radix with base 2. Indicates rounding up. Indicates rounding down, T is a preset string of length t, [s] N Represents a string of N bytes. Furthermore, the adopting of symmetric block cipher operation to process the intermediate quantity R and the derived key to generate the intermediate quantity S includes: The intermediate quantity R and the derived key are processed using the SM4 algorithm to obtain a grouping result, which is expressed as follows: In the formula, SM4(k, data) means that the SM4 algorithm is used to perform a symmetric block cipher operation with key k on the data data, and pkey i is the derived key, || represents concatenation, represents the exclusive OR operation, Indicates rounding down. LOG(radix) means to find the logarithm of the base radix with base 2; The first d bytes of the grouping result are used as the intermediate quantity S. Further, generating plaintext data based on the intermediate quantity S and the ciphertext B' includes: Let C = STR radix m (c), where c = (NUM radix (B`)-x)mod radix m , x = NUM(S), when i is an even number, m = u, when i is an odd number, m = v, NUM radix () indicates the digital representation based on radix, NUM() indicates the conversion from byte string to integer, STR radix m (c) represents the integer c as a string with radix as the base and length m; Let data A`=B`, data B`=C, and obtain the plaintext data X=A`||B`, where || represents concatenation. In a third aspect, the present invention proposes a device for enhancing the security of FF1 format-preserving encryption, the device comprising: a key selection module for randomly selecting a key and transforming the key using a keyed cryptographic hash algorithm based on an SM3 algorithm to obtain a derived key; A first encryption module, used for performing a hash value calculation with the derived key on data B to obtain an intermediate value R when performing each round of encryption operation on the plaintext data using the format-preserving encryption FF1 algorithm, wherein the plaintext data includes data A and data B; A second encryption module, used to process the intermediate quantity R and the derived key using a symmetric block cipher operation to generate an intermediate quantity S; The ciphertext generation module is used to generate ciphertext data based on the intermediate quantity S and data A. In a fourth aspect, the present invention proposes a data decryption device based on the FF1 format preservation algorithm, the device comprising: a ciphertext acquisition module, used to acquire ciphertext data and select a key based on a key identifier carried in the ciphertext data; A key derivation module, used to transform the key using a keyed cryptographic hash algorithm based on the SM3 algorithm to obtain a derived key; A first decryption module, configured to perform a hash value calculation with the derived key on the ciphertext B' to obtain an intermediate value R when performing each round of decryption operation on the ciphertext data using the format-preserving decryption FF1 algorithm, wherein the ciphertext data includes the ciphertext A' and the ciphertext B'; A second decryption module, used to process the intermediate quantity R and the derived key using a symmetric block cipher operation to generate an intermediate quantity S; The plaintext generation module is used to generate plaintext data based on the intermediate quantity S and the ciphertext A'. In a fifth aspect, the present invention proposes a data encryption and decryption system based on the FF1 format preservation algorithm, the system comprising a first user node and a second user node, the first user node and the second user node are both connected to a quantum key distribution network, wherein: The quantum key distribution network is used to generate and synchronize multiple keys in quantum network nodes throughout the network, and import the keys into the first user node and the second user node via a secure storage medium; The first user node is used to encrypt the plaintext data using the method for retaining encryption security in the enhanced FF1 format as described above, obtain the ciphertext data and send it to the second user node; The second user node is used to decrypt the ciphertext data to obtain the plaintext data. The advantages of the present invention are: (1) When performing format-preserving encryption on plain text, the present invention securely derives a randomly selected key based on the key-based cryptographic hash algorithm of the SM3 algorithm to generate multiple derived keys that meet forward and backward security requirements, and calls different derived keys in each round of encryption operations of the format-preserving encryption to randomly expand the key space, thereby increasing the complexity of the algorithm and the information redundancy, and improving the difficulty of cracking the format-preserving encryption. (2) The present invention makes real-time calls in each round of calls based on the characteristic data of the current round (including the round key) and combines SM3 and SM4 to generate intermediate quantities. (3) A large number of pre-shared keys with a unified key identification number index are distributed to user nodes through the quantum key distribution network (Quantum Key Distribution, QKD), which can securely share large-capacity keys. Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS FIG1 is a flow chart of a method for enhancing the FF1 format to preserve encryption security according to an embodiment of the present invention; 2 is a schematic flow chart of a data decryption method based on the FF1 format preservation algorithm according to an embodiment of the present invention; 3 is a schematic diagram of the structure of a device for enhancing the FF1 format to retain encryption security according to an embodiment of the present invention; 4 is a schematic diagram of the structure of a data decryption device based on the FF1 format preservation algorithm proposed in one embodiment of the present invention; 5 is a schematic diagram of the structure of a data encryption and decryption system based on the FF1 format preservation algorithm proposed in one embodiment of the present invention; FIG. 6 is a flowchart of a data encryption and decryption system based on the FF1 format preservation algorithm proposed in an embodiment of the present invention. DETAILED DESCRIPTION In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described in combination with the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Example 1 As shown in FIG1 , the first embodiment of the present invention proposes a method for enhancing the security of FF1 format-preserving encryption, the method comprising: S101, randomly selecting a key, and transforming the key using a keyed cryptographic hash algorithm based on the SM3 algorithm to obtain a derived key; S102, when using the format-preserving encryption FF1 algorithm to perform each round of encryption operation on the plaintext data, the data B is encrypted with The hash value of the derived key is calculated to obtain an intermediate value R, wherein the plaintext data includes data A and data B; S103, using a symmetric block cipher operation to process the intermediate quantity R and the derived key to generate an intermediate quantity S; S104. Generate ciphertext data based on the intermediate quantity S and data A. When performing format-preserving encryption on plain text, this embodiment securely derives a randomly selected key based on the key-based cryptographic hashing algorithm of the SM3 algorithm, generates multiple derived keys that meet forward and backward security requirements, and calls the derived keys in each round of encryption operations of the format-preserving encryption, randomly expanding the key space, increasing the complexity of the algorithm and information redundancy, and improving the difficulty of cracking the format-preserving encryption. In one embodiment, the key is a plurality of fresh keys generated by a quantum key distribution network and synchronized among quantum network nodes of the entire network, and is shared among users in the same encryption and decryption domain. In one embodiment, the key is identified by a key ID. Specifically, this embodiment generates multiple 128-bit fresh keys identified by 32-bit key IDs through the quantum key distribution network QKD and synchronizes them in the quantum network nodes of the entire network, and uses secure storage media such as secure SIM cards, secure TF cards or secure U shields to inject keys and import them into the local storage and running space of user nodes for user nodes to call when performing plaintext encryption. In one embodiment, the step S101: randomly selecting a key and transforming the key using a keyed cryptographic hash algorithm based on the SM3 algorithm to obtain a derived key specifically includes the following steps: S111, randomly select an ID k Key ID k _Key; S112, using a key cryptographic hash algorithm based on the SM3 algorithm to encrypt the key ID k _Key is transformed, and the formula is expressed as: pkey i =KF(ID k _Key,ID k ,salt i ,n`,i) P1 = HMAC_SM3 (IDk _Key,ID k ||salt i ||i||“FF1key derivation”) P2 = HMAC_SM3 (ID k _Key,P1) … P n` =HMAC_SM3(ID k _Key,P n`-1 ); In the formula, pkey i To derive the key, salt i is the salt value, n' is the number of iterations of key derivation, KF() is the key derivation function, P1~P n` is the intermediate quantity calculated by the key derivation function, "FF1key derivation" is a fixed string, HMAC_SM3 is a keyed cryptographic hash algorithm based on the SM3 algorithm, || indicates concatenation, Represents XOR operation, i=0,1,2...,9. It should be noted that number is the number of iterations that can be specified, and salt0 to salt9 are 512-bit salt values ​​that can be derived from random numbers or predefined strings and are shared among users in the same encryption and decryption domain. In one embodiment, for a plaintext data X of length n, 2≤n≤2 32 And for the basis radix∈[2,2 16 ], radix n ≥1000000, let v=nu, A=X[1…u], B=X[u+1,n], the step S102: when the plaintext data is encrypted using the format-preserving encryption FF1 algorithm, the data B is hashed with the derived key as the intermediate value R, and the formula is expressed as: R=SM3(pkey i ,P||Q) P=[1]||[2]||[1]||[radix] 3 ||

[0010] ||[u mod 256]||[n] 4 ||[t] 4 Q=T||[0] (-t-b-1)mod16 ||[i]||[NUM radix (B)] b Where SM3(k, data) means the hash value of data data with key k is calculated using SM3 algorithm, pkey i is a derived key, || indicates concatenation, radix indicates the base, NUM radix () indicates a radix-based number, [] indicates a single-byte character, i indicates the number of iterations of the format-preserving encryption algorithm, mod indicates the modulus operator, LOG(radix) means to find the logarithm of the base radix with base 2. Indicates rounding up. Indicates rounding down, T is a preset string of length t, [s] N Represents a string of N bytes. In one embodiment, the step S103: using a symmetric block cipher operation to process the intermediate quantity R and the derived key to generate the intermediate quantity S, comprises the following steps: S131, using the SM4 algorithm to process the intermediate quantity R and the derived key to obtain a grouping result, which is expressed as: In the formula, SM4(k, data) means that the SM4 algorithm is used to perform a symmetric block cipher operation with key k on the data data, and pkey i is the derived key, || represents concatenation, represents the exclusive OR operation, Indicates rounding down. LOG(radix) means to find the logarithm of the base radix with base 2; S132. Use the first d bytes of the grouping result as the intermediate quantity S. In one embodiment, the step S104: generating ciphertext data based on the intermediate quantity S and the data A, comprises the following steps: S141, let C = STR radix m (c), where c = (NUM radix (A)+y)mod radix m , y=NUM(S), when i is an even number, m=u, when i is an odd number, m=v, v=nu, n is the length of the plaintext data, NUM radix () indicates the number representation based on radix, NUM() indicates the conversion of byte string to integer, STRradix m (c) represents the integer c as a string with radix as the base and length m, and mod represents the modulus operator; S142, let data A=B, data B=C, and obtain the ciphertext data Y=A||B, where || represents concatenation. Example 2 As shown in FIG2 , the second embodiment of the present invention proposes a data decryption method based on the FF1 format preservation algorithm. The method includes the following steps: S201, obtaining ciphertext data, and selecting a key based on a key identifier carried in the ciphertext data; S202, transforming the key using a keyed cryptographic hash algorithm based on the SM3 algorithm to obtain a derived key; S203, when performing each round of decryption operation on the ciphertext data using the format-preserving decryption FF1 algorithm, performing a hash value calculation with the derived key on the ciphertext A' to obtain an intermediate value R, wherein the ciphertext data includes the ciphertext A' and the ciphertext B'; S204, using a symmetric block cipher operation to process the intermediate quantity R and the derived key to generate an intermediate quantity S; S205. Generate plaintext data based on the intermediate quantity S and the ciphertext B'. In one embodiment, the key is a plurality of fresh keys generated by a quantum key distribution network and synchronized among quantum network nodes of the entire network, and is shared among users in the same encryption and decryption domain. In one embodiment, the step S02: transforming the key using a keyed cryptographic hash algorithm based on the SM3 algorithm to obtain a derived key, which is expressed as: pkey i =KF(ID k _Key,ID k ,salt i ,n`,i) P1 = HMAC_SM3 (ID k _Key,ID k ||salt i ||i||“FF1key derivation”) P2 = HMAC_SM3 (ID k _Key,P1) … P n` =HMAC_SM3(ID k _Key,P n`-1 ); In the formula, pkey i To derive the key, salt i is the salt value, n` is the number of iterations, ID k _Key is the key, KF() is the key derivation function, P1~P n` is the intermediate quantity calculated by the key derivation function, "FF1key derivation" is a fixed string, HMAC_SM3 is a keyed cryptographic hash algorithm based on the SM3 algorithm, || indicates concatenation, Represents XOR operation, i=0,1,2...,9. In one embodiment, for the ciphertext data Y of length n, let v=nu, A`=Y[1…u], B`=Y[u+1,n], the step S203: when the ciphertext data is decrypted using the format-preserving decryption FF1 algorithm, the ciphertext A` is hashed with the derived key as the intermediate quantity R, and the formula is expressed as: R=SM3(pkey i ,P||Q) P=[1]||[2]||[1]||[radix] 3 ||

[0010] ||[u mod 256]||[n] 4 ||[t] 4 Q=T||[0] (-t-b-1)mod16 ||[i]||[NUM radix (A`)] b Where SM3(k, data) means the hash value of data data with key k is calculated using SM3 algorithm, pkey i is a derived key, || indicates concatenation, radix indicates the base, NUM radix () indicates a radix-based number, [] indicates a single-byte character, i indicates the number of iterations of the format-preserving encryption algorithm, mod indicates the modulus operator, LOG(radix) means to find the logarithm of the base radix with base 2. Indicates rounding up. Indicates rounding down, T is a preset string of length t, [s] N Represents a string of N bytes. In one embodiment, the step S204: using a symmetric block cipher operation to process the intermediate quantity R and the derived key to generate the intermediate quantity S, comprises the following steps: S241, using SM4 algorithm to process the intermediate quantity R and the derived key to obtain a grouping result, which is expressed as: In the formula, SM4(k, data) means that the SM4 algorithm is used to perform a symmetric block cipher operation with key k on the data data, and pkey i is the derived key, || represents concatenation, represents the exclusive OR operation, Indicates rounding down. LOG(radix) means to find the logarithm of the base radix with base 2; S242. Use the first d bytes of the grouping result as the intermediate quantity S. In one embodiment, the step S205: generating plaintext data based on the intermediate quantity S and the ciphertext B' comprises the following steps: S251, let C = STR radix m (c), where c = (NUM radix (B`)-x)mod radix m , x = NUM(S), when i is an even number, m = u, when i is an odd number, m = v, NUM radix () indicates the number representation based on radix, NUM() indicates the conversion of byte string to integer, STR radix m (c) represents the integer c as a string with radix as the base and length m; S252, let data A`=B`, data B`=C, and obtain the plaintext data X=A`||B`, where || represents concatenation. It should be noted that the symmetric decryption process proposed in this embodiment is the inverse process of the symmetric encryption proposed in the above-mentioned embodiment 1. By using different derived keys in each round of decryption operation and using the SM3 algorithm to transform important parameters in each round of decryption operation, the key space is increased, and the overall algorithm complexity and security are enhanced. Example 3 As shown in FIG3 , the third embodiment of the present invention proposes a device for enhancing the security of FF1 format-preserving encryption, the device comprising: The key selection module 11 is used to randomly select a key and transform the key using a keyed cryptographic hash algorithm based on the SM3 algorithm to obtain a derived key; A first encryption module 12 is used to perform a hash value calculation with the derived key on data B to obtain an intermediate value R when performing each round of encryption operation on the plaintext data using the format-preserving encryption FF1 algorithm, wherein the plaintext data includes data A and data B; A second encryption module 13, used to process the intermediate quantity R and the derived key using a symmetric block cipher operation to generate an intermediate quantity S; The ciphertext generation module 14 is used to generate ciphertext data based on the intermediate quantity S and the data A. When performing format-preserving encryption on plain text, this embodiment securely derives a randomly selected key based on the key-based cryptographic hashing algorithm of the SM3 algorithm, generates multiple derived keys that meet forward and backward security requirements, and calls the derived keys in each round of encryption operations of the format-preserving encryption, randomly expanding the key space, increasing the complexity of the algorithm and information redundancy, and improving the difficulty of cracking the format-preserving encryption. In one embodiment, the key is a plurality of fresh keys generated by a quantum key distribution network and synchronized among quantum network nodes of the entire network, and is shared among users in the same encryption and decryption domain. In one embodiment, the key is identified by a key ID. In one embodiment, the key selection module 11 specifically includes: The key random selection unit is used to randomly select the ID k Key ID k _Key; A key derivation unit is used to derive the key ID using a key cryptographic hash algorithm based on the SM3 algorithm. k _Key is transformed, and the key derivation function formula is expressed as: pkey i =KF(ID k _Key,ID k ,salt i ,n`,i) P1 = HMAC_SM3 (ID k _Key,ID k ||salt i ||i||“FF1key derivation”) P2 = HMAC_SM3 (ID k _Key,P1) … P n` =HMAC_SM3(ID k _Key,P n`-1 ); In the formula, pkey i To derive the key, salt i is the salt value, n' is the number of iterations of key derivation, KF() is the key derivation function, P1~P n` is the intermediate quantity calculated by the key derivation function, "FF1key derivation" is a fixed string, HMAC_SM3 is a keyed cryptographic hash algorithm based on the SM3 algorithm, || indicates concatenation, Represents XOR operation, i=0,1,2...,9. In one embodiment, for a plaintext data X of length n, let v=nu, A=X[1…u], B=X[u+1,n], the first encryption module 12 is specifically used to: when the format-preserving encryption FF1 algorithm is used to encrypt the plaintext data, the data B is hashed with the derived key as the intermediate value R, and the formula is expressed as: R=SM3(pkey i ,P||Q) P=[1]||[2]||[1]||[radix] 3 ||

[0010] ||[u mod 256]||[n] 4 ||[t] 4 Q=T||[0] (-t-b-1)mod16 ||[i]||[NUM radix (B)] b Where SM3(k, data) means the hash value of data data with key k is calculated using SM3 algorithm, pkey i is a derived key, || indicates concatenation, radix indicates the base, NUM radix () indicates a radix-based number, [] indicates a single-byte character, i represents the number of iterations of the format-preserving encryption algorithm, mod represents the modulus operator, LOG(radix) means to find the logarithm of the base radix with base 2. Indicates rounding up. Indicates rounding down, T is a preset string of length t, [s] N Represents a string of N bytes. In one embodiment, the second encryption module 13 specifically includes: The encryption unit is used to process the intermediate quantity R and the derived key using the SM4 algorithm to obtain a grouping result, which is expressed as follows: In the formula, SM4(k, data) means that the SM4 algorithm is used to perform a symmetric block cipher operation with key k on the data data, and pkey i is the derived key, || represents concatenation, represents the exclusive OR operation, Indicates rounding down. LOG(radix) means to find the logarithm of the base radix with base 2; The intermediate quantity S generating unit is used to use the first d bytes of the grouping result as the intermediate quantity S. In one embodiment, the ciphertext generation module 14 is specifically used to: Let C = STR radix m (c), where c = (NUM radix (A)+y)mod radix m , y=NUM(S), when i is an even number, m=u, when i is an odd number, m=v, v=nu, n is the length of the plaintext data, NUM radix () indicates the number representation based on radix, NUM() indicates the conversion of byte string to integer, STR radix m (c) represents the integer c as a string with radix as the base and length m, and mod represents the modulus operator; Let data A=B, data B=C, and obtain the ciphertext data Y=A||B, where || represents concatenation. Example 4 As shown in FIG. 4 , the fourth embodiment of the present invention proposes a data decryption device based on the FF1 format preservation algorithm, the device comprising: A ciphertext acquisition module 21 is used to acquire ciphertext data and select a key based on a key identifier carried in the ciphertext data; a key derivation module 22 is used to transform the key using a keyed cryptographic hash algorithm based on the SM3 algorithm to obtain a derived key; A first decryption module 23 is used to perform a hash value calculation with the derived key on the ciphertext B' to obtain an intermediate value R when performing each round of decryption operation on the ciphertext data using the format-preserving decryption FF1 algorithm, wherein the ciphertext data includes the ciphertext A' and the ciphertext B'; A second decryption module 24, configured to process the intermediate quantity R and the derived key using a symmetric block cipher operation to generate an intermediate quantity S; The plaintext generation module 25 is used to generate plaintext data based on the intermediate quantity S and the ciphertext A'. In one embodiment, the key is a plurality of fresh keys generated by a quantum key distribution network and synchronized among quantum network nodes of the entire network, and is shared among users in the same encryption and decryption domain. In one embodiment, the key derivation module 22 is specifically used to transform the key using a key derivation function, and the key derivation function formula is expressed as: pkey i =KF(ID k _Key,ID k ,salt i ,n`,i) P1 = HMAC_SM3 (ID k _Key,ID k ||salt i ||i||“FF1key derivation”) P2 = HMAC_SM3 (ID k _Key,P1) … P n` =HMAC_SM3(ID k _Key,P n`-1 ); In the formula, pkey i To derive the key, salt i is the salt value, n' is the number of iterations of key derivation, ID k _Key is the key, KF() is the key derivation function, P1~P n` is the intermediate quantity calculated by the key derivation function, "FF1key derivation" is a fixed string, HMAC_SM3 is a keyed cryptographic hash algorithm based on the SM3 algorithm, || indicates concatenation, Represents XOR operation, i=0,1,2...,9. In one embodiment, for the ciphertext data Y of length n, let v=nu, A`=Y[1…u], B`=Y[u+1,n], the first decryption module 23 is specifically used for: When the FF1 algorithm for format-preserving decryption is used to perform each round of decryption operation on the ciphertext data, the hash value of the ciphertext A' with the derived key is calculated to obtain the intermediate quantity R, which is expressed as follows: R=SM3(pkey i ,P||Q) P=[1]||[2]||[1]||[radix] 3 ||

[0010] ||[u mod 256]||[n] 4 ||[t] 4 Q=T||[0] (-t-b-1)mod16 ||[i]||[NUM radix (A`)] b Where SM3(k, data) means the hash value of data data with key k is calculated using SM3 algorithm, pkey i is a derived key, || indicates concatenation, radix indicates the base, NUM radix () indicates a radix-based number, [] indicates a single-byte character, i indicates the number of iterations of the format-preserving encryption algorithm, mod indicates the modulus operator, LOG(radix) means to find the logarithm of the base radix with base 2. Indicates rounding up. Indicates rounding down, T is a preset string of length t, [s] N Represents a string of N bytes. In one embodiment, the second decryption module 24 specifically includes: The decryption unit is used to process the intermediate quantity R and the derived key using the SM4 algorithm to obtain a grouping result, which is expressed as follows: In the formula, SM4(k, data) means that the SM4 algorithm is used to perform a symmetric block cipher operation with key k on the data data, and pkey i is the derived key, || represents concatenation, represents the exclusive OR operation, Indicates rounding down. LOG(radix) means to find the logarithm of the base radix with base 2; The intermediate quantity S generating unit is used to use the first d bytes of the grouping result as the intermediate quantity S. In one embodiment, the plaintext generation module 25 is specifically used for: Let C = STR radix m (c), where c = (NUM radix (B`)-x)mod radix m , x = NUM(S), when i is an even number, m = u, when i is an odd number, m = v, NUM radix () indicates the number representation based on radix, NUM() indicates the conversion of byte string to integer, STR radix m (c) represents the integer c as a string with radix as the base and length m; Let data A`=B`, data B`=C, and obtain the plaintext data X=A`||B`, where || represents concatenation. Example 5 As shown in FIG5 , the fifth embodiment of the present invention proposes a data encryption and decryption system based on the FF1 format preservation algorithm, wherein the system includes a first user node 1 and a second user node 2, wherein the first user node 1 and the second user node 2 are both connected to a quantum key distribution network 3, wherein: The quantum key distribution network 3 is used to generate and synchronize multiple keys in quantum network nodes throughout the network, and import the keys into the first user node 1 and the second user node 2 via a secure storage medium; The first user node 1 is used to encrypt the plaintext data using the method for retaining encryption security in the enhanced FF1 format as described in the above embodiment 1, obtain the ciphertext data and send it to the second user node; The second user node 2 is used to decrypt the ciphertext data using the decryption method described in the above embodiment 2 to obtain the plaintext data. Specifically, the user node is used to perform data encryption and decryption using the keys distributed by the quantum key distribution network and the FF1-SM4 format preservation algorithm, and uses secure storage media such as secure SIM cards, secure TF cards or secure U shields to inject keys and import them into local storage and running space. The key agent is used to provide the proxy functions of key injection and key distribution when the communication participants cannot directly perform key injection and key distribution at the nodes of the quantum key distribution network. The quantum key distribution network includes quantum network nodes and a quantum network link control center, which realizes quantum key generation and distribution, quantum key relay, quantum key provision and other services; quantum network nodes are used to store generated quantum keys, receive key applications from key agents, provide keys to key agents or directly provide key injection and key distribution services; the quantum network link control center is used to establish quantum key distribution and relay links between nodes according to the quantum network node ID. It should be noted that the workflow of the data encryption and decryption system based on the FF1 format preservation algorithm is shown in Figure 6: (1) Generate multiple 128-bit fresh keys identified by 32-bit key IDs through the quantum key distribution network QKD and synchronize them in the quantum network nodes of the entire network, and use secure storage media such as secure SIM cards, secure TF cards or secure U shields to inject the keys and import them into the local storage and operation space of the first user node and the second user node; (2) The user node that encrypts a piece of data randomly selects a key identifier as ID k pre-shared key and ID k Identifier key ID k _Key is transformed as follows: P1 = HMAC_SM3 (ID k _Key,ID k ||salt i ||i||"FF1key derivation"); P2 = HMAC_SM3 (ID k _Key,P1); … P n` =HMAC_SM3(ID k _Key,P n`-1 ); For i from 0 to 9: pkey i =KF(ID k _Key,ID k ,salt i ,n`,i) Where number is the number of iterations that can be specified, salt0 to salt9 are 512-bit salt values ​​that can be derived from random numbers or predefined strings and are shared among users in the same encryption and decryption domain, and HMAC_SM3 is a keyed cryptographic hash (HMAC) algorithm based on the SM3 algorithm. (3) For plaintext data X of length n, 2≤n≤2 32 And for the basis radix∈[2,216 ], radix n ≥1000000, [s] N Indicates that s is repeated N times, and the first user node encrypts the plaintext data as follows: make v=nu,A=X[1…u],B=X[u+1,n],T is a preset string of length t, P=[1]||[2]||[1]||[radix] 3 ||

[0010] ||[u mod256]||[n] 4 ||[t] 4 ; By NUM radix () represents a number based on radix, NUM() represents the conversion of a byte string to an integer, STR radix m (N) means that the integer N is represented as a radix-based m-length string, SM3(k, data) means that the hash value of data with key k is calculated using SM3, and SM4(k, data) means that the symmetric block cipher operation is performed on data using the SM4 algorithm. For i from 0 to 9: Q=T||[0] (-t-b-1)mod16 ||[i]||[NUM radix (B)] b R=SM3(pkey i ,P||Q) Take S as the first d bytes of the following group: y=NUM(S) m = u (i = even number) / v (i = odd number) c=(NUM radix (A)+y)mod radix m C=STR radix m (c) A=B B=C Return the encryption result Y=A||B. (4) The process of the second user node decrypting the ciphertext data Y includes: For the ciphertext data Y of length n, let A`=Y[1…u], B`=Y[u+1,n], then for i from 9 to 0: Q=T||[0] (-t-b-1)mod16 ||[i]||[NUMradix (A`)] b R=SM3(pkey i ,P||Q) Take S as the first d bytes of the following group x=NUM(S) m = u (i = even number) / v (i = odd number) c=(NUM radix (B`)-x)mod radix m C=STR radix m (c) B`=A` A`=C Return the decryption result X=A`||B`. This embodiment distributes a large number of pre-shared keys with a unified key identification number index to user nodes through the quantum key distribution network QKD, which can safely share large-capacity keys; and generates multiple derived keys that meet forward and backward security based on the key hash algorithm of SM3 to perform encryption and decryption operations in each round of FF1-SM4 format-preserving encryption. In addition to key derivation, the key cryptographic hash function HMAC is also used in the format-preserving encryption process to transform and derive related data, randomly expand the key space, increase the complexity of the algorithm and information redundancy, and increase the difficulty of cracking the format-preserving encryption. In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A method for enhancing the FF1 format to preserve encryption security, characterized in that: The method comprises: Randomly select a key and transform the key using a keyed cryptographic hash algorithm based on the SM3 algorithm to obtain a derived key; When the format-preserving encryption FF1 algorithm is used to perform each round of encryption operation on the plaintext data, a hash value calculation with the derived key is performed on the data B to obtain an intermediate quantity R, wherein the plaintext data includes the data A and the data B; Using a symmetric block cipher operation, the intermediate quantity R and the derived key are processed to generate an intermediate quantity S; Based on the intermediate quantity S and data A, ciphertext data is generated.

2. The method for enhancing the FF1 format to preserve encryption security as claimed in claim 1, characterized in that: The keys are multiple fresh keys generated by a quantum key distribution network and synchronized among quantum network nodes across the entire network, and are shared among users in the same encryption and decryption domain.

3. The method for enhancing the FF1 format to preserve encryption security as claimed in claim 1, characterized in that: The key is identified by a key ID.

4. The method for enhancing the FF1 format to preserve encryption security as claimed in claim 1, characterized in that: The randomly selected key and the key is transformed by using a keyed cryptographic hash algorithm based on the SM3 algorithm to obtain a derived key, including: Randomly select an ID k Key ID k _Key; The key ID is encrypted using a key cryptographic hash algorithm based on the SM3 algorithm. k _Key is transformed, and the formula is expressed as: pkey i =KF(ID k _Key,ID k ,salt i ,n`,i) P1=HMAC_SM3(ID k _Key,ID k ||salt i ||i||"FF1 key derivation”) P2=HMAC_SM3(ID k _Key,P1) …… P n` =HMAC_SM3(ID k _Key,P n`-1 ); In the formula, pkey i To derive the key, salt i is the salt value, n' is the number of iterations, KF() is the key derivation function, P1~P n` is the intermediate quantity calculated by the key derivation function, "FF1 key derivation" is a fixed string, HMAC_SM3 is a keyed cryptographic hash algorithm based on the SM3 algorithm, || indicates concatenation, Represents XOR operation, i=0,1,2...,9.

5. The method for enhancing the FF1 format to preserve encryption security as claimed in claim 1, characterized in that: For a plaintext data X of length n, let v=nu, A=X[1…u], B=X[u+1,n], when the format-preserving encryption FF1 algorithm is used to perform each round of encryption operation on the plaintext data, the data B is subjected to a hash value calculation with the derived key to obtain an intermediate quantity R, which is expressed as follows: R=SM3(pkey i ,P||Q) P=[1]||[2]||[1]||[radix] 3 ||[10]||[u mod 256]||[n] 4 ||[t] 4 Q=T||[0] (-t-b-1)mod16 ||[i]||[NUM radix (B)] b Where SM3(k, data) means the hash value of data data with key k is calculated using SM3 algorithm, pkey i is a derived key, || indicates concatenation, radix indicates the base, NUM radix () indicates a radix-based number, [] indicates a single-byte character, i indicates the number of iterations of the format-preserving encryption algorithm, mod indicates the modulus operator, LOG(radix) means to find the logarithm of the base radix with base 2. Indicates rounding up. Indicates rounding down, T is a preset string of length t, [s] N Represents a string of N bytes.

6. The method for enhancing the FF1 format to preserve encryption security as claimed in claim 1, characterized in that: The adopting of symmetric block cryptographic operation to process the intermediate quantity R and the derived key to generate the intermediate quantity S comprises: The intermediate quantity R and the derived key are processed using the SM4 algorithm to obtain a grouping result, which is expressed as follows: In the formula, SM4(k, data) means that the SM4 algorithm is used to perform a symmetric block cipher operation with key k on the data data, and pkey i is the derived key, || represents concatenation, Represents the exclusive OR operation, Indicates rounding down. LOG(radix) means to find the logarithm of the base radix with base 2; The first d bytes of the grouping result are used as the intermediate quantity S.

7. The method for enhancing the FF1 format to preserve encryption security as claimed in claim 1, characterized in that: The step of generating ciphertext data based on the intermediate quantity S and the data A comprises: Let C = STR radix m (c), where c = (NUM radix (A)+y)mod radix m , y=NUM(S), when i is an even number, m=u, when i is an odd number, m=v, v=nu, n is the length of the plaintext data, NUM radix () indicates the number representation based on radix, NUM() indicates the conversion of byte string to integer, STR radix m (c) means to represent the integer c as a string with radix as the base and length m, mod means the modulus operator, Indicates rounding up; Let data A=B, data B=C, and obtain the ciphertext data Y=A||B, where || represents concatenation.

8. A data decryption method based on the FF1 format preservation algorithm, characterized in that: The method comprises: Acquire ciphertext data, and select a key based on a key identifier carried in the ciphertext data; The key is transformed by using a keyed cryptographic hash algorithm based on the SM3 algorithm to obtain a derived key; When the format-preserving decryption FF1 algorithm is used to perform each round of decryption operation on the ciphertext data, a hash value calculation with the derived key is performed on the ciphertext A' to obtain an intermediate quantity R, wherein the ciphertext data includes the ciphertext A' and the ciphertext B'; Using a symmetric block cipher operation, the intermediate quantity R and the derived key are processed to generate an intermediate quantity S; Based on the intermediate quantity S and the ciphertext B', plaintext data is generated.

9. The data decryption method based on the FF1 format preservation algorithm as claimed in claim 8, characterized in that: The keys are multiple fresh keys generated by a quantum key distribution network and synchronized among quantum network nodes across the entire network, and are shared among users in the same encryption and decryption domain.

10. The data decryption method based on the FF1 format preservation algorithm as claimed in claim 8, characterized in that: The key is transformed by using a keyed cryptographic hash algorithm based on the SM3 algorithm to obtain a derived key, which is expressed as: pkey i =KF(ID k _Key,ID k ,salt i ,n`,i) P1 = HMAC_SM3 (ID k _Key,ID k ||salt i ||i||"FF1 key derivation") P2=HMAC_SM3(ID k _Key,P1) ... P n` =HMAC_SM3(ID k _Key,P n`-1 ); In the formula, pkey i To derive the key, salt i is the salt value, n` is the number of iterations, ID k _Key is the key, KF() is the key derivation function, P1~P n` is the intermediate quantity calculated by the key derivation function, "FF1 key derivation" is a fixed string, HMAC_SM3 is a keyed cryptographic hash algorithm based on the SM3 algorithm, || indicates concatenation, Represents XOR operation, i=0,1,2...,9.

11. The data decryption method based on the FF1 format preservation algorithm as claimed in claim 8, characterized in that: For a ciphertext data Y of length n, let v=nu, A`=Y[1…u], B`=Y[u+1,n], when the format-preserving decryption FF1 algorithm is used to perform each round of decryption operation on the ciphertext data, the ciphertext A` is subjected to a hash value calculation with the derived key to obtain an intermediate quantity R, which is expressed as follows: R=SM3(pkey i ,P||Q) P=[1]||[2]||[1]||[radix] 3 ||[10]||[u mod 256]||[n] 4 ||[t] 4 Q=T||[0] (-t-b-1)mod16 ||[i]||[NUM radix (A`)] b Where SM3(k, data) means the hash value of data data with key k is calculated using SM3 algorithm, pkey i is a derived key, || indicates concatenation, radix indicates the base, NUM radix () indicates a radix-based number, [] indicates a single-byte character, i indicates the number of iterations of the format-preserving encryption algorithm, mod indicates the modulus operator, LOG(radix) means to find the logarithm of the base radix with base 2. Indicates rounding up. Indicates rounding down, T is a preset string of length t, [s] N Represents a string of N bytes.

12. The data decryption method based on the FF1 format preservation algorithm as claimed in claim 8, characterized in that: The adopting of symmetric block cryptographic operation to process the intermediate quantity R and the derived key to generate the intermediate quantity S comprises: The intermediate quantity R and the derived key are processed using the SM4 algorithm to obtain a grouping result, which is expressed as follows: In the formula, SM4(k, data) means that the SM4 algorithm is used to perform a symmetric block cipher operation with key k on the data data, and pkey i is the derived key, || represents concatenation, Represents the exclusive OR operation, Indicates rounding down. LOG(radix) means to find the logarithm of the base radix with base 2; The first d bytes of the grouping result are used as the intermediate quantity S.

13. The data decryption method based on the FF1 format preservation algorithm as claimed in claim 8, characterized in that: The generating of plaintext data based on the intermediate quantity S and the ciphertext B' comprises: Let C = STR radix m (c), where c = (NUM radix (B`)-x)mod radix m , x = NUM(S), when i is an even number, m = u, when i is an odd number, m = v, NUM radix () indicates the number representation based on radix, NUM() indicates the conversion of byte string to integer, STR radix m (c) represents the integer c as a string with radix as the base and length m; Let data A`=B`, data B`=C, and obtain the plaintext data X=A`||B`, where || represents concatenation.

14. A device for enhancing the FF1 format to preserve encryption security, characterized in that: The device comprises: A key selection module is used to randomly select a key and transform the key using a keyed cryptographic hash algorithm based on the SM3 algorithm to obtain a derived key; A first encryption module, used for performing a hash value calculation with the derived key on data B to obtain an intermediate value R when performing each round of encryption operation on the plaintext data using the format-preserving encryption FF1 algorithm, wherein the plaintext data includes data A and data B; A second encryption module, used to process the intermediate quantity R and the derived key using a symmetric block cipher operation to generate an intermediate quantity S; The ciphertext generation module is used to generate ciphertext data based on the intermediate quantity S and data A.

15. A data decryption device based on the FF1 format preservation algorithm, characterized in that: The device comprises: A ciphertext acquisition module, used to acquire ciphertext data and select a key based on a key identifier carried in the ciphertext data; A key derivation module, used to transform the key using a keyed cryptographic hash algorithm based on the SM3 algorithm to obtain a derived key; A first decryption module, configured to perform a hash value calculation with the derived key on the ciphertext B' to obtain an intermediate value R when performing each round of decryption operation on the ciphertext data using the format-preserving decryption FF1 algorithm, wherein the ciphertext data includes the ciphertext A' and the ciphertext B'; A second decryption module, used to process the intermediate quantity R and the derived key using a symmetric block cipher operation to generate an intermediate quantity S; The plaintext generation module is used to generate plaintext data based on the intermediate quantity S and the ciphertext A'.

16. A data encryption and decryption system based on the FF1 format preservation algorithm, characterized in that: The system includes a first user node and a second user node, wherein the first user node and the second user node are both connected to a quantum key distribution network, wherein: The quantum key distribution network is used to generate and synchronize multiple keys in quantum network nodes throughout the network, and import the keys into the first user node and the second user node via a secure storage medium; The first user node is used to encrypt the plaintext data using the method for enhancing the FF1 format to retain encryption security as described in any one of claims 1 to 7, obtain the ciphertext data and send it to the second user node; The second user node is used to decrypt the ciphertext data to obtain the plaintext data.

Citation Information

Patent Citations

  • Rapid implementation method and system format-reserved encryption, medium and equipment

    CN111783112A

  • Security enhancement method and device based on reserved format algorithm

    CN113079010A

  • Encryption calculation method for quickly retaining data format based on domestic commercial cryptographic algorithm

    CN115174039A

  • Method and device for enhancing FF1 format and retaining encryption security

    CN116707804A

  • Progressive Key Rotation for Format Preserving Encryption (FPE)

    US20180091294A1

Cited By

  • Multi-modal complex data format-reserved encrypted storage method based on national cryptographic algorithm

    CN120546854A