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, sensitive data and basic data are differentiatedly encrypted, and key security is enhanced by improving the round-trip extension algorithm, the problems of insufficient sensitive data protection, low encryption and decryption efficiency and key correlation risks in existing systems are solved, and efficient and secure data sharing and privacy protection are achieved.
Patent Information
- Application Number
- CN202510363913.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-03-26
AI Technical Summary
The existing supply chain data privacy protection system fails to effectively distinguish sensitive data from non-sensitive data during data transmission and sharing, resulting in insufficient protection of sensitive data, rather than excessive encryption of non-sensitive data, affecting the efficiency and practicality of data sharing. At the same time, the existing systems have low execution efficiency in the encryption and decryption process, cannot meet the supply chain management requirements with high real-time requirements, and there is a risk of key correlation, which is easy to be cracked by attackers.
The supply chain data privacy protection method based on hybrid encryption and decryption is adopted to judge the data category, and the sensitive data is encrypted by a combination of symmetric and asymmetric combinations, and the basic data is encrypted by symmetric encryption. During the hybrid encryption process, the AES algorithm is used to randomly generate the key, and the public and private key pairs are generated through the ECC algorithm to perform ECC encryption on the key. At the same time, the round key expansion algorithm is improved to enhance the security of the key.
Differentiated encryption of sensitive and non-sensitive data is realized, the efficiency and practicality of data sharing is improved, the protection ability of data privacy is enhanced, the resource consumption of the encryption and decryption process is reduced, the supply chain management needs with high real-time requirements is met, and the security of keys is improved, and the risk of privacy leakage is reduced.
Smart Images

Figure CN119892507A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data encryption and decryption, and specifically relates to a supply chain data privacy protection method and system based on hybrid encryption and decryption. Background Art
[0002] As the global supply chain becomes increasingly complex and digital, information sharing has become a key means to improve supply chain efficiency and reduce the "bullwhip effect". Especially in the management of agricultural product supply chains, all participants such as producers, wholesalers, and retailers need to share transaction information to achieve 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, and 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 the secure sharing of information between enterprises, but it has also made the study of privacy protection schemes a hot topic in the field of agricultural product supply chain management. Existing supply chain data privacy protection systems implement data protection based on data encryption using traditional encryption algorithms, distributed ledgers using blockchain technology, and privacy information partitioning models using data mining. These technologies have improved the security of data sharing to a certain extent, but there are still the following deficiencies: (1) Lack of differentiated sharing solutions: Existing supply chain data privacy protection systems often use a unified encryption method during data transmission and sharing, failing to effectively distinguish between sensitive data and non-sensitive data. This leads to insufficient protection of sensitive data and excessive encryption of non-sensitive data, affecting the efficiency and practicality of data sharing.
[0004] (2) Encryption and decryption efficiency issues: Faced with complex and large amounts of supply chain data, the existing supply chain data privacy protection system has a low execution efficiency in the encryption and decryption process while ensuring security, and cannot meet the needs of supply chain management with high real-time requirements.
[0005] (3) Key correlation risk: The existing technology uses the traditional AES algorithm. The key of the previous round is strongly correlated with the key of the next round. An attacker may be able to crack all keys including the initial key by intercepting the key of any round, which poses a great risk of privacy leakage.
[0006] It can be seen that the existing supply chain data privacy protection systems and methods have significant shortcomings in differentiated sharing, encryption and decryption efficiency, key security, traceability data protection, resource consumption and specific supply chain optimization. It is urgent to develop a more secure, efficient and flexible supply chain data privacy protection system and method. Summary of the invention
[0007] The purpose of the present invention is to provide a supply chain data privacy protection method and system based on hybrid encryption and decryption in order to solve the above problems.
[0008] The present invention achieves the above-mentioned purpose through the following technical solutions: An encryption method for supply chain data privacy protection includes the following steps: 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, the AES algorithm randomly generates key one, the ECC algorithm randomly generates a public-private key pair, the key one is used to perform AES encryption on the plaintext to generate a sensitive data ciphertext, and the key one is ECC encrypted using the public key in the public-private key pair to generate a key ciphertext; during the symmetric encryption process, the AES algorithm randomly generates key two, the key two is used to perform AES encryption on the plaintext to generate a basic data ciphertext.
[0009] As a further optimization scheme of the present invention, in the AES encryption process, the plaintext undergoes initial round-by-round transformation and then undergoes m round-by-round transformation to generate a ciphertext corresponding to the plaintext; the key 1 and the key 2 both contain m+1 round-by-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.
[0010] As a further optimization scheme of the present invention, in the key expansion process of the key expansion algorithm, in two adjacent round keys, two characters of the round key of the latter round are calculated from the characters in the round key of the previous round, and the remaining two characters of the round key of the latter round are calculated from the characters in the round key of the current round.
[0011] As a further optimization scheme of the present invention, 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.
[0012] As a further optimization solution of the present invention, the key expansion process of the key expansion algorithm further includes the following key position displacement 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.
[0013] A decryption method for supply chain data privacy protection includes the following steps: Respond to user access requests for data, determine the data category, retrieve the ciphertext 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, and the key ciphertext is ECC decrypted according to the private key in the public-private key pair to obtain key one. Key one is used to perform AES decryption on the sensitive data ciphertext to obtain the sensitive data plaintext; during the symmetric decryption process, key two is used to perform AES decryption on the basic data ciphertext to obtain the basic data plaintext.
[0014] A supply chain data privacy protection method based on hybrid encryption and decryption includes the following steps: Based on the encryption method, encrypt the plaintext into ciphertext; Based on the judgment result in the encryption method, the ciphertext is classified and stored; The supply chain data privacy protection method also includes the following steps: Based on the decryption method, the ciphertext is decrypted into plaintext.
[0015] A supply chain data privacy protection system based on hybrid encryption and decryption, comprising: 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.
[0016] A storage medium stores computer program instructions, which implement the above method when the computer program instructions are executed by a processor.
[0017] The beneficial effects of the present invention are: The present invention adopts hybrid encryption when encrypting sensitive data and symmetric encryption when encrypting basic data. In the hybrid encryption process, the AES algorithm randomly generates a key, the ECC algorithm randomly generates a public-private key pair, and the key is used to perform AES encryption on the plaintext to form a sensitive data ciphertext, and the public key is used to perform ECC encryption on the key to generate a key ciphertext. In the symmetric encryption process, the key generated by the AES algorithm is used to perform AES encryption on the plaintext. Differential encryption is used for sensitive data and non-sensitive data, which improves data sharing efficiency and practicality while providing privacy protection. The present invention obtains the round keys required for round transformation through an improved round key expansion algorithm. During the key expansion process, two characters of the round key of the next round are calculated from the characters in the round key of the previous round, and the remaining two characters of the round key of the next round are calculated from the characters in the round key of the current round. An attacker cannot directly obtain the round key of the previous round through the round key of the next round, thereby increasing the difficulty of cracking and improving the security of the privacy protection system. On the basis of improving the round key expansion algorithm, the present invention adjusts the position of the characters at the key position in the round key array, so that the third character of each round key other than the initial round is displaced, thereby breaking the balance between the keys and improving the overall security of the key expansion. At the same time, each round only performs a complex operation on one character, which is equivalent to the calculation amount of the original algorithm, does not affect the implementation efficiency of the algorithm, and ensures the efficient operation of the algorithm. The present invention adopts AES+ECC hybrid encryption to encrypt sensitive data. The basic data is encrypting by AES algorithm, and the ECC algorithm is only used for key encryption. When facing huge supply chain data, it can not only ensure privacy protection security, but also improve the execution efficiency of encryption and decryption. It can meet the management needs of agricultural product supply chain with many participants and accessible parties and high real-time requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a data encryption flow chart of the present invention; Figure 2 It is a flow chart of the improved AES algorithm of the present invention; Figure 3 It is an extended flow chart of the first two rounds of round keys of the present invention; Figure 4 is a key expansion flow chart of the present invention; Figure 5 is a data decryption flow chart of the present invention; Figure 6 It is a flow chart of the displacement processing of the key position of the round key of the present invention; Figure 7 is a system block diagram of the present invention; Figure 8 It is the distribution map of tea supply chain traceability data; Fig. 9 This is a comparison chart of the round key generation time of the improved AES algorithm and the AES algorithm; Fig.10 This is a comparison chart of encryption and decryption time between the improved AES-128 algorithm and the ECC-256 and RSA-2048 algorithms; Fig.11 It is a comparison chart of encryption time between the improved AES+ECC algorithm and the ECC algorithm, and the improved AES+ECC algorithm; Fig.12 It is a comparison chart of the decryption time of the improved AES+ECC algorithm, the ECC algorithm, and the improved AES+ECC algorithm; Fig.13 This is a comparison chart of the improved AES+ECC algorithm, the ECC algorithm, and the total decryption time of the improved AES+ECC algorithm. DETAILED DESCRIPTION
[0019] The present application is further described in detail below in conjunction with the accompanying drawings. It is necessary to point out here that the following specific implementation methods are only used to further illustrate the present application and cannot be understood as limiting the scope of protection of the present application. Technical personnel in this field can make some non-essential improvements and adjustments to the present application based on the above application content.
[0020] Example 1
[0021] like Figure 1 As shown, this embodiment relates to an encryption method for supply chain data privacy protection, the method comprising the following steps: Step S1: respond to the access request and plaintext of the data uploaded by the user, judge the data category of the plaintext, and match the corresponding encryption strategy according to the judgment result. The plaintext submitted by the user can be either sensitive data plaintext or basic data plaintext. By classifying and identifying sensitive data, the data category of the plaintext can be determined. The classification and identification of sensitive data is a common technical means in this field and will not be described in detail.
[0022] The encryption strategy is as follows: when the data category is judged as sensitive data, a combination of symmetric and asymmetric hybrid encryption is used, that is, improved AES+ECC encryption; when the data category is judged as basic data, symmetric encryption is used; Step S2: Encrypt the plaintext into ciphertext based on the matched encryption strategy; When the data category is judged as sensitive data, the plaintext is sensitive data plaintext and needs to be hybrid encrypted. During the hybrid encryption process, the AES algorithm randomly generates a key key1, and the ECC algorithm randomly generates a public-private key pair. The public-private key pair contains the public key PK a , PK b ,…,PK n , and the private key SK a , S.K. b , …, SK n . Use key 1 to perform AES encryption on the plaintext of sensitive data to generate ciphertext of sensitive data, and use the public key PK in the public-private key pair to encrypt the sensitive data. a Perform ECC encryption on key 1 to generate key ciphertext S key1 When a user sends multiple ciphertexts, the public key PK a and private key SK a Encrypt and decrypt a plaintext key. Through other public keys PK b ,…,PK n , and other private keys SK b , …, SK n Encrypt and decrypt other plaintext keys.
[0023] When the data category is determined to be basic data, the plaintext is the basic data plaintext, and only symmetric encryption is required. During the symmetric encryption process, the AES algorithm randomly generates key 2, and uses key 2 to perform AES encryption on the basic data plaintext to generate the basic data ciphertext; Basic data does not represent public data. The basic data in a transaction can only be seen by the data holder and direct stakeholders. For example, the basic data "pesticide sales volume" in agricultural input enterprise A1 can be seen by tea farmer A2 and tea factory A2, but not by another agricultural input enterprise A4, that is, A4 can only see the encrypted ciphertext.
[0024] Sensitive data is visible only to the data holder and authorized party in the transaction, and other unauthorized parties in the supply chain can only see the ciphertext. For example, in a transaction initiated by agricultural material enterprise A1, the sensitive data "tea tree transaction price" is visible to authorized party A2, but not to agricultural material enterprises A3 and A4, who can only see the transaction ciphertext.
[0025] There are many participating nodes in the tea supply chain, and the privacy protection of key links in the tea supply chain requires fine-grained division and comprehensive and flexible requirements.
[0026] See also Figure 2-4 In step S1, during the AES encryption process, after the initial round transformation, the plaintext undergoes ten round transformations to generate the ciphertext corresponding to the plaintext. The data size of the plaintext and ciphertext is 128 bits. In the initial round Round0, the plaintext D1, D2, ..., D 16 Perform the round key addition operation AddRoundKey to form an intermediate ciphertext 1. In the first nine rounds of the subsequent ten rounds of round transformation, i.e., Round1 to Round9, perform nine byte replacement operations SubBytes, row shift operations ShiftRows, column transformation operations MiColumns, and round key addition operations AddRoundKey on the ciphertext 1 to form an intermediate ciphertext 2. In the last round of round transformation, perform byte replacement operations SubBytes, row shift operations ShiftRows, and round key addition operations AddRoundKey on the intermediate ciphertext 2 to form 128-bit ciphertexts C1, C2, …, C 16 Byte replacement operation, row shift operation, column transformation operation and round key addition operation are common knowledge in the art and will not be described in detail. It should be noted that both key 1 and key 2 contain eleven round keys kp. The difference between key 1 and key 2 is that the characters specifically included in the array of round keys kp are different, and the two are formed in the same way.
[0027] Among them, p=0, 1, 2, ..., 10. In the initial round transformation and the ten-round transformation, the data is round-keyed by 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. Figure 3 R0 and R1 in are the round key k0 and round key k1 in this embodiment. In addition, the number of round changes in other embodiments can be adjusted appropriately, and only ten round changes are performed in this embodiment.
[0028] In the key expansion process of the key expansion algorithm, 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.
[0029] 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, Byte loop, byte substitution, and round constant acquisition are all common knowledge in the art, so they will not be described in detail. Depend on and XOR to get, Depend on and XOR is used to obtain the first two characters of the round key. Both characters are obtained through the operation of the previous round key. Depend on and XOR to get, Depend on and complex calculations Therefore, the last two characters have nothing to do with the round key of the previous round, but are obtained by calculating the round key generated in this round.
[0030] Example 2 like Figure 5 As shown, this embodiment relates to a decryption method for supply chain data privacy protection, comprising the following steps: Step S3, responding to the user's access request to obtain data, determining the data category, retrieving the ciphertext based on the determination result, and matching the corresponding decryption strategy; Step S4: decrypt the ciphertext into plaintext based on the matched decryption strategy; In step S3, when the data category is determined to be sensitive data, the sensitive data ciphertext is retrieved through the smart contract and the public key PK is used to obtain the sensitive data ciphertext. a and key ciphertext S key1 The decryption strategy is a combination of symmetric and asymmetric decryption. When the data category is determined to be basic data, the basic data ciphertext and key 2 are retrieved through the smart contract, and the decryption strategy is symmetric decryption. The above decryption process is the inverse operation of the corresponding encryption process.
[0031] The above sensitive data ciphertext, basic data ciphertext and public key PK a and key ciphertext S key1 The key-value pair and key 2 are stored in a data storage module. 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 smart contracts is a common technical means in this field, so it will not be described in detail.
[0032] During the hybrid decryption process, the public key PK of the accessible party is used a Get the key ciphertext S corresponding to key 1 key1 , according to the private key SK of the accessible party a For the key ciphertext S key1 Perform ECC decryption to obtain key 1 and private key SK a Included in the public-private key pair. Use key 1 to perform AES decryption on the sensitive data ciphertext to obtain the sensitive data plaintext; during the symmetric decryption process, use key 2 to perform AES decryption on the basic data ciphertext to obtain the basic data plaintext.
[0033] Example 3
[0034] like Figure 1 and Figure 5 As shown, this embodiment discloses a supply chain data privacy protection method based on hybrid encryption and decryption. The method utilizes the encryption method in the first embodiment to encrypt plaintext into ciphertext.
[0035] After the plain text is encrypted into cipher text, the cipher text is classified and stored using the judgment result in the first embodiment.
[0036] When the data category is judged to be sensitive data, the public key PK a and key ciphertext S key1A key-value pair is formed, and the key-value pair and the sensitive data ciphertext are stored; when the data category is judged to be basic data, the key 2 key2 and the basic data ciphertext are stored.
[0037] During the data storage process, when the data category is judged to be sensitive data, the key-value pairs and sensitive data ciphertext are written into the relational database and blockchain through the smart contract; when the data category is judged to be basic data, the key 2 key2 and the basic data ciphertext are written into the relational database and blockchain through the smart contract.
[0038] The method also uses the decryption method in the second embodiment to decrypt the ciphertext into plaintext. When the data category is determined to be sensitive data, the sensitive data ciphertext is retrieved from the relational database or blockchain through the smart contract and the public key PK is used to decrypt the ciphertext into plaintext. a and key ciphertext S key1 The decryption strategy is a combination of symmetric and asymmetric decryption. When the data category is determined to be basic data, the basic data ciphertext and key 2 are retrieved from the relational database or blockchain through the smart contract, and the decryption strategy is symmetric decryption.
[0039] Example 4
[0040] like Figure 6 As shown, another supply chain data privacy protection method based on hybrid encryption and decryption is disclosed in this embodiment. In the above embodiment, the third character is in a key position in each round of the round key. In order to further reduce the internal correlation of each round of the round key, the third character of each round of the round key is shifted, and the third character of each round of the round key is shifted back three places, thereby breaking the balance between the keys.
[0041] Specifically, the difference between this embodiment and the previous embodiment is that the key expansion process of the key expansion algorithm also includes a key position shift process. In this embodiment, R0, R1, ..., R10 are the initial key and 10 round keys. Among them, R1, R2, ..., R10 form 10 improved round keys R1', R2', ..., R10' after the key position shift process. R0, R1', R2', ..., R10' formed in this embodiment constitute the initial key and the other 10 improved round keys.
[0042] The key expansion process of this embodiment 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.
[0043] In the key position shift process, the third characters of the round keys of Round1 to Round10 except the initial round Round0 are replaced 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′.
[0044] In this embodiment, in the first to tenth rounds Round1 to Round10 except the initial round Round0, the third character of the round key is shifted back 3 places 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 moving back 1 place.
[0045] At this point, the correlation between the round keys of two adjacent rounds and the correlation within the same group of round keys are lower than before. If an exhaustive search is used to crack the round keys of the previous or next round, 232*4=2128 attempts are required, which has reached the strength of brute force cracking. Assuming that the attacker intercepts a round key, such as the second round key (W4, W5, W6, W7), 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, it takes 264 exhaustive searches to obtain W1 and W3 (each byte is 32 bits long). Similarly, W4 only depends on W0 and W2, and it also requires 264 exhaustive searches.
[0046] Therefore, the number of exhaustive attacks in the first round of the improved key expansion algorithm reached 2128 times, which is equivalent to brute force cracking. In addition, even if the first two characters of a round of keys can be deduced, the following two characters cannot be easily cracked. The overall security of key expansion is improved. At the same time, each round only performs a complex operation on one character, which is equivalent to the calculation amount of the original algorithm, and does not affect the implementation efficiency of the algorithm, ensuring the efficient operation of the algorithm.
[0047] In addition, in some other embodiments, the number of digits by which the third character of each round key is shifted back on the third column can be adjusted. Alternatively, the third character of each round key can be shifted forward by a number of digits on the third column. Similarly, when the third character is shifted forward, the third character is shifted forward by 1 digit from the third column of the second round Round 1 to the third column of the last round Round 10.
[0048] In order to more clearly illustrate the present invention and its advantages, the method provided in Example 4 of the present invention will be further explained below in conjunction with specific examples and related drawings.
[0049] Whether the privacy protection scheme proposed in the above embodiment is reasonable or not depends on the feasibility of the encryption algorithm. In order 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 the aspects of encryption time, decryption time, and diffusion index.
[0050] Experimental data such as Figure 8 As shown in the figure, by collecting statistics on 2,000 tea supply chain valid chain data from a tea company in Huangshan City and a tea company in Shitai County, we obtained the tea supply chain traceability data distribution map. The size of the tea company's supply chain traceability data is concentrated between 1M and 50M, of which the data size between 1M and 10M accounts for 22.75% of the total data volume, and the data size between 10M and 50M accounts for 77.25% of the total data volume.
[0051] In view of the distribution of 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 used the following n groups of comparative experiments to compare this solution with other existing solutions as follows: ①. Test the round key generation time of traditional AES and improved AES key expansion algorithm; ②, Use the avalanche effect index to verify the rationality of the improved AES+ECC scheme; ③. Use data encryption and decryption time indicators to verify the effectiveness of the improved AES+ECC scheme; ④. Use statistical analysis methods to calculate the correlation between variables in different models.
[0052] The experimental results and analysis are as follows: (1) Comparison of round key generation time In order to verify the round key generation speed of the improved AES algorithm, the test data provided in the AES algorithm standard was used, the key generation time was recorded and the average of 10 results was taken.
[0053] Fig. 9This is a time comparison chart of AES and improved AES algorithm to generate ten rounds of keys. It can be concluded that the average time consumed by the AES-128 algorithm and the improved scheme is 0.002224 seconds and 0.002676 seconds respectively. The change in time can reflect that the improved scheme has increased a certain time complexity, but the scheme proposed in this article has increased the time by 0.000452 seconds compared with the AES algorithm. The change in milliseconds is almost negligible because it will not significantly increase the encryption and decryption time of the algorithm. Therefore, the improved algorithm increases the security of the algorithm while not affecting the efficiency of the algorithm. The AES algorithms included in the experiments below are all improved AES algorithms.
[0054] (2) Avalanche effect In order to verify the rationality of the scheme, the avalanche effect indicator is introduced. Avalanche effect refers to an ideal characteristic of an encryption algorithm. It means that if the plaintext or key changes slightly during the input process, it will cause a significant change in the ciphertext, such as more than half of the output bits flipping. Therefore, the higher the avalanche effect (Av), the stronger the security of the algorithm, because a single bit change during the input process can generate a different password result. Usually the number of flips in the password bit is divided by the total number of password bits to get the avalanche value. The avalanche effect of the improved AES+ECC algorithm proposed in the previous article is compared with other encryption algorithms, as shown in Table 1.
[0055] Table 1 Comparison of avalanche effects among different schemes ; It can be seen from the table that the avalanche effect of all improved algorithms is 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, which means that this algorithm is the most difficult to be destroyed. Compared with AES, the improved scheme has a significantly high avalanche effect, which means that the improved AES+ECC is stronger in terms of security than other models.
[0056] (3) Encryption and decryption time The encryption time is defined as the time required to convert the original text into a cipher file or encrypted file, and the decryption time is defined as the time required to convert the cipher text back to the original file. First, the encryption and decryption time of the improved AES-128, ECC-256, and RSA-2048 algorithms are compared. Fig.10 As shown in the figure, the encryption and decryption time of the symmetric encryption algorithm (AES) is much shorter than that of the asymmetric algorithm (RSA, ECC).
[0057] Although symmetric encryption algorithms are very efficient, potential risks such as information leakage caused by key management issues cannot be avoided. Therefore, this chapter uses asymmetric encryption algorithms to protect keys. The two hybrid encryption schemes are compared with the ECC encryption scheme. The encryption operation time of the three encryption algorithms on tea supply chain data sets of different sizes is shown in Table 2.
[0058] Table 2 Encryption schedule of three encryption algorithms ; As can be seen from the table, the traditional ECC algorithm takes the longest time, and the encryption time of the other two hybrid encryption algorithms is not much different. As the data set becomes larger, the time complexity of the three encryption algorithms increases. For specific comparison, refer to Fig.11 As can be seen from Table 2, the encryption operation time of the three encryption algorithms is positively correlated with the size of the tea supply chain traceability data.
[0059] In general, hybrid encryption algorithms are more efficient than traditional algorithms. When the data set is 1M, the efficiency of ECC's hybrid encryption algorithm is 59.43% higher than that of the traditional ECC algorithm, while the efficiency of RSA's hybrid encryption is 92.35% higher than that of the traditional ECC algorithm, which means that in the encryption stage of encrypting small data sets, the efficiency of RSA hybrid encryption algorithm is higher than that of ECC hybrid encryption algorithm; however, when the data set is greater than 1M and less than or equal to 50M, the efficiency of the two algorithms is equivalent in the encryption stage, and the overall efficiency of ECC hybrid encryption algorithm is slightly higher than that of RSA hybrid encryption algorithm.
[0060] The decryption time of the three encryption algorithms on tea supply chain data sets of different sizes is shown in Table 3. The ECC algorithm takes longer than the hybrid encryption algorithm. Fig.12 shown.
[0061] Table 3 Decryption schedule of three encryption algorithms ; As can be seen from the table above, the decryption operation time of the three encryption algorithms is 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 in the data decryption process, and the efficiency of the two hybrid encryption algorithms is close.
[0062] Table 4 Comparison of total time complexity of three encryption algorithms ; Table 4 is a comparison of the total running time of the three key algorithms. The total encryption and decryption time of the two hybrid encryption algorithms is much shorter than the traditional ECC algorithm. Among them, the ECC hybrid algorithm takes the shortest time. Similarly, the total encryption and decryption time of the three algorithms increases accordingly as the data set becomes larger. The fluctuation graph is shown in the figure below. Fig.12As shown in the figure, the total encryption and decryption time of the three schemes is compared. Fig.13 shown.
[0063] As can be seen from the above table, the total encryption and decryption time of the three encryption algorithms is positively correlated with the size of the tea supply chain chain data. 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 is more improved than the ECC hybrid encryption algorithm. As the size of the tea supply chain chain data increases, the time complexity of the two hybrid algorithms is getting closer. When the data set is greater than 20M and less than or equal to 50M, the encryption and decryption efficiency of the two algorithms is 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 Fig.13 It is shown that this scheme will help reduce the computational complexity compared with other encryption algorithms.
[0064] (4) Correlation analysis In order to further verify the security of the scheme, the correlation coefficient indicator is introduced. The correlation coefficient represents the correlation between two variables, such as the correlation coefficient factor between plaintext and ciphertext. It illustrates the relationship between different variables, and the coefficient represents the degree of strong protection of the encryption algorithm against statistical attacks. In order to make the system more secure, the correlation must be closer to "0". That is, a strong encryption algorithm should have a ciphertext that is completely different from the plain text.
[0065] The correlation coefficient should be calculated by the following equation: ; in: yes The average value of yes The average value of It is plain text data; is the ciphertext data. The average value calculation formula is shown in formula (2).
[0066] ; and The standard deviation of can be expressed as follows: ; 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 stronger the encryption algorithm.
[0067] Table 5 Comparison of correlation coefficient values of the proposed schemes ; Table 5 shows the correlation coefficients calculated using different data sizes. The results show that the correlation coefficient of the proposed scheme is about 0.045, which is close to zero. This means that the strong password generated by the improved AES+ECC algorithm has less similarity with the plain text and is difficult to crack.
[0068] By comparison, the AES+ECC hybrid encryption scheme combines the advantages of symmetric and asymmetric encryption algorithms. The use of hybrid encryption can effectively improve the efficiency of data transmission in the privacy protection process. At the same time, by improving 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 optimal.
[0069] In summary, when the method described in this embodiment is applied to the privacy protection of the tea supply chain, the key links of the tea supply chain are first sorted out, the basic data and sensitive data are determined respectively, and a differentiated privacy protection strategy is established on this basis; 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 needs while sharing enterprise information; finally, the hybrid encryption scheme is tested and evaluated, and experiments show that the improved AES+ECC hybrid encryption scheme is better than the AES+RSA and ECC encryption schemes.
[0070] Example 5
[0071] like Figure 7 As shown, this embodiment relates to a supply chain data privacy protection system based on hybrid encryption and decryption, the system comprising: The strategy selection module is used to receive the access request for submitted data and the corresponding plain text, judge the data category, and select the encryption strategy according to the judgment result; A data encryption module, used to encrypt plain text into cipher text according to a selected encryption strategy; A data storage module, used for storing encrypted ciphertext, the data storage module is composed of a relational database and a blockchain; 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 a key key1, and the ECC encryption module randomly generates a public-private key pair. The AES encryption module uses the key key1 to perform AES encryption on the plaintext to generate the sensitive data ciphertext. The ECC encryption module uses the public key PK in the public-private key pair to encrypt the plaintext. aPerform ECC encryption on key 1 to generate key ciphertext S key1 ; During the symmetric encryption process, the AES encryption module randomly generates key 2, key 2 is used to perform AES encryption on the plaintext to generate the basic data ciphertext; When the data category is judged to be sensitive data, the public key PK a and key ciphertext S key1 A key-value pair is formed, and the key-value pair and the sensitive data ciphertext are stored through the data storage module; when the data category is judged to be basic data, the key 2 key2 and the basic data ciphertext are stored through the data storage module.
[0072] The system also includes a data decryption module, which consists of an AES decryption module and an ECC decryption module.
[0073] The strategy selection module is also used to receive access requests for obtaining data, determine the data category, retrieve the ciphertext and select a decryption strategy based on the determination result.
[0074] When the data category is judged as sensitive data, the strategy selection module retrieves the sensitive data ciphertext in the data storage module and the public key PK through the smart contract. a and key ciphertext S key1 The decryption strategy is a combination of symmetric and asymmetric decryption. When the data category is determined to be basic data, the strategy selection module retrieves the basic data ciphertext and key 2 in the data storage module through the smart contract, and the decryption strategy is symmetric decryption.
[0075] During the hybrid decryption process, the ECC decryption module uses the public key PK a Get the key ciphertext S corresponding to key 1 key1 , and based on the private key SK in the public-private key pair a For the key ciphertext S key1 Perform ECC decryption to obtain key 1, and the AES decryption module uses key 1 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 key 2 to perform AES decryption on the basic data ciphertext to obtain the basic data plaintext.
[0076] Example 6
[0077] 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.
[0078] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which 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
Smart phone private short message security system and private short message transmission method
CN106973040A
Data transmission method and device, terminal and storage medium
CN112637166A
Data protection method and device, computer equipment and storage medium
CN115238286A
AES and RSA-based hybrid algorithms for message encryption & decryption.
IN202121007215A
A METHOD TO SECURE COMMUNICATION BETWEEN IoT DEVICES THROUGH CRYPTOGRAPHIC HYBRID ENCRYPTION TECHNIQUES
IN202421038233A