A blockchain-based covert communication method
Patent Information
- Application Number
- CN202311721928.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-14
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-12-14
AI Technical Summary
[0006]本发明针对已有隐蔽通信方法存在的隐蔽性不强、信道容量低等难题,提出了一种基于区块链的隐蔽通信方法
[0093](1)地址二叉树动态标签。在S12中,通过构建一棵地址二叉树帮助隐蔽通信的发送方快速地设置特殊交易的源地址与目的地址,同时接收方能够快速地根据地址标签从链上交易中筛选出特殊交易,降低了隐蔽通信的时间延迟。在S13与S14中,通过更新地址二叉树,为隐蔽通信的每次特殊交易选取不同的源地址与目的地址,弥补了固定地址标签方法易被检测的不足,提高了隐蔽通信的抗检测性,在秘密情报传输等现实场景中,本方法能够实现情报低延迟快速传递,不受到攻击者的检测与干扰,保障了情报传输的可靠性。
Smart Images

Figure CN117955687B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of blockchain technology and applications, and government information management in a big data environment, specifically to the field of blockchain application supervision in industries such as finance, communications, energy, and logistics. Background Technology
[0002] With the rapid development of information networks, the privacy of personal and commercial information transmitted over the network is receiving increasing public attention. Various cryptographic technologies are being applied to network communication to ensure the confidentiality of transmitted information. However, besides the content of the communication itself, the communication subjects and their relationships also fall under the category of privacy in communication activities and should be protected.
[0003] To address this problem, researchers have proposed covert communication techniques. These techniques enable the secret transmission of information in open environments by hiding it within public media. Covert communication techniques ensure that neither the content nor the relationship of communication can be detected or traced. Traditional covert communication techniques are mostly based on network protocols in the OSI model; for example, secret information is embedded in fields of protocols such as IP, TCP, and HTTP for transmission. However, traditional covert methods based on network protocols suffer from drawbacks such as low channel capacity and susceptibility to detection and intervention.
[0004] In recent years, blockchain technology has been widely applied across various industries. Some researchers have proposed that blockchain's decentralized, flood propagation, and anonymity make it suitable as a carrier for covert communication. First, there is no centralized institution in the blockchain; all transactions are recorded in blocks through a consensus algorithm, thus covert communication cannot be controlled by a central authority, enhancing the channel's resistance to detection. Second, messages in the blockchain network are propagated through flooding, meaning the recipient receives all transaction information, not just special transactions containing secret messages, preventing the exposure of communication relationships. Finally, the anonymity of the blockchain ensures that users' true identities are not revealed, giving the channel strong resistance to tracking.
[0005] Currently, research on blockchain-based covert communication technology is still in its early stages and faces a series of challenges. First, the channel capacity of covert channels is generally low. Since public blockchain addresses and transactions have fixed formats, arbitrarily modifying fixed fields will prevent consensus from being reached on the blockchain. To address these issues, this invention proposes a blockchain-based covert communication method. For example... Figure 1 As shown, this method overcomes the problems of poor concealment, low channel capacity, and weak feasibility of existing methods by embedding dynamic tags and secret information in address binary trees. Summary of the Invention
[0006] This invention addresses the shortcomings of existing covert communication methods, such as weak concealment and low channel capacity, by proposing a blockchain-based covert communication method. This method comprises two parts: dynamic address binary tree labeling and secret information embedding. Dynamic address binary tree labeling provides the source and destination addresses of blockchain transactions for covert communication by constructing and updating an address binary tree. The sender of the covert communication uses the address binary tree to generate addresses for each special transaction to evade detection, while the receiver uses the address binary tree to quickly identify newly generated special transactions and extract their secret information. Secret information embedding involves encrypting and obfuscating the secret information to be transmitted in the covert communication, then encoding and embedding it into the transaction amount field of the blockchain transaction before submitting the transaction to the blockchain, thus achieving covert communication. In summary, this method consists of two main steps: dynamic address binary tree labeling and secret information embedding.
[0007] S1: Dynamic Binary Address Labels. To enhance communication concealment, this method uses dynamic binary address labels to generate source and destination addresses for each special transaction. The specific process can be divided into the following four steps: concealed communication channel initialization, binary address tree construction, dynamic transaction label generation, and dynamic transaction label identification.
[0008] S11: Covert Communication Channel Initialization. Before constructing an address binary tree for covert communication, both communicating parties need to complete the channel initialization. This step requires both parties to reach a consensus on the off-chain secure channel, including the address set for covert communication, a shared random seed, etc. The specific process consists of the following 5 steps:
[0009] (1) Generate a covert communication address set. In covert communication, the sending direction blockchain requests n normal transaction addresses to form a covert communication address set A = {a1, a2, ... a...}. n}, where subscripts 1, 2, ..., n indicate the order in which the address is requested. Furthermore, the sender requests any address a in A. i Record its corresponding private key p i .
[0010] (2) Share the covert communication address set. The sender of the covert communication shares the blockchain address set A generated in step (1) with the receiver through an off-chain secure channel, but does not share the private keys of these addresses.
[0011] (3) Shared random seed. The sender of the covert communication uses a random algorithm to generate a random seed and shares the random seed with the receiver through an off-chain secure channel, where seed is any positive integer that satisfies seed≥n.
[0012] (4) Joining the blockchain network. The sender and receiver of covert communication each apply for a legitimate transaction address from the blockchain, thereby enabling them to query all transaction information on the blockchain.
[0013] (5) Conducting normal transactions. The two parties in the covert communication use all addresses in address set A to conduct multiple normal transactions, ensuring that any address a in A is guaranteed to be safe. i Each participant received a certain amount of on-chain virtual currency, providing a foundation for subsequent covert communication.
[0014] S12: Address Binary Tree Construction. To ensure concealment, the address of each special transaction, which serves as the carrier of covert communication, needs to be dynamically changed. This step constructs an address binary tree based on the initialization work in step S11 to meet the requirement of dynamic adjustment of transaction addresses. The specific process is shown in Algorithm 1, and consists of the following two steps:
[0015] (1) Randomly generate an address list. The two parties in covert communication use a random seed and agree on a random algorithm to generate a random address list L = { <k,a i Let |k = 1, 2, ..., n}, where k is a randomly generated new address number, and the subscript i represents the corresponding address a. i The initial sequence number when applying for address set A.
[0016] (2) Constructing an address binary tree. Following the sequence number k, addresses are selected sequentially from the address list L to construct an address binary tree. The specific process consists of the following three steps:
[0017] a) Construct the root node. Select the first address in the address list L as the root node of the binary tree. The initial index i of this address when it was allocated in the address set A is used as the value of the root node.
[0018] b) Generate a new node. Determine if all addresses in address list L have been retrieved and inserted into the address binary tree. If yes, end the construction of the address binary tree; otherwise, sequentially retrieve an address from address list L to construct a new node, where the initial index i of that address when it was allocated in address set A is used as the value of the new node.
[0019] c) Insert a new node. Insert the new node constructed in step b) into the address binary tree. First, compare the value of the new node with the value of the root node. If the value is less than the value of the root node, select the left child of the root node to continue the comparison; otherwise, select the right child of the root node to continue the comparison. Repeat the above comparison process until a corresponding node cannot be found from the current comparison position. Finally, insert the new node into the current comparison position.
[0020]
[0021] S13: Dynamic Transaction Tag Generation. To improve the ability to resist detection, this method dynamically generates source and destination addresses as tags for each transaction. The specific process consists of the following four steps:
[0022] (1) First transaction determination. Determine whether the current transaction is the first transaction after step S12. If yes, proceed directly to step (3); otherwise, continue to step (2).
[0023] (2) Reconstruct the address binary tree. Extract the source and destination addresses from the most recent special transaction for covert communication, swap their positions in the address list L, and reconstruct the address binary tree. The specific process is similar to step (2) in S12, inserting the addresses in L as nodes into the binary tree in sequence.
[0024] (3) Select the source address for the transaction. In the newly constructed address binary tree, select the address corresponding to the root node as the source address for this transaction.
[0025] (4) Select the destination address for the transaction. The destination address for this transaction is selected from the newly constructed address binary tree. The specific process consists of the following three steps:
[0026] a) Generation of the first transaction index value. Determine if the current transaction is the first transaction completed after step S12. If yes, the sender of the covert communication uses the number n of the address list L to take the modulo of the random seed and add 1 to obtain the index value j; otherwise, proceed directly to step b).
[0027] b) Generation of subsequent transaction index values. The sender of the covert communication first calculates the sum of the initial sequence numbers i of the source and destination addresses in the previous special transaction. Then, it takes the sum modulo n (the number of addresses in the address list L) and adds 1 to obtain the index value j.
[0028] c) Query the destination address of the transaction. In the newly constructed address binary tree, the sender uses a level-order traversal to find the node whose value equals the index value j. Then, the address corresponding to that node is used as the destination address for this transaction.
[0029] S14: Dynamic Transaction Tag Identification. The recipient of covert communication needs to maintain the same address binary tree as the sender using shared information to identify dynamic transaction tags and locate each unique transaction on the blockchain. The specific process consists of the following 5 steps:
[0030] (1) First transaction determination. Determine whether the current transaction is the first transaction after step S12. If yes, proceed directly to step (3); otherwise, continue to step (2).
[0031] (2) Reconstruct the address binary tree. Extract the source and destination addresses from the most recent special transaction for covert communication, swap their positions in the address list L, and reconstruct the address binary tree. The specific process is similar to step (2) in S12, inserting the addresses in L as nodes into the binary tree in sequence.
[0032] (3) Select the source address for the transaction. In the newly constructed address binary tree, select the address corresponding to the root node as the source address for this transaction.
[0033] (4) Select the destination address for the transaction. Select the destination address for this transaction from the newly constructed address binary tree. The specific process consists of the following 3 steps.
[0034] a) Generation of the first transaction index value. Determine if the current transaction is the first transaction completed after step S12. If yes, the sender of the covert communication uses the number n of the address list L, modulo the random seed, and adds 1 to obtain the index value j; otherwise, proceed directly to step b).
[0035] b) Generation of subsequent transaction index values. The receiver of the covert communication first calculates the sum of the initial sequence numbers i of the source and destination addresses in the previous special transaction. Then, it takes the sum modulo n (the number of addresses in the address list L) and adds 1 to obtain the index value j.
[0036] c) Query the destination address of the transaction. The receiver of the covert communication uses a level-order traversal method in the newly constructed address binary tree to find the node whose value equals the index value j. Then, the address corresponding to that node is used as the destination address for this transaction.
[0037] (5) Query transaction information. Starting from the last special transaction on the blockchain, find the transactions where the addresses of both parties match the source address and destination address tags in steps (3) and (4). Then, extract the transaction amount information from the transaction and save it.
[0038] S2: Secret Message Embedding. To improve the confidentiality of communication, this method embeds the secret message to be transmitted into the transaction amount field of the blockchain transaction. The specific process consists of the following 5 steps: determining the transaction amount format, determining the data encoding rules, secret message preprocessing, secret message encoding and sending, and secret message decoding and receiving.
[0039] S21: Determine the transaction amount format. Since different blockchains have different transaction amount formats, it is necessary to analyze the amounts of existing normal transactions on the chain to determine the format of special transactions. The specific process consists of the following three steps:
[0040] (1) Obtain normal transaction amount data. Query the public information of all transactions on the blockchain to obtain the transaction amount data for each transaction.
[0041] (2) Determine the length of the special transaction amount. Count the number of decimal places of all transaction amounts obtained in step (1), find the number of decimal places that appears most frequently, and use it as the fixed number of decimal places l of the transaction amount of the special transaction, that is, the length after the secret message is embedded.
[0042] (3) Set special transaction amount protection bits. To ensure that the amount of special transactions does not exceed the amount in the wallet of the transaction source address, set the first two digits of the fixed number of decimal places l as transaction amount protection bits.
[0043] S22: Determine the data encoding rules. Before encoding the binary data of the secret message and embedding it into the amount field of the special transaction, the encoding rules must first be determined. The encoding rules of this method include the following four points.
[0044] (1) Use a single digit to represent the position of a "0" bit that appears alone in the secret message. For example, if the third bit in the secret message is a "0" bit, then the transaction amount is represented by the number "3".
[0045] (2) Use two consecutive digits to represent the position and number of consecutive "0" bits in the secret message. Note that the second digit must be less than or equal to the first digit. For example, if the 2nd to 5th bits in the secret message are "0000", they will be encoded as "2242".
[0046] (3) When the encoding of a secret message exceeds a multiple of ten, a zero should be added to the transaction amount to avoid ambiguity when decoding the secret message. For example, when the secret message is encoded to the 11th or 21st digit, a zero should be added to the transaction amount.
[0047] (4) After all the coded numbers are embedded in the fixed embedding length l of the transaction amount, check the value of the entire transaction amount. If there is a "0" at the end of the transaction amount, delete all the "0"s at the end.
[0048] S23: Secret Message Preprocessing. Preprocessing is required before encoding the secret message for transmission. The specific process consists of the following three steps:
[0049] (1) Binary encoding of secret messages. The sender of covert communication encodes the secret message text to be transmitted into a binary message.
[0050] (2) Encryption of secret messages. The sender of covert communication uses a hash algorithm to calculate the hash value hash(seed) of a shared random seed, and uses hash(seed) as a key to encrypt the binary message using a symmetric cryptographic algorithm.
[0051] (3) Add an end marker. The sender of covert communication adds eight consecutive "0"s to the end of the encrypted message, i.e., "00000000", as the end marker of the secret message.
[0052] S24: Encoded and sent secret message. The preprocessed secret message is encoded, then embedded into the transaction amount field of the special transaction, and the special transaction is published on-chain. The specific process consists of the following four steps:
[0053] (1) Confirm that the secret message has been processed. Before each data encoding, the sender of covert communication needs to check whether the secret message has been processed. The specific process consists of the following three steps:
[0054] a) Set the marker pointer q to point to the first bit of the data to be encoded in the binary secret message data generated in step S23.
[0055] b) Check the number of unencoded data bits x remaining during the most recent data encoding process, and move the marker pointer q forward by x bits.
[0056] c) If the marker pointer q points to the end of the binary secret message data, then the corresponding secret message has been fully encoded, and step S24 ends; otherwise, continue to execute step (2).
[0057] (2) Data Segmentation and Obfuscation. Because the secret message data is quite long and cannot be encoded and embedded into a single transaction, it needs to be segmented. Furthermore, to enhance resistance to detection, the segmented secret message data needs to be obfuscated. The specific process consists of the following two steps:
[0058] a) Data Blocking. In the binary secret message data, starting from the data bit pointed to by the marker pointer q, read m bits of data (including the data bit pointed to by q). m must be greater than the maximum number of bits that can be embedded in a single transaction.
[0059] b) Data obfuscation. Perform a bitwise XOR operation between the m-bit secret message data and the first m bits of the source address of this transaction to generate obfuscated m-bit data.
[0060] (3) Constructing the transaction amount. In order to embed the secret message into the transaction amount of a special transaction, the secret message data needs to be encoded and the transaction amount value needs to be constructed according to the rules set in step S22. The specific process is shown in Algorithm 2, which consists of the following 12 steps:
[0061] a) The sender of the covert communication randomly generates a 2-digit number and fills it into the transaction amount protection field. Check if the current transaction amount is less than the balance in the source address wallet. If yes, continue to the next step; otherwise, repeat this step.
[0062] b) Set the initial value of the position variable to 0, the initial value of the consecutive position variable label to 0, and the initial value of the tens digit variable tag to 10.
[0063] c) Determine if all l digits of the transaction amount have been encoded. If yes, proceed to step l); otherwise, execute the subsequent steps sequentially.
[0064] d) Determine if the position-th bit in the secret message is "0". If yes, proceed to step e); otherwise, jump to step i).
[0065] e) Determine if the value of label is 0. If yes, proceed to step f); otherwise, jump to step h).
[0066] f) Determine if the current bit of the encoded secret message has reached a multiple of ten for the first time, i.e., determine if the result of position divided by tag is equal to 1. If yes, embed the number "0" at the end of the current transaction amount, add 10 to tag, and proceed to step g); otherwise, proceed directly to step g).
[0067] g) Increment the value of label by 1, embed the result of position modulo 10 at the end of the transaction amount, and jump to step k).
[0068] h) Increment the value of label by 1, and then check if the value of label is equal to the last digit of the transaction amount. If yes, embed the value of label at the end of the transaction amount, reset the value of label to 0, and then jump to step k); otherwise, jump directly to step k).
[0069] i) Determine if the value of label is greater than 1. If yes, embed the value of label at the end of the transaction amount; otherwise, proceed directly to step k).
[0070] j) Reset the value of label to 0.
[0071] k) Move the current encoded position of the secret message one position to the right, that is, increment the value of position by 1, and then jump to step c).
[0072] l) Submit the completed transaction amount and record the remaining uncoded data bits x in a secret message of length m.
[0073]
[0074]
[0075] (4) On-chain transaction publication. After constructing the transaction amount, the sender of the covert communication needs to embed it into a special transaction and publish it on the blockchain. The specific process consists of the following three steps:
[0076] a) Embedded Transaction. The sender of the covert communication constructs a special transaction using the source and destination addresses selected from the address binary tree. Then, the transaction amount constructed in step (3) is embedded into the transaction amount field of the transaction.
[0077] b) Data upload to the blockchain. The sender of the covert communication uses the private key of the source address to submit the current transaction to the blockchain. After consensus on the blockchain, the transaction is packaged into a block.
[0078] c) After the current transaction is successfully published, return to step (1).
[0079] S25: Secret Message Decoding and Reception. The recipient of the covert communication queries the blockchain for special transactions and decodes them into secret messages by extracting the transaction amount. The specific process consists of the following 5 steps:
[0080] (1) Extracting the transaction amount field. The receiver of the covert communication first extracts the transaction amount from the special transaction, with a length of 1 after decimal places. Then, the first 2 digits, i.e. the transaction amount protection bits, are removed to obtain the data of the embedded secret message.
[0081] (2) Decode the transaction amount data. The receiver of the covert communication decodes the data extracted in step (1). The specific process is divided into the following 7 steps.
[0082] a) Set the initial value of the position variable to 0, and the initial value of the tens digit variable tag to 0.
[0083] b) Determine if all transaction amount data has been decoded. If yes, proceed to step g); otherwise, execute step c).
[0084] c) Determine if the number at the position pointed to in the transaction amount data is "0". If yes, increment the tag by 10 and jump to step f); otherwise, execute step d).
[0085] d) Determine if the number num1 at the position of the transaction amount data is less than the next number num2. If so, fill in "0" at the num1+tag position of the decoded binary data and jump to step f); otherwise, proceed sequentially to step e).
[0086] e) Starting from the num1+tag bit of the decoded binary data, fill in num2 consecutive "0"s, then increment the position value by 1, and proceed to step f).
[0087] f) Increment the value of position by 1, and jump to step b).
[0088] g) Iterate through the decoded binary data, fill in the positions where no "0" is filled with the number "1", and then output the processed binary data.
[0089] (3) Data de-obfuscation. The receiver of the covert communication performs an XOR operation on the decoded binary data and the data of the same number of bits in the transaction source address to remove the obfuscation of the secret message data.
[0090] (4) Data decryption. The receiver of the covert communication uses a hash function to calculate the hash value hash(seed) of the shared random seed, and uses hash(seed) as the key to decrypt the deobfuscated data using a symmetric cryptographic algorithm.
[0091] (5) Secret Message Recovery. Check if there are 8 consecutive "0"s at the end of the data, which is the end marker of the secret message. If so, remove the end marker and merge the current data with the data in the cache to form the binary data of the secret message, and then restore it to text form; otherwise, put the decoded data into the cache, waiting for the next special transaction. Compared with the prior art, the advantages of the present invention are as follows:
[0092] This invention proposes a blockchain-based covert communication method, comprising two parts: dynamic tagging of address binary trees and embedding of secret information. Compared with existing methods, this method has the following advantages:
[0093] (1) Dynamic Address Binary Tree Labeling. In S12, an address binary tree is constructed to help the sender of covert communication quickly set the source and destination addresses of special transactions. At the same time, the receiver can quickly filter out special transactions from on-chain transactions based on the address labels, reducing the time delay of covert communication. In S13 and S14, by updating the address binary tree, different source and destination addresses are selected for each special transaction in covert communication. This compensates for the vulnerability of the fixed address label method to detection and improves the anti-detection capability of covert communication. In real-world scenarios such as secret intelligence transmission, this method can achieve low-latency and rapid intelligence transmission without being detected or interfered with by attackers, ensuring the reliability of intelligence transmission.
[0094] (2) Embedding of Secret Information. In S23 and S24, the secret message is encrypted and obfuscated, improving its resistance to detection. In S21 and S24, by analyzing the transaction amount distribution of normal blockchain transactions, the secret message is encoded into transaction amounts with the same distribution and embedded into special transactions, improving the concealment of communication. In addition, the use of a variable-length encoding method increases the information embedding rate of the secret message and improves the channel capacity of covert communication. In practical applications, this method can effectively solve the problem of low efficiency when transmitting large amounts of information such as confidential documents through covert channels, realizing covert communication of large amounts of data. Attached Figure Description
[0095] Figure 1 Overall architecture diagram of covert communication based on blockchain.
[0096] Figure 2 Ethereum block transaction data structure diagram,
[0097] Figure 3 Diagram illustrating the construction and update of a binary address tree.
[0098] Figure 4 Secret message encoding example,
[0099] Figure 5 The flowchart of address binary tree construction in the embodiment is as follows:
[0100] Figure 6 Flowchart of secret message encoding in the embodiment. Detailed Implementation
[0101] The technical solutions in the embodiments will be described in detail below with reference to the accompanying drawings. Obviously, the embodiments described below are merely one embodiment of the method of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the following embodiments without creative effort are within the scope of protection of the present invention.
[0102] Figure 1 This paper presents a blockchain-based covert communication architecture. This embodiment uses Ethereum as the blockchain platform and builds a covert communication architecture based on this platform. The implementation process of this invention mainly consists of two steps: dynamic tagging of address binary trees and embedding of secret information.
[0103] Before introducing the embodiments of the present invention, the overall architecture of the covert communication in the embodiments is first described. In this embodiment, there is a covert communication sender and a covert communication receiver, both of whom have joined the Ethereum mainnet and can conduct normal transactions. Neither party knows the other's identity or address information in the blockchain; they can only communicate through a covert channel. The data structure of blocks and transactions in Ethereum is as follows: Figure 2 As shown.
[0104] S1: Dynamic Binary Address Labels. To enhance communication concealment, this method uses dynamic binary address labels to generate source and destination addresses for each special transaction. The specific process can be divided into the following four steps: concealed communication channel initialization, binary address tree construction, dynamic transaction label generation, and dynamic transaction label identification.
[0105] S11: Covert Communication Channel Initialization. Before constructing an address binary tree for covert communication, both communicating parties need to complete the channel initialization. This step requires both parties to reach a consensus on the off-chain secure channel, including the address set for covert communication, a shared random seed, etc. The specific process consists of the following 5 steps:
[0106] (1) Generate a covert communication address set. In covert communication, the sender uses the AccountCreate() API function in Ethereum to request n normal transaction addresses from the blockchain to form a covert communication address set A = {a1, a2, ... a...} n}, where subscripts 1, 2, ..., n indicate the order in which the address is requested. Furthermore, the sender requests any address a in A. i Record its corresponding private key p i .
[0107] (2) Share the covert communication address set. The sender of the covert communication shares the blockchain address set A generated in step (1) with the receiver through a secure off-chain channel, but does not share the private keys of these addresses.
[0108] (3) Shared random seed. The sender of the covert communication uses the pseudo-random number generator Random() function to generate a random seed, and shares the random seed with the receiver through an off-chain secure channel, where seed is any positive integer that satisfies seed≥n.
[0109] (4) Joining the blockchain network. The sender and receiver of the covert communication each call the AccountCreate() function to apply for a normal transaction address from the Ethereum public chain network, thereby being able to query all transaction information on the blockchain.
[0110] (5) Conduct normal transactions. Both parties of the covert communication conduct multiple normal transactions using all addresses in the address set A to ensure that any address a in A i obtains a certain amount of on-chain virtual currency, providing a basis for subsequent covert communication.
[0111] S12: Address binary tree construction. To ensure covertness, the address of each special transaction used as the carrier of covert communication needs to be dynamically changed. This step constructs an address binary tree based on the initialization work in step S11 to meet the requirement of dynamic adjustment of transaction addresses. Figure 3 shows the process of constructing and updating the address binary tree, which is divided into the following 2 steps:
[0112] (1) Randomly generate an address list. Both parties of the covert communication use the random seed seed and generate a random address list L = {<k,a i >|k=1,2,…,n} by calling the random function Shuffle(A,seed), where k is the newly randomly generated address sequence number, and the subscript i represents the corresponding address a i 's initial sequence number when the address set A is applied for.
[0113] (2) Construct the address binary tree. Select addresses from the address list L in sequence according to the sequence number k to construct an address binary tree T. The specific process is as Figure 5 shown, and is divided into the following 3 steps:
[0114] a) Construct the root node. Select the first address in the address list L as the root node T.root of the binary tree, and assign the initial sequence number i of this address when the address set A is applied for as the value T.root.value of the root node.
[0115] b) Generate a new node. Determine whether all addresses in the address list L have been taken out and inserted into the address binary tree T. If yes, end the construction of the address binary tree; otherwise, take out an address from the address list L in order to construct a new node, wherein the initial sequence number i of this address when the address set A is applied for is used as the value of the new node.
[0116] c) Insert the new node. Insert the new node constructed in step b) into the address binary tree. First compare the value of the new node with the value of the root node. If the value is smaller than the value of the root node, that is, value<T.root.value, select the left child node position of the root node to continue the comparison; otherwise, select the right child node position of the root node to continue the comparison. Repeat the above comparison process until no corresponding node can be found from the current comparison position. Finally, insert the new node into the current comparison position.
[0117] S13: Dynamic Transaction Tag Generation. This method uses blockchain transactions as a carrier to achieve covert communication. To improve its ability to resist detection, this method dynamically generates a source address (Addr) for each transaction. _ from and destination address Addr _ The "to" tag is used as the primary label. The specific process involves the following four steps:
[0118] (1) First transaction determination. Set a flag variable count to record the transaction sequence number. If count is 0, it is determined that the current transaction is the first transaction after step S12 is completed, and directly jump to step (3) to execute; otherwise, continue to execute step (2). And increment the count value by 1.
[0119] (2) Reconstruct the address binary tree. Extract the source address Addr from the most recent special transaction for covert communication. _ from and destination address Addr _ The addresses in L are swapped and their positions in the address list L are reconstructed. The specific process is similar to step (2) in S12, where addresses in L are inserted into the binary tree as nodes in sequence.
[0120] (3) Select the transaction source address. In the newly constructed address binary tree, select the address corresponding to the root node T.root as the source address Addr for this transaction. _ from.
[0121] (4) Select the destination address for the transaction. Select the destination address (Addr) for this transaction from the newly constructed address binary tree. _ The specific process consists of the following two steps.
[0122] a) Generation of the first transaction index value. Determine whether the current transaction is the first transaction after step S12. If so, the sender of the covert communication uses the random seed and the number of addresses in the address list L modulo n to obtain the index value j, i.e., j = seed mod n; otherwise, proceed directly to step b).
[0123] b) Generation of subsequent transaction index values. The sender of the covert communication first calculates the sum of the initial sequence numbers i of the source and destination addresses in the previous special transaction. Then, it takes the sum modulo n by the number of addresses in the address list L and adds 1 to obtain the index value j, i.e., j = sum mod n.
[0124] c) Query the destination address of the transaction. In the newly constructed address binary tree, the sender of the covert communication uses a level-order traversal to call the `Traversal(T,j)` function to find the node whose value equals the index value `j`. Then, the address corresponding to that node is used as the destination address `Addrto` for this transaction.
[0125] S14: Dynamic Transaction Tag Identification. The recipient of covert communication needs to maintain the same address binary tree as the sender using shared information to identify dynamic transaction tags and locate each unique transaction on the blockchain. The specific process consists of the following 5 steps:
[0126] (1) First transaction determination. Set a flag bit count to record the transaction sequence number. If count is 0, it is determined that the current transaction is the first transaction after step S12 is completed, and directly jump to step (3) to execute; otherwise, continue to execute step (2). And increment the count value by 1.
[0127] (2) Reconstruct the address binary tree. Extract the source address Addr from the most recent special transaction for covert communication. _ from and destination address Addr _ The addresses in L are swapped and their positions in the address list L are reconstructed. The specific process is similar to step (2) in S12, where addresses in L are inserted into the binary tree as nodes in sequence.
[0128] (3) Select the transaction source address. In the newly constructed address binary tree, select the address corresponding to the root node T.root as the source address Addr for this transaction. _ from.
[0129] (4) Select the destination address for the transaction. Select the destination address (Addr) for this transaction from the newly constructed address binary tree. _ The specific process consists of the following three steps.
[0130] a) Generation of the first transaction index value. Determine whether the current transaction is the first transaction after step S12. If yes, the receiver of the covert communication uses the random seed and the number n of the address list L modulo 1 to obtain the index value j, i.e., j = seed mod n; otherwise, proceed directly to step b).
[0131] b) Generation of subsequent transaction index values. The receiver of the covert communication first calculates the sum of the initial sequence numbers i of the source address and destination address in the previous special transaction. Then, it takes the sum modulo n by the number of addresses in the address list L and adds 1 to obtain the index value j, i.e., j = sum mod n.
[0132] c) Query the destination address of the transaction. The receiver of the covert communication uses a level-order traversal method in the newly constructed address binary tree, calling the `Traversal(T,j)` function to find the node whose value equals the index value `j`. Then, the address corresponding to that node is used as the destination address `Addr` for this transaction. _ to.
[0133] (5) Query transaction information. Starting from the last special transaction on the blockchain, call the Scan() function to find the source address Addr that matches the addresses of both parties in the transaction, as described in steps (3) and (4). _ from and destination address Addr _ The transaction is tagged with "to". Then, the transaction amount information is extracted from the transaction and saved.
[0134] S2: Secret Message Embedding. To improve the confidentiality of communication, this invention embeds the secret information to be transmitted in covert communication into the transaction amount field of the blockchain transaction. The specific process consists of the following 5 steps: determining the transaction amount format, determining the data encoding rules, secret message preprocessing, secret message encoding and sending, and secret message decoding and receiving. Figure 4 An example of secret message encoding is shown.
[0135] S21: Determine the transaction amount format. This requires analyzing the amounts of normal transactions on Ethereum to determine the format of special transactions. The specific process involves the following three steps:
[0136] (1) Obtain normal transaction amount data. Use the EthereumScan tool to find and record block information in the Ethereum public chain, and call the Eth.GetTransaction() function to parse the block to obtain the transaction amount value of each transaction.
[0137] (2) Determine the length of special transaction amounts. Count the number of decimal places of all transaction amount values obtained in (1), and select the mode of the number of digits as the fixed embedding length l of the transaction amount. In Ethereum, the embedding length is set to 18 digits.
[0138] (3) Set special transaction amount protection bits. In order to ensure that the transaction amount after encoding is less than the amount in the wallet of the transaction source address, the first 2 bits of the 18-bit transaction amount length are used as transaction amount protection bits.
[0139] S22: Determine the data encoding rules. During the transmission of the secret message, the binary data of the secret message needs to be encoded and embedded into the amount field of the special transaction; therefore, the encoding rules need to be determined. The encoding rules of this method include the following four points.
[0140] (1) Use a single digit to represent the position of a single "0" bit in the secret message. For example, if the third bit in the secret message is a "0" bit, then the transaction amount is represented by the number "3".
[0141] (2) Use two consecutive digits to represent the position and number of consecutive "0" bits in the secret message. However, it should be noted that the second digit must be less than or equal to the first digit. For example, if the second to fifth bits in the secret message are "0000", they will be encoded as "2242".
[0142] (3) When the encoding of a secret message exceeds a multiple of ten, a zero should be added to the transaction amount to avoid ambiguity when decoding the secret message. For example, when the secret message is encoded to the 11th or 21st digit, a zero should be added to the transaction amount.
[0143] (4) After all the coded numbers are embedded in the fixed embedding length l of the transaction amount, check the value of the entire transaction amount. If there is a "0" at the end of the transaction amount, delete all the "0"s at the end.
[0144] S23: Secret Message Preprocessing. Preprocessing is required before encoding the secret message for transmission. The specific process consists of the following three steps:
[0145] (1) Binary encoding of secret messages. The sender of covert communication encodes the secret message text to be transmitted into a binary message using the Getbytes() function.
[0146] (2) Encryption of secret messages. The sender of the covert communication calls the hashlib.sha256() function in the hashlib library to calculate the hash value hash(seed) of the shared random seed, and uses hash(seed) as the key to encrypt the binary message using the Encrypt() function of the AES object in Crypto.Cipher.
[0147] (3) Add an end marker. The sender of covert communication adds eight consecutive "00000000" characters to the end of the encrypted secret message as an end marker.
[0148] S24: Encoded and transmitted secret message. The preprocessed secret message is encoded and embedded into the transaction amount field, and the blockchain transaction is constructed and transmitted on-chain. The specific process consists of the following four steps:
[0149] (1) Confirm that the secret message has been processed. Before each data encoding, the sender of covert communication needs to check whether the secret message has been processed. The specific process consists of the following three steps:
[0150] a) Set the marker pointer q to point to the first bit of the data to be encoded in the hidden message.
[0151] b) Check the number of unencoded data bits x remaining during the previous data encoding process, and move the marker pointer forward by x bits.
[0152] c) If the marker pointer points to null, that is, all secret messages have been encoded, the process ends directly; otherwise, continue with step (2).
[0153] (2) Data Segmentation and Obfuscation. Since the secret message is quite long, it cannot be encoded and embedded into a single transaction simultaneously; therefore, it needs to be segmented. Simultaneously, to enhance the data encoding's resistance to detection, the segmented secret message needs to be obfuscated. The specific process consists of the following two steps:
[0154] a) Data segmentation. Select the 40 bits following the data bit pointed to by the marker pointer q in the secret message (including the data bit pointed to by q).
[0155] b) Data obfuscation. The 40-bit secret message is obfuscated with the source address of this transaction, Addr. _ Perform a bitwise XOR operation on the first 40 bits of the fetch.
[0156] (3) Constructing the transaction amount. To embed the secret message into the transaction amount of a special transaction, the secret message data needs to be encoded and the transaction amount constructed according to the rules defined in step S22. The specific process is as follows: Figure 6 As shown, it consists of the following 12 steps:
[0157] a) The sender of the covert communication uses the Rondom() function to randomly generate a 2-digit number and fills it into the transaction amount protection field. Check if the current transaction amount is less than the balance in the source address wallet. If yes, continue to the next step; otherwise, repeat this step.
[0158] b) Set the initial value of the position variable to 0, the initial value of the consecutive position variable label to 0, and the initial value of the tens digit variable tag to 10.
[0159] c) Determine if all l digits of the transaction amount have been encoded. If yes, proceed to step l); otherwise, execute the subsequent steps sequentially.
[0160] d) Determine if the position-th bit in the secret message is "0". If yes, proceed to step e); otherwise, jump to step i).
[0161] e) Determine if the value of label is 0. If yes, proceed to step f); otherwise, jump to step h).
[0162] f) Determine if the current bit of the encoded secret message has reached a multiple of ten for the first time, i.e., determine if the result of position divided by tag is equal to 1. If yes, embed the number "0" at the end of the current transaction amount, add 10 to tag, and proceed to step g); otherwise, proceed directly to step g).
[0163] g) Increment the value of label by 1, embed the result of position modulo 10 at the end of the transaction amount, and jump to step k).
[0164] h) Increment the value of label by 1, and then check if the value of label is equal to the last digit of the transaction amount. If yes, embed the value of label at the end of the transaction amount, reset the value of label to 0, and then jump to step k); otherwise, jump directly to step k).
[0165] i) Determine if the value of label is greater than 1. If yes, embed the value of label at the end of the transaction amount; otherwise, proceed directly to step k).
[0166] j) Reset the value of label to 0.
[0167] k) Move the current encoded position of the secret message one position to the right, that is, increment the value of position by 1, and then jump to step c).
[0168] l) Submit the completed transaction amount and record the remaining uncoded data bits x in a secret message of length m.
[0169] (4) On-chain transaction publication. After constructing the transaction amount, the sender of the covert communication needs to publish the complete transaction on the blockchain. The specific process consists of the following three steps:
[0170] a) Embedded Transaction. The sender of the covert communication will embed the encoded transaction amount into the transaction source address Addr generated by S13. _ from and destination address Addr _ together they constitute a transaction.
[0171] b) Data is uploaded to the blockchain. The sender uses the source address of this transaction, Addr... _ The private key from will be used to submit the constructed transaction to the blockchain using the SubmitTransaction() function. After the blockchain reaches a consensus, the transaction will be packaged into a block.
[0172] c) After the current transaction is successfully published, return to step (1).
[0173] S25: Secret Message Decoding and Reception. After the recipient obtains the special transaction through a search, it needs to decode the transaction amount into a secret message. The specific process consists of the following 5 steps:
[0174] (1) Extract the transaction amount field. The covert communication receiver first extracts the 18-bit transaction amount from the special transaction and removes the first two transaction amount protection bits to obtain the data embedded with the secret message.
[0175] (2) Decode the transaction amount data. The receiver of the covert communication decodes the data extracted in step (1). The specific process is divided into the following 7 steps.
[0176] a) Set the initial value of the position variable to 0, and the initial value of the tens digit variable tag to 0.
[0177] b) Determine if all transaction amount data has been decoded. If yes, proceed to step g); otherwise, execute step c).
[0178] c) Determine if the number at the position pointed to in the transaction amount data is "0". If yes, increment the tag by 10 and jump to step f); otherwise, execute step d).
[0179] d) Determine if the number num1 at the position of the transaction amount data is less than the next number num2. If so, fill in "0" at the num1+tag position of the decoded binary data and jump to step f); otherwise, proceed sequentially to step e).
[0180] e) Starting from the num1+tag bit of the decoded binary data, fill in num2 consecutive "0"s, then increment the position value by 1, and proceed to step f).
[0181] f) Increment the value of position by 1, and jump to step b).
[0182] g) Iterate through the decoded binary data, fill in the positions where no "0" is filled with the number "1", and then output the processed binary data.
[0183] (3) Data deobfuscation. The receiver compares the decoded binary data with the transaction source address Addr of the same length. _ Perform an XOR operation from to restore the original data.
[0184] (4) Data decryption. The receiver calls the hashlib.sha256() function in the hashlib library to calculate the hash value hash(seed) of the shared random seed, and uses hash(seed) as the key to decrypt the binary message using the Decrypt() function of the AES object in Crypto.Cipher.
[0185] (5) Secret Message Recovery. Check if the data ends with a secret message end marker, which is 8 consecutive "00000000". If the end marker is present, submit all secret messages directly; if the end marker is not present, put the decoded data into the cache and wait for the next special transaction.
[0186] It should be noted that the above embodiments are not intended to limit the scope of protection of the present invention. Equivalent transformations or substitutions made based on the above technical solutions all fall within the scope of protection of the claims of the present invention.
Claims
1. A blockchain-based covert communication method, characterized in that, The method Includes the following steps: S1: Dynamic label of the address binary tree S2: Secret message embedding; The specific process of step S1 is as follows: S11: Initialization of covert communication channel S12: Construction of the address binary tree, S13: Dynamic transaction tag generation S14: Dynamic transaction tag recognition; The specific process of step S2 is as follows: S21: Determine the transaction amount format. S22: Determine the data encoding rules. S23: Secret Message Preprocessing S24: Secret message encoding transmission, S25: Secret message decoding and reception; S12: Address binary tree construction, which consists of the following two steps: (1) Randomly generate an address list, and the two parties in covert communication use a random seed. A random address list is generated by jointly agreeing on a random algorithm. ,in The index is a newly generated address number that is randomly generated. Indicates the corresponding address In address set The initial serial number at the time of application, (2) Construct an address binary tree, according to the sequence number. From the address list in sequence To construct a binary address tree by selecting addresses from the dataset, the specific process involves the following three steps: a) Construct the root node and select the address list. The first address in the address set is used as the root node of the binary tree. Initial serial number at the time of application As the value of the root node b) Generate a new node and check the address list. If all addresses have been retrieved and inserted into the address binary tree, then the construction of the address binary tree ends; otherwise, proceed sequentially from the address list... Take an address from the address set to construct a new node, where that address is in the address set. Initial serial number at the time of application As the value of the new node, c) Insert a new node. Insert the new node constructed in step b) into the address binary tree. First, compare the value of the new node with the value of the root node. If the value is less than the value of the root node, select the left child node of the root node to continue the comparison; otherwise, select the right child node of the root node to continue the comparison. Repeat the above comparison process until the corresponding node cannot be found from the current comparison position. Finally, insert the new node into the current comparison position. S13: Dynamic transaction tag generation, the specific process is divided into the following 4 steps: (1) First transaction judgment: Determine whether the current transaction is the first transaction after step S12. If so, proceed directly to step (3); otherwise, continue to step (2). (2) Reconstruct the address binary tree. Extract the source address and destination address from the most recent special transaction for covert communication and add them to the address list. The positions in the tree are swapped, and the address binary tree is reconstructed, sequentially... The address in the binary tree is used as a node for insertion into the binary tree. (3) Select the transaction source address. In the newly constructed address binary tree, select the address corresponding to the root node as the source address of this transaction. (4) Select the destination address for the transaction. Select the destination address for this transaction from the newly constructed address binary tree. The specific process is divided into the following 3 steps: a) First transaction index value generation: Determine if the current transaction is the first transaction after step S12. If so, the sender of the covert communication uses the address list. quantity For random seeds After taking the modulo, add 1 to get the index value. Otherwise, proceed directly to step b). b) Generation of subsequent transaction index values: The sender of the covert communication first calculates the initial sequence numbers of the source and destination addresses in the previous special transaction. and Then, using the address list quantity right After taking the modulo, add 1 to get the index value. , c) Query the destination address of the transaction. The sender of the covert communication uses a level-order traversal method in the newly constructed address binary tree to find the value that equals the index value. The corresponding node is then used as the destination address for this transaction. S14: Dynamic transaction tag recognition, the specific process is divided into the following 5 steps: (1) First transaction judgment: Determine whether the current transaction is the first transaction after step S12 is completed. If so, jump directly to step (3) to execute; otherwise, continue to execute step (2). (2) Reconstruct the address binary tree, extract the source address and destination address from the most recent special transaction for covert communication, and add them to the address list. The positions in the tree are swapped, and the address binary tree is reconstructed, sequentially... The address in the binary tree is used as a node for insertion. (3) Select the source address of the transaction. In the newly constructed address binary tree, select the address corresponding to the root node as the source address of this transaction. (4) Select the destination address for the transaction. Select the destination address for this transaction from the newly constructed address binary tree. The specific process is divided into the following 3 steps. a) First transaction index value generation: Determine if the current transaction is the first transaction after step S12. If so, the sender of the covert communication uses the address list. quantity For random seeds After taking the modulo, add 1 to get the index value. Otherwise, proceed directly to step b). b) Generation of subsequent transaction index values: The receiver of the covert communication first calculates the initial sequence numbers of the source and destination addresses in the previous special transaction. and Then, using the address list quantity right After taking the modulo, add 1 to get the index value. , c) Query the destination address of the transaction. The recipient of the covert communication uses a level-order traversal method in the newly constructed address binary tree to find the value that equals the index value. The corresponding node is then identified, and the address corresponding to that node is used as the destination address for this transaction. (5) Query transaction information. Starting from the last special transaction on the blockchain, find the transaction in which the addresses of both parties match the source address and destination address tags in steps (3) and (4). Then, extract the transaction amount information from the transaction and save it.
2. The blockchain-based covert communication method according to claim 1, characterized in that, S11: Covert communication channel initialization, as follows: Before constructing an address binary tree for covert communication, both communicating parties need to complete the channel initialization. The two parties reach a consensus on the off-chain secure channel, and the specific process consists of the following 5 steps: (1) Generate a set of covert communication addresses, and apply for blockchain for the sending direction in covert communication. A set of normal transaction addresses constitutes a covert communication address set. subscript Indicates the order of address requests, the sender's response to... any address in Record its corresponding private key , (2) Share the covert communication address set. The sender of the covert communication shares the blockchain address set generated in step (1) with the receiver through an off-chain secure channel. However, the private keys for these addresses are not shared. (3) Shared random seed: The sender of the covert communication uses a random algorithm to generate a random seed. And share the random seed with the receiver through an off-chain secure channel. ,in To meet All positive integers, (4) By joining the blockchain network, the sender and receiver of covert communication each apply for a normal transaction address from the blockchain, thereby being able to query all transaction information on the blockchain. (5) Conducting normal transactions and communicating covertly, the two parties use address sets All addresses within the system will conduct multiple normal transactions to ensure... any address in Each participant received a certain amount of on-chain virtual currency, providing a foundation for subsequent covert communication.
3. The blockchain-based covert communication method according to claim 1, characterized in that, S21: Determine the format of the transaction amount. The specific process consists of the following three steps: (1) Obtain normal transaction amount data, query the public information of all transactions on the blockchain, and obtain the transaction amount data of each transaction. (2) Determine the length of the special transaction amount, count the number of decimal places of all transaction amounts obtained in step (1), find the number of decimal places that appears most frequently, and use it as the fixed number of decimal places of the transaction amount of the special transaction. That is, the length of the embedded secret message. (3) Set a special transaction amount protection bit. To ensure that the amount of a special transaction does not exceed the amount in the wallet of the transaction source address, the number of decimal places is fixed. The first two digits are set as transaction amount protection digits.
4. The blockchain-based covert communication method according to claim 1, characterized in that, S22: Determine the data encoding rules, which include the following four points. (1) Use a single digit to represent the position of a single "0" bit in the secret message. (2) Use two consecutive digits to represent the position and number of consecutive "0" bits in the secret message. Note that the second digit must be less than or equal to the first digit. (3) Whenever the encoding in the secret message exceeds a multiple of ten digits, a zero should be added to the transaction amount to avoid ambiguity when decoding the secret message. (4) When the fixed embedding length in the transaction amount After all the encoded numbers are embedded, check the total transaction amount. If there is a "0" at the end of the transaction amount, delete all trailing "0"s.
5. The blockchain-based covert communication method according to claim 1, characterized in that, S23: Secret message preprocessing. Before the secret message is encoded for transmission, preprocessing is required. The specific process consists of the following three steps: (1) Binary encoding of secret messages: The sender of covert communication encodes the secret message text to be transmitted into a binary message. (2) The secret message is encrypted, and the sender of the covert communication uses a hash algorithm to calculate a shared random seed. hash value and will As the key, a symmetric cryptographic algorithm is used to encrypt the binary message. (3) Add an end marker. The sender of the covert communication adds 8 consecutive "0"s to the end of the encrypted message, i.e. "00000000", as the end marker of the secret message.
6. The blockchain-based covert communication method according to claim 1, characterized in that, S24: Transmitting a secret message in encoded form, the process consists of the following four steps: (1) To ensure that the secret message has been processed, the sender of the covert communication needs to check whether the secret message has been processed before each data encoding. (2) Data segmentation and obfuscation, (3) Construct the transaction amount, (4) Publish transactions on the blockchain.
7. The blockchain-based covert communication method according to claim 1, characterized in that, S25: Decoding and receiving secret messages, the specific process consists of the following 5 steps: (1) Extract the transaction amount field. The receiver of the covert communication first extracts the transaction amount from the special transaction, and the length after decimal places is [length missing]. The numerical value is then processed, and the first two bits, i.e., the transaction amount protection bits, are removed to obtain the embedded secret message data. (2) Decode the transaction amount data. The receiver of the covert communication decodes the data extracted in step (1). (3) Data de-obfuscation: The receiver of the covert communication performs an XOR operation on the decoded binary data and the data of the same number of bits in the transaction source address to remove the obfuscation of the secret message data. (4) Data decryption: The receiver of the covert communication uses a hash function to calculate a shared random seed. hash value and will The decrypted data is then decrypted using a symmetric cryptographic algorithm, which serves as the key. (5) Secret message recovery: Check if there are 8 consecutive "0"s at the end of the data, which is the end marker of the secret message. If so, remove the end marker and merge the current data with the data in the cache as the binary data of the secret message, and then restore it to text form; otherwise, put the data after this decoding into the cache and wait for the next special transaction.
Citation Information
Patent Citations
Administration mechanism for standard way access control list (ACL) rule under internet protocol security (IPsec) protocol
CN102811227A
Bitcoin transaction query method capable of effectively protecting user privacy
CN110287262A