CN114297721A - Information processing method, information processing apparatus, block chain platform, and storage medium - Google Patents
Information processing method, information processing apparatus, block chain platform, and storage medium Download PDFInfo
- Publication number
- CN114297721A CN114297721A CN202210089865.4A CN202210089865A CN114297721A CN 114297721 A CN114297721 A CN 114297721A CN 202210089865 A CN202210089865 A CN 202210089865A CN 114297721 A CN114297721 A CN 114297721A
- Authority
- CN
- China
- Prior art keywords
- ciphertext
- account
- value
- account value
- public key
- 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.)
- Granted
Links
- 230000010365 information processing Effects 0.000 title claims abstract description 37
- 238000003672 processing method Methods 0.000 title claims abstract description 26
- 238000011156 evaluation Methods 0.000 claims abstract description 63
- 238000000034 method Methods 0.000 claims abstract description 27
- 230000006870 function Effects 0.000 claims description 121
- 238000012545 processing Methods 0.000 claims description 13
- 238000004422 calculation algorithm Methods 0.000 description 48
- 238000010586 diagram Methods 0.000 description 14
- 238000004590 computer program Methods 0.000 description 7
- 238000004364 calculation method Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 238000013524 data verification Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Landscapes
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
本申请实施例公开了一种信息处理方法,方法包括:接收目标用户与其他用户之间的交易信息;其中,交易信息包括账户变化值;从区块链中获取目标用户的第一账本信息;其中,第一账本信息包括第一密文账户值和目标用户的第一公钥,第一密文账户值是目标用户用第一公钥对目标用户的前一次交易信息进行加密后得到的;用第一公钥对账户变化值进行加密得到第一密文账户变化值;基于第一密文账户值、第一密文账户变化值和第一评估函数确定第二密文账户值,并将第二密文账户值记录于区块链中,以使目标用户用与第一公钥对应的第一私钥对第二密文账户值进行解密得到第一明文账户值;其中,第一公钥和第一私钥根据同态加密参数生成。
The embodiment of the present application discloses an information processing method, the method includes: receiving transaction information between a target user and other users; wherein, the transaction information includes an account change value; obtaining first account book information of the target user from a blockchain; Wherein, the first ledger information includes a first ciphertext account value and a first public key of the target user, and the first ciphertext account value is obtained after the target user encrypts the previous transaction information of the target user with the first public key; Encrypt the account change value with the first public key to obtain the first ciphertext account change value; determine the second ciphertext account value based on the first ciphertext account value, the first ciphertext account change value and the first evaluation function, and use The second ciphertext account value is recorded in the blockchain, so that the target user decrypts the second ciphertext account value with the first private key corresponding to the first public key to obtain the first plaintext account value; The key and the first private key are generated according to the homomorphic encryption parameters.
Description
技术领域technical field
本申请涉及但不限于计算机技术领域,尤其涉及一种信息处理方法、信息处理装置、区块链平台和存储介质。This application relates to, but is not limited to, the field of computer technology, and in particular, relates to an information processing method, an information processing device, a blockchain platform, and a storage medium.
背景技术Background technique
区块链技术一般分为公有链和许可链,许可链又可以根据数据维护方是否为单一个体分成联盟链和私有链。公有链上的数据公开共享,而在许可链内部,数据虽然共享,但是其中保护的信息往往根据商业需求,对某些参与方开放而对另一些参与方保密。在隐私保护领域,随着欧盟2018提出的《通用数据保护条例》(General Data ProtectionRegulation,GDPR)需求,对数据的拥有方也提出了必须提供数据保护的要求。而联盟链领域的数据保护问题一直是有待解决的关键问题。Blockchain technology is generally divided into public chain and license chain, and license chain can be divided into alliance chain and private chain according to whether the data maintainer is a single individual. The data on the public chain is publicly shared, while in the permissioned chain, although the data is shared, the protected information is often open to some participants and kept secret to others according to business needs. In the field of privacy protection, with the requirements of the General Data Protection Regulation (GDPR) proposed by the European Union in 2018, data owners also have to provide data protection requirements. The data protection problem in the field of alliance chain has always been a key problem to be solved.
相关技术中,对联盟链上的数据保护的方法通过哈希上链的方式,由于哈希上链的交易在用户侧发生,只需要将交易后的结果的散列值即哈希数据保存在区块链上,以实现数据的不可见。然而,该方法中的哈希数据只能作为存证,当进行交易时仍需要原始明文数据,没有真正实现数据的保护。可见,目前亟需提供一种用于联盟链的数据的隐私保护的信息处理方法。In the related art, the data protection method on the alliance chain is through the method of hashing on the chain. Since the transaction on the hashing chain occurs on the user side, it is only necessary to save the hash value of the result of the transaction, that is, the hash data. On the blockchain to achieve data invisibility. However, the hash data in this method can only be used as a deposit certificate, and the original plaintext data is still required when conducting transactions, and data protection is not really realized. It can be seen that there is an urgent need to provide an information processing method for privacy protection of data in a consortium chain.
发明内容SUMMARY OF THE INVENTION
本申请实施例期望提供一种信息处理方法、信息处理装置、区块链平台和存储介质。The embodiments of the present application are expected to provide an information processing method, an information processing apparatus, a blockchain platform, and a storage medium.
本申请的技术方案是这样实现的:The technical solution of the present application is realized as follows:
第一方面,一种信息处理方法,应用于区块链的第一节点,所述方法包括:In a first aspect, an information processing method is applied to a first node of a blockchain, the method comprising:
接收目标用户与其他用户之间的交易信息;其中,所述交易信息包括账户变化值;Receive transaction information between the target user and other users; wherein the transaction information includes an account change value;
从所述区块链中获取所述目标用户的第一账本信息;其中,所述第一账本信息包括第一密文账户值和所述目标用户的第一公钥,所述第一密文账户值是所述目标用户用所述第一公钥对所述目标用户的前一次交易信息进行加密后得到的;Obtain the first ledger information of the target user from the blockchain; wherein the first ledger information includes a first ciphertext account value and the first public key of the target user, the first ciphertext The account value is obtained after the target user encrypts the previous transaction information of the target user with the first public key;
用所述第一公钥对所述账户变化值进行加密得到第一密文账户变化值;Encrypting the account change value with the first public key to obtain the first ciphertext account change value;
基于所述第一密文账户值、所述第一密文账户变化值和第一评估函数确定第二密文账户值,并将所述第二密文账户值记录于所述区块链中,以使所述目标用户用与所述第一公钥对应的第一私钥对所述第二密文账户值进行解密得到第一明文账户值;其中,所述第一公钥和所述第一私钥根据同态加密参数生成,所述第一评估函数包括运算函数。Determine a second ciphertext account value based on the first ciphertext account value, the first ciphertext account change value and the first evaluation function, and record the second ciphertext account value in the blockchain , so that the target user decrypts the second ciphertext account value with the first private key corresponding to the first public key to obtain the first plaintext account value; wherein the first public key and the The first private key is generated according to the homomorphic encryption parameters, and the first evaluation function includes an operation function.
第二方面,一种信息处理装置,所述装置包括:In a second aspect, an information processing apparatus, the apparatus includes:
接收模块,用于接收目标用户与其他用户之间的交易信息;其中,所述交易信息包括账户变化值;a receiving module for receiving transaction information between the target user and other users; wherein the transaction information includes account change values;
获取模块,用于从区块链中获取所述目标用户的第一账本信息;其中,所述第一账本信息包括第一密文账户值和所述目标用户的第一公钥,所述第一密文账户值是所述目标用户用所述第一公钥对所述目标用户的前一次交易信息进行加密后得到的;an acquisition module, configured to acquire the first account book information of the target user from the blockchain; wherein, the first account book information includes a first ciphertext account value and the first public key of the target user, the first account book information A ciphertext account value is obtained after the target user encrypts the previous transaction information of the target user with the first public key;
处理模块,用于用所述第一公钥对所述账户变化值进行加密得到第一密文账户变化值;基于所述第一密文账户值、所述第一密文账户变化值和第一评估函数确定第二密文账户值,并将所述第二密文账户值记录于所述区块链中,以使所述目标用户用与所述第一公钥对应的第一私钥对所述第二密文账户值进行解密得到第一明文账户值;其中,所述第一公钥和所述第一私钥根据同态加密参数生成,所述第一评估函数包括运算函数。A processing module, configured to encrypt the account change value with the first public key to obtain a first ciphertext account change value; based on the first ciphertext account value, the first ciphertext account change value and the first ciphertext account change value An evaluation function determines a second ciphertext account value, and records the second ciphertext account value in the blockchain, so that the target user can use the first private key corresponding to the first public key Decrypting the second ciphertext account value to obtain a first plaintext account value; wherein the first public key and the first private key are generated according to homomorphic encryption parameters, and the first evaluation function includes an operation function.
第三方面,一种区块链平台,所述区块链平台包括:In a third aspect, a blockchain platform, the blockchain platform includes:
存储器,用于存储可执行指令;memory for storing executable instructions;
处理器,用于执行所述存储器中存储的可执行指令,实现上述所述的信息处理方法。The processor is configured to execute the executable instructions stored in the memory to implement the above-mentioned information processing method.
第四方面,一种存储介质,所述存储介质存储有一个或者多个程序,一个或者多个程序可被一个或者多个处理器执行,以实现上述所述的信息处理方法。In a fourth aspect, a storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the above-mentioned information processing method.
本申请实施例所提供的信息处理方法、信息处理装置、区块链平台和存储介质,通过接收目标用户与其他用户之间的交易信息;其中,交易信息包括账户变化值;从区块链中获取目标用户的第一账本信息;其中,第一账本信息包括第一密文账户值和目标用户的第一公钥,第一密文账户值是目标用户用第一公钥对目标用户的前一次交易信息进行加密后得到的;用第一公钥对账户变化值进行加密得到第一密文账户变化值;基于第一密文账户值、第一密文账户变化值和第一评估函数确定第二密文账户值,并将第二密文账户值记录于区块链中,以使目标用户用与第一公钥对应的第一私钥对第二密文账户值进行解密得到第一明文账户值;其中,第一公钥和第一私钥根据同态加密参数生成,第一评估函数包括运算函数;如此,实现了区块链节点对密文数据进行操作的过程中,不会泄露数据的原始信息,实现了数据之间的隐私运算。The information processing method, information processing device, blockchain platform and storage medium provided by the embodiments of this application receive transaction information between the target user and other users; wherein the transaction information includes account change values; Obtain the first account book information of the target user; wherein, the first account book information includes the first ciphertext account value and the first public key of the target user, and the first ciphertext account value is the first ciphertext account value of the target user to the target user with the first public key. Obtained after encrypting one transaction information; encrypting the account change value with the first public key to obtain the first ciphertext account change value; determined based on the first ciphertext account value, the first ciphertext account change value and the first evaluation function The second ciphertext account value, and the second ciphertext account value is recorded in the blockchain, so that the target user decrypts the second ciphertext account value with the first private key corresponding to the first public key to obtain the first ciphertext account value. Plaintext account value; wherein, the first public key and the first private key are generated according to homomorphic encryption parameters, and the first evaluation function includes an operation function; in this way, it is realized that during the operation of the ciphertext data by the blockchain node, no The original information of the data is leaked, and the privacy operation between the data is realized.
附图说明Description of drawings
图1为本申请的实施例提供的信息处理方法的一种可选的流程示意图;FIG. 1 is an optional schematic flowchart of an information processing method provided by an embodiment of the present application;
图2为本申请的实施例提供的向第一节点发送消息的一种可选的示意图;FIG. 2 is an optional schematic diagram of sending a message to a first node according to an embodiment of the present application;
图3为本申请的实施例提供的信息处理方法的一种可选的流程示意图;3 is an optional schematic flowchart of an information processing method provided by an embodiment of the present application;
图4为本申请的实施例提供的信息处理方法的一种可选的流程示意图;FIG. 4 is an optional schematic flowchart of an information processing method provided by an embodiment of the present application;
图5为本申请的实施例提供的密文更新的一种可选的结构示意图;5 is a schematic structural diagram of an optional ciphertext update provided by an embodiment of the present application;
图6为本申请的实施例提供的信息处理方法的一种可选的流程示意图;FIG. 6 is an optional schematic flowchart of an information processing method provided by an embodiment of the present application;
图7为本申请的实施例提供的信息处理方法的一种可选的流程示意图;FIG. 7 is an optional schematic flowchart of an information processing method provided by an embodiment of the present application;
图8为本申请的实施例提供的信息处理方法的一种可选的流程示意图;FIG. 8 is an optional schematic flowchart of an information processing method provided by an embodiment of the present application;
图9为本申请的实施例提供的联合运算的一种可选的示意图;FIG. 9 is an optional schematic diagram of a joint operation provided by an embodiment of the present application;
图10为本申请的实施例提供的一种信息处理装置的结构示意图;FIG. 10 is a schematic structural diagram of an information processing apparatus according to an embodiment of the present application;
图11为本申请的实施例提供的一种区块链平台的结构示意图。。FIG. 11 is a schematic structural diagram of a blockchain platform provided by an embodiment of this application. .
具体实施方式Detailed ways
为了使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请作进一步地详细描述,所描述的实施例不应视为对本申请的限制,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be described in further detail below with reference to the accompanying drawings. All other embodiments obtained under the premise of creative work fall within the scope of protection of the present application.
在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" can be the same or a different subset of all possible embodiments, and Can be combined with each other without conflict.
在以下的描述中,所涉及的术语“第一\第二\第三”仅仅是是区别类似的对象,不代表针对对象的特定排序,可以理解地,“第一\第二\第三”在允许的情况下可以互换特定的顺序或先后次序,以使这里描述的本申请实施例能够以除了在这里图示或描述的以外的顺序实施。In the following description, the term "first\second\third" is only used to distinguish similar objects, and does not represent a specific ordering of objects. It is understood that "first\second\third" Where permitted, the specific order or sequence may be interchanged to enable the embodiments of the application described herein to be practiced in sequences other than those illustrated or described herein.
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本申请实施例的目的,不是旨在限制本申请。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application, and are not intended to limit the present application.
本申请的实施例提供一种信息处理方法,应用于区块链的第一节点,参照图1所示,该方法包括以下步骤:The embodiment of the present application provides an information processing method, which is applied to the first node of the blockchain. Referring to FIG. 1 , the method includes the following steps:
步骤101、接收目标用户与其他用户之间的交易信息。Step 101: Receive transaction information between the target user and other users.
其中,交易信息包括账户变化值。这里,账户变化值可以是目标用户的账户变化值,账户变化值也可以是其他用户的账户变化值,账户变化值还可以是与目标用户和其他用户不同的用户的账户变化值,对此,本申请不做具体限制。需要说明的是,在本申请实施例中,账户变化值为目标用户的账户变化值。The transaction information includes account change values. Here, the account change value may be the account change value of the target user, the account change value may also be the account change value of other users, and the account change value may also be the account change value of a user different from the target user and other users. This application does not make specific restrictions. It should be noted that, in this embodiment of the present application, the account change value is the account change value of the target user.
本申请实施例中,目标用户为增加账户值的用户,即转入一定账户值的用户;目标用户还可以为减少账户值的用户,即转出一定账户值的用户。In the embodiment of the present application, the target user is a user who increases the account value, that is, a user who transfers a certain account value; the target user can also be a user who reduces the account value, that is, a user who transfers a certain account value.
本申请实施例中,区块链的第一节点基于目标账户的原始账户值与账户变化值确定目标用户的变化后的账户值。In the embodiment of the present application, the first node of the blockchain determines the changed account value of the target user based on the original account value and the account change value of the target account.
这里,交易信息可以是区块链平台生成的,交易信息也可以是目标用户、其他用户或区块链上层指定的用户X生成并发送给区块链的第一节点的,对此本身不做具体限制。Here, the transaction information can be generated by the blockchain platform, and the transaction information can also be generated by the target user, other users or the user X specified by the upper layer of the blockchain and sent to the first node of the blockchain, which does not do anything by itself. specific restrictions.
本申请实施例中,交易信息还可以包括目标用户的第一标识和其他用户的第二标识,即交易信息可以表示为Tran(IDA,IDB,value),其中,IDA表示目标用户的第一标识,IDB表示其他用户的第二标识,value表示账户变化值。这里,目标用户与其他用户之间的交易信息还可以以合约的形式被提交到区块链的第一节点。In the embodiment of this application, the transaction information may also include the first identifier of the target user and the second identifiers of other users, that is, the transaction information may be represented as Tran(ID A , ID B , value), where ID A represents the target user's The first identifier, ID B represents the second identifier of other users, and value represents the account change value. Here, the transaction information between the target user and other users can also be submitted to the first node of the blockchain in the form of a contract.
在实际应用中,区块链包括公有链、私有链和联盟链;其中,公有链对所有用户开放,故公有链上的数据信息即账本信息可以公开共享;私有链对被授予写入权限的用户开放,故私有链上的数据信息即账本信息对授予写入权限的用户无需进行数据验证即可访问,具有很高的信任度;联盟链对参与管理的用户授予一定权限,需要对联盟链中各成员之间的数据信息即账本信息的隐私保护,以提升各成员之间的信任程度。本申请实施例提供的信息处理方法,应用于联盟链,以实现联盟链中各成员之间数据信息在交易过程中的数据的隐私保护的问题。In practical applications, blockchain includes public chain, private chain and alliance chain; among them, the public chain is open to all users, so the data information on the public chain, that is, the ledger information, can be shared publicly; Users are open, so the data information on the private chain, that is, the ledger information, can be accessed by users who have been granted write permission without data verification, which has a high degree of trust; the alliance chain grants certain permissions to users participating in management, and needs to be authorized by the alliance chain. The data information among the members of the PBX is the privacy protection of the ledger information, so as to enhance the trust between the members. The information processing method provided by the embodiment of the present application is applied to the consortium chain, so as to realize the privacy protection of the data in the transaction process of the data information among the members of the consortium chain.
本申请实施例中,第一节点为区块链包括的多个节点中的任一节点。In this embodiment of the present application, the first node is any node among multiple nodes included in the blockchain.
步骤102、从区块链中获取目标用户的第一账本信息。Step 102: Obtain the first ledger information of the target user from the blockchain.
其中,第一账本信息包括第一密文账户值和目标用户的第一公钥,第一密文账户值是目标用户用第一公钥对目标用户的前一次交易信息进行加密后得到的。The first ledger information includes a first ciphertext account value and a first public key of the target user, and the first ciphertext account value is obtained after the target user encrypts the previous transaction information of the target user with the first public key.
本申请实施例中,第一公钥是目标用户基于给定的同态加密参数,通过密钥生成算法生成加密所需的密钥,这里,目标用户基于给定的同态加密参数通过密钥生成算法生成加密所需的同态密钥,包括第一公钥和第一私钥,且第一私钥与第一公钥对应。示例性的,目标用户基于给定的同态加密参数λ,由密钥生成算法KeyGen(1λ)生成第一公钥PKA和第一私钥skA。需要说明的是,根据所选的加密和解密算法的不同,所需要的同态加密参数也不同,对于加密和解密算法,本申请不做具体限定。In the embodiment of the present application, the first public key is the key required for encryption generated by the target user through the key generation algorithm based on the given homomorphic encryption parameters. Here, the target user passes the key based on the given homomorphic encryption parameters The generation algorithm generates a homomorphic key required for encryption, including a first public key and a first private key, and the first private key corresponds to the first public key. Exemplarily, based on a given homomorphic encryption parameter λ, the target user generates the first public key PK A and the first private key sk A by the key generation algorithm KeyGen(1 λ ). It should be noted that, according to different encryption and decryption algorithms selected, the required homomorphic encryption parameters are also different, and this application does not specifically limit the encryption and decryption algorithms.
本申请实施例中,区块链的第一节点接收目标用户与其他用户之间的交易信息之后,从区块链中获取目标用户包括第一密文账户值和第一公钥的第一账本信息。In the embodiment of this application, after receiving the transaction information between the target user and other users, the first node of the blockchain obtains the first ledger of the target user including the first ciphertext account value and the first public key from the blockchain information.
本申请其他实施例中,第一账本信息还可以包括目标用户的第一标识。区块链的第一节点接收目标用户与其他用户之间的交易信息之后,基于交易信息包括的目标用户的第一标识,从区块链中获取与第一标识对应的第一账本信息。In other embodiments of the present application, the first ledger information may further include the first identifier of the target user. After receiving the transaction information between the target user and other users, the first node of the blockchain obtains the first ledger information corresponding to the first identification from the blockchain based on the first identification of the target user included in the transaction information.
步骤103、用第一公钥对账户变化值进行加密得到第一密文账户变化值。Step 103: Encrypt the account change value with the first public key to obtain the first ciphertext account change value.
本申请实施例中,区块链的第一节点从区块链中获取目标用户的第一账本信息的情况下,获取第一账本信息中的第一公钥。进一步地,通过加密算法利用第一公钥对交易信息中的账户变化值进行加密,得到第一密文账户变化值,以使第一节点利用同态下的评估算法,对同一密钥加密得到的至少两个密文值进行联合运算。In the embodiment of the present application, when the first node of the blockchain obtains the first account book information of the target user from the blockchain, it obtains the first public key in the first account book information. Further, the first public key is used to encrypt the account change value in the transaction information through the encryption algorithm to obtain the first ciphertext account change value, so that the first node uses the evaluation algorithm under homomorphism to encrypt the same key and obtain at least two ciphertext values of .
步骤104、基于第一密文账户值、第一密文账户变化值和第一评估函数确定第二密文账户值,并将第二密文账户值记录于区块链中,以使目标用户用与第一公钥对应的第一私钥对第二密文账户值进行解密得到第一明文账户值。Step 104: Determine the second ciphertext account value based on the first ciphertext account value, the first ciphertext account change value and the first evaluation function, and record the second ciphertext account value in the blockchain, so that the target user Decrypt the second ciphertext account value with the first private key corresponding to the first public key to obtain the first plaintext account value.
其中,第一公钥和第一私钥根据同态加密参数生成;第一评估函数包括运算函数。The first public key and the first private key are generated according to homomorphic encryption parameters; the first evaluation function includes an operation function.
本申请实施例中,运算函数包括但不限于加法运算函数、减法运算函数、乘法运算函数、除法运算函数和平均运算函数。In the embodiments of the present application, the operation functions include, but are not limited to, an addition operation function, a subtraction operation function, a multiplication operation function, a division operation function, and an average operation function.
本申请实施例中,评估函数可以理解为用同一公钥进行加密得到的至少两个密文值进行组合,并通过评估函数中包括的特定函数如运算函数,形成新的密文值,以通过与公钥对应的私钥对新的密文值进行解密后得到运算后的新的明文值。示例性的,评估算法为Eval(F,ct1,ct2,…,ctn),评估算法将n个密文ct1,ct2,…,ctn组合起来,通过一个运算函数F,形成新的密文ct’且ct’=F(ct1,ct2,…,ctn)。由于同态加密的性质保证了Dec(sk,ct’)=F(m1,m2,…,mn),即通过解密函数Dec函数,使用私钥sk将新的密文ct’进行同态解密,得到密文ct1对应的明文m1,密文ct2对应的明文m2,以及密文ctn对应的明文mn,并通过运算函数F对明文m1、m2和mn进行计算,得到新的明文。In the embodiment of the present application, the evaluation function can be understood as combining at least two ciphertext values obtained by encrypting with the same public key, and forming a new ciphertext value through a specific function included in the evaluation function, such as an operation function, to pass The private key corresponding to the public key decrypts the new ciphertext value to obtain a new plaintext value after the operation. Exemplarily, the evaluation algorithm is Eval(F, ct1, ct2, ..., ctn). The evaluation algorithm combines n ciphertexts ct1, ct2, ..., ctn, and uses an operation function F to form a new ciphertext ct' And ct'=F(ct1, ct2, . . . , ctn). Due to the nature of homomorphic encryption, it is guaranteed that Dec(sk, ct')=F(m1, m2, ..., mn), that is, through the decryption function Dec function, the new ciphertext ct' is homomorphically decrypted using the private key sk, The plaintext m1 corresponding to the ciphertext ct1, the plaintext m2 corresponding to the ciphertext ct2, and the plaintext mn corresponding to the ciphertext ctn are obtained, and the plaintext m1, m2 and mn are calculated by the operation function F to obtain a new plaintext.
本申请实施例中,区块链的第一节点用第一公钥对账户变化值进行加密得到第一密文账户变化值的情况下,第一节点通过第一评估函数中的运算函数,对第一密文账户值和第一密文账户变化值进行计算,得到第二密文账户值,并将第二密文账户值记录于区块链中,以使目标用户用与第一公钥对应的第一私钥对第二密文账户值进行解密得到第一明文账户值。In the embodiment of the present application, when the first node of the blockchain encrypts the account change value with the first public key to obtain the first ciphertext account change value, the first node uses the operation function in the first evaluation function to Calculate the first ciphertext account value and the change value of the first ciphertext account to obtain the second ciphertext account value, and record the second ciphertext account value in the blockchain, so that the target user can use the first public key with the first public key. The corresponding first private key decrypts the second ciphertext account value to obtain the first plaintext account value.
在一种可实现的应用场景中,目标用户为减少账户值的用户。首先,目标用户根据给定的同态加密参数执行密钥生成算法即KeyGen算法生成第一公钥PKA和第一私钥skA;其次,目标用户通过加密算法Enc算法用第一公钥PKA对目标用户的前一次交易信息mA进行加密后得到第一密文账户值ctA,可以表示为执行Enc(mA,PKA)得到ctA。进一步地,参照图2所示,图2中的A示出的是发送第一账本信息至第一节点的示意图,目标用户创建第一账本信息Create(IDA,ctA,PKA),并将第一账本信息发送给区块链的第一节点,并将第一节点的信息提供背书与同步的方式,同步给区块链的其他节点,最终达到一致性;其中,第一账本信息以键值对(key-value)结构存储在区块链上,第一账本信息为IDA:[ctA,PKA]。然后,参照图2所示,图2中的B示出的是发送交易信息至第一节点的示意图,第一节点接收目标用户与其他用户之间的交易信息Tran(IDA,IDB,value),基于第一标识IDA从区块链中获取第一账本信息,并用第一公钥PKA对交易信息中的账户变化值value进行加密得到第一密文账户变化值ctv1。进一步地,第一节点基于执行第一评估算法Eval(Sub,ctA,ctv1),得到第二密文账户值ctA′,并将第二密文账户值ctA′当做最终的账本值,记录在区块链中,其中,目标用户最终的第一账本信息为IDA:[ctA′,PKA]。最后,目标用户通过解密算法DEC算法用第一私钥skA对第二密文账户值ctA′进行解密得到第一明文账户值,以验证交易的准确性。In an achievable application scenario, the target user is a user whose account value is reduced. First, the target user executes the key generation algorithm according to the given homomorphic encryption parameters, that is, the KeyGen algorithm generates the first public key PK A and the first private key sk A ; secondly, the target user uses the first public key PK through the encryption algorithm Enc algorithm A encrypts the previous transaction information m A of the target user to obtain the first ciphertext account value ct A , which can be expressed as executing Enc(m A , PK A ) to obtain ct A . Further, referring to FIG. 2 , A in FIG. 2 shows a schematic diagram of sending the first account book information to the first node, the target user creates the first account book information Create(ID A , ct A , PK A ), and Send the first ledger information to the first node of the blockchain, and provide the information of the first node with endorsement and synchronization, and synchronize it to other nodes of the blockchain to achieve consistency eventually; The key-value pair structure is stored on the blockchain, and the first ledger information is ID A : [ct A ,PK A ]. Then, referring to FIG. 2 , B in FIG. 2 shows a schematic diagram of sending transaction information to the first node, and the first node receives the transaction information Tran(ID A , ID B , value between the target user and other users) ), obtain the first ledger information from the blockchain based on the first identification ID A , and encrypt the account change value value in the transaction information with the first public key PK A to obtain the first ciphertext account change value ct v1 . Further, the first node obtains the second ciphertext account value ct A' based on executing the first evaluation algorithm Eval(Sub, ct A , ct v1 ), and regards the second ciphertext account value ct A' as the final ledger value , recorded in the blockchain, where the final first ledger information of the target user is ID A :[ct A′ ,PK A ]. Finally, the target user decrypts the second ciphertext account value ct A' with the first private key sk A through the decryption algorithm DEC algorithm to obtain the first plaintext account value, so as to verify the accuracy of the transaction.
需要说明的是,上述背书可以理解为第一节点作为提交节点,将自身包括的所有信息先提交给背书节点,这里,背书节点可以是区块链平台指定的节点,背书节点先进行运算并更新信息后,将更新后的信息返还给提交节点,提交节点验证无误后再将更新后的信息发送至区块链的其他节点。It should be noted that the above endorsement can be understood as the first node as the submission node, which submits all the information included in itself to the endorsement node first. Here, the endorsement node can be a node designated by the blockchain platform, and the endorsement node performs calculations and updates first. After the information is received, the updated information is returned to the submitting node, and the submitting node verifies that it is correct before sending the updated information to other nodes in the blockchain.
在另一种可实现的应用场景中,若交易信息为Tran(IDA,IDB,value),则表示IDA对应的用户为交易发送方,IDB对应的用户为交易接收方,即目标用户为减少账户值的用户,其他用户为增加账户值的用户。首先,目标用户根据给定的同态加密参数执行密钥生成算法即KeyGen算法生成第一公钥PKA和第一私钥skA;其他用户根据给定的同态加密参数执行密钥生成算法即KeyGen算法生成第四公钥PKB和第四私钥skB。其次,目标用户通过加密算法Enc算法用第一公钥PKA对目标用户的前一次交易信息mA进行加密后得到第一密文账户值ctA,可以表示为执行Enc(mA,PKA)得到ctA;其他用户通过加密算法Enc算法用第四公钥PKB对其他用户的前一次交易信息mB进行加密后得到第四密文账户值ctB,可以表示为执行Enc(mB,PKB)得到ctB。进一步地,参照图2所示,目标用户创建第一账本信息Create(IDA,ctA,PKA),并将第一账本信息发送给区块链的第一节点,并将第一节点的信息提供背书与同步的方式,同步给区块链的其他节点。其中,第一账本信息以键值对(key-value)结构存储在区块链上,第一账本信息为IDA:[ctA,PKA]。其他用户创建第三账本信息Create(IDB,ctB,PKB),并将第三账本信息发送给区块链的第一节点,并将第一节点的信息提供背书与同步的方式,同步给区块链的其他节点。其中,第三账本信息以键值对(key-value)结构存储在区块链上,第三账本信息为IDB:[ctB,PKB]。然后,第一节点接收目标用户与其他用户之间的交易信息Tran(IDA,IDB,value),基于第一标识IDA从区块链中获取第一账本信息,以及基于第二标识IDB从区块链中获取第三账本信息。之后,第一节点用第一公钥PKA对交易信息中的账户变化值value进行加密得到第一密文账户变化值ctv1,以及用第四公钥PKB对交易信息中的账户变化值value进行加密得到第三密文账户变化值ctv2。进一步地,第一节点基于执行第一评估算法Eval(Sub,ctA,ctv1),得到第二密文账户值ctA′,并将第二密文账户值ctA′当做最终的账本值,记录在区块链中,其中,目标用户最终的第一账本信息为IDA:[ctA′,PKA]。第一节点基于执行第一评估算法Eval(Add,ctB,ctv2),得到第八密文账户值ctB′,并将第八密文账户值ctB′当做最终的账本值,记录在区块链中,其中,其他用户最终的第三账本信息为IDB:[ctB′,PKB]。最后,目标用户通过解密算法DEC算法用第一私钥skA对第二密文账户值ctA′进行解密得到第一明文账户值;其他用户通过解密算法DEC算法用第四私钥skB对第八密文账户值ctB′进行解密得到第二明文账户值,以验证交易的准确性。In another achievable application scenario, if the transaction information is Tran(ID A , ID B , value), it means that the user corresponding to ID A is the transaction sender, and the user corresponding to ID B is the transaction receiver, that is, the target The user is the user who reduces the account value, and the other users are the users who increase the account value. First, the target user executes the key generation algorithm according to the given homomorphic encryption parameters, that is, the KeyGen algorithm generates the first public key PK A and the first private key sk A ; other users execute the key generation algorithm according to the given homomorphic encryption parameters That is, the KeyGen algorithm generates the fourth public key PK B and the fourth private key sk B . Secondly, the target user encrypts the previous transaction information mA of the target user with the first public key PK A through the encryption algorithm Enc algorithm to obtain the first ciphertext account value ct A , which can be expressed as executing Enc(m A , PK A . ) to obtain ct A ; other users obtain the fourth ciphertext account value ct B after encrypting the previous transaction information m B of other users with the fourth public key PK B through the encryption algorithm Enc algorithm, which can be expressed as executing Enc (m B , PK B ) to get ct B . Further, as shown in FIG. 2 , the target user creates the first account book information Create(ID A , ct A , PK A ), sends the first account book information to the first node of the blockchain, and sends the first account book information to the first node of the blockchain. The information provides a way of endorsement and synchronization, which is synchronized to other nodes in the blockchain. The first ledger information is stored on the blockchain in a key-value structure, and the first ledger information is ID A : [ct A ,PK A ]. Other users create the third ledger information Create(ID B , ct B , PK B ), and send the third ledger information to the first node of the blockchain, and provide the first node's information with endorsement and synchronization methods to synchronize to other nodes of the blockchain. Among them, the third ledger information is stored on the blockchain in a key-value structure, and the third ledger information is ID B : [ct B ,PK B ]. Then, the first node receives the transaction information Tran(ID A , ID B , value) between the target user and other users, obtains the first ledger information from the blockchain based on the first identification ID A , and obtains the first ledger information based on the second identification ID B obtains the third ledger information from the blockchain. After that, the first node encrypts the account change value value in the transaction information with the first public key PK A to obtain the first ciphertext account change value ct v1 , and uses the fourth public key PK B to encrypt the account change value in the transaction information value is encrypted to obtain the third ciphertext account change value ct v2 . Further, the first node obtains the second ciphertext account value ct A' based on executing the first evaluation algorithm Eval(Sub, ct A , ct v1 ), and regards the second ciphertext account value ct A' as the final ledger value , recorded in the blockchain, where the final first ledger information of the target user is ID A :[ct A′ ,PK A ]. The first node obtains the eighth ciphertext account value ct B′ based on the execution of the first evaluation algorithm Eval (Add, ct B , ct v2 ), and regards the eighth ciphertext account value ct B′ as the final ledger value, which is recorded in the In the blockchain, the final third ledger information of other users is ID B :[ct B′ ,PK B ]. Finally, the target user decrypts the second ciphertext account value ct A' with the first private key sk A through the decryption algorithm DEC algorithm to obtain the first plaintext account value; other users use the fourth private key sk B to decrypt the The eighth ciphertext account value ct B' is decrypted to obtain the second plaintext account value to verify the accuracy of the transaction.
本申请实施例所提供的信息处理方法,通过接收目标用户与其他用户之间的交易信息;其中,交易信息包括账户变化值;从区块链中获取目标用户的第一账本信息;其中,第一账本信息包括第一密文账户值和目标用户的第一公钥,第一密文账户值是目标用户用第一公钥对目标用户的前一次交易信息进行加密后得到的;用第一公钥对账户变化值进行加密得到第一密文账户变化值;基于第一密文账户值、第一密文账户变化值和第一评估函数确定第二密文账户值,并将第二密文账户值记录于区块链中,以使目标用户用与第一公钥对应的第一私钥对第二密文账户值进行解密得到第一明文账户值;其中,第一公钥和第一私钥根据同态加密参数生成,第一评估函数包括运算函数;如此,实现了区块链节点对密文数据进行操作的过程中,不会泄露数据的原始信息,实现了数据之间的隐私运算。The information processing method provided by the embodiment of the present application receives transaction information between the target user and other users; wherein, the transaction information includes account change values; the first ledger information of the target user is obtained from the blockchain; A ledger information includes a first ciphertext account value and the target user's first public key, and the first ciphertext account value is obtained by the target user encrypting the target user's previous transaction information with the first public key; The public key encrypts the account change value to obtain the first ciphertext account change value; the second ciphertext account value is determined based on the first ciphertext account value, the first ciphertext account change value and the first evaluation function, and the second ciphertext account value is determined. The text account value is recorded in the blockchain, so that the target user decrypts the second cipher text account value with the first private key corresponding to the first public key to obtain the first plain text account value; A private key is generated according to the homomorphic encryption parameters, and the first evaluation function includes an operation function; in this way, it is realized that the original information of the data will not be leaked during the operation of the ciphertext data by the blockchain nodes, and the data communication between the data is realized. Privacy Computing.
本申请的实施例提供一种信息处理方法,应用于区块链的第一节点,参照图3所示,该方法包括以下步骤:The embodiment of the present application provides an information processing method, which is applied to the first node of the blockchain. Referring to FIG. 3 , the method includes the following steps:
步骤201、接收目标用户与其他用户之间的交易信息。Step 201: Receive transaction information between the target user and other users.
其中,交易信息包括账户变化值。The transaction information includes account change values.
步骤202、从区块链中获取目标用户的第一账本信息。Step 202: Obtain the first ledger information of the target user from the blockchain.
其中,第一账本信息包括第一密文账户值和目标用户的第一公钥,第一密文账户值是目标用户用第一公钥对目标用户的前一次交易信息进行加密后得到的。The first ledger information includes a first ciphertext account value and a first public key of the target user, and the first ciphertext account value is obtained after the target user encrypts the previous transaction information of the target user with the first public key.
步骤203、从区块链中获取目标用户的密钥更新信息。Step 203: Obtain the key update information of the target user from the blockchain.
其中,密钥更新信息包括第一密文私钥和第二公钥,第一密文私钥是目标用户用第二公钥对第一私钥进行加密后得到的。The key update information includes a first ciphertext private key and a second public key, and the first ciphertext private key is obtained after the target user encrypts the first private key with the second public key.
本申请实施例中,第二公钥是目标用户基于给定的同态加密参数,通过密钥生成算法生成加密所需的另一密钥。In this embodiment of the present application, the second public key is another key required for the target user to generate encryption through a key generation algorithm based on given homomorphic encryption parameters.
本申请实施例中,区块链的第一节点接收目标用户与其他用户之间的交易信息之后从区块链中获取目标用户的第一账本信息,以及从区块链中获取目标用户的包含有第一密文私钥和第二公钥的密钥更新信息。In the embodiment of the present application, after receiving the transaction information between the target user and other users, the first node of the blockchain obtains the first ledger information of the target user from the blockchain, and obtains the information of the target user from the blockchain. There are key update information of the first ciphertext private key and the second public key.
本申请实施例中,密钥更新可以在获取到第一账本信息,对第一账本信息中的第一密文账本值进行更新之前执行,密钥更新还可以在获取到第一账本信息,对第一账本信息中的第一密文账本值进行更新,得到更新后的第一密文账本值之后执行,本申请对于密钥更新的时机不做具体限制。这里,以下所执行的步骤是以在获取到第一账本信息,对第一账本信息中的第一密文账本值进行更新之前,对第一账本信息中的密钥和密文账本值进行更新。In this embodiment of the present application, the key update may be performed before the first account book information is obtained and the first ciphertext book value in the first account book information is updated. The first ciphertext ledger value in the first ledger information is updated, and the updated first ciphertext ledger value is obtained and executed. This application does not specifically limit the timing of key update. Here, the steps performed below are to update the key and the ciphertext ledger value in the first ledger information before the first ledger information is obtained and the first ciphertext ledger value in the first ledger information is updated .
步骤204、基于第一密文私钥和第二公钥,对第一账本信息进行更新,得到更新后的第一账本信息,以使第一节点根据更新后的第一账本信息,对区块链的目标用户的密文账户值重新记录。Step 204: Update the first ledger information based on the first ciphertext private key and the second public key to obtain the updated first ledger information, so that the first node can update the block based on the updated first ledger information. The ciphertext account value of the target user of the chain is re-recorded.
本申请实施例中,参考图4所示,步骤204基于第一密文私钥和第二公钥,对第一账本信息进行更新,得到更新后的第一账本信息,可以通过如下步骤实现:In this embodiment of the present application, referring to FIG. 4 , step 204 updates the first ledger information based on the first ciphertext private key and the second public key, and obtains the updated first ledger information, which can be implemented by the following steps:
步骤A1、用第二公钥对第一密文账户值进行再次加密得到第一密态下的第一密文账户值。Step A1: Re-encrypt the first ciphertext account value with the second public key to obtain the first ciphertext account value in the first cipher state.
步骤A2、基于第一密文私钥、第一密态下的第一密文账户值和第二评估函数确定第三密文账户值。Step A2: Determine the third ciphertext account value based on the first ciphertext private key, the first ciphertext account value in the first cipher state, and the second evaluation function.
其中,更新后的第一账本信息包括第三密文账户值和第二公钥。The updated first ledger information includes the third ciphertext account value and the second public key.
本申请实施例中,区块链的第一节点从区块链中获取目标用户的包括有第一密文私钥和第二公钥的密钥更新信息之后,通过加密算法用第二公钥对第一密文账户值进行再次加密得到第一密态下的第一密文账户值,并基于第一密文私钥、第一密态下的第一密文账户值以及第二评估函数,确定第三密文账户值。In the embodiment of the present application, after the first node of the blockchain obtains the key update information of the target user including the first ciphertext private key and the second public key from the blockchain, the second public key is used by the encryption algorithm. Re-encrypt the first ciphertext account value to obtain the first ciphertext account value in the first cipher state, and based on the first ciphertext private key, the first ciphertext account value in the first ciphertext state and the second evaluation function , and determine the third ciphertext account value.
本申请实施例中,步骤A2基于第一密文私钥、第一密态下的第一密文账户值和第二评估函数确定第三密文账户值,可以通过如下方式实现:In the embodiment of the present application, step A2 determines the third ciphertext account value based on the first ciphertext private key, the first ciphertext account value in the first cipher state, and the second evaluation function, which can be implemented in the following manner:
通过第二评估函数中的同态解密函数,用第一密文私钥对第一密态下的第一密文账户值进行解密,得到第三密文账户值。Through the homomorphic decryption function in the second evaluation function, the first ciphertext account value in the first ciphertext state is decrypted with the first ciphertext private key to obtain the third ciphertext account value.
其中,第二评估函数包括同态解密函数。Wherein, the second evaluation function includes a homomorphic decryption function.
由上述可知,本申请实施例,通过上述方法在实现密钥更新的过程中,目标用户无需将密文账本进行解密得到明文账本后,再用新的公钥对明文账本进行更新,如此,避免了目标用户在更新密钥时,同时改变了明文账本数据,实现了保护数据的隐私和安全。It can be seen from the above that, in the embodiment of the present application, in the process of realizing the key update through the above method, the target user does not need to decrypt the ciphertext ledger to obtain the plaintext ledger, and then use the new public key to update the plaintext ledger. When the target user updates the key, the plaintext ledger data is changed at the same time, and the privacy and security of the data are protected.
需要说明的是,相关技术中的密钥更新的方式将远端密文下载的本地,在本地使用对应的私钥将密文账户解密明文账户,再使用新密钥对明文账户进行加密得到新密文账户,该方法至少存在改变明文账本的问题。It should be noted that the key update method in the related art downloads the remote ciphertext locally, uses the corresponding private key locally to decrypt the plaintext account, and then uses the new key to encrypt the plaintext account to obtain a new key. For ciphertext accounts, this method at least has the problem of changing the plaintext ledger.
步骤205、用第二公钥对账户变化值进行加密得到第二密文账户变化值。Step 205: Encrypt the account change value with the second public key to obtain the second ciphertext account change value.
步骤206、基于更新后的第一账本信息中的密文账户值、第二密文账户变化值和第一评估函数确定更新后的第二密文账户值,并将更新后的第二密文账户值记录于区块链中,以使目标用户用与第二公钥对应的第二私钥对更新后的第二密文账户值进行解密得到第一明文账户值。Step 206: Determine the updated second ciphertext account value based on the ciphertext account value, the second ciphertext account change value and the first evaluation function in the updated first ledger information, and use the updated second ciphertext The account value is recorded in the blockchain, so that the target user decrypts the updated second ciphertext account value with the second private key corresponding to the second public key to obtain the first plaintext account value.
其中,第二公钥和第二私钥根据同态加密参数生成;第一评估函数包括运算函数。Wherein, the second public key and the second private key are generated according to homomorphic encryption parameters; the first evaluation function includes an operation function.
本申请实施例中,区块链的第一节点用第二公钥对账户变化值进行加密得到第二密文账户变化值的情况下,第一节点通过第一评估函数中的运算函数,对第三密文账户值和第二密文账户变化值进行计算,得到更新后的第二密文账户值,并将更新后的第二密文账户值记录于区块链中,以使目标用户用与第二公钥对应的第二私钥对更新后第二密文账户值进行解密得到第一明文账户值。In the embodiment of the present application, when the first node of the blockchain encrypts the account change value with the second public key to obtain the second ciphertext account change value, the first node uses the operation function in the first evaluation function to The third ciphertext account value and the second ciphertext account change value are calculated to obtain the updated second ciphertext account value, and the updated second ciphertext account value is recorded in the blockchain, so that the target user Decrypt the updated second ciphertext account value with the second private key corresponding to the second public key to obtain the first plaintext account value.
在一种可实现的应用场景中,参照图5所示,首先,目标用户从区块链中获取到包含有第一密文账户值和第一公钥的第一账户信息后,目标用户根据给定的同态加密参数执行密钥生成算法即KeyGen算法生成新的密钥,即第二公钥PK′A和第二私钥sk′A,并通过加密算法Enc算法用第二公钥PK′A对第一私钥skA进行加密得到第一密文私钥可以表示为执行Enc(skA,PK′A)得到然后,参照图2所示,图2中的C示出的是发送密钥更新信息至第一节点的示意图,目标用户生成密钥更新信息并将密钥更新信息发送给第一节点。进一步地,第一节点基于第一标识IDA从区块链中获取密钥更新信息,并通过加密算法Enc算法用第二公钥PK′A对第一密文账户值ctA进行加密后得到第一密态下的第一密文账户值可以表示为执行Enc(ctA,PK′A)得到最后,通过第二评估函数中的同态解密函数如Dec函数,用第一密文私钥对第一密态下的第一密文账户值进行解密,得到第三密文账户值ct′A,可以表示为执行得到ct′A,且密钥更新后的目标用户的第一账本信息为IDA:[ct′A,PK′A]。最后,目标用户为确保更新后账本信息的正确性,目标用户可以通过第一标识IDA查询区块链,得到第三密文账户值ct′A并执行Dec(sk′A,ct′A)得到m′A,验证mA是否等于m′A,如果相等,则密文更新成功。如此,无需将密文账本进行解密得到明文账本后,再用新的公钥对明文账本进行更新,避免了目标用户在更新密钥时,同时改变了明文账本数据,实现了保护数据的隐私和安全。In an achievable application scenario, as shown in FIG. 5 , first, after the target user obtains the first account information including the first ciphertext account value and the first public key from the blockchain, the target user according to The given homomorphic encryption parameters execute the key generation algorithm, namely the KeyGen algorithm, to generate a new key, namely the second public key PK' A and the second private key sk' A , and use the second public key PK through the encryption algorithm Enc algorithm ' A encrypts the first private key sk A to obtain the first ciphertext private key It can be expressed as executing Enc(sk A ,PK′ A ) to get Then, referring to FIG. 2 , C in FIG. 2 shows a schematic diagram of sending the key update information to the first node, and the target user generates the key update information and send the key update information to the first node. Further, the first node obtains the key update information from the blockchain based on the first identification ID A , and encrypts the first ciphertext account value ct A with the second public key PK' A through the encryption algorithm Enc algorithm to obtain The first ciphertext account value in the first cipher state It can be expressed as executing Enc(ct A ,PK′ A ) to get Finally, through the homomorphic decryption function in the second evaluation function, such as the Dec function, use the first ciphertext private key For the first ciphertext account value in the first cipher state Decrypt to obtain the third ciphertext account value ct' A , which can be expressed as execution Obtain ct' A , and the first ledger information of the target user after the key update is ID A : [ct' A , PK' A ]. Finally, in order to ensure the correctness of the updated ledger information, the target user can query the blockchain through the first identifier ID A , obtain the third ciphertext account value ct' A and execute Dec(sk' A , ct' A ) Obtain m' A , verify whether m A is equal to m' A , if it is equal, the ciphertext update is successful. In this way, there is no need to decrypt the ciphertext ledger to obtain the plaintext ledger, and then use the new public key to update the plaintext ledger, which prevents the target user from changing the plaintext ledger data when updating the key, and realizes the protection of data privacy and security. Safety.
需要说明的是,本实施例中与其它实施例中相同步骤和相同内容的说明,可以参照其它实施例中的描述,此处不再赘述。It should be noted that, for the description of the same steps and the same content in this embodiment as in other embodiments, reference may be made to the descriptions in other embodiments, and details are not repeated here.
本申请的实施例提供一种信息处理方法,应用于区块链的第一节点,参照图6所示,该方法包括以下步骤:The embodiment of the present application provides an information processing method, which is applied to the first node of the blockchain. Referring to FIG. 6 , the method includes the following steps:
步骤301、接收目标用户与其他用户之间的交易信息。Step 301: Receive transaction information between the target user and other users.
其中,交易信息包括账户变化值,这里,账户变化值可以是目标用户的账户变化值,账户变化值也可以是其他用户的账户变化值,账户变化值还可以是与目标用户以及其他用户不同的账户变化值,对此,本申请不做具体限制。需要说明的是,在本申请实施例中,账户变化值为与目标用户以及其他用户不同的账户变化值的账户变化值。这里,交易信息还包括目标用户的第一标识、其他用户的第二标识以及运算函数。交易信息用于对目标用户的账户值和其他用户账户值进行运算,故交易信息又称联合运算信息。The transaction information includes the account change value. Here, the account change value may be the account change value of the target user, the account change value may also be the account change value of other users, and the account change value may also be different from the target user and other users. Account change value, which is not specifically limited in this application. It should be noted that, in this embodiment of the present application, the account change value is an account change value that is different from the account change value of the target user and other users. Here, the transaction information further includes the first identification of the target user, the second identification of other users, and the operation function. The transaction information is used to calculate the target user's account value and other user account values, so the transaction information is also called joint operation information.
步骤302、从区块链中获取目标用户的第一账本信息。Step 302: Obtain the first ledger information of the target user from the blockchain.
其中,第一账本信息包括第一密文账户值和目标用户的第一公钥,第一密文账户值是目标用户用第一公钥对目标用户的前一次交易信息进行加密后得到的。The first ledger information includes a first ciphertext account value and a first public key of the target user, and the first ciphertext account value is obtained after the target user encrypts the previous transaction information of the target user with the first public key.
本申请实施例中,区块链的第一节点接收目标用户与其他用户之间的交易信之后,从区块链中获取第一标识对应的目标用户的第一账本信息。In the embodiment of the present application, after receiving the transaction letter between the target user and other users, the first node of the blockchain obtains the first ledger information of the target user corresponding to the first identifier from the blockchain.
步骤303、从区块链中获取代理用户的第二账本信息。Step 303: Obtain the second ledger information of the proxy user from the blockchain.
其中,第二账本信息包括空值和第三公钥,代理用户与目标用户和其他用户不同。Wherein, the second ledger information includes a null value and a third public key, and the proxy user is different from the target user and other users.
本申请实施例中,第二公钥是代理用户基于给定的同态加密参数,通过密钥生成算法生成加密所需的密钥。In the embodiment of the present application, the second public key is the key required for encryption generated by the proxy user through the key generation algorithm based on the given homomorphic encryption parameters.
步骤304、从区块链中获取目标用户的第二密文私钥。Step 304: Obtain the second ciphertext private key of the target user from the blockchain.
其中,第二密文私钥是目标用户用第三公钥对第一私钥进行加密后得到的。The second ciphertext private key is obtained after the target user encrypts the first private key with the third public key.
步骤305、从区块链中获取其他用户的第三密文私钥和第三账本信息。Step 305: Obtain the third ciphertext private key and third ledger information of other users from the blockchain.
其中,第二账本信息包括第四密文账户值和其他用户的第四公钥,第三密文私钥是其他用户用第三公钥对与第四公钥对应的第四私钥进行加密后得到的,第四密文账户值是其他用户用第四公钥对其他用户的前一次交易信息进行加密后得到的。The second ledger information includes the fourth ciphertext account value and the fourth public key of other users, and the third ciphertext private key is that other users encrypt the fourth private key corresponding to the fourth public key with the third public key The fourth ciphertext account value is obtained after other users encrypt the previous transaction information of other users with the fourth public key.
本申请实施例中,区块链的第一节点从区块链中获取目标用户的第一账本信息之后,从区块链中继续获取代理用户的包含有空值和第三公钥的第二账本信息,获取目标用户的第二密文私钥,以及获取第二标识对应的其他用户的第三密文私钥和包含有第四密文账户值和第四公钥的第三账本信息。In the embodiment of this application, after the first node of the blockchain obtains the first ledger information of the target user from the blockchain, it continues to obtain from the blockchain the second node of the proxy user that contains the null value and the third public key. Ledger information, obtain the second ciphertext private key of the target user, and obtain the third ciphertext private key of other users corresponding to the second identifier, and the third ledger information including the fourth ciphertext account value and the fourth public key.
步骤306、基于第二密文私钥、第三密文私钥、第一密文账户值、第四密文账户值和第三公钥,确定代理用户的第五密文账户值,并将第五密文账户值记录于区块链中,以使代理用户用与第三公钥对应的第三私钥对第五密文账户值进行解密得到第二明文账户值。Step 306: Determine the fifth ciphertext account value of the proxy user based on the second ciphertext private key, the third ciphertext private key, the first ciphertext account value, the fourth ciphertext account value and the third public key, and assign The fifth ciphertext account value is recorded in the blockchain, so that the proxy user decrypts the fifth ciphertext account value with the third private key corresponding to the third public key to obtain the second plaintext account value.
本申请实施例中,参照图7所示,步骤306基于第二密文私钥、第三密文私钥、第一密文账户值、第四密文账户值和第三公钥,确定代理用户的第五密文账户值,包括:In the embodiment of the present application, referring to FIG. 7 ,
步骤B1、用第三公钥对第一密文账户值进行加密得到第二密态下的第一密文账户值。Step B1: Encrypt the first ciphertext account value with the third public key to obtain the first ciphertext account value in the second cipher state.
步骤B2、用第三公钥对第四密文账户值进行加密得到第一密态下的第四密文账户值。Step B2, encrypting the fourth ciphertext account value with the third public key to obtain the fourth ciphertext account value in the first cipher state.
步骤B3、基于第二密文私钥、第三密文私钥、第二密态下的第一密文账户值和第一密态下的第四密文账户值,确定第五密文账户值。Step B3: Determine the fifth ciphertext account based on the second ciphertext private key, the third ciphertext private key, the first ciphertext account value in the second ciphertext state and the fourth ciphertext account value in the first ciphertext state value.
本申请实施例中,区块链的第一节点通过加密算法用第三公钥对第一密文账户值进行加密得到第二密态下的第一密文账户值,通过加密算法用第三公钥对第四密文账户值进行加密得到第一密态下的第四密文账户值,最后,基于第二密文私钥、第三密文私钥、第二密态下的第一密文账户值和第一密态下的第四密文账户值,确定第五密文账户值。In the embodiment of the present application, the first node of the blockchain encrypts the first ciphertext account value with the third public key through the encryption algorithm to obtain the first ciphertext account value in the second encryption state, and uses the third The public key encrypts the fourth ciphertext account value to obtain the fourth ciphertext account value in the first cipher state, and finally, based on the second ciphertext private key, the third ciphertext private key, and the first ciphertext in the second cipher state The ciphertext account value and the fourth ciphertext account value in the first cipher state determine the fifth ciphertext account value.
本申请实施例中,参照图8所示,步骤B3基于第二密文私钥、第三密文私钥、第二密态下的第一密文账户值和第一密态下的第四密文账户值,确定第五密文账户值,可以通过如下步骤实现:In the embodiment of this application, referring to FIG. 8 , step B3 is based on the second ciphertext private key, the third ciphertext private key, the first ciphertext account value in the second cipher state, and the fourth ciphertext in the first cipher state. The value of the ciphertext account and determining the value of the fifth ciphertext account can be achieved by the following steps:
步骤C1、通过第二评估函数中的同态解密函数,用第二密文私钥对第二密态下的第一密文账户值进行解密,得到第六密文账户值。Step C1: Decrypt the first ciphertext account value in the second ciphertext state with the second ciphertext private key through the homomorphic decryption function in the second evaluation function to obtain the sixth ciphertext account value.
步骤C2、通过同态解密函数,用第三密文私钥对第一密态下的第四密文账户值进行解密,得到第七密文账户值。Step C2: Decrypt the fourth ciphertext account value in the first ciphertext state with the third ciphertext private key through the homomorphic decryption function to obtain the seventh ciphertext account value.
步骤C3、通过第一评估函数中的运算函数,对第六密文账户值和第七密文账户值进行计算,确定第五密文账户值。Step C3: Calculate the sixth ciphertext account value and the seventh ciphertext account value through the operation function in the first evaluation function to determine the fifth ciphertext account value.
本申请实施例中,区块链的第一节点通过第二评估函数中的同态解密函数,用第二密文私钥对第二密态下的第一密文账户值进行解密,得到第六密文账户值;通过同态解密函数,用第三密文私钥对第一密态下的第四密文账户值进行解密,得到第七密文账户值;通过第一评估函数中的运算函数,对第六密文账户值和第七密文账户值进行计算,确定运算后得到的第五密文账户值。In the embodiment of the present application, the first node of the blockchain uses the second ciphertext private key to decrypt the first ciphertext account value in the second cipher state through the homomorphic decryption function in the second evaluation function, and obtains the first ciphertext account value in the second ciphertext state. Six ciphertext account values; through the homomorphic decryption function, use the third ciphertext private key to decrypt the fourth ciphertext account value in the first cipher state to obtain the seventh ciphertext account value; The operation function calculates the sixth ciphertext account value and the seventh ciphertext account value, and determines the fifth ciphertext account value obtained after the operation.
由上述可知,本申请实施例通过引入代理用户,实现不同用户之间的账本数据之间的隐私运算。需要说明的是,相关技术中在进行联合运算时,由于目标用户和其他用户的密文账本值都是通过使用各自的密钥进行加密的,如果想要对其进行联合运算,例如,求Sum(mA,mB)=mA+mB,在现有模型下是无法实现的,因为同态下的评估Eval函数要求各密文是在同一个密钥下产生的。It can be seen from the above that the embodiment of the present application implements privacy operations between account book data between different users by introducing proxy users. It should be noted that when performing joint operations in the related art, since the ciphertext ledger values of the target user and other users are encrypted by using their respective keys, if you want to perform joint operations on them, for example, find Sum (m A ,m B )=m A +m B , which cannot be realized under the existing model, because the evaluation of the Eval function under homomorphism requires that each ciphertext be generated under the same key.
在一种可实现的应用场景中,参照图9所示,首先,目标用户根据给定的同态加密参数执行密钥生成算法即KeyGen算法生成第一公钥PKA和第一私钥skA;其他用户根据给定的同态加密参数执行密钥生成算法即KeyGen算法生成第四公钥PKB和第四私钥skB;代理用户根据给定的同态加密参数执行密钥生成算法即KeyGen算法生成第三公钥PKD和第三私钥skD。然后,代理用户将第三公钥PKD提交到第一节点,第一节点为代理用户创建空的第二账本信息之后,目标用户和其他用户分别查询代理用户的第三公钥PKD,且目标用户通过加密算法Enc算法用第三公钥PKD对第一私钥skA进行加密后得到第二密文私钥可以表示为执行Enc(skA,PKD)得到其他用户通过加密算法Enc算法用第三公钥PKD对第四私钥skB进行加密后得到第三密文私钥可以表示为执行Enc(skB,PKD)得到目标用户将第二密文私钥发送给第一节点,以及其他用户将第三密文私钥发送给第一节点。In an achievable application scenario, as shown in FIG. 9 , first, the target user executes a key generation algorithm, that is, the KeyGen algorithm, according to the given homomorphic encryption parameters to generate the first public key PK A and the first private key sk A ; Other users execute the key generation algorithm according to the given homomorphic encryption parameters, that is, the KeyGen algorithm generates the fourth public key PK B and the fourth private key sk B ; the proxy user executes the key generation algorithm according to the given homomorphic encryption parameters, namely The KeyGen algorithm generates the third public key PK D and the third private key sk D . Then, the proxy user submits the third public key PK D to the first node, and the first node creates empty second ledger information for the proxy user After that, the target user and other users query the proxy user's third public key PK D respectively, and the target user encrypts the first private key sk A with the third public key PK D through the encryption algorithm Enc algorithm to obtain the second ciphertext private key. key It can be expressed as executing Enc(sk A ,PK D ) to get Other users encrypt the fourth private key sk B with the third public key PK D through the encryption algorithm Enc algorithm to obtain the third ciphertext private key It can be expressed as executing Enc(sk B ,PK D ) to get The target user sends the second ciphertext private key Send the third ciphertext private key to the first node and other users sent to the first node.
然后,第一节点接收目标用户与其他用户之间的联合运算信息compute(F,IDA,IDB),基于第一标识IDA从区块链中获取第一账本信息,以及基于第二标识IDB从区块链中获取第三账本信息。之后,第一节点用第三公钥PKD对第一密文账户值ctA进行加密得到第二密态下的第一密文账户值可以表示为执行Enc(ctA,PKD),得到用第三公钥PKD对第四密文账户值ctB进行加密得到第一密态下的第四密文账户值可以表示为执行Enc(ctB,PKD),得到 Then, the first node receives the joint operation information compute(F, ID A , ID B ) between the target user and other users, obtains the first ledger information from the blockchain based on the first identification ID A , and obtains the first ledger information based on the second identification ID B obtains the third ledger information from the blockchain. After that, the first node encrypts the first ciphertext account value ct A with the third public key PK D to obtain the first ciphertext account value in the second encrypted state It can be expressed as executing Enc(ct A ,PK D ), we get Encrypt the fourth ciphertext account value ct B with the third public key PK D to obtain the fourth ciphertext account value in the first cipher state It can be expressed as executing Enc(ct B ,PK D ), we get
进一步地,第一节点通过第二评估函数即Eval函数中的同态解密函数Dec函数,用第二密文私钥对第二密态下的第一密文账户值进行解密,得到第六密文账户值可以表示为执行得到通过第二评估函数即Eval函数中的同态解密函数Dec函数,用第三密文私钥对第二密态下的第一密文账户值进行解密,得到第七密文账户值可以表示为执行得到再然后,第一节点获取联合运算信息中的运算函数F,并确定为第一评估函数中的运算函数F,通过第一评估函数中的运算函数F,对第六密文账户值和第七密文账户值进行计算,确定第五密文账户值将第五密文账户值记录在区块链上,以确定代理用户最终的第三账本信息为Dealer:最后,代理用户通过代理标识Dealer查询区块链,得到第五密文账户值此时,代理用户使用第三私钥skD对第五密文账户值进行解密,得到F(mA,mB)即为对A和B的账本数据执行函数F的计算结果,从而将计算结果保存到区块链上。如此,通过引入代理用户,实现不同用户之间的账本数据之间的隐私运算。Further, the first node uses the second ciphertext private key to pair with the second evaluation function, namely the homomorphic decryption function Dec function in the Eval function. The first ciphertext account value in the second cipher state Decrypt to get the sixth ciphertext account value can be expressed as executing get Through the second evaluation function, that is, the homomorphic decryption function Dec function in the Eval function, use the third ciphertext private key to pair The first ciphertext account value in the second cipher state Decrypt to get the seventh ciphertext account value can be expressed as executing get Then, the first node obtains the operation function F in the joint operation information, and determines it as the operation function F in the first evaluation function. Through the operation function F in the first evaluation function, the sixth ciphertext account value is determined. and the seventh ciphertext account value Perform calculations to determine the value of the fifth ciphertext account Record the fifth ciphertext account value on the blockchain to determine the final third ledger information of the proxy user as Dealer: Finally, the proxy user queries the blockchain through the proxy identifier Dealer to obtain the fifth ciphertext account value At this time, the proxy user uses the third private key sk D to pair the fifth ciphertext account value decrypt to get F(m A , m B ) is the calculation result of executing function F on the ledger data of A and B, thereby saving the calculation result to the blockchain. In this way, by introducing proxy users, privacy operations between account book data between different users are realized.
需要说明的是,本实施例中与其它实施例中相同步骤和相同内容的说明,可以参照其它实施例中的描述,此处不再赘述。It should be noted that, for the description of the same steps and the same content in this embodiment as in other embodiments, reference may be made to the descriptions in other embodiments, and details are not repeated here.
本申请的实施例提供一种信息处理装置,该信息处理装置可以应用于图1、图3~图4以及图6~图8对应的实施例提供的一种信息处理方法中,参照图10所示,该信息处理装置10包括:An embodiment of the present application provides an information processing apparatus, and the information processing apparatus can be applied to an information processing method provided by the embodiments corresponding to FIG. 1 , FIGS. 3 to 4 , and FIGS. 6 to 8 . As shown, the
接收模块1001,用于接收目标用户与其他用户之间的交易信息;其中,交易信息包括账户变化值;The
获取模块1002,用于从区块链中获取目标用户的第一账本信息;其中,第一账本信息包括第一密文账户值和目标用户的第一公钥,第一密文账户值是目标用户用第一公钥对目标用户的前一次交易信息进行加密后得到的;The obtaining
处理模块1003,用于用第一公钥对账户变化值进行加密得到第一密文账户变化值;基于第一密文账户值、第一密文账户变化值和第一评估函数确定第二密文账户值,并将第二密文账户值记录于区块链中,以使目标用户用与第一公钥对应的第一私钥对第二密文账户值进行解密得到第一明文账户值;其中,第一公钥和第一私钥根据同态加密参数生成,第一评估函数包括运算函数。The
在本申请的其他实施例中,获取模块1002,还用于从区块链中获取目标用户的密钥更新信息,其中,密钥更新信息包括第一密文私钥和第二公钥,第一密文私钥是目标用户用第二公钥对第一私钥进行加密后得到的;处理模块1003,还用于基于第一密文私钥和第二公钥,对第一账本信息进行更新,得到更新后的第一账本信息,以使第一节点根据更新后的第一账本信息,对区块链的目标用户的密文账户值重新记录。In other embodiments of the present application, the obtaining
在本申请的其他实施例中,处理模块1003,还用于用第二公钥对第一密文账户值进行再次加密得到第一密态下的第一密文账户值;基于第一密文私钥、第一密态下的第一密文账户值和第二评估函数确定第三密文账户值;其中,更新后的第一账本信息包括第三密文账户值和第二公钥。In other embodiments of the present application, the
在本申请的其他实施例中,处理模块1003,还用于第二评估函数包括同态解密函数,通过第二评估函数中的同态解密函数,用第一密文私钥对第一密态下的第一密文账户值进行解密,得到第三密文账户值。In other embodiments of the present application, the
在本申请的其他实施例中,获取模块1002,还用于从区块链中获取代理用户的第二账本信息;其中,第二账本信息包括空值和第三公钥,代理用户与目标用户和其他用户不同;从区块链中获取目标用户的第二密文私钥;其中,第二密文私钥是目标用户用第三公钥对第一私钥进行加密后得到的;从区块链中获取其他用户的第三密文私钥和第三账本信息;其中,第二账本信息包括第四密文账户值和其他用户的第四公钥,第三密文私钥是其他用户用第三公钥对与第四公钥对应的第四私钥进行加密后得到的,第四密文账户值是其他用户用第四公钥对其他用户的前一次交易信息进行加密后得到的;处理模块1003,还用于基于第二密文私钥、第三密文私钥、第一密文账户值、第四密文账户值和第三公钥,确定代理用户的第五密文账户值,并将第五密文账户值记录于区块链中,以使代理用户用与第三公钥对应的第三私钥对第五密文账户值进行解密得到第二明文账户值。In other embodiments of this application, the obtaining module 1002 is further configured to obtain the second ledger information of the proxy user from the blockchain; wherein the second ledger information includes a null value and a third public key, the proxy user and the target user Different from other users; obtain the second ciphertext private key of the target user from the blockchain; wherein, the second ciphertext private key is obtained by the target user after encrypting the first private key with the third public key; Obtain the third ciphertext private key and third ledger information of other users in the block chain; wherein, the second ledger information includes the fourth ciphertext account value and the fourth public key of other users, and the third ciphertext private key is the other user's Obtained after encrypting the fourth private key corresponding to the fourth public key with the third public key, and the fourth ciphertext account value is obtained after other users encrypt the previous transaction information of other users with the fourth public key The processing module 1003 is also used to determine the fifth ciphertext of the proxy user based on the second ciphertext private key, the third ciphertext private key, the first ciphertext account value, the fourth ciphertext account value and the third public key account value, and record the fifth ciphertext account value in the blockchain, so that the proxy user decrypts the fifth ciphertext account value with the third private key corresponding to the third public key to obtain the second plaintext account value.
在本申请的其他实施例中,处理模块1003,还用于用第三公钥对第一密文账户值进行加密得到第二密态下的第一密文账户值;用第三公钥对第四密文账户值进行加密得到第一密态下的第四密文账户值;基于第二密文私钥、第三密文私钥、第二密态下的第一密文账户值和第一密态下的第四密文账户值,确定第五密文账户值。In other embodiments of the present application, the
在本申请的其他实施例中,处理模块1003,还用于通过第二评估函数中的同态解密函数,用第二密文私钥对第二密态下的第一密文账户值进行解密,得到第六密文账户值;通过同态解密函数,用第三密文私钥对第一密态下的第四密文账户值进行解密,得到第七密文账户值;通过第一评估函数中的运算函数,对第六密文账户值和第七密文账户值进行计算,确定第五密文账户值。In other embodiments of the present application, the
本申请的实施例提供一种区块链平台,该区块链平台可以应用于图1、图3~图4以及图6~图8对应的实施例提供的一种信息处理方法中,参照图11所示,该区块链平台11(图11中的区块链平台11与图10中的信息处理装置10相对应)包括:存储器1101和处理器1102,其中:The embodiments of the present application provide a blockchain platform, which can be applied to an information processing method provided by the embodiments corresponding to FIG. 1 , FIG. 3 to FIG. 4 , and FIGS. 6 to 8 . As shown in 11, the blockchain platform 11 (the
存储器1101,用于存储可执行指令;a
处理器1102,用于执行存储器1101中存储的可执行指令,以实现以下步骤:The
接收目标用户与其他用户之间的交易信息;其中,交易信息包括账户变化值;Receive transaction information between the target user and other users; wherein the transaction information includes account change values;
从区块链中获取目标用户的第一账本信息;其中,第一账本信息包括第一密文账户值和目标用户的第一公钥,第一密文账户值是目标用户用第一公钥对目标用户的前一次交易信息进行加密后得到的;Obtain the first account book information of the target user from the blockchain; wherein, the first account book information includes the first ciphertext account value and the first public key of the target user, and the first ciphertext account value is the target user's first public key Obtained by encrypting the previous transaction information of the target user;
用第一公钥对账户变化值进行加密得到第一密文账户变化值;Encrypting the account change value with the first public key to obtain the first ciphertext account change value;
基于第一密文账户值、第一密文账户变化值和第一评估函数确定第二密文账户值,并将第二密文账户值记录于区块链中,以使目标用户用与第一公钥对应的第一私钥对第二密文账户值进行解密得到第一明文账户值;其中,第一公钥和第一私钥根据同态加密参数生成;第一评估函数包括运算函数。The second ciphertext account value is determined based on the first ciphertext account value, the first ciphertext account change value and the first evaluation function, and the second ciphertext account value is recorded in the blockchain, so that the target user can use the same value as the first ciphertext account. A first private key corresponding to a public key decrypts the second ciphertext account value to obtain a first plaintext account value; wherein, the first public key and the first private key are generated according to homomorphic encryption parameters; the first evaluation function includes an operation function .
在本申请的其他实施例中,处理器1102,还用于执行存储器1101中存储的可执行指令,以实现以下步骤:In other embodiments of the present application, the
从区块链中获取目标用户的密钥更新信息,其中,密钥更新信息包括第一密文私钥和第二公钥,第一密文私钥是目标用户用第二公钥对第一私钥进行加密后得到的;基于第一密文私钥和第二公钥,对第一账本信息进行更新,得到更新后的第一账本信息,以使第一节点根据更新后的第一账本信息,对区块链的目标用户的密文账户值重新记录。Obtain the key update information of the target user from the blockchain, wherein the key update information includes a first ciphertext private key and a second public key, and the first ciphertext private key is the target user's use of the second public key to pair the first Obtained after the private key is encrypted; based on the first ciphertext private key and the second public key, the first ledger information is updated to obtain the updated first ledger information, so that the first node can obtain the updated first ledger according to the updated first ledger. information, re-record the ciphertext account value of the target user of the blockchain.
在本申请的其他实施例中,处理器1102,还用于执行存储器1101中存储的可执行指令,以实现以下步骤:In other embodiments of the present application, the
用第二公钥对第一密文账户值进行再次加密得到第一密态下的第一密文账户值;基于第一密文私钥、第一密态下的第一密文账户值和第二评估函数确定第三密文账户值;其中,更新后的第一账本信息包括第三密文账户值和第二公钥。Re-encrypt the first ciphertext account value with the second public key to obtain the first ciphertext account value in the first cipher state; based on the first ciphertext private key, the first ciphertext account value in the first cipher state and The second evaluation function determines the third ciphertext account value; wherein, the updated first ledger information includes the third ciphertext account value and the second public key.
在本申请的其他实施例中,处理器1102,还用于执行存储器1101中存储的可执行指令,以实现以下步骤:In other embodiments of the present application, the
第二评估函数包括同态解密函数,通过第二评估函数中的同态解密函数,用第一密文私钥对第一密态下的第一密文账户值进行解密,得到第三密文账户值。The second evaluation function includes a homomorphic decryption function. Through the homomorphic decryption function in the second evaluation function, the first ciphertext account value in the first cipher state is decrypted with the first ciphertext private key to obtain the third ciphertext account value.
在本申请的其他实施例中,处理器1102,还用于执行存储器1101中存储的可执行指令,以实现以下步骤:In other embodiments of the present application, the
从区块链中获取代理用户的第二账本信息;其中,第二账本信息包括空值和第三公钥,代理用户与目标用户和其他用户不同;从区块链中获取目标用户的第二密文私钥;其中,第二密文私钥是目标用户用第三公钥对第一私钥进行加密后得到的;从区块链中获取其他用户的第三密文私钥和第三账本信息;其中,第二账本信息包括第四密文账户值和其他用户的第四公钥,第三密文私钥是其他用户用第三公钥对与第四公钥对应的第四私钥进行加密后得到的,第四密文账户值是其他用户用第四公钥对其他用户的前一次交易信息进行加密后得到的;基于第二密文私钥、第三密文私钥、第一密文账户值、第四密文账户值和第三公钥,确定代理用户的第五密文账户值,并将第五密文账户值记录于区块链中,以使代理用户用与第三公钥对应的第三私钥对第五密文账户值进行解密得到第二明文账户值。Obtain the second ledger information of the proxy user from the blockchain; wherein the second ledger information includes a null value and a third public key, and the proxy user is different from the target user and other users; obtain the second ledger of the target user from the blockchain Ciphertext private key; wherein, the second ciphertext private key is obtained after the target user encrypts the first private key with the third public key; obtain the third ciphertext private key and the third ciphertext private key of other users from the blockchain Ledger information; wherein, the second account book information includes the fourth ciphertext account value and the fourth public key of other users, and the third ciphertext private key is the fourth private key corresponding to the fourth public key paired with the third public key by other users. The value of the fourth ciphertext account is obtained after other users encrypt the previous transaction information of other users with the fourth public key; based on the second ciphertext private key, the third ciphertext private key, The first ciphertext account value, the fourth ciphertext account value and the third public key determine the proxy user's fifth ciphertext account value, and record the fifth ciphertext account value in the blockchain, so that the proxy user can use The third private key corresponding to the third public key decrypts the fifth ciphertext account value to obtain the second plaintext account value.
在本申请的其他实施例中,处理器1102,还用于执行存储器1101中存储的可执行指令,以实现以下步骤:In other embodiments of the present application, the
用第三公钥对第一密文账户值进行加密得到第二密态下的第一密文账户值;用第三公钥对第四密文账户值进行加密得到第一密态下的第四密文账户值;基于第二密文私钥、第三密文私钥、第二密态下的第一密文账户值和第一密态下的第四密文账户值,确定第五密文账户值。Encrypt the first ciphertext account value with the third public key to obtain the first ciphertext account value in the second cipher state; encrypt the fourth ciphertext account value with the third public key to obtain the first ciphertext account value in the first cipher state. Four ciphertext account values; the fifth ciphertext account value is determined based on the second ciphertext private key, the third ciphertext private key, the first ciphertext account value in the second ciphertext state, and the fourth ciphertext account value in the first ciphertext state Ciphertext account value.
在本申请的其他实施例中,处理器1102,还用于执行存储器1101中存储的可执行指令,以实现以下步骤:In other embodiments of the present application, the
通过第二评估函数中的同态解密函数,用第二密文私钥对第二密态下的第一密文账户值进行解密,得到第六密文账户值;通过同态解密函数,用第三密文私钥对第一密态下的第四密文账户值进行解密,得到第七密文账户值;通过第一评估函数中的运算函数,对第六密文账户值和第七密文账户值进行计算,确定第五密文账户值。Through the homomorphic decryption function in the second evaluation function, use the second ciphertext private key to decrypt the first ciphertext account value in the second ciphertext state to obtain the sixth ciphertext account value; through the homomorphic decryption function, use The third ciphertext private key decrypts the fourth ciphertext account value in the first cipher state to obtain the seventh ciphertext account value; through the operation function in the first evaluation function, the sixth ciphertext account value and the seventh ciphertext account value are decrypted. The ciphertext account value is calculated to determine the fifth ciphertext account value.
本申请的实施例提供一种存储介质,该存储介质存储有一个或者多个程序,该一个或者多个程序可被一个或者多个处理器执行,以实现图1、图3~图4以及图6~图8对应的实施例提供的一种信息处理方法。Embodiments of the present application provide a storage medium, where one or more programs are stored in the storage medium, and the one or more programs can be executed by one or more processors to implement FIG. 1 , FIG. 3 to FIG. 4 , and FIG. An information processing method provided by the embodiments corresponding to FIG. 6 to FIG. 8 .
本申请实施例所提供的存储介质,通过接收目标用户与其他用户之间的交易信息;其中,交易信息包括账户变化值;从区块链中获取目标用户的第一账本信息;其中,第一账本信息包括第一密文账户值和目标用户的第一公钥,第一密文账户值是目标用户用第一公钥对目标用户的前一次交易信息进行加密后得到的;用第一公钥对账户变化值进行加密得到第一密文账户变化值;基于第一密文账户值、第一密文账户变化值和第一评估函数确定第二密文账户值,并将第二密文账户值记录于区块链中,以使目标用户用与第一公钥对应的第一私钥对第二密文账户值进行解密得到第一明文账户值;其中,第一公钥和第一私钥根据同态加密参数生成,第一评估函数包括运算函数;如此,实现了区块链节点对密文数据进行操作的过程中,不会泄露数据的原始信息,实现了数据之间的隐私运算。The storage medium provided by the embodiment of the present application receives transaction information between the target user and other users; wherein, the transaction information includes an account change value; the first ledger information of the target user is obtained from the blockchain; The ledger information includes the first ciphertext account value and the first public key of the target user. The first ciphertext account value is obtained after the target user encrypts the previous transaction information of the target user with the first public key; The key-pair account change value is encrypted to obtain the first ciphertext account change value; the second ciphertext account value is determined based on the first ciphertext account value, the first ciphertext account change value and the first evaluation function, and the second ciphertext account value is determined. The account value is recorded in the blockchain, so that the target user decrypts the second ciphertext account value with the first private key corresponding to the first public key to obtain the first plaintext account value; wherein the first public key and the first The private key is generated according to the homomorphic encryption parameters, and the first evaluation function includes the operation function; in this way, the original information of the data will not be leaked during the operation of the ciphertext data by the blockchain nodes, and the privacy between the data is realized. operation.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by those skilled in the art, the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the application may take the form of a hardware embodiment, a 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 having computer-usable program code embodied therein, including but not limited to disk storage, optical storage, and the like.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in a flow or flow of a flowchart and/or a block or blocks of a 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 function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the flowcharts and/or the block or blocks of the block diagrams.
以上所述,仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。The above descriptions are only preferred embodiments of the present application, and are not intended to limit the protection scope of the present application.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210089865.4A CN114297721B (en) | 2022-01-25 | 2022-01-25 | Information processing method, information processing device, blockchain platform and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210089865.4A CN114297721B (en) | 2022-01-25 | 2022-01-25 | Information processing method, information processing device, blockchain platform and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN114297721A true CN114297721A (en) | 2022-04-08 |
| CN114297721B CN114297721B (en) | 2025-01-21 |
Family
ID=80976875
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210089865.4A Active CN114297721B (en) | 2022-01-25 | 2022-01-25 | Information processing method, information processing device, blockchain platform and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114297721B (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116204912B (en) * | 2023-04-28 | 2023-09-12 | 北京天润基业科技发展股份有限公司 | Data processing method and device based on isomorphic encryption |
| CN116781390A (en) * | 2023-07-18 | 2023-09-19 | 中移动信息技术有限公司 | Data transmission methods, devices, equipment and storage media |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106549749A (en) * | 2016-12-06 | 2017-03-29 | 杭州趣链科技有限公司 | A kind of block chain method for secret protection encrypted based on additive homomorphism |
| CN110059494A (en) * | 2019-04-17 | 2019-07-26 | 深圳市路云区链网络科技有限公司 | A kind of method for secret protection and block catenary system of block chain transaction data |
| US20200074459A1 (en) * | 2018-08-30 | 2020-03-05 | Alibaba Group Holding Limited | Method, apparatus and electronic device for blockchain transactions |
| CN113094733A (en) * | 2021-04-25 | 2021-07-09 | 永旗(北京)科技有限公司 | Block chain data privacy protection method and system |
| CN113269642A (en) * | 2021-05-24 | 2021-08-17 | 深圳壹账通智能科技有限公司 | Transaction processing method, device, equipment and storage medium based on block chain |
| KR20210131031A (en) * | 2020-04-23 | 2021-11-02 | 에스케이 주식회사 | Method for managing user key using smart contract on blockchain |
-
2022
- 2022-01-25 CN CN202210089865.4A patent/CN114297721B/en active Active
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106549749A (en) * | 2016-12-06 | 2017-03-29 | 杭州趣链科技有限公司 | A kind of block chain method for secret protection encrypted based on additive homomorphism |
| US20200074459A1 (en) * | 2018-08-30 | 2020-03-05 | Alibaba Group Holding Limited | Method, apparatus and electronic device for blockchain transactions |
| CN110059494A (en) * | 2019-04-17 | 2019-07-26 | 深圳市路云区链网络科技有限公司 | A kind of method for secret protection and block catenary system of block chain transaction data |
| KR20210131031A (en) * | 2020-04-23 | 2021-11-02 | 에스케이 주식회사 | Method for managing user key using smart contract on blockchain |
| CN113094733A (en) * | 2021-04-25 | 2021-07-09 | 永旗(北京)科技有限公司 | Block chain data privacy protection method and system |
| CN113269642A (en) * | 2021-05-24 | 2021-08-17 | 深圳壹账通智能科技有限公司 | Transaction processing method, device, equipment and storage medium based on block chain |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116204912B (en) * | 2023-04-28 | 2023-09-12 | 北京天润基业科技发展股份有限公司 | Data processing method and device based on isomorphic encryption |
| CN116781390A (en) * | 2023-07-18 | 2023-09-19 | 中移动信息技术有限公司 | Data transmission methods, devices, equipment and storage media |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114297721B (en) | 2025-01-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP6515246B2 (en) | Determination of common secrets for the secure exchange of information and hierarchical and deterministic encryption keys | |
| CN107911216B (en) | A method and system for privacy protection of blockchain transactions | |
| KR102801145B1 (en) | How to implement blockchain to control and distribute digital content | |
| KR102717212B1 (en) | Secure, multi-agency, loss-proof storage and transfer of cryptographic keys for blockchain-based systems linked to wallet management systems | |
| CN113424185A (en) | Fast inadvertent transmission | |
| CN110289968B (en) | Private key recovery method, collaborative address creation method, collaborative address signature device and storage medium | |
| CN115455476A (en) | Vertical federated learning privacy protection method and system based on multi-key homomorphic encryption | |
| CN115296838B (en) | Block chain-based data sharing method, system and storage medium | |
| US8806206B2 (en) | Cooperation method and system of hardware secure units, and application device | |
| CN109754226B (en) | Data management method, device and storage medium | |
| TW202232913A (en) | Generating shared keys | |
| US12113914B2 (en) | Systems and methods for enforcing cryptographically secure actions in public, non-permissioned blockchains using bifurcated self-executing programs comprising shared digital signature requirements | |
| WO2021154157A1 (en) | Blockchain-based data exchange | |
| CN112039883A (en) | A method and device for data sharing of blockchain | |
| CN114297721A (en) | Information processing method, information processing apparatus, block chain platform, and storage medium | |
| CN118171294A (en) | A privacy protection method for federated learning based on homomorphic encryption | |
| CN102907041B (en) | A kind of data-sharing systems, data distribution systems and data guard method | |
| CN111429119B (en) | Blockchain technology for encryption, payment, inquiry and submission of digital currency | |
| KR102819698B1 (en) | Method and device for enabling secure digital communication among groups | |
| CN117077156B (en) | Data processing method and electronic device | |
| US12170720B2 (en) | Location-key encryption system | |
| EP4399834A1 (en) | Generating shared cryptographic keys | |
| CN117176351B (en) | Data transmission processing method, system, computer equipment and storage medium | |
| US12107954B2 (en) | Location key search of encrypted files without decryption | |
| US12341876B2 (en) | Cryptographic key management and transfer |
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 |