CN113098697B - Block chain data writing and accessing method and device - Google Patents
Block chain data writing and accessing method and device Download PDFInfo
- Publication number
- CN113098697B CN113098697B CN202110634791.3A CN202110634791A CN113098697B CN 113098697 B CN113098697 B CN 113098697B CN 202110634791 A CN202110634791 A CN 202110634791A CN 113098697 B CN113098697 B CN 113098697B
- Authority
- CN
- China
- Prior art keywords
- data
- access
- target
- key
- target ciphertext
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 84
- 238000012545 processing Methods 0.000 claims abstract description 32
- 230000007246 mechanism Effects 0.000 claims abstract description 24
- 238000012795 verification Methods 0.000 claims description 59
- 238000013500 data storage Methods 0.000 abstract description 5
- 230000008569 process Effects 0.000 description 28
- 238000005516 engineering process Methods 0.000 description 20
- 238000010586 diagram Methods 0.000 description 11
- 238000004590 computer program Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 8
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 238000012423 maintenance Methods 0.000 description 3
- 238000011084 recovery Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000013475 authorization Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000019771 cognition Effects 0.000 description 1
- 239000002131 composite material Substances 0.000 description 1
- 238000009792 diffusion process Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 238000002955 isolation Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3247—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
- H04L9/3255—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures using group based signatures, e.g. ring or threshold signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
- G06F21/6227—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database where protection concerns the structure of data, e.g. records, types, queries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
- H04L63/0435—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/08—Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
- H04L9/0816—Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
- H04L9/085—Secret sharing or secret splitting, e.g. threshold schemes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/50—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- General Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- General Physics & Mathematics (AREA)
- Bioethics (AREA)
- Databases & Information Systems (AREA)
- Computing Systems (AREA)
- Storage Device Security (AREA)
Abstract
本申请实施例中提供一种区块链数据写入、访问方法及装置,用于提高区块链上数据存储和数据访问的安全性。所述方法包括:各个共识节点分别获得数据所有方发送的数据写入请求;其中,各数据写入请求中包括相同的目标密文数据和彼此不同的密钥份额,所述目标密文数据是所述数据所有方以目标密钥对明文数据加密得到的,各密钥份额是所述数据所有方通过秘密共享机制将所述目标密钥进行拆分得到的;所述各个共识节点对所述目标密文数据进行共识处理;在确定对所述目标密文数据达成共识后,所述各个共识节点分别保存获得的目标密文数据和密钥份额。
The embodiments of the present application provide a method and device for writing and accessing blockchain data, which are used to improve the security of data storage and data access on the blockchain. The method includes: each consensus node obtains a data write request sent by a data owner respectively; wherein, each data write request includes the same target ciphertext data and different key shares from each other, and the target ciphertext data is The data owner encrypts the plaintext data with the target key, and each key share is obtained by splitting the target key by the data owner through a secret sharing mechanism; The target ciphertext data is subjected to consensus processing; after it is determined that a consensus is reached on the target ciphertext data, each consensus node saves the obtained target ciphertext data and key shares respectively.
Description
技术领域technical field
本申请涉及区块链技术领域,具体涉及一种区块链数据写入、访问方法及装置。The present application relates to the field of blockchain technology, and in particular to a method and device for writing and accessing blockchain data.
背景技术Background technique
区块链是一种利用密码学方法、计算机网络和分布式存储等技术综合实现的复合型技术,区块链提供一种分布式的数据共享模式,具有去中心化(点对点网络通信)、不可篡改、全程留痕、集体维护、公开透明等特点。基于区块链的这些特性,用户可以将数据存储在区块链上,以通过区块链实现对数据的共享。而用户数据一般涉及到用户自身隐私,所以有必要对区块链上存储的数据进行有效保护,以确保数据的安全。Blockchain is a composite technology that uses cryptography, computer networks, and distributed storage technologies. Blockchain provides a distributed data sharing model with decentralization (point-to-point Tampering, leaving traces throughout the process, collective maintenance, openness and transparency, etc. Based on these characteristics of the blockchain, users can store data on the blockchain to achieve data sharing through the blockchain. User data generally involves the user's own privacy, so it is necessary to effectively protect the data stored on the blockchain to ensure data security.
为确保区块链上数据的安全,需要在数据存储、数据访问等过程中进行安全控制,所以,如何提高区块链上数据存储和访问的安全性是需要考虑的问题。In order to ensure the security of data on the blockchain, it is necessary to carry out security control in the process of data storage and data access. Therefore, how to improve the security of data storage and access on the blockchain is a problem that needs to be considered.
发明内容SUMMARY OF THE INVENTION
本申请实施例中提供了一种区块链数据写入、访问方法及装置,主要用于提高区块链上数据存储和数据访问的安全性。The embodiments of the present application provide a method and device for writing and accessing blockchain data, which are mainly used to improve the security of data storage and data access on the blockchain.
根据本申请实施例的第一方面,提供一种区块链数据写入方法,所述方法包括:According to a first aspect of the embodiments of the present application, a method for writing blockchain data is provided, the method comprising:
各个共识节点分别获得数据所有方发送的数据写入请求;其中,各数据写入请求中包括相同的目标密文数据和彼此不同的密钥份额,所述目标密文数据是所述数据所有方以目标密钥对明文数据加密得到的,各密钥份额是所述数据所有方通过秘密共享机制将所述目标密钥进行拆分得到的;Each consensus node obtains the data write request sent by the data owner respectively; wherein, each data write request includes the same target ciphertext data and different key shares from each other, and the target ciphertext data is the data owner. Obtained by encrypting plaintext data with the target key, and each key share is obtained by splitting the target key by the data owner through a secret sharing mechanism;
所述各个共识节点对所述目标密文数据进行共识处理;The respective consensus nodes perform consensus processing on the target ciphertext data;
在确定对所述目标密文数据达成共识后,所述各个共识节点分别保存获得的目标密文数据和密钥份额。After it is determined that a consensus is reached on the target ciphertext data, each consensus node saves the obtained target ciphertext data and key shares respectively.
在一种可能的实现方式中,各个数据写入请求中还包括密钥份额对应的密钥份额签名,所述各个共识节点分别保存获得的目标密文数据和密钥份额,包括:In a possible implementation manner, each data writing request further includes a key share signature corresponding to the key share, and each consensus node saves the obtained target ciphertext data and key share, including:
所述各个共识节点分别将获得的目标密文数据、密钥份额和对应的密钥份额签名进行保存。The respective consensus nodes store the obtained target ciphertext data, the key share and the corresponding key share signature.
在一种可能的实现方式中,各个数据写入请求中还包括访问准入条件信息;在确定对所述目标密文数据达成共识后,所述各个共识节点分别保存获得的目标密文数据和密钥份额,包括:In a possible implementation manner, each data writing request further includes access access condition information; after it is determined that a consensus is reached on the target ciphertext data, each consensus node saves the obtained target ciphertext data and Key shares, including:
在确定对所述目标密文数据和所述访问准入条件信息均达成共识后,所述各个共识节点分别将获得的目标密文数据、密钥份额和访问准入条件信息进行保存;或者,After determining that both the target ciphertext data and the access access condition information have reached a consensus, each consensus node saves the obtained target ciphertext data, key share and access access condition information; or,
在确定对所述目标密文数据达成共识后,所述各个共识节点将获得的目标密文数据、密钥份额和准入条件信息进行保存。After it is determined that a consensus is reached on the target ciphertext data, each consensus node saves the obtained target ciphertext data, key share and access condition information.
在一种可能的实现方式中,所述访问准入条件信息中包括允许所述数据所有方访问所述目标密文数据的条件信息。In a possible implementation manner, the access access condition information includes condition information that allows the data owner to access the target ciphertext data.
在一种可能的实现方式中,在所述各个共识节点分别保存获得的目标密文数据和密钥份额之后,所述方法还包括:In a possible implementation manner, after the respective consensus nodes save the obtained target ciphertext data and key shares, the method further includes:
所述各个共识节点分别向所述数据所有方发送成功写入指示信息,以用于所述数据所有方在接收到的成功写入指示信息超过预定数量时确定所述目标密文数据成功写入。The respective consensus nodes respectively send successful write indication information to the data owner, for the data owner to determine that the target ciphertext data is successfully written when the received successful write indication information exceeds a predetermined number .
在一种可能的实现方式中,所述各个共识节点将获得的密钥份额保存在所述各个共识节点的可信执行环境中。In a possible implementation manner, each consensus node saves the obtained key share in the trusted execution environment of each consensus node.
根据本申请实施例的第二方面,提供了一种区块链数据访问方法,所述方法包括:According to a second aspect of the embodiments of the present application, a blockchain data access method is provided, the method comprising:
各个共识节点获得数据访问方发起的数据访问请求,其中,所述数据访问请求中包括目标数据标识;Each consensus node obtains a data access request initiated by the data access party, wherein the data access request includes a target data identifier;
所述各个共识节点从本地存储中确定所述目标数据标识对应的目标密文数据和密钥份额,其中,所述各个共识节点本地存储的密钥份额彼此不同,各密钥份额是数据所有方通过秘密共享机制将目标密钥进行拆分得到的,所述目标密文数据是所述数据所有方以所述目标密钥对明文数据加密得到的;The respective consensus nodes determine the target ciphertext data and the key share corresponding to the target data identifier from the local storage, wherein the key shares stored locally by the respective consensus nodes are different from each other, and each key share is the owner of the data. The target ciphertext data is obtained by splitting the target key through a secret sharing mechanism, and the target ciphertext data is obtained by encrypting the plaintext data with the target key by the data owner;
所述各个共识节点分别将本地存储的目标密文数据和密钥份额发送给所述数据访问方,以用于所述数据访问方根据预定数量且不同的密钥份额确定所述目标密钥,并根据所述目标密钥对所述目标密文数据解密。The respective consensus nodes send the locally stored target ciphertext data and key shares to the data access party, so that the data access party can determine the target key according to a predetermined number and different key shares, and decrypt the target ciphertext data according to the target key.
在一种可能的实现方式中,所述各个共识节点从本地存储中确定所述目标数据标识对应的目标密文数据和密钥份额,包括:In a possible implementation manner, each consensus node determines the target ciphertext data and key share corresponding to the target data identifier from local storage, including:
所述各个共识节点从本地存储中确定所述目标数据标识对应的目标密文数据、密钥份额和对应的密钥份额签名;The respective consensus nodes determine the target ciphertext data, the key share and the corresponding key share signature corresponding to the target data identifier from the local storage;
所述各个共识节点分别将本地存储的目标密文数据和密钥份额发送给所述数据访问方,包括:The respective consensus nodes send the locally stored target ciphertext data and key shares to the data access party, including:
所述各个共识节点分别将本地存储的目标密文数据、密钥份额和对应的密钥份额签名发送给所述数据访问方。The respective consensus nodes respectively send the locally stored target ciphertext data, the key share and the corresponding key share signature to the data access party.
在一种可能的实现方式中,所述数据访问请求中还包括所述数据访问方的待验证权限信息和权限签名,在所述各个共识节点分别将本地存储的目标密文数据和密钥份额发送给所述数据访问方之前,所述方法还包括:In a possible implementation manner, the data access request further includes the permission information and permission signature of the data access party to be verified, and the locally stored target ciphertext data and key share are respectively stored at the consensus nodes. Before sending to the data access party, the method further includes:
所述各个共识节点根据所述待验证权限信息和所述权限签名确定所述数据访问方的访问权限验证通过;其中,根据所述权限签名对所述待验证权限信息进行验证,并在所述待验证权限信息的验证通过时,根据所述待验证权限信息确定所述数据访问方的访问权限验证通过。The respective consensus nodes determine that the access authority verification of the data access party has passed according to the authority information to be verified and the authority signature; wherein, the authority information to be verified is verified according to the authority signature, and When the verification of the authority information to be verified is passed, it is determined that the verification of the access authority of the data access party is passed according to the authority information to be verified.
在一种可能的实现方式中,根据所述待验证权限信息确定所述数据访问方的访问权限验证通过,包括:In a possible implementation manner, determining that the access authority verification of the data access party passes the verification according to the authority information to be verified, including:
将所述待验证权限信息与访问准入条件信息进行匹配,其中,所述访问准入条件信息是由所述数据所有方确定的;Matching the permission information to be verified with access access condition information, wherein the access access condition information is determined by the data owner;
若匹配结果为设定匹配结果,则确定所述数据访问方的访问权限验证通过。If the matching result is the set matching result, it is determined that the access authority verification of the data access party has passed.
在一种可能的实现方式中,所述访问准入条件信息中包括允许所述数据所有方访问所述目标密文数据的条件信息。In a possible implementation manner, the access access condition information includes condition information that allows the data owner to access the target ciphertext data.
在一种可能的实现方式中,所述各个共识节点根据所述待验证权限信息和所述权限签名确定所述数据访问方的访问权限验证通过,包括:In a possible implementation manner, each consensus node determines that the verification of the access authority of the data access party has passed according to the authority information to be verified and the authority signature, including:
所述各个共识节点分别根据所述待验证权限信息和所述权限签名确定所述数据访问方的访问权限验证通过;或者,The respective consensus nodes determine that the access authority verification of the data access party has passed according to the authority information to be verified and the authority signature; or,
所述各个共识节点对所述待验证权限信息和所述权限签名进行共识处理,并在达成共识后确定所述数据访问方的访问权限验证通过。The respective consensus nodes perform consensus processing on the permission information to be verified and the permission signature, and after reaching a consensus, determine that the access permission verification of the data access party has passed.
根据本申请实施例的第三方面,提供了一种区块链数据写入装置,所述装置配置于各个共识节点中,所述装置包括:According to a third aspect of the embodiments of the present application, a block chain data writing device is provided, the device is configured in each consensus node, and the device includes:
获得模块,用于获得数据所有方发送的数据写入请求;其中,各数据写入请求中包括相同的目标密文数据和彼此不同的密钥份额,所述目标密文数据是所述数据所有方以目标密钥对明文数据加密得到的,各密钥份额是所述数据所有方通过秘密共享机制将所述目标密钥进行拆分得到的;The obtaining module is used to obtain the data writing request sent by the data owner; wherein, each data writing request includes the same target ciphertext data and different key shares from each other, and the target ciphertext data is owned by the data. The data is obtained by encrypting the plaintext data with the target key, and each key share is obtained by splitting the target key by the data owner through a secret sharing mechanism;
共识模块,用于对所述目标密文数据进行共识处理;a consensus module for performing consensus processing on the target ciphertext data;
存储模块,用于在确定对所述目标密文数据达成共识后,保存获得的目标密文数据和密钥份额。The storage module is configured to save the obtained target ciphertext data and key share after it is determined that a consensus has been reached on the target ciphertext data.
在一种可能的实现方式中,各个数据写入请求中还包括密钥份额对应的密钥份额签名,所述存储模块用于:In a possible implementation manner, each data write request further includes a key share signature corresponding to the key share, and the storage module is used for:
将获得的目标密文数据、密钥份额和对应的密钥份额签名进行保存。Save the obtained target ciphertext data, key share and corresponding key share signature.
在一种可能的实现方式中,各个数据写入请求中还包括访问准入条件信息,所述存储模块用于:In a possible implementation manner, each data write request further includes access access condition information, and the storage module is used for:
在确定对所述目标密文数据和所述访问准入条件信息均达成共识后,将获得的目标密文数据、密钥份额和访问准入条件信息进行保存;或者,After it is determined that a consensus is reached on the target ciphertext data and the access access condition information, the obtained target ciphertext data, key share and access access condition information are saved; or,
在确定对所述目标密文数据达成共识后,将获得的目标密文数据、密钥份额和访问准入条件信息进行保存。After it is determined that a consensus is reached on the target ciphertext data, the obtained target ciphertext data, key share and access condition information are saved.
在一种可能的实现方式中,所述访问准入条件信息中包括允许所述数据所有方访问所述目标密文数据的条件信息。In a possible implementation manner, the access access condition information includes condition information that allows the data owner to access the target ciphertext data.
在一种可能的实现方式中,所述装置还包括发送模块,用于:In a possible implementation manner, the apparatus further includes a sending module for:
在所述存储模块保存获得的目标密文数据和密钥份额之后,向所述数据所有方发送成功写入指示信息,以用于所述数据所有方在接收到的成功写入指示信息超过预定数量时确定所述目标密文数据成功写入。After the storage module saves the obtained target ciphertext data and key share, it sends the successful write indication information to the data owner, so that the data owner receives the successful write indication information exceeding a predetermined value When the number is determined, the target ciphertext data is successfully written.
根据本申请实施例的第四方面,提供了一种区块链数据访问装置,所述装置配置于各个共识节点中,所述装置包括:According to a fourth aspect of the embodiments of the present application, a blockchain data access device is provided, the device is configured in each consensus node, and the device includes:
获得模块,用于获得数据访问方发起的数据访问请求,其中,所述数据访问请求中包括目标数据标识;an obtaining module for obtaining a data access request initiated by a data access party, wherein the data access request includes a target data identifier;
确定模块,用于从本地存储中确定所述目标数据标识对应的目标密文数据和密钥份额,其中,所述各个共识节点本地存储的密钥份额彼此不同,各密钥份额是数据所有方通过秘密共享机制将目标密钥进行拆分得到的,所述目标密文数据是所述数据所有方以所述目标密钥对明文数据加密得到的;The determining module is used to determine the target ciphertext data and the key share corresponding to the target data identifier from the local storage, wherein the key shares stored locally by each consensus node are different from each other, and each key share is the owner of the data. The target ciphertext data is obtained by splitting the target key through a secret sharing mechanism, and the target ciphertext data is obtained by encrypting the plaintext data with the target key by the data owner;
发送模块,用于将本地存储的目标密文数据和密钥份额发送给所述数据访问方,以用于所述数据访问方根据预定数量且不同的密钥份额确定所述目标密钥,并根据所述目标密钥对所述目标密文数据解密。A sending module, configured to send the locally stored target ciphertext data and key shares to the data access party, so that the data access party can determine the target key according to a predetermined number and different key shares, and Decrypt the target ciphertext data according to the target key.
在一种可能的实现方式中,所述确定模块用于:In a possible implementation manner, the determining module is used for:
从本地存储中确定所述目标数据标识对应的目标密文数据、密钥份额和对应的密钥份额签名;Determine the target ciphertext data, the key share and the corresponding key share signature corresponding to the target data identifier from the local storage;
所述发送模块用于:The sending module is used for:
将本地存储的目标密文数据、密钥份额和对应的密钥份额签名发送给所述数据访问方。Send the locally stored target ciphertext data, the key share and the corresponding key share signature to the data access party.
在一种可能的实现方式中,所述数据访问请求中还包括所述数据访问方的待验证权限信息和权限签名,所述装置还包括权限验证模块,用于:In a possible implementation manner, the data access request further includes the permission information to be verified and the permission signature of the data access party, and the device further includes a permission verification module for:
在所述发送模块将本地存储的目标密文数据和密钥份额发送给所述数据访问方之前,根据所述待验证权限信息和所述权限签名确定所述数据访问方的访问权限验证通过;其中,根据所述权限签名对所述待验证权限信息进行验证,并在所述待验证权限信息的验证通过时,根据所述待验证权限信息确定所述数据访问方的访问权限验证通过。Before the sending module sends the locally stored target ciphertext data and key share to the data access party, determine that the access authority verification of the data access party has passed according to the permission information to be verified and the permission signature; Wherein, the authority information to be verified is verified according to the authority signature, and when the verification of the authority information to be verified is passed, it is determined that the access authority verification of the data access party is passed according to the authority information to be verified.
在一种可能的实现方式中,所述权限验证模块用于:In a possible implementation manner, the authority verification module is used for:
将所述待验证权限信息与访问准入条件信息进行匹配,其中,所述访问准入条件信息是由所述数据所有方确定的;Matching the permission information to be verified with access access condition information, wherein the access access condition information is determined by the data owner;
若匹配结果为设定匹配结果,则确定所述数据访问方的访问权限验证通过。If the matching result is the set matching result, it is determined that the access authority verification of the data access party has passed.
在一种可能的实现方式中,所述访问准入条件信息中包括允许所述数据所有方访问所述目标密文数据的条件信息。In a possible implementation manner, the access access condition information includes condition information that allows the data owner to access the target ciphertext data.
在一种可能的实现方式中,所述权限验证模块用于:In a possible implementation manner, the authority verification module is used for:
根据所述待验证权限信息和所述权限签名确定所述数据访问方的访问权限验证通过;或者,According to the permission information to be verified and the permission signature, it is determined that the access permission verification of the data access party has passed; or,
对所述待验证权限信息和所述权限签名进行共识处理,并在达成共识后确定所述数据访问方的访问权限验证通过。Consensus processing is performed on the permission information to be verified and the permission signature, and after reaching a consensus, it is determined that the access permission verification of the data access party has passed.
根据本申请实施例的第五方面,提供了一种区块链系统,包括至少两个共识节点,其中:According to a fifth aspect of the embodiments of the present application, a blockchain system is provided, including at least two consensus nodes, wherein:
各个共识节点用于分别获得数据所有方发送的数据写入请求,其中,各数据写入请求中包括相同的目标密文数据和彼此不同的密钥份额,所述目标密文数据是所述数据所有方以目标密钥对明文数据加密得到的,各密钥份额是所述数据所有方通过秘密共享机制将所述目标密钥进行拆分得到的;并对所述目标密文数据进行共识处理;以及在确定对所述目标密文数据达成共识后分别保存获得的目标密文数据和密钥份额。Each consensus node is used to obtain the data write request sent by the data owner respectively, wherein each data write request includes the same target ciphertext data and different key shares from each other, and the target ciphertext data is the data The owner encrypts the plaintext data with the target key, and each key share is obtained by splitting the target key by the data owner through a secret sharing mechanism; and performs consensus processing on the target ciphertext data ; and respectively save the obtained target ciphertext data and key share after reaching a consensus on the target ciphertext data.
根据本申请实施例的第六方面,提供了一种区块链系统,包括至少两个共识节点,其中:According to a sixth aspect of the embodiments of the present application, a blockchain system is provided, including at least two consensus nodes, wherein:
各个共识节点用于获得数据访问方发起的包括目标数据标识的数据访问请求;并从本地存储中确定所述目标数据标识对应的目标密文数据和密钥份额,其中,所述各个共识节点本地存储的密钥份额彼此不同,各密钥份额是数据所有方通过秘密共享机制将目标密钥进行拆分得到的,所述目标密文数据是所述数据所有方以所述目标密钥对明文数据加密得到的;以及分别将本地存储的目标密文数据和密钥份额发送给所述数据访问方,以用于所述数据访问方根据预定数量且不同的密钥份额确定所述目标密钥,并根据所述目标密钥对所述目标密文数据解密。Each consensus node is used to obtain the data access request including the target data identifier initiated by the data access party; and determine the target ciphertext data and key share corresponding to the target data identifier from the local storage, wherein each consensus node has a local The stored key shares are different from each other, each key share is obtained by the data owner splitting the target key through a secret sharing mechanism, and the target ciphertext data is the data owner using the target key to pair the plaintext. obtained by encrypting the data; and respectively sending the locally stored target ciphertext data and key shares to the data access party, so that the data access party can determine the target key according to a predetermined number and different key shares , and decrypt the target ciphertext data according to the target key.
根据本申请实施例的第七方面,提供了一种计算机存储介质,所述计算机存储介质中存储有计算机可读程序,所述计算机可读程序用于执行根据上述的第一方面中描述的方法。According to a seventh aspect of the embodiments of the present application, a computer storage medium is provided, where a computer-readable program is stored in the computer storage medium, and the computer-readable program is used to execute the method described in the above-mentioned first aspect .
根据本申请实施例的第八方面,提供了一种计算机存储介质,所述计算机存储介质中存储有计算机可读程序,所述计算机可读程序用于执行根据上述的第二方面中描述的方法。According to an eighth aspect of the embodiments of the present application, a computer storage medium is provided, where a computer-readable program is stored in the computer storage medium, and the computer-readable program is used to execute the method described in the second aspect above .
根据本申请实施例的第九方面,提供了一种计算机程序产品,该计算机程序产品对用于执行一种过程的指令进行编码,该过程包括上述的第一方面中描述的方法。According to a ninth aspect of the embodiments of the present application, there is provided a computer program product that encodes an instruction for executing a process, the process including the method described in the first aspect above.
根据本申请实施例的第十方面,提供了一种计算机程序产品,该计算机程序产品对用于执行一种过程的指令进行编码,该过程包括上述的第二方面中描述的方法。According to a tenth aspect of the embodiments of the present application, there is provided a computer program product, the computer program product encoding an instruction for executing a process, the process including the method described in the second aspect above.
根据本申请实施例的区块链数据写入、访问方法及装置,数据所有方在将目标密文数据上链存储时,将用于加密得到目标密文数据的目标密钥拆分成多个密钥份额,并将拆分得到的密钥份额分布式地存储在区块链系统中的各个共识节点中,采用秘密共享的密码技术,将各个密钥份额分开存储,即使个别密钥份额被恶意窃取或者篡改,也并不影响对目标密钥的准确恢复,提高了目标密钥在区块链系统中的安全性,从而提升了目标密文数据的安全性。进而,数据访问方在访问链上的目标密文数据时,在通过分散的多个密钥份额对目标密文数据进行有效保护的基础上,也可确保数据访问方能够通过一定数量的密钥份额恢复出正确的目标密钥,从而实现对目标密文数据的有效、安全的访问,提高了对区块链上存储数据访问的安全性。According to the method and device for writing and accessing blockchain data in the embodiments of the present application, when the data owner uploads and stores the target ciphertext data on the chain, the target key used to encrypt and obtain the target ciphertext data is split into multiple The key shares are distributed and stored in each consensus node in the blockchain system in a distributed manner. The cryptographic technology of secret sharing is used to store each key share separately, even if the individual key shares are Malicious theft or tampering does not affect the accurate recovery of the target key, which improves the security of the target key in the blockchain system, thereby improving the security of the target ciphertext data. Furthermore, when the data access party accesses the target ciphertext data on the chain, on the basis of effectively protecting the target ciphertext data through multiple distributed key shares, it can also ensure that the data access party can pass a certain number of keys. The share restores the correct target key, thereby realizing effective and safe access to the target ciphertext data, and improving the security of access to the data stored on the blockchain.
附图说明Description of drawings
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described herein are used to provide further understanding of the present application and constitute a part of the present application. The schematic embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation of the present application. In the attached image:
图1为本申请实施例适用的一种应用场景的示意图;FIG. 1 is a schematic diagram of an application scenario to which an embodiment of the present application is applicable;
图2为本申请实施例中的区块链数据写入方法的流程示意图;2 is a schematic flowchart of a method for writing blockchain data in an embodiment of the present application;
图3为本申请实施例中的区块链数据访问方法的流程示意图;3 is a schematic flowchart of a blockchain data access method in an embodiment of the application;
图4为本申请实施例中的数据所有方向区块链系统请求写入数据的过程示意图;FIG. 4 is a schematic diagram of a process of requesting data writing from a data owner-directed blockchain system in an embodiment of the application;
图5为本申请实施例中的数据访问方向区块链系统请求读取数据的过程示意图;FIG. 5 is a schematic diagram of a process of requesting a data access direction block chain system to read data in an embodiment of the application;
图6为本申请实施例中的区块链数据写入装置的结构框图;6 is a structural block diagram of a block chain data writing device in an embodiment of the application;
图7为本申请实施例中的区块链数据访问装置的结构框图。FIG. 7 is a structural block diagram of a blockchain data access device in an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请实施例中的技术方案及优点更加清楚明白,以下结合附图对本申请的示例性实施例进行进一步详细的说明,显然,所描述的实施例仅是本申请的一部分实施例,而不是所有实施例的穷举。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。In order to make the technical solutions and advantages of the embodiments of the present application clearer, the exemplary embodiments of the present application will be described in further detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and Not all embodiments are exhaustive. It should be noted that the embodiments in the present application and the features of the embodiments may be combined with each other in the case of no conflict.
本申请实施例的技术方案可应用于区块链系统中,通过该技术方案,在向区块链系统写入数据以及对区块链上的数据进行访问时可进行一定程度的安全控制,进而可提高区块链上数据的安全性。The technical solutions of the embodiments of the present application can be applied to the blockchain system, and through the technical solutions, a certain degree of security control can be performed when writing data to the blockchain system and accessing data on the blockchain, and further It can improve the security of data on the blockchain.
为更好地理解本申请实施例提供的技术方案,下面对本申请实施例提供的技术方案适用的应用场景做一些简单介绍,需要说明的是,以下介绍的应用场景仅用于说明本申请实施例而非限定。在具体实施时,可以根据实际需要灵活地应用本申请实施例提供的技术方案。In order to better understand the technical solutions provided by the embodiments of the present application, some application scenarios to which the technical solutions provided by the embodiments of the present application are applicable are briefly introduced below. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application. rather than limiting. During specific implementation, the technical solutions provided by the embodiments of the present application may be flexibly applied according to actual needs.
请参见图1所示,图1为本申请实施例的技术方案适用的一种应用场景,其中包括数据所有方、区块链系统、数据访问方,数据所有方和数据访问方可以是客户端、终端设备,也可以是可信认证中心或共识协议上层程序等。数据所有方和数据访问方均可与区块链系统进行通信,数据所有方可将希望存储的数据发送给区块链系统以实现数据的上链存储,数据访问方可以向区块链系统请求读取期望的数据,例如希望读取前述的数据所有方上链存储的数据,或者希望读取该数据访问方自身之前上链存储的数据,从而实现分享数据的目的。Please refer to FIG. 1. FIG. 1 is an application scenario to which the technical solution of the embodiment of the present application is applicable, which includes a data owner, a blockchain system, and a data accessor, and the data owner and data accessor may be clients. , terminal equipment, or a trusted certification center or an upper-layer program of a consensus protocol. Both the data owner and the data access party can communicate with the blockchain system. The data owner can send the data they want to store to the blockchain system to realize the on-chain storage of the data, and the data access party can request the blockchain system. To read the desired data, for example, you want to read the data stored on the chain by the aforementioned data owner, or you want to read the data stored on the chain before the data access party itself, so as to achieve the purpose of sharing data.
图1中的区块链系统可以理解为是区块链网络,该区块链网络是一个对等通信的网络,区块链系统中包括多个可互相通信的区块链节点,区块链节点可以是例如服务器等物理节点,或者可以是逻辑节点,本申请实施例不做限制。区块链系统中的多个区块链节点可以组成共识网络,而构成共识网络的各个区块链节点又可称作共识节点,共识网络可采用特定的共识算法对信息进行共识处理以达成共识。区块链系统具有去中心化、不可篡改、全程留痕、集体维护、公开透明等特点,随着区块链技术的发展,其在各种领域的应用越来越广泛。而在实际应用中,对于涉及一些业务场景的数据需要进行安全保护,以保证用户的利益。The blockchain system in Figure 1 can be understood as a blockchain network, which is a peer-to-peer communication network. The blockchain system includes multiple blockchain nodes that can communicate with each other. The node may be a physical node such as a server, or may be a logical node, which is not limited in this embodiment of the present application. Multiple blockchain nodes in a blockchain system can form a consensus network, and each blockchain node that constitutes a consensus network can also be called a consensus node. The consensus network can use a specific consensus algorithm to process information by consensus to reach a consensus. . The blockchain system has the characteristics of decentralization, non-tampering, full trace, collective maintenance, openness and transparency, etc. With the development of blockchain technology, its application in various fields is becoming more and more extensive. In practical applications, security protection is required for data involving some business scenarios to ensure the interests of users.
图1中区块链系统中的各个节点可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(ContentDelivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器,本申请实施例不做限制。Each node in the blockchain system in Figure 1 can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud service, cloud database, cloud computing, cloud function, Cloud servers for basic cloud computing services such as cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms, and other basic cloud computing services. make restrictions.
本申请实施例的技术方案分别从数据写入(即将数据上链存储)和数据访问两方面进行说明,其中的数据访问方案是基于数据写入方案实现的,具体来说,数据所有方在向区块链系统写入数据时将用来加密数据的密钥采用秘密共享技术拆分为多个密钥份额,然后将加密得到的数据和各个密钥份额分别上链存储在区块链系统中的各个区块链节点中,通过该方式将加密数据的密钥分布式地存储在区块链系统中,根据秘密共享技术的原理,即使区块链系统中的某些区块链节点失效(例如已被敌手控制或者硬件故障等),如果没有足够数量的密钥份额也无法恢复出目标密钥,从而实现对目标密钥的有效保护,并且也可以确保数据访问方能够拿到一定数量(该数量与秘密共享技术有关)的密钥份额来恢复出正确的加密密钥,以实现对加密数据的解密,从而得到正确的明文数据,完成对链上数据的安全访问。The technical solutions of the embodiments of the present application are respectively described from the aspects of data writing (that is, storing data on the chain) and data access. The data access solution is implemented based on the data writing solution. When the blockchain system writes data, the key used to encrypt the data is split into multiple key shares using secret sharing technology, and then the encrypted data and each key share are uploaded to the blockchain system and stored in the blockchain system. In each blockchain node of the blockchain system, the keys of encrypted data are distributed in the blockchain system in this way. According to the principle of secret sharing technology, even if some blockchain nodes in the blockchain system fail ( For example, it has been controlled by an adversary or hardware failure, etc.), if there is not a sufficient number of key shares, the target key cannot be recovered, so as to achieve effective protection of the target key, and it can also ensure that the data access party can get a certain amount ( This number is related to the secret sharing technology) to recover the correct encryption key to decrypt the encrypted data, so as to obtain the correct plaintext data and complete the secure access to the data on the chain.
为便于理解,以下先结合图2对数据上链的过程进行说明,其中,数据上链的过程即为数据所有方将需要存储的数据写入到区块链系统进行存储的过程。图2为本申请实施例提供的区块链数据写入方法的流程示意图,图2所示的流程描述如下。For ease of understanding, the following describes the process of data uploading on the chain with reference to Figure 2. The process of data uploading to the chain is the process in which the data owner writes the data to be stored into the blockchain system for storage. FIG. 2 is a schematic flowchart of a method for writing blockchain data according to an embodiment of the present application. The flowchart shown in FIG. 2 is described as follows.
S201:数据所有方采用目标密钥对明文数据进行加密,得到对应的目标密文数据。S201: The data owner encrypts the plaintext data with the target key to obtain the corresponding target ciphertext data.
例如,数据所有方需要将某条交易数据上链存储,为了确保该交易数据的安全,在上链之前可对该交易数据进行加密处理,例如可以采用通用的对称加密算法对该交易数据进行加密处理,可以将该交易数据理解为是本申请实施例中的明文数据,将加密用的密钥理解为本申请实施例中的目标密钥,以及将加密处理得到的加密数据理解为本申请实施例中的目标密文数据。For example, the data owner needs to store a certain transaction data on the chain. In order to ensure the security of the transaction data, the transaction data can be encrypted before being uploaded to the chain. For example, the transaction data can be encrypted by using a general symmetric encryption algorithm. processing, the transaction data can be understood as the plaintext data in the embodiment of the present application, the key used for encryption can be understood as the target key in the embodiment of the present application, and the encrypted data obtained by encryption processing can be understood as the implementation of the present application The target ciphertext data in the example.
其中,数据所有方可以是任一经授权客户、可信认证中心或共识协议上层程序,本申请实施例不做限制。The data owner may be any authorized client, a trusted certification center, or an upper-layer program of a consensus protocol, which is not limited in this embodiment of the present application.
S202:数据所有方采用秘密共享机制将目标密钥拆分为至少两个密钥份额。S202: The data owner uses a secret sharing mechanism to split the target key into at least two key shares.
也就是说,可以将目标密钥拆分为多个密钥份额,即将目标密钥按照特定的算法进行割裂处理,而拆分得到的各个密钥份额均是不同的。That is to say, the target key can be split into multiple key shares, that is, the target key is split according to a specific algorithm, and each key share obtained by splitting is different.
在本申请实施例中,采用了秘密共享技术来实现对目标密钥的拆分,以下对秘密共享技术进行简单介绍。In the embodiments of the present application, the secret sharing technology is used to realize the splitting of the target key, and the secret sharing technology is briefly introduced below.
秘密共享技术的思想是将秘密以适当的方式拆分,拆分后得到的每一个份额可由不同的参与者管理,单个参与者无法恢复秘密信息,只有若干个参与者一同协作才能恢复秘密信息。更重要的是,当其中任何相应范围内参与者出现问题时,秘密仍可以完整恢复。秘密共享是一种将秘密分割存储的密码技术,目的是阻止秘密过于集中,以达到分散风险和容忍入侵的目的,是信息安全和数据保密中的重要手段。秘密共享中有两个参数,例如以t,n表示这两个参数,则可以称作(t,n)秘密共享,其中的n表示将秘密拆分成的份额的数量,t表示至少要得到t个份额才可恢复出秘密,而任意少于t个份额是无法得到秘密的任何相关信息。具体理解如下:The idea of secret sharing technology is to split the secret in an appropriate way. Each share obtained after splitting can be managed by different participants. A single participant cannot recover the secret information, and only several participants can cooperate to recover the secret information. More importantly, in the event of a problem with any of the corresponding in-scope participants, the secret can still be fully recovered. Secret sharing is a cryptographic technology that separates and stores secrets. The purpose is to prevent secrets from being too concentrated, so as to achieve the purpose of dispersing risks and tolerating intrusions. It is an important means in information security and data secrecy. There are two parameters in secret sharing. For example, if t and n represent these two parameters, it can be called (t, n) secret sharing, where n represents the number of shares to split the secret into, and t represents at least the number of shares to be obtained. Only t shares can recover the secret, and any less than t shares cannot obtain any relevant information about the secret. The specific understanding is as follows:
假设将秘密secret拆分为n 个份额的秘密份额,那么通过任意t(2≤t≤n)个或更多个秘密份额就可以恢复得到秘密secret,而任意少于t个的一个或多个秘密份额是不能得到关于秘密secret的任何有用信息的。Assuming that the secret secret is split into n-share secret shares, then the secret secret can be recovered by any t (2≤t≤n) or more secret shares, and any one or more secret shares less than t can be recovered. The secret share cannot get any useful information about the secret secret.
在实际中,根据t和n的选择,可权衡安全性和可靠性。一般来说,t值越大,可提供高安全性和低可靠性;t值越低,可提供低安全性和高可靠性。In practice, depending on the choice of t and n, safety and reliability can be traded off. In general, larger values of t provide high security and low reliability; lower values of t provide low security and high reliability.
根据上面介绍的秘密共享技术,例如将目标密钥拆分为了对应的n(n为大于或等于2的整数)个密钥份额,拆分得到的n个密钥份额例如是:K1、K2、 K3、……、Kn。According to the secret sharing technology introduced above, for example, the target key is split into corresponding n (n is an integer greater than or equal to 2) key shares, and the n key shares obtained by splitting are, for example: K1, K2, K3, ..., Kn.
本申请实施例中,数据所有方采用秘密共享机制将目标密钥拆成密钥份额的数量可以根据区块链系统中的共识网络中所包括的共识节点的数量来确定,例如,可令密钥份额的数量与共识节点的数量相同,即有多少个共识节点则将目标密钥拆分为多少个密钥份额,又例如,可令密钥份额的数量略多于共识节点的数量,这里所说的“略多于”是指多于共识节点数量的设定值,设定值例如是1或者2或者3等较小的整数,这里的设定值也与秘密共享技术中的t值有关,这样可确保各个共识节点均能获得一个密钥份额且获得的密钥份额彼此之间是不同的,但是又能确保从共识节点中获得足够数量且相互不同的密钥份额以准确地恢复出目标密钥。In this embodiment of the present application, the number of data owners splitting the target key into key shares using a secret sharing mechanism can be determined according to the number of consensus nodes included in the consensus network in the blockchain system. The number of key shares is the same as the number of consensus nodes, that is, how many consensus nodes there are, the target key is divided into how many key shares, and for example, the number of key shares can be slightly more than the number of consensus nodes, here The "slightly more" refers to the set value that is larger than the number of consensus nodes. The set value is, for example, a small integer such as 1, 2, or 3. The set value here is also the same as the t value in the secret sharing technology. Related, this ensures that each consensus node gets a key share that is different from each other, but also ensures that a sufficient number of mutually different key shares are obtained from the consensus nodes to recover accurately out the target key.
举例来说,区块链系统中的共识网络包括20个共识节点,那么数据所有方可将目标密钥拆分成20个密钥份额,这样可以将这20个密钥份额分别对应发送给各个共识节点,后续可尽量从各个共识节点处获得这20个密钥份额,即使其中有个别共识节点失效,也可得到足够多的密钥份额而恢复出目标密钥,以实现对目标密文数据的准确解密。For example, if the consensus network in the blockchain system includes 20 consensus nodes, the data owner can split the target key into 20 key shares, so that the 20 key shares can be sent to each Consensus nodes, the 20 key shares can be obtained from each consensus node as much as possible in the future. Even if some of the consensus nodes fail, enough key shares can be obtained to recover the target key, so as to realize the target ciphertext data. accurate decryption.
又例如,区块链系统中的共识网络包括20个共识节点,那么数据所有方可将目标密钥拆分成21个密钥份额,这样可以将得到的密钥份额中的20个密钥分别发送给各个共识节点,后续可从各个共识节点处获得这20个密钥份额,即使未能获得全部密钥(全部密钥是21个),以及即使其中有个别共识节点失效而无法正确获得该共识节点所保管的密钥份额,也可得到足够多的密钥份额而恢复出目标密钥,以实现对目标密文数据的准确解密。For another example, the consensus network in the blockchain system includes 20 consensus nodes, then the data owner can split the target key into 21 key shares, so that the 20 keys in the obtained key shares can be divided into 20 key shares. It is sent to each consensus node, and the 20 key shares can be obtained from each consensus node later, even if all keys cannot be obtained (all keys are 21), and even if some of the consensus nodes fail and cannot be obtained correctly. The key shares kept by the consensus nodes can also obtain enough key shares to recover the target key, so as to achieve accurate decryption of the target ciphertext data.
S203:数据所有方对每个密钥份额进行签名处理,得到每个密钥份额对应的密钥份额签名。S203: The data owner performs signature processing on each key share to obtain a key share signature corresponding to each key share.
对密钥份额进行签名处理的方式可以采用一些通用的签名方式,例如可以先对密钥份额采用哈希算法计算数字摘要,然后采用非对称密钥中的私钥对该数字摘要进行加密,加密后的数字摘要就是该密钥份额的签名,称作密钥份额签名。例如,密钥份额K1、K2、K3、……、Kn对应的密钥份额签名分别以Sig1、Sig2、Sig3、……、Sign表示。Some common signature methods can be used to sign the key share. For example, a hash algorithm can be used to calculate the digital digest of the key share, and then the digital digest can be encrypted by using the private key in the asymmetric key. The resulting digital digest is the signature of the key share, called the key share signature. For example, the key share signatures corresponding to the key shares K1, K2, K3, ..., Kn are represented by Sig1, Sig2, Sig3, ..., Sign, respectively.
S204:数据所有方确定目标密文数据对应的访问准入条件信息。S204: The data owner determines access access condition information corresponding to the target ciphertext data.
其中,访问准入条件信息是用于对目标密文数据进行访问控制的筛选条件信息,在具体实施过程中,访问准入条件信息可以是访问控制列表(Access Control List,ACL),例如可以是数据所有方指定的允许或者不允许访问目标密文数据的用户标识、客户端标识、设备标识等黑名单或白名单,或者,访问准入条件信息也可以是特定的访问控制条件,可以理解为是数据所有方设定的允许或者不允许访问目标密文数据的限制条件,例如:允许35岁~50岁的女性访问目标密文数据,其中的“35岁~50岁的女性”即可理解为是访问控制条件,或者,不允许年龄小于20岁或者年龄大于65岁的人群访问目标密文数据,其中的“年龄小于20岁或者年龄大于65岁的人群”即可理解为是访问控制条件。Wherein, the access access condition information is the filter condition information used to control the access to the target ciphertext data. In the specific implementation process, the access access condition information may be an access control list (Access Control List, ACL), for example, it may be The blacklist or whitelist of user IDs, client IDs, device IDs and other user IDs, client IDs, and device IDs specified by the data owner to allow or disallow access to the target ciphertext data, or the access condition information can also be a specific access control condition, which can be understood as It is a restriction set by the data owner to allow or not allow access to the target ciphertext data. For example, to allow women between the ages of 35 and 50 to access the target ciphertext data, the "women between the ages of 35 and 50" can be understood. It is an access control condition, or, people younger than 20 years old or older than 65 years old are not allowed to access the target ciphertext data, in which "people younger than 20 years old or older than 65 years old" can be understood as access control conditions .
在实际中,用户可能会丢失自身加密获得的加密数据或者忘记自己加密数据的加密密钥,例如上述的目标密文数据,数据所有方在本地利用目标密钥对目标明文数据进行加密得到目标密文数据之后,可能会将目标密文数据丢失(例如误删或者被窃取)或者忘记了目标密钥,例如在丢失了目标密文数据后但又想要再获得对应的目标明文数据,此时使知晓目标密钥也无法执行解密操作,又例如在忘记了目标密钥却又想要获得目标明文数据或者希望为目标密文数据重置密钥时,由于没有加密用的目标密钥所以也就无法执行这些操作,可见,不便于用户对加密数据进行管理。鉴于此,本申请实施例中,数据所有方在设置针对目标密文数据的访问准入条件信息时可以允许数据所有方自身也能够访问,为此,可以在访问准入条件信息中设置允许该数据所有方访问目标密文数据的条件信息,例如可以将数据所有方的用户标识等身份信息添加到访问准入条件信息中,这样,在将目标密文数据上链存储到区块链系统后,数据所有方可作为访问者再向区块链系统请求读取目标密文数据以获得目标密文数据和对应的多个密钥份额,即可从区块链系统中重新获得目标密文数据和多个密钥份额,进而利用根据多个密钥份额恢复出的目标密钥对目标密文数据进行解密以得到对应的目标明文数据,或者可以根据恢复出的目标密钥对目标密文数据进行密钥重置处理,从而,可方便数据所有方自身对目标密文数据进行链上访问和二次管理等。In practice, users may lose the encrypted data obtained by their own encryption or forget the encryption key of their own encrypted data, such as the above-mentioned target ciphertext data. The data owner encrypts the target plaintext data locally with the target key to obtain the target password. After the data is stored, the target ciphertext data may be lost (for example, deleted or stolen by mistake) or the target key may be forgotten. Even if the target key is known, the decryption operation cannot be performed. For example, when you forget the target key but want to obtain the target plaintext data or want to reset the key for the target ciphertext data, because there is no target key for encryption, it is also Therefore, it is impossible to perform these operations, and it can be seen that it is inconvenient for users to manage encrypted data. In view of this, in the embodiment of the present application, the data owner may allow the data owner to access the access condition information for the target ciphertext data when setting the access condition information. Condition information for the data owner to access the target ciphertext data, for example, the identity information such as the user ID of the data owner can be added to the access access condition information, so that after the target ciphertext data is stored on the blockchain and stored in the blockchain system , the data owner can then request the blockchain system to read the target ciphertext data as a visitor to obtain the target ciphertext data and the corresponding multiple key shares, and then the target ciphertext data can be retrieved from the blockchain system and multiple key shares, and then use the target key recovered from the multiple key shares to decrypt the target ciphertext data to obtain the corresponding target plaintext data, or the target ciphertext data can be decrypted according to the recovered target key. The key reset process is performed, so that it is convenient for the data owner to access the target ciphertext data on-chain and secondary management.
S205:数据所有方根据共识节点的数量生成数据写入请求。S205: The data owner generates a data write request according to the number of consensus nodes.
具体来说,有多少个共识节点即可生成相同数量的数据写入请求,即数据写入请求的数量与共识节点的数量是相同的。如前介绍的,密钥份额的数量可能是等于或者大于共识节点的总数量的,考虑到实际情形,当密钥份额的数量与共识节点的总数量相同,例如都为20个,那么可使用全部的密钥份额来生成对应相同数量的数据写入请求,这样生成的20个数据写入请求中均包括一个密钥份额,且这20个数据写入请求中分别包括的密钥份额是彼此不同的;当密钥份额的数量大于共识节点的总数量,例如密钥份额是21个且共识节点的总数量是20个,那么可使用部分的密钥份额(即使用其中的随机的20个密钥份额)来对应生成20个数据写入请求,这样生成的20个数据写入请求中均包括一个密钥份额,且这20个数据写入请求中分别包括的密钥份额是彼此不同的。也就是说,数据所有方可生成与共识节点的总数量相同的数据写入请求,且各个数据写入请求中所携带的密钥份额是彼此不同的。Specifically, how many consensus nodes can generate the same number of data write requests, that is, the number of data write requests is the same as the number of consensus nodes. As mentioned before, the number of key shares may be equal to or greater than the total number of consensus nodes. Considering the actual situation, when the number of key shares is the same as the total number of consensus nodes, for example, both are 20, then you can use All key shares are used to generate the same number of data write requests, so that each of the 20 data write requests generated includes one key share, and the key shares included in the 20 data write requests are each other’s Different; when the number of key shares is greater than the total number of consensus nodes, for example, the number of key shares is 21 and the total number of consensus nodes is 20, then part of the key shares can be used (that is, using random 20 of them). key share) to generate 20 data write requests, each of the 20 generated data write requests includes one key share, and the key shares included in the 20 data write requests are different from each other . That is to say, the data owner can generate the same number of data write requests as the total number of consensus nodes, and the key shares carried in each data write request are different from each other.
每个数据写入请求中除了包括上述提到的密钥份额,还包括目标密文数据,此外,还可包括访问准入条件信息和/或密钥份额签名,每个数据写入请求中所包括的密钥份额以及对应的密钥份额签名是不同的。也就是说,各个数据写入请求包括的相同部分为目标密文数据和访问准入条件信息,而包括的不同部分则是密钥份额和对应的密钥份额签名。In addition to the above-mentioned key shares, each data write request also includes target ciphertext data, and also includes access condition information and/or key share signatures. The key shares included and the corresponding key share signatures are different. That is to say, the same part included in each data write request is the target ciphertext data and access access condition information, and the different parts included are the key share and the corresponding key share signature.
另外需要说明的是,上述S203和S204可以是可选的步骤,所以在图2中是以虚线表示的。也就是说,在具体实施过程中可能会执行S203和/或S204,也可能并不会执行S203和/或S204。那么对应的,若未执行S203,数据所有方生成的数据写入请求中也就并不包含密钥份额签名,以及,若未执行S204,那么数据所有方生成的数据写入请求中也就并不包含访问准入条件信息,在实施时可灵活选择S203和S204的实施,进而对数据写入请求中所包括的信息进行灵活配置以实现不同的验证功能,本申请实施例并不做限制。In addition, it should be noted that the above-mentioned S203 and S204 may be optional steps, so they are represented by dotted lines in FIG. 2 . That is to say, in the specific implementation process, S203 and/or S204 may be executed, or S203 and/or S204 may not be executed. Correspondingly, if S203 is not executed, the data write request generated by the data owner does not include the key share signature, and if S204 is not executed, the data write request generated by the data owner also does not contain the key share signature. Does not include access access condition information, and can flexibly choose the implementation of S203 and S204 during implementation, and then flexibly configure the information included in the data write request to implement different verification functions, which is not limited in this embodiment of the present application.
S206:数据所有方将各个数据写入请求发送给各个共识节点,对应的,各个共识节点分别获得数据所有方发送的数据写入请求。S206: The data owner sends each data write request to each consensus node, and correspondingly, each consensus node obtains the data write request sent by the data owner respectively.
如前所述的,数据所有方生成的数据写入请求的数量与共识节点的总数量是相同的,这样,数据所有方可将每个数据写入请求发送给不同的共识节点,如此,每个共识节点获得的是不同的密钥份额,这样可以将目标密钥对应的各个密钥份额分布式地存储在区块链系统中的不同节点中,以实现对密钥份额的分布式存储,这样,即使有个别共识节点已经被敌手控制(例如被恶意者攻击),但是该共识节点由于无法获得足够多的(例如前述的t个)密钥份额也是无法恢复出目标密钥的,所以这样可以较大程度上确保目标密钥的安全性。As mentioned earlier, the number of data write requests generated by the data owner is the same as the total number of consensus nodes, so that the data owner can send each data write request to a different consensus node, so that each Each consensus node obtains different key shares, so that each key share corresponding to the target key can be distributed in different nodes in the blockchain system to achieve distributed storage of key shares, In this way, even if an individual consensus node has been controlled by an adversary (such as being attacked by a malicious person), the consensus node cannot recover the target key because it cannot obtain enough (such as the aforementioned t) key shares. The security of the target key can be ensured to a large extent.
继续前述例子,由于有n个密钥份额K1、K2、 K3、……、Kn,如图2中所示的,例如生成的对应的数据写入请求为数据写入请求1、数据写入请求2、数据写入请求3、……、数据写入请求n,并将这n个数据写入请求分别发送给共识节点1、共识节点2、共识节点3、……、共识节点n。需要说明的是,为了简化图示,图2中仅示出了共识节点1和共识节点n,其它的共识节点以“……”替代表示。Continuing the foregoing example, since there are n key shares K1, K2, K3, . 2. Data write request 3, ..., data write request n, and send these n data write requests to
继续参见图2所示,数据所有方将各个数据写入请求对应发送给各个共识节点的步骤具体可以包括S206a、S206n等步骤。其中,S206a是数据所有方将携带目标密文数据和密钥份额1的数据写入请求1发送给共识节点1,S206n是数据所有方将携带目标密文数据和密钥份额n的数据写入请求n发送给共识节点n。需要说明的是,为了简化图示,图2中仅仅是以共识节点1、共识节点n进行举例说明,所以图2中仅示出了共识节点1和共识节点n,其它的共识节点以“……”替代表示,在具体实施过程中,还可以包括其它更多的共识节点,对应的,数据所有方还可以向其它的共识节点发送携带其它密钥份额和目标密文数据的不同数据写入请求。Continuing to refer to FIG. 2 , the step of the data owner correspondingly sending each data write request to each consensus node may specifically include steps S206a, S206n and the like. Among them, S206a is that the data owner sends the data write
S207:各个共识节点对目标密文数据进行共识处理,并达成共识。S207: Each consensus node performs consensus processing on the target ciphertext data, and reaches a consensus.
在区块链系统中的各个共识节点获得数据所有方发送的数据写入请求之后,各个共识节点均获得了相同的目标密文数据,基于区块链系统去中心化的特性,可先对目标密文数据进行共识处理,以确保各个共识节点最终存储的目标密文数据都是准确、唯一且有效的,即确保各个目标区块链节点最终存储的目标密文数据是一份相同的正确数据。After each consensus node in the blockchain system obtains the data write request sent by the data owner, each consensus node obtains the same target ciphertext data. The ciphertext data is processed by consensus to ensure that the target ciphertext data finally stored by each consensus node is accurate, unique and valid, that is, to ensure that the target ciphertext data finally stored by each target blockchain node is the same correct data .
区块链系统中的各个共识节点可以组成一个共识网络,在具体实施过程中,该共识网络可采用预定共识算法对目标密文数据进行共识处理以达成对目标密文数据的共识,需要说明的是,共识网络对目标密文数据进行共识处理,即是各个共识节点联合对目标密文数据进行共识处理。其中的预定共识算法可以采用目前通用的共识算法,例如工作量证明(Proof of Work,Pow)算法、股权证明(Proof of Stake,PoS)算法、委任权益证明(Delegated Proof of Stake,DPoS)、实用拜占庭容错(Practical Byzantine FaultTolerance,PBFT)算法等。Each consensus node in the blockchain system can form a consensus network. In the specific implementation process, the consensus network can use a predetermined consensus algorithm to perform consensus processing on the target ciphertext data to reach a consensus on the target ciphertext data. Yes, the consensus network performs consensus processing on the target ciphertext data, that is, each consensus node jointly performs consensus processing on the target ciphertext data. Among them, the predetermined consensus algorithm can adopt the current common consensus algorithm, such as Proof of Work (Pow) algorithm, Proof of Stake (PoS) algorithm, Delegated Proof of Stake (DPoS), practical Byzantine Fault Tolerance (Practical Byzantine Fault Tolerance, PBFT) algorithm, etc.
对目标密文数据达成共识,一方面可以包括对目标密文数据本身达成共识,另一方面还可以包括对目标密文数据的排序信息达成共识,其中的排序信息是用于指示目标密文数据在区块链系统中的排列顺序,例如可以是编号或者序号等信息。这样,共识系统中的各个共识节点可以达成对目标密文数据的数据本身以及排列顺序的共识,即确定目标密文数据和对应的排列顺序是唯一且准确的。Reaching a consensus on the target ciphertext data, on the one hand, may include reaching a consensus on the target ciphertext data itself, and on the other hand, it may also include reaching a consensus on the sorting information of the target ciphertext data, where the sorting information is used to indicate the target ciphertext data. The order of arrangement in the blockchain system, for example, can be information such as number or serial number. In this way, each consensus node in the consensus system can reach a consensus on the data itself and the arrangement order of the target ciphertext data, that is, it is determined that the target ciphertext data and the corresponding arrangement order are unique and accurate.
在一种可能的实施方式中,共识网络还可以对各个数据写入请求中的访问准入条件信息进行共识处理并达成共识,以确保各个共识节点最终所确定并存储的访问准入条件信息是准确且唯一的信息,确保访问准入条件信息有效。In a possible implementation, the consensus network can also perform consensus processing on the access access condition information in each data write request and reach a consensus, so as to ensure that the access access condition information finally determined and stored by each consensus node is Accurate and unique information to ensure access to access condition information is valid.
S208:各个共识节点分别保存获得的目标密文数据和密钥份额。S208: Each consensus node saves the obtained target ciphertext data and key shares respectively.
也就是说,在共识系统对目标密文数据达成共识之后,各个共识节点分别将各自从数据所有方接收到的同一份目标密文数据存储在本地,以及,将各自从数据所有方接收到的不同的密钥份额也一并存储在本地,从而,实现目标密文数据和多个密钥份额的上链存储,并且由于各个密钥份额是分别保存在不同的共识节点中的,以此可实现对若干密钥份额的分离存储,这样即使某个共识节点失效,例如被敌手攻击而使得该失效的共识节点中保存的密钥份额被泄露,但是由于敌手无法获得其它的密钥份额,所以无法获得足够数量的密钥份额来恢复出目标密钥,所以将各个密钥份额分开存储的方式可提高目标密钥的安全性,从而确保目标密文数据链上存储的安全性。That is to say, after the consensus system reaches a consensus on the target ciphertext data, each consensus node stores the same copy of the target ciphertext data received from the data owner locally, and stores the data received from the data owner respectively. Different key shares are also stored locally, thus realizing the on-chain storage of target ciphertext data and multiple key shares, and since each key share is stored in different consensus nodes, this can be achieved. Realize the separate storage of several key shares, so that even if a consensus node fails, such as being attacked by an adversary, the key shares saved in the failed consensus node are leaked, but since the adversary cannot obtain other key shares, so It is impossible to obtain a sufficient number of key shares to recover the target key, so the method of storing each key share separately can improve the security of the target key, thereby ensuring the security of the target ciphertext data stored on the chain.
此外,若数据写入请求中还包括有密钥份额签名和/或访问准入条件信息,各个共识节点也可以将接收到的密钥份额签名和/或访问准入条件信息连同目标密文数据和密钥份额一并存储在各个共识节点本地。In addition, if the data write request also includes key share signature and/or access access condition information, each consensus node can also send the received key share signature and/or access access condition information together with the target ciphertext data It is stored locally with each consensus node together with the key share.
例如,若数据写入请求中还包括密钥份额签名,则各个共识节点在确定对目标密文数据达成共识之后,可分别将获得的目标密文数据、密钥份额、对应的密钥份额签名保存在各个共识节点本地。For example, if the data writing request also includes a key share signature, each consensus node can sign the obtained target ciphertext data, key share, and corresponding key share after determining that they have reached a consensus on the target ciphertext data. Saved locally on each consensus node.
又例如,若数据写入请求中还包括访问准入条件信息,则各个共识节点在确定对目标密文数据达成共识之后,或者各个共识节点在确定对目标密文数据和访问准入条件信息均达成共识之后,可分别将获得的目标密文数据、密钥份额、访问准入条件信息保存在各个共识节点本地。For another example, if the data writing request also includes access access condition information, after each consensus node determines to reach a consensus on the target ciphertext data, or each consensus node determines that both the target ciphertext data and the access access condition information are After reaching a consensus, the obtained target ciphertext data, key share, and access access condition information can be saved locally in each consensus node.
再例如,若数据写入请求中还同时包括密钥份额签名和访问准入条件信息,则各个共识节点在确定对目标密文数据达成共识之后,或者各个共识节点在确定对目标密文数据和访问准入条件信息均达成共识之后,可分别将获得的目标密文数据、访问准入条件信息、密钥份额、对应的密钥份额签名保存在各个共识节点本地,即将这些数据本地存储。For another example, if the data writing request also includes key share signature and access access condition information, then each consensus node determines that the target ciphertext data has reached a consensus, or each consensus node determines that the target ciphertext data and After reaching a consensus on the access access condition information, the obtained target ciphertext data, access access condition information, key share, and the corresponding key share signature can be stored locally in each consensus node, that is, these data are stored locally.
S209:各个共识节点分别向数据所有方发送成功写入指示信息,对应的,数据所有方接收各个共识点发送的成功写入指示信息。S209: Each consensus node sends the successful write indication information to the data owner respectively, and correspondingly, the data owner receives the successful write indication information sent by each consensus point.
各个共识节点在将数据所有方发送的数据写入请求中的信息保存在本地之后,可以分别向数据所有方发送成功写入指示信息,成功写入指示信息用于指示对应的数据写入请求中需写入的数据已经成功存入了各个共识节点,例如指示数据写入请求中的目标密文数据和密钥份额已经成功保存在共识节点中。After each consensus node saves the information in the data write request sent by the data owner locally, it can send the successful write indication information to the data owner respectively, and the successful write indication information is used to indicate the corresponding data write request. The data to be written has been successfully stored in each consensus node, for example, the target ciphertext data and key share in the data write request have been successfully stored in the consensus node.
在实施时,各个共识节点向数据所有方发送的成功写入指示信息可以是相同,即发送的格式和内容均可以是相同的,或者也可以是不同的,在图2中是以发送的相同的成功写入指示信息为例进行图示说明的。During implementation, the successful writing indication information sent by each consensus node to the data owner may be the same, that is, the sent format and content may be the same, or they may be different, in FIG. The successful write indication information of , is illustrated as an example.
S210:数据所有方确定成功写入指示信息超过预定数量时,则确定目标密文数据已成功写入。S210: When the data owner determines that the successful writing indication information exceeds a predetermined number, it is determined that the target ciphertext data has been successfully written.
在实际中,由于区块链系统中的个别共识节点可能已经被恶意攻击或者发生故障等,那么这些共识节点可能并不能成功地向数据所有方发送成功写入指示信息,但是一般来说,正常运行的共识节点是大多数,也就是说,数据所有方收到的成功写入指示信息的数量可能是等于或者少于共识节点的数量的。为此,数据所有方即使未能收到全部共识节点发送的写入成功指示信息,也可以通过预定数量(例如称作第一预定数量)的成功写入指示信息来确定目标密文数据以及目标密钥(对应分散存储的多个密钥份额)已成功写入了区块链系统,即当接收到的成功写入指示信息超过第一预定数量时则可认为目标密文数据和目标密钥已成功存储到了区块链系统中。这里的第一预定数量与前面介绍的(t,n)秘密共享机制中的t的取值有关,第一预定数量可以是等于或者大于t且小于或等于n的任何整数,这样是确保已经被准确保存的密钥份额的数量是足够后续用来恢复目标密钥的。或者,例如整个共识系统中包括n个共识节点,而假设整个共识系统中已经被敌手控制的节点数最多为f个,那么t的取值可以是f+1≤t≤n-f,即,t的取值可根据共识系统中假定的失效节点的数量确定。In practice, since individual consensus nodes in the blockchain system may have been maliciously attacked or malfunctioned, these consensus nodes may not be able to successfully send the successful write indication to the data owner, but generally speaking, normal The number of consensus nodes running is the majority, that is, the number of successful write indications received by the data owner may be equal to or less than the number of consensus nodes. For this reason, even if the data owner fails to receive the write success indication information sent by all the consensus nodes, it can determine the target ciphertext data and the target ciphertext data through a predetermined number (for example, referred to as the first predetermined number) of successful write indication information. The key (corresponding to multiple key shares in decentralized storage) has been successfully written into the blockchain system, that is, when the received successful write indication information exceeds the first predetermined number, it can be considered that the target ciphertext data and the target key It has been successfully stored in the blockchain system. The first predetermined number here is related to the value of t in the (t, n) secret sharing mechanism introduced above. The first predetermined number can be any integer equal to or greater than t and less than or equal to n, which ensures that the The number of accurately stored key shares is sufficient for subsequent recovery of the target key. Or, for example, the entire consensus system includes n consensus nodes, and assuming that the number of nodes that have been controlled by the adversary in the entire consensus system is at most f, then the value of t can be f+1≤t≤n-f, that is, the value of t The value can be determined according to the assumed number of failed nodes in the consensus system.
在具体实施过程中,各个共识节点在保存密钥份额时,可将密钥份额保存在各个共识节点的可信执行环境(Trusted Execution Environment,TEE)中,以尽量提高密钥份额的安全性。In the specific implementation process, when each consensus node saves the key share, it can save the key share in the Trusted Execution Environment (TEE) of each consensus node to improve the security of the key share as much as possible.
具体来说,为了尽量保证目标密文数据和密钥份额的安全,为此,各个共识节点在存储目标密文数据和密钥份额时可将其保存在该共识节点的可信执行环境中,以一个共识节点(例如是共识节点A)为例,共识节点A可以将目标密文数据、密钥份额、对应的密钥份额签名保存在第一存储区域中,而将访问准入条件信息保存在第二存储区域中,其中的第二存储区域是常规的内存区域,而第一存储区域是位于TEE中的,这样可以更进一步地保证目标密文数据和密钥份额的安全性。在另一种可能实施方式中,由于可信执行环境是需要额外维护的,为了减少对TEE的存储占用,考虑到保证目标密文数据的安全前提是需要尽量维护密钥份额的安全,为此可仅将密钥份额保存在可信执行环境中,而将目标密文数据、访问准入条件信息、密钥份额签名保存在常规的存储区域中,或者可仅将密钥份额和密钥份额签名保存在TEE中,而将目标密文数据和访问准入条件信息存在常规的存储区域中,以尽量首要保证密钥份额的安全。Specifically, in order to ensure the security of the target ciphertext data and key share as much as possible, each consensus node can save the target ciphertext data and key share in the trusted execution environment of the consensus node when storing them. Taking a consensus node (for example, consensus node A) as an example, consensus node A can save the target ciphertext data, key share, and the corresponding key share signature in the first storage area, and save the access access condition information. In the second storage area, the second storage area is a conventional memory area, and the first storage area is located in the TEE, which can further ensure the security of the target ciphertext data and the key share. In another possible implementation, since the trusted execution environment requires additional maintenance, in order to reduce the storage occupation of the TEE, it is necessary to maintain the security of the key share as much as possible to ensure the security of the target ciphertext data. Only the key shares can be stored in the trusted execution environment, and the target ciphertext data, access condition information, and key share signatures can be stored in the conventional storage area, or only the key shares and key shares can be stored The signature is stored in the TEE, and the target ciphertext data and access condition information are stored in the conventional storage area to ensure the security of the key share as much as possible.
其中,TEE是基于 CPU 硬件的安全扩展,且与外部完全隔离的可信执行环境。TEE最早是由Global Platform提出的概念,用于解决移动设备上资源的安全隔离,平行于操作系统为应用程序提供可信安全的执行环境。而伴随着互联网的高速发展,安全的需求越来越高,不仅限于移动设备,云端设备,数据中心都对TEE提出了更多的需求,TEE的概念为此也得到了高速的发展和扩充。现在所说的TEE相比与最初提出的概念已经是更加广义的TEE,例如,服务器芯片厂商Intel,AMD等都先后推出了硬件辅助的TEE并丰富了TEE的概念和特性,在工业界得到了广泛的认可。Among them, TEE is a trusted execution environment based on the security extension of CPU hardware and completely isolated from the outside world. TEE was first proposed by Global Platform to solve the security isolation of resources on mobile devices, and to provide a trusted and secure execution environment for applications in parallel with the operating system. With the rapid development of the Internet, the demand for security is getting higher and higher, not only mobile devices, cloud devices, and data centers have put forward more demands on TEE, and the concept of TEE has also been rapidly developed and expanded. Compared with the concept originally proposed, TEE is a broader TEE. For example, server chip manufacturers Intel, AMD, etc. have successively launched hardware-assisted TEE and enriched the concept and characteristics of TEE. widely recognized.
以Intel SGX技术为例,SGX提供了内存中一个加密的可信执行区域,由 CPU 保护数据不被窃取。以上述的共识节点A采用支持SGX的CPU为例,利用新增的处理器指令,在共识节点A的内存中可以分配一部分区域作为围圈页面缓存或飞地页面缓存(Enclave PageCache,EPC),通过 CPU 内的加密引擎 MEE(Memory Encryption Engine)对EPC的数据进行加密,EPC 中加密的内容只有进入 CPU 后才会被解密,所以,可以将密钥份额存储在该区域中。在SGX 中,用户可以不信任操作系统、虚拟机监控器(Virtual Machine Monitor,VMM)、甚至基本输入输出系统(Basic Input Output System,BIOS),只需要信任 CPU 便能确保隐私数据不会泄漏,所以,通过将密钥份额保存在EPC中的方式可确保密钥份额足够的安全性,密钥份额被泄露的可能性很小。Taking Intel SGX technology as an example, SGX provides an encrypted trusted execution area in memory, and data is protected from theft by the CPU. Taking the above-mentioned consensus node A using a CPU supporting SGX as an example, using the newly added processor instructions, a part of the memory of consensus node A can be allocated as an enclave page cache or an enclave page cache (Enclave PageCache, EPC), The data of the EPC is encrypted by the encryption engine MEE (Memory Encryption Engine) in the CPU. The encrypted content in the EPC will only be decrypted after entering the CPU. Therefore, the key share can be stored in this area. In SGX, users can not trust the operating system, virtual machine monitor (Virtual Machine Monitor, VMM), or even the basic input output system (Basic Input Output System, BIOS), only need to trust the CPU to ensure that private data will not leak, Therefore, by storing the key share in the EPC, the sufficient security of the key share can be ensured, and the possibility of the key share being leaked is very small.
本申请实施例中的区块链数据写入方案中,由于采用了秘密共享机制将目标密钥进行了拆分处理并分布式存储在了区块链系统中的多个共识节点中,可以提高目标密钥的安全性,这样,即使某些区块链节点由于已经被恶意攻击或者出现硬件故障等原因失效或不安全时,攻击者也难以获得一定数量(例如前述介绍的t)的密钥份额来恢复目标密钥,进一步地保证了目标密文数据的安全性,从而提高了数据上链存储的安全性。In the blockchain data writing scheme in the embodiment of the present application, since a secret sharing mechanism is used to split the target key and store it in a distributed manner in multiple consensus nodes in the blockchain system, it can improve the The security of the target key, so that even if some blockchain nodes are invalid or insecure due to malicious attacks or hardware failures, it is difficult for an attacker to obtain a certain number of keys (such as the aforementioned t) share to restore the target key, which further ensures the security of the target ciphertext data, thereby improving the security of data storage on the chain.
上面通过图2介绍了数据所有方将目标密文数据和各个密钥份额上链存储到区块链系统的过程,基于该上链存储数据的过程,以下再通过图3对数据访问方向区块链系统请求访问目标密文数据的流程进行介绍。图3为本申请实施例中的区块链数据访问方法的流程示意图,图3所示的流程描述如下。Figure 2 above introduces the process of the data owner uploading the target ciphertext data and each key share to the blockchain system. The process of the chain system requesting access to the target ciphertext data is introduced. FIG. 3 is a schematic flowchart of a blockchain data access method in an embodiment of the present application. The flowchart shown in FIG. 3 is described as follows.
S301:数据访问方向各个共识节点发起数据访问请求,对应的,各个共识节点获得数据访问方发起的数据访问请求。S301: The data access direction initiates a data access request to each consensus node, and correspondingly, each consensus node obtains the data access request initiated by the data access party.
当数据访问方希望读取区块链上的数据时,可以向区块链系统发送请求,例如,当数据访问方希望读取区块链上存储的目标密文数据时,可以向区块链系统发送包括有目标数据标识的数据访问请求,其中的目标数据标识是用于唯一标识目标密文数据的标识信息,例如可以是目标密文数据的编号或者序号等排序信息,或者可以是指示目标密文数据的数据所有方何时上链存储的相关指示信息等。When the data access party wants to read the data on the blockchain, it can send a request to the blockchain system. For example, when the data access party wants to read the target ciphertext data stored on the blockchain, it can send a request to the blockchain system. The system sends a data access request including a target data identifier, where the target data identifier is the identification information used to uniquely identify the target ciphertext data, for example, it can be sorting information such as the number or serial number of the target ciphertext data, or it can be an indication of the target Relevant indication information of when the data owner of the ciphertext data will be stored on the chain.
基于前述对区块链数据的写入方法的介绍可知,区块链系统中的各个共识节点中存储有目标密文数据和用于加密得到目标密文数据的目标密钥对应的密钥份额,并且各个共识节点中存储的密钥份额彼此是互不相同的,其中,各个共识节点中存储的密钥份额是数据所有方通过秘密共享机制将目标密钥进行拆分得到的。为了获取到目标密文数据和足够多的密钥份额,数据访问方向区块链系统发起数据访问请求,可以是指向各个共识节点发起数据访问请求,在具体实施过程中,各个共识节点可以通过以下任一种方式获得数据访问方发起的数据访问请求。Based on the foregoing introduction to the method of writing blockchain data, it can be seen that each consensus node in the blockchain system stores the target ciphertext data and the key share corresponding to the target key used to encrypt the target ciphertext data. And the key shares stored in each consensus node are different from each other, wherein the key shares stored in each consensus node are obtained by splitting the target key by the data owner through a secret sharing mechanism. In order to obtain the target ciphertext data and enough key shares, the data access direction initiates a data access request to the blockchain system, which can be directed to each consensus node to initiate a data access request. In the specific implementation process, each consensus node can pass the following Either way to obtain the data access request initiated by the data access party.
方式1,数据访问方生成携带有目标数据标识的数据访问请求,并且将该数据访问请求分别发送给各个共识节点,这样,各个共识节点可直接从数据访问方处接收到数据访问请求。In
方式2,数据访问方生成携带有目标数据标识的数据访问请求,并且将该数据访问请求发送给共识网络中的某个共识节点,例如将该共识节点称作目标共识节点,再由目标共识节点扩散(例如广播)至共识网络中的其它共识节点,这样,各个共识节点也可获得数据访问请求。其中,从数据访问方处直接接收数据访问方的目标共识节点可以是共识网络中的任一个共识节点,目标共识节点可以是预先指定的或者也可以是数据访问方随机选择的,例如对于采用POW、POS、DPOS等争夺记账权性质的共识算法的共识网络,数据访问方可随机选择其中的一个共识节点作为目标共识节点,而对于采用PBFT等非争夺记账权性质的共识算法的共识网络,数据访问方可将其中的记账节点(预先商定好的)确定为目标共识节点。Mode 2, the data access party generates a data access request carrying the target data identifier, and sends the data access request to a consensus node in the consensus network, for example, the consensus node is called the target consensus node, and then the target consensus node Diffusion (such as broadcasting) to other consensus nodes in the consensus network, so that each consensus node can also obtain data access requests. The target consensus node that directly receives the data access party from the data access party can be any consensus node in the consensus network, and the target consensus node can be pre-specified or randomly selected by the data access party. Consensus networks with consensus algorithms that compete for accounting rights, such as POS, DPOS, etc., the data access party can randomly select one of the consensus nodes as the target consensus node. , the data access party can determine the accounting node (pre-agreed) as the target consensus node.
数据访问请求中携带有目标数据标识,此外,还可以包括数据访问方的待验证权限信息,或者还可以包括数据访问方的待验证权限信息和该待验证权限信息对应的权限签名。其中的待验证权限信息是用于对数据访问方是否具有读取目标密文数据的权限进行验证的信息,而权限签名是用于对待验证权限信息进行有效性验证的签名信息。The data access request carries the target data identifier, and may also include the authority information to be verified of the data access party, or may also include the authority information to be verified of the data access party and the authority signature corresponding to the authority information to be verified. The permission information to be verified is the information used to verify whether the data access party has the permission to read the target ciphertext data, and the permission signature is the signature information used to verify the validity of the permission information to be verified.
其中,数据访问方可以是任一经授权客户、可信认证中心或共识协议上层程序,本申请实施例不做限制。Wherein, the data access party may be any authorized client, a trusted certification center, or an upper-layer program of a consensus protocol, which is not limited in this embodiment of the present application.
S302:各个共识节点从本地存储中确定目标数据标识对应的目标密文数据和密钥份额。S302: Each consensus node determines the target ciphertext data and the key share corresponding to the target data identifier from the local storage.
其中,请参见图2对应实施例部分对于各个共识节点中分别存储的内容的介绍可知,不同的共识节点中存储的是同一份目标密文数据,但是各个共识节点中存储的密钥份额是彼此不同的,而所有共识节点中存储的密钥份额是数据所有方通过秘密共享机制将用于加密得到目标密文数据的目标密钥进行拆分得到的。所以,各个共识节点在获得数据所有方发送的数据访问请求之后,即可根据目标数据标识从本地存储中确定出目标数据标识所指示的目标密文数据,以及确定出与其对应的密钥份额。Among them, please refer to the introduction of the contents stored in each consensus node in the corresponding embodiment section of FIG. 2. It can be seen that the same target ciphertext data is stored in different consensus nodes, but the key shares stored in each consensus node are different from each other. The key shares stored in all consensus nodes are obtained by splitting the target key used to encrypt the target ciphertext data by the data owner through the secret sharing mechanism. Therefore, after obtaining the data access request sent by the data owner, each consensus node can determine the target ciphertext data indicated by the target data identifier from the local storage according to the target data identifier, and determine the corresponding key share.
S303:各个共识节点根据待验证权限信息和权限签名确定数据访问方的访问权限验证通过。S303: Each consensus node determines that the access authority verification of the data access party has passed according to the authority information to be verified and the authority signature.
在具体实施过程中,各个共识节点可各自独立的根据待验证权限信息和权限签名对数据访问方的访问权限进行验证,以得到数据访问方的访问权限验证结果。具体地,各个共识节点先根据权限签名对待验证权限信息进行有效性验证,并在待验证权限信息的有效性验证通过时再根据待验证权限信息来验证数据访问方的访问权限,例如,可将待验证权限信息与数据所有方预先上链存储在区块链系统中的访问准入条件信息进行匹配比较,在匹配结果为设定匹配结果时则可确定数据访问方的访问权限验证通过。其中的访问准入条件信息,如前所述的,访问准入条件信息可以是数据所有方指定的允许或者不允许访问目标密文数据的用户标识、客户端标识、设备标识等黑名单或白名单,或者,访问准入条件信息也可以是允许或者不允许访问目标密文数据的限制条件。各个共识节点各自在本地独立地对数据访问方进行访问权限验证,各个共识节点对数据访问方的访问权限验证可并行进行,这样可以在一定程度上加快整个区块链系统对数据访问方的权限验证过程,并且各个共识节点独立验证的方式可尽量减少对链上公共资源的占用。In the specific implementation process, each consensus node can independently verify the access authority of the data access party according to the authority information to be verified and the authority signature, so as to obtain the access authority verification result of the data access party. Specifically, each consensus node first verifies the validity of the authority information to be verified according to the authority signature, and then verifies the access authority of the data access party according to the authority information to be verified when the validity verification of the authority information to be verified passes. The permission information to be verified is matched and compared with the access access condition information stored in the blockchain system by the data owner in advance. The access access condition information, as mentioned above, may be a blacklist or whitelist specified by the data owner that allows or does not allow access to the target ciphertext data, such as user identifiers, client identifiers, device identifiers, etc. The list, or the access access condition information can also be a restriction condition that allows or does not allow access to the target ciphertext data. Each consensus node independently verifies the access rights of the data access party locally, and the access rights verification of each consensus node to the data access party can be carried out in parallel, which can speed up the rights of the entire blockchain system to the data access party to a certain extent. The verification process, and the independent verification of each consensus node can minimize the occupation of public resources on the chain.
在另一种实施方式中,各个共识节点还可联合对待验证权限信息和权限签名进行共识处理,并在达成共识时确定数据访问方的访问权限验证通过。具体来说,共识网络通过运行共识算法可确定出具有记账权的共识节点,再由具有记账权的共识节点采用上述共识节点独立的根据根据待验证权限信息和权限签名对数据访问方的访问权限进行验证的方式确定数据访问方是否具有访问权限,再将确定结果扩散给其它共识节点。所有共识节点通过共识方式对访问权限进行验证的方式,充分利用了区块链网络的共识特性,这样可确保各个共识节点对最终验证结果认知的一致性,在具体实施过程中,可进行一轮共识处理,或者,为提高验证结果的准确性,也可采用不同的共识算法进行至少两轮共识验证,本申请实施例不做限制。In another embodiment, each consensus node can also jointly perform consensus processing on the permission information to be verified and the permission signature, and determine that the access permission of the data access party has passed the verification when a consensus is reached. Specifically, the consensus network can determine the consensus node with the accounting right by running the consensus algorithm, and then the consensus node with the accounting right uses the above consensus node to independently determine the data access party according to the permission information to be verified and the permission signature. The way to verify the access authority determines whether the data accessor has the access authority, and then spreads the determination result to other consensus nodes. All consensus nodes verify access rights through consensus, making full use of the consensus characteristics of the blockchain network, which can ensure the consistency of each consensus node's cognition of the final verification result. rounds of consensus processing, or, in order to improve the accuracy of the verification result, different consensus algorithms may be used to perform at least two rounds of consensus verification, which is not limited in this embodiment of the present application.
其中的访问准入条件信息,如前所述的,访问准入条件信息可以是数据所有方指定的允许或者不允许访问目标密文数据的用户标识、客户端标识、设备标识等黑名单或白名单,或者,访问准入条件信息也可以是允许或者不允许访问目标密文数据的限制条件。The access access condition information, as mentioned above, may be a blacklist or whitelist specified by the data owner that allows or does not allow access to the target ciphertext data, such as user identifiers, client identifiers, device identifiers, etc. The list, or the access access condition information can also be a restriction condition that allows or does not allow access to the target ciphertext data.
本申请实施例中,通过权限签名和待验证权限信息对数据访问方的访问权限进行验证,可实现对访问者的访问控制,这样可以尽量提高数据访问的安全性和有效性,同时也保证链上数据的安全性。In the embodiment of the present application, the access authority of the data access party is verified by the authority signature and the authority information to be verified, so as to realize the access control of the visitor, so as to improve the security and effectiveness of data access as much as possible, and at the same time ensure the chain data security.
在实际中,数据访问方可以是图2对应实施例中介绍的数据所有方,也就是说,数据访问方可以对自己之前上链存储到区块链系统中的加密数据请求访问,例如在数据访问方忘记了之前上链存储的加密数据的密钥时则可采用该方式再次获得目标密文数据和目标密钥,以此可重新获得加密数据对应的明文数据,进而可实现对数据的再次管理。在这种情形下,数据所有方(此时也为数据访问方)预先上链存储的访问准入条件信息中可包括允许数据访问方访问目标密文数据的相关信息,例如数据访问方的用户标识等,这样在进行匹配比较时则可确保数据访问方能够通过权限认证,进而从区块链上获得目标密文数据和多个密钥份额。In practice, the data access party may be the data owner described in the corresponding embodiment in FIG. 2 , that is, the data access party may request access to the encrypted data stored in the blockchain system by itself, for example, in the data When the visitor forgets the key of the encrypted data stored on the chain before, this method can be used to obtain the target ciphertext data and the target key again, so that the plaintext data corresponding to the encrypted data can be obtained again, and the data can be retrieved again. manage. In this case, the access access condition information pre-stored by the data owner (also the data accessor at this time) may include relevant information that allows the data accessor to access the target ciphertext data, such as the user of the data accessor In this way, when matching and comparing, it can ensure that the data access party can pass the authorization authentication, and then obtain the target ciphertext data and multiple key shares from the blockchain.
在具体实施时,S303是可选的步骤,所以在图3中是以虚线框表示的。During specific implementation, S303 is an optional step, so it is represented by a dashed box in FIG. 3 .
S304:各个共识节点分别将本地的目标密文数据和密钥份额发送给数据访问方,对应的,数据访问方接收各个共识节点发送的目标密文数据和密钥份额。S304: Each consensus node sends the local target ciphertext data and key share to the data access party, correspondingly, the data access party receives the target ciphertext data and key share sent by each consensus node.
在数据访问方的访问权限验证通过时,表明该数据访问方是具有权限访问链上的目标密文数据的,则各个共识节点可以将目标密文数据发送给数据访问方,并且同时为了数据访问方能够完成对目标密文数据的解密,也需要一并将解密钥匙发送给数据访问方,但是由于加密用的目标密钥已经被拆分成了多个密钥份额,所以各个共识节点还分别将各自保管的密钥份额发送给数据访问方,以便于数据访问方能够根据接收到的多个密钥份额恢复出目标密钥,再采用目标密钥对目标密文数据进行解密。When the access authority verification of the data access party passes, it indicates that the data access party has the right to access the target ciphertext data on the chain, then each consensus node can send the target ciphertext data to the data access party, and at the same time, for the purpose of data access To complete the decryption of the target ciphertext data, it is also necessary to send the decryption key to the data access party. However, since the target key for encryption has been split into multiple key shares, each consensus node also has separate The key shares kept by them are sent to the data access party, so that the data access party can recover the target key according to the received multiple key shares, and then use the target key to decrypt the target ciphertext data.
请参见图3所示的,S304可以包括S304a和S304n等步骤,S304a是共识节点1向数据访问方发送目标密文数据和密钥份额1,S304n是共识节点n向数据访问方发送目标密文数据和密钥份额n。需要说明的是,图3中仅仅是以共识节点1、共识节点n进行举例说明,在具体实施过程中,还可以包括其它的共识节点,对应的,其它的共识节点还可以向数据访问方发送目标密文数据和其它的密钥份额。Referring to Figure 3, S304 may include steps such as S304a and S304n. S304a is the
S305:数据访问方根据预定数量且不同的密钥份额确定目标密钥,并根据目标密钥对目标密文数据进行解密。S305: The data access party determines the target key according to the predetermined number and different key shares, and decrypts the target ciphertext data according to the target key.
在实际中,由于区块链系统中的某些共识节点可能已经被恶意攻击或者出现硬件故障等原因并不能向数据访问方返回目标密文数据和对应的密钥份额,或者并不能向数据访问方发送正确的目标密文数据和对应的密钥份额。为此,根据(t,n)秘密共享技术的原理,数据访问方最少只要收到预定数量(例如称作第二预定数量,为大于或等于t且小于或等于n的整数)且互不相同的密钥份额就可以恢复出目标密钥,进而根据目标密钥对目标密文数据的解密,以此实现链上数据的有效访问。In practice, because some consensus nodes in the blockchain system may have been maliciously attacked or have hardware failures, the target ciphertext data and the corresponding key share cannot be returned to the data access party, or the data cannot be accessed. The party sends the correct target ciphertext data and the corresponding key share. For this reason, according to the principle of (t, n) secret sharing technology, the data access party at least only needs to receive a predetermined number (for example, called the second predetermined number, which is an integer greater than or equal to t and less than or equal to n) and different from each other The target key can be recovered, and then the target ciphertext data can be decrypted according to the target key, so as to achieve effective access to the data on the chain.
如前所述的,各个共识节点除了存储的目标密文数据和各不相同的密钥份额之外,还可以包括密钥份额对应的密钥份额签名,基于此,各个共识节点向数据访问方发送目标密文数据和密钥份额的同时,还可以一并发送密钥份额对应的密钥份额签名,以便于数据访问方可先根据密钥份额签名对密钥份额本身进行有效性验证,在密钥份额的有效性验证通过时,将其作为一个有效的密钥份额,进一步地的再使用第二预定数量个各不相同的有效密钥份额来恢复得到目标密钥。得到目标密钥之后,可通过运行与数据所有方所采用的对称加密算法对应的解密算法对目标密文数据进行解密,从而可得到目标密文数据对应的明文数据,以实现链上数据的有效访问。As mentioned above, in addition to the stored target ciphertext data and different key shares, each consensus node may also include a key share signature corresponding to the key share. Based on this, each consensus node sends data to the data access party. When sending the target ciphertext data and the key share, the key share signature corresponding to the key share can also be sent together, so that the data access party can first verify the validity of the key share itself according to the key share signature. When the validity verification of the key share is passed, it is regarded as a valid key share, and a second predetermined number of different valid key shares are further used to restore the target key. After obtaining the target key, the target ciphertext data can be decrypted by running the decryption algorithm corresponding to the symmetric encryption algorithm used by the data owner, so as to obtain the plaintext data corresponding to the target ciphertext data, so as to realize the effective data on the chain. access.
本申请实施例中,数据所有方在将目标密文数据上链存储的同时,将用于加密得到目标密文数据的目标密钥拆分成多个密钥份额,并将拆分得到的密钥份额分布式地存储在区块链系统中的各个节点中,采用秘密共享的密码技术,即使个别密钥份额被恶意窃取或者篡改,也并不影响对目标密钥的准确恢复,提高了目标密钥在区块链系统中的安全性,从而也就提升了目标密文数据的安全性,进而,数据访问方在访问链上的目标密文数据时,在通过分散的多个密钥对目标密文数据进行有效保护的基础上,也可确保数据访问方能够通过一定数量的密钥份额能够恢复出正确的目标密钥,从而实现对目标密文数据的有效、安全的访问,提高了对区块链上存储数据访问的安全性。In the embodiment of the present application, while storing the target ciphertext data on the chain, the data owner splits the target key used to encrypt the target ciphertext data into multiple key shares, and splits the obtained ciphertext data into multiple key shares. The key shares are stored in each node in the blockchain system in a distributed manner. The secret sharing cryptographic technology is adopted. Even if individual key shares are maliciously stolen or tampered with, the accurate recovery of the target key will not be affected, and the target key will be improved. The security of the key in the blockchain system also improves the security of the target ciphertext data. Furthermore, when the data access party accesses the target ciphertext data on the chain, it passes through multiple distributed key pairs. On the basis of effective protection of the target ciphertext data, it can also ensure that the data access party can recover the correct target key through a certain number of key shares, so as to achieve effective and safe access to the target ciphertext data, and improve the performance of the target ciphertext data. Security of access to data stored on the blockchain.
为便于理解,以下结合图4和图5对本申请实施例中的技术方案进行说明。For ease of understanding, the technical solutions in the embodiments of the present application are described below with reference to FIG. 4 and FIG. 5 .
请参见图4,假设数据所有方需要上链存储的目标密文数据是C,数据所有方确定能够访问目标密文数据的访问准入条件信息以ACL表示,用于采用对称加密方式进行加密得到目标密文数据C的目标密钥是K,数据所有方采用秘密共享技术将目标密钥K拆分为了K1、K2、K3、K4这四份密钥份额,而与K1、K2、K3、K4对应的密钥份额签名分别以Sig1、Sig2、Sig3、Sig4表示。在具体实施过程中,数据所有方将目标密钥K拆分成多少个密钥份额的数量可以是与区块链系统中的共识网络所包括的共识节点数相同的,例如图4中所示的都是4个。Please refer to Figure 4, assuming that the target ciphertext data that the data owner needs to store on the chain is C, and the access access condition information determined by the data owner to be able to access the target ciphertext data is represented by ACL, which is used to encrypt the data using symmetric encryption. The target key of the target ciphertext data C is K. The data owner uses the secret sharing technology to split the target key K into four key shares of K1, K2, K3, and K4. The corresponding key share signatures are represented by Sig1, Sig2, Sig3, and Sig4, respectively. In the specific implementation process, the number of key shares that the data owner splits the target key K into can be the same as the number of consensus nodes included in the consensus network in the blockchain system, such as shown in Figure 4 All are 4.
进一步地,数据所有方根据密钥份额的不同,生成了4个数据写入请求,如图4中的Write1、Write2、Write3、Write4。其中,Write1、Write2、Write3、Write4中均携带了目标密文数据C和访问准入条件信息ACL,而这4个数据写入请求中携带的密钥份额和对应的密钥份额签名均是不同的,以图4所示,Write1、Write2、Write3、Write4分别携带了密钥份额K1和密钥份额签名Sig1、密钥份额K2和密钥份额签名Sig2、密钥份额K3和密钥份额签名Sig3、密钥份额K4和密钥份额签名Sig4。在各个共识节点接收到对应的数据写入请求后,如共识节点1接收到的是Write1、共识节点2接收到的是Write2、共识节点3接收到的是Write3、共识节4接收到的是Write4,则将接收到的数据写入请求中的携带的信息分别保存在本地,如图4中的下图所示。然后,各个共识节点再向数据所有方发送成功写入指示信息,在图4中分别以Success1、Success2、Success3、Success4表示各个共识节点发送的成功写入指示信息,数据所有方可以根据足够数量的成功写入指示信息确定目标密文数据已经成功写入了区块链系统,实现了加密数据的上链存储。Further, the data owner generates 4 data write requests according to different key shares, such as Write1, Write2, Write3, and Write4 in Figure 4. Among them, Write1, Write2, Write3, and Write4 all carry the target ciphertext data C and the access access condition information ACL, and the key shares carried in the four data write requests and the corresponding key share signatures are different. As shown in Figure 4, Write1, Write2, Write3, and Write4 respectively carry the key share K1 and the key share signature Sig1, the key share K2 and the key share signature Sig2, the key share K3 and the key share signature Sig3 , key share K4 and key share signature Sig4. After each consensus node receives the corresponding data write request, for example,
再参见图5所示,当数据访问方希望从区块链系统读取目标密文数据时,可以向各个共识节点发送对应的读取指令,在图5中是以Read1、Read2、Read3、Read4分别表示数据访问方向各个共识节点发送的数据访问请求的,并且各个数据访问请求所携带的信息是相同的,假设其中的ts表示目标密文数据的编号(对应前述的目标数据标识),IDc表示的是数据访问方的身份标识(对应前述的待验证权限信息),Sigc是数据访问方的身份标识对应的身份签名(对应前述的权限签名)。图5中示出的是向各个共识节点均发送数据访问请求的方式,在另一种可能的实施方式中,数据访问方也可以仅向其中某一个共识节点发送数据访问请求,再由该节点将数据访问请求广播给其余各个节点。Referring to Figure 5 again, when the data access party wants to read the target ciphertext data from the blockchain system, it can send the corresponding read command to each consensus node. In Figure 5, it is Read1, Read2, Read3, Read4 Respectively represent the data access requests sent by the data access direction to each consensus node, and the information carried by each data access request is the same, assuming that ts represents the number of the target ciphertext data (corresponding to the aforementioned target data identifier), IDc represents Sigc is the identity signature of the data access party (corresponding to the aforementioned permission information to be verified), and Sigc is the identity signature (corresponding to the aforementioned permission signature) corresponding to the identity of the data access party. Figure 5 shows the way of sending data access requests to each consensus node. In another possible implementation, the data access party can also send data access requests to only one of the consensus nodes, and then the node Broadcast data access requests to the rest of the nodes.
进一步地,各个共识节点可以根据数据写入请求中的Sigc对数据访问方的身份标识IDc进行有效性验证,在根据IDc进行访问权限验证,待验证通过后可以从本地存储中确定出ts对应的目标密文数据、密钥份额和密钥份额签名。进一步地,共识节点1、共识节点2、共识节点3、共识节点4分别将各自存储的目标密文数据、密钥份额和对应的密钥份额签名分别发送给数据访问方,如图5中所示的,共识节点1将C、K1、Sig1发送给了数据访问方、共识节点2将C、K2、Sig2发送给了数据访问方、共识节点3将C、K3、Sig3发送给了数据访问方、共识节点4将C、K4、Sig4发送给了数据访问方。数据所有方在收到各个节点返回的数据之后,可以根据秘密共享机制通过足够数量且互不相同的密钥份额来恢复得到目标密钥K,再利用目标密钥K对目标密文数据C进行解密,以完成对链上数据的有效访问。Further, each consensus node can verify the validity of the identity identifier IDc of the data access party according to the Sigc in the data writing request, and verify the access authority according to the IDc. After the verification is passed, the corresponding ts can be determined from the local storage. Target ciphertext data, key share, and key share signature. Further,
本申请实施例中,数据所有方、数据访问方、区块链系统之间可以使用加密通道交换数据,这样可尽量确保数据安全传输。此外,数据所有方、数据访问方、区块链系统均可使用可信硬件、TEE、可信平台模块(Trusted Platform Module,TPM)、密码卡、密码机等,确保数据安全可靠地处理和保存。In the embodiment of the present application, the data owner, the data access party, and the blockchain system can use encrypted channels to exchange data, so as to ensure the safe transmission of data as much as possible. In addition, data owners, data access parties, and blockchain systems can use trusted hardware, TEE, Trusted Platform Module (TPM), cryptographic cards, cryptographic machines, etc., to ensure safe and reliable data processing and storage .
基于同一发明构思,本申请实施例提供一种区块链系统,该区块链系统例如是图1中的区块链系统,该区块链系统包括至少两个共识节点,这至少两个共识节点构成共识网络,其中:Based on the same inventive concept, the embodiments of the present application provide a blockchain system, for example, the blockchain system in FIG. 1 , the blockchain system includes at least two consensus nodes, the at least two consensus nodes Nodes form a consensus network, where:
各个共识节点用于分别获得数据所有方发送的数据写入请求,其中,各数据写入请求中包括相同的目标密文数据和彼此不同的密钥份额,目标密文数据是数据所有方以目标密钥对明文数据加密得到的,各密钥份额是数据所有方通过秘密共享机制将目标密钥进行拆分得到的;并对目标密文数据进行共识处理;以及在确定对目标密文数据达成共识后分别保存获得的目标密文数据和密钥份额。Each consensus node is used to obtain the data write request sent by the data owner, wherein each data write request includes the same target ciphertext data and different key shares from each other, and the target ciphertext data is the target ciphertext data of the data owner. The key is obtained by encrypting the plaintext data, and each key share is obtained by splitting the target key by the data owner through a secret sharing mechanism; consensus processing is performed on the target ciphertext data; After the consensus, the obtained target ciphertext data and key share are saved respectively.
基于本申请实施例中的区块链系统可以实现前述的图2和图4所描述的流程,基于秘密共享技术将目标密文数据对应的目标密钥拆分为多个密钥份额并将各个密钥份额分散保存在各个目标区块链节点中,通过分布式地存储密钥份额的方式可提高目标密钥的安全性,从而增强对目标密文数据的保护。Based on the blockchain system in the embodiment of the present application, the aforementioned processes described in FIG. 2 and FIG. 4 can be implemented. Based on the secret sharing technology, the target key corresponding to the target ciphertext data is split into multiple key shares and each The key shares are distributed and stored in each target blockchain node, and the security of the target key can be improved by storing the key shares in a distributed manner, thereby enhancing the protection of the target ciphertext data.
基于同一发明构思,本申请实施例提供一种区块链系统,该区块链系统例如是图1中的区块链系统,该区块链系统包括至少两个共识节点,这至少两个共识节点构成共识网络,其中:Based on the same inventive concept, the embodiments of the present application provide a blockchain system, for example, the blockchain system in FIG. 1 , the blockchain system includes at least two consensus nodes, the at least two consensus nodes Nodes form a consensus network, where:
各个共识节点用于获得数据访问方发起的包括目标数据标识的数据访问请求;并从本地存储中确定目标数据标识对应的目标密文数据和密钥份额,其中,各个共识节点本地存储的密钥份额彼此不同,各密钥份额是数据所有方通过秘密共享机制将目标密钥进行拆分得到的,目标密文数据是数据所有方以目标密钥对明文数据加密得到的;以及分别将本地存储的目标密文数据和密钥份额发送给数据访问方,以用于数据访问方根据预定数量且不同的密钥份额确定目标密钥,并根据目标密钥对目标密文数据解密。Each consensus node is used to obtain the data access request including the target data identifier initiated by the data access party; and determine the target ciphertext data and key share corresponding to the target data identifier from the local storage, wherein the key stored locally by each consensus node The shares are different from each other, each key share is obtained by the data owner splitting the target key through the secret sharing mechanism, and the target ciphertext data is obtained by the data owner encrypting the plaintext data with the target key; The target ciphertext data and the key share are sent to the data access party, so that the data accessor can determine the target key according to a predetermined number and different key shares, and decrypt the target ciphertext data according to the target key.
基于本申请实施例中的区块链系统可以实现前述的图3和图5所描述的流程,在对区块链上数据进行访问时,即使区块链系统中的有些节点可能已经被恶意攻击而不安全时,例如已被篡改了该节点上存储的目标密文数据和密钥份额,由于采用的是秘密共享技术,需要获得足够数量的密钥份额才能恢复出目标密钥,所以可确保目标密钥的安全,并且,数据访问方在收到足够数量的正确的密钥份额时可恢复出正确的目标密钥,这其中即使有些密钥份额已不再可信,仍然可确保恢复出的目标密钥的有效性,从而提高了对数据访问的安全控制。Based on the blockchain system in this embodiment of the present application, the processes described in the aforementioned FIG. 3 and FIG. 5 can be implemented. When accessing data on the blockchain, even some nodes in the blockchain system may have been maliciously attacked. When it is not safe, for example, the target ciphertext data and key shares stored on the node have been tampered with. Since the secret sharing technology is used, a sufficient number of key shares are required to recover the target key, so it can ensure that the target key is recovered. The security of the target key, and the data access party can recover the correct target key when it receives a sufficient number of correct key shares, even if some key shares are no longer trusted, it can still be recovered. The validity of the target key, thereby improving the security control of data access.
基于同一发明构思,本申请实施例提供一种基区块链数据写入装置,该装置可以是硬件结构、软件模块、或硬件结构加软件模块,该装置可以配置在区块链系统中的各个共识节点中。请参见图6所示,本申请实施例中的区块链数据写入装置包括获得模块601、共识模块602和存储模块603,其中:Based on the same inventive concept, the embodiments of the present application provide a basic blockchain data writing device. The device can be a hardware structure, a software module, or a hardware structure plus a software module. The device can be configured in each block chain system. in the consensus node. Referring to FIG. 6, the block chain data writing device in the embodiment of the present application includes an obtaining
获得模块601,用于获得数据所有方发送的数据写入请求;其中,各数据写入请求中包括相同的目标密文数据和彼此不同的密钥份额,目标密文数据是数据所有方以目标密钥对明文数据加密得到的,各密钥份额是数据所有方通过秘密共享机制将目标密钥进行拆分得到的;The obtaining
共识模块602,用于对目标密文数据进行共识处理;A
存储模块603,用于在确定对目标密文数据达成共识后,保存获得的目标密文数据和密钥份额。The
在一种可能的实施方式中,各个数据写入请求中还包括密钥份额对应的密钥份额签名,存储模块603用于:In a possible implementation manner, each data write request further includes a key share signature corresponding to the key share, and the
将获得的目标密文数据、密钥份额和对应的密钥份额签名进行保存。Save the obtained target ciphertext data, key share and corresponding key share signature.
在一种可能的实施方式中,各个数据写入请求中还包括访问准入条件信息,存储模块603用于:In a possible implementation manner, each data write request further includes access access condition information, and the
在确定对目标密文数据和访问准入条件信息均达成共识后,将获得的目标密文数据、密钥份额和访问准入条件信息进行保存;或者,After it is determined that both the target ciphertext data and the access access condition information have reached a consensus, save the obtained target ciphertext data, key share and access access condition information; or,
在确定对目标密文数据达成共识后,将获得的目标密文数据、密钥份额和访问准入条件信息进行保存。After it is determined that a consensus is reached on the target ciphertext data, the obtained target ciphertext data, key share and access condition information are saved.
在一种可能的实施方式中,访问准入条件信息中包括允许数据所有方访问目标密文数据的条件信息。In a possible implementation manner, the access access condition information includes condition information that allows the data owner to access the target ciphertext data.
在一种可能的实施方式中,本申请实施例中的区块链数据写入装置还包括发送模块604,用于:In a possible implementation, the block chain data writing device in the embodiment of the present application further includes a sending
在存储模块603保存获得的目标密文数据和密钥份额之后,向数据所有方发送成功写入指示信息,以用于数据所有方在接收到的成功写入指示信息超过预定数量时确定目标密文数据成功写入。After the
在具体实施时,发送模块604是可选的模块,即发送模块604并不是必须的模块,所以在图6中是以虚线框表示的。During specific implementation, the sending
前述的区块链数据写入方法的实施例中涉及的各步骤的所有相关内容均可以援引到本申请实施例中的区块链数据写入装置所对应的功能模块的功能描述,在此不再赘述。All relevant contents of the steps involved in the foregoing embodiments of the blockchain data writing method can be cited in the functional descriptions of the functional modules corresponding to the blockchain data writing device in the embodiments of the present application, and are not described herein. Repeat.
基于同一发明构思,本申请实施例提供一种区块链数据访问装置,该装置可以是硬件结构、软件模块、或硬件结构加软件模块,该装置可以配置在区块链系统中的各个共识节点中。请参见图7所示,本申请实施例中的区块链数据访问装置包括获得模块701、确定模块702和发送模块703,其中:Based on the same inventive concept, the embodiments of the present application provide a blockchain data access device, which can be a hardware structure, a software module, or a hardware structure plus a software module, and the device can be configured on each consensus node in the blockchain system middle. Referring to FIG. 7 , the blockchain data access device in this embodiment of the present application includes an obtaining
获得模块701,用于获得数据访问方发起的数据访问请求,其中,数据访问请求中包括目标数据标识;Obtaining
确定模块702,用于从本地存储中确定目标数据标识对应的目标密文数据和密钥份额,其中,各个共识节点本地存储的密钥份额彼此不同,各密钥份额是数据所有方通过秘密共享机制将目标密钥进行拆分得到的,目标密文数据是数据所有方以目标密钥对明文数据加密得到的;The
发送模块703,用于将本地存储的目标密文数据和密钥份额发送给数据访问方,以用于数据访问方根据预定数量且不同的密钥份额确定目标密钥,并根据目标密钥对目标密文数据解密。The sending
在一种可能的实施方式中,确定模块702用于:In a possible implementation, the determining
从本地存储中确定目标数据标识对应的目标密文数据、密钥份额和对应的密钥份额签名;Determine the target ciphertext data, the key share and the corresponding key share signature corresponding to the target data identifier from the local storage;
发送模块703用于:The sending
将本地存储的目标密文数据、密钥份额和对应的密钥份额签名发送给数据访问方。Send the locally stored target ciphertext data, key share and corresponding key share signature to the data access party.
在一种可能的实施方式中,数据访问请求中还包括数据访问方的待验证权限信息和权限签名,本申请实施例中的区块链数据访问装置还包括权限验证模块704,用于:In a possible implementation manner, the data access request further includes the permission information to be verified and the permission signature of the data access party, and the blockchain data access device in the embodiment of the present application further includes a
在发送模块703将本地存储的目标密文数据和密钥份额发送给数据访问方之前,根据待验证权限信息和权限签名确定数据访问方的访问权限验证通过;其中,根据权限签名对待验证权限信息进行验证,并在待验证权限信息的验证通过时,根据待验证权限信息确定数据访问方的访问权限验证通过。Before sending the locally stored target ciphertext data and key share to the data access party, the sending
在一种可能的实施方式中,权限验证模块704用于:In a possible implementation, the
将待验证权限信息与访问准入条件信息进行匹配,其中,访问准入条件信息是由数据所有方确定的;Matching the permission information to be verified with the access access condition information, wherein the access access condition information is determined by the data owner;
若匹配结果为设定匹配结果,则确定数据访问方的访问权限验证通过。If the matching result is the set matching result, it is determined that the access authority verification of the data access party has passed.
在一种可能的实施方式中,访问准入条件信息中包括允许数据所有方访问目标密文数据的条件信息。In a possible implementation manner, the access access condition information includes condition information that allows the data owner to access the target ciphertext data.
在一种可能的实施方式中,权限验证模块704用于:In a possible implementation, the
根据待验证权限信息和权限签名确定数据访问方的访问权限验证通过;或者,对待验证权限信息和权限签名进行共识处理,并在达成共识后确定数据访问方的访问权限验证通过。According to the permission information to be verified and the permission signature, it is determined that the access permission verification of the data access party has passed; or, consensus processing is performed on the permission information to be verified and the permission signature, and after a consensus is reached, it is determined that the access permission verification of the data access party has passed.
在具体实施时,权限验证模块704是可选的模块,即权限验证模块704并不是必须的模块,所以在图7中是以虚线框表示的。During specific implementation, the
前述的区块链数据访问方法的实施例中涉及的各步骤的所有相关内容均可以援引到本申请实施例中的区块链数据访问装置所对应的功能模块的功能描述,在此不再赘述。All relevant contents of the steps involved in the foregoing embodiments of the blockchain data access method can be cited in the functional descriptions of the functional modules corresponding to the blockchain data access device in the embodiments of the present application, which will not be repeated here. .
本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,另外,在本申请各个实施例中的各功能模块可以集成在一个处理器中,也可以是单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。The division of modules in the embodiments of the present application is schematic, and is only a logical function division. In actual implementation, there may be other division methods. In addition, the functional modules in the various embodiments of the present application may be integrated into one processing unit. In the device, it can also exist physically alone, or two or more modules can be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules.
基于同一发明构思,本申请实施例还提供一种计算机存储介质,该计算机存储介质可以是计算机可读存储介质,该计算机存储介质中存储有计算机指令或计算机可读程序,当该计算机指令或该计算机可读程序在计算机上运行时,使得计算机执行如前述的区块链数据写入方法的步骤。Based on the same inventive concept, an embodiment of the present application further provides a computer storage medium, which may be a computer-readable storage medium, where computer instructions or computer-readable programs are stored in the computer storage medium. When the computer-readable program runs on the computer, the computer executes the steps of the aforementioned method for writing blockchain data.
基于同一发明构思,本申请实施例还提供一种计算机存储介质,该计算机存储介质可以是计算机可读存储介质,该计算机存储介质中存储有计算机指令或计算机可读程序,当该计算机指令或该计算机可读程序在计算机上运行时,使得计算机执行如前述的区块链数据访问方法的步骤。Based on the same inventive concept, an embodiment of the present application further provides a computer storage medium, which may be a computer-readable storage medium, where computer instructions or computer-readable programs are stored in the computer storage medium. When the computer-readable program runs on the computer, the computer executes the steps of the aforementioned blockchain data access method.
在一些可能的实施方式中,本申请实施例提供的区块链数据写入方法的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当所述程序产品在计算机上运行时,所述程序代码用于使所述计算机执行前文所描述的根据本申请各种示例性实施方式的区块链数据写入方法中的步骤。In some possible implementations, various aspects of the blockchain data writing method provided by the embodiments of the present application may also be implemented in the form of a program product, which includes program code, and when the program product runs on a computer , the program code is used to cause the computer to execute the steps in the block chain data writing method described above according to various exemplary embodiments of the present application.
在一些可能的实施方式中,本申请实施例提供的区块链数据访问方法的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当所述程序产品在计算机上运行时,所述程序代码用于使所述计算机执行前文所描述的根据本申请各种示例性实施方式的区块链数据访问方法中的步骤。In some possible implementations, various aspects of the blockchain data access method provided by the embodiments of the present application may also be implemented in the form of a program product, which includes program code, and when the program product runs on a computer, The program code is used to cause the computer to execute the steps in the aforementioned blockchain data access method according to various exemplary embodiments of the present application.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by those skilled in the art, the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block in the flowcharts and/or block diagrams, and combinations of flows and/or blocks in the flowcharts and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in one or more of the flowcharts and/or one or more blocks of the block diagrams.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions An apparatus implements the functions specified in a flow or flows of the flowcharts and/or a block or blocks of the block diagrams.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in one or more of the flowcharts and/or one or more blocks of the block diagrams.
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。While the preferred embodiments of the present application have been described, additional changes and modifications to these embodiments may occur to those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be construed to include the preferred embodiment and all changes and modifications that fall within the scope of this application.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims (26)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110634791.3A CN113098697B (en) | 2021-06-08 | 2021-06-08 | Block chain data writing and accessing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110634791.3A CN113098697B (en) | 2021-06-08 | 2021-06-08 | Block chain data writing and accessing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113098697A CN113098697A (en) | 2021-07-09 |
CN113098697B true CN113098697B (en) | 2022-03-18 |
Family
ID=76664466
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110634791.3A Active CN113098697B (en) | 2021-06-08 | 2021-06-08 | Block chain data writing and accessing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113098697B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114331430B (en) * | 2021-12-24 | 2023-03-31 | 杭州钛度科技有限公司 | Block chain consensus method, apparatus, device and medium |
CN115277052B (en) * | 2022-06-07 | 2024-06-14 | 国网北京市电力公司 | Data encryption method and device based on block chain and electronic equipment |
WO2024197405A1 (en) * | 2023-03-27 | 2024-10-03 | Kelvin Zero Inc. | Systems and methods for trustless distributed symmetric encyption |
CN116090020B (en) * | 2023-04-13 | 2023-06-30 | 中国人民解放军海军潜艇学院 | Block chain-based information storage method and device, electronic equipment and storage medium |
CN118214614B (en) * | 2024-05-20 | 2024-07-30 | 浙江清华长三角研究院 | Method, device and system for access control of data on blockchain system |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106850654A (en) * | 2017-02-23 | 2017-06-13 | 布比(北京)网络技术有限公司 | The mandate access method and system of a kind of distributed information |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106548345B (en) * | 2016-12-07 | 2020-08-21 | 北京信任度科技有限公司 | Method and system for realizing block chain private key protection based on key partitioning |
US10735183B1 (en) * | 2017-06-30 | 2020-08-04 | Experian Information Solutions, Inc. | Symmetric encryption for private smart contracts among multiple parties in a private peer-to-peer network |
CN107623569A (en) * | 2017-09-30 | 2018-01-23 | 矩阵元技术(深圳)有限公司 | Block chain key escrow and restoration methods, device based on Secret sharing techniques |
CN108683509B (en) * | 2018-05-15 | 2021-12-28 | 北京创世智链信息技术研究院 | Block chain-based secure transaction method, device and system |
CN108809652B (en) * | 2018-05-21 | 2021-07-23 | 安徽航天信息有限公司 | Block chain encrypted account book based on secret sharing |
CN109150968B (en) * | 2018-07-13 | 2021-09-14 | 上海大学 | Block chain distributed storage method based on secret sharing |
CN109672529A (en) * | 2019-01-07 | 2019-04-23 | 苏宁易购集团股份有限公司 | A kind of method and system for going anonymization of combination block chain and privacy sharing |
CN109902494A (en) * | 2019-01-24 | 2019-06-18 | 北京融链科技有限公司 | Data encryption storage method, device, and file storage system |
CN110297831A (en) * | 2019-07-01 | 2019-10-01 | 电子科技大学 | A kind of block chain fragment storage method based on threshold secret sharing |
-
2021
- 2021-06-08 CN CN202110634791.3A patent/CN113098697B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106850654A (en) * | 2017-02-23 | 2017-06-13 | 布比(北京)网络技术有限公司 | The mandate access method and system of a kind of distributed information |
Non-Patent Citations (1)
Title |
---|
区块链系统下的多方密钥协商协议;唐春明等;《信息网络安全》;20171210(第12期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN113098697A (en) | 2021-07-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7121459B2 (en) | Blockchain authentication via hard/soft token verification | |
CN110875821B (en) | Cryptography blockchain interoperation | |
CN113098697B (en) | Block chain data writing and accessing method and device | |
US10673626B2 (en) | Threshold secret share authentication proof and secure blockchain voting with hardware security modules | |
TWI793899B (en) | Secure dynamic threshold signature scheme employing trusted hardware | |
JP6547079B1 (en) | Registration / authorization method, device and system | |
US10348706B2 (en) | Assuring external accessibility for devices on a network | |
US11063941B2 (en) | Authentication system, authentication method, and program | |
CN106888084B (en) | Quantum fort machine system and authentication method thereof | |
WO2020000786A1 (en) | Voting method and apparatus, and computer device and computer readable storage medium | |
CN110990827A (en) | Identity information verification method, server and storage medium | |
CN113259123B (en) | Block chain data writing and accessing method and device | |
KR20210040078A (en) | Systems and methods for safe storage services | |
CN112671779B (en) | DoH server-based domain name query method, device, equipment and medium | |
CN102271037A (en) | Key protectors based on online keys | |
JP2023500570A (en) | Digital signature generation using cold wallet | |
CN110505055B (en) | External network access identity authentication method and system based on asymmetric key pool pair and key fob | |
CN115277168B (en) | Method, device and system for accessing server | |
CN113196703B (en) | System and method for protecting computer networks from man-in-the-middle attacks | |
CN109302442B (en) | Data storage proving method and related equipment | |
TW202213147A (en) | Distributed anonymized compliant encryption management system | |
JP6533542B2 (en) | Secret key replication system, terminal and secret key replication method | |
CN113259124A (en) | Block chain data writing and accessing method and device | |
CN110519222B (en) | External network access identity authentication method and system based on disposable asymmetric key pair and key fob | |
Said et al. | A multi-factor authentication-based framework for identity management in cloud applications |
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 |