A Supply Chain Data Privacy Protection Method and System Based on Hybrid Encryption and Decryption

By adopting a hybrid encryption and decryption method in the supply chain data privacy protection system, differentiated encryption of sensitive data and basic data is solved, and the problems of low encryption and decryption efficiency and insufficient key security in existing systems are achieved, and efficient and secure data sharing and privacy protection are achieved.

CN119892507BActive Publication Date: 2025-06-24ANHUI AGRICULTURAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510363913.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-26
Publication Date
2025-06-24
Estimated Expiration
2045-03-26

AI Technical Summary

Technical Problem

The existing supply chain data privacy protection system lacks differentiated sharing solutions during data transmission and sharing, resulting in insufficient protection of sensitive data rather than excessive encryption of sensitive data, and low encryption and decryption efficiency, which cannot meet the supply chain management needs with high real-time requirements.

Method used

Using a method based on hybrid encryption and decryption, the data category is judged, the sensitive data is encrypted using a combination of symmetric and asymmetric combinations, the basic data is encrypted using symmetric encryption, and the key security is improved through an improved round key expansion algorithm.

Benefits of technology

Differentiated encryption of sensitive and non-sensitive data is realized, the efficiency and practicality of data sharing are improved, the security of privacy protection is enhanced, and the real-time needs of supply chain management are met.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119892507B_ABST
    Figure CN119892507B_ABST
Patent Text Reader

Abstract

The present invention relates to a method and system for protecting the privacy of supply chain data based on hybrid encryption and decryption, belonging to the technical field of data encryption and decryption. The method includes the following steps: responding to an access request and plaintext of user-uploaded data, judging the data category of the plaintext, and matching a corresponding encryption policy according to the judgment result; encrypting the plaintext into ciphertext based on the matched encryption policy. In the present invention, hybrid encryption is used for encrypting sensitive data, and symmetric encryption is used for encrypting basic data; during hybrid encryption, a key is randomly generated by the AES algorithm, a public-private key pair is randomly generated by the ECC algorithm, the plaintext is encrypted with the key by the AES algorithm, and the key is encrypted with the public key by the ECC algorithm to generate a key ciphertext; during symmetric encryption, the plaintext is encrypted with the key generated by the AES algorithm. For sensitive data and non-sensitive data, through a differential encryption policy, the efficiency and practicality of data sharing are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data encryption and decryption, and particularly relates to a supply chain data privacy protection method and system based on hybrid encryption and decryption. Background Art

[0002] With the increasing complexity and digitization of the global supply chain, information sharing has become a key means to improve supply chain efficiency and reduce the "bullwhip effect". Especially in the management of the agricultural product supply chain, all parties involved, such as producers, wholesalers, retailers, etc., need to share transaction information to achieve the transparency and efficient operation of the supply chain. However, information sharing also brings the risk of information leakage. Especially when it comes to sensitive data, privacy protection has become a key concern for all parties in the supply chain.

[0003] In recent years, encryption technology has played an important role in promoting information security sharing among enterprises, but it has also made the research on privacy protection solutions a research hotspot in the field of agricultural product supply chain management. Existing supply chain data privacy protection systems achieve data protection based on data encryption of traditional encryption algorithms, distributed ledgers of blockchain technology, and privacy information division models of data mining. These technologies have improved the security of data sharing to a certain extent, but there are still the following deficiencies:

[0004] (1) Lack of differentiated sharing scheme: In the process of data transmission and sharing in existing supply chain data privacy protection systems, a unified encryption method is often adopted, which fails to effectively distinguish sensitive data from non-sensitive data, resulting in insufficient protection of sensitive data and over-encryption of non-sensitive data, affecting the efficiency and practicability of data sharing.

[0005] (2) Encryption and decryption efficiency problem: Facing complex and large amounts of supply chain data, existing supply chain data privacy protection systems have low execution efficiency in the encryption and decryption processes on the premise of ensuring security, and cannot meet the requirements of supply chain management with high real-time requirements.

[0006] (3) Risk of key correlation: Existing technologies adopt the traditional AES algorithm, and the round keys of the previous round and the next round are strongly correlated. An attacker may crack all keys including the initial key by intercepting any round key, posing a great potential risk of privacy leakage.

[0007] It can be seen that existing supply chain data privacy protection systems and methods have significant deficiencies in differentiated sharing, encryption and decryption efficiency, key security, traceability data protection, resource consumption, and specific supply chain optimization. There is an urgent need to develop a more secure, efficient, and flexible supply chain data privacy protection system and method. Summary of the Invention

[0008] The object of the present invention is to provide a supply chain data privacy protection method and system based on hybrid encryption and decryption to solve the above problems.

[0009] The present invention achieves the above object through the following technical solutions:

[0010] An encryption method for supply chain data privacy protection, comprising the following steps:

[0011] Respond to the access request and plaintext of the user's uploaded data, judge the data category of the plaintext, and match the corresponding encryption policy according to the judgment result;

[0012] Encrypt the plaintext into ciphertext based on the matched encryption policy;

[0013] Among them, the encryption policy is:

[0014] When the data category is judged to be sensitive data, a hybrid encryption of symmetric and asymmetric combination is adopted; when the data category is judged to be basic data, symmetric encryption is adopted;

[0015] During the hybrid encryption process, the first key is randomly generated by the AES algorithm, the public and private key pairs are randomly generated by the ECC algorithm, the plaintext is encrypted by the AES algorithm using the first key to generate the sensitive data ciphertext, and the first key is encrypted by the ECC algorithm using the public key in the public and private key pairs to generate the key ciphertext; during the symmetric encryption process, the second key is randomly generated by the AES algorithm, and the plaintext is encrypted by the AES algorithm using the second key to generate the basic data ciphertext.

[0016] As a further optimized scheme of the present invention, during the AES encryption process, after the plaintext undergoes the initial round transformation, it undergoes m round transformations to generate the ciphertext corresponding to the plaintext; both the first key and the second key contain m + 1 round keys kp;

[0017] Among them, p = 0, 1, 2,..., m. During the initial round transformation and m round transformations, the data is subjected to round key addition through the round key kp; the round key k0 is the initial key, and each round key kp contains four characters. The round keys other than the initial key are obtained by the key expansion algorithm.

[0018] As a further optimized scheme of the present invention, during the key expansion process of the key expansion algorithm, among the adjacent two rounds of round keys, two characters of the latter round of round key are calculated from the characters in the previous round of round key, and the remaining two characters of the latter round of round key are calculated from the characters in the current round of round key.

[0019] As a further optimized scheme of the present invention, the key expansion process of the key expansion algorithm is as follows:

[0020] ;

[0021] ;

[0022] ;

[0023] ;

[0024] wherein, are respectively four characters in the previous round of round key, are respectively four characters in the next round of round key, is byte rotation, is byte substitution, is round constant, is the exclusive - or symbol.

[0025] As a further optimization scheme of the present invention, the key expansion process of the key expansion algorithm further includes the following key position displacement process:

[0026] Perform position permutation on the third character of the round key of each round except the initial round to obtain the improved round key of each round, and replace the round key of each round except the initial round with the improved round key of each round.

[0027] A decryption method for supply chain data privacy protection includes the following steps:

[0028] Respond to the user's access request for data, judge the data category, and according to the judgment result, retrieve the ciphertext and match the corresponding decryption strategy;

[0029] Decrypt the ciphertext into plaintext based on the matched decryption strategy;

[0030] When the data category is judged to be sensitive data, retrieve the sensitive data ciphertext and the key - value pair composed of the public key and the key ciphertext through the smart contract, and the decryption strategy is a hybrid decryption of symmetric and asymmetric combination; when the data category is judged to be basic data, retrieve the basic data ciphertext and key two through the smart contract, and the decryption strategy is symmetric decryption;

[0031] In the hybrid decryption process, use the public key to obtain the key ciphertext corresponding to key one, perform ECC decryption on the key ciphertext according to the private key in the public - private key pair to obtain key one, and use key one to perform AES decryption on the sensitive data ciphertext to obtain the sensitive data plaintext; in the symmetric decryption process, use key two to perform AES decryption on the basic data ciphertext to obtain the basic data plaintext.

[0032] A supply chain data privacy protection method based on hybrid encryption and decryption includes the following steps:

[0033] Based on the encryption method, encrypt the plaintext into ciphertext;

[0034] Based on the judgment result in the encryption method, classify and store the ciphertext;

[0035] This supply chain data privacy protection method further includes the following steps:

[0036] Based on the decryption method, decrypt the ciphertext into plaintext.

[0037] A supply chain data privacy protection system based on hybrid encryption and decryption includes:

[0038] A policy selection module, which is used to respond to the access request and plaintext of the user-uploaded data, judge the data category of the plaintext, and match the corresponding encryption policy according to the judgment result;

[0039] A data encryption module, which is used to encrypt the plaintext into ciphertext based on the matched encryption policy;

[0040] A data storage module, which classifies and stores the ciphertext based on the judgment result;

[0041] A data decryption module, which is used to decrypt the ciphertext into plaintext;

[0042] Among them, the data encryption module includes an AES encryption module and an ECC encryption module;

[0043] When the data category is judged to be sensitive data, the encryption policy is a hybrid encryption of symmetric and asymmetric combinations; when the data category is judged to be basic data, the encryption policy is symmetric encryption;

[0044] During the hybrid encryption process, the AES encryption module randomly generates a first key, the ECC encryption module randomly generates a public-private key pair, the AES encryption module uses the first key to perform AES encryption on the plaintext to generate a sensitive data ciphertext, and the ECC encryption module performs ECC encryption on the first key through the public key in the public-private key pair to generate a key ciphertext; during the symmetric encryption process, the AES encryption module randomly generates a second key and uses the second key to perform AES encryption on the plaintext to generate a basic data ciphertext.

[0045] A storage medium stores computer program instructions thereon, and when the computer program instructions are executed by a processor, the above method is implemented.

[0046] The beneficial effects of the present invention are as follows:

[0047] The present invention uses hybrid encryption when encrypting sensitive data and symmetric encryption when encrypting basic data. During the hybrid encryption process, the AES algorithm randomly generates a key, and the ECC algorithm randomly generates a public-private key pair. The key is used to perform AES encryption on the plaintext to form the ciphertext of the sensitive data, and the public key is used to perform ECC encryption on the key to generate the ciphertext of the key. During the symmetric encryption process, the key generated by the AES algorithm is used to perform AES encryption on the plaintext. For sensitive data and non-sensitive data, differential encryption is used to improve the data sharing efficiency and practicality on the premise of providing privacy protection.

[0048] The present invention obtains each round key required for the round transformation through an improved round key expansion algorithm. During the key expansion process, two of the characters of the next round key are calculated from the characters in the previous round key, and the remaining two characters of the next round key are calculated from the characters in the current round key. An attacker cannot directly obtain the previous round key from the next round key, which improves the cracking difficulty and enhances the security of the privacy protection system.

[0049] On the basis of improving the round key expansion algorithm, the present invention adjusts the positions of the characters at key positions in the round key array, causing the third character of each round key except the initial round to shift, thereby breaking the balance between keys and enhancing the overall security of key expansion. At the same time, only one character is complicated once per round, which is equivalent to the original algorithm in terms of computational complexity and does not affect the implementation efficiency of the algorithm, ensuring the efficient operation of the algorithm.

[0050] The present invention uses the AES+ECC hybrid encryption method to encrypt sensitive data, encrypts the basic data through the AES algorithm, and the ECC algorithm is only used for key encryption. When facing a large amount of supply chain data, it can not only ensure privacy protection security but also improve the execution efficiency of encryption and decryption, meeting the requirements of agricultural product supply chain management with a large number of participants and accessible parties and high real-time requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 is the data encryption flowchart of the present invention;

[0052] Figure 2 is the flowchart of the improved AES algorithm of the present invention;

[0053] Figure 3 is the expansion flowchart of the first two rounds of round keys of the present invention;

[0054] Figure 4 is the key expansion flowchart of the present invention;

[0055] Figure 5 is the data decryption flowchart of the present invention;

[0056] Figure 6 It is the flow chart of the displacement processing of the key positions of the round keys of the present invention;

[0057] Figure 7 It is the system block diagram of the present invention;

[0058] Figure 8 It is the distribution diagram of the traceability data of the tea supply chain;

[0059] Figure 9 It is the comparison chart of the round key generation time between the improved AES algorithm and the AES algorithm;

[0060] Figure 10 It is the comparison chart of the encryption and decryption times between the improved AES-128 algorithm and the ECC-256 and RSA-2048 algorithms;

[0061] Figure 11 It is the comparison chart of the encryption times between the improved AES+ECC algorithm and the ECC algorithm and the improved AES+ECC algorithm;

[0062] Figure 12 It is the comparison chart of the decryption times between the improved AES+ECC algorithm and the ECC algorithm and the improved AES+ECC algorithm;

[0063] Figure 13 It is the comparison chart of the total decryption times between the improved AES+ECC algorithm and the ECC algorithm and the improved AES+ECC algorithm. Specific implementation manners

[0064] The following further describes the present application in detail with reference to the accompanying drawings. It is necessary to point out here that the following specific implementation manners are only used to further illustrate the present application and cannot be understood as limiting the protection scope of the present application. Those skilled in the art can make some non-essential improvements and adjustments to the present application according to the above application content.

[0065] Example 1

[0066] As Figure 1 shown, this example relates to an encryption method for supply chain data privacy protection, and this method includes the following steps:

[0067] Step S1, in response to the access request and plaintext of the user's uploaded data, judge the data category of the plaintext, and match the corresponding encryption policy according to the judgment result. The plaintext submitted by the user can be either the plaintext of sensitive data or the plaintext of basic data. By classifying and identifying the sensitive data, the data category of the plaintext can be judged. The above classification and identification of sensitive data are common technical means in this field and will not be elaborated too much.

[0068] The encryption policy is as follows: when the data category is judged to be sensitive data, a hybrid encryption combining symmetric and asymmetric encryption is adopted, that is, improved AES+ECC encryption; when the data category is judged to be basic data, symmetric encryption is adopted.

[0069] Step S2, encrypt the plaintext into ciphertext based on the matched encryption policy;

[0070] When the data category is judged to be sensitive data, the plaintext is the sensitive data plaintext and needs to be hybrid-encrypted. During the hybrid encryption process, the key one key1 is randomly generated by the AES algorithm, and the public and private key pairs are randomly generated by the ECC algorithm. The public and private key pairs include the public key PK a , PK b , …, PK n , and the private key SK a , SK b , …, SK n . Use the key one key1 to perform AES encryption on the sensitive data plaintext to generate the sensitive data ciphertext, and use the public key PK a in the public and private key pairs to perform ECC encryption on the key one key1 to generate the key ciphertext S key1 . In the case where the user sends multiple ciphertexts, the public key PK a and the private key SK a are used to encrypt and decrypt the key of one plaintext. Through other public keys PK b , …, PK n , and other private keys SK b , …, SK n are used to encrypt and decrypt the keys of other plaintexts.

[0071] When the data category is judged to be basic data, the plaintext is the basic data plaintext and only symmetric encryption needs to be performed. During the symmetric encryption process, the key two key2 is randomly generated by the AES algorithm, and the key two key2 is used to perform AES encryption on the basic data plaintext to generate the basic data ciphertext;

[0072] Basic data does not represent public data. In a transaction, only the data holder and the direct stakeholders of the basic data can see it. For example, the basic data "pesticide sales volume" in the agricultural materials enterprise A1 can be seen by the tea farmer A2 and the tea factory A2, but not by another agricultural materials enterprise A4, that is, A4 can only see the encrypted ciphertext.

[0073] Sensitive data is only visible to the data holder and the authorized party in the transaction. The rest of the unauthorized parties in the supply chain can only see the ciphertext. For example, in the transaction initiated by the agricultural materials enterprise A1, for the sensitive data "tea tree transaction price", it is visible to the authorized party A2, but not to the agricultural materials enterprises A3 and A4, and only the transaction ciphertext can be seen.

[0074] There are many participating nodes in the tea supply chain. For the privacy protection of the key links in the tea supply chain, it is necessary to achieve fine-grained division and comprehensive flexibility requirements.

[0075] Please refer to Figures 2 - 4 , in step S1, during the AES encryption process, after the plaintext undergoes the initial round transformation, it then undergoes ten rounds of transformation to generate the ciphertext corresponding to the plaintext. The data volumes of both the plaintext and the ciphertext are 128 bits. In the initial round Round0, for the plaintext D1, D2,..., D 16 a round key addition operation AddRoundKey is performed to form the intermediate ciphertext one. In the first nine rounds of the subsequent ten rounds of transformation, that is, in Round1 to Round9, nine byte substitution operations SubBytes, row shift operations ShiftRows, column transformation operations MiColumns, and round key addition operations AddRoundKey are performed on the ciphertext one to form the intermediate ciphertext two. In the last round of transformation, byte substitution operations SubBytes, row shift operations ShiftRows, and round key addition operations AddRoundKey are performed on the intermediate ciphertext two to form the ciphertext C1, C2,..., C 16 . The byte substitution operation, row shift operation, column transformation operation, and round key addition operation are well-known common knowledge in the art and will not be elaborated further. It should be noted that both key one key1 and key two key2 contain eleven round keys kp. The difference between key one key1 and key two key2 lies in the specific characters included in the array of round key kp, and their formation methods are the same.

[0076] Among them, p = 0, 1, 2,..., 10. In the initial round transformation and the ten rounds of transformation, the round key kp is used to perform round key addition on the data; the round key k0 is the initial key, and each round key kp contains four characters. The round keys other than the initial key are obtained by the key expansion algorithm. Figure 3 R0 and R1 in

[0077] are the round key k0 and round key k1 in this embodiment. Additionally, in other embodiments, the number of rounds of transformation can be appropriately adjusted. In this embodiment, only ten rounds of transformation are performed.

[0078] During the key expansion process of the key expansion algorithm, two of the characters of the subsequent round key are calculated from the characters in the previous round key, and the remaining two characters of the subsequent round key are calculated from the characters in this round key.

[0079] ;

[0080] ;

[0081] ;

[0082] ;

[0083] wherein, are respectively four characters in the previous round of round key, are respectively four characters in the next round of round key, is byte rotation, is byte substitution, is round constant, is the exclusive - or symbol. Obtaining byte rotation, byte substitution, and round constant are all well - known common knowledge in the art, so no further elaboration will be made. In the above improvement is obtained by and through exclusive - or, is obtained by and through exclusive - or. The first two characters of the round key are both obtained through the operation of the previous round of round key. is obtained by and through exclusive - or, is obtained by and after complex operation through exclusive - or. Therefore, the last two characters have nothing to do with the previous round of round key, but are obtained through the operation of the round key generated in this round.

[0084] Embodiment 2

[0085] As shown in Figure 5 , this embodiment relates to a decryption method for supply chain data privacy protection, including the following steps:

[0086] Step S3: In response to the user's access request for data, judge the data category, and retrieve the ciphertext according to the judgment result and match the corresponding decryption strategy;

[0087] Step S4: Decrypt the ciphertext into plaintext based on the matched decryption strategy;

[0088] In step S3, when the data category is judged to be sensitive data, retrieve the sensitive data ciphertext and the key - value pair composed of the public key PK a and the key ciphertext S key1 through the smart contract. The decryption strategy is a hybrid decryption of symmetric and asymmetric combination; when the data category is judged to be basic data, retrieve the basic data ciphertext and the key two key2 through the smart contract, and the decryption strategy is symmetric decryption. The above decryption process is the inverse operation of the corresponding encryption process.

[0089] The above-mentioned ciphertext of sensitive data, ciphertext of basic data, and key-value pair composed of public key PK a and ciphertext of key S key1 are stored in a data storage module together with key two key2. The data storage module can be a blockchain, a relational database, or a module composed of a blockchain and a relational database. Retrieving data from the data storage module through a smart contract is a commonly used technical means in the art, so no further elaboration will be provided.

[0090] During the hybrid decryption process, the public key PK of the accessible party is used a to obtain the ciphertext of key S corresponding to key one key1 key1 , and according to the private key SK of the accessible party a , the ciphertext of key S key1 is decrypted by ECC to obtain key one key1. The private key SK a is included in the public-private key pair. The ciphertext of sensitive data is decrypted by AES using key one key1 to obtain the plaintext of sensitive data; during the symmetric decryption process, the ciphertext of basic data is decrypted by AES using key two key2 to obtain the plaintext of basic data.

[0091] Embodiment 3

[0092] As Figure 1 and Figure 5 shown, this embodiment discloses a supply chain data privacy protection method based on hybrid encryption and decryption. This method uses the encryption method in the first embodiment to encrypt the plaintext into ciphertext.

[0093] After encrypting the plaintext into ciphertext, the ciphertext is also classified and stored using the judgment result in the first embodiment.

[0094] When the data category is judged to be sensitive data, the public key PK a and the ciphertext of key S key1 are combined into a key-value pair, and the key-value pair and the ciphertext of sensitive data are stored; when the data category is judged to be basic data, key two key2 and the ciphertext of basic data are stored.

[0095] During the data storage process, when the data category is judged to be sensitive data, the key-value pair and the ciphertext of sensitive data are written into the relational database and the blockchain through a smart contract; when the data category is judged to be basic data, key two key2 and the ciphertext of basic data are written into the relational database and the blockchain through a smart contract.

[0096] This method also uses the decryption method in the second embodiment to decrypt the ciphertext into plaintext. When the data category is judged to be sensitive data, the ciphertext of sensitive data and the public key PK a and the ciphertext of key S are retrieved from the relational database or the blockchain through a smart contractkey1 The key-value pairs formed, and the decryption strategy is a hybrid decryption combining symmetric and asymmetric; when the data category is judged to be basic data, the encrypted text of the basic data and the key two key2 are retrieved from the relational database or the blockchain through the smart contract, and the decryption strategy is symmetric decryption.

[0097] Example 4

[0098] As Figure 6 shown, in this embodiment, another supply chain data privacy protection method based on hybrid encryption and decryption is disclosed. In the above embodiment, the third character is in a critical position in each round key. In order to further reduce the correlation within each round key, the third character of each round key is subjected to a displacement process, and the third character of each round key is shifted three positions backward, thereby breaking the balance between the keys.

[0099] Specifically, the difference between this embodiment and the previous embodiment is that the key expansion process of the key expansion algorithm further includes a critical position displacement process. In this embodiment, R0, R1,..., R10 are the initial key and 10 round keys. Among them, after the critical position displacement process, R1, R2,..., R10 form 10 improved round keys R1′, R2′,..., R10′. The R0, R1′, R2′,..., R10′ formed in this embodiment constitute the initial key and the other 10 improved round keys.

[0100] The key expansion process of this embodiment is as follows:

[0101] ;

[0102] ;

[0103] ;

[0104] ;

[0105] Among them, are respectively four characters in the previous round key, are respectively four characters in the next round key, is byte rotation, is byte substitution, is a round constant, is the exclusive OR symbol.

[0106] In the key position displacement process, the third character of the round keys in the rounds Round1 to Round10 except the initial round Round0 is subjected to position permutation to obtain R0, R1′, R2′, …, R10′. In this embodiment, the round keys k0, k1, k2, …, k10 of each round are replaced with R0, R1′, R2′, …, R10′.

[0107] In this embodiment, in the first round to the tenth round Round1 to Round10 except the initial round Round0, the third character of the round key of each round is shifted backward by 3 bits in the third column. It should be noted that the third character moving from the third column of the last round Round10 to the third column of the second round Round1 is equivalent to shifting backward by 1 bit.

[0108] Thus, the correlation between adjacent round keys and the internal association within the same group of round keys are both reduced compared with before. If brute-force search is used to crack the round key of the previous round or the next round, 232 * 4 = 2128 attempts are required, and at this time, it has reached the intensity of brute-force cracking. Suppose the attacker intercepts the round key of a certain round, such as the round key (W4, W5, W6, W7) of the second round, it is also impossible to deduce the initial key (W0, W1, W2, W3). Because W7 only depends on W5 and W6, W6 only depends on W4 and W5, and W5 only depends on W1 and W3. Even if W5 is known, 264 brute-force attempts are required to obtain W1 and W3 (each byte is 32 bits long). Similarly, W4 only depends on W0 and W2, and 264 brute-force attempts are also required.

[0109] Therefore, the number of brute-force attack attempts in the first round of the improved key expansion algorithm reaches 2128 times, which is equivalent to brute-force cracking. In addition, even if the first two characters of the round key of a certain round can be deduced, it is not easy to crack the following two characters. The overall security of the key expansion is improved. At the same time, only one character is subjected to a complication operation in each round, which is equivalent to the computational complexity of the original algorithm and does not affect the implementation efficiency of the algorithm, ensuring the efficient operation of the algorithm.

[0110] In addition, in some other embodiments, the number of bits by which the third character of the round key of each round is shifted backward in the third column can be adjusted. It is also possible to shift the third character of the round key of each round forward by a certain number of bits in the third column. Similarly, in the case of the third character moving forward, the third character moving from the third column of the second round Round1 to the third column of the last round Round10 is equivalent to moving forward by 1 bit.

[0111] In order to more clearly illustrate the present invention and its advantages, the method provided in Embodiment 4 of the present invention will be further explained below in combination with specific examples and their related drawings.

[0112] Whether the privacy protection scheme proposed in the above embodiments is reasonable depends on the implementability of the encryption algorithm. To analyze and verify the performance of the improved AES+ECC hybrid algorithm, the implementation efficiency of the algorithm was tested to verify the impact of the improved scheme on the encryption and decryption performance of the hybrid algorithm. Experiments will be carried out from aspects such as encryption time, decryption time, and diffusion index.

[0113] The experimental data is as Figure 8 shown. By collecting 2000 effective on-chain data of the tea supply chain from a tea enterprise in Huangshan urban area and a tea enterprise in Shitai County for statistics, a distribution map of the tea supply chain traceability data was obtained. The size of the tea enterprise supply chain traceability data is concentrated between 1M and 50M. Among them, the data with a size between 1M and 10M accounts for 22.75% of the total data volume, and the data with a size between 10M and 50M accounts for 77.25% of the total data volume.

[0114] Regarding the distribution of the on-chain data in the tea supply chain, this study selected six groups of data with sizes of 1M, 10M, 20M, 30M, 40M, and 50M for experiments, and respectively adopted the following n groups of comparative experiments to compare this scheme with other existing schemes as follows:

[0115] ①. Test the round key generation time of the traditional AES and the improved AES key expansion algorithm;

[0116] ②. Verify the rationality of the improved AES+ECC scheme using the avalanche effect index;

[0117] ③. Verify the effectiveness of the improved AES+ECC scheme using the data encryption and decryption time index;

[0118] ④. Use statistical analysis methods to calculate the correlation between variables in different models.

[0119] The experimental results and analysis are as follows:

[0120] (1)Comparison of round key generation time

[0121] To verify the round key generation speed of the improved AES algorithm, the test data provided in the AES algorithm standard was used, the time of key generation was recorded, and the average value of 10 results was taken.

[0122] Figure 9It is a time comparison graph of the AES and the improved AES algorithms for generating ten-round round keys. It can be obtained that the average times consumed by the AES-128 algorithm and the improved scheme are 0.002224 seconds and 0.002676 seconds respectively. The change in time can reflect that the improved scheme has increased a certain time complexity. However, compared with the AES algorithm, the time of the scheme proposed in this paper has increased by 0.000452 seconds, and the change at the millisecond level can almost be ignored because it will not significantly increase the running time of the algorithm for encryption and decryption. Therefore, while improving the security of the algorithm, the improved algorithm does not affect the efficiency of the algorithm. The AES algorithms included in the experiments in the following text are all improved AES algorithms.

[0123] (2)Avalanche effect

[0124] To verify the rationality of the scheme, the avalanche effect index is introduced. The avalanche effect refers to an ideal characteristic of an encryption algorithm. It means that if there are slight changes in the plaintext or the key during the input process, it will cause significant changes in the ciphertext, such as more than half of the output bits being flipped. Therefore, the higher the avalanche effect (Av), the stronger the security of the algorithm, because a change in one bit during the input process can generate different cipher results. Usually, the number of flipped bits in the cipher bits is divided by the total number of cipher bits to obtain the avalanche value. The avalanche effects of the improved AES+ECC algorithm proposed above and other encryption algorithms are compared, as shown in Table 1.

[0125] Table 1 Comparison of avalanche effects among different schemes

[0126] ;

[0127] It can be seen from the table that the avalanche effects of all improved algorithms are greater than 50%. Proposed is the scheme using the improved AES+ECC algorithm. The hybrid algorithm proposed in this scheme has the highest avalanche effect, meaning that this algorithm is the most difficult to be broken. Compared with AES, the improved scheme has a significantly higher avalanche effect, which means that the improved AES+ECC is stronger than other models in terms of security.

[0128] (3)Encryption and decryption time

[0129] The encryption time is defined as the time required to convert the original text into a password file or an encrypted file, and the decryption time is defined as the time required to convert the password text back to the original file. First, the encryption and decryption times of the improved AES-128, as well as the ECC-256 and RSA-2048 algorithms, are compared, as Figure 10 shown. It can be seen from the figure that the encryption and decryption times of the symmetric encryption algorithm (AES) are much less than those of the asymmetric algorithms (RSA, ECC).

[0130] Although the symmetric encryption algorithm is highly efficient, it is inevitable that potential risks such as information leakage caused by key management issues exist. Therefore, in this chapter, the asymmetric encryption algorithm is used to protect the key. Two hybrid encryption schemes are compared with the ECC encryption scheme, and the encryption operation times of the three encryption algorithms on tea supply chain datasets of different sizes are shown in Table 2.

[0131] Table 2 Encryption Time Table of Three Encryption Algorithms

[0132] ;

[0133] It can be seen from the table that the traditional ECC algorithm takes the longest time, and the encryption times of the other two hybrid encryption algorithms are not much different. As the dataset gets larger, the time complexities of the three encryption algorithms all increase. For specific comparison, refer to Figure 11 . It can be seen from Table 2 that the encryption operation times of the three encryption algorithms are positively correlated with the size of the tea supply chain traceability data.

[0134] Generally speaking, the hybrid encryption algorithm is more efficient than the traditional algorithm. When the dataset is 1M, the hybrid encryption algorithm of ECC is 59.43% more efficient than the traditional ECC algorithm, and the hybrid encryption of RSA is 92.35% more efficient than the traditional ECC algorithm, which means that in the encryption stage of small datasets, the RSA hybrid encryption algorithm is more efficient than the ECC hybrid encryption algorithm; however, when the dataset is larger than 1M and less than or equal to 50M, the two algorithms are equally efficient in the encryption stage, and the overall efficiency of the ECC hybrid encryption algorithm is slightly higher than that of the RSA hybrid encryption algorithm.

[0135] The decryption operation times of the three encryption algorithms on tea supply chain datasets of different sizes are shown in Table 3. The ECC algorithm takes longer than the hybrid encryption algorithm. The comparison of the three encryption schemes is as Figure 12 shown.

[0136] Table 3 Decryption Time Table of Three Encryption Algorithms

[0137] ;

[0138] It can be seen from the above table that the decryption operation times of the three encryption algorithms are positively correlated with the size of the tea supply chain traceability data. Similar to the encryption algorithm, the hybrid encryption algorithm is more efficient than the traditional elliptic curve algorithm during the data decryption process, and the efficiencies of the two hybrid encryption algorithms are close.

[0139] Table 4 Comparison Table of Total Time Complexities of Three Encryption Algorithms

[0140] ;

[0141] Table 4 shows the comparison of the total running times of three key algorithms. The total encryption and decryption times of the two hybrid encryption algorithms are much less than those of the traditional ECC algorithm. Among them, the ECC hybrid algorithm takes the shortest time. Similarly, the total encryption and decryption times of the three algorithms increase correspondingly as the dataset gets larger, and the fluctuation graph is as shown in Figure 12 shown. The comparison of the total encryption and decryption times of the three schemes is as shown in Figure 13 shown.

[0142] As can be seen from the above table, the total encryption and decryption times of the three encryption algorithms are positively correlated with the size of the data on the tea supply chain blockchain. The hybrid encryption algorithm has a lower time complexity than the traditional algorithm. When the data packet size is between 1M and 20M, the RSA hybrid encryption algorithm improves more than the ECC hybrid encryption algorithm. As the data on the tea supply chain blockchain increases, the time complexities of the two hybrid algorithms become closer and closer. When the dataset is greater than 20M and less than or equal to 50M, the encryption and decryption efficiencies of the two algorithms are equivalent, and the overall efficiency of the ECC hybrid encryption algorithm is slightly higher than that of the RSA hybrid encryption algorithm. Table 4 and Figure 13 show that this scheme will help reduce the computational complexity compared with other encryption algorithms.

[0143] (4) Correlation analysis

[0144] To further verify the security of the scheme, the correlation coefficient index is introduced. The correlation coefficient represents the correlation between two variables, such as the correlation coefficient factor between the plaintext and the ciphertext. It shows the relationship between different variables, and this coefficient represents the degree of strong protection of the encryption algorithm against statistical attacks. To make the system more secure, the correlation must be closer to "0". That is to say, a strong encryption algorithm should have ciphertext that is completely different from the plaintext.

[0145] The correlation coefficient should be calculated through the following equation:

[0146] ;

[0147] where: is the average value of; is the average value of; is the plaintext data; is the ciphertext data. The average value calculation formula is as shown in Equation (2).

[0148] ;

[0149] and The standard deviations of can be expressed as follows:

[0150] ;

[0151] A coefficient equal to 1 indicates the same plaintext and ciphertext, while a correlation coefficient equal to 0 indicates that the ciphertext and plaintext are completely different. Therefore, the smaller the correlation coefficient, the higher the strength of the encryption algorithm.

[0152] Table 5 Comparison table of correlation coefficient values of the proposed scheme

[0153] ;

[0154] Table 5 shows the correlation coefficients calculated using different data volumes. The results show that the correlation coefficient of the proposed scheme is approximately 0.045, close to zero. This means that the strong cipher generated by the improved AES+ECC algorithm has a small similarity to the plaintext and is difficult to crack.

[0155] By comparison, the AES+ECC hybrid encryption scheme combines the advantages of symmetric and asymmetric encryption algorithms. Using the hybrid encryption method can effectively improve the efficiency of data transmission in the privacy protection process. At the same time, through the improvement of the AES algorithm, the security of the scheme is further improved. Therefore, the efficiency and security of the improved AES+ECC hybrid encryption scheme are both optimal.

[0156] In summary, when the method described in this embodiment is applied to the privacy protection of the tea supply chain, first, the key links of the tea supply chain are sorted out, the basic data and sensitive data are determined respectively, and a differential privacy protection strategy is established based on this; then, according to the characteristics and properties of the encryption algorithm, the AES algorithm is optimized and improved, and a privacy protection scheme based on the improved AES+ECC hybrid encryption algorithm is formulated, so as to meet the fine-grained data protection requirements while sharing enterprise information; finally, the hybrid encryption scheme is tested and evaluated. Experiments show that the improved AES+ECC hybrid encryption scheme is superior to the AES+RSA and ECC encryption schemes.

[0157] Embodiment 5

[0158] As Figure 7 shown, this embodiment relates to a supply chain data privacy protection system based on hybrid encryption and decryption. The system includes:

[0159] A policy selection module, configured to receive an access request for submitted data and the corresponding plaintext, judge the data category, and select an encryption policy according to the judgment result;

[0160] A data encryption module, configured to encrypt the plaintext into ciphertext according to the selected encryption policy;

[0161] A data storage module, configured to store the encrypted ciphertext. The data storage module consists of a relational database and a blockchain;

[0162] Among them, the data encryption module includes an AES encryption module and an ECC encryption module;

[0163] When the data category is judged to be sensitive data, the encryption policy is a hybrid encryption of symmetric and asymmetric combinations; when the data category is judged to be basic data, the encryption policy is symmetric encryption;

[0164] During the hybrid encryption process, the AES encryption module randomly generates a key one key1, the ECC encryption module randomly generates a public-private key pair, the AES encryption module uses the key one key1 to perform AES encryption on the plaintext to generate a sensitive data ciphertext, and the ECC encryption module uses the public key PK in the public-private key pair a to perform ECC encryption on the key one key1 to generate a key ciphertext S key1 ; during the symmetric encryption process, the AES encryption module randomly generates a key two key2, and uses the key two key2 to perform AES encryption on the plaintext to generate a basic data ciphertext;

[0165] When the data category is judged to be sensitive data, the public key PK a and the key ciphertext S key1 are combined into a key-value pair, and the data storage module stores the key-value pair and the sensitive data ciphertext; when the data category is judged to be basic data, the data storage module stores the key two key2 and the basic data ciphertext.

[0166] The system also includes a data decryption module, which is composed of an AES decryption module and an ECC decryption module.

[0167] The policy selection module is also used to receive an access request for obtaining data, judge the data category, retrieve the ciphertext according to the judgment result, and select a decryption policy.

[0168] When the data category is judged to be sensitive data, the policy selection module retrieves the sensitive data ciphertext in the data storage module and the key-value pair composed of the public key PK a and the key ciphertext S key1 through the smart contract, and the decryption policy is a hybrid decryption of symmetric and asymmetric combinations; when the data category is judged to be basic data, the policy selection module retrieves the basic data ciphertext and the key two key2 in the data storage module through the smart contract, and the decryption policy is symmetric decryption.

[0169] During the hybrid decryption process, the ECC decryption module uses the public key PK a to obtain the key ciphertext S corresponding to the key one key1 key1 , and according to the private key SK in the public-private key pair a to decrypt the key ciphertext S key1Perform ECC decryption to obtain the first key key1. The AES decryption module uses the first key key1 to perform AES decryption on the sensitive data ciphertext to obtain the sensitive data plaintext; during the symmetric decryption process, the AES decryption module uses the second key key2 to perform AES decryption on the basic data ciphertext to obtain the basic data plaintext.

[0170] Embodiment 6

[0171] This embodiment relates to a storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the encryption method disclosed in the first embodiment can be implemented.

[0172] The above embodiments merely represent several implementation manners of the present invention. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the patent of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can still be made, and these all belong to the protection scope of the present invention.

Claims

1. An encryption method for supply chain data privacy protection, characterized in that: The following steps are involved: Respond to the access request and plaintext of the user's uploaded data, determine the data category of the plaintext, and match the corresponding encryption strategy according to the determination result; Encrypting the plaintext into ciphertext based on the matched encryption strategy; The encryption strategy is: When the data category is judged as sensitive data, a combination of symmetric and asymmetric encryption is used; when the data category is judged as basic data, symmetric encryption is used; During the hybrid encryption process, key one is randomly generated by the AES algorithm, a public-private key pair is randomly generated by the ECC algorithm, key one is used to perform AES encryption on the plaintext to generate sensitive data ciphertext, and key one is ECC encrypted using the public key in the public-private key pair to generate key ciphertext; during the symmetric encryption process, key two is randomly generated by the AES algorithm, and key two is used to perform AES encryption on the plaintext to generate basic data ciphertext.

2. The encryption method according to claim 1, characterized in that: In the AES encryption process, after the initial round transformation, the plaintext is transformed m rounds to generate a ciphertext corresponding to the plaintext; the key 1 and the key 2 both contain m+1 round keys kp; Among them, p=0, 1, 2, ..., m, in the initial round-to-round transformation and m-round-to-round transformation, the data is round-keyed by the round key kp; the round key k0 is the initial key, each round key kp contains four characters, and the round keys other than the initial key are obtained by the key expansion algorithm.

3. The encryption method according to claim 2, characterized in that: In the key expansion process of the key expansion algorithm, in two adjacent round keys, two characters of the next round key are calculated from the characters in the previous round key, and the remaining two characters of the next round key are calculated from the characters in the current round key.

4. The encryption method according to claim 3, characterized in that: The key expansion process of the key expansion algorithm is as follows: ; ; ; ; in, They are the four characters in the previous round key, They are the four characters in the next round of keys, For byte loop, For byte substitution, is the wheel constant, Is the XOR symbol.

5. The encryption method according to claim 4, characterized in that: The key expansion process of the key expansion algorithm also includes the following key position shift process: The third characters of the round keys of the remaining rounds except the initial round are permuted to obtain improved round keys of each round, and the improved round keys of each round are used to replace the round keys of the remaining rounds except the initial round.

6. A decryption method for supply chain data privacy protection, characterized in that: The following steps are involved: Respond to a user's access request for data, determine the data category, retrieve the ciphertext of any one of claims 1 to 5 and match the corresponding decryption strategy based on the determination result; Decrypting the ciphertext into plaintext based on the matched decryption strategy; When the data category is judged as sensitive data, the sensitive data ciphertext and the key-value pair consisting of the public key and the secret key ciphertext are retrieved through the smart contract, and the decryption strategy is a combination of symmetric and asymmetric decryption; when the data category is judged as basic data, the basic data ciphertext and key 2 are retrieved through the smart contract, and the decryption strategy is symmetric decryption; During the hybrid decryption process, the public key is used to obtain the key ciphertext corresponding to key one, the key ciphertext is decrypted by ECC according to the private key in the public-private key pair to obtain key one, and the sensitive data ciphertext is decrypted by AES using key one to obtain the sensitive data plaintext; During the symmetric decryption process, the basic data ciphertext is decrypted by AES using key 2 to obtain the basic data plaintext.

7. A supply chain data privacy protection method based on hybrid encryption and decryption, characterized by: The following steps are involved: Encrypting the plaintext into ciphertext based on the encryption method described in any one of claims 1 to 5; Based on the judgment result of any one of claims 1 to 5, the ciphertext is classified and stored; The supply chain data privacy protection method also includes the following steps: Based on the decryption method described in claim 6, the ciphertext is decrypted into plaintext.

8. The supply chain data privacy protection method based on hybrid encryption and decryption according to claim 7 is characterized by: During the classified storage process, when the data category is judged to be sensitive data, the public key and the key ciphertext are combined into a key-value pair, and the key-value pair and the sensitive data ciphertext are written into the data storage module through a smart contract; when the data category is judged to be basic data, the key 2 and the basic data ciphertext are written into the data storage module through a smart contract.

9. A supply chain data privacy protection system based on hybrid encryption and decryption, characterized in that: include: A policy selection module is used to respond to the access request and plain text of the user's uploaded data, judge the data category of the plain text, and match the corresponding encryption policy according to the judgment result; A data encryption module, used for encrypting the plaintext into ciphertext based on the matched encryption strategy; A data storage module, classifying and storing the ciphertext based on the judgment result; A data decryption module, used for decrypting the ciphertext into plaintext; Among them, the data encryption module includes an AES encryption module and an ECC encryption module; When the data category is judged as sensitive data, the encryption strategy is a combination of symmetric and asymmetric hybrid encryption; when the data category is judged as basic data, the encryption strategy is symmetric encryption; During the hybrid encryption process, the AES encryption module randomly generates key one, the ECC encryption module randomly generates a public-private key pair, the AES encryption module uses key one to perform AES encryption on the plaintext to generate sensitive data ciphertext, and the ECC encryption module uses the public key in the public-private key pair to perform ECC encryption on key one to generate key ciphertext; during the symmetric encryption process, the AES encryption module randomly generates key two, uses key two to perform AES encryption on the plaintext to generate basic data ciphertext.

10. A storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Data transmission method and device, terminal and storage medium

    CN112637166A

  • Data protection method and device, computer equipment and storage medium

    CN115238286A