Time-controlled encrypted anonymous interaction method based on smart contracts
Through the onion type data transmission and margin remuneration mechanism bound by smart contract, the identity privacy and unreliability problems in the existing TRE solution are solved, and high reliability and flexibility of anonymous time trap query is achieved to resist multiple attacks.
Patent Information
- Application Number
- CN202211260279.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-14
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2042-10-14
AI Technical Summary
The existing time-controlled encryption (TRE) solution based on blockchain smart contracts cannot guarantee the identity privacy of both parties, and has poor flexibility and scalability. It is impossible to query the time trap anonymously at any time, and intermediate nodes or Time server unreliability leads to unstable message transmission.
Using a time-controlled encryption anonymous interaction method based on smart contracts, the encrypted trap request is divided into multiple ciphertext fragments through the sender, and the onion type data is transmitted. The middleman node and the time server realize anonymous query arbitrary through smart contract constraints. Time is trapped, and the honesty of the middleman node is guaranteed through margin and remuneration mechanisms.
It improves the probability and stability of successful trap requests, resists early release, interrupt, eavesdropping and replacement attacks, and realizes the security and flexibility of anonymous queries.
Smart Images

Figure CN115664735B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data security technology, and in particular to a time-controlled encrypted anonymous interaction method based on smart contracts. Background Art
[0002] Timed-release encryption (TRE) is an important technology for releasing sensitive data at a specific time, and its implementation scheme is constantly improving with application scenarios and application requirements. The original TLP method bound the decryption of the message to a computational problem that required a specific time to solve, but due to the different computing power of different devices, it was difficult to control the precise scheduled decryption time and was replaced by a new method. The interactive time server-based method is that the receiver obtains the time trap by interacting with the server to decrypt the message; the non-interactive time server-based method is achieved by the time server periodically broadcasting the time trap. As the current demand is more towards anonymous query of the time trap at any time, constructing a suitable TRE scheme has become the goal of researchers.
[0003] When querying in a traditional network, there may be problems with unreliable intermediate transmission nodes or time servers. For intermediate nodes, they may choose to give up the message transmission due to bribery by attackers, or the intermediate nodes may be unable to transmit due to some reasons of their own; for time servers, dishonest time traps may occur. This will cause users to lose benefits due to the inability to transmit interactive information in a timely manner. Therefore, if there is a treaty to restrict the behavior of participants, and reward their honest behavior and punish their dishonest behavior, the stability and security of message transmission can be greatly improved. We consider using blockchain-based smart contract technology to solve the above problems.
[0004] The application of blockchain technology can ensure the integrity of trapdoor requests and messages during transmission, and since all transactions in the blockchain will be verified and backed up by all nodes in the network, the probability of successful trapdoor queries can be increased to a certain extent. As a digital contract based on blockchain that cannot be tampered with, smart contracts can achieve standardized management of the behavior of all participants and regulations on reward and punishment systems.
[0005] Most of the existing TRE schemes based on blockchain smart contracts use blockchain to control the time of obtaining decryption keys. Li et al. [Li C, Palanisamy B. Decentralized release of self-emerging data using smart contracts [C]. 2018 IEEE 37th Symposium on Reliable Distributed Systems (SRDS). Salvador, Brazil: IEEE, 2018: 213-220.] proposed in 2018 to use smart contracts in the Ethereum blockchain to achieve timed decryption of confidential data. The scheme designed an executable smart contract and employed a group of peers to transfer decryption keys to achieve timed decryption of confidential data without the need for a third-party time server to provide a time trapdoor. Ning et al. [Ning J, Dang H, Hou R, et al. Keeping time-release secrets through smart contracts [J]. Cryptology ePrint Archive, 2018.] proposed in 2018 an incentive-based method that combines threshold secret sharing with blockchain-based smart contracts, pre-distributing secrets to participants and reconstructing secrets at a specified time to achieve a time-controlled cryptographic mechanism. The solution implements timing control based on the sequential nature of block generation on the blockchain, and uses smart contracts to force relevant parties to fulfill their contractual obligations.
[0006] The above solution does not involve a trusted third party such as a time server, but cannot guarantee the identity privacy of both communicating parties, and the flexibility and scalability of the solution are poor. Summary of the invention
[0007] Aiming at the reliability problem of nodes in the existing TRE anonymous interaction work, the present invention proposes a time-controlled encrypted anonymous interaction method based on smart contracts, which improves the probability of successful trapdoor requests while realizing anonymous queries, making trapdoor requests more stable.
[0008] In order to achieve the above object, the present invention adopts the following technical solutions:
[0009] A time-controlled encrypted anonymous interaction method based on smart contracts includes three entities: a sender (i.e., a receiver of timed decrypted data), a middleman, and a time server. The sender, the middleman, and the time server are constrained by the smart contract. The method includes:
[0010] When the decryption time is approaching, the sender uses secret sharing technology to divide the encrypted trapdoor request into n ciphertext fragments, and encrypts them layer by layer to construct onion-type data. The onion-type data is transmitted through the middleman node selected from the smart contract. After receiving the ciphertext fragments, the time server integrates them to obtain the time of the trapdoor request and returns the corresponding time trapdoor to the sender, allowing the sender to anonymously query any time trapdoor.
[0011] Furthermore, the middleman is generated in the following manner:
[0012] Each node provides the contract with the node public key, IP information, deposit, and the time period in which the service can be provided to register as an intermediary. All intermediaries are maintained in the intermediary registration list. When they are selected to execute the contract content and complete the contract content, they will receive corresponding remuneration;
[0013] The sender estimates the time it takes to execute the service and calculates the deposit that each middleman needs to provide, as well as the remuneration the middleman can receive after the contract is completed. The smart contract selects a suitable middleman from the middleman registration list according to the sender's requirements and assigns a private contract to each middleman. The middleman executes the contract content based on the private contract.
[0014] Furthermore, the margin required to be provided by each intermediary should satisfy Among them, t is the number of ciphertext fragments that are successfully transmitted, and R is the remuneration that the middleman can get after the contract is completed.
[0015] Furthermore, the middleman node performs onion-type data transmission as follows:
[0016] The middleman decrypts the received onion-type data, obtains the next-hop address and the inner onion-type data, and then sends the inner onion-type data to the next middleman. While decrypting and sending the message, the middleman submits the certificate signed by its private key and the hash value of the sent content to the contract respectively; or
[0017] The middleman encrypts the received onion-type data and sends the encrypted onion-type data to the previous hop, submitting the certificate signed by its private key to the contract when receiving and sending the message.
[0018] Furthermore, it specifically includes:
[0019] In T f +|T o | Before, the sender generates ciphertext fragments <C1,C2,...,C n >, and use the middleman public key of each path to encrypt the ciphertext fragments to obtain n onion-type data <O1,O2,…,O n>, submit the ciphertext C and the hash value corresponding to each ciphertext fragment to the contract; where T f Indicates the time when the service starts, T o Indicates the operation time of the middleman;
[0020] In T f At this moment, the sender sends all onion messages to the first-layer middleman of each path, and sends the certificate signed by its private key to the contract to ensure that the sender sends the ciphertext at the correct time, eliminating the message delivery failure caused by the sender;
[0021] In T f1 +|T o | Before, a middleman receives the onion message and executes the private contract corresponding to the middleman: decrypt the first layer of onion type data, obtain the inner layer of onion type data, and send the certificate signed by the private key and the hash value corresponding to the onion type data of this layer to the contract; where T f1 Indicates the time when the first-layer middleman service starts;
[0022] In T f1 At this moment, the first-layer middleman sends the inner layer onion type data to the second-layer middleman and sends the certificate signed by the private key to the contract;
[0023] In T f2 +|T o | Before, the second-layer middleman receives the onion message and executes the private contract corresponding to the middleman: decrypts the second-layer onion type data, obtains the second-layer onion type data, and sends the certificate signed by the private key and the hash value corresponding to the onion type data of this layer to the contract; where T f2 Indicates the time when the second-layer middleman service starts;
[0024] In T f2 At this moment, the second-layer middleman sends the second-layer onion-type data to the third-layer middleman and sends a certificate signed by the private key to the contract;
[0025] In T f3 +|T o | Before, the three-layer middleman executes its private contract: decrypts the onion-type data to obtain the inner onion-type data, i.e., the ciphertext fragment, and submits its hash value to the contract, which checks whether the ciphertext fragment is correct; among them, T f3 Indicates the time when the three-layer middleman service starts;
[0026] In T f3 At this moment, the third-layer middleman sends the ciphertext fragment to the time server and submits the certificate signed by its private key and the hash value corresponding to the ciphertext fragment to the contract. The time server will integrate the fragments and submit the hash value of the ciphertext C to the contract;
[0027] In Tr At this moment, the time server uses its own private key to decrypt and obtain the trapdoor request time T, and generates the corresponding time trapdoor S according to the request time T T and choose one of the paths to return it;
[0028] After receiving the returned time trapdoor information, the middleman executes his private contract: encrypts with his private key and sends the encrypted message to the previous middleman, and sends the certificate signed by the private key to the contract. After receiving the returned data packet, the sender uses the public key of the middleman on the path to decrypt layer by layer to obtain the time trapdoor;
[0029] The contract pays the middleman who completes the contract the remuneration allocated in advance to each middleman's private contract and returns his deposit d p ; If a dishonest middleman executes the operation of confiscating his deposit, the contract will not stop if the message can be successfully delivered.
[0030] Furthermore, the breach of contract determination during the contract process includes:
[0031] Each middleman has an operation time T o , the middleman generates two certificates while decrypting and delivering the message and submits them to the contract. The contract uses the difference between the submission time of the two certificates and T o Compare, if the difference between its decryption time and transmission time is greater than T o , then it is judged as a violation;
[0032] The contract detects whether there is a substitution attack in the path by comparing the ciphertext hash values submitted by the three-layer middlemen with the hash values of the ciphertext fragments submitted by the sender. If the hash value of a certain path is detected to be different from that provided by the sender, it is determined that there is a substitution attack on the path. The contract compares the message hash values provided by the middlemen from back to front in turn to find the illegal middlemen and punish them;
[0033] For dishonest middlemen, the contract will blacklist them so that they cannot receive any subsequent tasks from the contract.
[0034] Furthermore, the onion type data is in the following format:
[0035]
[0036] in, and Indicates the cryptographic transformation of each layer node using its public key for encryption; and IP TS Indicates the lower node address; C i Fragment the ciphertext.
[0037] Compared with the prior art, the present invention has the following beneficial effects:
[0038] In order to improve the reliability and stability of users' query time trapdoors, the present invention proposes a time-controlled encrypted anonymous interaction method based on smart contracts. The sender transmits the trapdoor request to the time server through the middleman node through the smart contract running on Ethereum, and the time server returns the corresponding time trapdoor to the sender. In the case of anonymous query, the probability of successful trapdoor request is improved, making the trapdoor request more stable.
[0039] Security analysis shows that the method of the present invention can resist early release attacks, interruption attacks, eavesdropping attacks and replacement attacks. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A model diagram of a time-controlled encrypted anonymous interaction method based on a smart contract according to an embodiment of the present invention;
[0041] Figure 2 Contract C of the embodiment of the present invention TAIS Schematic diagram of the contents;
[0042] Figure 3 This is an example diagram of a participant behavior tree according to an embodiment of the present invention. DETAILED DESCRIPTION
[0043] The present invention will be further explained below with reference to the accompanying drawings and specific embodiments:
[0044] A time-controlled encrypted anonymous interaction method based on smart contract (TAIS method for short) includes three entities: a sender (i.e., a receiver of timed decrypted data), a middleman, and a time server. The sender, the middleman, and the time server are constrained by the smart contract. The method includes:
[0045] When the decryption time is approaching, the sender uses secret sharing technology to divide the encrypted trapdoor request into n ciphertext fragments, and encrypts them layer by layer to construct onion-type data. The onion-type data is transmitted through the middleman node selected from the smart contract. After receiving the ciphertext fragments, the time server integrates them to obtain the time of the trapdoor request, and returns the corresponding time trapdoor to the sender (i.e. the recipient of the timed decryption data), so that the sender can anonymously query any time trapdoor.
[0046] The details are as follows:
[0047] 1.1 Participants
[0048] The method proposed in the present invention involves three entities: a sender, a middleman, and a time server. Specifically:
[0049] The sender (Bob, the receiver of the timed decryption data in TRE, will be referred to as Bob in the following text for the convenience of description). Bob submits the middleman screening conditions and pays the reward to initiate the contract. Bob encrypts the trapdoor request message T using the public key of the time server TS to obtain the ciphertext C, and divides C into n ciphertext fragments, which are sent simultaneously by n paths.
[0050] Middleman. The peers register as middleman nodes by submitting a deposit to the smart contract, and the smart contract selects them according to Bob's requirements to form a group of middlemen. After Bob initiates the smart contract, they get smart contract tasks and get corresponding rewards after completing the tasks.
[0051] The time server (TS) is the receiver of the TAIS method. After receiving the ciphertext fragments of the trapdoor request, TS combines them to obtain the complete trapdoor request ciphertext C, decrypts it to obtain the time T, and generates the corresponding time trapdoor S T , encrypted using the private key and returned to Bob.
[0052] 1.2 Method model and objectives
[0053] The goal of this method model is to realize anonymous query time trap by users, that is, any authorized user can request time trap from the time server through the smart contract, and the time server cannot obtain the identity information of the user, and the third party cannot obtain the identity information of the user and the transmission content. TAIS To maintain this method.
[0054] First, the node needs to send a request to contract C TAIS Submit the public key and other information to register as a middleman node. This information is provided by C TAIS The registration list maintained is saved. When the specified decryption time is approaching, user Bob sends a TAIS Pay a fee to start C TAIS , and sends a trapdoor request to the time server through the middleman, C TAIS After all contract participants execute the contract content, Bob obtains the time trap door S requested T The specific process is as follows: Bob sends a TAIS Submit the middleman screening conditions to obtain the required middleman information, and change the trapdoor request ciphertext C = E TS_pub (T) is divided into n ciphertext fragments <C1,C2,…,C n >, and divide the middlemen into n groups and construct n onions based on the middlemen information:
[0055]
[0056] in, and Indicates the cryptographic transformation of each layer node using its public key for encryption; and IP TS Indicates the lower node address; C i Fragment the ciphertext.
[0057] Bob sends a request to contract C TAIS After payment, C TAIS The selected middleman is assigned his private contract. Each middleman executes his private contract after receiving the onion message. After receiving the ciphertext fragments, the time server synthesizes them into the original ciphertext, decrypts them to obtain the decryption time T, generates the corresponding time trapdoor and returns it to Bob. This method is maintained by a smart contract. The present invention calls this method of realizing anonymous interaction between users and time servers the TAIS method. The method model is as follows: Figure 1 shown.
[0058] The TAIS method needs to ensure the privacy of the sender's identity. The method process involves four stages: middleman registration, service setting, middleman private contract allocation, and service execution. The following is a brief introduction to each stage.
[0059] Intermediary registration: Any new blockchain network node can register with contract C at any time. TAIS Pay a deposit to register as an intermediary. Submitting a registration application indicates that you can provide services to execute the contract content and submit your public key and work window. After successful registration, Contract C TAIS Maintained in the broker registration list, and then can be selected to execute C TAIS , you can get corresponding remuneration after completion.
[0060] Service settings: User Bob estimates the service execution time [T f ,T e ](where T f Indicates the time when the service starts, T e Indicates the time when the service ends), and calculates the margin required by each middleman, as well as the contract C TAIS The middleman will receive a commission after completion. Contract C TAIS Select the appropriate broker from the registration list based on the working window and margin amount of each broker, and send the broker set to Bob Where IP i represents the IP of the ith middleman in the middleman set, Represents the public key of the i-th middleman in the middleman set.
[0061] Middleman private contract allocation: When Bob assigns a TAIS After submitting the required intermediary conditions, C TAIS Assign a suitable middleman to it and assign a private contract P to each middleman i , the middleman according to P i To execute the contract.
[0062] Service execution: The service execution time expected by the user [T f ,T e ] before the arrival of T f Previously, users needed to split the trapdoor request ciphertext and use the selected middleman’s public key to encrypt each ciphertext fragment layer by layer to generate n onions. Each middleman executes his own corresponding private contract, and after completion, the remuneration is distributed by their respective private contracts, where the remuneration of each contract is determined by contract C. TAIS If the middleman fails to complete the corresponding private contract, his deposit will be confiscated.
[0063] Smart contract C that implements the TAIS method TAIS like Figure 2 As shown, and etc. are private contracts between middlemen.
[0064] Smart Contract C TAIS Can be called by legitimate users. When user Bob calls contract C TAIS A certain amount of remuneration needs to be paid.
[0065] 1.3 Method Assumptions
[0066] In the TAIS method, we make the following provisions for each participant and the method execution process:
[0067] (1) Assume that sender Bob wants his trapdoor request message to be delivered quickly and on time, and is willing to pay a certain amount of money for it. Also assume that the payoff that the sender may get if the message is successfully delivered is R.
[0068] (2) Assume that there are enough nodes registered as middlemen.
[0069] (3) Assume that the counterparty who accepts bribes and acts dishonestly is rational and there is no attack at all costs.
[0070] 1.4 Attack Model
[0071] This section briefly outlines the types of attacks that the TAIS method may be subject to, and in 3.1 it is detailed whether it can resist these attacks.
[0072] (1) Early release attack: An early release attack is when the middleman releases the f The attacker's goal is to complete the message delivery and obtain the time trap before the sender receives the reply from TS.
[0073] (2) Interruption attack: This attack usually occurs when the middleman is bribed and refuses to pass on the information he has received. However, since the middleman pays a deposit when registering, the middleman will only accept the bribe when the amount of the bribe is greater than his deposit.
[0074] (3) Eavesdropping attack: An eavesdropping attack is when the attacker hopes to obtain the content or source of a message through eavesdropping.
[0075] (4) Replacement attack: This attack occurs when an attacker bribes a middleman to disrupt the transmission of a message and tamper with the content of the message in order to achieve the purpose of incorrectly transmitting the message.
[0076] 2 Smart Contract C TAIS Specific content
[0077] The anonymous query time trapdoor TAIS method is implemented by smart contract C TAIS Implementation. Smart Contract C TAIS The specific content includes the following four modules, which are introduced in detail below.
[0078] 2.1 Middleman Registration Module
[0079] The middleman registration module is a module set up for each node that can provide services. Through this module, any node in the blockchain network can apply to become a C TAIS The middleman node of the contract.
[0080] Each node sends a TAIS When applying to register as an intermediary, you need to submit a TAIS Provide the following:
[0081] (1) Node public key OR pub and IP information;
[0082] (2) The amount of liquid funds that the node has that can be used as margin d c , and delivery contract C TAIS Required Margin p .
[0083] (3) Node working window [T x ,T y], which is the time interval during which the service can be provided. Each node can modify its working window or give up providing services for the contract before its deposit is frozen.
[0084] In Contract C TAIS After reviewing the information submitted by the node, the qualified node information is maintained in the registration list to become the middleman node. The middleman node information in the registration list includes the node public key, IP address and working window.
[0085] 2.2 Service Setting Module
[0086] In T f Previously, the sender Bob calculated the fee r required to run the contract and the deposit d required by the middleman p , the number of middlemen required 3n, and the estimated service time [T f ,T e ]. Bob will 3n, [T f ,T e ] and the calculated d p , sent to contract C TAIS The contract selects qualified intermediary information from the registration list based on the screening criteria and returns it to Bob.
[0087] In T f At this moment, Bob will pay the contract a fee of 3nr and the contract will start to execute. TAIS Each middleman will be assigned its private contract.
[0088] Before setting up the service, Bob decomposes the ciphertext C obtained by encrypting the trapdoor request information using the time server public key into n ciphertext fragments <C1,C2,…,C n >.
[0089] After the service is set up, Bob divides the middlemen into 3 groups, and uses the public key information of n groups of middlemen to encrypt n ciphertext slices layer by layer to construct n onions. Taking the first path as an example, the onion form is as follows:
[0090]
[0091] in, and Indicates the cryptographic transformation of each layer node using its public key for encryption; and IP TS Indicates the lower-level node address; C1 is the ciphertext fragment.
[0092] The ciphertext decomposition method of the TAIS method adopts the (t,n) secret sharing method. Its principle is to decompose the ciphertext into n ciphertext fragments. When the number of successfully transmitted ciphertext fragments reaches t, the ciphertext can be restored. This method transmits the trapdoor request information through n paths, and when the number of successful transmissions reaches t, the trapdoor request can be restored by the TS.
[0093] Suppose the value of the ciphertext sent by the sender is v, the profit that can be obtained after successful sending is R, the amount of remuneration paid to each middleman is r, and the bribe paid to each middleman by the attacker when bribing the middleman is b r >0. It is recorded that there are n transmission paths in total, and the total amount of bribes that the attacker needs to pay is b r_sum <R. If the middleman accepts the attacker's bribe, it will inevitably result in the forfeiture of the deposit d p Only when the bribe is greater than the middleman's deposit can the bribery be successful. Therefore, it is only necessary to ensure that d p >b r .
[0094] When the attacker wants to obtain benefits by attacking instead of the sender, the attacker needs to bribe all the middleman nodes on at least n - t + 1 paths. At this time, for the bribes that the attacker needs to pay, there is 3×b r ×(n - t + 1)<R. Therefore, the middleman's deposit only needs to satisfy to ensure that d p >b r , it can be seen that the smaller t is, the less the deposit; but when t is too small, it will cause the attacker to more easily launch an early release attack. At this time, the attacker needs to bribe all the middleman nodes on at least t paths, and the bribes that need to be paid are 3×b r ×t<R. At this time, the middleman's deposit needs to satisfy To sum up, the value of t should satisfy The deposit d p should satisfy
[0095] 2.3 Middleman Private Contract Allocation Module
[0096] The TAIS method will design a private contract for the behavior of each middleman, and the public contract C TAIS is used to ensure the correct execution of each contract. After receiving the message transmitted by the previous hop, the middleman executes its private contract P i , and the contract P i includes two parts of algorithms in total.
[0097] (1) Forward algorithm: decrypt the received onion, obtain the next hop address and the inner onion, and then send the inner onion to the next middleman. While decrypting and sending the message, submit the certificate signed by its private key and the hash value of the sent content to the contract respectively;
[0098] (2) Reverse algorithm: Encrypt the received onion and send the encrypted onion message to the previous hop. Submit the certificate signed by its private key to the contract when receiving and sending the message.
[0099] 2.4 Service Execution Module
[0100] In C TAIS During the contract execution process, the middleman of each path needs to decrypt and obtain the ciphertext fragments and then send them to C TAIS The contract submits the hash value corresponding to the ciphertext shard, and the contract uses it to screen the path where the problem occurred after the service ends.
[0101] ①In T f +|T o | Before, sender Bob generates ciphertext fragments <C1,C2,…,C n >, and use the public key of the middleman of each path to encrypt the ciphertext fragments to obtain n onions <O1,O2,...,O n >. To Contract C TAIS Submit the ciphertext C and the hash value corresponding to each ciphertext fragment. f Indicates the time when the service starts, T o Indicates the middleman's operation time.
[0102] ②In T f At this moment, Bob sends all onion messages to the first-layer middleman of each path and sends a certificate signed by his private key to the contract to ensure that Bob sends the ciphertext at the right time and eliminates the message delivery failure caused by the sender.
[0103] ③In T f1 +|T o | Before, a middleman receives the onion message and executes the private contract corresponding to the middleman: decrypt the first layer of onion and obtain the inner layer of onion <O′1,O′2,…,O n ′>, send the private key signature certificate and the hash value corresponding to this layer of onion to the contract. f1 Indicates the time when the first-tier middleman service starts.
[0104] ④ In T f1 At this moment, the first-layer middleman sends the inner onion to the second-layer middleman and sends a certificate signed by the private key to the contract.
[0105] ⑤T f2 Repeat ③④. Among them, Tf2 Indicates the time when the Layer 2 broker service starts.
[0106] ⑥In T f3 +|T o | Before, the three-layer middleman executes his private contract: decrypt the onion to obtain the inner onion <C1,C2,…,C n >The ciphertext is divided into pieces and sent to contract C TAIS Submit its hash value, contract C TAIS Check whether the ciphertext fragmentation is correct. f3 Indicates the time when the Layer 3 broker service starts.
[0107] ⑦In T f3 At this moment, the third-layer middleman sends the ciphertext shard to TS and submits the certificate signed by its private key and the hash value corresponding to the ciphertext shard to the contract. TS will integrate the shards and submit the hash value of ciphertext C to the contract.
[0108] ⑧In T r At this moment, TS uses its own private key to decrypt and obtain the trapdoor request time T. TS generates the corresponding time trapdoor S according to the request time T T And choose one of the paths to return it.
[0109] ⑨After receiving the returned time trapdoor information, the middleman executes his private contract: encrypts with his private key and sends the encrypted message to the previous middleman, and sends the certificate signed by the private key to the contract. After receiving the returned data packet, Bob uses the public key of the middleman on the path to decrypt layer by layer to obtain the time trapdoor.
[0110] ⑩Contract C TAIS The intermediary who completes the contract will be paid the remuneration allocated in advance to each intermediary's private contract, and his deposit will be returned. p ; For dishonest middlemen, their deposit will be confiscated. If the message can be successfully delivered, the contract will not stop (C TAIS The contract is robust and will not fail due to the failure of an intermediary).
[0111] The specific breach of contract during the contract process is as follows:
[0112] (1) Each middleman / TS has an operation time T o , the middleman will generate two certificates and submit them to the contract while decrypting and transmitting the message. The contract will use the difference between the submission time of the two certificates and T o Compare, if the difference between its decryption time and transmission time is greater than T o , it is judged as a violation.
[0113] (2) The contract detects whether there is a substitution attack in the path by comparing the hash values of the ciphertext submitted by the three-layer middlemen with the hash values of the ciphertext fragments submitted by Bob. If the hash value of a certain path is detected to be different from that provided by Bob, it is determined that there is a substitution attack on the path. The contract will compare the message hash values provided by the middlemen from back to front in order to find the illegal middlemen and punish them.
[0114] For dishonest middlemen, the contract blacklists them so that they cannot receive any subsequent tasks from the contract.
[0115] 3TAIS Method Analysis
[0116] This section first conducts a security analysis on the TAIS method proposed in this paper, then analyzes the impact of the participants' behavior on the method, and finally analyzes the performance of the TAIS method.
[0117] 3.1 Security Analysis
[0118] First, the security model of the TAIS method is given. In the TAIS method, it is assumed that the selected middleman nodes and time servers are "curious but rational": when they execute the contract content as scheduled, they will try to speculate the content of the transmitted message and the source and destination of the message within their own capabilities. However, they will not actively destroy the content of the message or refuse to deliver the message while knowing that the deposit will be confiscated.
[0119] The following will conduct a security analysis on the attack model in 1.4 to prove that the security of this method is sufficient to ensure that Bob can successfully query the time trapdoor while maintaining anonymity. In our security analysis, we assume that all attackers launch attacks with the goal of destroying the TAIS method, that is, destroying the anonymity of the sender or destroying the sender's successful query of the time trapdoor. Assume that there are a total of m nodes registered with the contract as intermediary nodes.
[0120] (1) Early release attack
[0121] Each middleman needs to submit a certificate signed by his private key to the contract when decrypting and delivering the message to prove his behavior. If the middleman delivers the message in advance, he will be deemed to have breached the contract and his deposit will be confiscated by the contract at the final settlement. And if the attacker bribes the middleman to deliver the message in advance, he needs to bribe at least the third-layer middleman in t paths, and the location of the middleman in the path is unknown to the attacker. Therefore, he needs to bribe at least 3t middlemen in at least t paths, and pay each middleman at least a bribe greater than his deposit. The probability of a successful early release attack bribe is
[0122] (2) Interruption attack
[0123] In T n +T o If middleman A fails to pass the message to the next-hop middleman within the specified time, or the next-hop middleman submits an attack report to the contract, it means that the middleman failed to successfully pass the message. Whether it is active or passive, it is considered an interruption attack. The contract will check middleman node A and its previous-hop middleman node: check whether the middleman accepts bribes and refuses to pass the message to the next-hop; check whether the previous-hop of the middleman launches a replacement attack, making it unable to execute its private contract and pass the message.
[0124] If an attacker wants to bribe the middleman to give up the message transmission, thus achieving the purpose of message transmission failure, the attacker needs to successfully bribe at least one middleman in each of the n-t+1 paths. The probability of successful interruption attack is
[0125] (3) Eavesdropping Attack
[0126] For attackers who want to eavesdrop on the message content and launch an eavesdropping attack, since the message in transit has undergone at least one layer of encryption: encrypted using the time server public key, even if they bribe the middleman node to obtain the transmission content, they cannot obtain the plaintext information.
[0127] For an attacker who wants to eavesdrop on the source of a message and launches an eavesdropping attack, since each node only knows its previous and next hop nodes and does not know its own position in the path, it needs to bribe all nodes on the same path. The probability of a successful bribe is
[0128] (4) Replacement attack
[0129] The ciphertext fragments of the transmitted message are submitted to the contract with their hash values before being transmitted through each path; before the path is finally passed to the time server, the last layer of middleman nodes submits its hash value to the contract, and the contract checks whether it is correct or not and then passes it to the time server. If the contract detects that the number of correctly transmitted ciphertext fragments is greater than or equal to t, the contract will continue to execute the contract, and the paths that failed to be transmitted will be judged and processed after the message is successfully transmitted. If the contract detects that the number of correctly transmitted ciphertext fragments is less than t, the contract will be stopped, the paths and middleman nodes with transmission errors will be detected, and their deposits will be confiscated. For honest middleman nodes, the contract will return the deposit and pay their rewards. Therefore, nodes that have not been bribed will rationally and correctly execute their contracts.
[0130] If an attacker wants to disrupt the message delivery through a replacement attack, he needs to successfully bribe at least one middleman in each of the n-t+1 paths. The probability of success of the attack is the same as that of an interruption attack.
[0131] In summary, the closer m and n are, the greater the probability of a successful attack by the attacker, but this is difficult to achieve in real life, so the TAIS method can resist the above attacks.
[0132] 3.2 Participant Behavior Tree
[0133] Furthermore, we designed a contract such as Figure 3 The participant behavior tree shown in Figure 1 details the different results caused by different behaviors of the middleman node, as well as the corresponding benefits of the middleman and the attacker. In this behavior tree, it is assumed that the attacker can successfully bribe the middleman node by ignoring the probability problem described in 3.1. TAIS The behavior of the middleman in each path of the contract is consistent, so only the behavior tree of a single path is shown.
[0134] Assume that Y represents the middleman's honest execution of the contract, and N represents the middleman node accepting bribes from the attacker. 15 Indicates the different results caused by the different choices of each middleman. At this time, according to the deposit calculation formula in 2.2, we can know that there is a deposit Bribe in Take t=2,n=3, we have
[0135] N8 represents that the middleman nodes all honestly execute the contract and receive remuneration; N9~N 14 This means that one or two of the middlemen accepted the bribe. At this time, the income of the middleman node is b r -d p ,Depend on It can be seen that the bribe accepted by the middleman is less than his deposit, and a rational middleman node will not accept the bribe; N 15 It means that all three middleman nodes accept bribes. At this time, if the profit of the middleman node is greater than its deposit, the attacker's profit will be greater than the bribe he paid, so a rational attacker will not launch an attack.
[0136] 3.3 Experiments and performance analysis
[0137] C TAIS The contract program running environment is: Intel(R) Core(TM) i7-8550U CPU@1.80GHz processor, 8G memory, and tested using Solidity language in the Ethereum Rinkeby test network. On June 19, 2022, the exchange rate of Ethereum test coins to US dollars is 1ETH=$949.76, and the exchange rate to Gas is 1ETH=1×10 8 Gas. Therefore, the function execution costs involved in the TAIS method and the conversion to US dollars are shown in Table 1.
[0138] Table 1 Function execution cost
[0139]
[0140] The middleman registers through the newPeer() function, Bob sets up the service through the setup() function, the participant submits the signed certificate through the setCert() function, and submits the hash value of the message through the hash() function. TAIS The contract rewards or punishes the middleman through the award() function.
[0141] In C TAIS In the contract, a trapdoor query requires each middleman to call the setCert() function twice and the hash() function twice. User Bob calls the setup() function once and the hash() function n times. The time server calls the hash() function once. When returning, each middleman consumes the setCert() function once, consuming a total of 6n×setCert()+(3n+n+1+3)×hash()+setup()+award(). In this embodiment, n=3, t=2, and the gas consumption cost is $4.67.
[0142] Since there is no anonymous interactive TRE scheme based on blockchain, the following will be compared with similar methods, as shown in Table 2. Among them, DRSD [Li C, Palanisamy B. Decentralized release of self-emerging data using smart contracts [C]. 2018 IEEE 37th Symposium on ReliableDistributed Systems (SRDS). Salvador, Brazil: IEEE, 2018: 213-220.] and TTSD [Cao Haowen. Research on time-controlled encryption scheme based on blockchain technology [D]. Kaifeng: Henan University, 2020.] both realize timed decryption of data based on blockchain.
[0143] Table 2 Performance comparison
[0144]
[0145] From the perspective of communication anonymity. When users select participating middlemen, they do not interact with the middlemen, but directly select from the list of middlemen maintained by the contract. Since the contract behavior of each layer of middleman nodes is the same, when users distribute trapdoor query ciphertext shards to the first layer of middlemen, the middlemen cannot tell whether the message sent to them is from the user or other middleman nodes. In methods DRSD and TTSD, since users interact directly with all nodes, users cannot hide their identities. Therefore, the TAIS method implements anonymous queries.
[0146] From the perspective of implementation efficiency. The TAIS method pre-processes problems such as node failure that may be encountered during the transmission process. Once the trapdoor query behavior begins, the user does not need to perform additional calculations. And when transmitting the trapdoor query message, it is constructed into a layer-by-layer encrypted onion. The middleman cannot obtain the specific information transmitted. In the DRSD method, there is only one transmission path. Once the node fails, the user needs to reconstruct the onion for transmission, which increases the query time and may result in the inability to obtain the trapdoor information in time. Therefore, the TAIS method is more practical in terms of trapdoor query efficiency.
[0147] From the perspective of flexibility. Different users can set the amount of deposit according to the value of the message they transmit. The computational complexity of the method is linearly related to the number of selected middlemen. In addition, in the TAIS method, the sender (i.e. the receiver of the timed decryption data) can interact with the time server according to the selected time, rather than relying on the block generation time, which is more flexible.
[0148] Since the TAIS method uses a large number of middlemen when performing trapdoor queries, the resulting gas consumption is high and needs further optimization.
[0149] In summary, in order to improve the reliability and stability of users' query time trapdoors, the present invention proposes a time-controlled encrypted anonymous interaction method based on smart contracts. The sender passes the trapdoor request to the time server through the middleman node through the smart contract running on Ethereum, and the time server returns the corresponding time trapdoor to the sender. In the case of anonymous query, the probability of success of the trapdoor request is increased, making the trapdoor request more stable. Security analysis shows that the method of the present invention can resist early release attacks, interruption attacks, eavesdropping attacks and replacement attacks.
[0150] The above is only a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A time-controlled encrypted anonymous interaction method based on smart contracts. It is characterized in that The method includes three entities: sender, middleman, and time server. The sender, middleman, and time server are subject to the constraints of smart contracts. The method includes: When the decryption time is approaching, the sender uses secret sharing technology to divide the encrypted trapdoor request into n ciphertext fragments, and encrypts them layer by layer to construct onion-type data. The onion-type data is transmitted through the middleman node selected from the smart contract. After receiving the ciphertext fragments, the time server integrates them to obtain the time of the trapdoor request and returns the corresponding time trapdoor to the sender, so that the sender can anonymously query any time trapdoor. Specifically include: In T f +|T o | Before, the sender generates the ciphertext fragment <C 1 ,C 2 ,…,C n >, and use the middleman public key of each path to encrypt the ciphertext fragments to obtain n onion-type data <O 1 ,O 2 ,…,O n >, submit the ciphertext C and the hash value corresponding to each ciphertext fragment to the contract; where T f Indicates the time when the service starts, T o Indicates the operation time of the middleman; In T f At this moment, the sender sends all onion messages to the first-layer middleman of each path, and sends the certificate signed by its private key to the contract to ensure that the sender sends the ciphertext at the correct time, eliminating the message delivery failure caused by the sender; In T f1 +|T o | Before, a middleman receives the onion message and executes the private contract corresponding to the middleman: decrypt the first layer of onion type data, obtain the inner layer of onion type data, and send the certificate signed by the private key and the hash value corresponding to the onion type data of this layer to the contract; where T f1 Indicates the time when the first-layer middleman service starts; In T f1 At this moment, the first-layer middleman sends the inner layer onion type data to the second-layer middleman and sends the certificate signed by the private key to the contract; In T f2 +|T o | Before, the second-layer middleman receives the onion message and executes the private contract corresponding to the middleman: decrypt the second-layer onion type data, obtain the second-layer onion type data, and send the certificate signed by the private key and the hash value corresponding to the onion type data of this layer to the contract; where T f2 Indicates the time when the second-layer middleman service starts; In T f2 At this moment, the second-layer middleman sends the second-layer onion-type data to the third-layer middleman and sends a certificate signed by the private key to the contract; In T f3 +|T o | Before, the three-layer middleman executes its private contract: decrypts the onion-type data to obtain the inner onion-type data, i.e., the ciphertext fragment, and submits its hash value to the contract, which checks whether the ciphertext fragment is correct; among them, T f3 Indicates the time when the three-layer middleman service starts; In T f3 At this moment, the third-layer middleman sends the ciphertext fragment to the time server and submits the certificate signed by its private key and the hash value corresponding to the ciphertext fragment to the contract. The time server will integrate the fragments and submit the hash value of the ciphertext C to the contract; In T r At this moment, the time server uses its own private key to decrypt and obtain the trapdoor request time T, and generates the corresponding time trapdoor S according to the request time T T and choose one of the paths to return it; After receiving the returned time trapdoor information, the middleman executes its private contract: it uses its private key to encrypt and send the encrypted message to the previous middleman, and sends the certificate signed by the private key to the contract. After the sender receives the returned data packet, it uses the public key of the middleman on the path to decrypt it layer by layer to obtain the time trapdoor.
2. According to the time-controlled encrypted anonymous interaction method based on smart contracts according to claim 1, It is characterized in that The middleman is generated in the following manner: Each node provides the contract with the node public key, IP information, deposit, and the time period in which the service can be provided to register as an intermediary. All intermediaries are maintained in the intermediary registration list. When they are selected to execute the contract content and complete the contract content, they will receive corresponding remuneration; The sender estimates the time it takes to execute the service and calculates the deposit that each middleman needs to provide, as well as the remuneration the middleman can receive after the contract is completed. The smart contract selects a suitable middleman from the middleman registration list according to the sender's requirements and assigns a private contract to each middleman. The middleman executes the contract content based on the private contract.
3. According to claim 2, the time-controlled encrypted anonymous interaction method based on smart contracts, It is characterized in that The margin required to be provided by each intermediary should meet Among them, t is the number of ciphertext shards that are successfully transmitted, R is the remuneration that the middleman can get after the contract is completed, and n is the number of ciphertext shards.
4. According to claim 1, the time-controlled encrypted anonymous interaction method based on smart contracts, It is characterized in that The middleman node performs onion-type data transmission as follows: The middleman decrypts the received onion-type data, obtains the next-hop address and the inner onion-type data, and then sends the inner onion-type data to the next middleman. While decrypting and sending the message, the middleman submits the certificate signed by its private key and the hash value of the sent content to the contract respectively; or The middleman encrypts the received onion-type data and sends the encrypted onion-type data to the previous hop, submitting the certificate signed by its private key to the contract when receiving and sending the message.
5. According to claim 1, the time-controlled encrypted anonymous interaction method based on smart contracts, It is characterized in that The method further comprises: The contract pays the middleman who completes the contract the remuneration allocated in advance to each middleman's private contract and returns his deposit d p ; If a dishonest middleman executes the operation of confiscating his deposit, the contract will not stop if the message can be successfully delivered.
6. According to claim 5, the time-controlled encrypted anonymous interaction method based on smart contracts, It is characterized in that The breach of contract judgment during the contract process includes: Each middleman has an operation time T o , the middleman generates two certificates while decrypting and delivering the message and submits them to the contract. The contract uses the difference between the submission time of the two certificates and T o Compare, if the difference between its decryption time and transmission time is greater than T o , then it is judged as a violation; The contract detects whether there is a substitution attack in the path by comparing the ciphertext hash values submitted by the three-layer middlemen with the hash values of the ciphertext fragments submitted by the sender. If the hash value of a certain path is detected to be different from that provided by the sender, it is determined that there is a substitution attack on the path. The contract compares the message hash values provided by the middlemen from back to front in turn to find the illegal middlemen and punish them; For dishonest middlemen, the contract blacklists them so that they cannot receive any subsequent tasks from the contract.
7. The time-controlled encrypted anonymous interaction method based on smart contracts according to claim 1, 4 or 6, It is characterized in that The onion type data format is as follows: in, and Indicates the cryptographic transformation of each layer node using its public key for encryption; and IP TS Indicates the lower node address; C i Fragment the ciphertext.
Citation Information
Patent Citations
Tamper-proofing timing data secret transmission method based on block chain smart contract
CN109981690A
Time control encryption system and method supporting decryption at any specified time
CN111556009A
Time-controlled encryption method and system based on multiple time servers
CN114422114A
Blockchain methods, nodes, systems and products
US20210073212A1
Method and system for ensuring search completeness of searchable public key encryption
US20220255739A1
