CN113468570A - Private data sharing method based on intelligent contract - Google Patents

Private data sharing method based on intelligent contract Download PDF

Info

Publication number
CN113468570A
CN113468570A CN202110802587.8A CN202110802587A CN113468570A CN 113468570 A CN113468570 A CN 113468570A CN 202110802587 A CN202110802587 A CN 202110802587A CN 113468570 A CN113468570 A CN 113468570A
Authority
CN
China
Prior art keywords
key
sharing
private
private data
data
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.)
Pending
Application number
CN202110802587.8A
Other languages
Chinese (zh)
Inventor
洪薇
洪健
李京昆
刘文思
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hubei Yangzhong Jushi Information Technology Co ltd
Original Assignee
Hubei Yangzhong Jushi Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hubei Yangzhong Jushi Information Technology Co ltd filed Critical Hubei Yangzhong Jushi Information Technology Co ltd
Priority to CN202110802587.8A priority Critical patent/CN113468570A/en
Publication of CN113468570A publication Critical patent/CN113468570A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting 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/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Abstract

The invention relates to the technical field of private data sharing, in particular to a private data sharing method based on an intelligent contract, which aims to solve the problem that data is not tampered, and meanwhile, limited visitors can share data, and specifically comprises five steps S1-S5. The private data to be shared in the block chain network is encrypted by using data, only a sharing party meeting the conditions can decrypt the data by using the private key of the sharing party, other people can check the private encrypted data on the block chain, but the private key of the sharing party is unknown, so that the data cannot be decrypted, and after the private encrypted data is uploaded to the block chain, the private encrypted data can be verified to be authentic due to the characteristic that the block chain cannot be tampered, and the possibility of being stolen and tampered does not exist, so that the purpose of safely sharing the private data is fully achieved.

Description

Private data sharing method based on intelligent contract
Technical Field
The invention relates to the technical field of private data sharing, in particular to a private data sharing method based on an intelligent contract.
Background
Confidentiality, integrity and availability are the basis of data privacy, and the traditional technical field often has risks of data leakage and tampering when data sharing exchange is carried out, so that the data security can be ensured by often using a data encryption technology on private data needing sharing exchange, but the data security is not absolutely secure, the private data can be easily monitored and stolen by people in the data transmission, storage and exchange processes, once an encryption mode is mastered, the private data can be restored, and then the data leakage and tampering occur;
all data on a block chain are synchronously shared and cannot be tampered, so that each node can know what data are stored on the chain to cooperatively ensure the authenticity and non-tampering of the data, which ensures that private data are not tampered, but increases the risk of data leakage, because once the data encryption mode on the chain is mastered, the data cannot be guaranteed not to be leaked, if the data has the sharing requirement, only visitors with specific conditions can obtain the authentic data, but not all people can know the authentic data, how to ensure that the data are not tampered, and meanwhile, the requirement of limited sharing of the data can be met;
a smart contract is a computer protocol intended to propagate, verify or execute contracts in an informative manner, allowing trusted transactions to be conducted without third parties, which transactions are traceable and irreversible;
but the private data of the intelligent number-of-destinations contract is possible to be stolen and tampered, and the purpose of safe sharing of the private data cannot be achieved. Accordingly, those skilled in the art have provided a private data sharing method based on smart contracts to solve the problems set forth in the background art described above.
Disclosure of Invention
The invention aims to provide a private data sharing method based on an intelligent contract to solve the problems in the background technology.
In order to achieve the purpose, the invention provides the following technical scheme: the private data sharing method based on the intelligent contract comprises the following steps:
s1: a private data owner creates a private data sharing intelligent contract;
s2: on the basis of step S1, the sharing party generates a public and private key by using an asymmetric encryption algorithm, and sends a data sharing request to the smart contract, where the request content includes: applying a timestamp, applying a signature and sharing a public key;
s3: on the basis of the step S2, the intelligent contract utilizes the public key signature verification technology to automatically verify the identity information of the sharer after receiving the data sharing request, if the public key verifies that the signature is correct, the verification is passed, and the intelligent contract is stored in the sharer list of the intelligent contract, otherwise, the verification fails, and the application is refused;
s4: on the basis of the step S3, the owner checks the smart contract sharing inquiry, finds that there is a shared information request, and confirms that the sharer is a participation mode of the owner who wants to share information, generates a public and private key by using an asymmetric encryption algorithm, then generates a shared key by using a key exchange technique by using the private key of the owner and the public key of the sharer, encrypts private data to be shared by using a symmetric encryption technique by using the shared key, sends a privacy sharing request to the smart contract after encryption is completed, and uploads the encrypted private data and the public key of the owner to a block chain network;
s5: based on step S4, the sharer checks the smart contract privacy query, finds that the owner has uploaded the encrypted private data, then generates a shared key using a key exchange technique using the private key of the sharer and the public key of the owner, and decrypts the private data to be shared using a symmetric encryption technique using the shared key.
As a further aspect of the invention: the contract in the S1 includes a share application-receiving and verifying the identity of the sharer, a share inquiry-obtaining the identity of the sharer, a privacy share-uploading the encrypted privacy data, and an owner public key and a privacy inquiry-obtaining the encrypted privacy data.
As a further aspect of the invention: the signature application in S2 is to hash the timestamp and then sign the timestamp with a private key.
As a further aspect of the invention: the verification method in S3 is as follows:
a1: acquiring a certificate of identity information of a sharer, and verifying the validity of the certificate;
a2: extracting a public key from a certificate of the identity information of the sharer, verifying the signature of the public key, and simultaneously checking the integrity of the identity information;
a3: and whether the time stamp is the current time or not is verified, and the time stamp indicates that the public key verification signature is correct when the time stamp is the current time.
As a further aspect of the invention: the key exchange technique in S4 is as follows:
b1: setting an owner private key Alice and a sharer private key Bob, and taking a prime number p and an integer a, and disclosing a and p;
b2: alice selects a random number XA < q, and calculates a public key YA =a^XA modp;
B3: bob selects random number XB<pAnd calculate YB =a^XB modp;
B4: each party keeps X secret and publishes Y to obtain the other party;
b5: the method for Alice to calculate the secret key is as follows: k = (YB) ^ XA modp;
b6: the way Bob calculates the key is: k = (YA) ^ XB modp.
As a further aspect of the invention: k is the shared key.
As a further aspect of the invention: a is an primitive root of the prime number p, i.e., the values amodp, a2 modp, …, a (p-1) modp, are integers that are different from each other and that in some arrangement constitute all integers from 1 to p-1.
As a further aspect of the invention: assuming an original root a of the integer b and the prime p, a unique exponent i can be found, such that:
b = (i power of a) modp;
wherein 0 ≦ i ≦ p-1;
the exponent i is then referred to as the discrete logarithm of b modulo p by a.
Compared with the prior art, the invention has the beneficial effects that: the private data to be shared in the block chain network is encrypted by using data, only a sharing party meeting the conditions can decrypt the data by using the private key of the sharing party, other people can check the private encrypted data on the block chain, but the private key of the sharing party is unknown, so that the data cannot be decrypted, and after the private encrypted data is uploaded to the block chain, the private encrypted data can be verified to be authentic due to the characteristic that the block chain cannot be tampered, and the possibility of being stolen and tampered does not exist, so that the purpose of safely sharing the private data is fully achieved.
Detailed Description
In the embodiment of the invention, the privacy data sharing method based on the intelligent contract comprises the following steps:
s1: a private data owner creates a private data sharing intelligent contract;
s2: on the basis of step S1, the sharing party generates a public and private key by using an asymmetric encryption algorithm, and sends a data sharing request to the smart contract, where the request content includes: applying a timestamp, applying a signature and sharing a public key;
s3: on the basis of the step S2, the intelligent contract utilizes the public key signature verification technology to automatically verify the identity information of the sharer after receiving the data sharing request, if the public key verifies that the signature is correct, the verification is passed, and the intelligent contract is stored in the sharer list of the intelligent contract, otherwise, the verification fails, and the application is refused;
s4: on the basis of the step S3, the owner checks the smart contract sharing inquiry, finds that there is a shared information request, and confirms that the sharer is a participation mode of the owner who wants to share information, generates a public and private key by using an asymmetric encryption algorithm, then generates a shared key by using a key exchange technique by using the private key of the owner and the public key of the sharer, encrypts private data to be shared by using a symmetric encryption technique by using the shared key, sends a privacy sharing request to the smart contract after encryption is completed, and uploads the encrypted private data and the public key of the owner to a block chain network;
s5: based on step S4, the sharer checks the smart contract privacy query, finds that the owner has uploaded the encrypted private data, then generates a shared key using a key exchange technique using the private key of the sharer and the public key of the owner, and decrypts the private data to be shared using a symmetric encryption technique using the shared key.
Further, the contract in S1 includes a share application-receiving and verifying the identity of the sharer, a share inquiry-obtaining the identity of the sharer, a privacy share-uploading the encrypted private data, and an owner public key and a privacy inquiry-obtaining the encrypted private data.
Further, the signature application in S2 is to hash the timestamp and then sign the timestamp with a private key.
Further, the verification method in S3 is as follows:
a1: acquiring a certificate of identity information of a sharer, and verifying the validity of the certificate;
a2: extracting a public key from a certificate of the identity information of the sharer, verifying the signature of the public key, and simultaneously checking the integrity of the identity information;
a3: and whether the time stamp is the current time or not is verified, and the time stamp indicates that the public key verification signature is correct when the time stamp is the current time.
Further, the key exchange technique in S4 is as follows:
b1: setting an owner private key Alice and a sharer private key Bob, and taking a prime number p and an integer a, and disclosing a and p;
b2: alice selects a random number XA < q, and calculates a public key YA =a^XA modp;
B3: bob selects random number XB<pAnd calculate YB =a^XB modp;
B4: each party keeps X secret and publishes Y to obtain the other party;
b5: the method for Alice to calculate the secret key is as follows: k = (YB) ^ XA modp;
b6: the way Bob calculates the key is: k = (YA) ^ XB modp.
Further, K is the shared key.
Further, a is an primitive root of the prime number p, i.e., the values amodp, a ^2 modp, …, a ^ (p-1) modp, are integers that are different from each other and that, in some arrangement, make up all integers from 1 to p-1.
Further, assuming an original root a of the integer b and the prime p, a unique exponent i can be found, such that:
b = (i power of a) modp;
wherein 0 ≦ i ≦ p-1;
the exponent i is then referred to as the discrete logarithm of b modulo p by a.
Example (c):
1. the method comprises the steps that business information is shared, participants can be divided into an acquiring party and a sharing party, the acquiring party provides own public keys to the sharing party, the sharing party generates a shared key by using own private keys and public keys after confirming that the public keys and identities have no problem, the business information is directly uploaded to a block chain through encryption of the shared key, or the business information is uploaded to the block chain through encryption of user passwords and the like of a storage database where the business information is located, and after the acquiring party receives a message, an encrypted result on the block chain is decrypted and the business information is taken. Therefore, only one of the acquirers can know the business information, and the others cannot obtain the business information, and meanwhile, the business information transmitted by the sharing party is guaranteed to be real and not tampered.
2. The auction result is published, all the persons participating in the auction provide their own public keys before the auction result is issued, after the auction result is issued, the auction uses the public keys of the persons obtaining the auction product to generate a shared secret key, and encrypts the result and other information, such as the transaction acceptance place, time and the like, and uploads the result and other information to the block chain.
In summary, the following steps: the private data to be shared in the block chain network is encrypted by using data, only a sharing party meeting the conditions can decrypt the data by using the private key of the sharing party, other people can check the private encrypted data on the block chain, but the private key of the sharing party is unknown, so that the data cannot be decrypted, and after the private encrypted data is uploaded to the block chain, the private encrypted data can be verified to be authentic due to the characteristic that the block chain cannot be tampered, and the possibility of being stolen and tampered does not exist, so that the purpose of safely sharing the private data is fully achieved.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art should be considered to be within the technical scope of the present invention, and the technical solutions and the inventive concepts thereof according to the present invention are equivalent to or changed within the technical scope of the present invention.

Claims (8)

1. The private data sharing method based on the intelligent contract is characterized by comprising the following steps:
s1: a private data owner creates a private data sharing intelligent contract;
s2: on the basis of step S1, the sharing party generates a public and private key by using an asymmetric encryption algorithm, and sends a data sharing request to the smart contract, where the request content includes: applying a timestamp, applying a signature and sharing a public key;
s3: on the basis of the step S2, the intelligent contract utilizes the public key signature verification technology to automatically verify the identity information of the sharer after receiving the data sharing request, if the public key verifies that the signature is correct, the verification is passed, and the intelligent contract is stored in the sharer list of the intelligent contract, otherwise, the verification fails, and the application is refused;
s4: on the basis of the step S3, the owner checks the smart contract sharing inquiry, finds that there is a shared information request, and confirms that the sharer is a participation mode of the owner who wants to share information, generates a public and private key by using an asymmetric encryption algorithm, then generates a shared key by using a key exchange technique by using the private key of the owner and the public key of the sharer, encrypts private data to be shared by using a symmetric encryption technique by using the shared key, sends a privacy sharing request to the smart contract after encryption is completed, and uploads the encrypted private data and the public key of the owner to a block chain network;
s5: based on step S4, the sharer checks the smart contract privacy query, finds that the owner has uploaded the encrypted private data, then generates a shared key using a key exchange technique using the private key of the sharer and the public key of the owner, and decrypts the private data to be shared using a symmetric encryption technique using the shared key.
2. The method for sharing private data based on smart contracts according to claim 1, wherein the contracts in S1 include sharing application-receiving and verifying sharer identity, sharing inquiry-obtaining sharer identity, privacy sharing-uploading encrypted private data, and owner public key and privacy inquiry-obtaining encrypted private data.
3. The method for sharing private data based on an intelligent contract according to claim 1, wherein the signature application in S2 is performed by hashing a timestamp and then performing signature by a private key.
4. The method for sharing private data based on smart contracts according to claim 1, wherein the verification method in S3 is as follows:
a1: acquiring a certificate of identity information of a sharer, and verifying the validity of the certificate;
a2: extracting a public key from a certificate of the identity information of the sharer, verifying the signature of the public key, and simultaneously checking the integrity of the identity information;
a3: and whether the time stamp is the current time or not is verified, and the time stamp indicates that the public key verification signature is correct when the time stamp is the current time.
5. The method for sharing private data based on smart contracts according to claim 1, wherein the key exchange technique in S4 is as follows:
b1: setting an owner private key Alice and a sharer private key Bob, and taking a prime number p and an integer a, and disclosing a and p;
b2: alice selects a random number XA < q, and calculates a public key YA =a^XA modp;
B3: bob selects random number XB<pAnd calculate YB =a^XB modp;
B4: each party keeps X secret and publishes Y to obtain the other party;
b5: the method for Alice to calculate the secret key is as follows: k = (YB) ^ XA modp;
b6: the way Bob calculates the key is: k = (YA) ^ XB modp.
6. The method according to claim 5, wherein K is a shared key.
7. The intelligent contract-based private data sharing method of claim 5, wherein a is an primitive root of a prime number p, i.e. the values amodp, a ^2 modp, …, a ^ (p-1) modp, are integers different from each other and constitute all integers from 1 to p-1 in a certain arrangement.
8. A method for sharing private data based on an intelligent contract according to claim 7, wherein, assuming an original root a of an integer b and a prime p, a unique exponent i can be found, such that:
b = (i power of a) modp;
wherein 0 ≦ i ≦ p-1;
the exponent i is then referred to as the discrete logarithm of b modulo p by a.
CN202110802587.8A 2021-07-15 2021-07-15 Private data sharing method based on intelligent contract Pending CN113468570A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110802587.8A CN113468570A (en) 2021-07-15 2021-07-15 Private data sharing method based on intelligent contract

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110802587.8A CN113468570A (en) 2021-07-15 2021-07-15 Private data sharing method based on intelligent contract

Publications (1)

Publication Number Publication Date
CN113468570A true CN113468570A (en) 2021-10-01

Family

ID=77880764

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110802587.8A Pending CN113468570A (en) 2021-07-15 2021-07-15 Private data sharing method based on intelligent contract

Country Status (1)

Country Link
CN (1) CN113468570A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113783854A (en) * 2021-08-30 2021-12-10 湖南天河国云科技有限公司 Block chain-based credit data cross-chain sharing method and device
CN114338043A (en) * 2022-01-05 2022-04-12 上海卓鹏信息科技有限公司 Encryption storage of cross-dike chain credit investigation data and credit score privacy calculation scheme
CN115589303A (en) * 2022-07-11 2023-01-10 昆明理工大学 Data sharing and privacy protection method based on SM9 algorithm and cross-chain technology

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109326337A (en) * 2018-09-06 2019-02-12 西安电子科技大学 Electronic medical record storage and shared model and method based on block chain
CN110224814A (en) * 2019-06-27 2019-09-10 深圳前海微众银行股份有限公司 A kind of block chain data sharing method and device
CN110971390A (en) * 2019-11-29 2020-04-07 杭州云象网络技术有限公司 Fully homomorphic encryption method for intelligent contract privacy protection
CN111291407A (en) * 2020-01-21 2020-06-16 江苏荣泽信息科技股份有限公司 Data sharing method based on block chain privacy protection
CN112348674A (en) * 2020-10-20 2021-02-09 深圳前海微众银行股份有限公司 Block chain transaction data storage and acquisition method and device
CN112511599A (en) * 2020-11-10 2021-03-16 南京莱斯信息技术股份有限公司 Civil air defense data sharing system and method based on block chain
CN112822178A (en) * 2020-12-30 2021-05-18 北京工业大学 Business cooperative data sharing and privacy protection method based on block chain
CN112989415A (en) * 2021-03-23 2021-06-18 广东工业大学 Private data storage and access control method and system based on block chain

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109326337A (en) * 2018-09-06 2019-02-12 西安电子科技大学 Electronic medical record storage and shared model and method based on block chain
CN110224814A (en) * 2019-06-27 2019-09-10 深圳前海微众银行股份有限公司 A kind of block chain data sharing method and device
CN110971390A (en) * 2019-11-29 2020-04-07 杭州云象网络技术有限公司 Fully homomorphic encryption method for intelligent contract privacy protection
CN111291407A (en) * 2020-01-21 2020-06-16 江苏荣泽信息科技股份有限公司 Data sharing method based on block chain privacy protection
CN112348674A (en) * 2020-10-20 2021-02-09 深圳前海微众银行股份有限公司 Block chain transaction data storage and acquisition method and device
CN112511599A (en) * 2020-11-10 2021-03-16 南京莱斯信息技术股份有限公司 Civil air defense data sharing system and method based on block chain
CN112822178A (en) * 2020-12-30 2021-05-18 北京工业大学 Business cooperative data sharing and privacy protection method based on block chain
CN112989415A (en) * 2021-03-23 2021-06-18 广东工业大学 Private data storage and access control method and system based on block chain

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113783854A (en) * 2021-08-30 2021-12-10 湖南天河国云科技有限公司 Block chain-based credit data cross-chain sharing method and device
CN113783854B (en) * 2021-08-30 2023-10-17 湖南天河国云科技有限公司 Credit data cross-chain sharing method and device based on block chain
CN114338043A (en) * 2022-01-05 2022-04-12 上海卓鹏信息科技有限公司 Encryption storage of cross-dike chain credit investigation data and credit score privacy calculation scheme
CN115589303A (en) * 2022-07-11 2023-01-10 昆明理工大学 Data sharing and privacy protection method based on SM9 algorithm and cross-chain technology
CN115589303B (en) * 2022-07-11 2024-02-27 昆明理工大学 SM9 algorithm and cross-link technology based data sharing and privacy protection method

Similar Documents

Publication Publication Date Title
CN111083131B (en) Lightweight identity authentication method for power Internet of things sensing terminal
US10903991B1 (en) Systems and methods for generating signatures
CN109756485B (en) Electronic contract signing method, electronic contract signing device, computer equipment and storage medium
CN110391911B (en) System and method for anonymously voting block chain
CN107426157B (en) Alliance chain authority control method based on digital certificate and CA authentication system
CN107579819B (en) A kind of SM9 digital signature generation method and system
CN100546245C (en) Stride the network authentication and the method for distributing key of security domain
CN107947913A (en) The anonymous authentication method and system of a kind of identity-based
CN106878318A (en) A kind of block chain real time polling cloud system
CN113468570A (en) Private data sharing method based on intelligent contract
CN109409884A (en) A kind of block chain secret protection scheme and system based on SM9 algorithm
CN101640590A (en) Method for obtaining a secret key for identifying cryptographic algorithm and cryptographic center thereof
CN110519046A (en) Quantum communications service station cryptographic key negotiation method and system based on disposable asymmetric key pair and QKD
CN108494559B (en) Electronic contract signing method based on semi-trusted third party
CN113761582A (en) Group signature based method and system for protecting privacy of block chain transaction under supervision
CN103905384A (en) Embedded inter-terminal session handshake realization method based on security digital certificate
CN112291062B (en) Voting method and device based on block chain
CN112801606A (en) Electronic contract system of cone block chain
Boontaetae et al. RDI: Real digital identity based on decentralized PKI
CN108259180A (en) A kind of method of quantum Universal designated verifier signature
CN112529573A (en) Combined block chain threshold signature method and system
CN117094825A (en) Cross-chain trusted land transaction system and method based on blockchain
CN111062029A (en) Multi-factor authentication protocol based on identification password
CN110851804A (en) Alliance chain identity authentication method based on electronic contract
CN116015669A (en) Block chain-based cross-domain collaborative authentication method for Internet of things

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20211001