CN111950030A - Data sharing storage method based on block chain, terminal equipment and storage medium - Google Patents

Data sharing storage method based on block chain, terminal equipment and storage medium Download PDF

Info

Publication number
CN111950030A
CN111950030A CN202010904224.0A CN202010904224A CN111950030A CN 111950030 A CN111950030 A CN 111950030A CN 202010904224 A CN202010904224 A CN 202010904224A CN 111950030 A CN111950030 A CN 111950030A
Authority
CN
China
Prior art keywords
ciphertext
data block
data
hash value
generating
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.)
Withdrawn
Application number
CN202010904224.0A
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.)
Ningbo Fuwan Information Technology Co ltd
Original Assignee
Ningbo Fuwan 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 Ningbo Fuwan Information Technology Co ltd filed Critical Ningbo Fuwan Information Technology Co ltd
Priority to CN202010904224.0A priority Critical patent/CN111950030A/en
Publication of CN111950030A publication Critical patent/CN111950030A/en
Withdrawn legal-status Critical Current

Links

Images

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/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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

Abstract

The embodiment of the disclosure discloses a data sharing storage method based on a block chain, a terminal device and a storage medium. One embodiment of the method comprises: receiving target data to be stored sent by a target user; encrypting the target data to generate a ciphertext coding data block set and a hash value; generating a public key and a private key; generating a filter set based on the ciphertext coding data block set, the hash value and the private key; determining a storage unit by using an intelligent contract based on the filter set and the public key; and sending the ciphertext coding data block set to the determined storage unit. The method encrypts the target data to generate a ciphertext coding data block and a hash value, and the safety of the stored data is ensured. And after a filter set is generated, the filter set is written into an intelligent contract, a storage unit is determined by using the intelligent contract, and a ciphertext coding data block set is sent to the storage unit for storage, so that data information written into a block chain can be effectively hidden, and privacy protection of data sharing storage is realized.

Description

Data sharing storage method based on block chain, terminal equipment and storage medium
Technical Field
The embodiment of the disclosure relates to the field of block chains, in particular to a data storage method based on a block chain.
Background
With the development of information technology, enormous scale data is generated in numerous application fields such as scientific technology and commercial computing, and the amount of data is still rapidly increasing. The centralized cloud storage system is used as one of the solutions for mass data storage, and has the problems of high cost, single-point failure, high possibility of being attacked and the like.
The decentralized storage system can effectively avoid the above problems, and decentralized storage technologies represented by block chain shared storage are receiving wide attention from both academic and industrial fields. At present, in order to ensure the security of data stored in a blockchain, a conventional data encryption method is generally adopted to encrypt original data and store the encrypted data in the blockchain. Conventional data encryption methods generally encrypt original data to output encrypted data or encrypted data blocks. In addition, in the data sharing storage based on the block chain, the uplink of the stored data is realized by issuing an intelligent contract into the block chain.
However, the blockchain shared memory system can provide a low-cost and highly reliable memory service by aggregating idle memory resources, but also brings some problems to be solved:
firstly, the block chain completely decentralized storage mode has potential safety hazards such as privacy disclosure, and the traditional encryption method still has a risk of failure in the decentralized storage environment.
Secondly, when the amount of data to be stored is large and the intelligent contract information is large, the intelligent contract is issued, reasonable storage node storage data can be found through issuing the intelligent contract, and the like, and the problem of low efficiency can occur in the processing process.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose a block chain based data sharing storage method, a terminal device and a storage medium to solve one or more of the technical problems mentioned in the above background section.
In a first aspect, an embodiment of the present disclosure provides a data sharing storage method based on a block chain, where the method includes: receiving target data to be stored sent by a target user; encrypting the target data to generate a ciphertext coding data block set and a hash value; generating a public key and a private key; generating a filter set based on the ciphertext coding data block set, the hash value and the private key; determining a storage unit by using an intelligent contract based on the filter set and the public key; and sending the ciphertext coding data block set to the determined storage unit, wherein the storage unit stores the ciphertext coding data block set.
In some embodiments, encrypting the target data to generate the set of ciphertext encoded data blocks and the hash value includes: inputting the target data into a hash function to generate process data; inputting the process data into a password hash function to generate a secret key; encrypting the target data by using the key to generate encrypted data; generating a set of ciphertext encoded data blocks based on the encrypted data; and inputting the ciphertext coding data block set into a hash function to generate a hash value of the target data.
In some embodiments, generating the set of ciphertext encoded data blocks based on the encrypted data comprises: dividing the encrypted data into a first number of encrypted data blocks to generate an encrypted data block set; generating a coding matrix G ═ In×n;Bm×n]Where n is a first number, I is a unit diagonal matrix, I includes n rows and n columns, B is a van der mond matrix, B includes m rows and n columns, and m ═ n +, which is a redundant bit value, can be any integer; and multiplying the encrypted data block set by using the coding matrix G to generate a ciphertext coding data block set.
In some embodiments, generating a set of filters based on the set of ciphertext encoded data blocks, the hash value, and the private key comprises: generating a random number; and for each ciphertext coding data block in the ciphertext coding data block set, generating a filter of the ciphertext coding data block based on the random number, the hash value and the private key to obtain a filter set.
In some embodiments, generating the filter of the ciphertext encoded data block based on the random number, the hash value, and the private key comprises: determining a data summary of the ciphertext coding data block based on the hash value; generating a process hash value based on the random number and the data digest of the ciphertext encoded data block using:
Figure BDA0002660825980000031
wherein, R represents a random number, | | | is an arithmetic or operational character,
Figure BDA0002660825980000032
a data digest representing the ciphertext encoded data block,
Figure BDA0002660825980000033
a data summary for the ith ciphertext coding data block, U represents the ciphertext coding data block, i represents a ciphertext coding data block count, UiRepresenting the ciphertext coded data block, UiFor the ith ciphertext coding data block, H () is a hash function,
Figure BDA0002660825980000034
representing the process hash value; based on the private key and the process hash value, a filter for computing the ciphertext encoded data block using:
Figure BDA0002660825980000035
wherein d is a private key, N is a public key,
Figure BDA0002660825980000036
a process hash value is represented by a hash value of the process,
Figure BDA0002660825980000037
is composed of
Figure BDA0002660825980000038
Mod represents the modulo process, U represents the ciphertext encoded data block, i represents the ciphertext encoded data block count, U represents the number of ciphertext encoded data blocksiRepresenting the ith ciphertext encoded data block,
Figure BDA0002660825980000039
a filter representing the ciphertext encoded data block.
In some embodiments, determining the storage location using the smart contract based on the filter set and the public key comprises: writing the filter set and the public key into an intelligent contract; issuing intelligent contracts in a blockchain; according to the intelligent contract, a storage unit is determined.
In some embodiments, sending the set of ciphertext encoded data blocks to the determined storage unit comprises: for each ciphertext coding data block of the set of ciphertext coding data blocks, generating an index for the ciphertext coding data block using:
Indexi=H(H(Ui)||0,k),
where U represents the ciphertext encoded data block, i represents the ciphertext encoded data block count, UiRepresenting the ith ciphertext coded data block, H (U)i) Represents the hash value of the ith ciphertext coding data block, k is a randomly generated 256-bit random number, | | | is a solving or operational character, H () is a hash function, Index represents Index, IndexiIndex, representing the block of ciphertext coded dataiThe index of the ith ciphertext coding data block is used for obtaining an index set of the ciphertext coding data block set; and storing the ciphertext coding data block set and the index set in a storage unit.
In a second aspect, an embodiment of the present disclosure provides a terminal device, where the terminal device includes: one or more processors; a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method as described in any implementation manner of the first aspect.
In a third aspect, the disclosed embodiments provide a computer readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
The embodiment of the disclosure provides a data sharing storage method based on a block chain, a terminal device and a storage medium. One embodiment of the method comprises: receiving target data to be stored sent by a target user; encrypting the target data to generate a ciphertext coding data block set and a hash value; generating a public key and a private key; generating a filter set based on the ciphertext coding data block set, the hash value and the private key; determining a storage unit by using an intelligent contract based on the filter set and the public key; and sending the ciphertext coding data block set to the determined storage unit.
One of the above-described various embodiments of the present disclosure has the following advantageous effects: and the target data is encrypted to generate a ciphertext coding data block set, so that the confidentiality and the safety of the stored data are ensured. And generating a filter set based on the ciphertext coding data block set, the hash value and the private key, and writing the filter set into the intelligent contract. And realizing block chain shared storage of the ciphertext coding data block set by using an intelligent contract. The embodiment of the disclosure encrypts the target data to generate the ciphertext coding data block and the hash value, thereby ensuring the safety of the stored data. And generating a filter set and writing the filter set into the intelligent contract. The storage unit is determined by the intelligent contract, the ciphertext coding data block set is sent to the storage unit to be stored, data information written in a block chain can be effectively hidden, and privacy protection of data sharing storage is achieved.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an architectural diagram of an exemplary system in which some embodiments of the present disclosure may be applied;
FIG. 2 is a flow diagram of some embodiments of a blockchain based data sharing storage method according to the present disclosure;
FIG. 3 is a schematic diagram of one application scenario of a blockchain-based data sharing storage method according to some embodiments of the present disclosure;
FIG. 4 is a schematic block diagram of a computer system suitable for use as a server for implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the blockchain-based data sharing storage method of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a data storage application, a text analysis application, a natural language processing application, and the like.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various terminal devices having a display screen, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the above-listed terminal apparatuses. Which may be implemented as multiple software or software modules (e.g., to provide targeted data input, etc.), or may be implemented as a single software or software module. And is not particularly limited herein.
The server 105 may be a server that provides various services, such as a server that stores target data input by the terminal apparatuses 101, 102, 103, and the like. The server may perform processing such as encoding and storing on the received target data, and feed back a processing result (e.g., encrypted data) to the terminal device.
It should be noted that the data sharing and storing method based on the block chain provided in the embodiment of the present disclosure may be executed by the server 105, or may be executed by the terminal device.
It should be noted that the local area of the server 105 may also directly store data, and the server 105 may directly extract the local data and obtain encrypted data through encryption processing, in this case, the exemplary system architecture 100 may not include the terminal devices 101, 102, 103 and the network 104.
It should be noted that the terminal apparatuses 101, 102, and 103 may also have a data storage application installed therein, and in this case, the encryption processing method may also be executed by the terminal apparatuses 101, 102, and 103. At this point, the exemplary system architecture 100 may also not include the server 105 and the network 104.
The server 105 may be hardware or software. When the server 105 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server is software, it may be implemented as a plurality of software or software modules (for example, for providing storage services), or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to fig. 2, a flow 200 of some embodiments of a blockchain-based data sharing storage method according to the present disclosure is shown. The data sharing storage method based on the block chain comprises the following steps:
step 201, receiving target data to be stored sent by a target user.
In some embodiments, an executing body (e.g., the terminal device shown in fig. 1) of the blockchain-based data sharing storage method may directly obtain target data to be stored sent by a target user. Alternatively, the target user refers to a user who provides target data to be stored.
Step 202, encrypting the target data to generate a ciphertext coding data block set and a hash value.
In some embodiments, the execution agent may input the target data to a hash function to generate the process data. Specifically, the hash function may be a function that compresses a message of an arbitrary length into a message digest of a certain fixed length. The output of the hash function is a hash value. For two different hash values, their original inputs are not the same. For two identical hash values, their original inputs may or may not be the same.
And inputting the process data into a password hash function to generate a secret key. Specifically, the cryptographic hash function is a one-way hash function, can compress data of any length into an abstract of a certain fixed length, and is mainly used for generating digital signatures, message authentication codes and the like. And encrypting the target data by using the obtained key to generate encrypted data.
Optionally, a set of ciphertext encoded data blocks is generated based on the encrypted data. The encrypted data is sliced into a first number of encrypted data blocks to generate a set of encrypted data blocks. The coding matrix is generated using the following equation:
G=[In×n;Bm×n],
where n is a first number, I is a unit diagonal matrix, and I includes n rows and n columns. B is a Van der Mond matrix, and B comprises m rows and n columns. And m is n + and is a redundant bit value and can be any integer. And multiplying the encrypted data block set by using the coding matrix G to generate a ciphertext coding data block set.
And inputting the ciphertext coding data block set into a hash function to generate a hash value of the target data. The execution main body encrypts the input target data through the hash function and the password hash function to generate the encrypted data and the hash value of the target data, which is an invention point of the embodiment of the disclosure, so that the technical problem mentioned in the background art, namely, the safety and the confidentiality of the target data are solved. For the obtained target data, firstly, the target data is input into a hash function to obtain process data, and then the process data is input into a password hash function to obtain a secret key. The target data is encrypted using the key to obtain encrypted data. Different from the traditional method, the key used in the encryption process is obtained by processing a hash function and a password hash function, and the key is also the result of encryption processing, so that the reliability of data encryption is improved. And continuing encoding processing on the encrypted data to obtain a ciphertext encoded data block set. And inputting the ciphertext coding data block set into a hash function to generate a hash value of the target data. In a decentralized storage environment based on a block chain, a secret key is generated by an encryption means and target data are encrypted, and a hash value is generated by the encrypted data after being encoded and used for verifying data correctness, so that redundant storage of the encrypted data can be realized, and the reliability of target data storage is improved. The storage safety of the target data is guaranteed, and the stored data cannot be tampered, damaged or invalidated, so that the storage invalidation problem in the decentralized storage based on the block chain is solved.
Step 203, a public key and a private key are generated.
In some embodiments, the execution principal generates a public key and a private key. The execution body calculates modulo N using the following equation:
N=p×q,
wherein p and q are randomly generated prime numbers, p and q are not equal, and N represents a modulus. The execution main body determines the corresponding terminal identification. And inputting the terminal identification and the target data into a pseudorandom algorithm, and determining the obtained output as a public key.
Optionally, the executing entity generates the private key based on the public key by using the following formula
e×d=1(mod N),
Wherein d represents a private key, e is a public key, N is a modulus calculated in the process of generating the public key, mod is modulo processing, and the product of e and d satisfies the constraint that the modulus N is more than 1.
And step 204, generating a filter set based on the ciphertext coding data block set, the hash value and the private key.
In some embodiments, the execution body generates a random number. And for each ciphertext coding data block in the ciphertext coding data block set, based on the random number, the hash value and the private key, executing the following step one, and generating a filter of the ciphertext coding data block to obtain a filter set.
The method comprises the following steps: and a filter for generating the ciphertext coding data block.
First, based on the hash value, a data digest of the ciphertext coding data block is determined using the following equation:
y=xd mod N,
where d represents a private key, x represents a hash value, xdRepresenting the hash value raised to the power of d. N is the modulus calculated in the process of generating the public key, and mod is the modulus processing. y represents a data digest of the ciphertext coding data block.
And secondly, generating a process hash value by using the following formula based on the random number and the data abstract of the ciphertext coding data block:
Figure BDA0002660825980000091
wherein, R represents a random number, | | | is an arithmetic or operational character,
Figure BDA0002660825980000092
a data digest representing the ciphertext encoded data block.
Figure BDA0002660825980000093
And U represents the ciphertext coding data block. i represents the ciphertext coding data block count, and the current ciphertext coding data block count is the ith. U shapeiRepresenting the ciphertext coded data block, UiFor the ith ciphertext coding data block, H () is a hash function,
Figure BDA0002660825980000094
representing a process hash value.
Thirdly, based on the private key and the process hash value, calculating a filter of the ciphertext coding data block by using the following formula:
Figure BDA0002660825980000095
wherein d is the private key, N is the modulus used to generate the public key,
Figure BDA0002660825980000096
a process hash value is represented by a hash value of the process,
Figure BDA0002660825980000097
is composed of
Figure BDA0002660825980000098
To the d-th power of. mod denotes the modulo process. U denotes the ciphertext encoded data block, and i denotes the ciphertext encoded data block count. U shapeiRepresenting the ith ciphertext encoded data block,
Figure BDA0002660825980000099
a filter representing the ciphertext encoded data block.
The storage unit is determined using the smart contract based on the filter set and the public key, step 205.
In some embodiments, the execution agent writes the filter set and the public key to the smart contract. An intelligent contract is a set of commitments defined in digital form. The intelligent contract can control data in the block chain and appoint the rights and obligations of each participating terminal in the block chain. The smart contracts may be automatically executed by the computer system. In particular, the intelligent contract includes intelligent contract code, instances, and execution data. The intelligent contract code may be the source code of the intelligent contract. The intelligent contract code may be a piece of code that the computer system is capable of executing. An instance may be an actual service in a blockchain running an intelligent contract. The execution data may be data that remains in the blockchain after execution of an instance.
Optionally, the intelligent contracts are published in a blockchain. The issued intelligent contract includes the intelligent contract code, the instance, and the execution data. According to the intelligent contract, a storage unit is determined. And operating the intelligent contract codes, and determining the storage unit according to the code operation result. In particular, the intelligent contract code may be a bid code. All potential storage units in the block chain invoke a bid code to participate in the bid. And determining the potential storage unit with the lowest final bid as the storage unit.
The execution subject writes the filter set and the public key into the intelligent contract and issues the filter set and the public key in the blockchain as an invention point of the embodiment of the disclosure, thereby solving the technical problem two mentioned in the background art, that is, the filter set is used as the key content in the intelligent contract to effectively hide the target data information written in the blockchain. And generating a filter set of the ciphertext coding data block by using the private key and the hash value, wherein the filter set hides the target data information and does not expose the target data. The storage capacity of the filter set is far smaller than that of the original data, and the workload of storing and inquiring the filter set is far smaller than that of processing the target data or the encrypted data. The filter set and the public key are written into the intelligent contract, the constructed intelligent contract can hide and protect data information, and meanwhile the working efficiency of storage and query in the shared storage is improved. And issuing the intelligent contract in a block chain, operating an intelligent contract code, and determining a storage unit according to a code operation result. Even if the amount of data to be stored is large and the intelligent contract information is large, the intelligent contract only comprises a filter set, so that the processing efficiency is high, and the problem of storage and query delay can be avoided. By issuing an intelligent contract only containing a filter set, the problem of low efficiency can be solved in the processing process of finding reasonable storage nodes to store data and the like.
Step 205, sending the ciphertext coding data block set to the determined storage unit.
In some embodiments, the execution body sends the set of ciphertext encoded data blocks to the determined storage unit. The storage unit stores the ciphertext coding data block set. For each ciphertext coding data block of the set of ciphertext coding data blocks, generating an index for the ciphertext coding data block using:
Indexi=H(H(Ui)||0,k),
where U represents the ciphertext encoded data block and i represents the ciphertext encoded data block count. U shapeiRepresenting the ith ciphertext coded data block, H (U)i) A hash value representing the ith ciphertext coding data block. k is a randomly generated 256-bit random number. And | | l is an OR operator, and H () is a hash function. Index denotes the Index, IndexiAn index representing the ciphertext coded data block. IndexiIs the index of the ith ciphertext coding data block.
And calculating the index of each ciphertext coding data block in the ciphertext coding data block set to obtain an index set of the ciphertext coding data block set. And storing the ciphertext coding data block set and the index set in the storage unit.
One embodiment presented in fig. 2 has the following beneficial effects: and the target data is encrypted to generate a ciphertext coding data block set, so that the confidentiality and the safety of the stored data are ensured. And generating a filter set based on the ciphertext coding data block set, the hash value and the private key, and writing the filter set into the intelligent contract. And realizing block chain shared storage of the ciphertext coding data block set by using an intelligent contract. The embodiment of the disclosure processes the input target data through the hash function and the password hash function to obtain the encryption key. The target data is subjected to encryption processing using the encryption key to generate encrypted data. And finally, coding the encrypted data to obtain a ciphertext coding data block set and generating a hash value of the target data. Meanwhile, the ciphertext coding data block set and the hash value are stored, so that the damage of data tampering, stealing and the like in a decentralized storage environment can be resisted, the data storage safety is ensured, and the data failure is avoided. And generating a filter set by using the ciphertext coding data block set, the hash value and the private key, and writing the filter set into the intelligent contract. The filter set hides the target data information and does not expose the target data. The storage capacity of the filter set is far smaller than that of the original data, and the workload of storing and inquiring the filter set is far smaller than that of processing the target data or the encrypted data. By issuing an intelligent contract only containing a filter set, the problem of low efficiency can be solved in the processing process of finding reasonable storage nodes to store data and the like.
With continued reference to fig. 3, a schematic diagram of one application scenario of a blockchain-based data sharing storage method according to the present disclosure is shown.
In the application scenario of fig. 3, the user sends target data 301 to be stored to the server. After receiving the target data, the server encrypts the target data and generates a public key, a private key, and a filter set 302. The server writes the filter set and private key to the smart contract in the blockchain and determines the storage unit 303. And sending the ciphertext coding data block set to the determined storage unit to finish the shared storage 304 based on the block chain.
According to the data sharing storage method based on the block chain, firstly, target data are encrypted and encoded, and a ciphertext encoding data block is generated to guarantee the safety of the data. And generating a filter set based on the ciphertext coding data block, the private key and the hash value. The filter set is published in the block chain, so that the data information published in the block chain is effectively hidden, and privacy protection is realized.
Referring now to FIG. 4, a block diagram of a computer system 400 suitable for use in implementing a server of an embodiment of the present disclosure is shown. The server shown in fig. 4 is only an example, and should not bring any limitation to the function and the scope of use of the embodiments of the present disclosure.
As shown in fig. 4, the computer system 400 includes a Central Processing Unit (CPU)401 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the system 400 are also stored. The CPU 401, ROM 402, and RAM 403 are connected to each other via a bus 404. An Input/Output (I/O) interface 405 is also connected to the bus 404.
The following components are connected to the I/O interface 405: a storage section 406 including a hard disk and the like; and a communication section 407 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 407 performs communication processing via a network such as the internet. A drive 408 is also connected to the I/O interface 405 as needed. A removable medium 409 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted as necessary on the drive 408, so that a computer program read out therefrom is mounted as necessary in the storage section 406.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 407 and/or installed from the removable medium 409. The above-described functions defined in the method of the present disclosure are performed when the computer program is executed by a Central Processing Unit (CPU) 401. It should be noted that the computer readable medium in the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer-readable signal medium may include a propagated data signal with computer-readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the C language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is possible without departing from the inventive concept as defined above. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Claims (8)

1. A data sharing storage method based on a block chain comprises the following steps:
receiving target data to be stored sent by a target user;
encrypting the target data to generate a ciphertext coding data block set and a hash value;
generating a public key and a private key;
generating a set of filters based on the set of ciphertext encoding data blocks, the hash value, and the private key;
determining a storage unit using an intelligent contract based on the filter set and the public key;
and sending the ciphertext coding data block set to the determined storage unit, wherein the storage unit stores the ciphertext coding data block set.
2. The method of claim 1, wherein the encrypting the target data to generate a set of ciphertext encoded data blocks and a hash value comprises:
inputting the target data into a hash function to generate process data;
inputting the process data into a password hash function to generate a secret key;
encrypting the target data by using the key to generate encrypted data;
generating the set of ciphertext encoded data blocks based on the encrypted data;
and inputting the ciphertext coding data block set into a hash function to generate a hash value of the target data.
3. The method of claim 2, wherein the generating the set of ciphertext encoded data blocks based on the encrypted data comprises:
dividing the encrypted data into a first number of encrypted data blocks to generate an encrypted data block set;
generating a coding matrix G ═ In×n;Bm×n]Where n is a first number, I is a unit diagonal matrix, I includes n rows and n columns, B is a van der mond matrix, B includes m rows and n columns, and m ═ n +, which is a redundant bit value, can be any integer;
and multiplying the encrypted data block set by using the coding matrix G to generate the ciphertext coding data block set.
4. The method of claim 3, wherein the generating a set of filters based on the set of ciphertext encoded data blocks, the hash value, and the private key comprises:
generating a random number;
and for each ciphertext coding data block in the ciphertext coding data block set, generating a filter of the ciphertext coding data block based on the random number, the hash value and the private key to obtain the filter set.
5. The method of claim 4, wherein generating the filter of the ciphertext encoded data block based on the random number, the hash value, and the private key comprises:
determining a data summary of the ciphertext coding data block based on the hash value;
generating a process hash value based on the random number and the data digest of the ciphertext encoded data block using:
Figure FDA0002660825970000021
wherein R represents the random number, | | | is an arithmetic or operational character,
Figure FDA0002660825970000022
a data digest representing the ciphertext encoded data block,
Figure FDA0002660825970000023
a data summary for the ith ciphertext coding data block, U represents the ciphertext coding data block, i represents a ciphertext coding data block count, UiRepresenting the ciphertext coded data block, UiFor the ith ciphertext coding data block, H () is a hash function,
Figure FDA0002660825970000024
representing the process hash value;
calculating a filter for the ciphertext encoded data block based on the private key and the process hash value using:
Figure FDA0002660825970000025
wherein d is the private key, N is the public key,
Figure FDA0002660825970000026
represents the hash value of the process and the hash value,
Figure FDA0002660825970000027
is composed of
Figure FDA0002660825970000028
Mod represents the modulo process, U represents the ciphertext encoded data block, i represents the ciphertext encoded data block count, U represents the number of ciphertext encoded data blocksiRepresenting the ith ciphertext encoded data block,
Figure FDA0002660825970000029
a filter representing the ciphertext encoded data block.
6. The method of any of claims 1-5, wherein the determining a storage location using an intelligent contract based on the set of filters and the public key comprises:
writing the filter set and the public key to an intelligent contract;
issuing the intelligent contracts in a blockchain;
and determining the storage unit according to the intelligent contract.
7. A first terminal device comprising:
one or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
8. A computer-readable storage medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-6.
CN202010904224.0A 2020-09-01 2020-09-01 Data sharing storage method based on block chain, terminal equipment and storage medium Withdrawn CN111950030A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010904224.0A CN111950030A (en) 2020-09-01 2020-09-01 Data sharing storage method based on block chain, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010904224.0A CN111950030A (en) 2020-09-01 2020-09-01 Data sharing storage method based on block chain, terminal equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111950030A true CN111950030A (en) 2020-11-17

Family

ID=73367786

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010904224.0A Withdrawn CN111950030A (en) 2020-09-01 2020-09-01 Data sharing storage method based on block chain, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111950030A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112488577A (en) * 2020-12-17 2021-03-12 多点(深圳)数字科技有限公司 Information generation method and device, electronic equipment and computer readable medium
CN112565448A (en) * 2020-12-16 2021-03-26 宁波云麟信息科技有限公司 Block chain-based electronic evidence storage node selection method and electronic equipment
CN112632571A (en) * 2020-12-04 2021-04-09 翰顺联电子科技(南京)有限公司 Data encryption method, data decryption device and storage device
CN112732835A (en) * 2021-01-12 2021-04-30 宁波云麟信息科技有限公司 Block chain-based heterogeneous data storage method and electronic equipment
CN112925853A (en) * 2021-03-08 2021-06-08 宁波金狮科技有限公司 Trusted data exchange method and device based on block chain, terminal equipment and medium
CN113378214A (en) * 2021-05-20 2021-09-10 广西飞创信息科技有限公司 Continuous data protection method and device based on block chain technology
CN114726543A (en) * 2022-04-12 2022-07-08 北京信息科技大学 Message chain construction and key chain generation, message sending and receiving methods and devices
CN114785525A (en) * 2022-05-12 2022-07-22 深圳壹账通科技服务有限公司 Blacklist library generation method, apparatus, device and storage medium

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112632571A (en) * 2020-12-04 2021-04-09 翰顺联电子科技(南京)有限公司 Data encryption method, data decryption device and storage device
CN112632571B (en) * 2020-12-04 2024-04-09 翰顺联电子科技(南京)有限公司 Data encryption method, data decryption device and storage device
CN112565448A (en) * 2020-12-16 2021-03-26 宁波云麟信息科技有限公司 Block chain-based electronic evidence storage node selection method and electronic equipment
CN112488577A (en) * 2020-12-17 2021-03-12 多点(深圳)数字科技有限公司 Information generation method and device, electronic equipment and computer readable medium
CN112732835A (en) * 2021-01-12 2021-04-30 宁波云麟信息科技有限公司 Block chain-based heterogeneous data storage method and electronic equipment
CN112925853A (en) * 2021-03-08 2021-06-08 宁波金狮科技有限公司 Trusted data exchange method and device based on block chain, terminal equipment and medium
CN112925853B (en) * 2021-03-08 2022-08-02 山东审核通信息科技有限公司 Trusted data exchange method and device based on block chain, terminal equipment and medium
CN113378214A (en) * 2021-05-20 2021-09-10 广西飞创信息科技有限公司 Continuous data protection method and device based on block chain technology
CN113378214B (en) * 2021-05-20 2022-03-08 广西飞创信息科技有限公司 Continuous data protection method and device based on block chain technology
CN114726543A (en) * 2022-04-12 2022-07-08 北京信息科技大学 Message chain construction and key chain generation, message sending and receiving methods and devices
CN114726543B (en) * 2022-04-12 2023-07-18 北京信息科技大学 Key chain generation and message sending and receiving methods and devices based on message chain
CN114785525A (en) * 2022-05-12 2022-07-22 深圳壹账通科技服务有限公司 Blacklist library generation method, apparatus, device and storage medium

Similar Documents

Publication Publication Date Title
CN111950030A (en) Data sharing storage method based on block chain, terminal equipment and storage medium
CN107248984B (en) Data exchange system, method and device
CN112182644A (en) Data processing method and device and electronic equipment
CN109660534B (en) Multi-merchant-based security authentication method and device, electronic equipment and storage medium
CN111047314A (en) Financial data processing method and system based on block chain
CN112182109A (en) Distributed data coding storage method based on block chain and electronic equipment
CN111611621A (en) Block chain based distributed data encryption storage method and electronic equipment
CN112541775A (en) Transaction tracing method based on block chain, electronic device and computer storage medium
CN111950032A (en) Block chain-based data storage method, terminal device and storage medium
CN114760052A (en) Bank Internet of things platform key generation method and device, electronic equipment and medium
CN111563268B (en) Data encryption method and device based on matrix operation and storage medium
Krishnamoorthy et al. Implementation and management of cloud security for industry 4. O-data using hybrid elliptical curve cryptography
CN111291420B (en) Distributed off-link data storage method based on block chain
CN112182108A (en) Block chain based distributed data storage updating method and electronic equipment
CN111798236A (en) Transaction data encryption and decryption method, device and equipment
CN115085934A (en) Contract management method based on block chain and combined key and related equipment
CN112181308A (en) Block chain based distributed data storage method and electronic equipment
CN111931231A (en) Redundant storage method, terminal device and storage medium for distributed system
CN111931204A (en) Encryption and de-duplication storage method and terminal equipment for distributed system
CN114615087A (en) Data sharing method, device, equipment and medium
Liu et al. Video data integrity verification method based on full homomorphic encryption in cloud system
CN113626848A (en) Sample data generation method and device, electronic equipment and computer readable medium
CN111355584B (en) Method and apparatus for generating blockchain multi-signatures
CN111949738A (en) Block chain-based data storage deduplication method, terminal device and storage medium
CN113762958A (en) Method and device for generating electronic certificate

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20201117

WW01 Invention patent application withdrawn after publication