CN110689349B - Method and device for storing and searching transaction hash value in blockchain - Google Patents
Method and device for storing and searching transaction hash value in blockchain Download PDFInfo
- Publication number
- CN110689349B CN110689349B CN201910949539.4A CN201910949539A CN110689349B CN 110689349 B CN110689349 B CN 110689349B CN 201910949539 A CN201910949539 A CN 201910949539A CN 110689349 B CN110689349 B CN 110689349B
- Authority
- CN
- China
- Prior art keywords
- nth
- transaction
- index
- ciphertext
- hash value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
- G06Q20/3827—Use of message hashing
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/901—Indexing; Data structures therefor; Storage structures
- G06F16/9014—Indexing; Data structures therefor; Storage structures hash tables
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/901—Indexing; Data structures therefor; Storage structures
- G06F16/9024—Graphs; Linked lists
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/903—Querying
- G06F16/90335—Query processing
- G06F16/90344—Query processing by using string matching techniques
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
- G06Q20/3829—Payment protocols; Details thereof insuring higher security of transaction involving key management
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/389—Keeping log of transactions for guaranteeing non-repudiation of a transaction
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Business, Economics & Management (AREA)
- Databases & Information Systems (AREA)
- Accounting & Taxation (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Finance (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- Computer Security & Cryptography (AREA)
- Software Systems (AREA)
- Computational Linguistics (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
技术领域technical field
本发明涉及金融科技(Fintech)领域和区块链(Blockchain)领域,尤其涉及一种区块链中的交易哈希值存储和搜索方法及装置。The present invention relates to the fields of financial technology (Fintech) and blockchain (Blockchain), in particular to a method and device for storing and searching transaction hash values in the blockchain.
背景技术Background technique
随着计算机技术的发展,越来越多的技术(大数据、分布式、区块链(Blockchain)、人工智能等)应用在金融领域,传统金融业正在逐步向金融科技(Fintech)转变。目前,金融科技的区块链领域中,常涉及到交易的搜索。每笔交易在执行完毕后,都会产生唯一标识该笔交易的交易哈希值。目前,搜索用户的交易日志的一般方式是根据用户的交易哈希值来搜索,因此用户的交易哈希值的存储安全至关重要。With the development of computer technology, more and more technologies (big data, distributed, blockchain (Blockchain), artificial intelligence, etc.) are applied in the financial field, and the traditional financial industry is gradually transforming into financial technology (Fintech). At present, in the blockchain field of financial technology, the search for transactions is often involved. After each transaction is executed, a transaction hash value that uniquely identifies the transaction will be generated. At present, the general way to search the user's transaction log is to search according to the user's transaction hash value, so the storage security of the user's transaction hash value is very important.
现有技术中主要用两种方式存储交易哈希值,第一种是明文存储用户的交易哈希值,显然这种方式容易造成交易哈希值泄露;第二种是将用户的交易哈希值加密后,将交易哈希值存储为密文,但这样以来,便不能在密文上根据索引参数对交易哈希值进行搜索。因此,现有技术不能既满足交易哈希值的存储安全性,又能按照索引参数搜索到相应的交易哈希值,这是一个亟待解决的问题。In the prior art, there are mainly two ways to store the transaction hash value. The first is to store the user’s transaction hash value in plain text. Obviously, this method is easy to cause the transaction hash value to be leaked; the second is to store the user’s transaction hash value After the value is encrypted, the transaction hash value is stored as ciphertext, but in this way, the transaction hash value cannot be searched based on the index parameter on the ciphertext. Therefore, the existing technology cannot not only satisfy the storage security of the transaction hash value, but also search for the corresponding transaction hash value according to the index parameters, which is an urgent problem to be solved.
发明内容Contents of the invention
本申请实施例提供一种区块链中的交易哈希值存储和搜索方法及装置,解决了现有技术中不能既满足交易哈希值的存储安全性,又能按照索引参数搜索到相应的交易哈希值的问题。The embodiment of the present application provides a transaction hash value storage and search method and device in the blockchain, which solves the problem that the prior art cannot satisfy the storage security of the transaction hash value, and can also search for the corresponding transaction hash value according to the index parameters. Issues with transaction hashes.
第一方面,本申请实施例提供一种区块链中的交易哈希值存储方法:客户端获取用户在所述客户端上发起的第N次交易的交易哈希值和所述第N次交易的索引参数;所述索引参数是从交易的交易信息中确定出用于进行交易日志搜索的关键词;N为正整数;所述客户端获取所述索引参数对应的第N-1状态字符串;所述第N-1状态字符串是针对第N-1次交易生成的;所述客户端将所述第N-1状态字符串和所述第N次交易的交易哈希值作为第N待加密数据;所述客户端生成第N状态字符串,并根据所述第N状态字符串和所述索引参数的搜索令牌确定第N密钥和第N索引位置信息;所述客户端使用所述第N密钥将所述第N待加密数据加密为第N密文,并建立所述第N索引位置信息和所述第N密文的唯一映射关系。In the first aspect, the embodiment of the present application provides a transaction hash value storage method in the blockchain: the client obtains the transaction hash value and the Nth transaction hash value of the Nth transaction initiated by the user on the client The index parameter of the transaction; the index parameter is a keyword determined from the transaction information of the transaction for the transaction log search; N is a positive integer; the client obtains the N-1th state character corresponding to the index parameter string; the N-1th state string is generated for the N-1th transaction; the client uses the N-1th state string and the transaction hash value of the Nth transaction as the first N data to be encrypted; the client generates the Nth state string, and determines the Nth key and the Nth index position information according to the search token of the Nth state string and the index parameter; the client Using the Nth key to encrypt the Nth data to be encrypted into an Nth ciphertext, and establishing a unique mapping relationship between the Nth index position information and the Nth ciphertext.
上述方法中,客户端获取用户在所述客户端上发起的第N次交易的交易哈希值和所述第N次交易的索引参数对应的第N-1状态字符串后,再根据第N状态字符串和索引参数的搜索令牌,确定第N密钥和第N索引位置信息;并使用所述第N密钥将所述第N待加密数据加密为第N密文,由于第N-1状态字符串是针对第N-1次交易生成的,也就是说,对于每个N,第N密文都是需要第N-1状态字符串的参与,这种环环相扣的方式生成的明文保密性较高;另外,由于建立所述第N索引位置信息和所述第N密文的唯一映射关系,可以通过第N索引位置信息搜索到第N密文,因此,上述方法中交易哈希值的存储更加安全,同时存储时保留了可搜索性。In the above method, after the client obtains the transaction hash value of the Nth transaction initiated by the user on the client and the N-1th state string corresponding to the index parameter of the Nth transaction, then according to the Nth The search token of the status character string and the index parameter, determine the Nth key and the Nth index position information; and use the Nth key to encrypt the Nth data to be encrypted into the Nth ciphertext, because the Nth- 1 The state string is generated for the N-1th transaction, that is to say, for each N, the Nth ciphertext requires the participation of the N-1th state string, which is generated in an interlocking manner The confidentiality of the plaintext is relatively high; in addition, since the unique mapping relationship between the Nth index position information and the Nth ciphertext is established, the Nth ciphertext can be searched through the Nth index position information, therefore, the transaction in the above method Storage of hashes is more secure while preserving searchability when stored.
一种可选实施方式中,所述客户端将所述第N-1状态字符串和所述第N次交易的交易哈希值作为第N待加密数据,包括:所述客户端将所述第N-1状态字符串和所述第N次交易的交易哈希值拼接后的字符串,作为所述第N待加密数据;所述客户端使用所述第N密钥将所述第N待加密数据加密为第N密文,包括:按照预设位运算,将所述第N待加密数据与所述第N密钥的位运算结果,作为所述第N密文。In an optional implementation manner, the client uses the N-1th state string and the transaction hash value of the Nth transaction as the Nth data to be encrypted, including: the client uses the The character string concatenated by the N-1th state string and the transaction hash value of the Nth transaction is used as the Nth data to be encrypted; the client uses the Nth key to encrypt the Nth Encrypting the data to be encrypted into an Nth ciphertext includes: performing a bit operation result of the Nth data to be encrypted and the Nth key as the Nth ciphertext according to a preset bit operation.
上述方法中,所述客户端将所述第N-1状态字符串和所述第N次交易的交易哈希值拼接后的字符串,作为所述第N待加密数据,并通过预设位运算得到第N密文,从而简单、高效的方法对第N待加密数据进行加密。In the above method, the client concatenates the N-1th state string and the transaction hash value of the Nth transaction as the Nth data to be encrypted, and passes the preset bit The Nth ciphertext is obtained through the operation, so that the Nth data to be encrypted is encrypted in a simple and efficient way.
一种可选实施方式中,所述客户端根据所述第N状态字符串和所述索引参数的搜索令牌确定第N密钥和第N索引位置信息,包括:所述客户端将所述第N状态字符串和所述索引参数的搜索令牌按照第一预设哈希算法映射的结果,作为所述第N密钥;所述客户端将所述第N状态字符串和所述索引参数的搜索令牌按照第二预设哈希算法映射的结果,作为所述第N索引位置信息;所述第一哈希算法和所述第二哈希算法为不同的哈希算法。In an optional implementation manner, the client determines the Nth key and the Nth index location information according to the Nth state string and the search token of the index parameter, including: the client sends the The result of mapping the Nth state string and the search token of the index parameter according to the first preset hash algorithm is used as the Nth key; the client uses the Nth state string and the index The result of mapping the search token of the parameter according to the second preset hash algorithm is used as the Nth index position information; the first hash algorithm and the second hash algorithm are different hash algorithms.
上述方法中,客户端根据所述第N状态字符串和所述索引参数的搜索令牌,通过不同的第一哈希算法和第二哈希算法,分别确定第N密钥和第N索引位置信息,从而既与第N状态字符串和索引参数的搜索令牌建立了映射关系,又通过不同的哈希算法增强了保密性。In the above method, the client determines the Nth key and the Nth index position respectively through different first hash algorithms and second hash algorithms according to the Nth state string and the search token of the index parameter Information, so as to establish a mapping relationship with the Nth state string and the search token of the index parameter, and enhance the confidentiality through different hash algorithms.
第二方面,本申请提供一种区块链中的交易哈希值搜索方法,包括:索引服务器获取来自客户端的索引参数的搜索令牌和第N状态字符串;所述索引参数是从交易的交易信息中确定出用于进行交易日志搜索的关键词;N为正整数;所述第N状态字符串是用户在所述客户端上发起的第N次交易时生成的;所述索引服务器根据所述索引参数的搜索令牌和所述第N状态字符串,获取所述索引参数的第N索引位置信息;所述第N索引位置信息与第N密文唯一映射;所述第N密文是所述客户端对所述第N次交易的交易哈希值加密的密文;所述索引服务器根据所述第N索引位置信息,获取所述第N索引位置信息唯一映射的所述第N密文;所述索引服务器根据所述搜索令牌和所述第N状态字符串,生成第N密钥;所述索引服务器根据所述第N密钥将所述第N密文解密为第N待加密数据;所述索引服务器根据所述第N待加密数据,提取出所述第N次交易时的交易哈希值,使得完成所述第N次交易时的交易哈希值的搜索。In the second aspect, the present application provides a transaction hash value search method in the block chain, including: the index server obtains the search token and the Nth state string of the index parameter from the client; the index parameter is obtained from the transaction The keywords used to search the transaction log are determined in the transaction information; N is a positive integer; the Nth status character string is generated when the user initiates the Nth transaction on the client; the index server according to The search token of the index parameter and the Nth state character string are used to obtain the Nth index position information of the index parameter; the Nth index position information is uniquely mapped to the Nth ciphertext; the Nth ciphertext is the ciphertext encrypted by the client to the transaction hash value of the Nth transaction; the index server obtains the Nth index uniquely mapped to the Nth index location information according to the Nth index location information Ciphertext; the index server generates the Nth key according to the search token and the Nth status character string; the index server decrypts the Nth ciphertext into the Nth key according to the Nth key Data to be encrypted; the index server extracts the transaction hash value of the Nth transaction according to the Nth data to be encrypted, so that the search for the transaction hash value of the Nth transaction is completed.
上述方式下,索引服务器获取来自客户端的索引参数的搜索令牌和第N状态字符串,并根据所述索引参数的搜索令牌和所述第N状态字符串,获取所述索引参数的第N索引位置信息,由于所述第N索引位置信息与第N密文唯一映射,因此可以根据第N索引位置信息搜索到第N密文,并通过搜索令牌和所述第N状态字符串生成第N密钥,再用第N密钥将所述第N密文解密为第N待加密数据,并提取出所述第N次交易时的交易哈希值,从而实现了对第N次交易时的交易哈希值的搜索。In the above manner, the index server obtains the search token and the Nth state string of the index parameter from the client, and obtains the Nth state string of the index parameter according to the search token of the index parameter and the Nth state string. Index position information. Since the Nth index position information is uniquely mapped to the Nth ciphertext, the Nth ciphertext can be searched according to the Nth index position information, and the Nth ciphertext can be generated by searching the token and the Nth state string N key, and then use the N key to decrypt the Nth ciphertext into the Nth data to be encrypted, and extract the transaction hash value of the Nth transaction, thus realizing the Nth transaction A search of transaction hashes.
一种可选实施方式中,所述索引服务器根据所述第N待加密数据,提取出所述第N-1状态字符串;所述索引服务器根据所述索引参数的搜索令牌和所述第N-1状态字符串,获取所述索引参数的第N-1索引位置信息;所述索引服务器根据所述第N-1索引位置信息,获取所述第N-1索引位置信息唯一映射的第N-1密文;所述索引服务器根据所述搜索令牌和所述第N-1状态字符串,将所述第N-1密文解密为第N-1待加密数据;所述索引服务器根据所述第N-1待加密数据,提取出第N-1次交易时的交易哈希值,使得完成所述第N-1次交易时的交易哈希值的搜索。In an optional implementation manner, the index server extracts the N-1th state character string according to the Nth data to be encrypted; The N-1 status string is used to obtain the N-1th index position information of the index parameter; the index server obtains the N-1th index position information uniquely mapped to the N-1th index position information according to the N-1th index position information. N-1 ciphertext; the index server decrypts the N-1th ciphertext into N-1th data to be encrypted according to the search token and the N-1th state character string; the indexing server According to the N-1th data to be encrypted, the transaction hash value of the N-1th transaction is extracted, so that the search for the transaction hash value of the N-1th transaction is completed.
上述方式下,所述索引服务器根据所述第N待加密数据,提取出所述第N-1状态字符串,并获取所述索引参数的第N-1索引位置信息,获取所述第N-1索引位置信息唯一映射的第N-1密文,也就是说,索引服务器可以在对第N待加密数据解密后,再基于第N待加密数据获取第N-1密文,并提取出第N-1次交易时的交易哈希值,使得完成所述第N-1次交易时的交易哈希值的搜索。In the above manner, the index server extracts the N-1th state character string according to the Nth data to be encrypted, and obtains the N-1th index position information of the index parameter, and obtains the N-
一种可选实施方式中,所述第N密文是所述待加密数据与所述第N密钥按照预设位运算的位运算结果;所述索引服务器根据所述第N密钥将所述第N密文解密为第N待加密数据:所述索引服务器按照所述预设位运算,将所述第N密文与所述第N密钥的位运算结果,作为所述第N待加密数据。In an optional implementation manner, the Nth ciphertext is a bit operation result of the data to be encrypted and the Nth key according to a preset bit operation; the index server converts the Nth key to the The Nth ciphertext is decrypted into the Nth data to be encrypted: the index server calculates according to the preset bit, and uses the bit operation result of the Nth ciphertext and the Nth key as the Nth data to be encrypted Encrypt data.
上述方式下,由于所述第N密文是所述待加密数据与所述第N密钥按照预设位运算的位运算结果,所述索引服务器按照所述预设位运算再将第N密文解密,即将所述第N密文与所述第N密钥的位运算结果,作为所述第N待加密数据。In the above method, since the Nth ciphertext is the bit operation result of the data to be encrypted and the Nth key according to the preset bit operation, the index server calculates the Nth ciphertext according to the preset bit operation. The text decryption is to use the bit operation result of the Nth ciphertext and the Nth key as the Nth data to be encrypted.
第三方面,本申请提供一种区块链中的交易哈希值存储装置,包括:获取模块,用于获取用户在所述客户端上发起的第N次交易的交易哈希值和所述第N次交易的索引参数;所述索引参数是从交易的交易信息中确定出用于进行交易日志搜索的关键词;获取所述索引参数对应的第N-1状态字符串;所述第N-1状态字符串是针对第N-1次交易生成的;N为正整数;加密模块,用于将所述第N-1状态字符串和所述第N次交易的交易哈希值作为第N待加密数据;生成第N状态字符串,并根据所述第N状态字符串和所述索引参数的搜索令牌确定第N密钥和第N索引位置信息;使用所述第N密钥将所述第N待加密数据加密为第N密文,并建立所述第N索引位置信息和所述第N密文的唯一映射关系。In a third aspect, the present application provides a transaction hash value storage device in a block chain, including: an acquisition module, configured to acquire the transaction hash value and the transaction hash value of the Nth transaction initiated by the user on the client The index parameter of the Nth transaction; the index parameter is a keyword determined from the transaction information of the transaction for the transaction log search; obtain the N-1th state string corresponding to the index parameter; the Nth The -1 status string is generated for the N-1th transaction; N is a positive integer; the encryption module is used to use the N-1th status string and the transaction hash value of the N-th transaction as the first N data to be encrypted; generate the Nth state character string, and determine the Nth key and the Nth index position information according to the search token of the Nth state character string and the index parameter; use the Nth key to The Nth data to be encrypted is encrypted into an Nth ciphertext, and a unique mapping relationship between the Nth index position information and the Nth ciphertext is established.
一种可选实施方式中,所述加密模块具体用于:将所述第N-1状态字符串和所述第N次交易的交易哈希值拼接后的字符串,作为所述第N待加密数据;按照预设位运算,将所述第N待加密数据与所述第N密钥的位运算结果,作为所述第N密文。In an optional implementation manner, the encryption module is specifically configured to: concatenate the N-1th state character string and the transaction hash value of the Nth transaction as the character string to be used as the Nth Encrypting data: according to a preset bit operation, using a bit operation result of the Nth data to be encrypted and the Nth key as the Nth ciphertext.
一种可选实施方式中,所述加密模块具体用于:将所述第N状态字符串和所述索引参数的搜索令牌按照第一预设哈希算法映射的结果,作为所述第N密钥;将所述第N状态字符串和所述索引参数的搜索令牌按照第二预设哈希算法映射的结果,作为所述第N索引位置信息;所述第一哈希算法和所述第二哈希算法为不同的哈希算法。In an optional implementation manner, the encryption module is specifically configured to: map the Nth state character string and the search token of the index parameter according to a first preset hash algorithm as the Nth key; the result of mapping the Nth state string and the search token of the index parameter according to a second preset hash algorithm as the Nth index position information; the first hash algorithm and the The second hash algorithm is a different hash algorithm.
上述第三方面及第三方面各个实施例的有益效果,可以参考上述第一方面及第一方面各个实施例的有益效果,这里不再赘述。For the above-mentioned third aspect and the beneficial effects of each embodiment of the third aspect, reference may be made to the above-mentioned first aspect and the beneficial effects of each embodiment of the first aspect, which will not be repeated here.
第四方面,本申请提供一种区块链中的交易哈希值存储装置,包括:获取模块,用于获取来自客户端的索引参数的搜索令牌和第N状态字符串;所述索引参数是从交易的交易信息中确定出用于进行交易日志搜索的关键词;所述第N状态字符串是用户在所述客户端上发起的第N次交易时生成的;N为正整数;根据所述索引参数的搜索令牌和所述第N状态字符串,获取所述索引参数的第N索引位置信息;所述第N索引位置信息与第N密文唯一映射;所述第N密文是所述客户端对所述第N次交易的交易哈希值加密的密文;根据所述第N索引位置信息,获取所述第N索引位置信息唯一映射的所述第N密文;解密模块,用于根据所述搜索令牌和所述第N状态字符串,生成第N密钥;根据所述第N密钥将所述第N密文解密为第N待加密数据;根据所述第N待加密数据,提取出所述第N次交易时的交易哈希值,使得完成所述第N次交易时的交易哈希值的搜索。In a fourth aspect, the present application provides a transaction hash value storage device in a block chain, including: an acquisition module, which is used to acquire a search token and an Nth state character string of an index parameter from a client; the index parameter is Determine the keywords used to search the transaction log from the transaction information of the transaction; the Nth status character string is generated when the user initiates the Nth transaction on the client; N is a positive integer; according to the The search token of the index parameter and the Nth state character string to obtain the Nth index position information of the index parameter; the Nth index position information is uniquely mapped to the Nth ciphertext; the Nth ciphertext is The client encrypts the ciphertext of the transaction hash value of the Nth transaction; according to the Nth index position information, obtains the Nth ciphertext uniquely mapped to the Nth index position information; a decryption module , for generating an Nth key according to the search token and the Nth state string; decrypting the Nth ciphertext into the Nth data to be encrypted according to the Nth key; according to the Nth key For N data to be encrypted, the transaction hash value at the time of the Nth transaction is extracted, so that the search for the transaction hash value at the time of the Nth transaction is completed.
一种可选实施方式中,所述获取模块还用于:根据所述第N待加密数据,提取出所述第N-1状态字符串;根据所述索引参数的搜索令牌和所述第N-1状态字符串,获取所述索引参数的第N-1索引位置信息;根据所述第N-1索引位置信息,获取所述第N-1索引位置信息唯一映射的第N-1密文;所述解密模块还用于:根据所述搜索令牌和所述第N-1状态字符串,将所述第N-1密文解密为第N-1待加密数据;根据所述第N-1待加密数据,提取出第N-1次交易时的交易哈希值,使得完成所述第N-1次交易时的交易哈希值的搜索。In an optional implementation manner, the obtaining module is further configured to: extract the N-1th state character string according to the Nth data to be encrypted; according to the search token of the index parameter and the N-1 status character string, to obtain the N-1th index position information of the index parameter; according to the N-1th index position information, to obtain the N-1th index uniquely mapped to the N-1th index position information text; the decryption module is also used to: according to the search token and the N-1 state string, decrypt the N-1th ciphertext into the N-1th data to be encrypted; according to the N-1th state string For N-1 data to be encrypted, the transaction hash value of the N-1th transaction is extracted, so that the search for the transaction hash value of the N-1th transaction is completed.
一种可选实施方式中,所述第N密文是所述待加密数据与所述第N密钥按照预设位运算的位运算结果;所述索引服务器根据所述第N密钥将所述第N密文解密为第N待加密数据:所述索引服务器按照所述预设位运算,将所述第N密文与所述第N密钥的位运算结果,作为所述第N待加密数据。In an optional implementation manner, the Nth ciphertext is a bit operation result of the data to be encrypted and the Nth key according to a preset bit operation; the index server converts the Nth key to the The Nth ciphertext is decrypted into the Nth data to be encrypted: the index server calculates according to the preset bit, and uses the bit operation result of the Nth ciphertext and the Nth key as the Nth data to be encrypted Encrypt data.
上述第四方面及第四方面各个实施例的有益效果,可以参考上述第二方面及第二方面各个实施例的有益效果,这里不再赘述。For the beneficial effects of the above fourth aspect and various embodiments of the fourth aspect, reference may be made to the above second aspect and the beneficial effects of each embodiment of the second aspect, which will not be repeated here.
第五方面,本申请实施例提供一种计算机设备,包括程序或指令,当所述程序或指令被执行时,用以执行上述第一方面及第一方面各个实施例或者第二方面及第二方面各个实施例的方法。In the fifth aspect, the embodiment of the present application provides a computer device, including a program or an instruction. When the program or instruction is executed, it is used to execute the above-mentioned first aspect and the various embodiments of the first aspect or the second aspect and the second aspect. Methods of various embodiments of the aspect.
第六方面,本申请实施例提供一种存储介质,包括程序或指令,当所述程序或指令被执行时,用以执行上述第一方面及第一方面各个实施例或者第二方面及第二方面各个实施例的方法。In the sixth aspect, the embodiments of the present application provide a storage medium, including programs or instructions, when the programs or instructions are executed, to execute the above-mentioned first aspect and the various embodiments of the first aspect or the second aspect and the second aspect Methods of various embodiments of the aspect.
附图说明Description of drawings
图1为区块链的结构示意图;Figure 1 is a schematic structural diagram of the blockchain;
图2为事件调用并生成日志的流程示意图;Figure 2 is a schematic flow chart of event calling and generating logs;
图3为本申请实施例提供的一种交易哈希值的存储和搜索方法的过程示意图;Fig. 3 is a schematic diagram of the process of a transaction hash value storage and search method provided by the embodiment of the present application;
图4为本申请实施例提供的一种交易哈希值的存储方法的步骤流程示意图;Fig. 4 is a schematic flow chart of the steps of a transaction hash value storage method provided by the embodiment of the present application;
图5为本申请实施例提供的一种交易哈希值的搜索方法的步骤流程示意图;Fig. 5 is a schematic flow chart of the steps of a transaction hash value search method provided by the embodiment of the present application;
图6为本申请实施例提供的一种交易哈希值的存储装置的结构示意图;FIG. 6 is a schematic structural diagram of a transaction hash value storage device provided by an embodiment of the present application;
图7为本申请实施例提供的一种交易哈希值的搜索装置的结构示意图。FIG. 7 is a schematic structural diagram of a transaction hash value search device provided by an embodiment of the present application.
具体实施方式Detailed ways
为了更好的理解上述技术方案,下面将结合说明书附图及具体的实施方式对上述技术方案进行详细的说明,应当理解本申请实施例以及实施例中的具体特征是对本申请技术方案的详细的说明,而不是对本申请技术方案的限定,在不冲突的情况下,本申请实施例以及实施例中的技术特征可以相互结合。In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods. It should be understood that the embodiments of the present application and the specific features in the embodiments are detailed descriptions of the technical solution of the present application. To illustrate, rather than limit, the technical solutions of the present application, the embodiments of the present application and the technical features in the embodiments can be combined without conflict.
下面首先解释本申请实施例中出现的名词。The nouns appearing in the embodiments of the present application are firstly explained below.
区块链:如图1所示,区块链是由一系列区块组成的一条链,每个块上除了记录本块的数据还会记录上一块的哈希(Hash)值,通过这种方式组成一条链。区块链的核心理念有两个,一个是密码学技术,另一个是去中心化思想,基于这两个理念做到区块链上的历史信息无法被篡改。Blockchain: As shown in Figure 1, the blockchain is a chain composed of a series of blocks. In addition to recording the data of this block, each block also records the hash (Hash) value of the previous block. Through this form a chain. There are two core concepts of the blockchain, one is cryptography technology, and the other is the idea of decentralization. Based on these two concepts, the historical information on the blockchain cannot be tampered with.
智能合约:智能合约是一种旨在以信息化方式传播、验证或执行合同的计算机协议。智能合约允许在没有第三方的情况下进行可信交易,这些交易可追踪且不可逆转。智能合约具体形式为部署在区块链上,完成特定功能的代码。Smart Contract: A smart contract is a computer protocol designed to communicate, verify or enforce a contract in an informational manner. Smart contracts allow for trusted transactions without third parties, which are traceable and irreversible. The specific form of a smart contract is the code deployed on the blockchain to complete a specific function.
日志:日志是以太坊定义的一种特殊的数据,日志与智能合约关联,是交易收据的一部分。包含某个特定日志的交易是唯一的,以太坊中的交易一般使用其交易哈希值表示。日志由客户端在执行交易时生成,可以在区块链存储中检索到它们。只要某个区块可以访问,其相关的日志就可以访问。但在合约中,并不能直接访问日志和事件数据(即便是创建日志的合约),一般只能通过交易哈希值来访问日志。日志包括主题(topic)和数据(data)两部分,其中topic部分用于快速查找,而data部分用于存储原始日志。Log: The log is a special kind of data defined by Ethereum. The log is associated with the smart contract and is part of the transaction receipt. Transactions that contain a particular log are unique, and transactions in Ethereum are generally represented by their transaction hash. Logs are generated by clients when executing transactions and they can be retrieved in blockchain storage. As long as a block is accessible, its associated logs are also accessible. However, in the contract, the log and event data cannot be directly accessed (even the contract that created the log), and generally the log can only be accessed through the transaction hash value. The log includes two parts: topic and data. The topic part is used for quick search, while the data part is used to store the original log.
事件:事件是以太坊虚拟机在日志机制的基础上提供的一个接口,通过触发事件可以生成一条日志并将其写入到区块链中。在智能合约开发中,事件机制通常被用来记录用户的操作记录。如定义一个转账事件event transfer(address indexed from,addressindexed to,uint value),当该事件被触发时,参数from、to和value将会生成一条日志,该条日志将被写入到区块链。应用程序可以通过以太坊客户端的远程过程调用(remoteprocedure call,RPC)接口监听或调用事件,如图2所示。Event: An event is an interface provided by the Ethereum Virtual Machine based on the log mechanism. By triggering an event, a log can be generated and written into the blockchain. In the development of smart contracts, the event mechanism is usually used to record user operation records. For example, define a transfer event event transfer(address indexed from, address indexed to, uint value), when the event is triggered, the parameters from, to and value will generate a log, which will be written to the blockchain. The application program can monitor or invoke events through the remote procedure call (remote procedure call, RPC) interface of the Ethereum client, as shown in Figure 2.
事件的参数:在定义一个事件时,需要指定该事件的参数。参数分为两种,一种是被indexed修饰的,另外一种没有被indexed修饰。这两种参数的区别在于前者将被存储在日志的topic字段,而后者将会被存储在日志的data字段中。日志的topic字段可以用作搜索,而data字段不可以用作搜索。如定义一个转账事件event transfer(address indexedfrom,address indexed to,uint value),当该事件被触发时,参数from、to和value将会被写入到区块链的日志中。用户可以通过from或to过滤日志,如“搜索from等于地址A的所有记录(相当于搜索地址A的转出记录)”,而不能使用value进行过滤。Parameters of the event: When defining an event, the parameters of the event need to be specified. There are two types of parameters, one is modified by indexed, and the other is not modified by indexed. The difference between these two parameters is that the former will be stored in the topic field of the log, while the latter will be stored in the data field of the log. The topic field of the log can be used for searching, but the data field cannot be used for searching. For example, if you define a transfer event event transfer(address indexed from, address indexed to, uint value), when the event is triggered, the parameters from, to and value will be written into the log of the blockchain. Users can filter logs by from or to, such as "search for all records where from is equal to address A (equivalent to searching for transfer-out records of address A)", but cannot filter by value.
哈希函数:哈希函数又被称为散列函数,是把任意长度的输入通过散列算法变换成固定长度的输出,该输出就是散列值。这种转换是一种压缩映射,也就是,散列值的空间通常远小于输入的空间,不同的输入可能会散列成相同的输出,所以不可能从散列值来确定唯一的输入值。哈希函数可以被形式化地定义为:H:(0,1)x→(0,1)n。其中x为任意长度,而n为固定长度。Hash function: A hash function is also called a hash function, which converts an input of any length into a fixed-length output through a hash algorithm, and the output is a hash value. This conversion is a compression map, that is, the space of the hash value is usually much smaller than the space of the input, and different inputs may hash to the same output, so it is impossible to determine the unique input value from the hash value. A hash function can be formally defined as: H:(0,1) x →(0,1) n . Where x is an arbitrary length, and n is a fixed length.
伪随机函数:伪随机函数是一种生成随机字符串的方式。和哈希函数不同,伪随机函数的输入中包括一个密钥k和消息m,k是被秘密保存的。伪随机函数的输出由k和m共同决定。伪随机函数可以形式化的定义为F:(0,1)λ×(0,1)x→(0,1)n。其中λ为密钥k的长度,x为消息m的长度,n为输出的长度。在本专利中,伪随机是利用哈希函数实现,即将密钥k和消息m拼接在一起作为函数的输入,F(k,m)=H(k||m)。在本申请实施例中,||表示连接,k||m表示将k与m连接的结果。Pseudorandom function: A pseudorandom function is a way of generating a random string of characters. Unlike the hash function, the input of the pseudo-random function includes a key k and a message m, and k is kept secret. The output of the pseudo-random function is jointly determined by k and m. The pseudorandom function can be formally defined as F:(0,1) λ ×(0,1) x →(0,1) n . where λ is the length of the key k, x is the length of the message m, and n is the length of the output. In this patent, the pseudo-random is implemented by using a hash function, that is, splicing the key k and the message m together as the input of the function, F(k,m)=H(k||m). In the embodiment of the present application, || represents a connection, and k||m represents a result of connecting k and m.
搜索令牌:搜索令牌是搜索关键词的一种变形。在搜索时,为了保证所搜索关键词的机密性,用户需要首先对关键词进行处理。生成搜索令牌的过程需要用户密钥的参与,以保证攻击者不能伪造。搜索令牌不会泄露原来的关键词的任何信息,在可搜索加密中,通常使用伪随机函数生成搜索关键词所对应的搜索令牌。如要搜索的关键词为w,用户密钥为k,则搜索令牌为F(k,w)。Search tokens: Search tokens are a variant of search keywords. When searching, in order to ensure the confidentiality of the searched keyword, the user needs to process the keyword first. The process of generating a search token requires the participation of the user's key to ensure that an attacker cannot forge it. The search token will not reveal any information about the original keyword. In searchable encryption, a pseudo-random function is usually used to generate a search token corresponding to the search keyword. If the keyword to be searched is w and the user key is k, then the search token is F(k,w).
在金融机构(银行机构、保险机构或证券机构)在进行业务(如银行的贷款业务、存款业务等)运转过程中,常涉及到交易的搜索。每笔交易在执行完毕后,都会产生唯一标识该笔交易的交易哈希值。目前,搜索用户的交易日志的一般方式是根据用户的交易哈希值来搜索,因此用户的交易哈希值的存储安全至关重要。During the operation of financial institutions (banking institutions, insurance institutions or securities institutions) (such as bank loan business, deposit business, etc.), transaction searches are often involved. After each transaction is executed, a transaction hash value that uniquely identifies the transaction will be generated. At present, the general way to search the user's transaction log is to search according to the user's transaction hash value, so the storage security of the user's transaction hash value is very important.
现有技术中主要用两种方式存储交易哈希值,第一种是明文存储用户的交易哈希值,显然这种方式容易造成交易哈希值泄露;第二种是将用户的交易哈希值加密后,将交易哈希值存储为密文,但这样以来,便不能在密文上根据索引参数对交易哈希值进行搜索。因此,现有技术不能既满足交易哈希值的存储安全性,又能按照索引参数搜索到相应的交易哈希值,这种情况也会导致任务调度信号传输延迟过长。这种情况不符合银行等金融机构的需求,无法保证金融机构各项业务的高效运转。In the prior art, there are mainly two ways to store the transaction hash value. The first is to store the user’s transaction hash value in plain text. Obviously, this method is easy to cause the transaction hash value to be leaked; the second is to store the user’s transaction hash value After the value is encrypted, the transaction hash value is stored as ciphertext, but in this way, the transaction hash value cannot be searched based on the index parameter on the ciphertext. Therefore, the existing technology cannot not only satisfy the storage security of the transaction hash value, but also be able to search for the corresponding transaction hash value according to the index parameters, which will also lead to a long transmission delay of the task scheduling signal. This situation does not meet the needs of financial institutions such as banks, and cannot guarantee the efficient operation of various businesses of financial institutions.
基于以上分析,本发明针对现有的事件机制,设计了一种区块链中支持交易哈希值的存储和搜索的方案。本方案确保在用户与区块链交互的整个过程中,传输的数据都是密文的。另外,用户可以同时对topic字段和data字段中的数据进行搜索。Based on the above analysis, the present invention designs a solution in the blockchain that supports the storage and search of transaction hash values for the existing event mechanism. This scheme ensures that during the entire process of user interaction with the blockchain, the transmitted data is in ciphertext. In addition, users can search data in the topic field and data field at the same time.
本方案使用的一种具备前向安全性质的可搜索加密存储方案。如图3所示,每一个关键词都对应一个状态链。状态链中的一个节点就对应一个包含该关键词的文件,每一个节点都使用状态st唯一标识。在Update阶段,客户端首先产生出新的状态stc+1,然后根据关键词w、关键词w的搜索令牌tw、文件名ind、操作类型op(包括增加和删除两种情况)等信息生成新的节点,并将该节点添加到状态链中。在搜索时,只需要知道tw和stc+1,就可以得到最后一个节点,从而遍历得到该状态链上的所有的节点。This scheme uses a searchable encrypted storage scheme with forward security properties. As shown in Figure 3, each keyword corresponds to a state chain. A node in the state chain corresponds to a file containing the keyword, and each node is uniquely identified by the state st. In the Update phase, the client first generates a new state st c+1 , and then according to the keyword w, the search token t w of the keyword w, the file name ind, the operation type op (including adding and deleting), etc. The information generates a new node and adds the node to the state chain. When searching, only need to know t w and st c+1 to get the last node, so as to traverse to get all the nodes on the state chain.
在本申请中,文件名对应于交易哈希值,关键词对应于用户定义的事件中被indexed修饰的参数。如定义一个转账事件event transfer(address indexed from,address indexed to,uint value)。想要搜索from=“0x1234..”的日志时,只需要搜索关键词w=“0x1234…”的所有交易哈希值,再从这些交易收据中取出对应的日志即可。另外,在本申请中,只有一种操作类型,即op一定为增加。In this application, the file name corresponds to the transaction hash value, and the keyword corresponds to the parameter modified by indexed in the user-defined event. For example, define a transfer event event transfer(address indexed from, address indexed to, uint value). When you want to search for logs from=“0x1234..”, you only need to search for all transaction hash values with keywords w=“0x1234…”, and then retrieve the corresponding logs from these transaction receipts. In addition, in this application, there is only one type of operation, that is, op must be increment.
该方案主要包括三个主体:The program mainly includes three main bodies:
区块链:任意一种具有事件机制的区块链,用于分布式存储数据。Blockchain: Any blockchain with an event mechanism for distributed storage of data.
用户:产生数据并以触发事件的形式写入到数据库中,检索满足某种条件的事件。需要注意的是,本发明中用户被要求有一定的存储能力,用于存储一些与关键词相关的信息。根据应用场景的不同,用户的存储形式也不同:如在客户机/服务器(Client/Server,C/S)架构的应用中可以使用服务器中;在浏览器/服务器结构(Browser/Server,B/S)架构的应用中可以使用浏览器储存在用户本地终端上的数据(cookie)等。User: Generate data and write it into the database in the form of triggering events, and retrieve events that meet certain conditions. It should be noted that in the present invention, the user is required to have a certain storage capacity for storing some information related to keywords. According to different application scenarios, the user's storage form is also different: for example, in the application of the client/server (Client/Server, C/S) architecture, the server can be used; in the browser/server structure (Browser/Server, B/ S) The data (cookie) stored in the user's local terminal by the browser can be used in the application of the framework.
索引服务器:当用户的存储能力不足时,可以将索引位置信息外包给一个可信的服务器。在搜索时,首先由索引服务器搜索到满足条件的交易哈希值,之后用户根据交易哈希值查询到具体的日志。Index server: When the user's storage capacity is insufficient, the index location information can be outsourced to a trusted server. When searching, the index server first searches for the transaction hash value that meets the conditions, and then the user queries the specific log according to the transaction hash value.
在进行交易哈希值的存储或搜索之前,需要做系统初始化。下面详细描述了系统初始化的过程:Before storing or searching transaction hash values, system initialization is required. The process of system initialization is described in detail below:
用户确定长期密钥k。The user determines the long-term key k.
长期密钥本质上是一个二进制字符串。该密钥的长度与系统参数λ有关,如λ=1024时,k为长度为1024的二进制串。该长期密钥需要用户妥善保管,将会被用作生成关键词对应的搜索令牌。A long-term key is essentially a binary string. The length of the key is related to the system parameter λ. For example, when λ=1024, k is a binary string with a length of 1024. The long-term key needs to be kept safe by the user, and will be used to generate the search token corresponding to the keyword.
用户初始化本地存储结构。The user initializes the local storage structure.
举例来说,该存储结构是一个键-值(map)结构的数据结构,其中键(key)为关键词,值(value)为该关键词对应的最新状态。For example, the storage structure is a data structure of a key-value (map) structure, wherein the key (key) is a keyword, and the value (value) is the latest state corresponding to the keyword.
下面结合图4和图5,详细介绍本申请实施例提供的一种交易哈希值的存储和搜索方法的步骤流程示意图。In the following, with reference to FIG. 4 and FIG. 5 , a schematic flowchart of the steps of a method for storing and searching transaction hash values provided by the embodiment of the present application will be introduced in detail.
本申请实施例提供的一种交易哈希值的存储方法的步骤如下:The steps of a transaction hash value storage method provided in the embodiment of this application are as follows:
步骤401:客户端获取用户在所述客户端上发起的第N次交易的交易哈希值和所述第N次交易的索引参数。Step 401: the client terminal obtains the transaction hash value of the Nth transaction initiated by the user on the client terminal and the index parameter of the Nth transaction.
所述索引参数是从交易的交易信息中确定出用于进行交易日志搜索的关键词;N为正整数。The index parameter is a keyword determined from the transaction information of the transaction for searching the transaction log; N is a positive integer.
步骤402:所述客户端获取所述索引参数对应的第N-1状态字符串。Step 402: The client acquires the N-1th state string corresponding to the index parameter.
所述第N-1状态字符串是针对第N-1次交易生成的。The N-1th status string is generated for the N-1th transaction.
步骤403:所述客户端将所述第N-1状态字符串和所述第N次交易的交易哈希值作为第N待加密数据。Step 403: The client uses the N-1th status string and the transaction hash value of the Nth transaction as the Nth data to be encrypted.
步骤404:所述客户端生成第N状态字符串,并根据所述第N状态字符串和所述索引参数的搜索令牌确定第N密钥和第N索引位置信息。Step 404: The client generates an Nth state string, and determines the Nth key and the Nth index position information according to the Nth state string and the search token of the index parameter.
步骤405:所述客户端使用所述第N密钥将所述第N待加密数据加密为第N密文,并建立所述第N索引位置信息和所述第N密文的唯一映射关系。Step 405: The client encrypts the Nth data to be encrypted into an Nth ciphertext by using the Nth key, and establishes a unique mapping relationship between the Nth index position information and the Nth ciphertext.
步骤401中,客户端指运行客户端前端软件的客户端主机。第N次交易中,N的计数是针对某一个事件及该事件的一个索引参数的具体参数值的。举例来说,第N次交易可以为转账事件在“from=A”的条件下的第N次触发对应的交易。当需要根据索引参数搜索交易日志时,可以为索引参数赋具体的值来搜索,举例来说,按照“form=A”搜索转账事件。In
上述步骤401~步骤405中,加密为第N密文的一种可选实施方式如下:In the
所述客户端将所述第N-1状态字符串和所述第N次交易的交易哈希值拼接后的字符串,作为所述第N待加密数据;按照预设位运算,将所述第N待加密数据与所述第N密钥的位运算结果,作为所述第N密文。举例来说,预设位运算为异或位运算。The client concatenates the N-1th state string and the transaction hash value of the Nth transaction as the Nth data to be encrypted; according to the preset bit operation, the A bit operation result of the Nth data to be encrypted and the Nth key is used as the Nth ciphertext. For example, the preset bit operation is an exclusive OR bit operation.
步骤404的一种可选实施方式如下:An optional implementation manner of
所述客户端将所述第N状态字符串和所述索引参数的搜索令牌按照第一预设哈希算法映射的结果,作为所述第N密钥;所述客户端将所述第N状态字符串和所述索引参数的搜索令牌按照第二预设哈希算法映射的结果,作为所述第N索引位置信息;所述第一哈希算法和所述第二哈希算法为不同的哈希算法。The client uses the result of mapping the Nth state string and the search token of the index parameter according to the first preset hash algorithm as the Nth key; the client uses the Nth The result of mapping the status string and the search token of the index parameter according to the second preset hash algorithm is used as the Nth index position information; the first hash algorithm and the second hash algorithm are different hash algorithm.
相应地,本申请实施例提供的一种交易哈希值的搜索方法的步骤如下:Correspondingly, the steps of a transaction hash value search method provided in the embodiment of the present application are as follows:
步骤501:索引服务器获取来自客户端的索引参数的搜索令牌和第N状态字符串。Step 501: The indexing server acquires the search token and the Nth status string of the indexing parameters from the client.
所述索引参数是从交易的交易信息中确定出用于进行交易日志搜索的关键词;所述第N状态字符串是用户在所述客户端上发起的第N次交易时生成的;N为正整数。The index parameter is determined from the transaction information of the transaction to be used for the keyword search of the transaction log; the Nth status character string is generated when the user initiates the Nth transaction on the client; N is positive integer.
步骤502:所述索引服务器根据所述索引参数的搜索令牌和所述第N状态字符串,获取所述索引参数的第N索引位置信息。Step 502: The index server obtains the Nth index position information of the index parameter according to the search token of the index parameter and the Nth status character string.
所述第N索引位置信息与第N密文唯一映射;所述第N密文是所述客户端对所述第N次交易的交易哈希值加密的密文。The Nth index position information is uniquely mapped to the Nth ciphertext; the Nth ciphertext is the ciphertext encrypted by the client to the transaction hash value of the Nth transaction.
步骤503:所述索引服务器根据所述第N索引位置信息,获取所述第N索引位置信息唯一映射的所述第N密文。Step 503: The index server obtains the Nth ciphertext uniquely mapped to the Nth index location information according to the Nth index location information.
步骤504:所述索引服务器根据所述搜索令牌和所述第N状态字符串,生成第N密钥。Step 504: The index server generates an Nth key according to the search token and the Nth state string.
所述索引服务器根据所述第N密钥将所述第N密文解密为第N待加密数据。The index server decrypts the Nth ciphertext into Nth data to be encrypted according to the Nth key.
步骤505:所述索引服务器根据所述第N待加密数据,提取出所述第N次交易时的交易哈希值,使得完成所述第N次交易时的交易哈希值的搜索。Step 505: The index server extracts the transaction hash value of the Nth transaction according to the Nth data to be encrypted, so as to complete the search for the transaction hash value of the Nth transaction.
需要说明的是,上述501~505中的搜索令牌、第N状态字符串、第N索引位置信息、第N密文、第N密钥和第N待加密数据。与步骤401~步骤404中的相对应。It should be noted that the search token, the Nth state character string, the Nth index position information, the Nth ciphertext, the Nth key and the Nth data to be encrypted in the above 501-505. Corresponding to
步骤505之后,还可以继续搜索第N-1次交易时的交易哈希值,具体实施方式如下:After
所述索引服务器根据所述第N待加密数据,提取出所述第N-1状态字符串;所述索引服务器根据所述索引参数的搜索令牌和所述第N-1状态字符串,获取所述索引参数的第N-1索引位置信息;所述索引服务器根据所述第N-1索引位置信息,获取所述第N-1索引位置信息唯一映射的第N-1密文;所述索引服务器根据所述搜索令牌和所述第N-1状态字符串,将所述第N-1密文解密为第N-1待加密数据;所述索引服务器根据所述第N-1待加密数据,提取出第N-1次交易时的交易哈希值,使得完成所述第N-1次交易时的交易哈希值的搜索。The index server extracts the N-1th state string according to the Nth data to be encrypted; the index server obtains the N-1th state string according to the search token of the index parameter and the N-1th state string The N-1th index position information of the index parameter; the index server obtains the N-1th ciphertext uniquely mapped to the N-1th index position information according to the N-1th index position information; the The index server decrypts the N-1th ciphertext into the N-1th data to be encrypted according to the search token and the N-1th status string; Encrypt the data, and extract the transaction hash value of the N-1th transaction, so that the search for the transaction hash value of the N-1th transaction is completed.
步骤504中,一种可选实施方式为:所述第N密文是所述待加密数据与所述第N密钥按照预设位运算的位运算结果;步骤504可以按以下步骤执行:In
所述索引服务器按照所述预设位运算,将所述第N密文与所述第N密钥的位运算结果,作为所述第N待加密数据。The index server calculates according to the preset bit, and uses the bit operation result of the Nth ciphertext and the Nth key as the Nth data to be encrypted.
下面通过具体例子,进一步说明本申请实施例提供的一种交易哈希值的存储和搜索方法。The following uses specific examples to further illustrate a method for storing and searching transaction hash values provided by the embodiment of the present application.
当事件触发时,交易哈希值的存储过程如下。需要说明的是,以下过程是针对一个事件的一个索引参数的过程:When the event is triggered, the storage process of the transaction hash value is as follows. It should be noted that the following process is for an index parameter of an event:
步骤401具体可以分为以下的第一步和第二步:Step 401 can be specifically divided into the following first step and second step:
第一步:将该事件中以indexed修饰的参数作为关键词w。Step 1: Use the parameter modified with indexed in the event as the keyword w.
具体来说,可以使用伪随机函数F,将长期密钥和关键词作为参数,计算其搜索令牌tw=F(k,w)。Specifically, a pseudo-random function F can be used to calculate the search token tw=F(k,w) with long-term keys and keywords as parameters.
例如在智能合约中定义了一个转账事件,event transfer(address indexedfrom,address indexed to,uint value)。当触发转账事件时,emit transfer("0x1111…ffffcccc","0x50…sd5adb20",100),即地址"0x1111…ffffcccc"向地址"0x50…sd5adb20"转账100eth。For example, a transfer event is defined in the smart contract, event transfer(address indexed from, address indexed to, uint value). When the transfer event is triggered, emit transfer("0x1111...ffffcccc", "0x50...sd5adb20", 100), that is, the address "0x1111...ffffcccc" transfers 100eth to the address "0x50...sd5adb20".
由于参数from和to被indexed修饰,表示用户希望将来能够以这两个参数作为关键词进行搜索(如过滤出所有地址为"0x1111…FFFFCCCC"的转账记录)。对两个索引参数的每一个参数都执行上述第一步:用户生成两个搜索令牌tw=F(k,"0x1111…ffffcccc")和tw=F(k,"0x50…sd5adb20")。Since the parameters from and to are modified by indexed, it means that the user hopes to search with these two parameters as keywords in the future (for example, filter out all transfer records whose address is "0x1111...FFFFCCCC"). The first step above is performed for each of the two index parameters: the user generates two search tokens t w =F(k,"0x1111...ffffcccc") and t w =F(k,"0x50...sd5adb20") .
第二步:用户获得交易的交易哈希值。Step 2: The user gets the transaction hash value of the transaction.
具体来说,在用户通过调用函数发起交易之后,会返回一个交易的交易哈希值,可以利用回调函数捕捉到该哈希值。该哈希值也可以手动计算出来,假设交易tx=[nonce,gasPrice,gas,to,value,data,v,r,s],其中nonce为随机数,gasPrice为当前gas的价格,gas为该交易可使用的最大gas数量限制,to为接收方地址(在本申请的场景中,可以是一个合约地址),value为交易发送的以太币数量,data为交易的数据,v,r和s可以代表椭圆曲线数字签名算法(elliptic curve digital signature,ECDSA)签名。在计算交易的哈希值时,首先对交易进行递归长度前缀(recursive length prefix,RLP)编码,然后对编码后的数据计算交易哈希值。举例来说,通过keccak256计算交易哈希值,即交易的哈希值简单表示为:hash(tx)=keccak256(rlp.encode(tx)),hash(tx)为2048比特的字符串。Specifically, after the user initiates a transaction by calling the function, a transaction hash value of the transaction will be returned, and the callback function can be used to capture the hash value. The hash value can also be calculated manually, assuming that the transaction tx=[nonce,gasPrice,gas,to,value,data,v,r,s], where nonce is a random number, gasPrice is the current gas price, and gas is the The maximum amount of gas that can be used in a transaction is limited, to is the address of the receiver (in the scenario of this application, it can be a contract address), value is the amount of ether sent by the transaction, data is the data of the transaction, v, r and s can be Represents an elliptic curve digital signature algorithm (elliptic curve digital signature, ECDSA) signature. When calculating the hash value of a transaction, the transaction is first encoded with a recursive length prefix (RLP), and then the encoded data is used to calculate the transaction hash value. For example, the transaction hash value is calculated by keccak256, that is, the transaction hash value is simply expressed as: hash(tx)=keccak256(rlp.encode(tx)), and hash(tx) is a 2048-bit string.
第三步:用户检查本地存储中是否有关于w的记录,执行步骤402。Step 3: The user checks whether there is a record about w in the local storage, and executes
步骤402分两种情况:Step 402 is divided into two situations:
第一种:如果没有关于w的记录,确定该索引参数是第一次出现,将预设的特殊符号⊥(代表该关键词第一次出现)作为第N-1状态字符串(图3中的stc)。The first type: if there is no record about w, it is determined that the index parameter is the first occurrence, and the preset special symbol ⊥ (representing the first occurrence of the keyword) is used as the N-1th state string (in Figure 3 of st c ).
第二种:如果有关于w的记录,确定该索引参数不是第一次出现,则将随机生成的字符串作为第N-1状态字符串。The second type: if there is a record about w, it is determined that the index parameter is not the first occurrence, and the randomly generated character string is used as the N-1th state character string.
状态字符串的长度可以通过系统参数λ设置,如λ=1024时,状态状态字符串是长度为1024的二进制串。The length of the status character string can be set by the system parameter λ, for example, when λ=1024, the status character string is a binary string with a length of 1024.
第四步:执行步骤403。Step 4: Step 403 is executed.
举例来说,将第N-1状态字符串与交易哈希值拼接得到第N待加密数据,即p=(⊥||hash(tx));或者将stc和交易的哈希值拼接得到第N待加密数据,即p=(stc||hash)。For example, concatenate the N-1th state string and the transaction hash value to obtain the Nth data to be encrypted, that is, p=(⊥||hash(tx)); or concatenate st c and the transaction hash value to obtain The Nth data to be encrypted, that is, p=(st c ||hash).
第五步:执行步骤404~步骤405。Step 5: Execute
举例来说,u=H1(tw||stc+1),u为第N索引位置信息,stc+1为第N状态字符串,H1为第一哈希算法。For example, u=H 1 (t w ||st c+1 ), u is the Nth index position information, st c+1 is the Nth state character string, and H 1 is the first hash algorithm.
计算第N密钥key=H2(tw||stc+1),使用预设位运算,如异或位运算待加密数据加密得到第N密文e(即长度不足时用0补齐)。这里的H2为第二哈希算法。Calculate the Nth key key=H 2 (t w ||st c+1 ), use the preset bit operation, such as XOR bit operation to encrypt the data to be encrypted to obtain the Nth ciphertext e (ie If the length is insufficient, fill it with 0). Here H 2 is the second hash algorithm.
H1和H2必须是两个不同的哈希函数,如H1为SHA256哈希函数,而H2为MD5哈希函数。 H1 and H2 must be two different hash functions, such as H1 is the SHA256 hash function, and H2 is the MD5 hash function.
第六步:用户将索引参数w对应的第N状态字符串stc+1存入用户的存储结构中,将(u,e)存储在索引服务器中。此时索引服务器的存储如图3所示,该图表示一个索引参数取一个具体参数值(如"0x1111…FFFFCCCC")的索引情况,其中每一个节点代表一个包含该参数值的日志。由于日志存储在交易的收据中,在本申请中每一个节点都保存一个该日志对应的交易哈希值hash(tx)。Step 6: The user stores the Nth state string st c+1 corresponding to the index parameter w into the user's storage structure, and stores (u, e) in the index server. At this time, the storage of the index server is shown in Figure 3, which shows the index situation where an index parameter takes a specific parameter value (such as "0x1111...FFFFCCCC"), and each node represents a log containing the parameter value. Since the log is stored in the transaction receipt, in this application each node saves a transaction hash value hash(tx) corresponding to the log.
交易哈希值的搜索过程如下。需要说明的是,以下过程是针对一个事件的一个索引参数的过程:The search process for the transaction hash value is as follows. It should be noted that the following process is for an index parameter of an event:
第一步:用户检查本地存储中是否有关于w的记录,如果没有,说明不存在关于该索引参数的日志,直接返回空。Step 1: The user checks whether there is a record about w in the local storage. If not, it means that there is no log about the index parameter, and returns empty directly.
第二步:如果有关于w的记录,则执行步骤501。Step 2: If there is a record about w, go to step 501.
具体来说,取出某个状态字符串,如stc。特殊地,stc为w最新的状态字符串。利用长期密钥计算搜索令牌tw=F(k,w),其中F是伪随机函数。客户端将tw和stc提交给索引服务器;Specifically, fetch a certain state string, such as st c . In particular, st c is the latest state string of w. The search token t w =F(k,w) is computed using the long-term key, where F is a pseudo-random function. The client submits t w and st c to the index server;
第三步:执行步骤502~步骤503。Step 3: Execute
举例来说,索引服务器在收到(tw,stc)后,通过u=H1(tw||stc-1)获得第N索引位置信息。取出关于stc的记录密文e。For example, after receiving (tw, stc), the index server obtains the Nth index position information through u=H 1 (t w ||st c-1 ). Take out the record ciphertext e about stc.
第四步:执行步骤504~步骤505。Step 4: Execute
对e进行解密,即H2(tw||stc)为第N密钥;p为第N待加密数据。其中p=(stc-1,hash(tx));hash(tx)即为满足条件的事件所生成的日志所在的交易的哈希值,将其存储在结果R中。Decrypt e, that is, H 2 (t w ||st c ) is the Nth key; p is the Nth data to be encrypted. Where p=(stc-1,hash(tx)); hash(tx) is the hash value of the transaction where the log generated by the event meeting the conditions is located, and it is stored in the result R.
第五步:获取索引参数的参数值对应的日志。Step 5: Obtain the log corresponding to the parameter value of the index parameter.
索引服务器利用stc-1计算下一个位置u=H1(tw||stc-1),取出相对应的密文。如果有,则继续循环操作步骤三,并更新R,最后将搜索结果R返回,R就是所有满足条件的交易哈希值的集合。The index server uses stc-1 to calculate the next position u=H 1 (t w ||st c-1 ), and takes out the corresponding ciphertext. If so, continue to loop through Step 3, update R, and finally return the search result R, which is the set of hash values of all transactions that meet the conditions.
用户在收到R之后,分别将R中的每个交易哈希值作为输入,使用相应的函数如(web3.eth.getTransactionReceipt)函数获得该交易的收据,进而获得具体的日志。After receiving R, the user takes each transaction hash value in R as input, and uses the corresponding function such as (web3.eth.getTransactionReceipt) function to obtain the receipt of the transaction, and then obtain the specific log.
如图6,本申请提供一种区块链中的交易哈希值存储装置,包括:获取模块601,用于获取用户在所述客户端上发起的第N次交易的交易哈希值和所述第N次交易的索引参数;所述索引参数是从交易的交易信息中确定出用于进行交易日志搜索的关键词;获取所述索引参数对应的第N-1状态字符串;所述第N-1状态字符串是针对第N-1次交易生成的;N为正整数;加密模块602,用于将所述第N-1状态字符串和所述第N次交易的交易哈希值作为第N待加密数据;生成第N状态字符串,并根据所述第N状态字符串和所述索引参数的搜索令牌确定第N密钥和第N索引位置信息;使用所述第N密钥将所述第N待加密数据加密为第N密文,并建立所述第N索引位置信息和所述第N密文的唯一映射关系。As shown in Figure 6, the present application provides a transaction hash value storage device in the block chain, including: an
一种可选实施方式中,所述加密模块602具体用于:将所述第N-1状态字符串和所述第N次交易的交易哈希值拼接后的字符串,作为所述第N待加密数据;按照预设位运算,将所述第N待加密数据与所述第N密钥的位运算结果,作为所述第N密文。In an optional implementation manner, the
一种可选实施方式中,所述加密模块602具体用于:将所述第N状态字符串和所述索引参数的搜索令牌按照第一预设哈希算法映射的结果,作为所述第N密钥;将所述第N状态字符串和所述索引参数的搜索令牌按照第二预设哈希算法映射的结果,作为所述第N索引位置信息;所述第一哈希算法和所述第二哈希算法为不同的哈希算法。In an optional implementation manner, the
如图7,本申请提供一种区块链中的交易哈希值存储装置,包括:获取模块701,用于获取来自客户端的索引参数的搜索令牌和第N状态字符串;所述索引参数是从交易的交易信息中确定出用于进行交易日志搜索的关键词;所述第N状态字符串是用户在所述客户端上发起的第N次交易时生成的;N为正整数;根据所述索引参数的搜索令牌和所述第N状态字符串,获取所述索引参数的第N索引位置信息;所述第N索引位置信息与第N密文唯一映射;所述第N密文是所述客户端对所述第N次交易的交易哈希值加密的密文;根据所述第N索引位置信息,获取所述第N索引位置信息唯一映射的所述第N密文;解密模块702,用于根据所述搜索令牌和所述第N状态字符串,生成第N密钥;根据所述第N密钥将所述第N密文解密为第N待加密数据;根据所述第N待加密数据,提取出所述第N次交易时的交易哈希值,使得完成所述第N次交易时的交易哈希值的搜索。As shown in Figure 7, the application provides a transaction hash value storage device in the block chain, including: an acquisition module 701, which is used to acquire the search token and the Nth state string of the index parameter from the client; the index parameter It is determined from the transaction information of the transaction that the keyword used for searching the transaction log is determined; the Nth status character string is generated when the user initiates the Nth transaction on the client; N is a positive integer; according to The search token of the index parameter and the Nth state character string are used to obtain the Nth index position information of the index parameter; the Nth index position information is uniquely mapped to the Nth ciphertext; the Nth ciphertext is the ciphertext encrypted by the client to the transaction hash value of the Nth transaction; according to the Nth index location information, obtain the Nth ciphertext uniquely mapped to the Nth index location information; decrypt Module 702, configured to generate an Nth key according to the search token and the Nth state character string; decrypt the Nth ciphertext into Nth data to be encrypted according to the Nth key; For the Nth data to be encrypted, the transaction hash value at the time of the Nth transaction is extracted, so that the search for the transaction hash value at the time of the Nth transaction is completed.
一种可选实施方式中,所述获取模块701还用于:根据所述第N待加密数据,提取出所述第N-1状态字符串;根据所述索引参数的搜索令牌和所述第N-1状态字符串,获取所述索引参数的第N-1索引位置信息;根据所述第N-1索引位置信息,获取所述第N-1索引位置信息唯一映射的第N-1密文;所述解密模块702还用于:根据所述搜索令牌和所述第N-1状态字符串,将所述第N-1密文解密为第N-1待加密数据;根据所述第N-1待加密数据,提取出第N-1次交易时的交易哈希值,使得完成所述第N-1次交易时的交易哈希值的搜索。In an optional implementation manner, the acquiring
一种可选实施方式中,所述第N密文是所述待加密数据与所述第N密钥按照预设位运算的位运算结果;所述索引服务器根据所述第N密钥将所述第N密文解密为第N待加密数据:所述索引服务器按照所述预设位运算,将所述第N密文与所述第N密钥的位运算结果,作为所述第N待加密数据。In an optional implementation manner, the Nth ciphertext is a bit operation result of the data to be encrypted and the Nth key according to a preset bit operation; the index server converts the Nth key to the The Nth ciphertext is decrypted into the Nth data to be encrypted: the index server calculates according to the preset bit, and uses the bit operation result of the Nth ciphertext and the Nth key as the Nth data to be encrypted Encrypt data.
本申请实施例提供一种计算机设备,包括程序或指令,当所述程序或指令被执行时,用以执行本申请实施例提供的一种区块链中的交易哈希值存储或搜索方法及任一可选方法。An embodiment of the present application provides a computer device, including a program or an instruction. When the program or instruction is executed, it is used to execute a transaction hash value storage or search method in the blockchain provided by the embodiment of the present application and Either method is optional.
本申请实施例提供一种存储介质,包括程序或指令,当所述程序或指令被执行时,用以执行本申请实施例提供的一种区块链中的交易哈希值存储或搜索方法及任一可选方法。An embodiment of the present application provides a storage medium, including a program or an instruction. When the program or instruction is executed, it is used to execute a transaction hash value storage or search method in the blockchain provided by the embodiment of the present application and Either method is optional.
最后应说明的是:本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、光学存储器等)上实施的计算机程序产品的形式。Finally, it should be noted that those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the present application. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Apparently, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. In this way, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims (12)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910949539.4A CN110689349B (en) | 2019-10-08 | 2019-10-08 | Method and device for storing and searching transaction hash value in blockchain |
| PCT/CN2020/116236 WO2021068726A1 (en) | 2019-10-08 | 2020-09-18 | Method and device for storing and searching for transaction hash value in blockchain |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910949539.4A CN110689349B (en) | 2019-10-08 | 2019-10-08 | Method and device for storing and searching transaction hash value in blockchain |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN110689349A CN110689349A (en) | 2020-01-14 |
| CN110689349B true CN110689349B (en) | 2023-07-11 |
Family
ID=69111740
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910949539.4A Active CN110689349B (en) | 2019-10-08 | 2019-10-08 | Method and device for storing and searching transaction hash value in blockchain |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110689349B (en) |
| WO (1) | WO2021068726A1 (en) |
Families Citing this family (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110689349B (en) * | 2019-10-08 | 2023-07-11 | 深圳前海微众银行股份有限公司 | Method and device for storing and searching transaction hash value in blockchain |
| CN111526047B (en) * | 2020-04-15 | 2022-11-08 | 杭州溪塔科技有限公司 | Block chain-based message queue design method and device |
| CN114116367B (en) * | 2020-08-25 | 2022-11-01 | 荣耀终端有限公司 | Method for generating log and electronic equipment |
| CN112711648B (en) * | 2020-12-23 | 2024-07-02 | 航天信息股份有限公司 | Database character string ciphertext storage method, electronic equipment and medium |
| CN112765271B (en) * | 2020-12-31 | 2023-02-07 | 杭州趣链科技有限公司 | Block chain transaction index storage method and device, computer equipment and medium |
| CN113468571B (en) * | 2021-07-15 | 2023-05-12 | 湖北央中巨石信息技术有限公司 | Source tracing method based on block chain |
| CN115730006A (en) * | 2021-08-30 | 2023-03-03 | 杭州时戳信息科技有限公司 | Intelligent contract deployment method and device and computer readable storage medium |
| CN114491613B (en) * | 2021-11-11 | 2024-04-16 | 北京航空航天大学 | Efficient and searchable proxy privacy set intersection method and device |
| CN114726865B (en) * | 2022-03-29 | 2024-05-31 | 杭州安恒信息技术股份有限公司 | Data pledge method, system, electronic device and storage medium |
| CN114710357B (en) * | 2022-04-12 | 2023-07-21 | 河北大学 | A Dynamically Searchable Encryption Method Supporting Block Verification in Editable Blockchain |
| CN115225258B (en) * | 2022-09-19 | 2023-01-06 | 中电科新型智慧城市研究院有限公司 | A security management method and system for cross-domain trusted data based on blockchain |
| KR102748322B1 (en) * | 2023-05-31 | 2024-12-31 | 한국전자통신연구원 | Method and apparatus for generating partial index based on encryption key in blockchain platform and retrieving data using the partial index |
| CN117077179B (en) * | 2023-10-11 | 2024-01-02 | 中国移动紫金(江苏)创新研究院有限公司 | Searchable encryption method, device, equipment and medium based on differential privacy ranking |
| CN117574413B (en) * | 2024-01-17 | 2024-04-05 | 杭州易靓好车互联网科技有限公司 | Dynamic encryption protection method for vehicle transaction client information |
| CN118394714B (en) * | 2024-06-26 | 2024-08-23 | 湖南交通物流信息服务有限公司 | A method for quickly building and storing encrypted file indexes |
| CN119739786B (en) * | 2024-12-09 | 2025-05-16 | 北京律数科技有限公司 | Big data analysis method and system based on blockchain |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2015055762A1 (en) * | 2013-10-18 | 2015-04-23 | Robert Bosch Gmbh | System and method for dynamic, non-interactive, and parallelizable searchable symmetric encryption |
| WO2015108052A1 (en) * | 2014-01-16 | 2015-07-23 | 株式会社日立ソリューションズ | Retrievable cryptograph processing system and retrievable cryptograph processing method |
| US9946720B1 (en) * | 2015-12-04 | 2018-04-17 | Ionu Security, Inc. | Searching data files using a key map |
Family Cites Families (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106610995B (en) * | 2015-10-23 | 2020-07-07 | 华为技术有限公司 | A method, device and system for creating ciphertext index |
| CN109218010B (en) * | 2017-07-04 | 2021-11-30 | 阿波罗智能技术(北京)有限公司 | Data encryption method and device and data decryption method and device |
| US10565192B2 (en) * | 2017-08-01 | 2020-02-18 | International Business Machines Corporation | Optimizing queries and other retrieve operations in a blockchain |
| US10848321B2 (en) * | 2017-11-03 | 2020-11-24 | Mastercard International Incorporated | Systems and methods for authenticating a user based on biometric and device data |
| CN108573741A (en) * | 2017-12-25 | 2018-09-25 | 北京金山云网络技术有限公司 | Business data recording method, device, equipment and storage medium |
| CN108389059A (en) * | 2018-02-26 | 2018-08-10 | 成都大学 | Digital copyrighted work protection, transaction and distributing method based on ownership and system |
| FR3079324B1 (en) * | 2018-03-22 | 2020-04-10 | Sagemcom Energy & Telecom Sas | DATA MANAGEMENT METHODS AND SYSTEM FOR TEMPORAL DATA CONTROL |
| CN109936457B (en) * | 2019-02-20 | 2022-04-26 | 深圳前海微众银行股份有限公司 | Block chain multi-party witness method, device, equipment and computer readable storage medium |
| CN109815723A (en) * | 2019-02-28 | 2019-05-28 | 东北大学 | A searchable encryption system and method based on suffix tree |
| CN110245489B (en) * | 2019-05-20 | 2021-04-27 | 创新先进技术有限公司 | Receipt storage method, node and system based on plaintext log |
| CN110689349B (en) * | 2019-10-08 | 2023-07-11 | 深圳前海微众银行股份有限公司 | Method and device for storing and searching transaction hash value in blockchain |
-
2019
- 2019-10-08 CN CN201910949539.4A patent/CN110689349B/en active Active
-
2020
- 2020-09-18 WO PCT/CN2020/116236 patent/WO2021068726A1/en not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2015055762A1 (en) * | 2013-10-18 | 2015-04-23 | Robert Bosch Gmbh | System and method for dynamic, non-interactive, and parallelizable searchable symmetric encryption |
| WO2015108052A1 (en) * | 2014-01-16 | 2015-07-23 | 株式会社日立ソリューションズ | Retrievable cryptograph processing system and retrievable cryptograph processing method |
| US9946720B1 (en) * | 2015-12-04 | 2018-04-17 | Ionu Security, Inc. | Searching data files using a key map |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110689349A (en) | 2020-01-14 |
| WO2021068726A1 (en) | 2021-04-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110689349B (en) | Method and device for storing and searching transaction hash value in blockchain | |
| US10699006B1 (en) | Processing and storing blockchain data under a trusted execution environment | |
| US12309127B2 (en) | End-to-end secure operations using a query vector | |
| CN111295650B (en) | Perform mapping iterations in blockchain-based systems | |
| US8533489B2 (en) | Searchable symmetric encryption with dynamic updating | |
| CN112131227B (en) | A data query method and device based on alliance chain | |
| US11251969B2 (en) | Performing map iterations in a blockchain-based system | |
| WO2020224489A1 (en) | Blockchain-based bank data sharing method and related apparatus | |
| CN109936620B (en) | Block chain-based storage method, device, system and storage medium | |
| CN107995299A (en) | A Blind Storage Method Against Access Pattern Leakage in Cloud Environment | |
| US10476661B2 (en) | Polynomial-based homomorphic encryption | |
| CN111798236B (en) | Transaction data encryption and decryption methods, devices and equipment | |
| FR3107416A1 (en) | EFFECTIVE RANDOM TOKENIZATION IN A DEMATERIALIZED ENVIRONMENT | |
| CN112000632A (en) | Ciphertext sharing method, medium, sharing client and system | |
| Hoang et al. | A multi-server oblivious dynamic searchable encryption framework | |
| CN112182109A (en) | Distributed data coding storage method based on block chain and electronic equipment | |
| CN112202555B (en) | Information processing method, device and equipment for generating random number based on information attribute | |
| WO2024239434A1 (en) | Data processing method, system and apparatus, and storage medium | |
| CN117150092A (en) | Anonymous inquiry methods, devices, equipment, media and products | |
| HK40030391B (en) | Performing map iterations in a blockchain-based system | |
| HK40031023A (en) | Performing map iterations in a blockchain-based system | |
| HK40030391A (en) | Performing map iterations in a blockchain-based system | |
| CN119808112A (en) | Data processing method, device, electronic device and storage medium | |
| HK40021553B (en) | Method, apparatus, device and medium for storing private data | |
| HK40017316B (en) | Parallel execution of transactions in blockchain network |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |