CN112100144A - Block chain file sharing method and device, storage medium and electronic equipment - Google Patents

Block chain file sharing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN112100144A
CN112100144A CN202010845699.7A CN202010845699A CN112100144A CN 112100144 A CN112100144 A CN 112100144A CN 202010845699 A CN202010845699 A CN 202010845699A CN 112100144 A CN112100144 A CN 112100144A
Authority
CN
China
Prior art keywords
file
receiver
source file
key
identity verification
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
CN202010845699.7A
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.)
Shandong Neusoft System Integration Co ltd
Neusoft Corp
Original Assignee
Shandong Neusoft System Integration Co ltd
Neusoft Corp
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 Shandong Neusoft System Integration Co ltd, Neusoft Corp filed Critical Shandong Neusoft System Integration Co ltd
Priority to CN202010845699.7A priority Critical patent/CN112100144A/en
Publication of CN112100144A publication Critical patent/CN112100144A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/176Support for shared access to files; File sharing support
    • 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
    • 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
    • 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 disclosure relates to a block chain file sharing method, a block chain file sharing device, a storage medium and an electronic device, wherein when the method is applied to a file sender, the method comprises the following steps: encrypting the source file according to a target encryption mode; segmenting the encrypted source file to obtain at least one segmented file; uploading the segmentation file to a block chain network for storage; the split file comprises an identity verification sequence generated based on an encryption key, and the identity verification sequence is used for a file receiver to verify whether the received file is the split file, and the encryption key is a key used by the target encryption mode. In the above scheme, since the file uploaded to the block chain is encrypted, except for the designated file receiver, other block chain link points cannot acquire detailed information of the file, so that authority management of the file on the chain is realized.

Description

Block chain file sharing method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a method and an apparatus for sharing blockchain files, a storage medium, and an electronic device.
Background
Blockchains are a technique that can collectively maintain a reliable database through decentralization and distrust. The method can store transactions occurring in a period of time by taking the blocks as units, and connect the blocks according to time sequence by using a cryptographic algorithm to form a data structure similar to a chain. The block chain technology has the characteristics of distributed accounts, decentralization, non-falsification and the like, and has a relatively high application prospect in many aspects.
In a related scenario, sharing of files between block chain nodes may be performed based on a block chain network. However, since the distributed ledger has to guarantee verifiability for all nodes, the ledger needs to be disclosed for all nodes, which makes file authority management difficult.
Disclosure of Invention
The present disclosure is directed to a method, an apparatus, a storage medium, and an electronic device for sharing a blockchain file, so as to solve the above related technical problems.
In order to achieve the above object, according to a first aspect of the embodiments of the present disclosure, there is provided a block chain file sharing method applied to a file sender, the method including:
encrypting the source file according to a target encryption mode;
segmenting the encrypted source file to obtain at least one segmented file;
uploading the segmentation file to a block chain network for storage;
the split file comprises an identity verification sequence generated based on an encryption key, and the identity verification sequence is used for a file receiver to verify whether the received file is the split file, and the encryption key is a key used by the target encryption mode.
Optionally, the file receiver is any node in the blockchain network, and encrypting the source file according to a target encryption manner includes:
encrypting the source file according to the public key of the file receiver; and the number of the first and second electrodes,
and taking the hash value of the public key of the file receiver as the identity verification sequence.
Optionally, the file receiver is any node that satisfies a file receiving condition and is determined by the blockchain network based on an intelligent contract, and encrypting the source file according to a target encryption manner includes:
encrypting the source file based on a first random number;
and taking the hash value of the first random number as the authentication sequence.
According to a second aspect of the embodiments of the present disclosure, there is provided a method for sharing a blockchain file, which is applied to a file receiver, the method including:
obtaining at least one candidate file corresponding to a source file to be received through a blockchain network;
verifying the identity verification sequence included by the candidate file, and determining a segmented file according to a verification result; the authentication sequence is generated based on an encryption key, the encryption key is used by a file sender for encrypting the source file in a target encryption mode, and the split file is obtained by splitting the encrypted source file;
recombining the divided files to obtain the encrypted source file;
and decrypting the encrypted source file according to a decryption mode corresponding to the target encryption mode to obtain the source file.
Optionally, the file receiver is any node in the block chain network, the verifying the identity verification sequence included in the candidate file, and determining the split file according to the verification result includes:
verifying the identity verification sequence of the candidate file according to the public key of the file receiver;
taking the candidate file which is successfully verified as the segmentation file;
the decrypting the encrypted source file according to the decryption mode corresponding to the target encryption mode includes:
and decrypting the encrypted source file according to the private key of the file receiver.
Optionally, the file receiver is any node that satisfies the file receiving condition and is determined by the blockchain network based on an intelligent contract, and the method further includes:
receiving a decryption message issued by an intelligent contract, wherein the decryption message is generated in response to the file receiver meeting the intelligent contract condition;
acquiring a first random number used for encrypting the source file by the file sender according to the decryption message;
the verification of the identity verification sequence included in the candidate file comprises
Verifying the identity verification sequence of the candidate file according to the first random number;
taking the candidate file which is successfully verified as the segmentation file;
the decrypting the encrypted source file according to the decryption mode corresponding to the target encryption mode includes:
and decrypting the encrypted source file according to the first random number.
Optionally, the block chain network is a federation chain supporting private data, the decryption message is obtained by encrypting the first random number according to a public key of the file receiver, and accordingly, obtaining the first random number used by the file sender to encrypt the source file according to the decryption message includes:
and decrypting the decrypted message according to the private key of the file receiver to obtain the first random number.
Optionally, the block chain network is a public chain or a federation chain that does not support private data, the decryption message is obtained by encrypting a second random number according to a public key of the file receiver, and accordingly, obtaining a first random number used by the file sender to encrypt the source file according to the decryption message includes:
decrypting the decrypted message according to the private key of the file receiver to obtain the second random number;
and logging in a key storage device by taking the decryption message as a user name and the second random number as a password, and acquiring the first random number from the key storage device, wherein the key storage device is not a node of the blockchain network.
According to a third aspect of the embodiments of the present disclosure, there is provided a block chain file sharing apparatus, including:
the encryption module is used for encrypting the source file according to the target encryption mode;
the file segmentation module is used for segmenting the encrypted source file to obtain at least one segmented file;
the uploading module is used for uploading the segmentation files to a block chain network for storage;
the split file comprises an identity verification sequence generated based on an encryption key, and the identity verification sequence is used for a file receiver to verify whether the received file is the split file, and the encryption key is a key used by the target encryption mode.
Optionally, the file receiver is any node in the blockchain network, and the encryption module includes:
the first encryption submodule is used for encrypting the source file according to the public key of the file receiver;
and the first execution submodule is used for taking the hash value of the public key of the file receiver as the identity verification sequence.
Optionally, the file receiver is any node that satisfies a file receiving condition and is determined by the blockchain network based on an intelligent contract, and the encryption module includes:
a second encryption submodule for encrypting the source file based on the first random number;
and the second execution submodule is used for taking the hash value of the first random number as the authentication sequence.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a blockchain file sharing apparatus, including:
a first obtaining module, configured to obtain at least one candidate file corresponding to a source file to be received through a blockchain network;
the verification module is used for verifying the identity verification sequence included by the candidate file and determining the divided file according to the verification result; the authentication sequence is generated based on an encryption key, the encryption key is used by a file sender for encrypting the source file in a target encryption mode, and the split file is obtained by splitting the encrypted source file;
the recombination module is used for recombining the segmented files to obtain the encrypted source file;
and the decryption module is used for decrypting the encrypted source file according to a decryption mode corresponding to the target encryption mode to obtain the source file.
Optionally, the file receiver is any node in the blockchain network, and the verification module includes:
the first verification submodule is used for verifying the identity verification sequence of the candidate file according to the public key of the file receiver;
a third execution sub-module, configured to use the successfully verified candidate file as the split file;
the decryption module includes:
and the first decryption submodule is used for decrypting the encrypted source file according to the private key of the file receiver.
Optionally, the file receiver is any node that satisfies the file receiving condition and is determined by the blockchain network based on an intelligent contract, and the apparatus further includes:
the receiving module is used for receiving a decryption message issued by the intelligent contract, and the decryption message is generated in response to the file receiving party meeting the intelligent contract condition;
a second obtaining module, configured to obtain, according to the decryption message, a first random number used by the file sender to encrypt the source file;
the verification module comprises:
the second verification submodule is used for verifying the identity verification sequence of the candidate file according to the first random number;
the fourth execution sub-module is used for taking the candidate file which is successfully verified as the segmentation file;
the decryption module includes:
and the second decryption submodule is used for decrypting the encrypted source file according to the first random number.
Optionally, the blockchain network is a federation chain supporting private data, the decryption message is obtained by encrypting the first random number according to a public key of the file receiver, and accordingly, the second obtaining module includes:
and the third decryption submodule is used for decrypting the decrypted message according to the private key of the file receiver to obtain the first random number.
Optionally, the blockchain network is a public chain or a federation chain that does not support private data, the decryption message is obtained by encrypting a second random number according to a public key of the file receiver, and accordingly, the second obtaining module includes:
the fourth decryption submodule is used for decrypting the decrypted message according to the private key of the file receiving party to obtain the second random number;
and the obtaining sub-module is used for logging in a key storage device by taking the decryption message as a user name and the second random number as a password, and obtaining the first random number from the key storage device, wherein the key storage device is not a node of the blockchain network.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, performs the steps of the method of any one of the above-mentioned first aspects.
According to a sixth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of the method of any one of the above second aspects.
According to a seventh aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of any of the first aspects above.
According to an eighth aspect of embodiments of the present disclosure, there is provided an electronic apparatus including:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of any of the second aspects above.
The technical scheme at least comprises the following beneficial effects:
before uploading a source file to be shared to a block chain, a file sender can encrypt and divide the source file to obtain at least one divided file, so that the limitation of the file uploading size of the block chain is met. In addition, because the file uploaded to the block chain is encrypted, other block chain link points except for the designated file receiver cannot acquire detailed information of the file, so that authority management of the file on the chain is realized. In addition, because the divided files also comprise the identity verification sequence, a file receiver can determine whether the divided files belong to the source file to be acquired through the identity verification sequence, and other nodes cannot know the file receiver, so that the concealment of the sharing process is ensured.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
FIG. 1 is a schematic diagram of a file partition shown in an exemplary embodiment of the present disclosure.
Fig. 2 is a flowchart illustrating a method for sharing blockchain files according to an exemplary embodiment of the disclosure.
Fig. 3 is a flowchart illustrating a method for sharing blockchain files according to an exemplary embodiment of the disclosure.
Fig. 4 is a block diagram of a blockchain file sharing apparatus according to an exemplary embodiment of the disclosure.
Fig. 5 is a block diagram of a blockchain file sharing apparatus according to an exemplary embodiment of the disclosure.
FIG. 6 is a block diagram of an electronic device shown in an exemplary embodiment of the present disclosure.
Fig. 7 is a block diagram of an electronic device shown in an exemplary embodiment of the present disclosure.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
Before introducing the blockchain file sharing method, apparatus, storage medium, and electronic device provided by the present disclosure, an application scenario and related terms of embodiments of the present disclosure are first introduced. The block chain is a decentralized distributed database system which is jointly maintained by all nodes in a block chain network and consists of a series of data blocks generated based on a cryptography method, wherein each data block is one block in the block chain. The blocks are linked together in order according to the chronological order of the generation times, forming a chain of data, which is referred to visually as a chain of blocks.
In a related scenario, sharing of files between block chain nodes may be performed based on a block chain network. Generally, various types of data of the block chain may be stored in the block in the form of transaction records, so the size of the transaction records should not exceed the block size. Thus, referring to the schematic diagram of one type of file splitting shown in FIG. 1, a source file may be split when its size exceeds a threshold. As shown in fig. 1, a source file may be divided into a plurality of divided files of length a, with the last remaining portion b as another divided file.
For these split files, the distributed ledger needs to be made verifiable for all nodes, so the ledger needs to be made public for all nodes. That is to say, each node in the block chain network can acquire each of the split files, which makes file authority management difficult. In addition, since the block chain network is different from a conventional structured storage manner in file storage, each block may include a plurality of files named the same in the process of sharing and acquiring the files, which further increases the difficulty of file management.
To this end, the present disclosure provides a blockchain file sharing method, which may be applied to a file sender with reference to a flowchart of the blockchain file sharing method shown in fig. 2, and the method includes:
s21, encrypting the source file according to the target encryption mode;
s22, dividing the encrypted source file to obtain at least one divided file;
and S23, uploading the segmentation file to a block chain network for storage.
Specifically, the file sender may be, for example, a blockchain node that stores all or part of the block data. When embodied, it may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone, wearable computing device (e.g., smart watch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer, a server, and so forth.
In S21, the file sender may determine the corresponding target encryption scheme according to the information of the file receiver.
For example, in some implementation scenarios, when the file receiver is a node in the blockchain network, the public key of the file receiver may be used to encrypt the source file, so as to implement file sharing for the specific node in the blockchain network.
In other embodiments, the file receiver may also be a plurality of node devices in the blockchain network. In this case, corresponding smart contracts may be generated from the plurality of node devices and stored in the blockchain network, so that each of the file recipients can obtain an encryption key through the smart contract, thereby implementing file sharing for the plurality of nodes in the blockchain network.
For the encryption key, in some embodiments, the encryption key may be a first random number generated randomly, and the file sender may encrypt the source file based on the first random number to obtain an encrypted source file.
For example, the first random number may be obtained by a linear congruence method based on a 64-bit system as follows. The basic recursion formula of the linear congruence method is as follows:
Xn+1=(aXn+c)mod m
the constraint conditions of the parameters in the above recursion formula are:
Figure BDA0002642980970000091
the recursive analytic formula of the linear congruence method is as follows:
Figure BDA0002642980970000092
wherein u isiIs a linear congruence period. Thus, the recursive approach of the linear congruence method can be obtained by adopting a mixed congruence method:
Figure BDA0002642980970000093
specifically, in the above formula, a is a multiplier, c is an increment, and m is a modulus. The above formula is a sum congruence method when a is 0, a multiplier congruence method when c is 0, and a hybrid congruence method when c is not 0. In the case of generating random numbers with better uniformity and randomness, the selection of multipliers, increments and moduli in the above formula may include multiple ones, for example, a mixed congruence method of m ═ 2k may be adopted.
Further, the maximum period of the linear congruence method is m, but may be smaller than m in general. In order to maximize the period, the relevant parameters in the above formula may satisfy the following condition:
(1) c and m are coprime;
(2) the product of all prime factors of m can divide a-1;
(3) if m is a multiple of 4, a-1 is also a multiple of 4;
(4) a, c, x0 (initial value, generally seed) are all less than m;
(5) a and c are positive integers.
When the correlation parameter satisfies the above condition, the maximum period of the linear congruency method is 2 of the period of the linear congruency method of 32 bits32And (4) doubling. The parameters 17745895947410025 and 152399025 may be derived recursively from 32-bit pseudo-random numbers under the constraints of the above conditions.
Thereby, the first random number may be acquired based on the linear congruence method. Because the linear congruence method is based on a 64-bit system, the numerical range of random numbers can be larger, and meanwhile, the generation randomness of the random numbers can be improved, so that the safety is improved.
In step S22, the encrypted source file may be divided into at least one divided file. For the file splitting process, in some embodiments, the file may be split based on a preset file size; in other embodiments, for different types of the original file, the original file may also be segmented based on a preset data line, so as to obtain at least one segmented file, which is not limited in this disclosure.
It is worth mentioning that the split file may further include an authentication sequence generated based on an encryption key, so that a file receiver can verify whether the received file is the split file. The encryption key is a key used in the target encryption manner, and with the above example, when the file receiver is any node in the blockchain network, the hash value of the public key of the node may be used as the authentication sequence. In this way, the file receiver may obtain the corresponding public key hash value by performing hash operation on the own public key, so as to determine whether the split file is the split file corresponding to the source file to be acquired by comparing with the authentication sequence in the split file.
Correspondingly, when the file receiver is any node which is determined by the blockchain network based on an intelligent contract and meets the file receiving condition, the hash value of the first random number may be used as the authentication sequence. In this way, the file receiver may obtain the corresponding key hash value by performing hash operation on the obtained encryption key (i.e., the first random number), so that whether the split file is the split file corresponding to the source file to be obtained may be determined by comparing the split file with the authentication sequence in the split file.
It is noted that a block in a blockchain network may include a plurality of files with the same name. Therefore, for the file receiving party, it may also obtain a plurality of files with the same name when querying the file, which further causes difficulty in the file receiving party to quickly determine the required file from the plurality of files with the same name, and reduces the efficiency of file obtaining. By adopting the technical scheme, the divided files also comprise the identity verification sequence, so that the file receiver can verify the identity verification sequence to determine whether the divided files are the divided files corresponding to the source files to be acquired, and the file acquisition efficiency can be improved. In addition, by adopting the mode, other nodes cannot know the receiver of the file, so that the concealment of the sharing process can be ensured.
In some possible embodiments, in the case that a plurality of divided files are obtained, a hash value of each of the divided files may be calculated, and a packet hash table corresponding to the encrypted source file may be generated according to an order of the divided files.
For example, the structure of the split file can be as shown in table 1:
Figure BDA0002642980970000111
TABLE 1
Wherein the source file name can be used for file receiver retrieval; the hash value of the source file can be used for verifying the integrity of the obtained file after the file receiver recombines and decrypts the plurality of divided files; the hash value of the split file can be used for a file receiver to verify the correctness of the split file; the number of divided files determines the length of a packet hash table in which information of each divided file obtained by dividing the source file is described and the order of each divided file when each divided file is reassembled. The encryption means may include public transmission, private transmission, and intelligent contract transmission, etc. The public transmission authentication sequence may be null, the private transmission authentication sequence may be a public key hash value of the file receiver, and the contract transmission authentication sequence is a hash value of the first random number. By adopting the technical scheme, after any one of the divided files is confirmed through the identity verification sequence, each divided file corresponding to the source file can be obtained according to the packet hash table in the divided file, so that the file obtaining efficiency is further improved.
For the process of obtaining the hash value, in one possible way, the hash value of the corresponding file may be determined by the following modified SHA-256 algorithm. The modified SHA-256 algorithm is as follows:
for block MiI 1, …, N, the following cycles of steps 1) and 2) may be performed:
1) prepare the message column Wt
Figure BDA0002642980970000121
Wt=Wt-40Wt-91+Wt-12+Wt-16(16≤t≤79)
Wherein, M is an encryption block, and W is a ciphertext word in the encryption process. It is noted that in the SHA-256 algorithm of the present embodiment, the encryption parameters are promoted from 64 to 80 of the relevant SHA-256 algorithms. Therefore, in the above formula, by changing the iteration order of W and the value range of t, the SHA-256 algorithm of the present embodiment can be applied to the case of 80 encryption parameters.
2) Initializing working variables:
Figure BDA0002642980970000122
Figure BDA0002642980970000123
wherein, A-H are 8 working variables with the length of 32 bits;
Figure BDA0002642980970000124
and representing the hash value obtained by the iteration of the previous round. Wherein the initial values of A-H are:
A=0xd507ab93,B=0x12634b05,C=0x223175bf,D=0x750c7ac5,E=0x76ba5d34,F=0x84dec1fd,G=0x7bac06a4,=0xc17bf162。
since the number of encryption parameters increases to 80, the following transformation can be performed for t 0 to 79:
Figure BDA0002642980970000125
the modified SHA-256 algorithm includes six logic functions, where each logic function may operate on 32-bit words (e.g., x, y, z), with the result of each function being a new 32-bit word. Wherein the logic function is defined as follows:
Figure BDA0002642980970000131
Figure BDA0002642980970000132
Figure BDA0002642980970000133
Figure BDA0002642980970000134
the applicant finds that for the SHA-256 algorithm, the risk of table lookup cracking is increased along with the increase of the use scenes, so that in the improved SHA-256 algorithm, K is usedtA constant sequence comprising 80 32 bits can be defined as follows:
6a09e667 bb67ae85 3c6ef372 a54ff53a
510e527f 9b05688c 1f83d9ab 5be0cd19
428a2f98 71374491b5c0fbcf e9b5dba5
3956c25b 59f111f1 923f82a4 ab1c5ed5
d807aa98 12835b01 243185be 550c7dc3
72be5d74 80deb1fe 9bdc06a7 c19bf174
e49b69c1 efbe4786 0fc19dc6 240ca1cc
2de92c6f 4a7484aa 5cb0a9dc 76f988da
983e5152 a831c66d b00327c8 bf597fc7
c6e00bf3 d5a79147 06ca6351 14292967
27b70a85 2e1b2138 4d2c6dfc 53380d13
650a7354 766a0abb 81c2c92e 92722c85
a2bfe8a1 a81a664b c24b8b70 c76c51a3
d192e819 d6990624f40e3585 106aa070
19a4c116 1e376c08 2748774c 34b0bcb5
391c0cb3 4ed8aa4a 5b9cca4f 682e6ff3
748f82ee 78a5636f 84c87814 8cc70208
90befffa a4506ceb bef9a3f7 c67178f2
328a3f95 61375461a5c0fbef f9b5dca7
2953c25e 59f211f3 623f82a6 ad1c5ed4
for the encryption parameter, the obtaining method of the encryption parameter may be, for example, taking the first 32 bits of the fractional part of the square root of the prime number. In the encryption parameters, prime numbers selected by the initialization encryption parameters and the iterative encryption parameters are replaced and mixed.
By adopting the technical scheme, the unidirectional, nonlinear, pseudo-random, anti-collision and avalanche effects in the hash calculation process can be enhanced, the cracking difficulty is reduced, and the encryption safety is improved.
In step S23, the file sender may broadcast each of the split files as a transaction message into the blockchain network after generating the split files, so that the split files can be saved in the blockchain.
By adopting the technical scheme, before uploading the source file to be shared to the block chain, the file sender can encrypt and divide the source file to obtain at least one divided file so as to meet the size limit of the uploaded file of the block chain. In addition, because the file uploaded to the block chain is encrypted, other block chain link points except for the designated file receiver cannot acquire detailed information of the file, so that authority management of the file on the chain is realized. In addition, because the divided files also comprise the identity verification sequence, a file receiver can determine whether the divided files belong to the source file to be acquired through the identity verification sequence, and other nodes cannot know the file receiver, so that the concealment of the sharing process is ensured.
Fig. 3 is a flowchart of a blockchain file sharing method according to an exemplary embodiment of the present disclosure, where the method may be applied to a file receiver described in the foregoing embodiment, and the method includes:
s31, obtaining at least one candidate file corresponding to the source file to be received through the block chain network;
s32, verifying the identity verification sequence included in the candidate file, and determining the divided file according to the verification result; the authentication sequence is generated based on an encryption key, the encryption key is used by a file sender for encrypting the source file in a target encryption mode, and the split file is obtained by splitting the encrypted source file;
s33, recombining the divided files to obtain the encrypted source file;
s34, decrypting the encrypted source file according to the decryption mode corresponding to the target encryption mode to obtain the source file.
Specifically, the file receiver may be, for example, a blockchain node that stores all or part of the tile data. When embodied, it may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone, wearable computing device (e.g., smart watch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer, a server, and so forth.
In S31, the file receiver may retrieve, for example, the file name of the file to be acquired in the blockchain network, so as to acquire at least one candidate file corresponding to the source file to be received. It should be understood that a block in a blockchain network may include multiple files of the same name. Therefore, it is also possible for the file receiver to acquire a plurality of files of the same name when inquiring about the file.
Thus, in S32, the authentication sequence included in the candidate file may be verified, and the divided file may be determined according to the verification result. The authentication sequence is generated based on an encryption key, the encryption key is used by a file sender to encrypt the source file in a target encryption mode, and the split file is obtained by splitting the encrypted source file.
For example, in a case that the encryption key is a public key of a file receiver, if the file receiver successfully verifies the identity in the candidate file through its own public key, the divided file may be determined to be a divided file corresponding to the source file to be acquired.
In S33, after determining a split file from the candidate files, the split file may be reassembled to obtain the encrypted source file; further, in step S34, the encrypted source file may be decrypted according to a decryption method corresponding to the target encryption method, so as to obtain the source file.
By adopting the technical scheme, when the file is acquired, the file receiver can quickly determine the divided file from the acquired multiple candidate files through the identity verification sequence, so that the acquisition efficiency of the file can be improved.
In one possible implementation, the file receiver may be any node in the blockchain network, in which case the source file may be encrypted, for example, according to the public key of the file receiver.
For the public key and the private key corresponding to the public key, in some embodiments, the key pair may be obtained as follows.
Firstly, the relevant parameters of the key pair acquisition process are explained, and the parameters include:
finite field FgComprising g elements. Wherein the parameters α, β are elements in the finite field and α, β are prime numbers. The elliptic curve over the finite field is E: y is2=x3+αx+βy,4α3+27β2Not equal to 0. F on EgThe number of rational points of (a) can be divided evenly by a large prime number n. A base point G with a base point order of n is selected for E. The parameter is D ═ Fg,α,β,G,n)。
In this way, the key pair may be generated by:
(1) randomly selecting an integer d from [1, n-1 ];
(2) calculating a public key Q ═ dG;
(3) a key pair (d, Q) is generated, where Q is the public key and d is the private key.
The source file may be encrypted according to the public key of the file receiver by:
(1) inputting the selected parameter D ═ (F)gα, β, G, n) and invokes the SHA-256 algorithm in the above embodiment;
(2) generating a pseudo-random number integer k satisfying 1 ≦ k ≦ n-1 using an improved linear congruence method;
(3) calculating kG ═ x, y, making r ═ x mod n, and if the calculated r ═ 0, returning to step (2);
(4) calculating e-SHA-256 (m xor r);
(5) calculating s ═ (k-r-eQ) mod n using the public keys Q and r, and if s ═ 0, returning to step (2);
(6) the file sender issues the encryption result (r, s) for the source file m into the blockchain.
In the encryption mode, the base point is multiplied by the pseudo random number with good randomness, so that the randomness of the selection of the elliptic curve base point is increased and the value range is expanded on the premise of keeping the property of the common elliptic curve base point, thereby providing better security for the encryption algorithm.
Thus, the verifying the identity verification sequence included in the candidate file and determining the segmented file according to the verification result includes:
verifying the identity verification sequence of the candidate file according to the public key of the file receiver;
and taking the candidate file which is successfully verified as the segmentation file.
For example, the file receiver may perform hash calculation on its own public key to obtain a hash value of its own public key. And comparing the hash value with the identity verification sequence of the candidate file, and when the hash value is the same as the identity verification sequence of the candidate file, indicating that the candidate file is the split file corresponding to the source file.
In this case, the decrypting the encrypted source file according to the decryption method corresponding to the target encryption method includes:
and decrypting the encrypted source file according to the private key of the file receiver.
Following an embodiment of the above encryption process, the decryption process may include:
(1) after the file receiving party obtains the encrypted source file, the file receiving party can use a private key d of the file receiving party and call an improved hash function SHA-256;
(2) calculating e-SHA-256 (m xor r);
(3) calculating i ═ r + s) mod n, and j ═ e mod n;
(4) calculating X ═ iG + jQ ═ (X ', y'), if X ═ 0, then the signature is determined to be invalid, otherwise, the next verification can be performed;
(5) calculate r '═ x' mod n. When r' is r, the correct decryption result is obtained.
By adopting the technical scheme, the file receiver can determine the split file corresponding to the source file to be acquired in a mode of verifying the candidate file through the public key, and the encrypted source file is obtained through recombination based on the split file. Finally, the encrypted source file can be decrypted through a private key of the block chain, the source file needing to be acquired is obtained, and file sharing among the designated nodes in the block chain is achieved.
In another possible embodiment, the file receiver is any node that satisfies the file receiving condition and is determined by the blockchain network based on an intelligent contract, and the method further includes:
receiving a decryption message issued by an intelligent contract, wherein the decryption message is generated in response to the file receiver meeting the intelligent contract condition;
and acquiring a first random number used for encrypting the source file by the file sender according to the decryption message.
An intelligent contract is a computer protocol intended to propagate, validate or execute contracts in an informational manner. It allows trusted transactions to be conducted without third parties, and these transactions are traceable and irreversible. When the intelligent contract runs on the block chain, the whole process can be guaranteed to be transparent and can not be tampered, and meanwhile, the influence of a centralized mechanism can be avoided, so that the intelligent contract can be operated efficiently.
That is to say, after the file sender generates an intelligent contract according to the information of the file receiver and uploads the intelligent contract to the block chain, the file receiver meeting the intelligent contract condition can obtain the first random number for encrypting the source file through the intelligent contract.
For example, in one possible implementation, the blockchain network is a federation chain supporting private data. In this case, the encrypting the first random number according to the public key of the file receiver by the decryption message, and accordingly, the obtaining the first random number used for encrypting the source file by the file sender according to the decryption message includes:
and decrypting the decrypted message according to the private key of the file receiver to obtain the first random number.
For example, it is a matter of course of practical applicationThe intelligent contract may generate and issue a decryption message g (a) according to the public key of the file receiver and the first random number a when it is determined that the file receiver satisfies the intelligent contract condition. Thus, after the file receiver acquires the decryption message G (A), G can be performed according to the private key of the file receiver-1(G (A)) operating to obtain the first random number A, and further decrypting the encrypted source file according to the random number A to obtain the source file.
In another possible implementation, the blockchain network is a public chain or a federation chain that does not support private data, in which case the decryption message is obtained by encrypting a second random number according to a public key of the file receiver, and accordingly, obtaining a first random number used by the file sender to encrypt the source file according to the decryption message includes:
and logging in a key storage device by taking the decryption message as a user name and the second random number as a password, and acquiring the first random number from the key storage device, wherein the key storage device is not a node of the blockchain network.
For example, the key storage device may be, for example, a notarization device or a node device in a relay chain, and the first random number a may be stored in the key storage device in advance. For example, a corresponding query directory may be generated according to the hash value of the source file and the first random number, so that a file receiver may perform a query after meeting a corresponding condition.
For the intelligent contract, the intelligent contract may generate and issue a decryption message g (B) according to the public key of the file receiver and the randomly generated second random number B, when it is determined that the file receiver satisfies the intelligent contract condition. In addition, the smart contract may further send a decryption message g (B) generated and issued by the second random number B to a key storage device so that the key storage device can generate a corresponding account and password information according to the decryption message g (B) and the second random number B. In this way, the file section can decrypt the decryption message g (B) according to its own private key to obtain a second random number B, and the decryption message is used as a user name, and the second random number is used as a password to log in the key storage device, and the first random number is obtained from the key storage device.
In this way, the file receiving party can verify the identity verification sequence of the candidate file according to the first random number, so that the candidate file which is successfully verified is used as the divided file, and the encrypted source file is decrypted according to the first random number to obtain the source file.
According to the technical scheme, the file can be shared to the designated node in the block chain by combining the intelligent contract, and the authority management function is realized in the block chain file sharing process.
The present disclosure also provides a blockchain file sharing apparatus, which may be used for a file sender in the foregoing embodiments, and referring to a block diagram of a blockchain file sharing apparatus shown in fig. 4, the apparatus 400 includes:
the encryption module 401 is configured to encrypt the source file according to a target encryption manner;
a file dividing module 402, configured to divide the encrypted source file to obtain at least one divided file;
an uploading module 403, configured to upload the split file to a block chain network for storage; the split file comprises an identity verification sequence generated based on an encryption key, and the identity verification sequence is used for a file receiver to verify whether the received file is the split file, and the encryption key is a key used by the target encryption mode.
Optionally, the file receiver is any node in the blockchain network, and the encryption module 401 includes:
the first encryption submodule is used for encrypting the source file according to the public key of the file receiver; and the first execution submodule is used for taking the hash value of the public key of the file receiver as the identity verification sequence.
Optionally, the file receiver is any node that satisfies a file receiving condition and is determined by the blockchain network based on an intelligent contract, where the encryption module 401 includes:
a second encryption submodule for encrypting the source file based on the first random number; and the second execution submodule is used for taking the hash value of the first random number as the authentication sequence.
By adopting the technical scheme, before uploading the source file to be shared to the block chain, the file sender can encrypt and divide the source file to obtain at least one divided file so as to meet the size limit of the uploaded file of the block chain. In addition, because the file uploaded to the block chain is encrypted, other block chain link points except for the designated file receiver cannot acquire detailed information of the file, so that authority management of the file on the chain is realized. In addition, because the divided files also comprise the identity verification sequence, a file receiver can determine whether the divided files belong to the source file to be acquired through the identity verification sequence, and other nodes cannot know the file receiver, so that the concealment of the sharing process is ensured.
The present disclosure also provides a blockchain file sharing apparatus, which may be used for a file receiver in the foregoing embodiments, and referring to a block diagram of a blockchain file sharing apparatus shown in fig. 5, the apparatus 500 includes:
a first obtaining module 501, configured to obtain at least one candidate file corresponding to a source file to be received through a blockchain network; a verification module 502, configured to verify an identity verification sequence included in the candidate file, and determine a split file according to a verification result; the authentication sequence is generated based on an encryption key, the encryption key is used by a file sender for encrypting the source file in a target encryption mode, and the split file is obtained by splitting the encrypted source file; a restructuring module 503, configured to restructure the split file to obtain the encrypted source file; a decryption module 504, configured to decrypt the encrypted source file according to a decryption manner corresponding to the target encryption manner, so as to obtain the source file.
By adopting the technical scheme, when the file is acquired, the file receiver can quickly determine the divided file from the acquired multiple candidate files through the identity verification sequence, so that the acquisition efficiency of the file can be improved.
Optionally, the file receiver is any node in the blockchain network, and the verification module 502 includes:
the first verification submodule is used for verifying the identity verification sequence of the candidate file according to the public key of the file receiver; a third execution sub-module, configured to use the successfully verified candidate file as the split file; the decryption module 504 includes: and the first decryption submodule is used for decrypting the encrypted source file according to the private key of the file receiver.
Optionally, the file receiver is any node that satisfies the file receiving condition and is determined by the blockchain network based on an intelligent contract, and the apparatus 500 further includes:
the receiving module is used for receiving a decryption message issued by the intelligent contract, and the decryption message is generated in response to the file receiving party meeting the intelligent contract condition; a second obtaining module, configured to obtain, according to the decryption message, a first random number used by the file sender to encrypt the source file; the verification module 502 includes: the second verification submodule is used for verifying the identity verification sequence of the candidate file according to the first random number; the fourth execution sub-module is used for taking the candidate file which is successfully verified as the segmentation file; the decryption module 504 includes: and the second decryption submodule is used for decrypting the encrypted source file according to the first random number.
Optionally, the blockchain network is a federation chain supporting private data, the decryption message is obtained by encrypting the first random number according to a public key of the file receiver, and accordingly, the second obtaining module includes:
and the third decryption submodule is used for decrypting the decrypted message according to the private key of the file receiver to obtain the first random number.
Optionally, the blockchain network is a public chain or a federation chain that does not support private data, the decryption message is obtained by encrypting a second random number according to a public key of the file receiver, and accordingly, the second obtaining module includes:
the fourth decryption submodule is used for decrypting the decrypted message according to the private key of the file receiving party to obtain the second random number; and the obtaining sub-module is used for logging in a key storage device by taking the decryption message as a user name and the second random number as a password, and obtaining the first random number from the key storage device, wherein the key storage device is not a node of the blockchain network.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
It should be noted that, in the foregoing embodiment, the method for sharing a blockchain file is described by taking the file sender and the file receiver as nodes in the blockchain network as an example. However, those skilled in the art will appreciate that the file sender and the file receiver may not be nodes in a blockchain network when implemented. For example, the file sender may also publish the file to the blockchain network by communicating with a node in the blockchain network, which is not limited in this disclosure.
The present disclosure also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method for a file sender in the above-described blockchain file sharing method.
The present disclosure also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method for a file recipient in the above-described blockchain file sharing method.
The present disclosure also provides an electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method for the file sender in the above block chain file sharing method.
The present disclosure also provides an electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method for the file recipient in the above blockchain file sharing method.
Fig. 6 is a block diagram illustrating an electronic device 600 according to an example embodiment. As shown in fig. 6, the electronic device 600 may include: a processor 601 and a memory 602. The electronic device 600 may also include one or more of a multimedia component 603, an input/output (I/O) interface 604, and a communications component 605.
The processor 601 is configured to control the overall operation of the electronic device 600 to complete all or part of the steps in the method for the file sender in the above block chain file sharing method. The memory 602 is used to store various types of data to support operation at the electronic device 600, such as instructions for any application or method operating on the electronic device 600 and application-related data, such as files to be shared, messages sent and received, pictures, audio, video, and so forth. The Memory 602 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. The multimedia components 603 may include a screen and audio components. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 602 or transmitted through the communication component 605. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 604 provides an interface between the processor 601 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 605 is used for wired or wireless communication between the electronic device 600 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, which is not limited herein. The corresponding communication component 605 may therefore include: Wi-Fi module, Bluetooth module, NFC module, etc.
In an exemplary embodiment, the electronic Device 600 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the method for the file sender in the above-described block chain file sharing method.
In another exemplary embodiment, there is also provided a computer readable storage medium including program instructions which, when executed by a processor, implement the steps of the method for a file sender in the above-described blockchain file sharing method. For example, the computer readable storage medium may be the memory 602 including program instructions executable by the processor 601 of the electronic device 600 to perform the method for the file sender in the above-described blockchain file sharing method.
Fig. 7 is a block diagram illustrating an electronic device 700 in accordance with an example embodiment. As shown in fig. 7, the electronic device 700 may include: a processor 701 and a memory 702. The electronic device 700 may also include one or more of a multimedia component 703, an input/output (I/O) interface 704, and a communication component 705.
The processor 701 is configured to control the overall operation of the electronic device 700, so as to complete all or part of the steps in the method for the file recipient in the above block chain file sharing method. The memory 702 is used to store various types of data to support operation at the electronic device 700, such as instructions for any application or method operating on the electronic device 700 and application-related data, such as received files, transmitted and received messages, pictures, audio, video, and the like. The Memory 702 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk. The multimedia components 703 may include screen and audio components. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 702 or received through the communication component 705. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 704 provides an interface between the processor 701 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, which is not limited herein. The corresponding communication component 705 may thus include: Wi-Fi module, Bluetooth module, NFC module, etc.
In an exemplary embodiment, the electronic Device 700 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the method for the file recipient in the above-described block chain file sharing method.
In another exemplary embodiment, there is also provided a computer readable storage medium including program instructions which, when executed by a processor, implement the steps of the method for a file recipient in the above-described blockchain file sharing method. For example, the computer readable storage medium may be the memory 702 described above comprising program instructions executable by the processor 701 of the electronic device 700 to perform the method for the file recipient in the blockchain file sharing method described above.
In another exemplary embodiment, a computer program product is also provided, which comprises a computer program executable by a programmable apparatus, the computer program having code portions for performing the method for a file sender in the above-mentioned block chain file sharing method when executed by the programmable apparatus.
In another exemplary embodiment, a computer program product is also provided, which comprises a computer program executable by a programmable apparatus, the computer program having code portions for performing the method for a file recipient in the above-mentioned blockchain file sharing method when executed by the programmable apparatus.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that, in the foregoing embodiments, various features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various combinations that are possible in the present disclosure are not described again.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.

Claims (10)

1. A block chain file sharing method is applied to a file sender, and comprises the following steps:
encrypting the source file according to a target encryption mode;
segmenting the encrypted source file to obtain at least one segmented file;
uploading the segmentation file to a block chain network for storage;
the split file comprises an identity verification sequence generated based on an encryption key, and the identity verification sequence is used for a file receiver to verify whether the received file is the split file, and the encryption key is a key used by the target encryption mode.
2. The method according to claim 1, wherein the file receiver is any node in the blockchain network, and the encrypting the source file according to the target encryption mode comprises:
encrypting the source file according to the public key of the file receiver; and the number of the first and second electrodes,
and taking the hash value of the public key of the file receiver as the identity verification sequence.
3. The method according to claim 1, wherein the file receiver is any node that satisfies a file receiving condition determined by the blockchain network based on an intelligent contract, and the encrypting the source file according to the target encryption mode includes:
encrypting the source file based on a first random number;
and taking the hash value of the first random number as the authentication sequence.
4. A method for sharing a blockchain file is applied to a file receiver, and comprises the following steps:
obtaining at least one candidate file corresponding to a source file to be received through a blockchain network;
verifying the identity verification sequence included by the candidate file, and determining a segmented file according to a verification result; the authentication sequence is generated based on an encryption key, the encryption key is used by a file sender for encrypting the source file in a target encryption mode, and the split file is obtained by splitting the encrypted source file;
recombining the divided files to obtain the encrypted source file;
and decrypting the encrypted source file according to a decryption mode corresponding to the target encryption mode to obtain the source file.
5. The method according to claim 4, wherein the file receiver is any node in the blockchain network, and the verifying the authentication sequence included in the candidate file and determining the split file according to the verification result comprise:
verifying the identity verification sequence of the candidate file according to the public key of the file receiver;
taking the candidate file which is successfully verified as the segmentation file;
the decrypting the encrypted source file according to the decryption mode corresponding to the target encryption mode includes:
and decrypting the encrypted source file according to the private key of the file receiver.
6. The method of claim 4, wherein the file receiver is any node of the blockchain network that meets a file receiving condition determined based on an intelligent contract, and wherein the method further comprises:
receiving a decryption message issued by an intelligent contract, wherein the decryption message is generated in response to the file receiver meeting the intelligent contract condition;
acquiring a first random number used for encrypting the source file by the file sender according to the decryption message;
the verification of the identity verification sequence included in the candidate file comprises
Verifying the identity verification sequence of the candidate file according to the first random number;
taking the candidate file which is successfully verified as the segmentation file;
the decrypting the encrypted source file according to the decryption mode corresponding to the target encryption mode includes:
and decrypting the encrypted source file according to the first random number.
7. A blockchain file sharing apparatus, comprising:
the encryption module is used for encrypting the source file according to the target encryption mode;
the file segmentation module is used for segmenting the encrypted source file to obtain at least one segmented file;
the uploading module is used for uploading the segmentation files to a block chain network for storage;
the split file comprises an identity verification sequence generated based on an encryption key, and the identity verification sequence is used for a file receiver to verify whether the received file is the split file, and the encryption key is a key used by the target encryption mode.
8. A blockchain file sharing apparatus, comprising:
a first obtaining module, configured to obtain at least one candidate file corresponding to a source file to be received through a blockchain network;
the verification module is used for verifying the identity verification sequence included by the candidate file and determining the divided file according to the verification result; the authentication sequence is generated based on an encryption key, the encryption key is used by a file sender for encrypting the source file in a target encryption mode, and the split file is obtained by splitting the encrypted source file;
the recombination module is used for recombining the segmented files to obtain the encrypted source file;
and the decryption module is used for decrypting the encrypted source file according to a decryption mode corresponding to the target encryption mode to obtain the source file.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 3; alternatively, the program is adapted to carry out the steps of the method of any of claims 4-6 when executed by a processor.
10. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to carry out the steps of the method of any one of claims 1 to 3; or the processor is adapted to execute the computer program in the memory to implement the steps of the method of any of claims 4-6.
CN202010845699.7A 2020-08-20 2020-08-20 Block chain file sharing method and device, storage medium and electronic equipment Pending CN112100144A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010845699.7A CN112100144A (en) 2020-08-20 2020-08-20 Block chain file sharing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010845699.7A CN112100144A (en) 2020-08-20 2020-08-20 Block chain file sharing method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN112100144A true CN112100144A (en) 2020-12-18

Family

ID=73753314

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010845699.7A Pending CN112100144A (en) 2020-08-20 2020-08-20 Block chain file sharing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112100144A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112668053A (en) * 2021-01-05 2021-04-16 上海能链众合科技有限公司 Encryption method based on pseudo-random public key for block chain
CN114710359A (en) * 2022-04-15 2022-07-05 辽宁工控科技有限公司 Industrial network dynamic key management method and industrial network encryption communication method
CN116594972A (en) * 2023-07-17 2023-08-15 国网江苏省电力有限公司信息通信分公司 File encryption sharing method and device

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170048235A1 (en) * 2015-07-14 2017-02-16 Fmr Llc Crypto Captcha and Social Aggregating, Fractionally Efficient Transfer Guidance, Conditional Triggered Transaction, Datastructures, Apparatuses, Methods and Systems
CN107612934A (en) * 2017-10-24 2018-01-19 济南浪潮高新科技投资发展有限公司 A kind of block chain mobile terminal computing system and method based on Secret splitting
CN109345386A (en) * 2018-08-31 2019-02-15 阿里巴巴集团控股有限公司 Transaction common recognition processing method and processing device, electronic equipment based on block chain
CN109583219A (en) * 2018-11-30 2019-04-05 国家电网有限公司 A kind of data signature, encryption and preservation method, apparatus and equipment
CN109886040A (en) * 2019-01-24 2019-06-14 北京融链科技有限公司 Data processing method, device, storage medium and processor
CN109918925A (en) * 2019-02-19 2019-06-21 上海泉坤信息科技有限公司 Date storage method, back end and storage medium
CN110061968A (en) * 2019-03-15 2019-07-26 广东工程职业技术学院 A kind of file encryption-decryption method based on block chain, system and storage medium
CN110163007A (en) * 2019-04-23 2019-08-23 西安邮电大学 Data integrity verification method, equipment and storage medium based on block chain
KR102083757B1 (en) * 2019-05-17 2020-03-02 김성완 Node device constituting a block-chain network and an operation method of the node device
CN111355705A (en) * 2020-02-08 2020-06-30 西安电子科技大学 Data auditing and safety duplicate removal cloud storage system and method based on block chain
CN111432403A (en) * 2020-03-14 2020-07-17 广东洪心电子商务科技股份有限公司 Data auditing method and device based on block chain

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170048235A1 (en) * 2015-07-14 2017-02-16 Fmr Llc Crypto Captcha and Social Aggregating, Fractionally Efficient Transfer Guidance, Conditional Triggered Transaction, Datastructures, Apparatuses, Methods and Systems
CN107612934A (en) * 2017-10-24 2018-01-19 济南浪潮高新科技投资发展有限公司 A kind of block chain mobile terminal computing system and method based on Secret splitting
CN109345386A (en) * 2018-08-31 2019-02-15 阿里巴巴集团控股有限公司 Transaction common recognition processing method and processing device, electronic equipment based on block chain
CN109583219A (en) * 2018-11-30 2019-04-05 国家电网有限公司 A kind of data signature, encryption and preservation method, apparatus and equipment
CN109886040A (en) * 2019-01-24 2019-06-14 北京融链科技有限公司 Data processing method, device, storage medium and processor
CN109918925A (en) * 2019-02-19 2019-06-21 上海泉坤信息科技有限公司 Date storage method, back end and storage medium
CN110061968A (en) * 2019-03-15 2019-07-26 广东工程职业技术学院 A kind of file encryption-decryption method based on block chain, system and storage medium
CN110163007A (en) * 2019-04-23 2019-08-23 西安邮电大学 Data integrity verification method, equipment and storage medium based on block chain
KR102083757B1 (en) * 2019-05-17 2020-03-02 김성완 Node device constituting a block-chain network and an operation method of the node device
CN111355705A (en) * 2020-02-08 2020-06-30 西安电子科技大学 Data auditing and safety duplicate removal cloud storage system and method based on block chain
CN111432403A (en) * 2020-03-14 2020-07-17 广东洪心电子商务科技股份有限公司 Data auditing method and device based on block chain

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
周艺华;李洪明;: "基于区块链的数据管理方案", 信息安全研究, no. 01 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112668053A (en) * 2021-01-05 2021-04-16 上海能链众合科技有限公司 Encryption method based on pseudo-random public key for block chain
CN114710359A (en) * 2022-04-15 2022-07-05 辽宁工控科技有限公司 Industrial network dynamic key management method and industrial network encryption communication method
CN114710359B (en) * 2022-04-15 2024-02-06 沈阳邦粹科技有限公司 Industrial network dynamic key management method and industrial network encryption communication method
CN116594972A (en) * 2023-07-17 2023-08-15 国网江苏省电力有限公司信息通信分公司 File encryption sharing method and device
CN116594972B (en) * 2023-07-17 2023-10-24 国网江苏省电力有限公司信息通信分公司 File encryption sharing method and device

Similar Documents

Publication Publication Date Title
US9973334B2 (en) Homomorphically-created symmetric key
US20050271207A1 (en) Method and system for chaotic digital signature, encryption, and authentication
US10880100B2 (en) Apparatus and method for certificate enrollment
CN112100144A (en) Block chain file sharing method and device, storage medium and electronic equipment
CN112822255B (en) Block chain-based mail processing method, mail sending end, receiving end and equipment
CN113711564A (en) Computer-implemented method and system for encrypting data
WO2020084418A1 (en) Computer implemented system and method for distributing shares of digitally signed data
CN112865957A (en) Data encryption transmission method and device, computer target equipment and storage medium
CN115804061A (en) Generating a shared private key
US11177950B2 (en) Key generation for use in secured communication
CN111294203A (en) Information transmission method
WO2021098152A1 (en) Blockchain-based data processing method, device, and computer apparatus
Abdel-Kader et al. Efficient two-stage cryptography scheme for secure distributed data storage in cloud computing.
Chakraborty et al. Enhanced public auditability & secure data storage in cloud computing
Homoliak et al. An air-gapped 2-factor authentication for smart-contract wallets
Cairns et al. Flexible data authentication evaluated for the smart grid
CN117795901A (en) Generating digital signature shares
CN111488618B (en) Block chain-based one-time pad encryption method, device and storage medium
KR102282788B1 (en) Blockchain system for supporting change of plain text data included in transaction
KR101026647B1 (en) Communication security system and method of the same with key derivation cryptographic algorithm
CN111885056A (en) Zero knowledge proving method and device based on block chain and electronic equipment
Brisson Deterministic random number generation for one time pads: Creating a Whitenoise super key
CN116866029B (en) Random number encryption data transmission method, device, computer equipment and storage medium
US20220103355A1 (en) Method and system for key generation
Bene et al. Post-Quantum Security Overview of the Public Key Infrastructure

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