A time-limited information sharing method based on blockchain

By publishing the encrypted and decrypted warehouse of smart contracts on the blockchain, using the decentralized characteristics of blockchain and the countdown mechanism of smart contracts, the problem of the inability to effectively limit the information sharing time limit in the existing technology is solved, and the information time limit is realized Sharing and confidentiality improve information security and encryption and decryption efficiency.

CN114785570BActive Publication Date: 2024-12-06ZHEJIANG DIGITAL QIN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210356355.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-06
Publication Date
2024-12-06
Estimated Expiration
2042-04-06

AI Technical Summary

Technical Problem

The prior art cannot effectively limit the information sharing time limit, and time-based encryption schemes rely on trusted local time and are easily bypassed, resulting in low encryption security.

Method used

The blockchain-based information sharing method is adopted. By publishing smart contracts on the blockchain, the encryption and decryption warehouse is used to achieve limited-time encryption and decryption, ensuring that the information can be correctly decrypted within a specified time period, and remains confidential if it exceeds the time limit.

Benefits of technology

It realizes reliable and limited-time sharing and confidentiality of information, improving the security of information and the efficiency of limited-time encryption and decryption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114785570B_ABST
    Figure CN114785570B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of information technology, and in particular to a limited-time information sharing method based on blockchain, including: an information source party publishes a smart contract on a blockchain; when the clock counts down to 0, the encryption and decryption warehouse resets the clock and clears the blank list; the information source party allocates a limited time duration for information sharing to the requester; the information source party selects a matching encryption and decryption warehouse and feedbacks the warehouse identifier; the information is packaged and recorded as an information package; the smart contract is submitted, and the smart contract uses each encryption and decryption warehouse to encrypt the information package in turn, and the ciphertext is associated with the warehouse identifier and then uploaded to the blockchain for storage; the requester queries the blockchain to obtain the corresponding ciphertext; the ciphertext is associated with the receiving public key within the time limit, and the warehouse identifier corresponds to the encryption and decryption warehouse; the receiving public key is verified to be in the white list, and the ciphertext is decrypted and encrypted using the receiving public key and displayed in the output column; the requester uses the private key to decrypt and obtain the information package. The beneficial effect of the present invention is that the information can be correctly decrypted and obtained within the sharing time limit, and limited-time sharing is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information technology, and in particular to a time-limited information sharing method based on blockchain. Background Art

[0002] Information limited-time sharing can control the degree of information diffusion from a time perspective. For example, when it is used to distribute paid subscription information, when the paid subscription time expires, the subscription information that was once decryptable will no longer be decrypted. Controlling the spread of information from a time perspective can effectively control the spread of information and improve the security of information. The prior art has disclosed an attribute-based encryption (ABE) that encrypts messages according to attributes. Through a control strategy, only users who meet the attribute requirements can decrypt the ciphertext, thereby ensuring the confidentiality of the data. However, it cannot only constrain the user's decryption of the ciphertext from a time perspective. Although the encryption scheme based on time comparison provides the function of limiting the decryption time. However, its technical solution relies on trusted local time. Users can easily bypass the time limit determination process by changing the local time, and the encryption security is not high. Therefore, it is necessary to study new technical solutions for information limited-time sharing. Summary of the invention

[0003] The technical problem to be solved by the present invention is that the time limit of information sharing cannot be effectively limited at present. A method for limited-time information sharing based on blockchain is proposed, which can provide reliable locking and confidentiality for information that exceeds the time limit, thereby realizing limited-time information sharing.

[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is: a method for limited-time information sharing based on blockchain, comprising: an information source party publishes a smart contract on the blockchain, the smart contract includes a plurality of encryption and decryption warehouses, the encryption and decryption warehouses include warehouse identifiers, encryption functions, clocks, receiving columns, output columns and white lists, the receiving columns receive data, the output columns display the results of encryption or decryption, and the white list records the set of public keys that are allowed to access the encryption and decryption warehouses; the clock counts down to the countdown clock, and when the clock counts down to 0, the encryption and decryption warehouse resets the clock and clears the list; the requester requests information sharing from the information source party, and the information source party allocates a limited-time duration for information sharing to the requester; the information source party queries the clock of the encryption and decryption warehouse of the smart contract, selects the encryption and decryption warehouse corresponding to the clock that matches the limited-time duration, The requester's public key is added to the whitelist, and the warehouse identifier is fed back to the requester; when the information source generates new information to be shared with the requester, the information is packaged and recorded as an information package; the information package is submitted to the smart contract, and the smart contract uses each encryption and decryption warehouse in turn to encrypt the information package to obtain the ciphertext, and then associates the ciphertext with the warehouse identifier and uploads it to the blockchain for storage; the requester queries the blockchain to obtain the ciphertext corresponding to the assigned warehouse identifier; after associating the ciphertext with the receiving public key within a time limit, the requester submits the receiving column of the encryption and decryption warehouse corresponding to the warehouse identifier; the encryption and decryption warehouse verifies whether the receiving public key is in the whitelist. If it is not in the whitelist, no operation is performed. Otherwise, the encryption and decryption warehouse decrypts the ciphertext to obtain the information package, encrypts the information package using the receiving public key, and displays it in the output column; the requester uses the private key to decrypt to obtain the information package.

[0005] Preferably, the information source encrypts the information package using a symmetric encryption algorithm with the encryption key being Key, and uploads the encrypted information package to the blockchain for storage; the information source submits the Key to the smart contract, and the smart contract uses each encryption and decryption warehouse in turn to encrypt the information package to obtain the ciphertext, and associates the ciphertext with the warehouse identifier and then uploads it to the blockchain for storage; the requester polls the blockchain to obtain the encrypted information package and the ciphertext encrypted by the smart contract; the requester associates the ciphertext with the receiving public key within a time limit, and then submits the receiving column of the encryption and decryption warehouse corresponding to the warehouse identifier; the encryption and decryption warehouse verifies that the receiving public key is in the whitelist, then decrypts the ciphertext to obtain the Key, encrypts the Key with the receiving public key and displays it in the output column; the requester reads the data in the output column, decrypts it using the private key to obtain the Key, and decrypts the information package using the Key to obtain the information package in plaintext.

[0006] Preferably, the encryption function of the encryption / decryption warehouse is a univariate polynomial f(x), and the method for the encryption / decryption warehouse to encrypt data using the univariate polynomial f(x) is: converting the data to be encrypted into a binary stream, filling the gaps according to preset rules, truncating the data into a number of binary segments of preset lengths, and converting the binary segments into integers D; generating data combinations (b1, x1, b2, x2, …, bN, xN, △), where bi is a positive integer, such that D=∑(-1)^bi*floor(bi / 2)*f(xi)+△, where i∈[1,N], △ is a correction value, and floor() is a downward forensic function; combining the data combinations in sequence as ciphertext; the method for the encryption / decryption warehouse to decrypt data is: reading the data combinations in sequence, substituting bi and xi in each data combination into the univariate polynomial f(x), and summing them with the correction value △ to obtain the integer D; converting all the integers D into binary streams and splicing them in sequence, removing the padding, and obtaining the decrypted data.

[0007] Preferably, the smart contract generates a set of values ​​of the independent variable x for each encryption and decryption warehouse; the encryption and decryption warehouse calculates the function value of the current encryption function under the set of values ​​of the independent variable x, and associates the function value with the value of the independent variable x as a quick lookup table; when the encryption and decryption warehouse encrypts data, it queries the quick lookup table, selects N function values ​​and generates N bi values ​​accordingly, so that the difference between ∑(-1)^bi*floor(bi / 2)*f(xi) and D is within a preset range.

[0008] Preferably, when the clock of the encryption / decryption warehouse counts down to 0, the encryption / decryption warehouse updates the encryption function and the quick lookup table.

[0009] Preferably, the encryption and decryption warehouse generates multiple different true subsets of the value set of the independent variable x; the information source party numbers the different information packages generated at the same time, groups the requesters corresponding to each information package into a group, and assigns a group number; when the information source party associates the information package or Key with the corresponding group number and submits it to the smart contract; when the encryption and decryption warehouse encrypts the data, different true subsets are selected for information packages or Keys with different group numbers, and the same true subset is selected for information packages or Keys with the same group number, so that the value of the independent variable x involved in the ciphertext traverses the selected true subset, and when the clock counts down to 0, the true subset is regenerated; when the encryption and decryption warehouse decrypts, it checks whether the value of the independent variable x involved in the ciphertext is consistent with the true subset corresponding to the group number, and if it does not match, decryption is not performed.

[0010] Preferably, the encryption and decryption warehouse generates an equivalent univariate polynomial f'(x) under each proper subset for the univariate polynomial f(x) of the current encryption function, and when the independent variable x takes a value in the proper subset, the equivalent univariate polynomial f'(x) has the same function value as the univariate polynomial f(x); when the number of requesters with the same information package and the same shared duration exceeds a preset threshold, the information source requests the smart contract to disclose the equivalent univariate polynomial f'(x) and submits the group number to the smart contract; the smart contract obtains the proper subset of the group number corresponding to the encryption and decryption warehouse, encrypts the equivalent univariate polynomial f'(x) corresponding to the proper subset using the public key of the information source, and then uploads it to the blockchain; the information source queries the blockchain, decrypts it using the private key, and then sends the equivalent univariate polynomial f'(x) to the requester with the same information package and the same shared duration; the requester receives the equivalent univariate polynomial f'(x) and uses the equivalent univariate polynomial f'(x) to decrypt the ciphertext.

[0011] The substantial effects of the present invention are: realizing time-limited encryption and time-limited decryption through the smart contract published on the blockchain, so that information can be correctly decrypted and obtained only within the shared time limit. If the shared time limit is exceeded, the information will remain confidential, thus realizing time-limited sharing of information; and improving the efficiency of time-limited encryption and decryption through a new time-limited encryption algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 This is a schematic diagram of a method for sharing information within a limited time according to Example 1.

[0013] Figure 2 This is a schematic diagram of an information encryption method according to Embodiment 1.

[0014] Figure 3 This is a schematic diagram of the encryption method of the encryption and decryption warehouse in Example 1.

[0015] Figure 4 This is a schematic diagram of an encryption method using a quick lookup table in Example 1.

[0016] Figure 5 This is a schematic diagram of a method for encrypting multiple information packets within a limited time according to Embodiment 2.

[0017] Figure 6 This is a schematic diagram of the equivalent univariate polynomial encryption method of Example 2. DETAILED DESCRIPTION

[0018] The specific implementation of the present invention will be further described below through specific examples in conjunction with the accompanying drawings.

[0019] Embodiment 1:

[0020] A method for sharing information in a limited time based on blockchain, please refer to the attached Figure 1, including: step A01) the information source publishes a smart contract on the blockchain, the smart contract includes several encryption and decryption warehouses, the encryption and decryption warehouses include warehouse identifiers, encryption functions, clocks, receiving columns, output columns and white lists, the receiving columns receive data, the output columns display the results of encryption or decryption, and the white list records the set of public keys that are allowed to access the encryption and decryption warehouses; step A02) the clock counts down to the clock, when the clock counts down to 0, the encryption and decryption warehouse resets the clock and clears the list; step A03) the requester requests information sharing from the information source, and the information source allocates a time limit for information sharing to the requester; step A04) the information source queries the clock of the encryption and decryption warehouse of the smart contract, selects the encryption and decryption warehouse corresponding to the clock that matches the time limit, adds the requester's public key to the white list, and feeds back the warehouse identifier to the requester; step A0 5) When the information source generates new information to be shared with the requester, the information is packaged and recorded as an information package; Step A06) The information package is submitted to the smart contract, and the smart contract uses each encryption and decryption warehouse to encrypt the information package in turn, obtains the ciphertext, and associates the ciphertext with the warehouse identifier and uploads it to the blockchain for storage; Step A07) The requester queries the blockchain to obtain the ciphertext corresponding to the assigned warehouse identifier; Step A08) The requester associates the ciphertext with the receiving public key within the time limit and submits the receiving column of the encryption and decryption warehouse corresponding to the warehouse identifier; Step A09) The encryption and decryption warehouse verifies whether the receiving public key is in the whitelist. If it is not in the whitelist, no operation is performed. Otherwise, Step A10) The encryption and decryption warehouse decrypts the ciphertext to obtain the information package, and encrypts the information package with the receiving public key and displays it in the output column; Step A11) The requester uses the private key to decrypt and obtain the information package. As shown in Table 1, it is a structure table of the smart contract. Each clock has a corresponding time limit. The time limit setting can be completed by adding the requester's public key to the corresponding whitelist. Table 1 records 60 encryption and decryption warehouses, which can provide 60 different time limits. After the information package is generated, it needs to be encrypted in 60 encryption and decryption warehouses respectively, and then uploaded to the blockchain storage after the warehouse identification is associated. Requesters with different shared time limits use the corresponding encryption and decryption warehouses to decrypt the corresponding ciphertext to obtain the information package in plaintext and complete the information sharing.

[0021] Table 1 Smart contract structure

[0022] Encryption and decryption warehouse 1 {Storage ID 1, encryption function 1, clock 1, receiving column 1, output column 1, whitelist 1} Encryption and decryption warehouse 2 {Storage ID 2, encryption function 2, clock 2, receiving column 2, output column 2, whitelist 2} Encryption and decryption warehouse 3 {Storage ID 3, encryption function 3, clock 3, receiving column 3, output column 3, whitelist 3} … … Encryption and decryption warehouse 60 {bin identifier 60, encryption function 60, clock 60, receiving column 60, output column 60, whitelist 60}

[0023] When the information packet is large, it will take a long time for the encryption and decryption bin to complete the encryption and decryption process, reducing the efficiency of the encryption and decryption bin. To this end, this embodiment provides a specific improved technical solution, please refer to the attached Figure 2, including: Step B01) The information source encrypts the information package using a symmetric encryption algorithm, the encryption key is Key, and the encrypted information package is uploaded to the blockchain for storage; Step B02) The information source submits Key to the smart contract, and the smart contract uses each encryption and decryption warehouse to encrypt the information package in turn, obtains the ciphertext, and associates the ciphertext with the warehouse identifier and uploads it to the blockchain for storage; Step B03) The requester polls the blockchain to obtain the encrypted information package and the ciphertext encrypted by the smart contract; Step B04) The requester associates the ciphertext with the receiving public key within a limited time, and submits the receiving column of the encryption and decryption warehouse corresponding to the warehouse identifier; Step B05) The encryption and decryption warehouse verifies that the receiving public key is in the whitelist, then decrypts the ciphertext, obtains Key, encrypts Key with the receiving public key and displays it in the output column; Step B06) The requester reads the output column data, decrypts it using the private key to obtain Key, and uses Key to decrypt the information package to obtain the information package in plain text. If the generated information package is the industry survey report of this month, the industry survey report is encrypted using a symmetric encryption algorithm and uploaded to the blockchain for storage. The secret key Key used by the symmetric encryption algorithm is encrypted with the 60 encryption and decryption warehouses shown in Table 1, and then uploaded to the blockchain after being associated with the warehouse identifier. There will be 60 ciphertexts associated with the warehouse identifier. The requester queries the blockchain, obtains the ciphertext associated with the corresponding warehouse identifier, submits the ciphertext to the encryption and decryption warehouse for decryption, obtains the secret key Key, and uses the secret key Key to decrypt and obtain the information package in the original state, that is, the industry survey report in the original state.

[0024] The encryption function of the encryption and decryption bin is a univariate polynomial f(x), please refer to the attached Figure 3 , the method for encrypting data using a univariate polynomial f(x) in the encryption and decryption warehouse is as follows: step C01) converting the data to be encrypted into a binary stream, padded according to a preset rule, truncated into a number of binary segments of preset length, and converting the binary segments into integers D; step C02) generating a data combination (b1, x1, b2, x2, …, bN, xN, △), bi is a positive integer, such that D = ∑ (-1) ^ bi * floor (bi / 2) * f (xi) + △, where i ∈ [1, N], △ is a correction value, and floor () is a downward forensic function; step C03) combining the data combinations in order as ciphertext. For example, if the key is "EuWk", in ASCII encoding, the string EuWk is converted to binary as follows: 01000101 011101010101010111 01101011, which is truncated to two integers according to the length of 2 bytes, namely D1=17781 and D2=22379. The univariate polynomial f(x) is: f(x)=15*x^2-32*x+64. Then D1 can be expressed as D1=6*f(7)+ f(31)+844, and the corresponding data combination is (12,7,2,31,844). The data combination of integer D2 can be obtained in the same way. The data combination of each integer is not unique.

[0025] Correspondingly, the method for encrypting and decrypting data in the decryption warehouse is: read the data combinations in sequence, substitute bi and xi in each data combination into the univariate polynomial f(x), and sum them with the correction value △ to obtain the integer D; convert all integers D into binary streams and splice them in sequence, remove the padding, and obtain the decrypted data.

[0026] In order to improve the efficiency of encryption and decryption using the univariate polynomial f(x), this embodiment provides a solution for implementing high-efficiency encryption and decryption with the help of a quick lookup table. Figure 4 , including: step D01) the smart contract generates a set of independent variable x values ​​for each encryption and decryption warehouse; step D02) the encryption and decryption warehouse calculates the function value of the current encryption function under the set of independent variable x values, and associates the function value with the value of independent variable x as a quick lookup table; step D03) when the encryption and decryption warehouse encrypts the data, it queries the quick lookup table, selects N function values ​​and generates N bi values ​​accordingly, so that the difference between ∑(-1)^bi*floor(bi / 2)*f(xi) and D is within the preset range. When the clock of the encryption and decryption warehouse counts down to 0, the encryption and decryption warehouse updates the encryption function and the quick lookup table. In this embodiment, the set of independent variable x values ​​set for encryption and decryption warehouse 2 is {2,4,7}, and the univariate polynomial f(x) is: f(x)=7*x^2+12*x-4, then the corresponding function value is {48,156,423}, and the quick lookup table is shown in Table 2.

[0027] Table 2 Quick Lookup Table Provided in This Example

[0028] Independent variable x Function value of a univariate polynomial f(x) 2 48 4 156 7 423

[0029] By using the values ​​in {48,156,423}, performing the sum calculation with coefficients, and adding the correction value △, any integer D can be expressed to complete the encryption process of the information.

[0030] The substantial effect of this embodiment is: time-limited encryption and time-limited decryption are achieved through the smart contract published on the blockchain, so that information can be correctly decrypted and obtained within the shared time limit. If the shared time limit is exceeded, the information will remain confidential, thus achieving time-limited sharing of information; the efficiency of time-limited encryption and decryption is improved through a new time-limited encryption algorithm.

[0031] Embodiment 2:

[0032] A method for limited-time information sharing based on blockchain. Based on the first embodiment, this embodiment provides a specific technical solution for the information source to share multiple types of information within different requesters at the same time. Figure 5, including: step E01) the encryption and decryption warehouse generates multiple different true subsets of the value set of the independent variable x; step E02) the information source party numbers the different information packages generated at the same time, groups the requesters corresponding to each information package into a group, and assigns a group number; step E03) the information source party associates the information package or key with the corresponding group number and submits it to the smart contract; step E04) when the encryption and decryption warehouse encrypts the data, different true subsets are selected for information packages or keys with different group numbers, and the same true subset is selected for information packages or keys with the same group number, so that the value of the independent variable x involved in the ciphertext traverses the selected true subset, and when the clock counts down to 0, the true subset is regenerated; when the encryption and decryption warehouse decrypts, it checks whether the value of the independent variable x involved in the ciphertext is consistent with the true subset corresponding to the group number. If it does not match, decryption is not performed.

[0033] In this embodiment, the value set of the independent variable x set for the encryption and decryption warehouse 2 is {2,4,7,9,10}, and the univariate polynomial f(x) is: f(x)=7*x^2+12*x-4. Two proper subsets are generated, namely {2,4,7} and {2,7,10}, and the corresponding group numbers are Z1 and Z2 respectively. When the information source generates multiple types of information packages, such as providing an industry survey report and a price list of a certain type of product at the same time, the two information packages are shared with different requesters respectively. If the technical solution recorded in Example 1 is adopted, when the requester of the shared industry survey report with a time limit of 30 days and the requester of the shared price list with a time limit of 30 days, they will have the right to use the same encryption and decryption warehouse, that is, they will be added to the whitelist of the corresponding encryption and decryption warehouse. As a result, the requester of the shared industry survey report can also decrypt and obtain the price list. This affects the normal sharing of information. In order to solve this problem, the second embodiment provides a specific technical solution, which can be applied to the situation where the information source needs to share different types of information packages for different requesters at the same time. Different group numbers are assigned to requesters who share industry survey reports and price lists. When the requester requests the encryption and decryption warehouse to decrypt, the encryption and decryption warehouse checks whether the value of the independent variable x involved in the ciphertext is consistent with the true subset corresponding to the group number. If the value of the independent variable x involved in the ciphertext is outside the corresponding true subset, it is judged that it does not match and the decryption operation is not performed.

[0034] In order to reduce the encryption and decryption workload of the encryption and decryption warehouse, this embodiment provides a technical solution that uses an equivalent univariate polynomial to enable the requester to complete the decryption process by himself without affecting the sharing of other information. Figure 6, including: step F01) the encryption and decryption warehouse generates an equivalent univariate polynomial f'(x) under each proper subset for the univariate polynomial f(x) of the current encryption function, and when the independent variable x takes a value in the proper subset, the equivalent univariate polynomial f'(x) has the same function value as the univariate polynomial f(x); step F02) when the number of requesters with the same information package and the same sharing time exceeds a preset threshold, the information source requests the smart contract to disclose the equivalent univariate polynomial f'(x) and submit the group number to the smart contract; step F03) The smart contract obtains the true subset of the group number corresponding to the encryption and decryption warehouse, encrypts the equivalent univariate polynomial f'(x) corresponding to the true subset with the public key of the information source, and then uploads it to the blockchain; Step F04) The information source queries the blockchain, decrypts it with the private key, and sends the equivalent univariate polynomial f'(x) to the requester with the same information package and the same sharing time; Step F05) The requester receives the equivalent univariate polynomial f'(x) and uses the equivalent univariate polynomial f'(x) to decrypt the ciphertext. Compared with the first embodiment, only one type of information can be shared. When different categories of information need to be shared with different requesters with the same time limit, the technical solution recorded in the first embodiment will result in the requesters being able to decrypt the information packages of their respective information categories, and cannot form isolation between the requester groups. The technical solution recorded in this embodiment solves the isolation between different requester groups when sharing information with the same time limit, so that the requester group can only decrypt the corresponding category of information.

[0035] The univariate polynomial f(x) is: f(x)=7*x^2+12*x-4. Generate two proper subsets, {2,4,7} and {2,7,10}. Calculate the corresponding function values, and then generate the equivalent univariate polynomial f'(x) of the corresponding proper subsets. For example, the corresponding function value of the proper subset {2,4,7} is {48,156,423}, and the corresponding equivalent univariate polynomial f'(x) is: f'(x)=-8.75*x^3+120.75*x^2-425.5*x+486. The value of the equivalent univariate polynomial f'(x) on the proper subset {2,4,7} is the same as that of the univariate polynomial f(x). At the same time, an equivalent univariate polynomial of the proper subset {2,7,10} with group number Z2 is generated, denoted as f''(x)= -1.25*x^3+30.75*x^2-118*x+171, which is the same as the value of the univariate polynomial f(x) on the proper subset {2,7,10}.

[0036] The key generated for the information package of the industry survey report is "EuWk", which is converted to binary as 0100010101110101 01010111 01101011, and truncated to two integers according to the length of 2 bytes, respectively D11 = 17781, D12 = 22379. Select the proper subset {2,4,7}, then the integers D11 and D12 are respectively expressed as: D11 = 15*f(2) + 22*f(4) + 32*f(7) + 93, the corresponding data combination is (30,2,44,4,64,7,93). D12 = 25*f(2) + 12*f(4) + 45*f(7) + 272, the corresponding data combination is (50,2,24,4,90,7,272). The ciphertext of secret key Key = "EuWk" is {(30,2,44,4,64,7,93),(50,2,24,4,90,7,272)}.

[0037] Similarly, the key Key generated for the price list information package is "oT3g", which is converted to binary as 0110111101010100 00110011 01100111, and truncated to two integers according to the length of 2 bytes, namely D21=28500 and D22=13159. Select the proper subset {2,7,10}, then the integers D21 and D22 are represented as: D21=8*f(2)+20*f(7)+24*f(10)+72, and the corresponding data combination is (16,2,40,7,48,10,72). D22=12*f(2)+18*f(7)+6*f(10)+73, and the corresponding data combination is (24,2,36,7,12,10,73). The ciphertext of key Key = "oT3g" is {(16,2,40,7,48,10,72),(24,2,36,7,12,10,73)}.

[0038] Provide equivalent univariate polynomials f'(x) and f''(x) to the requesters corresponding to the two information packets respectively, and the requesters will not be affected when decrypting the corresponding ciphertext. For example, when using f'(x) =-8.75*x^3+120.75*x^2-425.5*x+486 to decrypt {(30,2,44,4,64,7,93), (50,2,24,4,90,7,272)}, substitute the corresponding independent variable x value, bi value and correction value △ to obtain the correct integers D11 and D12, convert them into binary, concatenate them, and then convert them into a string to obtain the secret key Key "EuWk". But if it is the requester corresponding to the price list, try to decrypt {(30,2,44,4,64,7,93), (50,2,24,4,90,7,272)}, that is, use f''(x)= -1.25*x^3+30.75*x^2-118*x+171 to decrypt {(30,2,44,4,64,7,93), (50,2,24,4,90,7,272)}, the result is D11=16791, D12=21839, which is converted to binary and concatenated as: 0100 0001 1001 0111 0101 0101 0100 1111, which is then converted to the string "-UO", where "-" represents non-ACSII characters. It can be seen that the requester corresponding to the price list cannot correctly decrypt the non-corresponding secret key using the equivalent univariate polynomial obtained, thereby achieving isolation between the shared groups corresponding to different types of information packets, thereby improving the security of information sharing.

[0039] The above-described embodiment is only a preferred solution of the present invention and does not limit the present invention in any form. There are other variations and modifications without exceeding the technical solution described in the claims.

Claims

1. A method for limited-time information sharing based on blockchain, characterized in that: include: The information source publishes a smart contract on the blockchain. The smart contract includes several encryption and decryption bins. The encryption and decryption bins include bin identifiers, encryption functions, clocks, receiving columns, output columns, and whitelists. The receiving column receives data, the output column displays the result of encryption or decryption, and the whitelist records the set of public keys that are allowed to access the encryption and decryption bins. The clock counts down to 0, and the encryption and decryption warehouse resets the clock and clears the list; The requester requests information sharing from the information source, and the information source assigns the requester a time limit for information sharing; The information source queries the clock of the smart contract's encryption and decryption warehouse, selects the encryption and decryption warehouse corresponding to the clock that matches the time limit, adds the requester's public key to the whitelist, and feeds back the warehouse identifier to the requester; When the information source generates new information to be shared with the requester, the information is packaged and recorded as an information package; Submit the information package to the smart contract, and the smart contract uses each encryption and decryption warehouse in turn to encrypt the information package to obtain ciphertext, associate the ciphertext with the warehouse identifier, and then upload it to the blockchain for storage; The requester queries the blockchain to obtain the ciphertext corresponding to the assigned warehouse identifier; The requester associates the ciphertext with the receiving public key within the time limit and submits the receiving column of the encryption and decryption warehouse corresponding to the warehouse identifier; The encryption and decryption warehouse verifies whether the receiving public key is in the white list. If it is not in the white list, no operation is performed. Otherwise, the encryption and decryption warehouse decrypts the ciphertext to obtain the information package, encrypts the information package with the receiving public key, and displays it in the output column; The requester uses the private key to decrypt and obtain the information packet; The encryption function of the encryption / decryption bin is a univariate polynomial f(x). The method for the encryption / decryption bin to encrypt data using the univariate polynomial f(x) is: The data to be encrypted is converted into a binary stream, and after padding according to a preset rule, it is truncated into a number of binary segments of preset lengths, and the binary segments are converted into integers D; Generate a data combination (b1,x1,b2,x2,…,bN,xN,△), bi is a positive integer, so that D=∑(-1)^bi*floor(bi / 2)*f(xi)+△, where i∈[1,N], △ is the correction value, and floor() is the downward forensic function; Combine the data in order as ciphertext; The method of encrypting and decrypting data in the decryption warehouse is: Read the data combinations in sequence, substitute bi and xi in each data combination into the univariate polynomial f(x), and sum them with the correction value △ to obtain the integer D; Convert all integers D into binary streams and concatenate them in order, remove the padding, and obtain the decrypted data; The smart contract generates a set of values ​​of independent variable x for each encryption and decryption warehouse; The encryption and decryption warehouse calculates the function value of the current encryption function under the value set of the independent variable x, and associates the function value with the value of the independent variable x as a quick lookup table; When the encryption and decryption warehouse encrypts data, it queries the quick lookup table, selects N function values ​​and generates N bi values ​​accordingly, so that the difference between ∑(-1)^bi*floor(bi / 2)*f(xi) and D is within the preset range.

2. According to claim 1, a method for limited-time information sharing based on blockchain is characterized in that: The information source encrypts the information package using a symmetric encryption algorithm, with the encryption key being Key, and uploads the encrypted information package to the blockchain for storage; The information source submits the key to the smart contract, and the smart contract uses each encryption and decryption warehouse in turn to encrypt the information package, obtain the ciphertext, associate the ciphertext with the warehouse identifier, and then upload it to the blockchain for storage; The requester polls the blockchain and obtains the encrypted information package and the encrypted ciphertext of the smart contract; The requester associates the ciphertext with the receiving public key within the time limit and submits the receiving column of the encryption and decryption warehouse corresponding to the warehouse identifier; The encryption and decryption warehouse verifies that the received public key is in the whitelist, decrypts the ciphertext, obtains the Key, encrypts the Key with the received public key, and displays it in the output column; The requester reads the output column data, decrypts it using the private key to obtain the Key, and decrypts the information packet using the Key to obtain the information packet in plain text.

3. According to claim 1, a method for limited-time information sharing based on blockchain is characterized in that: When the clock of the encryption / decryption warehouse counts down to 0, the encryption / decryption warehouse updates the encryption function and the quick lookup table.

4. According to claim 1, a method for limited-time information sharing based on blockchain is characterized in that: The encryption / decryption warehouse generates multiple different proper subsets of the value set of the independent variable x; The information source party numbers different information packets generated at the same time, groups the requesters corresponding to each information packet into a group, and assigns a group number; When the information source associates the information package or key with the corresponding group number and submits it to the smart contract; When the encryption and decryption warehouse encrypts data, different true subsets are selected for information packets or keys with different group numbers, and the same true subset is selected for information packets or keys with the same group number, so that the value of the independent variable x involved in the ciphertext traverses the selected true subset, and when the clock countdown reaches 0, the true subset is regenerated; When the encryption and decryption warehouse performs decryption, it checks whether the value of the independent variable x involved in the ciphertext matches the true subset corresponding to the group number. If not, decryption is not performed.

5. According to claim 4, a method for limited-time information sharing based on blockchain is characterized in that: The encryption / decryption warehouse generates an equivalent univariate polynomial f'(x) under each proper subset for the univariate polynomial f(x) of the current encryption function. When the independent variable x takes a value in the proper subset, the equivalent univariate polynomial f'(x) has the same function value as the univariate polynomial f(x); When the number of requesters with the same information package and the same sharing duration exceeds a preset threshold, the information source requests the smart contract to disclose the equivalent univariate polynomial f'(x) and submit the group number to the smart contract; The smart contract obtains the proper subset of the group number corresponding to the encryption and decryption warehouse, encrypts the equivalent univariate polynomial f'(x) corresponding to the proper subset using the public key of the information source, and then uploads it to the blockchain; The information source queries the blockchain, decrypts it with a private key, and sends the equivalent univariate polynomial f'(x) to the requester with the same information package and the same shared duration; The requester receives the equivalent univariate polynomial f'(x) and uses the equivalent univariate polynomial f'(x) to decrypt the ciphertext.