CN115913513B - Distributed trusted data transaction method, system and device supporting privacy protection - Google Patents

Distributed trusted data transaction method, system and device supporting privacy protection Download PDF

Info

Publication number
CN115913513B
CN115913513B CN202310021062.XA CN202310021062A CN115913513B CN 115913513 B CN115913513 B CN 115913513B CN 202310021062 A CN202310021062 A CN 202310021062A CN 115913513 B CN115913513 B CN 115913513B
Authority
CN
China
Prior art keywords
data
transaction
privacy protection
distributed
identity
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
Application number
CN202310021062.XA
Other languages
Chinese (zh)
Other versions
CN115913513A (en
Inventor
马兆丰
董建成
张茜
段鹏飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing University of Posts and Telecommunications
Original Assignee
Beijing University of Posts and Telecommunications
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing University of Posts and Telecommunications filed Critical Beijing University of Posts and Telecommunications
Priority to CN202310021062.XA priority Critical patent/CN115913513B/en
Publication of CN115913513A publication Critical patent/CN115913513A/en
Application granted granted Critical
Publication of CN115913513B publication Critical patent/CN115913513B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Storage Device Security (AREA)

Abstract

The invention provides a distributed trusted data transaction method, a system and a device supporting privacy protection, wherein in the data transaction process, the privacy protection of data in the storage process is ensured by introducing disc-falling encryption on the basis of distributed storage; in the transaction process, the decentralized identity information is provided for a data provider and a data demander through a distributed multi-center identity identification protocol, so that the identity privacy of a user can be ensured; by introducing homomorphic encryption and zero knowledge proof in the transaction process, service of transaction calculation or authentication is provided for users under the condition that data originals do not need to be disclosed, and transaction data privacy is guaranteed.

Description

支持隐私保护的分布式可信数据交易方法、系统及装置Distributed trusted data transaction method, system and device supporting privacy protection

技术领域Technical Field

本发明涉及区块链技术领域,尤其涉及一种支持隐私保护的分布式可信数据交易方法、系统及装置。The present invention relates to the field of blockchain technology, and in particular to a distributed trusted data transaction method, system and device supporting privacy protection.

背景技术Background Art

在互联网应用日益普及的大环境下,大量应用需要将发生的事件、行为、状态持久地记录在数据库中以用于日后的查询,即进行持久化存储。传统的方法采用由数据管理服务平台作为公正的第三方进行统一记账,所有的交易信息的查询操作全部在这个平台上进行处理,其他机构和组织的数据也以接入的方式添加至交易服务平台。在这种传统集中式记账方式里,主要的交易信息存储在单一的记账方,这是一种“逻辑”上的集中式存储模式,即交易数据存储在唯一的某业务参与方并由其负责管理。As Internet applications become increasingly popular, a large number of applications need to record the events, behaviors, and states that occur in a persistent manner in the database for future queries, that is, for persistent storage. The traditional method uses a data management service platform as an impartial third party to perform unified accounting. All query operations for transaction information are processed on this platform, and the data of other institutions and organizations are also added to the transaction service platform in an access manner. In this traditional centralized accounting method, the main transaction information is stored in a single accounting party. This is a "logical" centralized storage model, that is, the transaction data is stored in a single business participant and is managed by it.

集中式记账方式存在数据存取性能问题,即记账方为了保证可靠性需要存储数据的多个副本,从而造成了数据存取的性能瓶颈;数据信任问题,即交易数据可能被记账方篡改且无法验证,因此各参与方需要完全信任记账方;数据灾备问题,即记账方受到攻击后数据难以恢复。因此,传统集中式记账方式存在着存储效率低、可信性差、易受攻击等弊端。The centralized accounting method has data access performance issues, that is, the accounting party needs to store multiple copies of data to ensure reliability, which creates a performance bottleneck for data access; data trust issues, that is, transaction data may be tampered with by the accounting party and cannot be verified, so all participants need to fully trust the accounting party; data disaster recovery issues, that is, it is difficult to recover data after the accounting party is attacked. Therefore, the traditional centralized accounting method has the disadvantages of low storage efficiency, poor credibility, and vulnerability to attacks.

随着加密货币和去中心化应用的流行,区块链技术受到了各行业极大的关注。从数据管理的角度,区块链可以视作是在一个分布式环境下众多不可信节点共同维护且不可篡改的账本。由于节点间相互不可信,区块链通过共识协议,确保数据存储的一致性,实现去中心化的数据管理。基于区块链的数据管理技术通过区块链的链式结构、分布式共识机制将这样过大的权限分散给所有节点参与者,避免了权限过大的中心化第三方恶意破坏数据的可能,可以有效传统数据管理所面临的权限集中,数据真实可靠问题。With the popularity of cryptocurrency and decentralized applications, blockchain technology has received great attention from various industries. From the perspective of data management, blockchain can be regarded as a ledger that is jointly maintained and cannot be tampered with by many untrusted nodes in a distributed environment. Since the nodes are mutually untrustworthy, blockchain uses consensus protocols to ensure the consistency of data storage and realize decentralized data management. Blockchain-based data management technology distributes such excessive authority to all node participants through the chain structure and distributed consensus mechanism of blockchain, avoiding the possibility of centralized third parties with excessive authority maliciously destroying data, and can effectively solve the problems of centralized authority and data authenticity and reliability faced by traditional data management.

区块链系统相比传统分布式数据库系统,在记账方式上提供了更好的分布性、透明性和可信性,在功能上提供了防篡改验证机制和智能合约机制,因此更加适合在非可信环境下的匿名使用。然而,区块链技术在提高效率、降低成本、提高数据安全性的同时也面临严重的隐私泄露问题。其一是链上数据隐私及威胁,包括交易隐私、账户地址隐私、用户身份隐私等链上数据信息。其二是智能合约隐私及威胁,智能合约概念的提出为区块链提供了更广阔的应用场景,但智能合约技术在实际应用时有可能导致数据隐私的泄露.用户发起函数调用后系统会构建智能合约交易,区块链系统中的许多节点会对该交易进行处理,这要求与交易相关的操作和数据需要对所有节点开放,在处理敏感数据的应用场景时会存在隐私泄露的问题,如投票方案、医疗数据收集等。Compared with traditional distributed database systems, blockchain systems provide better distribution, transparency and credibility in accounting methods, and provide tamper-proof verification mechanisms and smart contract mechanisms in terms of functions. Therefore, they are more suitable for anonymous use in non-trusted environments. However, while blockchain technology improves efficiency, reduces costs and improves data security, it also faces serious privacy leakage problems. The first is the privacy and threats of on-chain data, including transaction privacy, account address privacy, user identity privacy and other on-chain data information. The second is the privacy and threats of smart contracts. The concept of smart contracts provides a broader application scenario for blockchain, but smart contract technology may lead to data privacy leakage in actual application. After the user initiates a function call, the system will build a smart contract transaction, and many nodes in the blockchain system will process the transaction. This requires that operations and data related to the transaction need to be open to all nodes. There will be privacy leakage problems in application scenarios that process sensitive data, such as voting schemes and medical data collection.

发明内容Summary of the invention

鉴于此,本发明实施例提供了一种支持隐私保护的分布式可信数据交易方法、系统及装置,以消除或改善现有技术中存在的一个或更多个缺陷,以解决现有区块链技术由于透明的信任机制导致隐私数据无法得到保障的问题。In view of this, the embodiments of the present invention provide a distributed trusted data transaction method, system and device that support privacy protection, so as to eliminate or improve one or more defects existing in the prior art, so as to solve the problem that privacy data cannot be guaranteed due to the transparent trust mechanism of the existing blockchain technology.

一方面,本发明提供一种支持隐私保护的分布式可信数据交易方法,所述方法由数据管理模块执行,所述数据管理模块还通过数据接口连接调用隐私保护模块、区块链基础设施和存储模块,该方法包括以下步骤:In one aspect, the present invention provides a distributed trusted data transaction method supporting privacy protection, the method being executed by a data management module, the data management module also calling a privacy protection module, a blockchain infrastructure and a storage module through a data interface connection, the method comprising the following steps:

由所述数据管理模块接收数据提供方发送的数据上传请求,所述数据上传请求包含所述数据提供方的第一权限信息;验证所述第一权限信息,在验证通过的情况下,接收所述数据提供方的交易数据;The data management module receives a data upload request sent by a data provider, wherein the data upload request includes first permission information of the data provider; verifies the first permission information, and receives transaction data of the data provider if the verification passes;

所述数据管理模块调用所述隐私保护模块使用基于分布式多中心的身份标识协议生成所述数据提供方的第一去中心化身份,并反馈至所述数据提供方;所述隐私保护模块采用同态加密算法加密所述交易数据得到交易密文;The data management module calls the privacy protection module to generate the first decentralized identity of the data provider using a distributed multi-center-based identity identification protocol, and feeds back to the data provider; the privacy protection module uses a homomorphic encryption algorithm to encrypt the transaction data to obtain a transaction ciphertext;

所述数据管理模块调用所述区块链基础设施基于落盘加密将所述第一去中心化身份和所述交易密文分布式上链存储至所述存储模块,得到第一存储结果和第一上链交易回执并发送至所述数据管理模块;The data management module calls the blockchain infrastructure to store the first decentralized identity and the transaction ciphertext in a distributed manner on the chain to the storage module based on disk encryption, obtains a first storage result and a first on-chain transaction receipt, and sends them to the data management module;

由所述数据管理模块接收数据需求方发送的数据交易请求,所述数据交易请求中包含所述数据需求方的第二权限信息;验证所述第二权限信息,在验证通过的情况下,所述隐私保护模块使用基于分布式多中心的身份标识协议生成所述数据需求方的第二去中心化身份,并发送至所述数据需求方;The data management module receives a data transaction request sent by a data demander, wherein the data transaction request includes the second permission information of the data demander; verifies the second permission information, and if the verification is passed, the privacy protection module generates a second decentralized identity of the data demander using an identity identification protocol based on a distributed multi-center, and sends it to the data demander;

所述数据管理模块调用所述隐私保护模块根据所述数据交易请求,对所述交易密文进行同态计算或生成零知识证明;The data management module calls the privacy protection module to perform homomorphic calculation on the transaction ciphertext or generate zero-knowledge proof according to the data transaction request;

所述数据管理模块调用所述区块链基础设施获取所述数据交易请求对应的数据提供方的第一去中心化身份;The data management module calls the blockchain infrastructure to obtain a first decentralized identity of a data provider corresponding to the data transaction request;

所述数据管理模块调用所述隐私保护模块将所述同态计算的结果或所述零知识证明发送至所述区块链基础设施,由所述区块链基础设施基于落盘加密分布式存储至所述存储模块,得到第二存储结果和第二上链交易回执;The data management module calls the privacy protection module to send the result of the homomorphic computation or the zero-knowledge proof to the blockchain infrastructure, which is then distributed and stored in the storage module based on disk encryption by the blockchain infrastructure to obtain a second storage result and a second on-chain transaction receipt;

所述区块链基础设施将所述第二存储结果和所述第二上链交易回执发送至所述数据管理模块;The blockchain infrastructure sends the second storage result and the second on-chain transaction receipt to the data management module;

所述数据管理模块将所述同态计算的结果或所述零知识证明发送至所述数据需求方,以及将包含所述第一去中心化身份的可信凭证发送至数据需求方。The data management module sends the result of the homomorphic computation or the zero-knowledge proof to the data demander, and sends the trusted credential containing the first decentralized identity to the data demander.

在一些实施例中,所述隐私保护模块采用同态加密算法加密所述交易数据得到交易密文中,所述同态加密算法采用基于格密码的全同态加密算法。In some embodiments, the privacy protection module uses a homomorphic encryption algorithm to encrypt the transaction data to obtain a transaction ciphertext, and the homomorphic encryption algorithm uses a fully homomorphic encryption algorithm based on a lattice cipher.

在一些实施例中,所述基于格密码的全同态加密算法中,将私钥sk表示为向量

Figure 100002_DEST_PATH_IMAGE002
,公钥pk表示为A,明文表示为
Figure 100002_DEST_PATH_IMAGE003
,密文表示为C;In some embodiments, in the fully homomorphic encryption algorithm based on lattice cipher, the private key sk is represented as a vector
Figure 100002_DEST_PATH_IMAGE002
, the public key pk is represented by A, and the plain text is represented by
Figure 100002_DEST_PATH_IMAGE003
, the ciphertext is represented by C;

获取用于生成安全参数的Setup函数,用于生成私钥的SecretKeyGen函数和用于生成公钥的PublicKeyGen函数;Get the Setup function for generating security parameters, the SecretKeyGen function for generating private keys, and the PublicKeyGen function for generating public keys;

所述Setup函数中,

Figure 100002_DEST_PATH_IMAGE004
选择一个模数q,
Figure 100002_DEST_PATH_IMAGE005
比特长,晶格尺寸参数
Figure 100002_DEST_PATH_IMAGE006
和误差分布函数
Figure 100002_DEST_PATH_IMAGE007
Figure 100002_DEST_PATH_IMAGE009
表示加密算法的系统安全参数,
Figure 100002_DEST_PATH_IMAGE011
表示同态运算的层数;同时选择参数
Figure 100002_DEST_PATH_IMAGE012
,并合并参数
Figure 100002_DEST_PATH_IMAGE013
Figure 100002_DEST_PATH_IMAGE014
Figure 100002_DEST_PATH_IMAGE015
;函数
Figure 100002_DEST_PATH_IMAGE016
表示复杂度;In the Setup function,
Figure 100002_DEST_PATH_IMAGE004
Choose a modulus q,
Figure 100002_DEST_PATH_IMAGE005
Bit length, lattice size parameters
Figure 100002_DEST_PATH_IMAGE006
and the error distribution function
Figure 100002_DEST_PATH_IMAGE007
,
Figure 100002_DEST_PATH_IMAGE009
Represents the system security parameters of the encryption algorithm,
Figure 100002_DEST_PATH_IMAGE011
Indicates the number of layers of homomorphic operations; at the same time, select the parameters
Figure 100002_DEST_PATH_IMAGE012
, and merge the parameters
Figure 100002_DEST_PATH_IMAGE013
,
Figure 100002_DEST_PATH_IMAGE014
,
Figure 100002_DEST_PATH_IMAGE015
;function
Figure 100002_DEST_PATH_IMAGE016
Represents complexity;

所述SecretKeyGen函数中,SecretKeyGen(params)取样

Figure 100002_DEST_PATH_IMAGE017
,代表向量t的维度为n且属于素数有限域,输出私钥sk=
Figure 100002_DEST_PATH_IMAGE018
,并满足
Figure 100002_DEST_PATH_IMAGE019
;In the SecretKeyGen function, SecretKeyGen(params) samples
Figure 100002_DEST_PATH_IMAGE017
, which means that the dimension of vector t is n and belongs to the prime finite field, and the output private key sk=
Figure 100002_DEST_PATH_IMAGE018
, and meet
Figure 100002_DEST_PATH_IMAGE019
;

所述PublicKeyGen函数中, PublicKeyGen(params,sk)均匀随机生成一个矩阵

Figure 100002_DEST_PATH_IMAGE020
和向量
Figure 100002_DEST_PATH_IMAGE021
,令
Figure 100002_DEST_PATH_IMAGE022
,让A是由
Figure 100002_DEST_PATH_IMAGE023
与n列矩阵B一起组成的n+1列矩阵,设公钥pk=A;In the PublicKeyGen function, PublicKeyGen(params,sk) uniformly randomly generates a matrix
Figure 100002_DEST_PATH_IMAGE020
and vector
Figure 100002_DEST_PATH_IMAGE021
,make
Figure 100002_DEST_PATH_IMAGE022
, let A be
Figure 100002_DEST_PATH_IMAGE023
Together with the n-column matrix B, it forms an n+1-column matrix. Let the public key pk=A;

消息加密算法Enc(params,pk,μ),为加密明文

Figure DEST_PATH_IMAGE024
Figure 100002_DEST_PATH_IMAGE025
表示素数有限域,范围为(-q/2,q/2),取样一个均值矩阵
Figure 100002_DEST_PATH_IMAGE026
,输出密文C,计算式如下:Message encryption algorithm Enc(params,pk,μ), which is the encrypted plaintext
Figure DEST_PATH_IMAGE024
,
Figure 100002_DEST_PATH_IMAGE025
Represents a prime finite field, ranging from (-q/2,q/2), sampling a mean matrix
Figure 100002_DEST_PATH_IMAGE026
, output ciphertext C, the calculation formula is as follows:

Figure 100002_DEST_PATH_IMAGE027
Figure 100002_DEST_PATH_IMAGE027
;

其中,BitDecomp(•)函数表示将输入的每一位按照二进制展开,

Figure 100002_DEST_PATH_IMAGE028
是它的反函数,Flatten(•)函数为
Figure 100002_DEST_PATH_IMAGE029
;The BitDecomp(•) function represents expanding each bit of the input in binary format.
Figure 100002_DEST_PATH_IMAGE028
is its inverse function, and the Flatten(•) function is
Figure 100002_DEST_PATH_IMAGE029
;

消息解密算法Decry(params,sk,C),解密密文C得到

Figure 100002_DEST_PATH_IMAGE030
。Message decryption algorithm Decry(params,sk,C), decrypt ciphertext C to get
Figure 100002_DEST_PATH_IMAGE030
.

在一些实施例中,所述消息解密算法Decry(params,sk,C),引入两种解密算法Dec(params,sk,C)和MPDec(params,sk,C);In some embodiments, the message decryption algorithm Decry(params,sk,C) introduces two decryption algorithms Dec(params,sk,C) and MPDec(params,sk,C);

Dec(params,sk,C)中,观察向量

Figure 100002_DEST_PATH_IMAGE031
Figure 100002_DEST_PATH_IMAGE032
个系数
Figure 100002_DEST_PATH_IMAGE033
,让
Figure 100002_DEST_PATH_IMAGE034
,让
Figure DEST_PATH_IMAGE035
是C的第i行,计算:In Dec(params,sk,C), the observation vector
Figure 100002_DEST_PATH_IMAGE031
forward
Figure 100002_DEST_PATH_IMAGE032
Coefficient
Figure 100002_DEST_PATH_IMAGE033
,let
Figure 100002_DEST_PATH_IMAGE034
,let
Figure DEST_PATH_IMAGE035
is the i-th row of C, calculate:

Figure 100002_DEST_PATH_IMAGE036
Figure 100002_DEST_PATH_IMAGE036
;

MPDec(params,sk,C)中,已知

Figure 100002_DEST_PATH_IMAGE037
Figure 100002_DEST_PATH_IMAGE038
的前
Figure 100002_DEST_PATH_IMAGE039
个系数为
Figure 100002_DEST_PATH_IMAGE040
,因此如果满足
Figure 100002_DEST_PATH_IMAGE041
,那么
Figure DEST_PATH_IMAGE042
的前
Figure 227642DEST_PATH_IMAGE039
个系数为
Figure DEST_PATH_IMAGE043
,其中
Figure DEST_PATH_IMAGE044
。从
Figure DEST_PATH_IMAGE045
中恢复
Figure DEST_PATH_IMAGE046
,然后从
Figure DEST_PATH_IMAGE047
中恢复下一个最低有效位,以此类推,最终得到明文
Figure DEST_PATH_IMAGE049
;其中,Small表示在能够接受的噪音范围之内。In MPDec(params,sk,C), it is known that
Figure 100002_DEST_PATH_IMAGE037
,
Figure 100002_DEST_PATH_IMAGE038
Before
Figure 100002_DEST_PATH_IMAGE039
The coefficient is
Figure 100002_DEST_PATH_IMAGE040
, so if
Figure 100002_DEST_PATH_IMAGE041
,So
Figure DEST_PATH_IMAGE042
Before
Figure 227642DEST_PATH_IMAGE039
The coefficient is
Figure DEST_PATH_IMAGE043
,in
Figure DEST_PATH_IMAGE044
.from
Figure DEST_PATH_IMAGE045
Recovery
Figure DEST_PATH_IMAGE046
, then from
Figure DEST_PATH_IMAGE047
Recover the next least significant bit from the original text, and so on, and finally get the plaintext
Figure DEST_PATH_IMAGE049
; Among them, Small means it is within the acceptable noise range.

在一些实施例中,所述方法采用FISCO BCOS分布式存储架构存储所述第一去中心化身份、所述交易密文、所述同态计算的结果和/或所述零知识证明。In some embodiments, the method uses the FISCO BCOS distributed storage architecture to store the first decentralized identity, the transaction ciphertext, the result of the homomorphic computation and/or the zero-knowledge proof.

另一方面,本发明还提供一种支持隐私保护的分布式可信数据交易系统,包括:On the other hand, the present invention also provides a distributed trusted data transaction system supporting privacy protection, comprising:

数据管理模块,用于连接数据提供方和数据需求方的客户端,并执行上述的支持隐私保护的分布式可信数据交易方法;A data management module, used to connect the clients of data providers and data demanders, and execute the above-mentioned distributed trusted data transaction method supporting privacy protection;

隐私保护模块,通过数据接口连接所述数据管理模块,用于调用和执行同态加密算法;A privacy protection module, connected to the data management module via a data interface, for calling and executing a homomorphic encryption algorithm;

区块链基础设施,包括多个网络节点,连接所述隐私保护模块和所述数据管理模块,用于记账交易;A blockchain infrastructure, including a plurality of network nodes, connecting the privacy protection module and the data management module, for recording transactions;

存储模块,用于分布式存储交易数据。Storage module, used for distributed storage of transaction data.

在一些实施例中,所述存储模块基于FISCO BCOS分布式存储架构,通过抽象表结构统一SQL和NOSQL,以支持LevelDB、RocksDB和MySQL。In some embodiments, the storage module is based on the FISCO BCOS distributed storage architecture and unifies SQL and NOSQL through an abstract table structure to support LevelDB, RocksDB and MySQL.

在一些实施例中,所述隐私保护模块基于WeIdentity DID分布式多中心的身份标识协议为所述数据提供方和所述数据需求方的客户端提供去中心化的身份标识。In some embodiments, the privacy protection module provides decentralized identity identification for the clients of the data provider and the data demander based on the WeIdentity DID distributed multi-center identity identification protocol.

另一方面,本发明还提供一种支持隐私保护的分布式可信数据交易装置,包括处理器和存储器,其特征在于,所述存储器中存储有计算机指令,所述处理器用于执行所述存储器中存储的计算机指令,当所述计算机指令被处理器执行时该装置实现上述方法的步骤。On the other hand, the present invention also provides a distributed trusted data transaction device that supports privacy protection, including a processor and a memory, characterized in that computer instructions are stored in the memory, and the processor is used to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the device implements the steps of the above method.

另一方面,本发明还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述方法的步骤。On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when executed by a processor.

本发明的有益效果至少是:The beneficial effects of the present invention are at least:

本发明所述支持隐私保护的分布式可信数据交易方法、系统及装置,在数据交易过程中,在分布式存储的基础上通过引入落盘加密保障数据在存储过程中的隐私保护;在交易过程中通过分布式多中心的身份标识协议为数据提供者和数据需求者提供去中心化的身份信息,能够保障用户的身份隐私;通过在交易过程中引入同态加密和零知识证明,在不需要披露数据原文的情况下,为用户提供交易计算或认证的服务,保障了交易数据隐私。The distributed trusted data transaction method, system and device supporting privacy protection described in the present invention, during the data transaction process, introduces disk encryption on the basis of distributed storage to ensure the privacy of data during the storage process; during the transaction process, a distributed multi-center identity identification protocol is used to provide decentralized identity information for data providers and data demanders, thereby ensuring the identity privacy of users; by introducing homomorphic encryption and zero-knowledge proof in the transaction process, transaction calculation or authentication services are provided to users without disclosing the original data, thereby ensuring the privacy of transaction data.

本发明的附加优点、目的,以及特征将在下面的描述中将部分地加以阐述,且将对于本领域普通技术人员在研究下文后部分地变得明显,或者可以根据本发明的实践而获知。本发明的目的和其它优点可以通过在说明书以及附图中具体指出的结构实现到并获得。Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.

本领域技术人员将会理解的是,能够用本发明实现的目的和优点不限于以上具体所述,并且根据以下详细说明将更清楚地理解本发明能够实现的上述和其他目的。Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,并不构成对本发明的限定。在附图中:The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings:

图1为本发明一实施例所述支持隐私保护的分布式可信数据交易方法流程图。FIG1 is a flow chart of a distributed trusted data transaction method supporting privacy protection according to an embodiment of the present invention.

图2为本发明另一实施例所述基于同态加密和零知识证明的算法协议时序图。FIG2 is a timing diagram of an algorithm protocol based on homomorphic encryption and zero-knowledge proof according to another embodiment of the present invention.

具体实施方式DETAILED DESCRIPTION

为使本发明的目的、技术方案和优点更加清楚明白,下面结合实施方式和附图,对本发明做进一步详细说明。在此,本发明的示意性实施方式及其说明用于解释本发明,但并不作为对本发明的限定。In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

在此,还需要说明的是,为了避免因不必要的细节而模糊了本发明,在附图中仅仅示出了与根据本发明的方案密切相关的结构和/或处理步骤,而省略了与本发明关系不大的其他细节。It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and/or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.

应该强调,术语“包括/包含”在本文使用时指特征、要素、步骤或组件的存在,但并不排除一个或更多个其它特征、要素、步骤或组件的存在或附加。It should be emphasized that the term “include/comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.

在此,还需要说明的是,如果没有特殊说明,术语“连接”在本文不仅可以指直接连接,也可以表示存在中间物的间接连接。It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection with an intermediate.

在下文中,将参考附图描述本发明的实施例。在附图中,相同的附图标记代表相同或类似的部件,或者相同或类似的步骤。Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.

传统数据管理将数据经过加密存储在一个具有公信力的第三方,并绑定时间戳、操作人等信息用来证明源信息的可靠性。其数据的存取和验证过程中都需要无条件信任第三方,第三方权限过于集中,如果第三方恶意篡改或删除数据,则无法检验,无法保证数据是真实且可靠的。基于区块链的数据管理技术可以建立高效透明的信任机制,有效解决传统数据管理在存取和使用过程中所面临的权限集中和的信任问题。但是,对区块链应用程序开发过程中仍然存在大量的数据管理问题, 如数据隐私、可伸缩性和延迟。针对上述问题,本发明提出支持隐私保护的分布式可信数据管理系统及方法,可有效解决传统中心化数据管理的痛点,并从存储隐私、数据隐私、身份隐私三个方面实现隐私保护。采用“隐私保护和区块链”技术相结合的形式,使用隐私保护技术和区块链数据管理技术相辅相成,保证信息系统的机密性、完整性、可用性、认证性和不可否认性。通过系统将数据存储和处理,在保证隐私的条件下实现数据的安全可用。Traditional data management encrypts and stores data in a credible third party, and binds timestamps, operators and other information to prove the reliability of the source information. The access and verification of data requires unconditional trust in the third party. The third party's authority is too centralized. If the third party maliciously tampers with or deletes the data, it cannot be verified, and the data cannot be guaranteed to be true and reliable. Blockchain-based data management technology can establish an efficient and transparent trust mechanism, effectively solving the centralized authority and trust problems faced by traditional data management in the access and use process. However, there are still a large number of data management problems in the development of blockchain applications, such as data privacy, scalability and latency. In response to the above problems, the present invention proposes a distributed trusted data management system and method that supports privacy protection, which can effectively solve the pain points of traditional centralized data management and realize privacy protection from three aspects: storage privacy, data privacy and identity privacy. The combination of "privacy protection and blockchain" technology is adopted, and the privacy protection technology and blockchain data management technology complement each other to ensure the confidentiality, integrity, availability, authentication and non-repudiation of the information system. The data is stored and processed by the system, and the data is made secure and available under the condition of ensuring privacy.

具体的,一方面,本发明提供一种支持隐私保护的分布式可信数据交易方法,所述方法由数据管理模块执行,数据管理模块还通过数据接口连接调用隐私保护模块、区块链基础设施和存储模块。在实际运行过程中,数据管理模块、隐私保护模块可以采用独立硬件,也可以装载在区块链网络的智能体上运行。Specifically, on the one hand, the present invention provides a distributed trusted data transaction method supporting privacy protection, which is executed by a data management module, and the data management module also calls a privacy protection module, a blockchain infrastructure, and a storage module through a data interface connection. In the actual operation process, the data management module and the privacy protection module can use independent hardware or be loaded on an intelligent body of the blockchain network for operation.

该方法包括以下步骤S101~S109:The method comprises the following steps S101 to S109:

步骤S101:由数据管理模块接收数据提供方发送的数据上传请求,数据上传请求包含数据提供方的第一权限信息;验证第一权限信息,在验证通过的情况下,接收数据提供方的交易数据。Step S101: The data management module receives a data upload request sent by a data provider, the data upload request includes the first permission information of the data provider; verifies the first permission information, and receives the transaction data of the data provider if the verification passes.

步骤S102:数据管理模块调用隐私保护模块使用基于分布式多中心的身份标识协议生成数据提供方的第一去中心化身份,并反馈至数据提供方;隐私保护模块采用同态加密算法加密交易数据得到交易密文。Step S102: The data management module calls the privacy protection module to use the distributed multi-center-based identity identification protocol to generate the first decentralized identity of the data provider, and feeds it back to the data provider; the privacy protection module uses the homomorphic encryption algorithm to encrypt the transaction data to obtain the transaction ciphertext.

步骤S103:数据管理模块调用区块链基础设施基于落盘加密将第一去中心化身份和交易密文分布式上链存储至存储模块,得到第一存储结果和第一上链交易回执并发送至所述数据管理模块。Step S103: The data management module calls the blockchain infrastructure to store the first decentralized identity and transaction ciphertext in a distributed manner on the chain to the storage module based on disk encryption, obtains the first storage result and the first on-chain transaction receipt and sends them to the data management module.

步骤S104:由数据管理模块接收数据需求方发送的数据交易请求,数据交易请求中包含数据需求方的第二权限信息;验证第二权限信息,在验证通过的情况下,隐私保护模块使用基于分布式多中心的身份标识协议生成数据需求方的第二去中心化身份,并发送至数据需求方。Step S104: The data management module receives a data transaction request sent by the data demander, which includes the second permission information of the data demander; verifies the second permission information, and if the verification is successful, the privacy protection module uses an identity identification protocol based on a distributed multi-center to generate a second decentralized identity of the data demander, and sends it to the data demander.

步骤S105:数据管理模块调用隐私保护模块根据数据交易请求,对交易密文进行同态计算或生成零知识证明。Step S105: The data management module calls the privacy protection module to perform homomorphic calculation on the transaction ciphertext or generate zero-knowledge proof according to the data transaction request.

步骤S106:数据管理模块调用区块链基础设施获取数据交易请求对应的数据提供方的第一去中心化身份。Step S106: The data management module calls the blockchain infrastructure to obtain the first decentralized identity of the data provider corresponding to the data transaction request.

步骤S107:数据管理模块调用隐私保护模块将同态计算的结果或零知识证明发送至区块链基础设施,由区块链基础设施基于落盘加密分布式存储至存储模块,得到第二存储结果和第二上链交易回执。Step S107: The data management module calls the privacy protection module to send the result of the homomorphic computing or the zero-knowledge proof to the blockchain infrastructure, which then stores the result in a distributed manner based on disk encryption to the storage module to obtain a second storage result and a second on-chain transaction receipt.

步骤S108:区块链基础设施将第二存储结果和第二上链交易回执发送至数据管理模块。Step S108: The blockchain infrastructure sends the second storage result and the second on-chain transaction receipt to the data management module.

步骤S109:数据管理模块将同态计算的结果或零知识证明发送至数据需求方,以及将包含第一去中心化身份的可信凭证发送至数据需求方。Step S109: The data management module sends the result of the homomorphic computing or the zero-knowledge proof to the data demander, and sends the trusted certificate containing the first decentralized identity to the data demander.

在步骤S101中,数据提供方对于需要上链存储的数据提出数据上传请求,其中,数据提供方的第一权限信息可以在特定字段添加身份标识,以确认其拥有上传数据的权限。该第一权限信息不仅可以标记具有数据上传权限的主体,还可以标记所允许上传的数据的类型、数据格式和数据长度等。只有在验证通过的情况下,才允许执行后续的上传操作,如果验证不通过则停止交易。In step S101, the data provider makes a data upload request for the data to be stored on the chain, wherein the first permission information of the data provider can add an identity in a specific field to confirm that it has the authority to upload data. The first permission information can not only mark the subject with data upload authority, but also mark the type, data format and data length of the data allowed to be uploaded. Only if the verification is passed, the subsequent upload operation is allowed to be performed. If the verification fails, the transaction is stopped.

在步骤S102中,本实施例基于分布式多中心的身份标识协议为WeIdentity DID,可以是用户在交易过程中选择性披露或提供身份证明,以达到身份隐私保护的目的。分布式数字身份主张用户管理和控制数字身份,不同用户之间不依赖于第三方进行安全通信。通过用户自己管理的 DID标识符和密钥、注册到分布式账本的分布式数字身份数据,满足基于 DID的点对点相互认证和安全通信需要。就两点间通信而言,其安全通信的工作原理依然是基于传统 PKI挑战响应机制和协商数据加密方式。这种安全通信的底层协议可使用HTTP、RPC、蓝牙、NFC或其它协议,成为不同解决方案之间端到端互联互通的标准通信方式;就全网所有节点而言,通过部署在去中心化服务器及个人客户端的身份密钥钱包,以及全网共享的 DID分布式账本,代表任意不同实体身份的节点之间都可以实现基于非对称密钥方式的认证交互,并最终通过这种实体间的信任传递实现全网信任。In step S102, the distributed multi-center identity identification protocol in this embodiment is WeIdentity DID, which can be selectively disclosed or provided by the user during the transaction process to achieve the purpose of identity privacy protection. Distributed digital identity advocates that users manage and control digital identities, and different users do not rely on third parties for secure communication. Through the DID identifier and key managed by the user himself and the distributed digital identity data registered to the distributed ledger, the needs of point-to-point mutual authentication and secure communication based on DID are met. As far as communication between two points is concerned, the working principle of its secure communication is still based on the traditional PKI challenge response mechanism and negotiated data encryption method. The underlying protocol of this secure communication can use HTTP, RPC, Bluetooth, NFC or other protocols, becoming a standard communication method for end-to-end interconnection between different solutions; as far as all nodes in the entire network are concerned, through the identity key wallet deployed on the decentralized server and personal client, and the DID distributed ledger shared by the entire network, nodes representing any different entity identities can realize authentication interaction based on asymmetric key mode, and finally realize network-wide trust through such trust transfer between entities.

本实施例中,通过引入同态加密(Homomorphic Encryption),将原始数据经过同态加密后,对得到的密文进行特定的运算,然后将计算结果再进行同态解密后得到的明文等价于原始明文数据直接进行相同计算所得到的数据结果。同态加密中,其他用户可以对加密后的数据进行处理,在这个过程中不会泄露任何原始的内容,在数据处理完成之后再进行解密,得到的正是对原始数据进行相同处理后的结果。能够提升数据处理安全性能,保障数据隐私。In this embodiment, homomorphic encryption is introduced to homomorphically encrypt the original data, perform specific operations on the obtained ciphertext, and then homomorphically decrypt the calculation result to obtain a plaintext equivalent to the data result obtained by directly performing the same calculation on the original plaintext data. In homomorphic encryption, other users can process the encrypted data without leaking any original content in the process. After the data processing is completed, it is decrypted and the result is the result of the same processing on the original data. It can improve the security performance of data processing and protect data privacy.

在步骤S103中,本申请采用落盘加密技术进行分布式存储,落盘加密是在机构内部进行的。在机构的内网环境中,每个机构独立地对节点的硬盘数据进行加密。当节点所在机器的硬盘被带离机构,并让节点在机构内网之外的网络启动,硬盘数据将无法解密,节点无法启动。进而无法盗取联盟链上的数据。所以通过落盘加密的方式,可以有效实现数据存储过程中的隐私保护。In step S103, the present application adopts disk encryption technology for distributed storage, and the disk encryption is performed within the organization. In the intranet environment of the organization, each organization independently encrypts the hard disk data of the node. When the hard disk of the machine where the node is located is taken away from the organization, and the node is started in a network outside the organization's intranet, the hard disk data cannot be decrypted and the node cannot be started. Therefore, the data on the alliance chain cannot be stolen. Therefore, by means of disk encryption, privacy protection during data storage can be effectively achieved.

在步骤S104中,与步骤S101相对应的,也需要数据需求方的权限进行查验,以确认其拥有相应数据的访问权限。第二权限信息的形式和内容可以参照第一权限信息设置。通过WeIdentity DID协议为其提供第二去中心化身份,可以有效保护数据需求方的身份隐私。In step S104, corresponding to step S101, the data demander's authority is also required to be checked to confirm that it has access rights to the corresponding data. The form and content of the second permission information can be set with reference to the first permission information. Providing a second decentralized identity through the WeIdentity DID protocol can effectively protect the identity privacy of the data demander.

在步骤S105中,基于数据交易请求,由隐私保护模块对需求的交易密文进行同态计算或生成零知识证明。具体的,对于需要进行计算的数据,采用同态加密进行计算,对于需要进行证明的数据,则提供零知识证明。In step S105, based on the data transaction request, the privacy protection module performs homomorphic calculation on the required transaction ciphertext or generates a zero-knowledge proof. Specifically, for data that needs to be calculated, homomorphic encryption is used for calculation, and for data that needs to be proved, a zero-knowledge proof is provided.

在步骤S106~S109中,同步发送第一去中心化身份至数据需求方,以证明提供的同态计算结果或零知识证明确实来源于所需的数据提供方,并对交易过程进行上链存储和记录。In steps S106 to S109, the first decentralized identity is synchronously sent to the data demander to prove that the provided homomorphic computing results or zero-knowledge proofs are indeed derived from the required data provider, and the transaction process is stored and recorded on the chain.

在一些实施例中,步骤S102中,隐私保护模块采用同态加密算法加密交易数据得到交易密文中,同态加密算法采用基于格密码的全同态加密算法。相应的步骤S105,中也采用全同态加密算法进行计算。In some embodiments, in step S102, the privacy protection module uses a homomorphic encryption algorithm to encrypt the transaction data to obtain a transaction ciphertext, and the homomorphic encryption algorithm uses a fully homomorphic encryption algorithm based on a lattice cipher. Correspondingly, in step S105, a fully homomorphic encryption algorithm is also used for calculation.

具体的,基于格密码的全同态加密算法中,将私钥sk表示为向量

Figure DEST_PATH_IMAGE050
,公钥pk表示为A,明文表示为
Figure 456367DEST_PATH_IMAGE003
,密文表示为C。Specifically, in the fully homomorphic encryption algorithm based on lattice cryptography, the private key sk is represented as a vector
Figure DEST_PATH_IMAGE050
, the public key pk is represented by A, and the plain text is represented by
Figure 456367DEST_PATH_IMAGE003
, the ciphertext is represented by C.

获取用于生成安全参数的Setup函数,用于生成私钥的SecretKeyGen函数和用于生成公钥的PublicKeyGen函数。Get the Setup function for generating security parameters, the SecretKeyGen function for generating private keys, and the PublicKeyGen function for generating public keys.

Setup函数中,

Figure 501684DEST_PATH_IMAGE004
选择一个模数q,
Figure 428051DEST_PATH_IMAGE005
比特长,晶格尺寸参数
Figure 383369DEST_PATH_IMAGE006
和误差分布函数
Figure 471411DEST_PATH_IMAGE007
Figure DEST_PATH_IMAGE051
Figure DEST_PATH_IMAGE052
表示与
Figure DEST_PATH_IMAGE053
Figure DEST_PATH_IMAGE055
相关,
Figure 613810DEST_PATH_IMAGE009
表示加密算法的系统安全参数,
Figure 343869DEST_PATH_IMAGE011
表示同态运算的层数。同时选择参数
Figure 917807DEST_PATH_IMAGE012
,并合并参数
Figure 176750DEST_PATH_IMAGE013
Figure 337604DEST_PATH_IMAGE014
Figure 340195DEST_PATH_IMAGE015
;函数
Figure 394739DEST_PATH_IMAGE016
表示复杂度。In the Setup function,
Figure 501684DEST_PATH_IMAGE004
Choose a modulus q,
Figure 428051DEST_PATH_IMAGE005
Bit length, lattice size parameters
Figure 383369DEST_PATH_IMAGE006
and the error distribution function
Figure 471411DEST_PATH_IMAGE007
,
Figure DEST_PATH_IMAGE051
and
Figure DEST_PATH_IMAGE052
Representation and
Figure DEST_PATH_IMAGE053
,
Figure DEST_PATH_IMAGE055
Related,
Figure 613810DEST_PATH_IMAGE009
Represents the system security parameters of the encryption algorithm,
Figure 343869DEST_PATH_IMAGE011
Indicates the number of layers of homomorphic operations. At the same time, select the parameter
Figure 917807DEST_PATH_IMAGE012
, and merge the parameters
Figure 176750DEST_PATH_IMAGE013
,
Figure 337604DEST_PATH_IMAGE014
,
Figure 340195DEST_PATH_IMAGE015
;function
Figure 394739DEST_PATH_IMAGE016
Indicates complexity.

SecretKeyGen函数中,SecretKeyGen(params)取样

Figure 965529DEST_PATH_IMAGE017
,代表向量t的维度为n且属于素数有限域,输出私钥sk=
Figure 738313DEST_PATH_IMAGE018
,并满足
Figure 279016DEST_PATH_IMAGE019
。In the SecretKeyGen function, SecretKeyGen(params) sampling
Figure 965529DEST_PATH_IMAGE017
, which means that the dimension of vector t is n and belongs to the prime finite field, and the output private key sk=
Figure 738313DEST_PATH_IMAGE018
, and meet
Figure 279016DEST_PATH_IMAGE019
.

PublicKeyGen函数中, PublicKeyGen(params,sk)均匀随机生成一个矩阵

Figure 329011DEST_PATH_IMAGE020
和向量
Figure 929757DEST_PATH_IMAGE021
,令
Figure 563738DEST_PATH_IMAGE022
,让A是由
Figure 908132DEST_PATH_IMAGE023
与n列矩阵B一起组成的n+1列矩阵,设公钥pk=A。In the PublicKeyGen function, PublicKeyGen(params,sk) uniformly randomly generates a matrix
Figure 329011DEST_PATH_IMAGE020
and vector
Figure 929757DEST_PATH_IMAGE021
,make
Figure 563738DEST_PATH_IMAGE022
, let A be
Figure 908132DEST_PATH_IMAGE023
Together with the n-column matrix B, it forms an n+1-column matrix, and the public key pk=A.

消息加密算法Enc(params,pk,μ),为加密明文

Figure 937268DEST_PATH_IMAGE024
Figure 849860DEST_PATH_IMAGE025
表示素数有限域,范围为(-q/2,q/2),取样一个均值矩阵
Figure 331657DEST_PATH_IMAGE026
,输出密文C,计算式如下:Message encryption algorithm Enc(params,pk,μ), which is the encrypted plaintext
Figure 937268DEST_PATH_IMAGE024
,
Figure 849860DEST_PATH_IMAGE025
Represents a prime finite field, ranging from (-q/2,q/2), sampling a mean matrix
Figure 331657DEST_PATH_IMAGE026
, output ciphertext C, the calculation formula is as follows:

Figure 479742DEST_PATH_IMAGE027
Figure 479742DEST_PATH_IMAGE027
;

其中,BitDecomp(•)函数表示将输入的每一位按照二进制展开,

Figure 238750DEST_PATH_IMAGE028
是它的反函数,Flatten(•)函数为
Figure 446878DEST_PATH_IMAGE029
。The BitDecomp(•) function represents expanding each bit of the input in binary format.
Figure 238750DEST_PATH_IMAGE028
is its inverse function, and the Flatten(•) function is
Figure 446878DEST_PATH_IMAGE029
.

消息解密算法Decry(params,sk,C),解密密文C得到

Figure 291337DEST_PATH_IMAGE030
。Message decryption algorithm Decry(params,sk,C), decrypt ciphertext C to get
Figure 291337DEST_PATH_IMAGE030
.

在一些实施例中,消息解密算法Decry(params,sk,C),引入两种解密算法Dec(params,sk,C)和MPDec(params,sk,C);In some embodiments, the message decryption algorithm Decry(params,sk,C) introduces two decryption algorithms Dec(params,sk,C) and MPDec(params,sk,C);

Dec能够充分恢复信息

Figure 977533DEST_PATH_IMAGE030
,Dec(params,sk,C)中,观察向量
Figure 715682DEST_PATH_IMAGE031
Figure 745910DEST_PATH_IMAGE032
个系数
Figure 936720DEST_PATH_IMAGE033
,让
Figure 692186DEST_PATH_IMAGE034
,让
Figure 425787DEST_PATH_IMAGE035
是C的第i行,计算:Dec can fully recover information
Figure 977533DEST_PATH_IMAGE030
, in Dec(params,sk,C), the observation vector
Figure 715682DEST_PATH_IMAGE031
forward
Figure 745910DEST_PATH_IMAGE032
Coefficient
Figure 936720DEST_PATH_IMAGE033
,let
Figure 692186DEST_PATH_IMAGE034
,let
Figure 425787DEST_PATH_IMAGE035
is the i-th row of C, calculate:

Figure 116663DEST_PATH_IMAGE036
Figure 116663DEST_PATH_IMAGE036
;

MPDec能够恢复任意

Figure DEST_PATH_IMAGE056
,MPDec(params,sk,C)中,已知
Figure 998031DEST_PATH_IMAGE037
Figure 291609DEST_PATH_IMAGE038
的前
Figure 378251DEST_PATH_IMAGE039
个系数为
Figure 833504DEST_PATH_IMAGE040
,因此如果满足
Figure 139851DEST_PATH_IMAGE041
,那么
Figure 971541DEST_PATH_IMAGE042
的前
Figure 804368DEST_PATH_IMAGE039
个系数为
Figure 305887DEST_PATH_IMAGE043
,其中
Figure 224165DEST_PATH_IMAGE044
。从
Figure 491DEST_PATH_IMAGE045
中恢复
Figure 156666DEST_PATH_IMAGE046
,然后从
Figure 219300DEST_PATH_IMAGE047
中恢复下一个最低有效位,以此类推,最终得到明文
Figure DEST_PATH_IMAGE057
;其中,Small表示在能够接受的噪音范围之内,比如q/4;LSB表示最低有效位(Least SignificantBit)是指一个二进制数字中的第0位(即最低位),权值为2^0,可以用它来检测数的奇偶性。与之相反的称之为最高有效位。在大端序中,LSB指最右边的位。最低有效位代表二进制数中的最小的单位,可以用来指示数字很小的变化。MPDec can recover any
Figure DEST_PATH_IMAGE056
, in MPDec(params,sk,C), it is known that
Figure 998031DEST_PATH_IMAGE037
,
Figure 291609DEST_PATH_IMAGE038
Before
Figure 378251DEST_PATH_IMAGE039
The coefficient is
Figure 833504DEST_PATH_IMAGE040
, so if
Figure 139851DEST_PATH_IMAGE041
,So
Figure 971541DEST_PATH_IMAGE042
Before
Figure 804368DEST_PATH_IMAGE039
The coefficient is
Figure 305887DEST_PATH_IMAGE043
,in
Figure 224165DEST_PATH_IMAGE044
.from
Figure 491DEST_PATH_IMAGE045
Recovery
Figure 156666DEST_PATH_IMAGE046
, then from
Figure 219300DEST_PATH_IMAGE047
Recover the next least significant bit from the original text, and so on, and finally get the plaintext
Figure DEST_PATH_IMAGE057
; Small means within the acceptable noise range, such as q/4; LSB stands for Least Significant Bit, which refers to the 0th bit (i.e. the lowest bit) in a binary number, with a weight of 2^0, and can be used to detect the parity of a number. The opposite is called the Most Significant Bit. In big-endian order, LSB refers to the rightmost bit. The least significant bit represents the smallest unit in a binary number and can be used to indicate very small changes in a number.

在一些实施例中,步骤S101~S109中,所述方法采用FISCO BCOS分布式存储架构存储第一去中心化身份、交易密文、同态计算的结果和/或零知识证明。In some embodiments, in steps S101 to S109, the method uses the FISCO BCOS distributed storage architecture to store the first decentralized identity, transaction ciphertext, results of homomorphic computing and/or zero-knowledge proof.

另一方面,本发明还提供一种支持隐私保护的分布式可信数据交易系统,包括:On the other hand, the present invention also provides a distributed trusted data transaction system supporting privacy protection, comprising:

数据管理模块,用于连接数据提供方和数据需求方的客户端,并执行上述的支持隐私保护的分布式可信数据交易方法;A data management module, used to connect the clients of data providers and data demanders, and execute the above-mentioned distributed trusted data transaction method supporting privacy protection;

隐私保护模块,通过数据接口连接所述数据管理模块,用于调用和执行同态加密算法;A privacy protection module, connected to the data management module via a data interface, for calling and executing a homomorphic encryption algorithm;

区块链基础设施,包括多个网络节点,连接所述隐私保护模块和所述数据管理模块,用于记账交易;A blockchain infrastructure, including a plurality of network nodes, connecting the privacy protection module and the data management module, for recording transactions;

存储模块,用于分布式存储交易数据。Storage module, used for distributed storage of transaction data.

在一些实施例中,存储模块基于FISCO BCOS分布式存储架构,通过抽象表结构统一SQL和NOSQL,以支持LevelDB、RocksDB和MySQL。In some embodiments, the storage module is based on the FISCO BCOS distributed storage architecture and unifies SQL and NOSQL through an abstract table structure to support LevelDB, RocksDB, and MySQL.

在一些实施例中,隐私保护模块基于WeIdentity DID分布式多中心的身份标识协议为所述数据提供方和所述数据需求方的客户端提供去中心化的身份标识。In some embodiments, the privacy protection module provides decentralized identity identification for the clients of the data provider and the data demander based on the WeIdentity DID distributed multi-center identity identification protocol.

另一方面,本发明还提供一种支持隐私保护的分布式可信数据交易装置,包括处理器和存储器,其特征在于,所述存储器中存储有计算机指令,所述处理器用于执行所述存储器中存储的计算机指令,当所述计算机指令被处理器执行时该装置实现上述方法的步骤。On the other hand, the present invention also provides a distributed trusted data transaction device that supports privacy protection, including a processor and a memory, characterized in that computer instructions are stored in the memory, and the processor is used to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the device implements the steps of the above method.

另一方面,本发明还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述方法的步骤。On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when executed by a processor.

下面结合具体实施例对本发明进行说明:The present invention will be described below in conjunction with specific embodiments:

构建支持隐私保护的分布式可信数据交易系统,包括数据管理模块,数据管理模块还通过数据接口连接调用隐私保护模块、区块链基础设施和存储模块。定义数据的提供方和分享者为DO,定义数据的需求方和使用方为DU,定义去中心化的唯一的身份证明为DID,同态运算结果为DR,零知识可信证明为Proof。Build a distributed trusted data transaction system that supports privacy protection, including a data management module, which also calls the privacy protection module, blockchain infrastructure and storage module through a data interface connection. Define the data provider and sharer as DO, the data demander and user as DU, the decentralized unique identity proof as DID, the homomorphic operation result as DR, and the zero-knowledge trusted proof as Proof.

本实施例提供一种支持隐私保护的分布式可信数据交易方法,如图1所示,具体步骤如下:This embodiment provides a distributed trusted data transaction method that supports privacy protection, as shown in FIG1 , and the specific steps are as follows:

步骤1:DO根据业务需求发起数据上传请求,请求到达数据管理模块。Step 1: DO initiates a data upload request based on business needs, and the request reaches the data management module.

步骤2:数据管理模块首先对DO进行访问权限验证,权限通过后接收请求方的数据。Step 2: The data management module first verifies the access rights of the DO, and receives the data from the requester after the permission is passed.

步骤3:对DO的身份生成DID,对DO的数据做隐私保护处理,通过同态加密的加密算法进行加密。Step 3: Generate DID for DO’s identity, perform privacy protection on DO’s data, and encrypt it using the homomorphic encryption algorithm.

步骤4:将DID返回给DO。Step 4: Return the DID to the DO.

步骤5:将密文数据和DID进行分布式存储。首先根据DO的权限进行存储访问控制,权限通过后进行密文数据和DID上链。Step 5: Distribute the encrypted data and DID for storage. First, perform storage access control based on the DO's permissions, and upload the encrypted data and DID to the chain after the permissions are passed.

步骤6:将存储结果和上链交易回执返还给数据管理模块。Step 6: Return the storage results and on-chain transaction receipt to the data management module.

步骤7:将数据上链成功的消息返回给DO。Step 7: Return the message of successful data upload to DO.

步骤8:DU发起获取数据请求,将请求内容发送给数据管理模块。Step 8: DU initiates a request to obtain data and sends the request content to the data management module.

步骤9:对DU进行访问权限验证,权限通过后生成DU的DID并返回给DU。Step 9: Verify access rights for DU. If the rights are approved, generate DU’s DID and return it to DU.

步骤10:根据DU请求的内容对DO的数据进行密文同态计算得到数据结果DR,或生成基于零知识证明的可信证明Proof。Step 10: Perform ciphertext homomorphic calculation on the DO data according to the content requested by DU to obtain the data result DR, or generate a trusted proof Proof based on zero-knowledge proof.

步骤11:为DU提供DO的DID。Step 11: Provide DU with the DID of DO.

步骤12:将交易过程进行上链存储。Step 12: Store the transaction process on the chain.

步骤13:将存储结果和上链交易回执返还给数据管理模块。Step 13: Return the storage results and on-chain transaction receipt to the data management module.

步骤14:返回DU所需要的DR或Proof。Step 14: Return the DR or Proof required by DU.

在上述步骤S1~S14中,存储模块采用分布式存储技术存储身份证明DID,同态运算加密的数据,同态运算结果为DR和零知识可信证明为Proof。存储模块主要包括两部分:世界状态和分布式存储。世界状态可进一步划分成 MPTState 和 StorageState。其中,MPTState使用MPT树存储账户的状态,与以太坊一致。StorageState使用分布式存储的表结构存储账户状态,不存历史信息,去掉了对MPT树的依赖,性能更高。分布式存储(AdvancedMass Database,AMDB):通过抽象表结构,实现了SQL和NOSQL的统一,通过实现对应的存储驱动,可以支持各类数据库,支持LevelDB、RocksDB和MySQL。In the above steps S1~S14, the storage module uses distributed storage technology to store identity proof DID, data encrypted by homomorphic operation, and the result of homomorphic operation is DR and zero-knowledge trusted proof is Proof. The storage module mainly includes two parts: world state and distributed storage. The world state can be further divided into MPTState and StorageState. Among them, MPTState uses MPT tree to store the state of the account, which is consistent with Ethereum. StorageState uses the table structure of distributed storage to store account status, does not store historical information, removes the dependence on MPT tree, and has higher performance. Distributed storage (AdvancedMass Database, AMDB): Through the abstract table structure, the unification of SQL and NOSQL is realized. By implementing the corresponding storage driver, various databases can be supported, including LevelDB, RocksDB and MySQL.

在上述步骤S1~S14中,采用访问控制,一方面是针对用户的权限管理和身份管理;另一方面是针对节点存储数据的访问控制,即落盘加密技术的应用。可有效防止数据在脱离内网的条件下被访问和非授权的情况下访问。In the above steps S1 to S14, access control is used, on the one hand, for user authority management and identity management; on the other hand, it is for node storage data access control, that is, the application of disk encryption technology. It can effectively prevent data from being accessed and unauthorized access when it is out of the intranet.

在上述步骤S1~S14中,采用数据隐私保护,主要结合同态加密和零知识证明,在数据使用过程中使用同态加密的方式进行密文运算,在需要提供证明的场景使用零知识证明技术进行可信证明。In the above steps S1 to S14, data privacy protection is adopted, mainly combining homomorphic encryption and zero-knowledge proof. Homomorphic encryption is used to perform ciphertext operations during data use, and zero-knowledge proof technology is used for trusted proof in scenarios where proof is required.

在上述步骤S1~S14中,还采用分布是身份技术,主要使用基于WeIdentity DID的分布式多中心的身份标识协议,使实体(人或物)的现实身份实现了链上的身份标识;同时,WeIdentity DID给与Entity(人或者物)直接拥有和控制自己身份ID的能力,达到交易过程中进行选择性披露或提供身份证明以达到身份隐私的目的。In the above steps S1~S14, distributed identity technology is also used, mainly using a distributed multi-center identity identification protocol based on WeIdentity DID, so that the real identity of the entity (person or thing) can be realized on the chain; at the same time, WeIdentity DID gives the Entity (person or thing) the ability to directly own and control its own identity ID, so as to achieve the purpose of selective disclosure or provision of identity proof during the transaction process to achieve identity privacy.

具体的,下面对本实施例所采用的三个核心进行说明,包括基于区块链的落盘加密技术、同态加密和零知识证明技术以及基于分布式身份的身份隐私保护技术。Specifically, the three cores adopted in this embodiment are described below, including blockchain-based disk encryption technology, homomorphic encryption and zero-knowledge proof technology, and identity privacy protection technology based on distributed identity.

一、对基于区块链的落盘加密技术进行说明1. Explain the blockchain-based disk encryption technology

区块链部署是多方参与的,为了简化多方协作环境的搭建,通常会使用公有云部署区块链。机构将自己的节点部署到云上,让服务与云上的节点进行交互,实现多方协作。在这个架构中,机构内部的安全性是很高的,尤其是金融机构。虽然通过网络的隔离机制将节点限制在“内网”中,通过网络不能轻易地盗取数据,但是数据全部托管在云上,由于所有参与者都会保存一份数据,在网络和系统安全措施有疏漏或操作不当等极端情况下,可能出现某一份数据被越权访问的情况。基于FISCOBCOS的落盘加密技术可以有效防止数据盘被攻破或者盗取,避免数据泄露情况的发生。Blockchain deployment involves multiple parties. In order to simplify the establishment of a multi-party collaborative environment, blockchain is usually deployed using a public cloud. Institutions deploy their own nodes on the cloud, allowing services to interact with nodes on the cloud to achieve multi-party collaboration. In this architecture, the security within the institution is very high, especially for financial institutions. Although the nodes are restricted to the "intranet" through the network isolation mechanism, data cannot be easily stolen through the network, but all data is hosted on the cloud. Since all participants will save a copy of the data, in extreme cases such as omissions in network and system security measures or improper operation, a copy of the data may be accessed without authorization. The disk encryption technology based on FISCOBCOS can effectively prevent the data disk from being hacked or stolen, and avoid data leakage.

具体的,落盘加密通过节点自身持有的秘钥(dataKey)和Key Manager管理的全局秘钥(superKey)来完成的。Specifically, disk encryption is accomplished through the secret key (dataKey) held by the node itself and the global secret key (superKey) managed by the Key Manager.

节点用自己的dataKey,对自身加密的数据(Encrypted Space)进行加解密。节点本身不会在本地磁盘中存储dataKey,而是存储dataKey被加密后cipherDataKey。节点启动时,拿cipherDataKey向Key Manager请求,获取dataKey。dataKey只在节点的内存中,当节点关闭后,dataKey自动丢弃。The node uses its own dataKey to encrypt and decrypt its own encrypted data (Encrypted Space). The node itself does not store dataKey in the local disk, but stores cipherDataKey after dataKey is encrypted. When the node starts, it takes cipherDataKey to request Key Manager to obtain dataKey. dataKey is only in the node's memory. When the node is shut down, dataKey is automatically discarded.

Key Manager持有全局的superKey,负责对所有节点启动时的授权请求进行响应。Key Manager在节点启动时必须在线,响应节点的启动请求。当节点启动时,发来cipherDataKey,Key Manager用superKey对cipherDataKey进行解密,若解密成功,就将节点的dataKey返回给节点。Key Manager只能在内网访问,机构外的外网无法访问KeyManager。The Key Manager holds the global superKey and is responsible for responding to authorization requests when all nodes start. The Key Manager must be online when the node starts and respond to the node's startup request. When the node starts, it sends the cipherDataKey, and the Key Manager uses the superKey to decrypt the cipherDataKey. If the decryption is successful, the dataKey of the node is returned to the node. The Key Manager can only be accessed on the intranet, and the external network outside the organization cannot access the KeyManager.

二、对同态加密和零知识证明技术的说明2. Description of Homomorphic Encryption and Zero-Knowledge Proof Technology

本实施例中,使用同态加密和零知识证明作为隐私保护的核心,当使用同态加密和零知识证明技术来在区块链中完成一笔交易时,同一个交易中的所有输入地址都隶属于同一个用户集合(同一个人或者一个机构)。应用层需要使用同态加密算法产生的密钥对(公钥和私钥)处理交易数据,处理过程包括对各种零知识证明生成相关的证据。接下来,应用层将这些加密后的交易数据和相关的证据一起发送到区块链网络中,让区块链背书节点对交易数据进行合法性背书校验。因为整个过程中,所有节点处理的交易数据均为加密后的密文,因此实现了数据的隐私保护。协议设计采用现有的同态加密算法和零知识证明算法,可以保证正确性。在本实施例中,采用同态加密与零知识证明结合,将要上链的数据加密,确保链上数据的隐私性和安全性。采用零知识证明保证在证明者不透露被证明数据明文的前提下,向验证者证明约束关系的正确性。如图2所示,具体的步骤如下:In this embodiment, homomorphic encryption and zero-knowledge proof are used as the core of privacy protection. When homomorphic encryption and zero-knowledge proof technology are used to complete a transaction in the blockchain, all input addresses in the same transaction belong to the same user set (the same person or an organization). The application layer needs to use the key pair (public key and private key) generated by the homomorphic encryption algorithm to process the transaction data. The processing process includes generating relevant evidence for various zero-knowledge proofs. Next, the application layer sends these encrypted transaction data and related evidence to the blockchain network, allowing the blockchain endorsement node to verify the legitimacy of the transaction data. Because the transaction data processed by all nodes in the whole process are encrypted ciphertext, the privacy protection of the data is achieved. The protocol design uses the existing homomorphic encryption algorithm and zero-knowledge proof algorithm to ensure correctness. In this embodiment, homomorphic encryption is combined with zero-knowledge proof to encrypt the data to be uploaded to the chain to ensure the privacy and security of the data on the chain. Zero-knowledge proof is used to ensure that the correctness of the constraint relationship is proved to the verifier without revealing the plaintext of the proved data. As shown in Figure 2, the specific steps are as follows:

步骤200:密钥初始化,生成密钥产生函数,分别是Setup,SecretKeyGe和PublickeyGen函数。通过运行Setup生成系统安全参数params1,params2。分别用于同态加密和零知识证明。Step 200: Initialize the key and generate the key generation functions, namely Setup, SecretKeyGe and PublickeyGen functions. Generate system security parameters params1 and params2 by running Setup. They are used for homomorphic encryption and zero-knowledge proof respectively.

步骤201:客户端请求隐私保护模块生成用户的公钥Pk和私钥Sk,具体如下式所示:Step 201: The client requests the privacy protection module to generate the user's public key Pk and private key Sk, as shown in the following formula:

Figure DEST_PATH_IMAGE058
Figure DEST_PATH_IMAGE058
;

Figure DEST_PATH_IMAGE059
Figure DEST_PATH_IMAGE059
;

步骤202:将Pk和Sk返回给客户端。Step 202: Return Pk and Sk to the client.

步骤203:客户端请求数据上链,请求会被访问控制模块拦截,验证权限后放行。Step 203: The client requests data to be uploaded to the chain, and the request will be intercepted by the access control module and released after the authority is verified.

步骤204:客户端收到权限通过消息后,准备生成零知识证明或加密本地数据。Step 204: After receiving the permission approval message, the client prepares to generate zero-knowledge proof or encrypt local data.

步骤205:客户端加密本地数据,生成零知识证明,本地数据加密具体公式如下所示:Step 205: The client encrypts the local data and generates a zero-knowledge proof. The specific formula for encrypting the local data is as follows:

Figure 670878DEST_PATH_IMAGE060
Figure 670878DEST_PATH_IMAGE060
;

生成零知识证明具体公式如下所示:The specific formula for generating zero-knowledge proof is as follows:

Figure DEST_PATH_IMAGE061
Figure DEST_PATH_IMAGE061
;

步骤206:客户端上传加密数据或零知识证明到区块链网络接口。Step 206: The client uploads the encrypted data or zero-knowledge proof to the blockchain network interface.

Figure DEST_PATH_IMAGE062
Figure DEST_PATH_IMAGE062

步骤207:网络接口会根据业务场景对零知识证明进行验证或对密文数据进行计算。Step 207: The network interface verifies the zero-knowledge proof or calculates the encrypted data according to the business scenario.

步骤208:如果需要密文计算,会继续请求隐私保护模块的同态加密算法来进行同态计算,具体公式如下:Step 208: If ciphertext calculation is required, the homomorphic encryption algorithm of the privacy protection module will be requested to perform homomorphic calculation. The specific formula is as follows:

Figure DEST_PATH_IMAGE063
Figure DEST_PATH_IMAGE063
;

步骤209:将运算结果sData返回给请求节点。Step 209: Return the operation result sData to the requesting node.

步骤210:在需要验证零知识证明的场景,利用零知识证明的验证算法,以确保数据来源的正确性,同时也可以保障用户的身份隐私。具体验证公式如下:Step 210: In the scenario where zero-knowledge proof needs to be verified, the verification algorithm of zero-knowledge proof is used to ensure the correctness of the data source and protect the user's identity privacy. The specific verification formula is as follows:

Figure 952693DEST_PATH_IMAGE064
Figure 952693DEST_PATH_IMAGE064

步骤211:将运算结果或证明返回给接口层,接口层根据结果做判断。Step 211: Return the calculation result or proof to the interface layer, and the interface layer makes a judgment based on the result.

更进一步的,区块链中为了保证所有交易数据都是公开和透明,每一个参与者都能够获得完整的数据备份,为了防止数据篡改而导致企业商业机密和个人隐私泄露给用户和企业带来极大的困扰的现状,本实施例基于同态加密和零知识证明的数据隐私保护算法,根据区块链应用场景及设计的需求选择不同的同态加密或零知识证明加密算法,突破在数据共享、协同及流通过程中数据隐私保护的条件限制,保证多场景下数据的真实性、有效性、隐私性及安全性。Furthermore, in order to ensure that all transaction data in the blockchain is open and transparent, every participant can obtain a complete data backup, and to prevent data tampering from causing great troubles to users and enterprises due to the leakage of corporate trade secrets and personal privacy. This embodiment is based on homomorphic encryption and zero-knowledge proof data privacy protection algorithms. Different homomorphic encryption or zero-knowledge proof encryption algorithms are selected according to blockchain application scenarios and design requirements, breaking through the conditions for data privacy protection in the process of data sharing, collaboration and circulation, and ensuring the authenticity, validity, privacy and security of data in multiple scenarios.

本实施例中,同态加密算法方面选择全同态加密算法GSW(基于格密码的全同态加密算法),GSW方案针对LWE算法中的重线性化技术复杂且计算量大的问题,提出了一种基于近似特征向量的同态加密方案,作为完全同态加密算法,具有计算更为简单、易于理解的特点。In this embodiment, the fully homomorphic encryption algorithm GSW (fully homomorphic encryption algorithm based on lattice cipher) is selected as the homomorphic encryption algorithm. The GSW scheme proposes a homomorphic encryption scheme based on approximate eigenvectors to address the problem that the relinearization technology in the LWE algorithm is complex and computationally intensive. As a fully homomorphic encryption algorithm, it has the characteristics of simpler calculation and easier understanding.

基于格密码的全同态加密算法中,将私钥sk表示为向量

Figure DEST_PATH_IMAGE065
,公钥pk表示为A,明文表示为
Figure 635478DEST_PATH_IMAGE030
,密文表示为C。In the fully homomorphic encryption algorithm based on lattice cipher, the private key sk is represented as a vector
Figure DEST_PATH_IMAGE065
, the public key pk is represented by A, and the plain text is represented by
Figure 635478DEST_PATH_IMAGE030
, the ciphertext is represented by C.

获取用于生成安全参数的Setup函数,用于生成私钥的SecretKeyGen函数和用于生成公钥的PublicKeyGen函数。Get the Setup function for generating security parameters, the SecretKeyGen function for generating private keys, and the PublicKeyGen function for generating public keys.

Setup函数中,

Figure 9959DEST_PATH_IMAGE004
选择一个模数q,
Figure 371670DEST_PATH_IMAGE005
比特长,晶格尺寸参数
Figure 348853DEST_PATH_IMAGE006
和误差分布函数
Figure 620566DEST_PATH_IMAGE007
Figure 25002DEST_PATH_IMAGE009
表示加密算法的系统安全参数,
Figure 139589DEST_PATH_IMAGE011
表示同态运算的层数;同时选择参数
Figure 28785DEST_PATH_IMAGE012
,并合并参数
Figure 545217DEST_PATH_IMAGE013
Figure 261500DEST_PATH_IMAGE014
Figure 863383DEST_PATH_IMAGE015
;函数
Figure 323314DEST_PATH_IMAGE016
表示复杂度;。In the Setup function,
Figure 9959DEST_PATH_IMAGE004
Choose a modulus q,
Figure 371670DEST_PATH_IMAGE005
Bit length, lattice size parameters
Figure 348853DEST_PATH_IMAGE006
and the error distribution function
Figure 620566DEST_PATH_IMAGE007
,
Figure 25002DEST_PATH_IMAGE009
Represents the system security parameters of the encryption algorithm,
Figure 139589DEST_PATH_IMAGE011
Indicates the number of layers of homomorphic operations; at the same time, select the parameters
Figure 28785DEST_PATH_IMAGE012
, and merge the parameters
Figure 545217DEST_PATH_IMAGE013
,
Figure 261500DEST_PATH_IMAGE014
,
Figure 863383DEST_PATH_IMAGE015
;function
Figure 323314DEST_PATH_IMAGE016
Indicates complexity;.

SecretKeyGen函数中,SecretKeyGen(params)取样

Figure 100778DEST_PATH_IMAGE017
,代表向量t的维度为n且属于素数有限域,输出私钥sk=
Figure 283235DEST_PATH_IMAGE018
,并满足
Figure 106834DEST_PATH_IMAGE019
。In the SecretKeyGen function, SecretKeyGen(params) sampling
Figure 100778DEST_PATH_IMAGE017
, which means that the dimension of vector t is n and belongs to the prime finite field, and the output private key sk=
Figure 283235DEST_PATH_IMAGE018
, and meet
Figure 106834DEST_PATH_IMAGE019
.

PublicKeyGen函数中, PublicKeyGen(params,sk)均匀随机生成一个矩阵

Figure 104877DEST_PATH_IMAGE020
和向量
Figure 330322DEST_PATH_IMAGE021
,令
Figure 247463DEST_PATH_IMAGE022
,让A是由
Figure 433725DEST_PATH_IMAGE023
与n列矩阵B一起组成的n+1列矩阵,设公钥pk=A。In the PublicKeyGen function, PublicKeyGen(params,sk) uniformly randomly generates a matrix
Figure 104877DEST_PATH_IMAGE020
and vector
Figure 330322DEST_PATH_IMAGE021
,make
Figure 247463DEST_PATH_IMAGE022
, let A be
Figure 433725DEST_PATH_IMAGE023
Together with the n-column matrix B, it forms an n+1-column matrix, and the public key pk=A.

消息加密算法Enc(params,pk,μ),为加密明文

Figure 360092DEST_PATH_IMAGE024
Figure 174465DEST_PATH_IMAGE025
表示素数有限域,范围为(-q/2,q/2),取样一个均值矩阵
Figure 403452DEST_PATH_IMAGE026
,输出密文C,计算式如下:Message encryption algorithm Enc(params,pk,μ), which is the encrypted plaintext
Figure 360092DEST_PATH_IMAGE024
,
Figure 174465DEST_PATH_IMAGE025
Represents a prime finite field, ranging from (-q/2,q/2), sampling a mean matrix
Figure 403452DEST_PATH_IMAGE026
, output ciphertext C, the calculation formula is as follows:

Figure 201644DEST_PATH_IMAGE027
Figure 201644DEST_PATH_IMAGE027
;

其中,BitDecomp(•)函数表示将输入的每一位按照二进制展开,

Figure 666123DEST_PATH_IMAGE028
是它的反函数,Flatten(•)函数为
Figure 974482DEST_PATH_IMAGE029
。The BitDecomp(•) function represents expanding each bit of the input in binary format.
Figure 666123DEST_PATH_IMAGE028
is its inverse function, and the Flatten(•) function is
Figure 974482DEST_PATH_IMAGE029
.

消息解密算法Decry(params,sk,C),解密密文C得到

Figure 499004DEST_PATH_IMAGE030
。Message decryption algorithm Decry(params,sk,C), decrypt ciphertext C to get
Figure 499004DEST_PATH_IMAGE030
.

在一些实施例中,消息解密算法Decry(params,sk,C),引入两种解密算法Dec(params,sk,C)和MPDec(params,sk,C);In some embodiments, the message decryption algorithm Decry(params,sk,C) introduces two decryption algorithms Dec(params,sk,C) and MPDec(params,sk,C);

Dec能够充分恢复

Figure 659859DEST_PATH_IMAGE030
,Dec(params,sk,C)中,观察向量
Figure 662450DEST_PATH_IMAGE031
Figure 716993DEST_PATH_IMAGE032
个系数
Figure 287783DEST_PATH_IMAGE033
,让
Figure 794988DEST_PATH_IMAGE034
,让
Figure 742215DEST_PATH_IMAGE035
是C的第i行,计算:Dec was able to fully recover
Figure 659859DEST_PATH_IMAGE030
, in Dec(params,sk,C), the observation vector
Figure 662450DEST_PATH_IMAGE031
forward
Figure 716993DEST_PATH_IMAGE032
Coefficient
Figure 287783DEST_PATH_IMAGE033
,let
Figure 794988DEST_PATH_IMAGE034
,let
Figure 742215DEST_PATH_IMAGE035
is the i-th row of C, calculate:

Figure 87484DEST_PATH_IMAGE036
Figure 87484DEST_PATH_IMAGE036
;

MPDec能够恢复任意

Figure 360333DEST_PATH_IMAGE024
,MPDec(params,sk,C)中,已知
Figure 620413DEST_PATH_IMAGE037
Figure 840173DEST_PATH_IMAGE065
的前
Figure 603730DEST_PATH_IMAGE039
个系数为
Figure 640956DEST_PATH_IMAGE040
,因此如果满足
Figure 998119DEST_PATH_IMAGE041
,那么
Figure 411783DEST_PATH_IMAGE042
的前
Figure 29846DEST_PATH_IMAGE039
个系数为
Figure 889173DEST_PATH_IMAGE043
,其中
Figure 592686DEST_PATH_IMAGE044
。从
Figure 278883DEST_PATH_IMAGE045
中恢复
Figure 157977DEST_PATH_IMAGE046
,然后从
Figure 271427DEST_PATH_IMAGE047
中恢复下一个最低有效位,以此类推,最终得到明文
Figure DEST_PATH_IMAGE066
;其中,Small表示在能够接受的噪音范围之内,LSB表示最低有效位(Least Significant Bit)是指一个二进制数字中的第0位(即最低位),权值为2^0,可以用它来检测数的奇偶性。与之相反的称之为最高有效位。在大端序中,LSB指最右边的位。最低有效位代表二进制数中的最小的单位,可以用来指示数字很小的变化。MPDec can recover any
Figure 360333DEST_PATH_IMAGE024
, in MPDec(params,sk,C), it is known that
Figure 620413DEST_PATH_IMAGE037
,
Figure 840173DEST_PATH_IMAGE065
Before
Figure 603730DEST_PATH_IMAGE039
The coefficient is
Figure 640956DEST_PATH_IMAGE040
, so if
Figure 998119DEST_PATH_IMAGE041
,So
Figure 411783DEST_PATH_IMAGE042
Before
Figure 29846DEST_PATH_IMAGE039
The coefficient is
Figure 889173DEST_PATH_IMAGE043
,in
Figure 592686DEST_PATH_IMAGE044
.from
Figure 278883DEST_PATH_IMAGE045
Recovery
Figure 157977DEST_PATH_IMAGE046
, then from
Figure 271427DEST_PATH_IMAGE047
Recover the next least significant bit from the original text, and so on, and finally get the plaintext
Figure DEST_PATH_IMAGE066
; Small means within the acceptable noise range, LSB stands for Least Significant Bit, which refers to the 0th bit (i.e. the lowest bit) in a binary number, with a weight of 2^0, and can be used to detect the parity of a number. The opposite is called the Most Significant Bit. In big-endian order, LSB refers to the rightmost bit. The least significant bit represents the smallest unit in a binary number and can be used to indicate very small changes in a number.

进一步的,验证全同态性,具体如下:Further, verify the full homomorphism, as follows:

(a) BSW方案提供四种同态性,分别是MultConst(乘常数), Add(加法同态),Mult(乘法同态)和NAND(与非门的同态)。(a) The BSW scheme provides four homomorphisms, namely MultConst (multiplication constant), Add (addition homomorphism), Mult (multiplication homomorphism) and NAND (NAND gate homomorphism).

(b) MultConst(C,a)(b) MultConst(C,a)

将密文

Figure DEST_PATH_IMAGE067
乘以已知常数
Figure DEST_PATH_IMAGE068
,设置
Figure DEST_PATH_IMAGE069
,并输出
Figure DEST_PATH_IMAGE070
,则:Ciphertext
Figure DEST_PATH_IMAGE067
Multiply by a known constant
Figure DEST_PATH_IMAGE068
,set up
Figure DEST_PATH_IMAGE069
, and output
Figure DEST_PATH_IMAGE070
,but:

Figure 337603DEST_PATH_IMAGE071
Figure 337603DEST_PATH_IMAGE071

(c) Add

Figure DEST_PATH_IMAGE072
(c) Add
Figure DEST_PATH_IMAGE072

执行密文加法,返回

Figure DEST_PATH_IMAGE073
,根据矩阵性质可知是满足加法同态的。Perform ciphertext addition and return
Figure DEST_PATH_IMAGE073
According to the properties of the matrix, it satisfies additive homomorphism.

(d) Mult

Figure 607916DEST_PATH_IMAGE072
(d) Mult
Figure 607916DEST_PATH_IMAGE072

执行密文乘法,返回

Figure 341517DEST_PATH_IMAGE073
,可得以下公式。Perform ciphertext multiplication and return
Figure 341517DEST_PATH_IMAGE073
, we can get the following formula.

Figure DEST_PATH_IMAGE074
Figure DEST_PATH_IMAGE074

观察噪声

Figure DEST_PATH_IMAGE075
,已知
Figure DEST_PATH_IMAGE076
的取值在{0,1}范围内,因此重点关注
Figure DEST_PATH_IMAGE077
。消息
Figure 858823DEST_PATH_IMAGE077
的值越小,同态运算误差的增长就越小。Observation Noise
Figure DEST_PATH_IMAGE075
, known
Figure DEST_PATH_IMAGE076
The value of is in the range of {0,1}, so we focus on
Figure DEST_PATH_IMAGE077
.information
Figure 858823DEST_PATH_IMAGE077
The smaller the value of , the smaller the growth of homomorphic operation error.

因此,引入使用NAND运算的NA布尔电路将消息空间限制为小消息的方式,即NAND

Figure DEST_PATH_IMAGE078
。Therefore, the NA Boolean circuit using NAND operation is introduced to limit the message space to small messages, namely NAND
Figure DEST_PATH_IMAGE078
.

(e) NAND

Figure 677875DEST_PATH_IMAGE072
(e) NAND
Figure 677875DEST_PATH_IMAGE072

执行NAND运算,返回

Figure DEST_PATH_IMAGE079
,可得以下公式。Perform NAND operation and return
Figure DEST_PATH_IMAGE079
, we can get the following formula.

Figure DEST_PATH_IMAGE080
Figure DEST_PATH_IMAGE080
;

NAND运算保持同态性,如果输入消息满足{0,1}范围,则输出密文也将是{0,1}的加密,因此保证了

Figure 643557DEST_PATH_IMAGE077
是小消息,由于
Figure DEST_PATH_IMAGE081
,因此乘法的误差最多为N+1。NAND operation maintains homomorphism. If the input message satisfies the range of {0,1}, the output ciphertext will also be the encryption of {0,1}, thus ensuring
Figure 643557DEST_PATH_IMAGE077
It's small news, because
Figure DEST_PATH_IMAGE081
, so the error of multiplication is at most N+1.

零知识证明最早是Goldwasser等密码学家在1985年提出的概念,证明者需要证明他们知道某些秘密,但是他们不用出示关于这个秘密任何有用的相关信息,即可让验证者相信他们是正确的。验证者将他们要验证的信息通过计算转化为零知识证明中的证据,验证者通过这些信息随机生成一系列的挑战。证明者则需要用自己所拥有的秘密信息完成这些挑战,这个挑战过程持续多次。若证明者能够完成验证者所随机选择的全部挑战,则零知识证明被验证通过,验证者可以相信证明者知道这个秘密。本实施例研究零知识证明(zk-SNARK )算法,从QSP/QAP到Groth16。Groth16提出的算法,具有非常少的证明数据(2/3个证明数据)以及一个表达式验证。下面是零知识证明的验证例子:Zero-knowledge proof was first proposed by cryptographers such as Goldwasser in 1985. The prover needs to prove that they know certain secrets, but they do not need to show any useful information about the secret to convince the verifier that they are correct. The verifier converts the information they want to verify into evidence in the zero-knowledge proof through calculation, and the verifier randomly generates a series of challenges based on this information. The prover needs to complete these challenges with the secret information he owns, and this challenge process continues multiple times. If the prover can complete all the challenges randomly selected by the verifier, the zero-knowledge proof is verified and the verifier can believe that the prover knows the secret. This embodiment studies the zero-knowledge proof (zk-SNARK) algorithm, from QSP/QAP to Groth16. The algorithm proposed by Groth16 has very little proof data (2/3 proof data) and an expression verification. The following is an example of zero-knowledge proof verification:

设𝐹q为一个有限域,椭圆曲线为E,Q为椭圆曲线E上一个点,且Q=nP,P为公开值,n为秘密。公开点P,Q和椭圆曲线E,零知识证明的证明及验证方法如下:Let 𝐹q be a finite field, elliptic curve E, Q be a point on elliptic curve E, and Q=nP, P is a public value, and n is a secret. For public points P, Q and elliptic curve E, the proof and verification method of zero-knowledge proof is as follows:

证明者需要向验证者证明他知道秘密n,但又不暴露它,则可以按下列步骤来进行。The prover needs to prove to the verifier that he knows the secret n without revealing it. He can do so by following the steps below.

Setp1:证明者随机选择一个整数𝑟,𝑟 < 𝑞。计算𝑃1= 𝑟𝑃,𝑃2= (𝑛−𝑟)𝑃,并将𝑃1,𝑃2发送给验证者。Setp1: The prover randomly selects an integer 𝑟, 𝑟 < 𝑞. Calculate 𝑃1 = 𝑟𝑃, 𝑃2 = (𝑛−𝑟)𝑃, and send 𝑃1, 𝑃2 to the verifier.

Setp2:验证者随机要求证明者发送𝑟i,i = 1,2,其中,𝑟1=𝑟,𝑟2=𝑛−𝑟。Setp2: The verifier randomly asks the prover to send 𝑟i, i = 1, 2, where 𝑟1=𝑟, 𝑟2=𝑛−𝑟.

Setp3:证明者收到𝑟i后,验证𝑃i= 𝑟𝑖𝑃和𝑃1+𝑃2= 𝑄是否成立。Setp3: After receiving 𝑟i, the prover verifies whether 𝑃i= 𝑟𝑖𝑃 and 𝑃1+𝑃2= 𝑄 hold.

重复以上三步m次,直到证明者相信证明者知道秘密n。Repeat the above three steps m times until the prover believes that the prover knows the secret n.

可以证明证明者每轮能够成功欺骗验证者的概率为1/2,因为若证明者不知道秘密 n,证明者想要成功欺骗验证者,证明者可以进行如下过程:It can be proved that the probability of the prover successfully deceiving the verifier in each round is 1/2, because if the prover does not know the secret n, the prover wants to successfully deceive the verifier. The prover can do the following process:

证明者选择一个整数r,并记𝑃1= 𝑟𝑃,𝑃2= 𝑄−𝑃1,然后按上述步骤发送给验证者,假设验证者要求证明者传送𝑟1= 𝑟,它恰好可以提供r,这时证明者成功欺骗了验证者。假设验证者要求传送与𝑃2对应的数𝑟2,因为证明者不知道秘密n,而通过𝑃2得到对应的数𝑟2是一个基于椭圆曲线上的离散对数问题,所以证明者无论如何也得不到𝑟2。因此,证明者在每一轮能够成功欺骗验证者的概率为1/2,经过m轮之后,证明者能成功欺骗验证者的概率为1/2m。所以经过充分大的次数后,如果证明者每次均能正确回答,则验证者相信证明者知道秘密 n。The prover chooses an integer r and remembers 𝑃1= 𝑟𝑃, 𝑃2= 𝑄−𝑃1, and then sends it to the verifier according to the above steps. Suppose the verifier asks the prover to send 𝑟1= 𝑟, which happens to provide r. At this time, the prover successfully deceives the verifier. Suppose the verifier asks to send the number 𝑟2 corresponding to 𝑃2. Because the prover does not know the secret n, and getting the corresponding number 𝑟2 through 𝑃2 is a discrete logarithm problem based on the elliptic curve, the prover cannot get 𝑟2 anyway. Therefore, the probability that the prover can successfully deceive the verifier in each round is 1/2. After m rounds, the probability that the prover can successfully deceive the verifier is 1/2m. So after a sufficiently large number of times, if the prover can answer correctly every time, the verifier believes that the prover knows the secret n.

经过上述过程,证明者向验证者证明了自己知道秘密n而没有向验证者透露关于n的任何信息。在具体的零知识证明应用环境中,首先要把证明的问题转化成电路门的形式和R1CS约束条件,再将转化之后的向量组转换成多项式的形式,这个转变的过程就叫做QAP。在进行可信设置阶段生成一对密钥(ek,vk),ek用于生成证明条件,vk用于生成验证证明。After the above process, the prover proves to the verifier that he knows the secret n without revealing any information about n to the verifier. In the specific zero-knowledge proof application environment, the proof problem must first be converted into the form of circuit gates and R1CS constraints, and then the transformed vector group is converted into a polynomial form. This transformation process is called QAP. A pair of keys (ek, vk) is generated during the trusted setup phase. ek is used to generate the proof condition, and vk is used to generate the verification proof.

三、对基于分布式身份的身份隐私保护技术进行说明3. Explain the identity privacy protection technology based on distributed identity

传统方式中,用户的注册和身份管理完全依赖于单一中心的注册机构;随着分布式账本技术(例如区块链)的出现,分布式多中心的身份注册、标识和管理成为可能。针对区块链技术在保持身份和交易匿名性的同时难以防止身份隐私泄露的问题,本实施例研究避免用户身份信息泄露的区块链身份隐私保护技术,实现用户身份的匿名性和隐私的高安全性。In the traditional way, user registration and identity management completely rely on a single central registration agency; with the emergence of distributed ledger technology (such as blockchain), distributed multi-center identity registration, identification and management become possible. In view of the problem that blockchain technology is difficult to prevent identity privacy leakage while maintaining identity and transaction anonymity, this embodiment studies blockchain identity privacy protection technology that avoids user identity information leakage, and achieves high security of user identity anonymity and privacy.

研究基于FISCO BCOS的WeIdentity分布式多中心的技术解决方案,WeIdentityDID模块在FISCO-BCOS区块链底层平台上实现了一套符合W3C DID规范的分布式多中心的身份标识协议使实体(人或物)的现实身份实现了链上的身份标识;同时,WeIdentity DID给与Entity(人或者物)直接拥有和控制自己身份ID的能力。现实世界中存在着各种各样用于描述实体身份、实体间关系的数据,如身份证、行驶证、存款证明、处方、毕业证、房产证、信用报告等。WeIdentity Credential提供了一整套基于W3C VC规范的解决方案,旨在对这一类数据进行标准化、电子化,生成可验证、可交换的「凭证」(Credential),支持对凭证的属性进行选择性披露,及生成链上存证(Evidence)。本实施例结合其分布式身份标识模块和可验证数字凭证模块实现分布式可信的数据管理。The WeIdentity distributed multi-center technical solution based on FISCO BCOS is studied. The WeIdentityDID module implements a set of distributed multi-center identity identification protocols that comply with the W3C DID specification on the underlying platform of the FISCO-BCOS blockchain, which enables the real identity of the entity (person or object) to realize the identity identification on the chain; at the same time, WeIdentity DID gives the Entity (person or object) the ability to directly own and control its own identity ID. In the real world, there are various data used to describe the identity of entities and the relationship between entities, such as identity cards, driving licenses, deposit certificates, prescriptions, graduation certificates, real estate certificates, credit reports, etc. WeIdentity Credential provides a complete set of solutions based on the W3C VC specification, aiming to standardize and digitize this type of data, generate verifiable and exchangeable "credentials", support selective disclosure of the attributes of the credentials, and generate on-chain evidence (Evidence). This embodiment combines its distributed identity identification module and verifiable digital credential module to achieve distributed and trusted data management.

WeIdentity可以被广泛运用在实体身份标识及可信数据交换场景中,在WeIdentity生态中,存在如下不同角色:User (Entity),即用户(实体);Issuer,即证明的发行者;Verifier,即证明的使用者。WeIdentity can be widely used in entity identity identification and trusted data exchange scenarios. In the WeIdentity ecosystem, there are the following different roles: User (Entity), Issuer, the issuer of the certificate; Verifier, the user of the certificate.

用户(实体)会在链上注册属于自己的WeIdentity DID,从发行者处申请证明,并授权转发或直接出示给使用者来使用。发行者用于验证实体对WeIdentity DID的所有权,其次发行实体相关的证明。使用者会验证实体对WeIdentity DID的所有权,其次在链上验证证明的真实性,以便处理相关业务。The user (entity) will register their own WeIdentity DID on the chain, apply for a certificate from the issuer, and authorize the forwarding or directly present it to the user for use. The issuer verifies the entity's ownership of the WeIdentity DID, and then issues the entity's related certificates. The user will verify the entity's ownership of the WeIdentity DID, and then verify the authenticity of the certificate on the chain in order to handle related business.

通过将实体的现实身份和可验证数字凭证的内容进行链下存储,支持实体将信息最小化或者选择性披露给其他机构,同时防止任何第三方反向推测出实体在现实世界或其他场景语义中的身份以实现隐私保护。首先,通过用户代理为不同的实体生成独立唯一的DID;其次,发行者验证实体身份及DID所有权,为实体发行各种各样的电子化证明。当实体需要办理业务的时候,可以直接将证明出示给使用者,也可以通过在链上进行主动授权加授权存证上链的方式,由之前授权的凭证存储机构转发给使用者。以上流程,保证了数据以实体用户为中心,同时实体身份、确权、授权等操作在链上完成,可追溯,可验证,不可篡改。By storing the entity's real identity and the content of the verifiable digital certificate off-chain, the entity is supported to minimize information or selectively disclose it to other institutions, while preventing any third party from reversely inferring the entity's identity in the real world or other scenarios to achieve privacy protection. First, an independent and unique DID is generated for different entities through user agents; second, the issuer verifies the entity's identity and DID ownership, and issues various electronic certificates for the entity. When the entity needs to handle business, the certificate can be presented directly to the user, or it can be forwarded to the user by the previously authorized credential storage institution through active authorization and authorization certificate storage on the chain. The above process ensures that the data is centered on the entity user, and at the same time, the entity identity, right confirmation, authorization and other operations are completed on the chain, which are traceable, verifiable and cannot be tampered with.

本实施例采用支持隐私保护的分布式可信数据交易系统及方法可以有效解决传统数据管理的痛点,如数据信任、数据存取及数据灾备等方面的缺陷;同时重点解决加入区块链技术后的数据、身份隐私泄露的问题。保证多方用户在交易的过程中不暴露或选择性的暴露身份、在数据计算的过程中使用同态计算的方式保证用户数据的隐私。与此同时对于链上存储的数据,使用落盘加密和群组隔离的方式,对存储内容进行访问控制,防止存储数据泄露。具体的有益效果可分为以下两2个方面:This embodiment uses a distributed trusted data transaction system and method that supports privacy protection to effectively solve the pain points of traditional data management, such as defects in data trust, data access, and data disaster recovery; at the same time, it focuses on solving the problem of data and identity privacy leakage after the addition of blockchain technology. Ensure that multiple users do not expose or selectively expose their identities during the transaction process, and use homomorphic computing to ensure the privacy of user data during data calculation. At the same time, for data stored on the chain, disk encryption and group isolation are used to control access to the stored content to prevent leakage of stored data. The specific beneficial effects can be divided into the following two aspects:

1)数据非法使用防护方面1) Protection against illegal use of data

该系统基于区块链平台的统一数字身份体系,采用基于权限控制的分布式身份认证模型,改变了用户数据的使用逻辑,数据的权利从托管方转移到用户,真正意义上由用户决定自己数据的访问权限。有效解决了运营过程中出现的冗余问题、孤岛问题、隐私问题和监管问题。该体系具有以下特性:一是身份唯一性,采用基于DID的身份信息认证,提高身份可信度;二是强隐私性,参与方拥有对自己数字身份及行为数据的所有权、管理权和控制权,同时可结合零知识证明技术,做到数据可用不可见;三是强监管性,用户在身份开立时需监管机构的授权,方便监管机构实时对链上用户进行监管。系统从存储管理、权限控制、身份管理等多个方面对数据进行身份认证和访问控制,保证数据使用方在拥有数据使用权的基础上才会对使用方暴露数据访问的接口。The system is based on the unified digital identity system of the blockchain platform and adopts a distributed identity authentication model based on permission control. It changes the logic of user data usage, and the data rights are transferred from the custodian to the user. In a real sense, the user decides the access rights to their own data. It effectively solves the redundancy, island, privacy and regulatory issues that arise during the operation process. The system has the following characteristics: First, identity uniqueness, using DID-based identity information authentication to improve identity credibility; second, strong privacy, the participants have ownership, management and control rights over their digital identity and behavior data, and can be combined with zero-knowledge proof technology to make data available but invisible; third, strong supervision, users need the authorization of the regulatory agency when opening their identity, which facilitates the regulatory agency to supervise the users on the chain in real time. The system authenticates and controls data from multiple aspects such as storage management, permission control, and identity management to ensure that the data user will only expose the data access interface to the user on the basis of having the right to use the data.

2)数据隐私安全保护方面2) Data privacy and security protection

系统使用同态加密和零知识证明结合运算协议实现在不同场景下的身份匿名隐私保护和数据隐私保护。使用全同态加密算法实现数据在密文条件下进行计算,无需解密,提高了数据隐私性,从而实现了密文计算。使用零知识证明和基于分布式身份的身份隐私保护技术可以对双方参与的场景给予身份隐私保护和证明生成验证。在数据存储方面,使用落盘加密保障数据存储隐私。降低了数据加解密计算的代价,提高了数据的隐私性与安全性。The system uses homomorphic encryption and zero-knowledge proof combined with computing protocols to achieve identity anonymity privacy protection and data privacy protection in different scenarios. The fully homomorphic encryption algorithm is used to realize data calculation under ciphertext conditions without decryption, which improves data privacy and thus realizes ciphertext calculation. The use of zero-knowledge proof and identity privacy protection technology based on distributed identity can provide identity privacy protection and proof generation verification for scenarios involving both parties. In terms of data storage, disk encryption is used to ensure data storage privacy. The cost of data encryption and decryption calculations is reduced, and the privacy and security of data are improved.

区块链隐私保护的一项重要意义就是减少现实世界的隐私威胁。我们没办法完全保障自己的隐私安全,但是可以利用区块链技术将自己的数据掌握在自己手里,减少泄露渠道。支持隐私保护的分布式高可信数据管理系统及方法在应对当前区块链技术面临隐私泄露风险及传统数据管理无法保证可信性的窘况具有重要意义。An important significance of blockchain privacy protection is to reduce privacy threats in the real world. We cannot completely protect our privacy, but we can use blockchain technology to keep our data in our own hands and reduce the channels for leakage. Distributed high-trust data management systems and methods that support privacy protection are of great significance in dealing with the current blockchain technology facing the risk of privacy leakage and the dilemma of traditional data management being unable to guarantee credibility.

综上所述,本发明所述支持隐私保护的分布式可信数据交易方法、系统及装置,在数据交易过程中,在分布式存储的基础上通过引入落盘加密保障数据在存储过程中的隐私保护;在交易过程中通过分布式多中心的身份标识协议为数据提供者和数据需求者提供去中心化的身份信息,能够保障用户的身份隐私;通过在交易过程中引入同态加密和零知识证明,在不需要披露数据原文的情况下,为用户提供交易计算或认证的服务,保障了交易数据隐私。In summary, the distributed trusted data transaction method, system and device supporting privacy protection described in the present invention, during the data transaction process, introduces disk encryption on the basis of distributed storage to ensure the privacy of data during the storage process; during the transaction process, a distributed multi-center identity identification protocol is used to provide decentralized identity information for data providers and data demanders, thereby ensuring the user's identity privacy; by introducing homomorphic encryption and zero-knowledge proof in the transaction process, transaction calculation or authentication services are provided to users without disclosing the original data, thereby ensuring the privacy of transaction data.

与上述方法相应地,本发明还提供了一种装置/系统,该装置/系统包括计算机设备,所述计算机设备包括处理器和存储器,所述存储器中存储有计算机指令,所述处理器用于执行所述存储器中存储的计算机指令,当所述计算机指令被处理器执行时该装置/系统实现如前所述方法的步骤。Corresponding to the above method, the present invention also provides an apparatus/system, which includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, the processor is used to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the apparatus/system implements the steps of the method described above.

本发明实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时以实现前述边缘计算服务器部署方法的步骤。该计算机可读存储介质可以是有形存储介质,诸如随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、软盘、硬盘、可移动存储盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质。The embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the aforementioned edge computing server deployment method are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.

本领域普通技术人员应该可以明白,结合本文中所公开的实施方式描述的各示例性的组成部分、系统和方法,能够以硬件、软件或者二者的结合来实现。具体究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。当以硬件方式实现时,其可以例如是电子电路、专用集成电路(ASIC)、适当的固件、插件、功能卡等等。当以软件方式实现时,本发明的元素是被用于执行所需任务的程序或者代码段。程序或者代码段可以存储在机器可读介质中,或者通过载波中携带的数据信号在传输介质或者通信链路上传送。It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.

需要明确的是,本发明并不局限于上文所描述并在图中示出的特定配置和处理。为了简明起见,这里省略了对已知方法的详细描述。在上述实施例中,描述和示出了若干具体的步骤作为示例。但是,本发明的方法过程并不限于所描述和示出的具体步骤,本领域的技术人员可以在领会本发明的精神后,作出各种改变、修改和添加,或者改变步骤之间的顺序。It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.

本发明中,针对一个实施方式描述和/或例示的特征,可以在一个或更多个其它实施方式中以相同方式或以类似方式使用,和/或与其他实施方式的特征相结合或代替其他实施方式的特征。In the present invention, features described and/or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and/or combined with features of other embodiments or replace features of other embodiments.

以上所述仅为本发明的优选实施例,并不用于限制本发明,对于本领域的技术人员来说,本发明实施例可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims (10)

1. A distributed trusted data transaction method supporting privacy protection, the method being performed by a data management module that also invokes a privacy protection module, a blockchain infrastructure, and a storage module via a data interface connection, the method comprising the steps of:
receiving a data uploading request sent by a data provider by the data management module, wherein the data uploading request comprises first authority information of the data provider; verifying the first authority information, and receiving transaction data of the data provider under the condition that verification is passed;
The data management module invokes the privacy protection module to generate a first decentralised identity of the data provider by using an identity identification protocol based on a distributed multi-center, and feeds the first decentralised identity back to the data provider; the privacy protection module encrypts the transaction data by adopting a homomorphic encryption algorithm to obtain a transaction ciphertext;
the data management module invokes the blockchain infrastructure to store the first decentralised identity and the transaction ciphertext in a distributed uplink manner to the storage module based on falling disk encryption, and obtains a first storage result and a first uplink transaction receipt which are sent to the data management module;
receiving a data transaction request sent by a data demand party by the data management module, wherein the data transaction request comprises second authority information of the data demand party; verifying the second authority information, and under the condition that verification is passed, generating a second decentralised identity of the data requiring party by using an identity identification protocol based on a distributed multi-center by using the privacy protection module, and sending the second decentralised identity to the data requiring party;
the data management module calls the privacy protection module to perform homomorphic calculation on the transaction ciphertext or generate zero knowledge proof according to the data transaction request;
The data management module invokes the blockchain infrastructure to acquire a first decentralised identity of a data provider corresponding to the data transaction request;
the data management module calls the privacy protection module to send the homomorphic calculation result or the zero knowledge proof to the blockchain infrastructure, and the blockchain infrastructure performs distributed storage to the storage module based on the disc-falling encryption to obtain a second storage result and a second uplink transaction receipt;
the blockchain infrastructure sending the second stored result and the second uplink transaction receipt to the data management module;
the data management module sends the results of the homomorphic calculation or the zero knowledge proof to the data demander and sends a trusted credential containing the first decentralized identity to the data demander.
2. The method for transaction of distributed trusted data supporting privacy protection according to claim 1, wherein the privacy protection module encrypts the transaction data by using a homomorphic encryption algorithm to obtain a transaction context, and the homomorphic encryption algorithm uses a homomorphic encryption algorithm based on a lattice password.
3. The privacy preserving distributed trusted data transaction method as claimed in claim 2, whichCharacterized in that, in the isomorphic encryption algorithm based on the lattice password, the private key sk is expressed as a vector
Figure DEST_PATH_IMAGE001
Public key pk is denoted as A and plaintext is denoted as +.>
Figure DEST_PATH_IMAGE002
Ciphertext is denoted as C;
acquiring a Setup function for generating security parameters, a SecretKeyGen function for generating a private key and a PublicKeyGen function for generating a public key;
in the set function, the set function is used,
Figure DEST_PATH_IMAGE003
selecting a modulus q,
Figure DEST_PATH_IMAGE004
Bit length, lattice size parameter
Figure DEST_PATH_IMAGE005
And error distribution function->
Figure DEST_PATH_IMAGE006
Figure DEST_PATH_IMAGE007
System security parameters representing encryption algorithm +.>
Figure DEST_PATH_IMAGE008
The number of layers representing homomorphic operation; simultaneously select the parameters->
Figure DEST_PATH_IMAGE009
And combining parameters->
Figure DEST_PATH_IMAGE010
Figure DEST_PATH_IMAGE011
The method comprises the steps of carrying out a first treatment on the surface of the Function->
Figure DEST_PATH_IMAGE012
Representing complexity;
in the SecretKeyGen function, secretKeyGen (params) samples
Figure DEST_PATH_IMAGE013
The dimension representing the vector t is n and belongs to prime finite field, and the output private key sk= = -j>
Figure DEST_PATH_IMAGE014
And meet->
Figure DEST_PATH_IMAGE015
In the publicKeyGen function, a matrix is uniformly and randomly generated by publicKeyGen (params, sk)
Figure DEST_PATH_IMAGE016
Sum vector->
Figure DEST_PATH_IMAGE017
Let->
Figure DEST_PATH_IMAGE018
Let A be->
Figure DEST_PATH_IMAGE019
An n+1 column matrix composed with n column matrices B, provided with a public key pk=a;
message encryption algorithm Enc (params, pk, μ), which is encryption of plaintext
Figure DEST_PATH_IMAGE020
Representing prime finite field, the range is (-q/2, q/2), sampling an average matrix >
Figure DEST_PATH_IMAGE021
The ciphertext C is output as follows:
Figure DEST_PATH_IMAGE022
wherein the BitDecomp ()'s function represents that each bit of the input is spread out in binary,
Figure DEST_PATH_IMAGE023
is an inverse function thereof, the Flatten ()'s function is +.>
Figure 708935DEST_PATH_IMAGE024
Message decryption algorithm Decry (params, sk, C), decrypting ciphertext C
Figure DEST_PATH_IMAGE025
4. A distributed trusted data transaction method supporting privacy protection as claimed in claim 3, wherein said message decryption algorithm Dec (params, sk, C) is introduced with two decryption algorithms Dec (params, sk, C) and MPDec (params, sk, C);
in Dec (params, sk, C), the vectors are observed
Figure DEST_PATH_IMAGE026
Front->
Figure DEST_PATH_IMAGE027
Personal coefficient->
Figure DEST_PATH_IMAGE028
Let->
Figure DEST_PATH_IMAGE029
Let->
Figure DEST_PATH_IMAGE030
Is line i of C, calculate:
Figure DEST_PATH_IMAGE031
MPDec (params, sk, C) is known to
Figure DEST_PATH_IMAGE032
Figure DEST_PATH_IMAGE033
Before->
Figure DEST_PATH_IMAGE034
The number of coefficients is->
Figure 78605DEST_PATH_IMAGE035
Thus if it meets->
Figure DEST_PATH_IMAGE036
Then->
Figure DEST_PATH_IMAGE037
Before->
Figure 28982DEST_PATH_IMAGE034
The number of coefficients is->
Figure DEST_PATH_IMAGE038
Wherein->
Figure DEST_PATH_IMAGE039
The method comprises the steps of carrying out a first treatment on the surface of the From->
Figure DEST_PATH_IMAGE040
Middle recovery->
Figure DEST_PATH_IMAGE041
Then from->
Figure 565136DEST_PATH_IMAGE042
The next least significant bit is recovered, and so on, finally the plaintext ++>
Figure 786033DEST_PATH_IMAGE043
The method comprises the steps of carrying out a first treatment on the surface of the Wherein Small represents within an acceptable noise range.
5. The privacy preserving distributed trusted data transaction method of claim 1, wherein said method employs a fsco BCOS distributed storage architecture to store said first de-centralized identity, said transaction ciphertext, results of said homomorphic computation, and/or said zero knowledge proof.
6. A distributed trusted data transaction system supporting privacy protection, comprising:
a data management module for connecting the data provider and the data demander's clients and performing the distributed trusted data transaction method supporting privacy protection as claimed in any one of claims 1 to 5;
the privacy protection module is connected with the data management module through a data interface and is used for calling and executing homomorphic encryption algorithms;
a blockchain infrastructure comprising a plurality of network nodes connecting the privacy protection module and the data management module for accounting transactions;
and the storage module is used for storing the transaction data in a distributed mode.
7. The privacy preserving distributed trusted data transaction system of claim 6 wherein the storage module unifies SQL and NOSQL via abstract table structures based on a fsco BCOS distributed storage architecture to support LevelDB, rocksDB and MySQL.
8. The privacy preserving distributed trusted data transaction system of claim 6 wherein the privacy preserving module provides de-centralized identification for the data provider and the data demander's clients based on the identification protocol of the weidity DID distributed multi-center.
9. A distributed trusted data transaction device supporting privacy protection, comprising a processor and a memory, wherein said memory has stored therein computer instructions for executing the computer instructions stored in said memory, which when executed by the processor, implement the steps of the method of any one of claims 1 to 5.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 5.
CN202310021062.XA 2023-01-07 2023-01-07 Distributed trusted data transaction method, system and device supporting privacy protection Active CN115913513B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310021062.XA CN115913513B (en) 2023-01-07 2023-01-07 Distributed trusted data transaction method, system and device supporting privacy protection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310021062.XA CN115913513B (en) 2023-01-07 2023-01-07 Distributed trusted data transaction method, system and device supporting privacy protection

Publications (2)

Publication Number Publication Date
CN115913513A CN115913513A (en) 2023-04-04
CN115913513B true CN115913513B (en) 2023-05-12

Family

ID=85771818

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310021062.XA Active CN115913513B (en) 2023-01-07 2023-01-07 Distributed trusted data transaction method, system and device supporting privacy protection

Country Status (1)

Country Link
CN (1) CN115913513B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116912002B (en) * 2023-09-12 2023-12-12 深圳小米房产网络科技有限公司 Real estate transaction system based on blockchain technology
CN118233214A (en) * 2024-05-14 2024-06-21 广州信安数据有限公司 Ciphertext data sharing method, system and computer program product based on onion encryption

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111090876A (en) * 2020-03-18 2020-05-01 支付宝(杭州)信息技术有限公司 Contract calling method and device
CN113411384A (en) * 2021-06-10 2021-09-17 华中科技大学 System and method for privacy protection in data security sharing process of Internet of things
CN114785511A (en) * 2022-02-25 2022-07-22 蚂蚁区块链科技(上海)有限公司 Certificate generation method and device, electronic device and storage medium
CN114900290A (en) * 2022-03-07 2022-08-12 南京信息工程大学 Data transaction model and privacy protection method based on block chain
CN115174091A (en) * 2022-05-29 2022-10-11 北京理工大学 Homomorphic encryption privacy protection method for distributed digital identity
CN115473664A (en) * 2022-05-31 2022-12-13 北京邮电大学 Credit data processing method and model based on block chain

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11082418B2 (en) * 2017-02-13 2021-08-03 Avalanche Cloud Corporation Privacy ensured brokered identity federation

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111090876A (en) * 2020-03-18 2020-05-01 支付宝(杭州)信息技术有限公司 Contract calling method and device
CN113411384A (en) * 2021-06-10 2021-09-17 华中科技大学 System and method for privacy protection in data security sharing process of Internet of things
CN114785511A (en) * 2022-02-25 2022-07-22 蚂蚁区块链科技(上海)有限公司 Certificate generation method and device, electronic device and storage medium
CN114900290A (en) * 2022-03-07 2022-08-12 南京信息工程大学 Data transaction model and privacy protection method based on block chain
CN115174091A (en) * 2022-05-29 2022-10-11 北京理工大学 Homomorphic encryption privacy protection method for distributed digital identity
CN115473664A (en) * 2022-05-31 2022-12-13 北京邮电大学 Credit data processing method and model based on block chain

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
云计算环境中支持隐私保护的数字版权保护方案;黄勤龙 等;通信学报;第35卷(第02期);全文 *

Also Published As

Publication number Publication date
CN115913513A (en) 2023-04-04

Similar Documents

Publication Publication Date Title
CN108418680B (en) Block chain key recovery method and medium based on secure multi-party computing technology
US11159307B2 (en) Ad-hoc trusted groups on a blockchain
US10673626B2 (en) Threshold secret share authentication proof and secure blockchain voting with hardware security modules
CN107911216B (en) A method and system for privacy protection of blockchain transactions
CN115242555B (en) A supervisable cross-chain privacy data sharing method and device
US11405365B2 (en) Method and apparatus for effecting a data-based activity
US20210089676A1 (en) Methods and systems for secure data exchange
US9137017B2 (en) Key recovery mechanism
JP7585315B2 (en) Digital signature generation using cold wallets
US9009464B2 (en) Anonymous register system and method thereof
US11374910B2 (en) Method and apparatus for effecting a data-based activity
CN115296838B (en) Block chain-based data sharing method, system and storage medium
CN114866323B (en) User-controllable privacy data authorization sharing system and method
CN113643134B (en) Internet of things blockchain transaction method and system based on multi-key homomorphic encryption
CN115913513B (en) Distributed trusted data transaction method, system and device supporting privacy protection
CN113225302B (en) Data sharing system and method based on proxy re-encryption
US11637817B2 (en) Method and apparatus for effecting a data-based activity
WO2014114080A1 (en) Method and system for data encryption protection
Li et al. Traceable Ciphertext‐Policy Attribute‐Based Encryption with Verifiable Outsourced Decryption in eHealth Cloud
CN117081803B (en) Internet of Things Ciphertext Access Control Method Based on Blockchain
Tiwari et al. ACDAS: Authenticated controlled data access and sharing scheme for cloud storage
CN118869177A (en) Digital identity management method, system, electronic device and computer-readable storage medium based on blockchain
CN113239376B (en) Data sharing method, request method and device based on block chain
De Oliveira et al. Red Alert: break-glass protocol to access encrypted medical records in the cloud
TWM585941U (en) Account data processing system

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